From 16a3e4a463c8c7ab76068fd0bc61d32cd5a2eb40 Mon Sep 17 00:00:00 2001 From: jassmith Date: Wed, 13 Mar 2024 18:34:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20a57ed?= =?UTF-8?q?a16cee8abd08b697b3bda5c5e347b8c40b6=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...=> 01-getting-started.stories-pReBqtRc.js} | 2 +- ...js => 02-editing-data.stories-BQj7fCeJ.js} | 2 +- ....js => 03-grid-column.stories-M9wjl6_S.js} | 2 +- ... => 04-streaming-data.stories-vLZm8kin.js} | 2 +- ...1YrTI.js => 06-search.stories-HT4OBHAI.js} | 2 +- ...=> 07-column-grouping.stories-5voO87Gi.js} | 2 +- ...rufF.js => 08-theming.stories-2t9RmZTv.js} | 2 +- ...uUaNJ-.js => 09-menus.stories-e6AvaNtK.js} | 2 +- ...E4Gn.js => add-column.stories-_EqbBQr_.js} | 2 +- ...=> add-data-to-middle.stories-tQw-dOJ-.js} | 2 +- ...js => add-data-to-top.stories-Y48s8jn2.js} | 2 +- ...lkRdaQ.js => add-data.stories-E0FdRGvU.js} | 4 +- ....js => all-cell-kinds.stories--ALeAPbB.js} | 2 +- ... => append-row-handle.stories-rOWS4lXQ.js} | 2 +- ...automatic-row-markers.stories-DpSDMBm4.js} | 2 +- ...js => built-in-search.stories-mWtMZkcZ.js} | 2 +- ... cell-activated-event.stories-koZ0slRi.js} | 2 +- ...s-4eUYRTdX.js => cell.stories-_g0ubFdV.js} | 2 +- ...column-group-collapse.stories-n1L-OcXE.js} | 2 +- ...V.js => column-groups.stories-hfw5JFYP.js} | 2 +- ... => content-alignment.stories-xW0P0pcx.js} | 2 +- ... => controlled-search.stories-Wwgq4vZY.js} | 2 +- ... controlled-selection.stories-lniLWk35.js} | 2 +- ...s8.js => copy-support.stories-WvtcgNF-.js} | 2 +- ...> custom-header-icons.stories-UqnmJb04.js} | 2 +- ...6.js => custom-header.stories-WQ7yFD8e.js} | 2 +- docs/assets/data-editor-all-ZeeWpldS.js | 124 ++++++++++++++++ docs/assets/data-editor-all-fnGrkeU4.js | 135 ++++++++++++++++++ docs/assets/data-editor-all-kM-cjKZ5.js | 135 ------------------ docs/assets/data-editor-all-zTb9g2fv.js | 124 ---------------- ...=> data-editor-repros.stories-9nGWjuU7.js} | 2 +- ...uJ2.js => data-editor.stories-gYDN_QGF.js} | 2 +- ...s => data-grid-overlay-editor-XEAOWHGB.js} | 2 +- ...s => data-grid-overlay-editor-xe3yVD_U.js} | 2 +- ...bsBmC.js => data-grid.stories-sK45HGli.js} | 2 +- ...tsZ.js => drag-source.stories-aEzkiqBC.js} | 2 +- ...qK5.js => drop-events.stories-NILeIqbJ.js} | 2 +- ...Mzp.js => fill-handle.stories-eTGLgxP6.js} | 2 +- ....js => freeze-columns.stories-7zVe9neV.js} | 2 +- ...Ppp.js => freeze-rows.stories-89-Y26fw.js} | 2 +- ...AK.js => header-menus.stories-dRSmfSg8.js} | 2 +- ...js => highlight-cells.stories-5mGy7815.js} | 2 +- ...{iframe-0-Di66Z3.js => iframe-alOpk4ZG.js} | 4 +- ...fQX.js => image-window-loader-ggeJlWLo.js} | 16 +-- ... => imperative-scroll.stories-Yaxb7oEo.js} | 2 +- ....js => input-blending.stories-zezAtL-R.js} | 2 +- ...1zn.js => keybindings.stories-qU4VQLV1.js} | 2 +- ...=> layout-integration.stories-lu4Lde2T.js} | 2 +- ... multi-select-columns.stories-2oeztbOf.js} | 2 +- ... => new-column-button.stories-KCBl3BdD.js} | 2 +- ...C.js => obscured-grid.stories-Do_HI9sC.js} | 2 +- ...bserve-visible-region.stories-z9Laxci_.js} | 2 +- ...dred-thousand-columns.stories-H4KjbryM.js} | 2 +- ...s => one-million-rows.stories-p8UsVN67.js} | 2 +- ...9HSu.js => overscroll.stories-jctFGx74.js} | 2 +- ...Ya0-po6.js => padding.stories-YAYw5imX.js} | 2 +- ...B.js => paste-support.stories--aYIJkKr.js} | 2 +- ...event-diagonal-scroll.stories-1SfpzkSI.js} | 2 +- ...u.js => rapid-updates.stories-AEZyu2Ww.js} | 2 +- ... => rearrange-columns.stories-3_bNW4sh.js} | 2 +- ...LP.js => reorder-rows.stories-FwicXjYY.js} | 2 +- ... => resizable-columns.stories-Dibf-Amn.js} | 2 +- ...l.js => right-element.stories-m3yQrSTF.js} | 2 +- ...5.js => right-to-left.stories-uW6E-20L.js} | 2 +- ... row-and-header-sizes.stories-sNSldu-6.js} | 2 +- ...VK.js => row-grouping.stories-ONZORBKM.js} | 2 +- ...AgYiU.js => row-hover.stories-nRHuwzz4.js} | 2 +- ...6i9.js => row-markers.stories-wk8qKt8n.js} | 2 +- ...CR3.js => scaled-view.stories-1QjGLbTA.js} | 2 +- ...r.js => scroll-offset.stories-eyu0T1ZU.js} | 2 +- ....js => scroll-shadows.stories-hVBm2cZ6.js} | 2 +- ...UnF.js => scrolling-data-grid-wnX0bxop.js} | 2 +- ...> scrolling-data-grid.stories-hHj024-J.js} | 2 +- ...s => search-as-filter.stories-l3udCDZ_.js} | 2 +- ...s => server-side-data.stories-lxb0GRUD.js} | 2 +- ...tV5D.js => shadow-dom.stories-gOMw4cfa.js} | 2 +- ...r.js => silly-numbers.stories-pjTTVQ6Y.js} | 2 +- ...> small-editable-grid.stories-l1Vy5okC.js} | 2 +- ...smooth-scrolling-grid.stories-4dHWEWrt.js} | 2 +- ...hzNLk.js => span-cell.stories-WMdPvU3C.js} | 2 +- ...> stretch-column-size.stories-iOY1CWt9.js} | 2 +- ... => ten-million-cells.stories-uQH2qa2w.js} | 2 +- ...s => theme-per-column.stories-21oCUHRj.js} | 2 +- ...d.js => theme-per-row.stories-QYCshzOF.js} | 2 +- ...1.js => theme-support.stories-Tbsj0CEF.js} | 2 +- ...wf15EA.js => tooltips.stories-L9--bKUS.js} | 2 +- ... trailing-row-options.stories-JJNnNKur.js} | 2 +- ...h74.js => uneven-rows.stories-LG_7MDCI.js} | 2 +- ...js => use-data-source.stories-Fo8NpI-_.js} | 2 +- .../{utils-qU2KzddR.js => utils-MADpeXg5.js} | 2 +- ...F.js => validate-data.stories-AR2BMamQ.js} | 2 +- ...S.js => wrapping-text.stories-A-X6NF7r.js} | 2 +- docs/iframe.html | 2 +- docs/project.json | 2 +- 94 files changed, 358 insertions(+), 358 deletions(-) rename docs/assets/{01-getting-started.stories-I5lnvGfZ.js => 01-getting-started.stories-pReBqtRc.js} (98%) rename docs/assets/{02-editing-data.stories-Ybg3Js5e.js => 02-editing-data.stories-BQj7fCeJ.js} (98%) rename docs/assets/{03-grid-column.stories-P60uWubs.js => 03-grid-column.stories-M9wjl6_S.js} (96%) rename docs/assets/{04-streaming-data.stories-2jkbEPbR.js => 04-streaming-data.stories-vLZm8kin.js} (98%) rename docs/assets/{06-search.stories-_h21YrTI.js => 06-search.stories-HT4OBHAI.js} (97%) rename docs/assets/{07-column-grouping.stories-iIWli84A.js => 07-column-grouping.stories-5voO87Gi.js} (96%) rename docs/assets/{08-theming.stories-TO36rufF.js => 08-theming.stories-2t9RmZTv.js} (98%) rename docs/assets/{09-menus.stories-DHuUaNJ-.js => 09-menus.stories-e6AvaNtK.js} (98%) rename docs/assets/{add-column.stories-qJd3E4Gn.js => add-column.stories-_EqbBQr_.js} (76%) rename docs/assets/{add-data-to-middle.stories-bzixFsHE.js => add-data-to-middle.stories-tQw-dOJ-.js} (86%) rename docs/assets/{add-data-to-top.stories-VjNp9gVs.js => add-data-to-top.stories-Y48s8jn2.js} (87%) rename docs/assets/{add-data.stories-aXlkRdaQ.js => add-data.stories-E0FdRGvU.js} (50%) rename docs/assets/{all-cell-kinds.stories-fHIsKU4O.js => all-cell-kinds.stories--ALeAPbB.js} (78%) rename docs/assets/{append-row-handle.stories-mXWrYEJH.js => append-row-handle.stories-rOWS4lXQ.js} (88%) rename docs/assets/{automatic-row-markers.stories-ia88nBlQ.js => automatic-row-markers.stories-DpSDMBm4.js} (83%) rename docs/assets/{built-in-search.stories-6a9Si4Mh.js => built-in-search.stories-mWtMZkcZ.js} (88%) rename docs/assets/{cell-activated-event.stories-2uo3VD4n.js => cell-activated-event.stories-koZ0slRi.js} (89%) rename docs/assets/{cell.stories-4eUYRTdX.js => cell.stories-_g0ubFdV.js} (99%) rename docs/assets/{column-group-collapse.stories-mvtXkbjB.js => column-group-collapse.stories-n1L-OcXE.js} (85%) rename docs/assets/{column-groups.stories-KDyARjGV.js => column-groups.stories-hfw5JFYP.js} (78%) rename docs/assets/{content-alignment.stories-M5AzCjo1.js => content-alignment.stories-xW0P0pcx.js} (85%) rename docs/assets/{controlled-search.stories-1bZF0uVx.js => controlled-search.stories-Wwgq4vZY.js} (89%) rename docs/assets/{controlled-selection.stories-mNmRkBMo.js => controlled-selection.stories-lniLWk35.js} (93%) rename docs/assets/{copy-support.stories-5RB4fQs8.js => copy-support.stories-WvtcgNF-.js} (79%) rename docs/assets/{custom-header-icons.stories-TyvbcE1O.js => custom-header-icons.stories-UqnmJb04.js} (95%) rename docs/assets/{custom-header.stories-xcKX1MW6.js => custom-header.stories-WQ7yFD8e.js} (88%) create mode 100644 docs/assets/data-editor-all-ZeeWpldS.js create mode 100644 docs/assets/data-editor-all-fnGrkeU4.js delete mode 100644 docs/assets/data-editor-all-kM-cjKZ5.js delete mode 100644 docs/assets/data-editor-all-zTb9g2fv.js rename docs/assets/{data-editor-repros.stories-Exc9lGv1.js => data-editor-repros.stories-9nGWjuU7.js} (92%) rename docs/assets/{data-editor.stories-lLnDOuJ2.js => data-editor.stories-gYDN_QGF.js} (98%) rename docs/assets/{data-grid-overlay-editor-B2IrFVCJ.js => data-grid-overlay-editor-XEAOWHGB.js} (93%) rename docs/assets/{data-grid-overlay-editor-K62UQj4H.js => data-grid-overlay-editor-xe3yVD_U.js} (96%) rename docs/assets/{data-grid.stories-lpcbsBmC.js => data-grid.stories-sK45HGli.js} (99%) rename docs/assets/{drag-source.stories-mSx5ttsZ.js => drag-source.stories-aEzkiqBC.js} (81%) rename docs/assets/{drop-events.stories-8CKkmqK5.js => drop-events.stories-NILeIqbJ.js} (93%) rename docs/assets/{fill-handle.stories-X5hFdMzp.js => fill-handle.stories-eTGLgxP6.js} (88%) rename docs/assets/{freeze-columns.stories-B34272mh.js => freeze-columns.stories-7zVe9neV.js} (77%) rename docs/assets/{freeze-rows.stories-43HikPpp.js => freeze-rows.stories-89-Y26fw.js} (88%) rename docs/assets/{header-menus.stories-Y3C9yIAK.js => header-menus.stories-dRSmfSg8.js} (93%) rename docs/assets/{highlight-cells.stories-K9fd6qTU.js => highlight-cells.stories-5mGy7815.js} (87%) rename docs/assets/{iframe-0-Di66Z3.js => iframe-alOpk4ZG.js} (61%) rename docs/assets/{image-window-loader--5E_ifQX.js => image-window-loader-ggeJlWLo.js} (77%) rename docs/assets/{imperative-scroll.stories-oW8fncC4.js => imperative-scroll.stories-Yaxb7oEo.js} (88%) rename docs/assets/{input-blending.stories-7l7a8cEj.js => input-blending.stories-zezAtL-R.js} (89%) rename docs/assets/{keybindings.stories-n34M31zn.js => keybindings.stories-qU4VQLV1.js} (92%) rename docs/assets/{layout-integration.stories-oXBi69Mb.js => layout-integration.stories-lu4Lde2T.js} (82%) rename docs/assets/{multi-select-columns.stories-vgNzpHed.js => multi-select-columns.stories-2oeztbOf.js} (77%) rename docs/assets/{new-column-button.stories-_UjPFsep.js => new-column-button.stories-KCBl3BdD.js} (83%) rename docs/assets/{obscured-grid.stories-8VUfU7HC.js => obscured-grid.stories-Do_HI9sC.js} (85%) rename docs/assets/{observe-visible-region.stories-hggE4aBc.js => observe-visible-region.stories-z9Laxci_.js} (84%) rename docs/assets/{one-hundred-thousand-columns.stories-dDLvE0PG.js => one-hundred-thousand-columns.stories-H4KjbryM.js} (77%) rename docs/assets/{one-million-rows.stories-ztAARuLY.js => one-million-rows.stories-p8UsVN67.js} (77%) rename docs/assets/{overscroll.stories-hbmC9HSu.js => overscroll.stories-jctFGx74.js} (78%) rename docs/assets/{padding.stories-QYa0-po6.js => padding.stories-YAYw5imX.js} (78%) rename docs/assets/{paste-support.stories-RpELQuPB.js => paste-support.stories--aYIJkKr.js} (86%) rename docs/assets/{prevent-diagonal-scroll.stories-M-p0URcv.js => prevent-diagonal-scroll.stories-1SfpzkSI.js} (74%) rename docs/assets/{rapid-updates.stories-uoglvjgu.js => rapid-updates.stories-AEZyu2Ww.js} (92%) rename docs/assets/{rearrange-columns.stories-sF1dM7Mx.js => rearrange-columns.stories-3_bNW4sh.js} (88%) rename docs/assets/{reorder-rows.stories-O3M8AWLP.js => reorder-rows.stories-FwicXjYY.js} (87%) rename docs/assets/{resizable-columns.stories-XXhh_SVO.js => resizable-columns.stories-Dibf-Amn.js} (85%) rename docs/assets/{right-element.stories-NA-kKa_l.js => right-element.stories-m3yQrSTF.js} (90%) rename docs/assets/{right-to-left.stories-VyfcM2n5.js => right-to-left.stories-uW6E-20L.js} (88%) rename docs/assets/{row-and-header-sizes.stories-zl2epROy.js => row-and-header-sizes.stories-sNSldu-6.js} (78%) rename docs/assets/{row-grouping.stories-NeYCW-VK.js => row-grouping.stories-ONZORBKM.js} (93%) rename docs/assets/{row-hover.stories-4MjAgYiU.js => row-hover.stories-nRHuwzz4.js} (85%) rename docs/assets/{row-markers.stories-IsElw6i9.js => row-markers.stories-wk8qKt8n.js} (79%) rename docs/assets/{scaled-view.stories-8zeM-CR3.js => scaled-view.stories-1QjGLbTA.js} (73%) rename docs/assets/{scroll-offset.stories-Uz4w97or.js => scroll-offset.stories-eyu0T1ZU.js} (75%) rename docs/assets/{scroll-shadows.stories-jclChxEm.js => scroll-shadows.stories-hVBm2cZ6.js} (90%) rename docs/assets/{scrolling-data-grid-rB9VuUnF.js => scrolling-data-grid-wnX0bxop.js} (99%) rename docs/assets/{scrolling-data-grid.stories-BLD-s3DI.js => scrolling-data-grid.stories-hHj024-J.js} (96%) rename docs/assets/{search-as-filter.stories-rGOo9giK.js => search-as-filter.stories-l3udCDZ_.js} (90%) rename docs/assets/{server-side-data.stories-d_4a-drI.js => server-side-data.stories-lxb0GRUD.js} (93%) rename docs/assets/{shadow-dom.stories-7TXZtV5D.js => shadow-dom.stories-gOMw4cfa.js} (82%) rename docs/assets/{silly-numbers.stories-xhq3GNLr.js => silly-numbers.stories-pjTTVQ6Y.js} (78%) rename docs/assets/{small-editable-grid.stories-1GHfUE3O.js => small-editable-grid.stories-l1Vy5okC.js} (78%) rename docs/assets/{smooth-scrolling-grid.stories-DSIsyYN3.js => smooth-scrolling-grid.stories-4dHWEWrt.js} (77%) rename docs/assets/{span-cell.stories-tX8hzNLk.js => span-cell.stories-WMdPvU3C.js} (89%) rename docs/assets/{stretch-column-size.stories-je-gWdg3.js => stretch-column-size.stories-iOY1CWt9.js} (84%) rename docs/assets/{ten-million-cells.stories-1_UuWv9S.js => ten-million-cells.stories-uQH2qa2w.js} (76%) rename docs/assets/{theme-per-column.stories-isrD9oZt.js => theme-per-column.stories-21oCUHRj.js} (90%) rename docs/assets/{theme-per-row.stories-IBnFrFRd.js => theme-per-row.stories-QYCshzOF.js} (85%) rename docs/assets/{theme-support.stories-2BOQXcq1.js => theme-support.stories-Tbsj0CEF.js} (93%) rename docs/assets/{tooltips.stories-JLwf15EA.js => tooltips.stories-L9--bKUS.js} (89%) rename docs/assets/{trailing-row-options.stories-riMxTVcx.js => trailing-row-options.stories-JJNnNKur.js} (89%) rename docs/assets/{uneven-rows.stories-XkRXih74.js => uneven-rows.stories-LG_7MDCI.js} (73%) rename docs/assets/{use-data-source.stories-ys8NwUsp.js => use-data-source.stories-Fo8NpI-_.js} (99%) rename docs/assets/{utils-qU2KzddR.js => utils-MADpeXg5.js} (99%) rename docs/assets/{validate-data.stories-E60M8lNF.js => validate-data.stories-AR2BMamQ.js} (81%) rename docs/assets/{wrapping-text.stories-5GtqZrPS.js => wrapping-text.stories-A-X6NF7r.js} (88%) diff --git a/docs/assets/01-getting-started.stories-I5lnvGfZ.js b/docs/assets/01-getting-started.stories-pReBqtRc.js similarity index 98% rename from docs/assets/01-getting-started.stories-I5lnvGfZ.js rename to docs/assets/01-getting-started.stories-pReBqtRc.js index 3f5ee6b96..c546c7a00 100644 --- a/docs/assets/01-getting-started.stories-I5lnvGfZ.js +++ b/docs/assets/01-getting-started.stories-pReBqtRc.js @@ -1,4 +1,4 @@ -import{j as e,a as l}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{G as M}from"./image-window-loader--5E_ifQX.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{S as x}from"./story-utils-K2EZnGjM.js";import{D as T,M as a,H as i,W as y}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const F={title:"Glide-Data-Grid/Docs",decorators:[r=>e(x,{children:e(r,{})})]},s=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],o=()=>{const r=t.useCallback(n=>{const[S,R]=n,p=s[R][["name","company","email","phone"][S]];return{kind:M.Text,allowOverlay:!1,displayData:p,data:p}},[]),[m,C]=t.useState(!1),[c,w]=t.useState(!1),[d,f]=t.useState(!0),h=t.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return l(T,{children:[e(a,{children:` +import{j as e,a as l}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{G as M}from"./image-window-loader-ggeJlWLo.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{S as x}from"./story-utils-K2EZnGjM.js";import{D as T,M as a,H as i,W as y}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const F={title:"Glide-Data-Grid/Docs",decorators:[r=>e(x,{children:e(r,{})})]},s=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],o=()=>{const r=t.useCallback(n=>{const[S,R]=n,p=s[R][["name","company","email","phone"][S]];return{kind:M.Text,allowOverlay:!1,displayData:p,data:p}},[]),[m,C]=t.useState(!1),[c,w]=t.useState(!1),[d,f]=t.useState(!0),h=t.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return l(T,{children:[e(a,{children:` # Getting Started Glide data grid is a powerful but flexible library requiring very few concepts required to get started. The grid will need data, columns, and a \`getCellContent\` callback to convert our data into cells on demand. Because the callback is used, there is no need to pre-format the data in any particular way, so long as it can be transformed into a cell. This example uses a flat array of objects.`}),e(i,{children:` diff --git a/docs/assets/02-editing-data.stories-Ybg3Js5e.js b/docs/assets/02-editing-data.stories-BQj7fCeJ.js similarity index 98% rename from docs/assets/02-editing-data.stories-Ybg3Js5e.js rename to docs/assets/02-editing-data.stories-BQj7fCeJ.js index fadd294ce..0f92d2fcc 100644 --- a/docs/assets/02-editing-data.stories-Ybg3Js5e.js +++ b/docs/assets/02-editing-data.stories-BQj7fCeJ.js @@ -1,4 +1,4 @@ -import{j as e,a as T}from"./marked.esm-dbrxtycE.js";import{r as i}from"./index-BMVQvedj.js";import{G as s}from"./image-window-loader--5E_ifQX.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{S as b}from"./story-utils-K2EZnGjM.js";import{D as x,M as d,H as y,W as u}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const W={title:"Glide-Data-Grid/Docs",decorators:[a=>e(b,{children:e(a,{})})]},f=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],m=()=>{const a=i.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}]),E=i.useCallback(t=>{const[o,l]=t,n=a.current[l][["name","company","email","phone"][o]];return{kind:s.Text,allowOverlay:!0,displayData:n,data:n}},[]),k=i.useCallback(t=>{const[o,l]=t,n=f[l][["name","company","email","phone"][o]];return{kind:s.Text,allowOverlay:!0,displayData:n,data:n}},[]),R=i.useCallback((t,o)=>{if(o.kind!==s.Text)return;const l=["name","company","email","phone"],[r,c]=t,n=l[r];a.current[c][n]=o.data},[]),p=i.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return T(x,{children:[e(d,{children:` +import{j as e,a as T}from"./marked.esm-dbrxtycE.js";import{r as i}from"./index-BMVQvedj.js";import{G as s}from"./image-window-loader-ggeJlWLo.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{S as b}from"./story-utils-K2EZnGjM.js";import{D as x,M as d,H as y,W as u}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const W={title:"Glide-Data-Grid/Docs",decorators:[a=>e(b,{children:e(a,{})})]},f=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],m=()=>{const a=i.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}]),E=i.useCallback(t=>{const[o,l]=t,n=a.current[l][["name","company","email","phone"][o]];return{kind:s.Text,allowOverlay:!0,displayData:n,data:n}},[]),k=i.useCallback(t=>{const[o,l]=t,n=f[l][["name","company","email","phone"][o]];return{kind:s.Text,allowOverlay:!0,displayData:n,data:n}},[]),R=i.useCallback((t,o)=>{if(o.kind!==s.Text)return;const l=["name","company","email","phone"],[r,c]=t,n=l[r];a.current[c][n]=o.data},[]),p=i.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return T(x,{children:[e(d,{children:` # Editing Data Editing data is handled via callbacks. Taking the getting started example as a starting point, the \`getContent\` callback can be modified to allow editing.`}),e(y,{children:` diff --git a/docs/assets/03-grid-column.stories-P60uWubs.js b/docs/assets/03-grid-column.stories-M9wjl6_S.js similarity index 96% rename from docs/assets/03-grid-column.stories-P60uWubs.js rename to docs/assets/03-grid-column.stories-M9wjl6_S.js index 24cff3106..29f6b0f78 100644 --- a/docs/assets/03-grid-column.stories-P60uWubs.js +++ b/docs/assets/03-grid-column.stories-M9wjl6_S.js @@ -1,4 +1,4 @@ -import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{r as c}from"./index-BMVQvedj.js";import{G as g,a as n}from"./image-window-loader--5E_ifQX.js";import{D as r}from"./data-editor-all-zTb9g2fv.js";import{S as w}from"./story-utils-K2EZnGjM.js";import{D as C,M as o,H as a,W as d}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const O={title:"Glide-Data-Grid/Docs",decorators:[t=>e(w,{children:e(t,{})})]},i=()=>{const t=c.useCallback(l=>({kind:g.Text,allowOverlay:!1,displayData:l.toString(),data:l.toString()}),[]),u=c.useMemo(()=>[{title:"First",width:150},{title:"Second",width:150}],[]);return p(C,{children:[e(o,{children:"\n# Basic usage\n\n> The `GridColumn[]` passed to the `DataEditor` in the `columns` property should be memoized to avoid excessive re-rendering. These samples may not do this for the sake of brevity.\n\nThere are only two mandatory properties for each `GridColumn`: `title` and `id`. The id should be a stable id and not the index of the column. Additionally a `width` property can be provided which represents the width of the column in pixels. If a width is provided the id may be omited. This may change in a future version."}),e(a,{children:` +import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{r as c}from"./index-BMVQvedj.js";import{G as g,a as n}from"./image-window-loader-ggeJlWLo.js";import{D as r}from"./data-editor-all-ZeeWpldS.js";import{S as w}from"./story-utils-K2EZnGjM.js";import{D as C,M as o,H as a,W as d}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const O={title:"Glide-Data-Grid/Docs",decorators:[t=>e(w,{children:e(t,{})})]},i=()=>{const t=c.useCallback(l=>({kind:g.Text,allowOverlay:!1,displayData:l.toString(),data:l.toString()}),[]),u=c.useMemo(()=>[{title:"First",width:150},{title:"Second",width:150}],[]);return p(C,{children:[e(o,{children:"\n# Basic usage\n\n> The `GridColumn[]` passed to the `DataEditor` in the `columns` property should be memoized to avoid excessive re-rendering. These samples may not do this for the sake of brevity.\n\nThere are only two mandatory properties for each `GridColumn`: `title` and `id`. The id should be a stable id and not the index of the column. Additionally a `width` property can be provided which represents the width of the column in pixels. If a width is provided the id may be omited. This may change in a future version."}),e(a,{children:` const columns: GridColumn[] = [ { title: "First", id: "first", width: 150 }, { title: "Second", id: "second", width: 150 } diff --git a/docs/assets/04-streaming-data.stories-2jkbEPbR.js b/docs/assets/04-streaming-data.stories-vLZm8kin.js similarity index 98% rename from docs/assets/04-streaming-data.stories-2jkbEPbR.js rename to docs/assets/04-streaming-data.stories-vLZm8kin.js index 7cc6d5497..dd2b5360e 100644 --- a/docs/assets/04-streaming-data.stories-2jkbEPbR.js +++ b/docs/assets/04-streaming-data.stories-vLZm8kin.js @@ -1,4 +1,4 @@ -import{j as n,a as T}from"./marked.esm-dbrxtycE.js";import{r as l}from"./index-BMVQvedj.js";import{G as y}from"./image-window-loader--5E_ifQX.js";import{D as g}from"./data-editor-all-zTb9g2fv.js";import{S as b}from"./story-utils-K2EZnGjM.js";import{D as S,M as s,H as h,W as R}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const X={title:"Glide-Data-Grid/Docs",decorators:[t=>n(b,{children:n(t,{})})]},d=()=>{const t=l.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332",update:0},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227",update:0},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826",update:0},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320",update:0},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472",update:0},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651",update:0},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331",update:0},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134",update:0},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194",update:0},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271",update:0},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454",update:0},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982",update:0},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444",update:0},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805",update:0},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012",update:0},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442",update:0},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883",update:0}]),o=l.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332",update:0},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227",update:0},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826",update:0},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320",update:0},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472",update:0},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651",update:0},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331",update:0},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134",update:0},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194",update:0},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271",update:0},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454",update:0},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982",update:0},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444",update:0},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805",update:0},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012",update:0},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442",update:0},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883",update:0}]),k=l.useCallback(e=>{const[a,m]=e,c=o.current[m][["name","company","email","phone"][a]];return{kind:y.Text,allowOverlay:!0,displayData:c,data:c}},[]),E=l.useCallback(e=>{const[a,m]=e,r=t.current[m],c=r[["name","company","email","phone"][a]];return{kind:y.Text,allowOverlay:!0,displayData:c,data:c,lastUpdated:r.update}},[]),u=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),p=l.useRef(null),M=()=>{var r;const e=Math.floor(Math.random()*o.current.length),a=Math.floor(Math.random()*o.current.length),m=o.current[e].email;o.current[e].email=o.current[a].email,o.current[a].email=m,(r=p.current)==null||r.updateCells([e,a].map(i=>({cell:[2,i]})))},D=()=>{var r;const e=Math.floor(Math.random()*t.current.length),a=Math.floor(Math.random()*t.current.length),m=t.current[e].email;t.current[e].email=t.current[a].email,t.current[a].email=m,t.current[e].update=performance.now(),t.current[a].update=performance.now(),(r=p.current)==null||r.updateCells([e,a].map(i=>({cell:[2,i]})))};return T(S,{children:[n(s,{children:` +import{j as n,a as T}from"./marked.esm-dbrxtycE.js";import{r as l}from"./index-BMVQvedj.js";import{G as y}from"./image-window-loader-ggeJlWLo.js";import{D as g}from"./data-editor-all-ZeeWpldS.js";import{S as b}from"./story-utils-K2EZnGjM.js";import{D as S,M as s,H as h,W as R}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const X={title:"Glide-Data-Grid/Docs",decorators:[t=>n(b,{children:n(t,{})})]},d=()=>{const t=l.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332",update:0},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227",update:0},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826",update:0},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320",update:0},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472",update:0},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651",update:0},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331",update:0},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134",update:0},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194",update:0},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271",update:0},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454",update:0},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982",update:0},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444",update:0},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805",update:0},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012",update:0},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442",update:0},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883",update:0}]),o=l.useRef([{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332",update:0},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227",update:0},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826",update:0},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320",update:0},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472",update:0},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651",update:0},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331",update:0},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134",update:0},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194",update:0},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271",update:0},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454",update:0},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982",update:0},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444",update:0},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805",update:0},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012",update:0},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442",update:0},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883",update:0}]),k=l.useCallback(e=>{const[a,m]=e,c=o.current[m][["name","company","email","phone"][a]];return{kind:y.Text,allowOverlay:!0,displayData:c,data:c}},[]),E=l.useCallback(e=>{const[a,m]=e,r=t.current[m],c=r[["name","company","email","phone"][a]];return{kind:y.Text,allowOverlay:!0,displayData:c,data:c,lastUpdated:r.update}},[]),u=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),p=l.useRef(null),M=()=>{var r;const e=Math.floor(Math.random()*o.current.length),a=Math.floor(Math.random()*o.current.length),m=o.current[e].email;o.current[e].email=o.current[a].email,o.current[a].email=m,(r=p.current)==null||r.updateCells([e,a].map(i=>({cell:[2,i]})))},D=()=>{var r;const e=Math.floor(Math.random()*t.current.length),a=Math.floor(Math.random()*t.current.length),m=t.current[e].email;t.current[e].email=t.current[a].email,t.current[a].email=m,t.current[e].update=performance.now(),t.current[a].update=performance.now(),(r=p.current)==null||r.updateCells([e,a].map(i=>({cell:[2,i]})))};return T(S,{children:[n(s,{children:` # Streaming Data > Glide Data Grid is capable of streaming hundreds of thousands of updates per second. You won't need that, but every millisecond the grid doesn't take is another millisecond your app has to process data and remain responsive. diff --git a/docs/assets/06-search.stories-_h21YrTI.js b/docs/assets/06-search.stories-HT4OBHAI.js similarity index 97% rename from docs/assets/06-search.stories-_h21YrTI.js rename to docs/assets/06-search.stories-HT4OBHAI.js index 2d6e0d7a3..71225eef3 100644 --- a/docs/assets/06-search.stories-_h21YrTI.js +++ b/docs/assets/06-search.stories-HT4OBHAI.js @@ -1,4 +1,4 @@ -import{j as e,a as b}from"./marked.esm-dbrxtycE.js";import{r as o}from"./index-BMVQvedj.js";import{G as k}from"./image-window-loader--5E_ifQX.js";import{D as i}from"./data-editor-all-zTb9g2fv.js";import{S as E}from"./story-utils-K2EZnGjM.js";import{D as R,M as s,H as h,W as m}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const B={title:"Glide-Data-Grid/Docs",decorators:[n=>e(E,{children:e(n,{})})]},t=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],a=()=>{const n=o.useCallback(g=>{const[C,w]=g,c=t[w][["name","company","email","phone"][C]];return{kind:k.Text,allowOverlay:!0,displayData:c,data:c}},[]),r=o.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),[u,l]=o.useState(!1),y=o.useCallback(()=>l(!1),[]);return b(R,{children:[e(s,{children:` +import{j as e,a as b}from"./marked.esm-dbrxtycE.js";import{r as o}from"./index-BMVQvedj.js";import{G as k}from"./image-window-loader-ggeJlWLo.js";import{D as i}from"./data-editor-all-ZeeWpldS.js";import{S as E}from"./story-utils-K2EZnGjM.js";import{D as R,M as s,H as h,W as m}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const B={title:"Glide-Data-Grid/Docs",decorators:[n=>e(E,{children:e(n,{})})]},t=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],a=()=>{const n=o.useCallback(g=>{const[C,w]=g,c=t[w][["name","company","email","phone"][C]];return{kind:k.Text,allowOverlay:!0,displayData:c,data:c}},[]),r=o.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),[u,l]=o.useState(!1),y=o.useCallback(()=>l(!1),[]);return b(R,{children:[e(s,{children:` # Search Search is a controlled property in Glide Data Grid. Triggering the search interface is up to the application but once triggered search is handled interally on the data grid. Search always depends on a properly implemented \`getCellsForSelection\`.`}),e(h,{children:` diff --git a/docs/assets/07-column-grouping.stories-iIWli84A.js b/docs/assets/07-column-grouping.stories-5voO87Gi.js similarity index 96% rename from docs/assets/07-column-grouping.stories-iIWli84A.js rename to docs/assets/07-column-grouping.stories-5voO87Gi.js index 6ed0047d2..8ff4eda80 100644 --- a/docs/assets/07-column-grouping.stories-iIWli84A.js +++ b/docs/assets/07-column-grouping.stories-5voO87Gi.js @@ -1,4 +1,4 @@ -import{j as n,a as u}from"./marked.esm-dbrxtycE.js";import{r}from"./index-BMVQvedj.js";import{G as h}from"./image-window-loader--5E_ifQX.js";import{D as y}from"./data-editor-all-zTb9g2fv.js";import{S as g}from"./story-utils-K2EZnGjM.js";import{D as C,M as E,H as x,W as R}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const L={title:"Glide-Data-Grid/Docs",decorators:[o=>n(g,{children:n(o,{})})]},t=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],e=()=>{const o=r.useCallback(c=>{const[s,d]=c,a=t[d][["name","company","email","phone"][s]];return{kind:h.Text,allowOverlay:!0,displayData:a,data:a}},[]),p=r.useMemo(()=>[{title:"Name",id:"name",group:"Core"},{title:"Company",id:"company",group:"Core"},{title:"Email",id:"email",group:"Extra"},{title:"Phone",id:"phone",group:"Extra"}],[]);return u(C,{children:[n(E,{children:` +import{j as n,a as u}from"./marked.esm-dbrxtycE.js";import{r}from"./index-BMVQvedj.js";import{G as h}from"./image-window-loader-ggeJlWLo.js";import{D as y}from"./data-editor-all-ZeeWpldS.js";import{S as g}from"./story-utils-K2EZnGjM.js";import{D as C,M as E,H as x,W as R}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const L={title:"Glide-Data-Grid/Docs",decorators:[o=>n(g,{children:n(o,{})})]},t=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],e=()=>{const o=r.useCallback(c=>{const[s,d]=c,a=t[d][["name","company","email","phone"][s]];return{kind:h.Text,allowOverlay:!0,displayData:a,data:a}},[]),p=r.useMemo(()=>[{title:"Name",id:"name",group:"Core"},{title:"Company",id:"company",group:"Core"},{title:"Email",id:"email",group:"Extra"},{title:"Phone",id:"phone",group:"Extra"}],[]);return u(C,{children:[n(E,{children:` # Column Grouping Columns can be grouped by assinging them a group. Easy peasy.`}),n(x,{children:` diff --git a/docs/assets/08-theming.stories-TO36rufF.js b/docs/assets/08-theming.stories-2t9RmZTv.js similarity index 98% rename from docs/assets/08-theming.stories-TO36rufF.js rename to docs/assets/08-theming.stories-2t9RmZTv.js index 38a568a72..9996e2d03 100644 --- a/docs/assets/08-theming.stories-TO36rufF.js +++ b/docs/assets/08-theming.stories-2t9RmZTv.js @@ -1,4 +1,4 @@ -import{j as e,a as v}from"./marked.esm-dbrxtycE.js";import{r as l}from"./index-BMVQvedj.js";import{G as p}from"./image-window-loader--5E_ifQX.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{S as k}from"./story-utils-K2EZnGjM.js";import{D,M as g,H as s,W as c}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";const N={title:"Glide-Data-Grid/Docs",decorators:[t=>e(k,{children:e(t,{})})]},n=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],a=()=>{const t=l.useCallback(o=>{const[i,d]=o,r=n[d][["name","company","email","phone"][i]];return{kind:p.Text,allowOverlay:!0,displayData:r,data:r}},[]),T=l.useCallback(o=>{const[i,d]=o,r=n[d][["name","company","email","phone"][i]];let b;return i===1&&d===1&&(b={textDark:"#FF0000"}),{kind:p.Text,allowOverlay:!0,displayData:r,data:r,themeOverride:b}},[]),u=l.useCallback(o=>{if(o%2===0)return{bgCell:"#F9FDFF"}},[]),w=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),m=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",themeOverride:{textDark:"#225588",baseFontStyle:"600 13px"},id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return v(D,{children:[e(g,{children:` +import{j as e,a as v}from"./marked.esm-dbrxtycE.js";import{r as l}from"./index-BMVQvedj.js";import{G as p}from"./image-window-loader-ggeJlWLo.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{S as k}from"./story-utils-K2EZnGjM.js";import{D,M as g,H as s,W as c}from"./doc-wrapper-m1-LpzDL.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";const N={title:"Glide-Data-Grid/Docs",decorators:[t=>e(k,{children:e(t,{})})]},n=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],a=()=>{const t=l.useCallback(o=>{const[i,d]=o,r=n[d][["name","company","email","phone"][i]];return{kind:p.Text,allowOverlay:!0,displayData:r,data:r}},[]),T=l.useCallback(o=>{const[i,d]=o,r=n[d][["name","company","email","phone"][i]];let b;return i===1&&d===1&&(b={textDark:"#FF0000"}),{kind:p.Text,allowOverlay:!0,displayData:r,data:r,themeOverride:b}},[]),u=l.useCallback(o=>{if(o%2===0)return{bgCell:"#F9FDFF"}},[]),w=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]),m=l.useMemo(()=>[{title:"Name",id:"name"},{title:"Company",themeOverride:{textDark:"#225588",baseFontStyle:"600 13px"},id:"company"},{title:"Email",id:"email"},{title:"Phone",id:"phone"}],[]);return v(D,{children:[e(g,{children:` # Theming Theming the Glide Data Grid is a cascaded through 5 levels diff --git a/docs/assets/09-menus.stories-DHuUaNJ-.js b/docs/assets/09-menus.stories-e6AvaNtK.js similarity index 98% rename from docs/assets/09-menus.stories-DHuUaNJ-.js rename to docs/assets/09-menus.stories-e6AvaNtK.js index 3d3fdcab2..3bb0ea93d 100644 --- a/docs/assets/09-menus.stories-DHuUaNJ-.js +++ b/docs/assets/09-menus.stories-e6AvaNtK.js @@ -1,4 +1,4 @@ -import{j as n,a as s}from"./marked.esm-dbrxtycE.js";import{r as a}from"./index-BMVQvedj.js";import{G as S}from"./image-window-loader--5E_ifQX.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{S as f}from"./story-utils-K2EZnGjM.js";import{D as O,M as p,H as g,W as b}from"./doc-wrapper-m1-LpzDL.js";import{u as E}from"./react-laag.esm-PpDllAFI.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./toConsumableArray-ppDpjNRJ.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/Docs",decorators:[r=>n(f,{children:n(r,{})})]},l=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],i=()=>{const r=a.useCallback(t=>{const[o,H]=t,m=l[H][["name","company","email","phone"][o]];return{kind:S.Text,allowOverlay:!0,displayData:m,data:m}},[]),d=a.useMemo(()=>[{title:"Name",id:"name",hasMenu:!0},{title:"Company",id:"company",hasMenu:!0},{title:"Email",id:"email",hasMenu:!0},{title:"Phone",id:"phone",hasMenu:!0}],[]),C=a.useCallback((t,o)=>{window.alert("Header menu clicked "+t+JSON.stringify(o))},[]),[e,u]=a.useState(),k=a.useCallback((t,o)=>{u({col:t,bounds:o})},[]),{renderLayer:R,layerProps:c}=E({isOpen:e!==void 0,triggerOffset:4,onOutsideClick:()=>u(void 0),trigger:{getBounds:()=>({bottom:((e==null?void 0:e.bounds.y)??0)+((e==null?void 0:e.bounds.height)??0),height:(e==null?void 0:e.bounds.height)??0,left:(e==null?void 0:e.bounds.x)??0,right:((e==null?void 0:e.bounds.x)??0)+((e==null?void 0:e.bounds.width)??0),top:(e==null?void 0:e.bounds.y)??0,width:(e==null?void 0:e.bounds.width)??0})},placement:"bottom-start",auto:!0,possiblePlacements:["bottom-start","bottom-end"]});return s(O,{children:[n(p,{children:` +import{j as n,a as s}from"./marked.esm-dbrxtycE.js";import{r as a}from"./index-BMVQvedj.js";import{G as S}from"./image-window-loader-ggeJlWLo.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{S as f}from"./story-utils-K2EZnGjM.js";import{D as O,M as p,H as g,W as b}from"./doc-wrapper-m1-LpzDL.js";import{u as E}from"./react-laag.esm-PpDllAFI.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./toConsumableArray-ppDpjNRJ.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/Docs",decorators:[r=>n(f,{children:n(r,{})})]},l=[{name:"Deidre Morris",company:"GONKLE",email:"deidremorris@gonkle.com",phone:"+1 (867) 507-3332"},{name:"Sheryl Craig",company:"EVENTAGE",email:"sherylcraig@eventage.com",phone:"+1 (869) 520-2227"},{name:"Lidia Bowers",company:"ANOCHA",email:"lidiabowers@anocha.com",phone:"+1 (808) 414-3826"},{name:"Jones Norton",company:"REPETWIRE",email:"jonesnorton@repetwire.com",phone:"+1 (875) 582-3320"},{name:"Lula Bruce",company:"COMDOM",email:"lulabruce@comdom.com",phone:"+1 (873) 452-2472"},{name:"Larsen Montgomery",company:"SQUISH",email:"larsenmontgomery@squish.com",phone:"+1 (893) 482-3651"},{name:"Becky Bright",company:"COMCUR",email:"beckybright@comcur.com",phone:"+1 (879) 494-2331"},{name:"Charlotte Rowland",company:"FROLIX",email:"charlotterowland@frolix.com",phone:"+1 (861) 439-2134"},{name:"Sonya Hensley",company:"GEEKETRON",email:"sonyahensley@geeketron.com",phone:"+1 (802) 553-2194"},{name:"Stephenson Guthrie",company:"EXOSWITCH",email:"stephensonguthrie@exoswitch.com",phone:"+1 (903) 449-3271"},{name:"Mcmillan Cline",company:"TURNLING",email:"mcmillancline@turnling.com",phone:"+1 (982) 496-2454"},{name:"Kemp Davis",company:"TETRATREX",email:"kempdavis@tetratrex.com",phone:"+1 (859) 594-2982"},{name:"Matilda Levy",company:"SLOFAST",email:"matildalevy@slofast.com",phone:"+1 (841) 521-2444"},{name:"Hattie Simpson",company:"COMTRAK",email:"hattiesimpson@comtrak.com",phone:"+1 (962) 587-3805"},{name:"Kinney Munoz",company:"IDETICA",email:"kinneymunoz@idetica.com",phone:"+1 (921) 513-2012"},{name:"Lambert Raymond",company:"TURNABOUT",email:"lambertraymond@turnabout.com",phone:"+1 (919) 519-2442"},{name:"Bryant Dunlap",company:"BYTREX",email:"bryantdunlap@bytrex.com",phone:"+1 (872) 583-2883"}],i=()=>{const r=a.useCallback(t=>{const[o,H]=t,m=l[H][["name","company","email","phone"][o]];return{kind:S.Text,allowOverlay:!0,displayData:m,data:m}},[]),d=a.useMemo(()=>[{title:"Name",id:"name",hasMenu:!0},{title:"Company",id:"company",hasMenu:!0},{title:"Email",id:"email",hasMenu:!0},{title:"Phone",id:"phone",hasMenu:!0}],[]),C=a.useCallback((t,o)=>{window.alert("Header menu clicked "+t+JSON.stringify(o))},[]),[e,u]=a.useState(),k=a.useCallback((t,o)=>{u({col:t,bounds:o})},[]),{renderLayer:R,layerProps:c}=E({isOpen:e!==void 0,triggerOffset:4,onOutsideClick:()=>u(void 0),trigger:{getBounds:()=>({bottom:((e==null?void 0:e.bounds.y)??0)+((e==null?void 0:e.bounds.height)??0),height:(e==null?void 0:e.bounds.height)??0,left:(e==null?void 0:e.bounds.x)??0,right:((e==null?void 0:e.bounds.x)??0)+((e==null?void 0:e.bounds.width)??0),top:(e==null?void 0:e.bounds.y)??0,width:(e==null?void 0:e.bounds.width)??0})},placement:"bottom-start",auto:!0,possiblePlacements:["bottom-start","bottom-end"]});return s(O,{children:[n(p,{children:` # Menus Glide Data Grid doesn't come with built in menus. Instead it is evented and ready to work with whatever menus you want diff --git a/docs/assets/add-column.stories-qJd3E4Gn.js b/docs/assets/add-column.stories-_EqbBQr_.js similarity index 76% rename from docs/assets/add-column.stories-qJd3E4Gn.js rename to docs/assets/add-column.stories-_EqbBQr_.js index 626d675ab..e7f148d63 100644 --- a/docs/assets/add-column.stories-qJd3E4Gn.js +++ b/docs/assets/add-column.stories-_EqbBQr_.js @@ -1,4 +1,4 @@ -import{j as r,a as l,F as i}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as c}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as u,M as d,u as C,d as f}from"./utils-qU2KzddR.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(g,{children:r(p,{title:"Add and remove columns",description:l(i,{children:[r(u,{children:"You can add and remove columns at your disposal"}),r(d,{children:"Use the story's controls to change the number of columns"})]}),children:r(t,{})})})]},o=t=>{const{cols:a,getCellContent:m}=C(t.columnsCount);return r(c,{...f,rowMarkers:"number",getCellContent:m,experimental:{strict:!0},columns:a,rows:1e4})};o.args={columnsCount:10};o.argTypes={columnsCount:{control:{type:"range",min:2,max:200}}};var e,s,n;o.parameters={...o.parameters,docs:{...(e=o.parameters)==null?void 0:e.docs,source:{originalSource:`p => { +import{j as r,a as l,F as i}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as c}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as u,M as d,u as C,d as f}from"./utils-MADpeXg5.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(g,{children:r(p,{title:"Add and remove columns",description:l(i,{children:[r(u,{children:"You can add and remove columns at your disposal"}),r(d,{children:"Use the story's controls to change the number of columns"})]}),children:r(t,{})})})]},o=t=>{const{cols:a,getCellContent:m}=C(t.columnsCount);return r(c,{...f,rowMarkers:"number",getCellContent:m,experimental:{strict:!0},columns:a,rows:1e4})};o.args={columnsCount:10};o.argTypes={columnsCount:{control:{type:"range",min:2,max:200}}};var e,s,n;o.parameters={...o.parameters,docs:{...(e=o.parameters)==null?void 0:e.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/add-data-to-middle.stories-bzixFsHE.js b/docs/assets/add-data-to-middle.stories-tQw-dOJ-.js similarity index 86% rename from docs/assets/add-data-to-middle.stories-bzixFsHE.js rename to docs/assets/add-data-to-middle.stories-tQw-dOJ-.js index 7a480d954..62897b47f 100644 --- a/docs/assets/add-data-to-middle.stories-bzixFsHE.js +++ b/docs/assets/add-data-to-middle.stories-tQw-dOJ-.js @@ -1,4 +1,4 @@ -import{j as n,a as d,F as R}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{B as g,D as y,M as D,K as k,u as M,c as b,d as A}from"./utils-qU2KzddR.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>n(V,{children:n(g,{title:"Add data to middle",description:d(R,{children:[n(y,{children:"You can return a different location to have the new row append take place."}),d(D,{children:["Note that ",n(k,{children:"insertIndex"}),' is zero-based while the number column on the left side of the grid is one-based, so inserting at index "4" creates a new row at "5"']})]}),children:n(s,{})})})]},o=s=>{const{cols:w,getCellContent:a,setCellValueRaw:l,setCellValue:C}=M(60,!1),[i,x]=c.useState(50),r=s.insertIndex,f=c.useCallback(async()=>{for(let e=i;e>r;e--)for(let t=0;t<6;t++)l([t,e],a([t,e-1]));for(let e=0;e<6;e++){const t=a([e,r]);l([e,r],b(t))}return x(e=>e+1),r},[a,i,l,r]);return n(h,{...A,getCellContent:a,columns:w,rowMarkers:"both",onCellEdited:C,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:i,onRowAppended:f})};o.args={insertIndex:10};o.argTypes={insertIndex:{control:{type:"range",min:1,max:48}}};var p,m,u;o.parameters={...o.parameters,docs:{...(p=o.parameters)==null?void 0:p.docs,source:{originalSource:`p => { +import{j as n,a as d,F as R}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{B as g,D as y,M as D,K as k,u as M,c as b,d as A}from"./utils-MADpeXg5.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>n(V,{children:n(g,{title:"Add data to middle",description:d(R,{children:[n(y,{children:"You can return a different location to have the new row append take place."}),d(D,{children:["Note that ",n(k,{children:"insertIndex"}),' is zero-based while the number column on the left side of the grid is one-based, so inserting at index "4" creates a new row at "5"']})]}),children:n(s,{})})})]},o=s=>{const{cols:w,getCellContent:a,setCellValueRaw:l,setCellValue:C}=M(60,!1),[i,x]=c.useState(50),r=s.insertIndex,f=c.useCallback(async()=>{for(let e=i;e>r;e--)for(let t=0;t<6;t++)l([t,e],a([t,e-1]));for(let e=0;e<6;e++){const t=a([e,r]);l([e,r],b(t))}return x(e=>e+1),r},[a,i,l,r]);return n(h,{...A,getCellContent:a,columns:w,rowMarkers:"both",onCellEdited:C,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:i,onRowAppended:f})};o.args={insertIndex:10};o.argTypes={insertIndex:{control:{type:"range",min:1,max:48}}};var p,m,u;o.parameters={...o.parameters,docs:{...(p=o.parameters)==null?void 0:p.docs,source:{originalSource:`p => { const { cols, getCellContent, diff --git a/docs/assets/add-data-to-top.stories-VjNp9gVs.js b/docs/assets/add-data-to-top.stories-Y48s8jn2.js similarity index 87% rename from docs/assets/add-data-to-top.stories-VjNp9gVs.js rename to docs/assets/add-data-to-top.stories-Y48s8jn2.js index d3b2f9105..978750350 100644 --- a/docs/assets/add-data-to-top.stories-VjNp9gVs.js +++ b/docs/assets/add-data-to-top.stories-Y48s8jn2.js @@ -1,4 +1,4 @@ -import{j as o,F as C}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as R}from"./data-editor-all-zTb9g2fv.js";import{B as f,D as h,u as D,c as g,d as x}from"./utils-qU2KzddR.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>o(y,{children:o(f,{title:"Add data",description:o(C,{children:o(h,{children:"You can return a different location to have the new row append take place."})}),children:o(l,{})})})]},r=()=>{const{cols:l,getCellContent:n,setCellValueRaw:a,setCellValue:u}=D(60,!1),[s,m]=c.useState(50),w=c.useCallback(async()=>{for(let e=s;e>0;e--)for(let t=0;t<6;t++)a([t,e],n([t,e-1]));for(let e=0;e<6;e++){const t=n([e,0]);a([e,0],g(t))}return m(e=>e+1),"top"},[n,s,a]);return o(R,{...x,getCellContent:n,columns:l,rowMarkers:"both",onCellEdited:u,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:s,onRowAppended:w})};var i,p,d;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as o,F as C}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as R}from"./data-editor-all-ZeeWpldS.js";import{B as f,D as h,u as D,c as g,d as x}from"./utils-MADpeXg5.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>o(y,{children:o(f,{title:"Add data",description:o(C,{children:o(h,{children:"You can return a different location to have the new row append take place."})}),children:o(l,{})})})]},r=()=>{const{cols:l,getCellContent:n,setCellValueRaw:a,setCellValue:u}=D(60,!1),[s,m]=c.useState(50),w=c.useCallback(async()=>{for(let e=s;e>0;e--)for(let t=0;t<6;t++)a([t,e],n([t,e-1]));for(let e=0;e<6;e++){const t=n([e,0]);a([e,0],g(t))}return m(e=>e+1),"top"},[n,s,a]);return o(R,{...x,getCellContent:n,columns:l,rowMarkers:"both",onCellEdited:u,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:s,onRowAppended:w})};var i,p,d;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/add-data.stories-aXlkRdaQ.js b/docs/assets/add-data.stories-E0FdRGvU.js similarity index 50% rename from docs/assets/add-data.stories-aXlkRdaQ.js rename to docs/assets/add-data.stories-E0FdRGvU.js index e6d60657d..c85e132f5 100644 --- a/docs/assets/add-data.stories-aXlkRdaQ.js +++ b/docs/assets/add-data.stories-E0FdRGvU.js @@ -1,4 +1,4 @@ -import{j as t,a as c,F as R}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as g}from"./data-editor-all-zTb9g2fv.js";import{B as f,D,M as k,K as A,u as E,c as b,d as V}from"./utils-qU2KzddR.js";import{S as j}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const H={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(j,{children:t(f,{title:"Add data",description:c(R,{children:[t(D,{children:"Data can be added by clicking on the trailing row."}),c(k,{children:["Keyboard is also supported, just navigate past the last row and press"," ",t(A,{children:"Enter"})]})]}),children:t(o,{})})})]},n=()=>{const{cols:o,getCellContent:a,setCellValueRaw:l,setCellValue:w}=E(60,!1),[s,m]=i.useState(50),h=i.useCallback(()=>{const r=s;for(let e=0;ee+1)},[o.length,a,s,l]);return t(g,{...V,getCellContent:a,columns:o,rowMarkers:"both",onPaste:!0,onCellEdited:w,trailingRowOptions:{sticky:!1,tint:!0,hint:"New row..."},rows:s,onRowAppended:h})};var d,u,p;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{j as t,a as i,F as g}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as R}from"./data-editor-all-ZeeWpldS.js";import{B as f,D,M as k,K as S,u as A,c as E,d as b}from"./utils-MADpeXg5.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const H={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(V,{children:t(f,{title:"Add data",description:i(g,{children:[t(D,{children:"Data can be added by clicking on the trailing row."}),i(k,{children:["Keyboard is also supported, just navigate past the last row and press"," ",t(S,{children:"Enter"})]})]}),children:t(o,{})})})]},n=()=>{const{cols:o,getCellContent:a,setCellValueRaw:l,setCellValue:m}=A(60,!1),[s,w]=c.useState(50),h=c.useCallback(()=>{const r=s;for(let e=0;ee+1)},[o.length,a,s,l]);return t(R,{...b,getCellContent:a,columns:o,rangeSelectionColumnSpanning:!1,rowMarkers:"both",onPaste:!0,onCellEdited:m,trailingRowOptions:{sticky:!1,tint:!0,hint:"New row..."},rows:s,onRowAppended:h})};var d,u,p;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const { cols, getCellContent, @@ -17,7 +17,7 @@ import{j as t,a as c,F as R}from"./marked.esm-dbrxtycE.js";import{R as i}from"./ // Tell the data grid there is another row setNumRows(cv => cv + 1); }, [cols.length, getCellContent, numRows, setCellValueRaw]); - return e(g,{children:e(p,{title:"Lotsa cell kinds",description:d(c,{children:["Data grid supports plenty cell kinds. Anything under ",e(u,{children:"GridCellKind"}),"."]}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:s,onColumnResize:i,setCellValue:a}=C();return e(m,{...h,getCellContent:s,columns:o,onCellEdited:a,onPaste:!0,onColumnResize:i,highlightRegions:[{color:"#ff00ff33",range:{x:1,y:1,width:3,height:3}}],rows:1e3})};var l,r,n;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`() => { +import{j as e,a as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as c,P as u,a as C,d as h}from"./utils-MADpeXg5.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(g,{children:e(p,{title:"Lotsa cell kinds",description:d(c,{children:["Data grid supports plenty cell kinds. Anything under ",e(u,{children:"GridCellKind"}),"."]}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:s,onColumnResize:i,setCellValue:a}=C();return e(m,{...h,getCellContent:s,columns:o,onCellEdited:a,onPaste:!0,onColumnResize:i,highlightRegions:[{color:"#ff00ff33",range:{x:1,y:1,width:3,height:3}}],rows:1e3})};var l,r,n;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/append-row-handle.stories-mXWrYEJH.js b/docs/assets/append-row-handle.stories-rOWS4lXQ.js similarity index 88% rename from docs/assets/append-row-handle.stories-mXWrYEJH.js rename to docs/assets/append-row-handle.stories-rOWS4lXQ.js index f19ac3394..59665d3cb 100644 --- a/docs/assets/append-row-handle.stories-mXWrYEJH.js +++ b/docs/assets/append-row-handle.stories-rOWS4lXQ.js @@ -1,4 +1,4 @@ -import{j as e,a as c,F as k}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{D}from"./data-editor-all-zTb9g2fv.js";import{u as N,c as y,B as A,D as b,P as p,M as P,K as E,d as M}from"./utils-qU2KzddR.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(V,{children:e(a,{})})]},r=()=>{const{cols:a,getCellContent:l,setCellValueRaw:d,setCellValue:R}=N(60,!1),[s,f]=n.useState(50),i=n.useRef(null),C=n.useCallback(()=>{var t;(t=i.current)==null||t.appendRow(3,!1)},[i]),g=n.useCallback(()=>{const t=s;for(let o=0;o<6;o++){const h=l([o,t]);d([o,t],y(h))}f(o=>o+1)},[l,s,d]);return e(A,{title:"appendRow Ref",description:c(k,{children:[c(b,{children:["Adding data can also be triggered from outside of ",e(p,{children:"DataEditor"})]}),c(P,{children:["By calling ",e(p,{children:"appendRow"})," on a ",e(p,{children:"ref"})," to your grid, you can trigger the append elsewhere, like this ",e(E,{onClick:C,children:"Append"})," button"]})]}),children:e(D,{...M,ref:i,getCellContent:l,columns:a,rowMarkers:"both",onCellEdited:R,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:s,onRowAppended:g})})};var u,m,w;r.parameters={...r.parameters,docs:{...(u=r.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{j as e,a as c,F as k}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{D}from"./data-editor-all-ZeeWpldS.js";import{u as N,c as y,B as A,D as b,P as p,M as P,K as E,d as M}from"./utils-MADpeXg5.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(V,{children:e(a,{})})]},r=()=>{const{cols:a,getCellContent:l,setCellValueRaw:d,setCellValue:R}=N(60,!1),[s,f]=n.useState(50),i=n.useRef(null),C=n.useCallback(()=>{var t;(t=i.current)==null||t.appendRow(3,!1)},[i]),g=n.useCallback(()=>{const t=s;for(let o=0;o<6;o++){const h=l([o,t]);d([o,t],y(h))}f(o=>o+1)},[l,s,d]);return e(A,{title:"appendRow Ref",description:c(k,{children:[c(b,{children:["Adding data can also be triggered from outside of ",e(p,{children:"DataEditor"})]}),c(P,{children:["By calling ",e(p,{children:"appendRow"})," on a ",e(p,{children:"ref"})," to your grid, you can trigger the append elsewhere, like this ",e(E,{onClick:C,children:"Append"})," button"]})]}),children:e(D,{...M,ref:i,getCellContent:l,columns:a,rowMarkers:"both",onCellEdited:R,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:s,onRowAppended:g})})};var u,m,w;r.parameters={...r.parameters,docs:{...(u=r.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/automatic-row-markers.stories-ia88nBlQ.js b/docs/assets/automatic-row-markers.stories-DpSDMBm4.js similarity index 83% rename from docs/assets/automatic-row-markers.stories-ia88nBlQ.js rename to docs/assets/automatic-row-markers.stories-DpSDMBm4.js index ae7867eeb..5bea5cc60 100644 --- a/docs/assets/automatic-row-markers.stories-ia88nBlQ.js +++ b/docs/assets/automatic-row-markers.stories-DpSDMBm4.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-zTb9g2fv.js";import{u as d,B as u,D as k,P as h,M as w,K as a,d as M}from"./utils-qU2KzddR.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(f,{children:e(o,{})})]},r=()=>{const{cols:o,getCellContent:c}=d(6),l=e(p,{...M,rowMarkers:"checkbox-visible",getCellContent:c,columns:o,rows:1e3});return e(u,{title:"Automatic Row Markers",description:t(m,{children:[t(k,{children:["You can enable row markers with rich selection behavior using the"," ",e(h,{children:"rowMarkers"})," prop."]}),t(w,{children:["Use ",e(a,{children:"⇧"})," + click to make range selections, and ",e(a,{children:"Ctrl"})," (",e(a,{children:"⌘"})," on Mac) + click to add/remove individual rows."]})]}),children:l})};var i,s,n;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-ZeeWpldS.js";import{u as d,B as u,D as k,P as h,M as w,K as a,d as M}from"./utils-MADpeXg5.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(f,{children:e(o,{})})]},r=()=>{const{cols:o,getCellContent:c}=d(6),l=e(p,{...M,rowMarkers:"checkbox-visible",getCellContent:c,columns:o,rows:1e3});return e(u,{title:"Automatic Row Markers",description:t(m,{children:[t(k,{children:["You can enable row markers with rich selection behavior using the"," ",e(h,{children:"rowMarkers"})," prop."]}),t(w,{children:["Use ",e(a,{children:"⇧"})," + click to make range selections, and ",e(a,{children:"Ctrl"})," (",e(a,{children:"⌘"})," on Mac) + click to add/remove individual rows."]})]}),children:l})};var i,s,n;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/built-in-search.stories-6a9Si4Mh.js b/docs/assets/built-in-search.stories-mWtMZkcZ.js similarity index 88% rename from docs/assets/built-in-search.stories-6a9Si4Mh.js rename to docs/assets/built-in-search.stories-mWtMZkcZ.js index 355e1688a..dfb21186e 100644 --- a/docs/assets/built-in-search.stories-6a9Si4Mh.js +++ b/docs/assets/built-in-search.stories-mWtMZkcZ.js @@ -1,4 +1,4 @@ -import{j as e,a as n,F as y}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{C as c,u as g}from"./image-window-loader--5E_ifQX.js";import{D}from"./data-editor-all-zTb9g2fv.js";import{B as K,D as R,P as v,M as E,K as a,a as k,d as F}from"./utils-qU2KzddR.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(G,{children:e(K,{title:"Search is easy",description:n(y,{children:[n(R,{children:["Search for any data in your grid by setting ",e(v,{children:"showSearch"}),"."]}),n(E,{children:["In this story, ",e(a,{children:"Ctrl"})," (",e(a,{children:"⌘"})," on Mac) +"," ",e(a,{children:"f"})," toggles the search bar. Make sure you're focused on the Data Grid!"]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:u,onColumnResize:p,setCellValue:h}=k(),[S,l]=s.useState(!1),[C,f]=s.useState({rows:c.empty(),columns:c.empty()});return g("keydown",s.useCallback(t=>{(t.ctrlKey||t.metaKey)&&t.code==="KeyF"&&(l(w=>!w),t.stopPropagation(),t.preventDefault())},[]),window,!1,!0),e(D,{...F,getCellContent:u,getCellsForSelection:!0,gridSelection:C,onGridSelectionChange:f,columns:r,onCellEdited:h,onColumnResize:p,showSearch:S,onSearchClose:()=>l(!1),rows:1e4})};var i,m,d;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as e,a as n,F as y}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{C as c,u as g}from"./image-window-loader-ggeJlWLo.js";import{D}from"./data-editor-all-ZeeWpldS.js";import{B as K,D as R,P as v,M as E,K as a,a as k,d as F}from"./utils-MADpeXg5.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(G,{children:e(K,{title:"Search is easy",description:n(y,{children:[n(R,{children:["Search for any data in your grid by setting ",e(v,{children:"showSearch"}),"."]}),n(E,{children:["In this story, ",e(a,{children:"Ctrl"})," (",e(a,{children:"⌘"})," on Mac) +"," ",e(a,{children:"f"})," toggles the search bar. Make sure you're focused on the Data Grid!"]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:u,onColumnResize:p,setCellValue:h}=k(),[S,l]=s.useState(!1),[C,f]=s.useState({rows:c.empty(),columns:c.empty()});return g("keydown",s.useCallback(t=>{(t.ctrlKey||t.metaKey)&&t.code==="KeyF"&&(l(w=>!w),t.stopPropagation(),t.preventDefault())},[]),window,!1,!0),e(D,{...F,getCellContent:u,getCellsForSelection:!0,gridSelection:C,onGridSelectionChange:f,columns:r,onCellEdited:h,onColumnResize:p,showSearch:S,onSearchClose:()=>l(!1),rows:1e4})};var i,m,d;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/cell-activated-event.stories-2uo3VD4n.js b/docs/assets/cell-activated-event.stories-koZ0slRi.js similarity index 89% rename from docs/assets/cell-activated-event.stories-2uo3VD4n.js rename to docs/assets/cell-activated-event.stories-koZ0slRi.js index d6a2cc9aa..4c1c5d751 100644 --- a/docs/assets/cell-activated-event.stories-2uo3VD4n.js +++ b/docs/assets/cell-activated-event.stories-koZ0slRi.js @@ -1,4 +1,4 @@ -import{j as e,a as o,F as g}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as k}from"./data-editor-all-zTb9g2fv.js";import{a as B,B as E,D as y,K as s,P as D,M as S,d as M}from"./utils-qU2KzddR.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const G={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(R,{children:e(n,{})})]},t=n=>{const{cols:m,getCellContent:c,onColumnResize:p,setCellValue:C}=B(),A=i.useCallback(l=>{const r=c(l);return l[0]===3?{...r,activationBehaviorOverride:"single-click",hoverEffect:!0}:r},[c]),[a,h]=i.useState(void 0),f=i.useCallback(l=>{h(l)},[]);return e(E,{title:"Cell Activated event",description:o(g,{children:[o(y,{children:["When you tap ",e(s,{children:"Enter"}),", ",e(s,{children:"Space"})," or double click a cell, that cell is activated. You can track this with ",e(D,{children:"onCellActivated"}),"."]}),o(S,{children:["Last activated cell:"," ",a===void 0?"none":`(${a[0]}, ${a[1]})`]})]}),children:e(k,{...M,cellActivationBehavior:n.cellActivationBehavior,getCellContent:A,getCellsForSelection:!0,columns:m,onCellEdited:C,onColumnResize:p,onCellActivated:f,rows:1e4})})};t.argTypes={cellActivationBehavior:{control:{type:"select"},options:["double-click","single-click","second-click"]}};t.args={cellActivationBehavior:"second-click"};var d,u,v;t.parameters={...t.parameters,docs:{...(d=t.parameters)==null?void 0:d.docs,source:{originalSource:`p => { +import{j as e,a as o,F as g}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as k}from"./data-editor-all-ZeeWpldS.js";import{a as B,B as E,D as y,K as s,P as D,M as S,d as M}from"./utils-MADpeXg5.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const G={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(R,{children:e(n,{})})]},t=n=>{const{cols:m,getCellContent:c,onColumnResize:p,setCellValue:C}=B(),A=i.useCallback(l=>{const r=c(l);return l[0]===3?{...r,activationBehaviorOverride:"single-click",hoverEffect:!0}:r},[c]),[a,h]=i.useState(void 0),f=i.useCallback(l=>{h(l)},[]);return e(E,{title:"Cell Activated event",description:o(g,{children:[o(y,{children:["When you tap ",e(s,{children:"Enter"}),", ",e(s,{children:"Space"})," or double click a cell, that cell is activated. You can track this with ",e(D,{children:"onCellActivated"}),"."]}),o(S,{children:["Last activated cell:"," ",a===void 0?"none":`(${a[0]}, ${a[1]})`]})]}),children:e(k,{...M,cellActivationBehavior:n.cellActivationBehavior,getCellContent:A,getCellsForSelection:!0,columns:m,onCellEdited:C,onColumnResize:p,onCellActivated:f,rows:1e4})})};t.argTypes={cellActivationBehavior:{control:{type:"select"},options:["double-click","single-click","second-click"]}};t.args={cellActivationBehavior:"second-click"};var d,u,v;t.parameters={...t.parameters,docs:{...(d=t.parameters)==null?void 0:d.docs,source:{originalSource:`p => { const { cols, getCellContent, diff --git a/docs/assets/cell.stories-4eUYRTdX.js b/docs/assets/cell.stories-_g0ubFdV.js similarity index 99% rename from docs/assets/cell.stories-4eUYRTdX.js rename to docs/assets/cell.stories-_g0ubFdV.js index 582f82304..9b7c7b7f0 100644 --- a/docs/assets/cell.stories-4eUYRTdX.js +++ b/docs/assets/cell.stories-_g0ubFdV.js @@ -1,4 +1,4 @@ -import{j as D,s as te,a as Pe,m as Zr}from"./marked.esm-dbrxtycE.js";import{r as y}from"./index-BMVQvedj.js";import{G as E,p as Jr,m as Ce,g as ue,a as zt,u as jn,d as Qr,b as ea,i as ta,r as na,c as Rt,D as Kn}from"./data-editor-all-kM-cjKZ5.js";import{_ as Te,a as ra,b as ce,t as aa,c as Yn,d as V,e as ke}from"./toConsumableArray-ppDpjNRJ.js";import{r as oa}from"./index-wocATsGp.js";import{_ as ia}from"./iframe-0-Di66Z3.js";import{r as wt}from"./throttle-7EuXLZa7.js";import{u as la}from"./flatten-qRvRBp6y.js";import{u as sa}from"./index.esm-Ejw8GwRl.js";import"../sb-preview/runtime.js";import"./_baseIteratee-WTHxv43n.js";const ua=[[50,5],[61.23,39.55],[97.55,39.55],[68.16,60.9],[79.39,95.45],[50,74.1],[20.61,95.45],[31.84,60.9],[2.45,39.55],[38.77,39.55]];function ca(t,e,n){let a=!1;for(const r of ua){const o=(r[0]-50)*(n/100)+e[0],l=(r[1]-50)*(n/100)+e[1];a?t.lineTo(o,l):(t.moveTo(o,l),a=!0)}t.closePath()}const da=()=>D("svg",{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M47.1468 13.7811C48.0449 11.0172 51.9551 11.0172 52.8532 13.7812L60.5522 37.4762C60.9538 38.7123 62.1056 39.5491 63.4053 39.5491H88.3198C91.226 39.5491 92.4343 43.268 90.0831 44.9762L69.9269 59.6205C68.8755 60.3845 68.4355 61.7386 68.8371 62.9746L76.5361 86.6697C77.4342 89.4336 74.2707 91.732 71.9196 90.0238L51.7634 75.3794C50.7119 74.6155 49.2881 74.6155 48.2366 75.3795L28.0804 90.0238C25.7293 91.732 22.5659 89.4336 23.4639 86.6697L31.1629 62.9746C31.5645 61.7386 31.1245 60.3845 30.0731 59.6205L9.91686 44.9762C7.56572 43.268 8.77405 39.5491 11.6802 39.5491H36.5947C37.8944 39.5491 39.0462 38.7123 39.4478 37.4762L47.1468 13.7811Z",fill:"currentColor"})}),fa=te("div")({name:"EditorWrap",class:"e8nv6xj",propsAsIs:!1}),pa={kind:E.Custom,isMatch:t=>t.data.kind==="star-cell",needsHover:!0,draw:(t,e)=>{const{ctx:n,theme:a,rect:r,hoverAmount:o}=t,{rating:l}=e.data,s=a.cellHorizontalPadding;let i=r.x+s;const u=Math.min(5,Math.ceil(l));i+=8,n.beginPath();for(let c=0;ct=>D(fa,{children:[0,1,2,3,4].map(e=>D("div",{className:t.value.data.rating{t.onChange({...t.value,data:{...t.value.data,rating:e+1}})},children:D(da,{})},e))}),onPaste:(t,e)=>{const n=Number.parseInt(t);return{...e,rating:Number.isNaN(n)?0:n}}},ha=pa,va={kind:E.Custom,isMatch:t=>t.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(t,e)=>{const{ctx:n,theme:a,rect:r,hoverAmount:o,hoverX:l}=t;let{values:s,yAxis:i,color:u,graphKind:c="area",displayValues:d,hideAxis:h}=e.data;const[m,g]=i;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-m)/(g-m))));const f=a.cellHorizontalPadding,p=f+r.x,v=r.y+3,C=r.height-6,S=r.width-f*2,O=g-m,k=g<=0?v:m>=0?v+C:v+C*(g/O);if(!h&&m<=0&&g>=0&&(n.beginPath(),n.moveTo(p,k),n.lineTo(p+S,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=a.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const x=2,b=(s.length-1)*x,w=(S-b)/s.length;let M=p;for(const F of s){const N=v+C-F*C;n.moveTo(M,k),n.lineTo(M+w,k),n.lineTo(M+w,N),n.lineTo(M,N),M+=w+x}n.fillStyle=e.data.color??a.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),b=s.map((M,F)=>({x:p+x*F,y:v+C-M*C}));n.moveTo(b[0].x,b[0].y);let w=0;if(b.length>2)for(w=1;w{},onPaste:(t,e)=>e},ma=va;function $e(t,e,n,a,r,o){if(!(a<=0||r<=0)){if(typeof o=="number"&&o<=0){t.rect(e,n,a,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,a/2),tr:Math.min(o.tr,r/2,a/2),bl:Math.min(o.bl,r/2,a/2),br:Math.min(o.br,r/2,a/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),t.moveTo(e+o.tl,n),t.arcTo(e+a,n,e+a,n+o.tr,o.tr),t.arcTo(e+a,n+r,e+a-o.br,n+r,o.br),t.arcTo(e,n+r,e,n+r-o.bl,o.bl),t.arcTo(e,n,e+o.tl,n,o.tl)}}const we=20,Oe=6,ga=()=>t=>t.tagHeight/2,ba=()=>t=>t.tagHeight,ya=()=>t=>t.innerPad,Ca=te("div")({name:"EditorWrap",class:"e14vzbfa",propsAsIs:!1,vars:{"e14vzbfa-0":[ga(),"px"],"e14vzbfa-1":[ba(),"px"],"e14vzbfa-2":[ya(),"px"]}}),wa={kind:E.Custom,isMatch:t=>t.data.kind==="tags-cell",draw:(t,e)=>{var h;const{ctx:n,theme:a,rect:r}=t,{possibleTags:o,tags:l}=e.data,s={x:r.x+a.cellHorizontalPadding,y:r.y+a.cellVerticalPadding,width:r.width-2*a.cellHorizontalPadding,height:r.height-2*a.cellVerticalPadding},i=Math.max(1,Math.floor(s.height/(we+Oe)));let u=s.x,c=1,d=s.y+(s.height-i*we-(i-1)*Oe)/2;for(const m of l){const g=((h=o.find(C=>C.tag===m))==null?void 0:h.color)??a.bgBubble;n.font=`12px ${a.fontFamily}`;const p=Ce(m,n).width+Oe*2,v=we/2;if(u!==s.x&&u+p>s.x+s.width&&cs.x+s.width&&c>=i)break}return!0},provideEditor:()=>t=>{const{onChange:e,value:n}=t,{readonly:a=!1}=n,{possibleTags:r,tags:o}=n.data;return D(Ca,{tagHeight:we,innerPad:Oe,className:a?"gdg-readonly":"",children:r.map(l=>{const s=o.indexOf(l.tag)!==-1;return Pe("label",{children:[!a&&D("input",{className:"gdg-input",type:"checkbox",checked:s,onChange:()=>{const i=s?o.filter(u=>u!==l.tag):[...o,l.tag];e({...t.value,data:{...n.data,tags:i}})}}),D("div",{className:"gdg-pill "+(s?"gdg-selected":"gdg-unselected"),style:{backgroundColor:s?l.color:void 0},children:l.tag})]},l.tag)})})},onPaste:(t,e)=>({...e,tags:e.possibleTags.map(n=>n.tag).filter(n=>t.split(",").map(a=>a.trim()).includes(n))})},Sa=wa,Oa={kind:E.Custom,isMatch:t=>t.data.kind==="user-profile-cell",draw:(t,e)=>{const{ctx:n,rect:a,theme:r,imageLoader:o,col:l,row:s}=t,{image:i,name:u,initial:c,tint:d}=e.data,h=r.cellHorizontalPadding,m=Math.min(12,a.height/2-r.cellVerticalPadding),g=a.x+h,f=o.loadOrGetImage(i,l,s);n.save(),n.beginPath(),n.arc(g+m,a.y+a.height/2,m,0,Math.PI*2),n.globalAlpha=.2,n.fillStyle=d,n.fill(),n.globalAlpha=1,n.font=`600 16px ${r.fontFamily}`;const p=Ce(c[0],n);return n.fillText(c[0],g+m-p.width/2,a.y+a.height/2+ue(n,`600 16px ${r.fontFamily}`)),f!==void 0&&(n.save(),n.beginPath(),n.arc(g+m,a.y+a.height/2,m,0,Math.PI*2),n.clip(),n.drawImage(f,g,a.y+a.height/2-m,m*2,m*2),n.restore()),u!==void 0&&(n.font=r.baseFontFull,n.fillStyle=r.textDark,n.fillText(u,g+m*2+h,a.y+a.height/2+ue(n,r))),n.restore(),!0},provideEditor:()=>t=>{const{isHighlighted:e,onChange:n,value:a}=t;return D(zt,{highlight:e,autoFocus:!0,value:a.data.name??"",disabled:a.readonly??!1,onChange:r=>n({...a,data:{...a.data,name:r.target.value}})})},onPaste:(t,e)=>({...e,name:t})},xa=Oa;function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function P(t){for(var e=1;eD("svg",{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("path",{d:"M47.1468 13.7811C48.0449 11.0172 51.9551 11.0172 52.8532 13.7812L60.5522 37.4762C60.9538 38.7123 62.1056 39.5491 63.4053 39.5491H88.3198C91.226 39.5491 92.4343 43.268 90.0831 44.9762L69.9269 59.6205C68.8755 60.3845 68.4355 61.7386 68.8371 62.9746L76.5361 86.6697C77.4342 89.4336 74.2707 91.732 71.9196 90.0238L51.7634 75.3794C50.7119 74.6155 49.2881 74.6155 48.2366 75.3795L28.0804 90.0238C25.7293 91.732 22.5659 89.4336 23.4639 86.6697L31.1629 62.9746C31.5645 61.7386 31.1245 60.3845 30.0731 59.6205L9.91686 44.9762C7.56572 43.268 8.77405 39.5491 11.6802 39.5491H36.5947C37.8944 39.5491 39.0462 38.7123 39.4478 37.4762L47.1468 13.7811Z",fill:"currentColor"})}),fa=te("div")({name:"EditorWrap",class:"e8nv6xj",propsAsIs:!1}),pa={kind:E.Custom,isMatch:t=>t.data.kind==="star-cell",needsHover:!0,draw:(t,e)=>{const{ctx:n,theme:a,rect:r,hoverAmount:o}=t,{rating:l}=e.data,s=a.cellHorizontalPadding;let i=r.x+s;const u=Math.min(5,Math.ceil(l));i+=8,n.beginPath();for(let c=0;ct=>D(fa,{children:[0,1,2,3,4].map(e=>D("div",{className:t.value.data.rating{t.onChange({...t.value,data:{...t.value.data,rating:e+1}})},children:D(da,{})},e))}),onPaste:(t,e)=>{const n=Number.parseInt(t);return{...e,rating:Number.isNaN(n)?0:n}}},ha=pa,va={kind:E.Custom,isMatch:t=>t.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(t,e)=>{const{ctx:n,theme:a,rect:r,hoverAmount:o,hoverX:l}=t;let{values:s,yAxis:i,color:u,graphKind:c="area",displayValues:d,hideAxis:h}=e.data;const[m,g]=i;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-m)/(g-m))));const f=a.cellHorizontalPadding,p=f+r.x,v=r.y+3,C=r.height-6,S=r.width-f*2,O=g-m,k=g<=0?v:m>=0?v+C:v+C*(g/O);if(!h&&m<=0&&g>=0&&(n.beginPath(),n.moveTo(p,k),n.lineTo(p+S,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=a.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const x=2,b=(s.length-1)*x,w=(S-b)/s.length;let M=p;for(const F of s){const N=v+C-F*C;n.moveTo(M,k),n.lineTo(M+w,k),n.lineTo(M+w,N),n.lineTo(M,N),M+=w+x}n.fillStyle=e.data.color??a.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),b=s.map((M,F)=>({x:p+x*F,y:v+C-M*C}));n.moveTo(b[0].x,b[0].y);let w=0;if(b.length>2)for(w=1;w{},onPaste:(t,e)=>e},ma=va;function $e(t,e,n,a,r,o){if(!(a<=0||r<=0)){if(typeof o=="number"&&o<=0){t.rect(e,n,a,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,a/2),tr:Math.min(o.tr,r/2,a/2),bl:Math.min(o.bl,r/2,a/2),br:Math.min(o.br,r/2,a/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),t.moveTo(e+o.tl,n),t.arcTo(e+a,n,e+a,n+o.tr,o.tr),t.arcTo(e+a,n+r,e+a-o.br,n+r,o.br),t.arcTo(e,n+r,e,n+r-o.bl,o.bl),t.arcTo(e,n,e+o.tl,n,o.tl)}}const we=20,Oe=6,ga=()=>t=>t.tagHeight/2,ba=()=>t=>t.tagHeight,ya=()=>t=>t.innerPad,Ca=te("div")({name:"EditorWrap",class:"e14vzbfa",propsAsIs:!1,vars:{"e14vzbfa-0":[ga(),"px"],"e14vzbfa-1":[ba(),"px"],"e14vzbfa-2":[ya(),"px"]}}),wa={kind:E.Custom,isMatch:t=>t.data.kind==="tags-cell",draw:(t,e)=>{var h;const{ctx:n,theme:a,rect:r}=t,{possibleTags:o,tags:l}=e.data,s={x:r.x+a.cellHorizontalPadding,y:r.y+a.cellVerticalPadding,width:r.width-2*a.cellHorizontalPadding,height:r.height-2*a.cellVerticalPadding},i=Math.max(1,Math.floor(s.height/(we+Oe)));let u=s.x,c=1,d=s.y+(s.height-i*we-(i-1)*Oe)/2;for(const m of l){const g=((h=o.find(C=>C.tag===m))==null?void 0:h.color)??a.bgBubble;n.font=`12px ${a.fontFamily}`;const p=Ce(m,n).width+Oe*2,v=we/2;if(u!==s.x&&u+p>s.x+s.width&&cs.x+s.width&&c>=i)break}return!0},provideEditor:()=>t=>{const{onChange:e,value:n}=t,{readonly:a=!1}=n,{possibleTags:r,tags:o}=n.data;return D(Ca,{tagHeight:we,innerPad:Oe,className:a?"gdg-readonly":"",children:r.map(l=>{const s=o.indexOf(l.tag)!==-1;return Pe("label",{children:[!a&&D("input",{className:"gdg-input",type:"checkbox",checked:s,onChange:()=>{const i=s?o.filter(u=>u!==l.tag):[...o,l.tag];e({...t.value,data:{...n.data,tags:i}})}}),D("div",{className:"gdg-pill "+(s?"gdg-selected":"gdg-unselected"),style:{backgroundColor:s?l.color:void 0},children:l.tag})]},l.tag)})})},onPaste:(t,e)=>({...e,tags:e.possibleTags.map(n=>n.tag).filter(n=>t.split(",").map(a=>a.trim()).includes(n))})},Sa=wa,Oa={kind:E.Custom,isMatch:t=>t.data.kind==="user-profile-cell",draw:(t,e)=>{const{ctx:n,rect:a,theme:r,imageLoader:o,col:l,row:s}=t,{image:i,name:u,initial:c,tint:d}=e.data,h=r.cellHorizontalPadding,m=Math.min(12,a.height/2-r.cellVerticalPadding),g=a.x+h,f=o.loadOrGetImage(i,l,s);n.save(),n.beginPath(),n.arc(g+m,a.y+a.height/2,m,0,Math.PI*2),n.globalAlpha=.2,n.fillStyle=d,n.fill(),n.globalAlpha=1,n.font=`600 16px ${r.fontFamily}`;const p=Ce(c[0],n);return n.fillText(c[0],g+m-p.width/2,a.y+a.height/2+ue(n,`600 16px ${r.fontFamily}`)),f!==void 0&&(n.save(),n.beginPath(),n.arc(g+m,a.y+a.height/2,m,0,Math.PI*2),n.clip(),n.drawImage(f,g,a.y+a.height/2-m,m*2,m*2),n.restore()),u!==void 0&&(n.font=r.baseFontFull,n.fillStyle=r.textDark,n.fillText(u,g+m*2+h,a.y+a.height/2+ue(n,r))),n.restore(),!0},provideEditor:()=>t=>{const{isHighlighted:e,onChange:n,value:a}=t;return D(zt,{highlight:e,autoFocus:!0,value:a.data.name??"",disabled:a.readonly??!1,onChange:r=>n({...a,data:{...a.data,name:r.target.value}})})},onPaste:(t,e)=>({...e,name:t})},xa=Oa;function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function P(t){for(var e=1;e0?K(De,--Y):0,Ie--,z===10&&(Ie=1,st--),z}function Z(){return z=Y2||He(z)>3?"":" "}function Ka(t,e){for(;--e&&Z()&&!(z<48||z>102||z>57&&z<65||z>70&&z<97););return _e(t,Ke()+(e<6&&se()==32&&Z()==32))}function $t(t){for(;Z();)switch(z){case t:return Y;case 34:case 39:t!==34&&t!==39&&$t(z);break;case 40:t===41&&$t(t);break;case 92:Z();break}return Y}function Ya(t,e){for(;Z()&&t+z!==57;)if(t+z===84&&se()===47)break;return"/*"+_e(e,Y-1)+"*"+lt(t===47?t:Z())}function Xa(t){for(;!He(se());)Z();return _e(t,Y)}function qa(t){return nr(Xe("",null,null,null,[""],t=tr(t),0,[0],t))}function Xe(t,e,n,a,r,o,l,s,i){for(var u=0,c=0,d=l,h=0,m=0,g=0,f=1,p=1,v=1,C=0,S="",O=r,k=o,x=a,b=S;p;)switch(g=C,C=Z()){case 40:if(g!=108&&b.charCodeAt(d-1)==58){Ft(b+=R(Ye(C),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:b+=Ye(C);break;case 9:case 10:case 13:case 32:b+=ja(g);break;case 92:b+=Ka(Ke()-1,7);continue;case 47:switch(se()){case 42:case 47:We(Za(Ya(Z(),Ke()),e,n),i);break;default:b+="/"}break;case 123*f:s[u++]=ie(b)*v;case 125*f:case 59:case 0:switch(C){case 0:case 125:p=0;case 59+c:m>0&&ie(b)-d&&We(m>32?dn(b+";",a,n,d-1):dn(R(b," ","")+";",a,n,d-2),i);break;case 59:b+=";";default:if(We(x=cn(b,e,n,u,c,r,s,S,O=[],k=[],d),o),C===123)if(c===0)Xe(b,e,x,x,O,o,d,s,k);else switch(h){case 100:case 109:case 115:Xe(t,x,x,a&&We(cn(t,x,x,0,0,r,s,S,r,O=[],d),k),r,k,d,s,a?O:k);break;default:Xe(b,x,x,x,[""],k,0,s,k)}}u=c=m=0,f=v=1,S=b="",d=l;break;case 58:d=1+ie(b),m=g;default:if(f<1){if(C==123)--f;else if(C==125&&f++==0&&Ga()==125)continue}switch(b+=lt(C),C*f){case 38:v=c>0?1:(b+="\f",-1);break;case 44:s[u++]=(ie(b)-1)*v,v=1;break;case 64:se()===45&&(b+=Ye(Z())),h=se(),c=d=ie(S=b+=Xa(Ke())),C++;break;case 45:g===45&&ie(b)==2&&(f=0)}}return o}function cn(t,e,n,a,r,o,l,s,i,u,c){for(var d=r-1,h=r===0?o:[""],m=Ut(h),g=0,f=0,p=0;g0?h[v]+" "+C:R(C,/&\f/g,h[v])))&&(i[p++]=S);return ut(t,e,n,r===0?Bt:s,i,u,c)}function Za(t,e,n){return ut(t,e,n,Zn,lt(Ua()),Ae(t,2,-2),0)}function dn(t,e,n,a){return ut(t,e,n,Wt,Ae(t,0,a),Ae(t,a+1,-1),a)}function rr(t,e){switch(za(t,e)){case 5103:return T+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return T+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return T+t+Qe+t+G+t+t;case 6828:case 4268:return T+t+G+t+t;case 6165:return T+t+G+"flex-"+t+t;case 5187:return T+t+R(t,/(\w+).+(:[^]+)/,T+"box-$1$2"+G+"flex-$1$2")+t;case 5443:return T+t+G+"flex-item-"+R(t,/flex-|-self/,"")+t;case 4675:return T+t+G+"flex-line-pack"+R(t,/align-content|flex-|-self/,"")+t;case 5548:return T+t+G+R(t,"shrink","negative")+t;case 5292:return T+t+G+R(t,"basis","preferred-size")+t;case 6060:return T+"box-"+R(t,"-grow","")+T+t+G+R(t,"grow","positive")+t;case 4554:return T+R(t,/([^-])(transform)/g,"$1"+T+"$2")+t;case 6187:return R(R(R(t,/(zoom-|grab)/,T+"$1"),/(image-set)/,T+"$1"),t,"")+t;case 5495:case 3959:return R(t,/(image-set\([^]*)/,T+"$1$`$1");case 4968:return R(R(t,/(.+:)(flex-)?(.*)/,T+"box-pack:$3"+G+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+T+t+t;case 4095:case 3583:case 4068:case 2532:return R(t,/(.+)-inline(.+)/,T+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ie(t)-1-e>6)switch(K(t,e+1)){case 109:if(K(t,e+4)!==45)break;case 102:return R(t,/(.+:)(.+)-([^]+)/,"$1"+T+"$2-$3$1"+Qe+(K(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Ft(t,"stretch")?rr(R(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(K(t,e+1)!==115)break;case 6444:switch(K(t,ie(t)-3-(~Ft(t,"!important")&&10))){case 107:return R(t,":",":"+T)+t;case 101:return R(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+T+(K(t,14)===45?"inline-":"")+"box$3$1"+T+"$2$3$1"+G+"$2box$3")+t}break;case 5936:switch(K(t,e+11)){case 114:return T+t+G+R(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return T+t+G+R(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return T+t+G+R(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return T+t+G+t+t}return t}function Me(t,e){for(var n="",a=Ut(t),r=0;r-1&&!t.return)switch(t.type){case Wt:t.return=rr(t.value,t.length);break;case Jn:return Me([Ve(t,{value:R(t.value,"@","@"+T)})],a);case Bt:if(t.length)return Wa(t.props,function(r){switch(Ba(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Me([Ve(t,{props:[R(r,/:(read-\w+)/,":"+Qe+"$1")]})],a);case"::placeholder":return Me([Ve(t,{props:[R(r,/:(plac\w+)/,":"+T+"input-$1")]}),Ve(t,{props:[R(r,/:(plac\w+)/,":"+Qe+"$1")]}),Ve(t,{props:[R(r,/:(plac\w+)/,G+"input-$1")]})],a)}return""})}}var no=function(e,n,a){for(var r=0,o=0;r=o,o=se(),r===38&&o===12&&(n[a]=1),!He(o);)Z();return _e(e,Y)},ro=function(e,n){var a=-1,r=44;do switch(He(r)){case 0:r===38&&se()===12&&(n[a]=1),e[a]+=no(Y-1,n,a);break;case 2:e[a]+=Ye(r);break;case 4:if(r===44){e[++a]=se()===58?"&\f":"",n[a]=e[a].length;break}default:e[a]+=lt(r)}while(r=Z());return e},ao=function(e,n){return nr(ro(tr(e),n))},fn=new WeakMap,oo=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,a=e.parent,r=e.column===a.column&&e.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!fn.get(a))&&!r){fn.set(e,!0);for(var o=[],l=ao(n,o),s=a.props,i=0,u=0;io(A,{children:o(M,{title:"Group collapse",description:i(D,{children:[i(b,{children:["Through clever usage of ",o(k,{children:"onGroupHeaderClicked"})," you can implement group collapsing. This is a very basic version however it is possible to go much further."]}),o(S,{children:"Cells under a certain size will not attempt to render to save some frames."})]}),children:o(e,{})})})]};function E(e){const[s,n]=t.useState([]),C=t.useCallback((r,l)=>{const u=e[r].group??"";n(p=>p.includes(u)?p.filter(G=>G!==u):[...p,u]),l.preventDefault()},[e]),[g,h]=t.useState(x.empty()),f=t.useCallback((r,l)=>{l!=="group"&&h(r)},[]);return{columns:t.useMemo(()=>e.map(r=>s.includes(r.group??"")?{...r,width:8,hasMenu:!0}:{...r,hasMenu:!0}),[s,e]),onGroupHeaderClicked:C,selectedColumns:g,onSelectedColumnsChange:f}}const a=()=>{const{cols:e,getCellContent:s}=w(100,!0,!0),n=E(e);return o(H,{...v,...n,getCellContent:s,groupHeaderHeight:24,rows:1e3,rowMarkers:"both"})};var m,c,d;a.parameters={...a.parameters,docs:{...(m=a.parameters)==null?void 0:m.docs,source:{originalSource:`() => { +import{j as o,a as i,F as D}from"./marked.esm-dbrxtycE.js";import{R as t}from"./index-BMVQvedj.js";import{D as H}from"./data-editor-all-ZeeWpldS.js";import{B as M,D as b,P as k,M as S,u as w,d as v}from"./utils-MADpeXg5.js";import{C as x}from"./image-window-loader-ggeJlWLo.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const L={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>o(A,{children:o(M,{title:"Group collapse",description:i(D,{children:[i(b,{children:["Through clever usage of ",o(k,{children:"onGroupHeaderClicked"})," you can implement group collapsing. This is a very basic version however it is possible to go much further."]}),o(S,{children:"Cells under a certain size will not attempt to render to save some frames."})]}),children:o(e,{})})})]};function E(e){const[s,n]=t.useState([]),C=t.useCallback((r,l)=>{const u=e[r].group??"";n(p=>p.includes(u)?p.filter(G=>G!==u):[...p,u]),l.preventDefault()},[e]),[g,h]=t.useState(x.empty()),f=t.useCallback((r,l)=>{l!=="group"&&h(r)},[]);return{columns:t.useMemo(()=>e.map(r=>s.includes(r.group??"")?{...r,width:8,hasMenu:!0}:{...r,hasMenu:!0}),[s,e]),onGroupHeaderClicked:C,selectedColumns:g,onSelectedColumnsChange:f}}const a=()=>{const{cols:e,getCellContent:s}=w(100,!0,!0),n=E(e);return o(H,{...v,...n,getCellContent:s,groupHeaderHeight:24,rows:1e3,rowMarkers:"both"})};var m,c,d;a.parameters={...a.parameters,docs:{...(m=a.parameters)==null?void 0:m.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/column-groups.stories-KDyARjGV.js b/docs/assets/column-groups.stories-hfw5JFYP.js similarity index 78% rename from docs/assets/column-groups.stories-KDyARjGV.js rename to docs/assets/column-groups.stories-hfw5JFYP.js index d6b113f3e..e0e768fab 100644 --- a/docs/assets/column-groups.stories-KDyARjGV.js +++ b/docs/assets/column-groups.stories-hfw5JFYP.js @@ -1,4 +1,4 @@ -import{j as r,a as p}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-zTb9g2fv.js";import{B as u,D as d,P as c,u as g,d as C}from"./utils-qU2KzddR.js";import{a as G}from"./image-window-loader--5E_ifQX.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(D,{children:r(u,{title:"Column Grouping",description:p(d,{children:["Columns in the data grid may be grouped by setting their ",r(c,{children:"group"})," ","property."]}),children:r(t,{})})})]},o=()=>{const{cols:t,getCellContent:i}=g(20,!0,!0);return r(l,{...C,getCellContent:i,onGroupHeaderRenamed:(e,m)=>window.alert(`Please rename group ${e} to ${m}`),columns:t,rows:1e3,getGroupDetails:e=>({name:e,icon:e===""?void 0:G.HeaderCode}),rowMarkers:"both"})};var a,n,s;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { +import{j as r,a as p}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-ZeeWpldS.js";import{B as u,D as d,P as c,u as g,d as C}from"./utils-MADpeXg5.js";import{a as G}from"./image-window-loader-ggeJlWLo.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(D,{children:r(u,{title:"Column Grouping",description:p(d,{children:["Columns in the data grid may be grouped by setting their ",r(c,{children:"group"})," ","property."]}),children:r(t,{})})})]},o=()=>{const{cols:t,getCellContent:i}=g(20,!0,!0);return r(l,{...C,getCellContent:i,onGroupHeaderRenamed:(e,m)=>window.alert(`Please rename group ${e} to ${m}`),columns:t,rows:1e3,getGroupDetails:e=>({name:e,icon:e===""?void 0:G.HeaderCode}),rowMarkers:"both"})};var a,n,s;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/content-alignment.stories-M5AzCjo1.js b/docs/assets/content-alignment.stories-xW0P0pcx.js similarity index 85% rename from docs/assets/content-alignment.stories-M5AzCjo1.js rename to docs/assets/content-alignment.stories-xW0P0pcx.js index 092549118..9046004fd 100644 --- a/docs/assets/content-alignment.stories-M5AzCjo1.js +++ b/docs/assets/content-alignment.stories-xW0P0pcx.js @@ -1,4 +1,4 @@ -import{j as t,a as p}from"./marked.esm-dbrxtycE.js";import{R as C}from"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-zTb9g2fv.js";import{B as g,D as u,P as o,a as f,d as A}from"./utils-qU2KzddR.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>t(h,{children:t(g,{title:"Content Alignment",description:p(u,{children:["You can customize the content alignment by setting ",t(o,{children:"contentAlign"})," of a cell to ",t(o,{children:"left"}),", ",t(o,{children:"right"})," or ",t(o,{children:"center"}),"."]}),children:t(l,{})})})]},r=()=>{const{cols:l,getCellContent:n}=f(),m=C.useCallback(e=>{const[i,D]=e;return i===3?{...n(e),contentAlign:"center"}:i===4?{...n(e),contentAlign:"right"}:i===5?{...n(e),contentAlign:"left"}:n(e)},[n]);return t(d,{...A,getCellContent:m,columns:l,rows:300})};var c,s,a;r.parameters={...r.parameters,docs:{...(c=r.parameters)==null?void 0:c.docs,source:{originalSource:`() => { +import{j as t,a as p}from"./marked.esm-dbrxtycE.js";import{R as C}from"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-ZeeWpldS.js";import{B as g,D as u,P as o,a as f,d as A}from"./utils-MADpeXg5.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>t(h,{children:t(g,{title:"Content Alignment",description:p(u,{children:["You can customize the content alignment by setting ",t(o,{children:"contentAlign"})," of a cell to ",t(o,{children:"left"}),", ",t(o,{children:"right"})," or ",t(o,{children:"center"}),"."]}),children:t(l,{})})})]},r=()=>{const{cols:l,getCellContent:n}=f(),m=C.useCallback(e=>{const[i,D]=e;return i===3?{...n(e),contentAlign:"center"}:i===4?{...n(e),contentAlign:"right"}:i===5?{...n(e),contentAlign:"left"}:n(e)},[n]);return t(d,{...A,getCellContent:m,columns:l,rows:300})};var c,s,a;r.parameters={...r.parameters,docs:{...(c=r.parameters)==null?void 0:c.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/controlled-search.stories-1bZF0uVx.js b/docs/assets/controlled-search.stories-Wwgq4vZY.js similarity index 89% rename from docs/assets/controlled-search.stories-1bZF0uVx.js rename to docs/assets/controlled-search.stories-Wwgq4vZY.js index 47a57b2ab..2dedbf41f 100644 --- a/docs/assets/controlled-search.stories-1bZF0uVx.js +++ b/docs/assets/controlled-search.stories-Wwgq4vZY.js @@ -1,4 +1,4 @@ -import{j as t,F as R,a as y}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{C as i,u as V}from"./image-window-loader--5E_ifQX.js";import{D as v}from"./data-editor-all-zTb9g2fv.js";import{B as D,D as E,P as K,a as k,d as F}from"./utils-qU2KzddR.js";import{S as P}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(P,{children:t(D,{title:"Controlling search results",description:t(R,{children:y(E,{children:["Search results can be controlled via ",t(K,{children:"searchResults"}),". You can implement any search algorithm you want, even a silly one."]})}),children:t(r,{})})})]},n=()=>{const{cols:r,getCellContent:p,onColumnResize:S,setCellValue:d}=k(),[C,l]=s.useState(!1),[f,g]=s.useState({rows:i.empty(),columns:i.empty()});V("keydown",s.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.code==="KeyF"&&(l(o=>!o),e.stopPropagation(),e.preventDefault())},[]),window,!1,!0);const[a,c]=s.useState(""),w=s.useMemo(()=>{const e=[];for(let o=0;o{l(!1),c("")},rows:1e4})};var u,h,m;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{j as t,F as R,a as y}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{C as i,u as V}from"./image-window-loader-ggeJlWLo.js";import{D as v}from"./data-editor-all-ZeeWpldS.js";import{B as D,D as E,P as K,a as k,d as F}from"./utils-MADpeXg5.js";import{S as P}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(P,{children:t(D,{title:"Controlling search results",description:t(R,{children:y(E,{children:["Search results can be controlled via ",t(K,{children:"searchResults"}),". You can implement any search algorithm you want, even a silly one."]})}),children:t(r,{})})})]},n=()=>{const{cols:r,getCellContent:p,onColumnResize:S,setCellValue:d}=k(),[C,l]=s.useState(!1),[f,g]=s.useState({rows:i.empty(),columns:i.empty()});V("keydown",s.useCallback(e=>{(e.ctrlKey||e.metaKey)&&e.code==="KeyF"&&(l(o=>!o),e.stopPropagation(),e.preventDefault())},[]),window,!1,!0);const[a,c]=s.useState(""),w=s.useMemo(()=>{const e=[];for(let o=0;o{l(!1),c("")},rows:1e4})};var u,h,m;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/controlled-selection.stories-mNmRkBMo.js b/docs/assets/controlled-selection.stories-lniLWk35.js similarity index 93% rename from docs/assets/controlled-selection.stories-mNmRkBMo.js rename to docs/assets/controlled-selection.stories-lniLWk35.js index 1de19f9f9..c9c62f0bd 100644 --- a/docs/assets/controlled-selection.stories-mNmRkBMo.js +++ b/docs/assets/controlled-selection.stories-lniLWk35.js @@ -1,4 +1,4 @@ -import{j as e,a as w}from"./marked.esm-dbrxtycE.js";import{R as f}from"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-zTb9g2fv.js";import{u as x,B as y,D,P as p,d as G}from"./utils-qU2KzddR.js";import{C as d}from"./image-window-loader--5E_ifQX.js";import{S as N}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[c=>e(N,{children:e(c,{})})]},l=()=>{var u,m;const{cols:c,getCellContent:C}=x(30,!0,!0),[a,i]=f.useState({columns:d.empty(),rows:d.empty()});return e(y,{title:"Controlled Selection",description:w(D,{children:["The selection of the grid can be controlled via ",e(p,{children:"GridSelection"})," and"," ",e(p,{children:"onGridSelectionChange"}),".",e("input",{type:"range",min:0,max:29,value:((u=a.current)==null?void 0:u.cell[0])??0,onChange:s=>{const t=s.target.valueAsNumber;i(n=>{var r,o;return{...n,current:{cell:[t,((r=n.current)==null?void 0:r.cell[1])??0],range:{x:t,y:((o=n.current)==null?void 0:o.cell[1])??0,width:1,height:1},rangeStack:[]}}})}}),e("input",{type:"range",min:0,max:99,value:((m=a.current)==null?void 0:m.cell[1])??0,onChange:s=>{const t=s.target.valueAsNumber;i(n=>{var r,o;return{...n,current:{cell:[((r=n.current)==null?void 0:r.cell[0])??0,t],range:{x:((o=n.current)==null?void 0:o.cell[0])??0,y:t,width:1,height:1},rangeStack:[]}}})}})]}),children:e(v,{...G,getCellContent:C,gridSelection:a,onGridSelectionChange:i,columns:c,rows:100,rowMarkers:"both"})})};var g,h,S;l.parameters={...l.parameters,docs:{...(g=l.parameters)==null?void 0:g.docs,source:{originalSource:`() => { +import{j as e,a as w}from"./marked.esm-dbrxtycE.js";import{R as f}from"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-ZeeWpldS.js";import{u as x,B as y,D,P as p,d as G}from"./utils-MADpeXg5.js";import{C as d}from"./image-window-loader-ggeJlWLo.js";import{S as N}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[c=>e(N,{children:e(c,{})})]},l=()=>{var u,m;const{cols:c,getCellContent:C}=x(30,!0,!0),[a,i]=f.useState({columns:d.empty(),rows:d.empty()});return e(y,{title:"Controlled Selection",description:w(D,{children:["The selection of the grid can be controlled via ",e(p,{children:"GridSelection"})," and"," ",e(p,{children:"onGridSelectionChange"}),".",e("input",{type:"range",min:0,max:29,value:((u=a.current)==null?void 0:u.cell[0])??0,onChange:s=>{const t=s.target.valueAsNumber;i(n=>{var r,o;return{...n,current:{cell:[t,((r=n.current)==null?void 0:r.cell[1])??0],range:{x:t,y:((o=n.current)==null?void 0:o.cell[1])??0,width:1,height:1},rangeStack:[]}}})}}),e("input",{type:"range",min:0,max:99,value:((m=a.current)==null?void 0:m.cell[1])??0,onChange:s=>{const t=s.target.valueAsNumber;i(n=>{var r,o;return{...n,current:{cell:[((r=n.current)==null?void 0:r.cell[0])??0,t],range:{x:((o=n.current)==null?void 0:o.cell[0])??0,y:t,width:1,height:1},rangeStack:[]}}})}})]}),children:e(v,{...G,getCellContent:C,gridSelection:a,onGridSelectionChange:i,columns:c,rows:100,rowMarkers:"both"})})};var g,h,S;l.parameters={...l.parameters,docs:{...(g=l.parameters)==null?void 0:g.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/copy-support.stories-5RB4fQs8.js b/docs/assets/copy-support.stories-WvtcgNF-.js similarity index 79% rename from docs/assets/copy-support.stories-5RB4fQs8.js rename to docs/assets/copy-support.stories-WvtcgNF-.js index b8f4e79c3..1330cafee 100644 --- a/docs/assets/copy-support.stories-5RB4fQs8.js +++ b/docs/assets/copy-support.stories-WvtcgNF-.js @@ -1,4 +1,4 @@ -import{j as e,a as r,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-zTb9g2fv.js";import{B as c,D as u,P as C,M as h,u as g,d as f}from"./utils-qU2KzddR.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(D,{children:e(c,{title:"Copy support",description:r(m,{children:[r(u,{children:["Large amounts of data can be copied and customized using"," ",e(C,{children:"getCellsForSelection"}),"."]}),e(h,{children:"The data is copied into a format ready to be pasted into Excel or Google Sheets"}),e("textarea",{placeholder:"Copy something below and paste it here...",style:{width:"100%",marginBottom:20,borderRadius:9,minHeight:200,padding:10}})]}),children:e(t,{})})})]},o=()=>{const{cols:t,getCellContent:i,onColumnResize:l,setCellValue:p}=g(10,!1);return e(d,{...f,getCellContent:i,rowMarkers:"both",columns:t,onCellEdited:p,onColumnResize:l,rows:400})};var a,s,n;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { +import{j as e,a as r,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-ZeeWpldS.js";import{B as c,D as u,P as C,M as h,u as g,d as f}from"./utils-MADpeXg5.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(D,{children:e(c,{title:"Copy support",description:r(m,{children:[r(u,{children:["Large amounts of data can be copied and customized using"," ",e(C,{children:"getCellsForSelection"}),"."]}),e(h,{children:"The data is copied into a format ready to be pasted into Excel or Google Sheets"}),e("textarea",{placeholder:"Copy something below and paste it here...",style:{width:"100%",marginBottom:20,borderRadius:9,minHeight:200,padding:10}})]}),children:e(t,{})})})]},o=()=>{const{cols:t,getCellContent:i,onColumnResize:l,setCellValue:p}=g(10,!1);return e(d,{...f,getCellContent:i,rowMarkers:"both",columns:t,onCellEdited:p,onColumnResize:l,rows:400})};var a,s,n;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/custom-header-icons.stories-TyvbcE1O.js b/docs/assets/custom-header-icons.stories-UqnmJb04.js similarity index 95% rename from docs/assets/custom-header-icons.stories-TyvbcE1O.js rename to docs/assets/custom-header-icons.stories-UqnmJb04.js index 6583e9ea5..053f9714e 100644 --- a/docs/assets/custom-header-icons.stories-TyvbcE1O.js +++ b/docs/assets/custom-header-icons.stories-UqnmJb04.js @@ -1,4 +1,4 @@ -import{j as l,F as u,a as f}from"./marked.esm-dbrxtycE.js";import{R as t}from"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-zTb9g2fv.js";import{B as h,D as g,P as v,a as M,d as H}from"./utils-qU2KzddR.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const A={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>l(w,{children:l(h,{title:"Custom header icons",description:l(u,{children:f(g,{children:["You can provide overrides for the default icons by passing the"," ",l(v,{children:"headerIcons"})," prop."]})}),children:l(o,{})})})]},r=()=>{const{cols:o,getCellContent:s,onColumnResize:C,setCellValue:a}=M(),c=t.useMemo(()=>{const e=[...o];return e[3]={...e[3],title:"CUSTOM ICON",icon:"custom",width:200},e},[o]),p=t.useMemo(()=>({custom:e=>` +import{j as l,F as u,a as f}from"./marked.esm-dbrxtycE.js";import{R as t}from"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ZeeWpldS.js";import{B as h,D as g,P as v,a as M,d as H}from"./utils-MADpeXg5.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const A={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>l(w,{children:l(h,{title:"Custom header icons",description:l(u,{children:f(g,{children:["You can provide overrides for the default icons by passing the"," ",l(v,{children:"headerIcons"})," prop."]})}),children:l(o,{})})})]},r=()=>{const{cols:o,getCellContent:s,onColumnResize:C,setCellValue:a}=M(),c=t.useMemo(()=>{const e=[...o];return e[3]={...e[3],title:"CUSTOM ICON",icon:"custom",width:200},e},[o]),p=t.useMemo(()=>({custom:e=>` diff --git a/docs/assets/custom-header.stories-xcKX1MW6.js b/docs/assets/custom-header.stories-WQ7yFD8e.js similarity index 88% rename from docs/assets/custom-header.stories-xcKX1MW6.js rename to docs/assets/custom-header.stories-WQ7yFD8e.js index 332aba2f0..90f814e7d 100644 --- a/docs/assets/custom-header.stories-xcKX1MW6.js +++ b/docs/assets/custom-header.stories-WQ7yFD8e.js @@ -1,4 +1,4 @@ -import{j as o}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as f,D as x,u as g,d as C}from"./utils-qU2KzddR.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>o(y,{children:o(f,{title:"Custom Drawing",description:o(x,{children:"You can draw over or under most objects in the grid."}),children:o(n,{})})})]},a=()=>{const{cols:n,getCellContent:p}=g(1e3,!0,!0),w=s.useCallback((c,l)=>{const{ctx:e,rect:t}=c;e.beginPath(),e.rect(t.x,t.y,t.width,t.height);const r=e.createLinearGradient(0,t.y,0,t.y+t.height);r.addColorStop(0,"#ff00d934"),r.addColorStop(1,"#00a2ff34"),e.fillStyle=r,e.fill(),l()},[]),h=s.useCallback((c,l)=>{l();const{ctx:e,rect:t}=c,r=7;e.beginPath(),e.moveTo(t.x+t.width-r,t.y+1),e.lineTo(t.x+t.width,t.y+r+1),e.lineTo(t.x+t.width,t.y+1),e.closePath(),e.save(),e.fillStyle="#ff0000",e.fill(),e.restore()},[]);return o(u,{...C,getCellContent:p,columns:n,drawHeader:w,drawCell:h,rows:3e3,rowMarkers:"both"})};var i,d,m;a.parameters={...a.parameters,docs:{...(i=a.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as o}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as f,D as x,u as g,d as C}from"./utils-MADpeXg5.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const B={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>o(y,{children:o(f,{title:"Custom Drawing",description:o(x,{children:"You can draw over or under most objects in the grid."}),children:o(n,{})})})]},a=()=>{const{cols:n,getCellContent:p}=g(1e3,!0,!0),w=s.useCallback((c,l)=>{const{ctx:e,rect:t}=c;e.beginPath(),e.rect(t.x,t.y,t.width,t.height);const r=e.createLinearGradient(0,t.y,0,t.y+t.height);r.addColorStop(0,"#ff00d934"),r.addColorStop(1,"#00a2ff34"),e.fillStyle=r,e.fill(),l()},[]),h=s.useCallback((c,l)=>{l();const{ctx:e,rect:t}=c,r=7;e.beginPath(),e.moveTo(t.x+t.width-r,t.y+1),e.lineTo(t.x+t.width,t.y+r+1),e.lineTo(t.x+t.width,t.y+1),e.closePath(),e.save(),e.fillStyle="#ff0000",e.fill(),e.restore()},[]);return o(u,{...C,getCellContent:p,columns:n,drawHeader:w,drawCell:h,rows:3e3,rowMarkers:"both"})};var i,d,m;a.parameters={...a.parameters,docs:{...(i=a.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/data-editor-all-ZeeWpldS.js b/docs/assets/data-editor-all-ZeeWpldS.js new file mode 100644 index 000000000..67525dbe4 --- /dev/null +++ b/docs/assets/data-editor-all-ZeeWpldS.js @@ -0,0 +1,124 @@ +var Nl=Object.defineProperty;var Ol=(e,o,l)=>o in e?Nl(e,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[o]=l;var dn=(e,o,l)=>(Ol(e,typeof o!="symbol"?o+"":o,l),l);import{s as vn,a as Qt,j,F as tr}from"./marked.esm-dbrxtycE.js";import{r as i,R as Re}from"./index-BMVQvedj.js";import{_ as Wl}from"./iframe-alOpk4ZG.js";import{G as Q,b as Go,i as Ho,r as or,c as Po,C as X,g as fr,d as Ul,w as kt,e as Bl,f as Vl,m as fn,h as nr,I as Do,p as _l,j as Xl,t as Yl,k as ql,l as At,o as rr,n as lr,q as jl,s as Eo,v as Io,x as Zl,y as Jl,z as Ql,A as ei,B as ti,D as ir,E as Jt,F as oi,H as ni,J as cr,K as ri,u as hn,L as li,M as ii,T as ci,N as sr,O as si,P as ai}from"./image-window-loader-ggeJlWLo.js";import{c as Mt,r as Gt,d as ui}from"./throttle-7EuXLZa7.js";import{u as di,f as ar}from"./flatten-qRvRBp6y.js";import{G as fi}from"./scrolling-data-grid-wnX0bxop.js";const Z='',hi=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z}`},gi=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z}`},vi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + `},mi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Ci=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},hr=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + + + `},wi=e=>{const o=e.bgColor;return`${Z} + + + + +`},pi=hr,bi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},yi=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + + + + + + `},xi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + +`},Ri=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},Mi=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},ki=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Si=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + + `},zi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + +`},Ti=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + + `},Li=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Hi=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},Di=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},Ei=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Ii=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + + + +`},$i=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},Fi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Ai=e=>{const o=e.fgColor,l=e.bgColor;return` + ${Z} + + + `},Gi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + + +`},Pi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} + + +`},Ki=e=>{const o=e.fgColor;return` + + + `},Ni=e=>{const o=e.fgColor;return` + + + +`},Oi={headerRowID:hi,headerNumber:vi,headerCode:gi,headerString:mi,headerBoolean:Ci,headerAudioUri:pi,headerVideoUri:bi,headerEmoji:yi,headerImage:xi,headerUri:hr,headerPhone:Ri,headerMarkdown:Mi,headerDate:ki,headerTime:Si,headerEmail:zi,headerReference:Ti,headerIfThenElse:Li,headerSingleValue:Hi,headerLookup:Di,headerTextTemplate:Ei,headerMath:Ii,headerRollup:$i,headerJoinStrings:Fi,headerSplitString:Ai,headerGeoDistance:Gi,headerArray:Pi,rowOwnerOverlay:Ki,protectedColumnOverlay:Ni,renameIcon:wi},Wi=vn("div")({name:"SearchWrapper",class:"slyseh9",propsAsIs:!1}),Ui=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})}),Bi=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})}),Vi=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}),_i=10,Xi=e=>{const{canvasRef:o,cellYOffset:l,rows:u,columns:w,searchInputRef:x,searchValue:p,searchResults:z,onSearchValueChange:M,getCellsForSelection:k,onSearchResultsChanged:C,showSearch:S=!1,onSearchClose:H}=e,[K]=i.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[N,ne]=i.useState(""),he=p??N,U=i.useCallback(E=>{ne(E),M==null||M(E)},[M]),[F,O]=i.useState(),Ce=i.useRef(F);Ce.current=F,i.useEffect(()=>{z!==void 0&&(z.length>0?O(E=>({rowsSearched:u,results:z.length,selectedIndex:(E==null?void 0:E.selectedIndex)??-1})):O(void 0))},[u,z]);const se=i.useRef();se.current===void 0&&(se.current=new AbortController);const de=i.useRef(),[Y,ee]=i.useState([]),te=z??Y,_=i.useCallback(()=>{de.current!==void 0&&(window.cancelAnimationFrame(de.current),de.current=void 0,se.current.abort())},[]),je=i.useRef(l);je.current=l;const Le=i.useCallback(E=>{const re=new RegExp(E.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=je.current,De=Math.min(10,u),Pe=0;O(void 0),ee([]);const ft=[],to=async()=>{var Ve;if(k===void 0)return;const Oo=performance.now(),Kt=u-Pe;let ht=k({x:0,y:ae,width:w.length,height:Math.min(De,Kt,u-ae)},se.current.signal);typeof ht=="function"&&(ht=await ht());let oo=!1;for(const[we,Ee]of ht.entries())for(const[Wo,Ze]of Ee.entries()){let Je;switch(Ze.kind){case Q.Text:case Q.Number:Je=Ze.displayData;break;case Q.Uri:case Q.Markdown:Je=Ze.data;break;case Q.Boolean:Je=typeof Ze.data=="boolean"?Ze.data.toString():void 0;break;case Q.Image:case Q.Bubble:Je=Ze.data.join("🐳");break;case Q.Custom:Je=Ze.copyData;break}Je!==void 0&&re.test(Je)&&(ft.push([Wo,we+ae]),oo=!0)}const no=performance.now();oo&&ee([...ft]),Pe+=ht.length,Go(Pe<=u);const ot=((Ve=Ce.current)==null?void 0:Ve.selectedIndex)??-1;O({results:ft.length,rowsSearched:Pe,selectedIndex:ot}),C==null||C(ft,ot),ae+De>=u?ae=0:ae+=De;const gt=no-Oo,vt=Math.max(gt,1),mt=_i/vt;De=Math.ceil(De*mt),Pe{var E;H==null||H(),O(void 0),ee([]),C==null||C([],-1),_(),(E=o==null?void 0:o.current)==null||E.focus()},[_,o,H,C]),eo=i.useCallback(E=>{U(E.target.value),z===void 0&&(E.target.value===""?(O(void 0),ee([]),_()):Le(E.target.value))},[Le,_,U,z]);i.useEffect(()=>{S&&x.current!==null&&(U(""),x.current.focus({preventScroll:!0}))},[S,x,U]);const dt=i.useCallback(E=>{var ae;if((ae=E==null?void 0:E.stopPropagation)==null||ae.call(E),F===void 0)return;const re=(F.selectedIndex+1)%F.results;O({...F,selectedIndex:re}),C==null||C(te,re)},[F,C,te]),He=i.useCallback(E=>{var ae;if((ae=E==null?void 0:E.stopPropagation)==null||ae.call(E),F===void 0)return;let re=(F.selectedIndex-1)%F.results;re<0&&(re+=F.results),O({...F,selectedIndex:re}),C==null||C(te,re)},[C,te,F]),Ae=i.useCallback(E=>{(E.ctrlKey||E.metaKey)&&E.nativeEvent.code==="KeyF"||E.key==="Escape"?(Be(),E.stopPropagation(),E.preventDefault()):E.key==="Enter"&&(E.shiftKey?He():dt())},[Be,dt,He]);i.useEffect(()=>()=>{_()},[_]);const[Pt,Ge]=i.useState(!1);i.useEffect(()=>{if(S)Ge(!0);else{const E=setTimeout(()=>Ge(!1),150);return()=>clearTimeout(E)}},[S]);const No=i.useMemo(()=>{if(!S&&!Pt)return null;let E;F!==void 0&&(E=F.results>=1e3?"over 1000":`${F.results} result${F.results!==1?"s":""}`,F.selectedIndex>=0&&(E=`${F.selectedIndex+1} of ${E}`));const re=Pe=>{Pe.stopPropagation()},De={width:`${Math.floor(((F==null?void 0:F.rowsSearched)??0)/u*100)}%`};return Qt(Wi,{className:S?"":"out",onMouseDown:re,onMouseMove:re,onMouseUp:re,onClick:re,children:[Qt("div",{className:"gdg-search-bar-inner",children:[j("input",{id:K,"aria-hidden":!S,"data-testid":"search-input",ref:x,onChange:eo,value:he,tabIndex:S?void 0:-1,onKeyDownCapture:Ae}),j("button",{"aria-label":"Previous Result","aria-hidden":!S,tabIndex:S?void 0:-1,onClick:He,disabled:((F==null?void 0:F.results)??0)===0,children:Ui}),j("button",{"aria-label":"Next Result","aria-hidden":!S,tabIndex:S?void 0:-1,onClick:dt,disabled:((F==null?void 0:F.results)??0)===0,children:Bi}),H!==void 0&&j("button",{"aria-label":"Close Search","aria-hidden":!S,"data-testid":"search-close-button",tabIndex:S?void 0:-1,onClick:Be,children:Vi})]}),F!==void 0?Qt(tr,{children:[j("div",{className:"gdg-search-status",children:j("div",{"data-testid":"search-result-area",children:E})}),j("div",{className:"gdg-search-progress",style:De})]}):j("div",{className:"gdg-search-status",children:j("label",{htmlFor:K,children:"Type to search"})})]})},[S,Pt,F,u,K,x,eo,he,Ae,He,dt,H,Be]);return Qt(tr,{children:[j(fi,{prelightCells:te,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),No]})},Yi=Xi;class qi extends i.PureComponent{constructor(){super(...arguments);dn(this,"wrapperRef",i.createRef());dn(this,"clickOutside",l=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(l))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(l.target)){let u=l.target;for(;u!==null;){if(u.classList.contains("click-outside-ignore"))return;u=u.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:l,isOutsideClick:u,...w}=this.props;return j("div",{...w,ref:this.wrapperRef,children:this.props.children})}}const ji=()=>e=>Math.max(16,e.targetHeight-10),Zi=vn("input")({name:"RenameInput",class:"r1fzhvm4",propsAsIs:!1,vars:{"r1fzhvm4-0":[ji(),"px"]}}),Ji=e=>{const{bounds:o,group:l,onClose:u,canvasBounds:w,onFinish:x}=e,[p,z]=Re.useState(l);return j(qi,{style:{position:"absolute",left:o.x-w.left+1,top:o.y-w.top,width:o.width-2,height:o.height},className:"c181oggi",onClickOutside:u,children:j(Zi,{targetHeight:o.height,"data-testid":"group-rename-input",value:p,onBlur:u,onFocus:M=>M.target.setSelectionRange(0,p.length),onChange:M=>z(M.target.value),onKeyDown:M=>{M.key==="Enter"?x(p):M.key==="Escape"&&u()},autoFocus:!0})})},gn=150;function Qi(e,o,l,u){var x;const w=u(o);return((x=w==null?void 0:w.measure)==null?void 0:x.call(w,e,o,l))??gn}function gr(e,o,l,u,w,x,p,z,M){let k=0;const C=w===void 0?[]:w.map(H=>{const K=Qi(e,H[u],o,M);return k=Math.max(k,K),K});if(C.length>5&&z){k=0;let H=0;for(const N of C)H+=N;const K=H/C.length;for(let N=0;N=K*2?C[N]=0:k=Math.max(k,C[N])}k=Math.max(k,e.measureText(l.title).width+o.cellHorizontalPadding*2+(l.icon===void 0?0:28));const S=Math.max(Math.ceil(x),Math.min(Math.floor(p),Math.ceil(k)));return{...l,width:S}}function ec(e,o,l,u,w,x,p,z,M){const k=i.useRef(o),C=i.useRef(l),S=i.useRef(p);k.current=o,C.current=l,S.current=p;const[H,K]=i.useMemo(()=>{if(typeof window>"u")return[null,null];const F=document.createElement("canvas");return F.style.display="none",F.style.opacity="0",F.style.position="fixed",[F,F.getContext("2d",{alpha:!1})]},[]);i.useLayoutEffect(()=>(H&&document.documentElement.append(H),()=>{H==null||H.remove()}),[H]);const N=i.useRef({}),ne=i.useRef(),[he,U]=i.useState();return i.useLayoutEffect(()=>{const F=C.current;if(F===void 0||e.every(Ho))return;let O=Math.max(1,10-Math.floor(e.length/1e4)),Ce=0;O1&&(O--,Ce=1);const se={x:0,y:0,width:e.length,height:Math.min(k.current,O)},de={x:0,y:k.current-1,width:e.length,height:1};(async()=>{const ee=F(se,M.signal),te=Ce>0?F(de,M.signal):void 0;let _;typeof ee=="object"?_=ee:_=await or(ee),te!==void 0&&(typeof te=="object"?_=[..._,...te]:_=[..._,...await or(te)]),ne.current=e,U(_)})()},[M.signal,e]),i.useMemo(()=>{let O=e.every(Ho)?e:K===null?e.map(Y=>Ho(Y)?Y:{...Y,width:gn}):(K.font=S.current.baseFontFull,e.map((Y,ee)=>{if(Ho(Y))return Y;if(N.current[Y.id]!==void 0)return{...Y,width:N.current[Y.id]};if(he===void 0||ne.current!==e||Y.id===void 0)return{...Y,width:gn};const te=gr(K,p,Y,ee,he,w,x,!0,z);return N.current[Y.id]=te.width,te})),Ce=0,se=0;const de=[];for(const[Y,ee]of O.entries())Ce+=ee.width,ee.grow!==void 0&&ee.grow>0&&(se+=ee.grow,de.push(Y));if(Ce0){const Y=[...O],ee=u-Ce;let te=ee;for(let _=0;_1&&e.startsWith("_")?Number.parseInt(e.slice(1))===o.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===o.keyCode:e===o.key}function A(e,o,l){const u=vr(e,o);return u&&(l.didMatch=!0),u}function vr(e,o){if(e.length===0)return!1;if(e.includes("|")){const M=e.split("|");for(const k of M)if(vr(k,o))return!0;return!1}let l=!1,u=!1,w=!1,x=!1;const p=e.split("+"),z=p.pop();if(!tc(z,o))return!1;if(p[0]==="any")return!0;for(const M of p)switch(M){case"ctrl":l=!0;break;case"shift":u=!0;break;case"alt":w=!0;break;case"meta":x=!0;break;case"primary":Po.value?x=!0:l=!0;break}return o.altKey===w&&o.ctrlKey===l&&o.shiftKey===u&&o.metaKey===x}function oc(e,o,l,u,w,x,p){const z=Re.useCallback((C,S,H,K)=>{var O;(x==="cell"||x==="multi-cell")&&C!==void 0&&(C={...C,range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}),!p&&C!==void 0&&C.range.width>1&&(C={...C,range:{...C.range,width:1,x:C.cell[0]}});const N=l==="mixed"&&(H||K==="drag"),ne=u==="mixed"&&N,he=w==="mixed"&&N;let U={current:C===void 0?void 0:{...C,rangeStack:K==="drag"?((O=e.current)==null?void 0:O.rangeStack)??[]:[]},columns:ne?e.columns:X.empty(),rows:he?e.rows:X.empty()};H&&(x==="multi-rect"||x==="multi-cell")&&U.current!==void 0&&e.current!==void 0&&(U={...U,current:{...U.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),o(U,S)},[u,e,l,x,p,w,o]),M=Re.useCallback((C,S,H)=>{C=C??e.rows,S!==void 0&&(C=C.add(S));let K;if(w==="exclusive"&&C.length>0)K={current:void 0,columns:X.empty(),rows:C};else{const N=H&&l==="mixed",ne=H&&u==="mixed";K={current:N?e.current:void 0,columns:ne?e.columns:X.empty(),rows:C}}o(K,!1)},[u,e,l,w,o]),k=Re.useCallback((C,S,H)=>{C=C??e.columns,S!==void 0&&(C=C.add(S));let K;if(u==="exclusive"&&C.length>0)K={current:void 0,rows:X.empty(),columns:C};else{const N=H&&l==="mixed",ne=H&&w==="mixed";K={current:N?e.current:void 0,rows:ne?e.rows:X.empty(),columns:C}}o(K,!1)},[u,e,l,w,o]);return[z,M,k]}function nc(e,o,l,u,w){const x=i.useCallback(k=>{if(e===!0){const C=[];for(let S=k.y;S=w?H.push({kind:Q.Loading,allowOverlay:!1}):H.push(o([K,S]));C.push(H)}return C}return(e==null?void 0:e(k,u.signal))??[]},[u.signal,o,e,w]),p=e!==void 0?x:void 0,z=i.useCallback(k=>{if(p===void 0)return[];const C={...k,x:k.x-l};if(C.x<0){C.x=0,C.width--;const S=p(C,u.signal);return typeof S=="function"?async()=>(await S()).map(H=>[{kind:Q.Loading,allowOverlay:!1},...H]):S.map(H=>[{kind:Q.Loading,allowOverlay:!1},...H])}return p(C,u.signal)},[u.signal,p,l]);return[e!==void 0?z:void 0,p]}function ur(e){return typeof e=="string"?e:`${e}px`}const rc=()=>e=>e.innerWidth,lc=()=>e=>e.innerHeight,ic=vn("div")({name:"Wrapper",class:"w2q57ts",propsAsIs:!1,vars:{"w2q57ts-0":[rc()],"w2q57ts-1":[lc()]}}),cc=e=>{const{inWidth:o,inHeight:l,children:u,...w}=e;return j(ic,{innerHeight:ur(l),innerWidth:ur(o),...w,children:u})},sc=2,ac=1300;function uc(e,o,l){const u=Re.useRef(0),[w,x]=e??[0,0];Re.useEffect(()=>{if(w===0&&x===0){u.current=0;return}let p=!1,z=0;const M=k=>{var C;if(!p){if(z===0)z=k;else{const S=k-z;u.current=Math.min(1,u.current+S/ac);const H=u.current**1.618*S*sc;(C=o.current)==null||C.scrollBy(w*H,x*H),z=k,l==null||l()}window.requestAnimationFrame(M)}};return window.requestAnimationFrame(M),()=>{p=!0}},[o,w,x,l])}function dc({rowHeight:e,headerHeight:o,groupHeaderHeight:l,theme:u,overscrollX:w,overscrollY:x,scaleToRem:p,remSize:z}){const[M,k,C,S,H,K]=Re.useMemo(()=>{if(!p||z===16)return[e,o,l,u,w,x];const N=z/16,ne=e,he=fr();return[typeof ne=="number"?ne*N:U=>Math.ceil(ne(U)*N),Math.ceil(o*N),Math.ceil(l*N),{...u,headerIconSize:((u==null?void 0:u.headerIconSize)??he.headerIconSize)*N,cellHorizontalPadding:((u==null?void 0:u.cellHorizontalPadding)??he.cellHorizontalPadding)*N,cellVerticalPadding:((u==null?void 0:u.cellVerticalPadding)??he.cellVerticalPadding)*N},Math.ceil((w??0)*N),Math.ceil((x??0)*N)]},[l,o,w,x,z,e,p,u]);return{rowHeight:M,headerHeight:k,groupHeaderHeight:C,theme:S,overscrollX:H,overscrollY:K}}const ut={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function G(e,o){return e===!0?o:e===!1?"":e}function dr(e){const o=Po.value;return{activateCell:G(e.activateCell," |Enter|shift+Enter"),clear:G(e.clear,"any+Escape"),closeOverlay:G(e.closeOverlay,"any+Escape"),acceptOverlayDown:G(e.acceptOverlayDown,"Enter"),acceptOverlayUp:G(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:G(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:G(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:G(e.delete,o?"Backspace|Delete":"Delete"),downFill:G(e.downFill,"primary+_68"),scrollToSelectedCell:G(e.scrollToSelectedCell,"primary+Enter"),goDownCell:G(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:G(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:G(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:G(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:G(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:G(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:G(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:G(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:G(e.goToFirstCell,"primary+Home"),goToFirstColumn:G(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:G(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:G(e.goToLastCell,"primary+End"),goToLastColumn:G(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:G(e.goToLastRow,"primary+ArrowDown"),goToNextPage:G(e.goToNextPage,"PageDown"),goToPreviousPage:G(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:G(e.rightFill,"primary+_82"),search:G(e.search,"primary+f"),selectAll:G(e.selectAll,"primary+a"),selectColumn:G(e.selectColumn,"ctrl+ "),selectGrowDown:G(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:G(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:G(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:G(e.selectGrowUp,"shift+ArrowUp"),selectRow:G(e.selectRow,"shift+ "),selectToFirstCell:G(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:G(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:G(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:G(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:G(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:G(e.selectToLastRow,"primary+shift+ArrowDown")}}function fc(e){const o=Ul(e);return Re.useMemo(()=>{if(o===void 0)return dr(ut);const l={...o,goToNextPage:(o==null?void 0:o.goToNextPage)??(o==null?void 0:o.pageDown)??ut.goToNextPage,goToPreviousPage:(o==null?void 0:o.goToPreviousPage)??(o==null?void 0:o.pageUp)??ut.goToPreviousPage,goToFirstCell:(o==null?void 0:o.goToFirstCell)??(o==null?void 0:o.first)??ut.goToFirstCell,goToLastCell:(o==null?void 0:o.goToLastCell)??(o==null?void 0:o.last)??ut.goToLastCell,selectToFirstCell:(o==null?void 0:o.selectToFirstCell)??(o==null?void 0:o.first)??ut.selectToFirstCell,selectToLastCell:(o==null?void 0:o.selectToLastCell)??(o==null?void 0:o.last)??ut.selectToLastCell};return dr({...ut,...l})},[o])}function hc(e){function o(u,w,x){if(typeof u=="number")return{headerIndex:u,isCollapsed:!1,depth:w,path:x};const p={headerIndex:u.headerIndex,isCollapsed:u.isCollapsed,depth:w,path:x};return u.subGroups!==void 0&&(p.subGroups=u.subGroups.map((z,M)=>o(z,w+1,[...x,M])).sort((z,M)=>z.headerIndex-M.headerIndex)),p}return e.map((u,w)=>o(u,0,[w])).sort((u,w)=>u.headerIndex-w.headerIndex)}function mn(e,o){const l=[];function u(p,z,M=!1){let k=z!==null?z-p.headerIndex:o-p.headerIndex;if(p.subGroups!==void 0&&(k=p.subGroups[0].headerIndex-p.headerIndex),k--,l.push({headerIndex:p.headerIndex,contentIndex:-1,skip:M,isCollapsed:p.isCollapsed,depth:p.depth,path:p.path,rows:k}),p.subGroups)for(let C=0;Cp.skip===!1).map(p=>{const{skip:z,...M}=p;return M})}function Ko(e,o){if(o===void 0||mn.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let l=e;for(const u of o){if(l===0)return{path:[...u.path,-1],originalIndex:u.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:u.rows};if(l--,!u.isCollapsed){if(le===void 0?void 0:mn(e,o),[e,o]),x=Re.useMemo(()=>w===void 0?o:w.reduce((k,C)=>k+(C.isCollapsed?1:C.rows+1),0),[w,o]),p=Re.useMemo(()=>e===void 0||typeof l=="number"&&e.height===l?l:k=>{const{isGroupHeader:C}=Ko(k,w);return C?e.height:typeof l=="number"?l:l(k)},[w,e,l]),z=Re.useCallback(k=>{if(w===void 0)return k;let C=k;for(const S of w){if(C===0)return;if(C--,!S.isCollapsed){if(C{if(e===void 0)return u==null?void 0:u(k,k,k);if(u===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:C,contentIndex:S,groupIndex:H}=Ko(k,w);return C?e.themeOverride:u==null?void 0:u(k,H,S)},[w,u,e]));return e===void 0?{rowHeight:p,rows:o,rowNumberMapper:z,getRowThemeOverride:M}:{rowHeight:p,rows:x,rowNumberMapper:z,getRowThemeOverride:M}}function vc(e,o){const l=Re.useMemo(()=>e===void 0?void 0:mn(e,o),[e,o]);return{getRowGroupingForPath:Cr,updateRowGroupingByPath:mr,mapper:Re.useCallback(u=>{if(typeof u=="number")return Ko(u,l);const w=Ko(u[1],l);return{...w,originalIndex:[u[0],w.originalIndex]}},[l])}}function mr(e,o,l){const[u,...w]=o;return w[0]===-1?e.map((x,p)=>p===u?{...x,...l}:x):e.map((x,p)=>p===u?{...x,subGroups:mr(x.subGroups??[],w,l)}:x)}function Cr(e,o){const[l,...u]=o;return u[0]===-1?e[l]:Cr(e[l].subGroups??[],u)}function mc(e,o){const[l]=i.useState(()=>({value:e,callback:o,facade:{get current(){return l.value},set current(u){const w=l.value;w!==u&&(l.value=u,l.callback(u,w))}}}));return l.callback=o,l.facade}function Cc(e,o,l,u,w){const[x,p]=i.useMemo(()=>[o!==void 0&&typeof l=="number"?Math.floor(o/l):0,o!==void 0&&typeof l=="number"?-(o%l):0],[o,l]),z=i.useMemo(()=>({x:u.current.x,y:x,width:u.current.width??1,height:u.current.height??1,ty:p}),[u,p,x]),[M,k,C]=Bl(z),S=i.useRef(w);S.current=w;const H=mc(null,ne=>{ne!==null&&o!==void 0?ne.scrollTop=o:ne!==null&&e!==void 0&&(ne.scrollLeft=e)}),K=(M.height??1)>1;i.useLayoutEffect(()=>{if(o!==void 0&&H.current!==null&&K){if(H.current.scrollTop===o)return;H.current.scrollTop=o,H.current.scrollTop!==o&&C(),S.current()}},[o,K,C,H]);const N=(M.width??1)>1;return i.useLayoutEffect(()=>{if(e!==void 0&&H.current!==null&&N){if(H.current.scrollLeft===e)return;H.current.scrollLeft=e,H.current.scrollLeft!==e&&C(),S.current()}},[e,N,C,H]),{visibleRegion:M,setVisibleRegion:k,scrollRef:H}}const wc=i.lazy(async()=>await Wl(()=>import("./data-grid-overlay-editor-XEAOWHGB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let pc=0;function bc(e){return di(ar(ar(e).filter(o=>o.span!==void 0).map(o=>{var l,u;return Gt((((l=o.span)==null?void 0:l[0])??0)+1,(((u=o.span)==null?void 0:u[1])??0)+1)})))}function $o(e,o){return e===void 0||o===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+o,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+o},rangeStack:e.current.rangeStack.map(l=>({...l,x:l.x+o}))},rows:e.rows,columns:e.columns.offset(o)}}const Fo={kind:Q.Loading,allowOverlay:!1},Ao={columns:X.empty(),rows:X.empty(),current:void 0},yc=(e,o)=>{var Jn,Qn,er;const[l,u]=i.useState(Ao),[w,x]=i.useState(),p=i.useRef(null),z=i.useRef(null),[M,k]=i.useState(),C=i.useRef(),S=typeof window>"u"?null:window,{imageEditorOverride:H,getRowThemeOverride:K,markdownDivCreateNode:N,width:ne,height:he,columns:U,rows:F,getCellContent:O,onCellClicked:Ce,onCellActivated:se,onFillPattern:de,onFinishedEditing:Y,coercePasteValue:ee,drawHeader:te,drawCell:_,editorBloom:je,onHeaderClicked:Le,onColumnProposeMove:Be,rangeSelectionColumnSpanning:eo=!0,spanRangeBehavior:dt="default",onGroupHeaderClicked:He,onCellContextMenu:Ae,className:Pt,onHeaderContextMenu:Ge,getCellsForSelection:No,onGroupHeaderContextMenu:E,onGroupHeaderRenamed:re,onCellEdited:ae,onCellsEdited:De,onSearchResultsChanged:Pe,searchResults:ft,onSearchValueChange:to,searchValue:Oo,onKeyDown:Kt,onKeyUp:ht,keybindings:oo,editOnType:no=!0,onRowAppended:ot,onColumnMoved:gt,validateCell:vt,highlightRegions:mt,rangeSelect:Ve="rect",columnSelect:we="multi",rowSelect:Ee="multi",rangeSelectionBlending:Wo="exclusive",columnSelectionBlending:Ze="exclusive",rowSelectionBlending:Je="exclusive",onDelete:Uo,onDragStart:ro,onMouseMove:lo,onPaste:Ct,copyHeaders:Cn=!1,freezeColumns:Qe=0,cellActivationBehavior:Bo="second-click",rowSelectionMode:Vo="auto",onHeaderMenuClick:io,onHeaderIndicatorClick:co,getGroupDetails:so,rowGrouping:nt,onSearchClose:_o,onItemHovered:ao,onSelectionCleared:rt,showSearch:wr,onVisibleRegionChanged:uo,gridSelection:wt,onGridSelectionChange:Xo,minColumnWidth:pr=50,maxColumnWidth:br=500,maxColumnAutoWidth:yr,provideEditor:xr,trailingRowOptions:B,freezeTrailingRows:et=0,allowedFillDirections:wn="orthogonal",scrollOffsetX:Rr,scrollOffsetY:Mr,verticalBorder:St,onDragOverCell:kr,onDrop:Sr,onColumnResize:Nt,onColumnResizeEnd:Ot,onColumnResizeStart:Wt,customRenderers:fo,fillHandle:zr,experimental:ge,fixedShadowX:Tr,fixedShadowY:Lr,headerIcons:Hr,imageWindowLoader:Dr,initialSize:Er,isDraggable:Ir,onDragLeave:$r,onRowMoved:Ut,overscrollX:Fr,overscrollY:Ar,preventDiagonalScrolling:Gr,rightElement:Pr,rightElementProps:Kr,trapFocus:pn=!1,smoothScrollX:Nr,smoothScrollY:Or,scaleToRem:Wr=!1,rowHeight:Ur=34,headerHeight:bn=36,groupHeaderHeight:Br=bn,theme:Vr,isOutsideClick:_r,renderers:Yo,resizeIndicator:Xr,scrollToActiveCell:yn=!0,drawFocusRing:xn=!0}=e,Rn=xn==="no-editor"?w===void 0:xn,le=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Ke=(le==null?void 0:le.kind)??e.rowMarkers??"none",Yr=(le==null?void 0:le.width)??e.rowMarkerWidth,Mn=(le==null?void 0:le.startIndex)??e.rowMarkerStartIndex??1,kn=(le==null?void 0:le.theme)??e.rowMarkerTheme,Sn=le==null?void 0:le.headerTheme,zn=le==null?void 0:le.headerAlwaysVisible,ho=(le==null?void 0:le.checkboxStyle)??"square",zt=Math.max(pr,20),go=Math.max(br,zt),qr=Math.max(yr??go,zt),Tn=i.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:$,rowNumberMapper:Ln,rowHeight:jr,getRowThemeOverride:tt}=gc(nt,F,Ur,K),Zr=i.useMemo(()=>Number.parseFloat(Tn.fontSize),[Tn]),{rowHeight:lt,headerHeight:qo,groupHeaderHeight:Hn,theme:Dn,overscrollX:Jr,overscrollY:Qr}=dc({groupHeaderHeight:Br,headerHeight:bn,overscrollX:Fr,overscrollY:Ar,remSize:Zr,rowHeight:jr,scaleToRem:Wr,theme:Vr}),it=fc(oo),Tt=Yr??(F>1e4?48:F>1e3?44:F>100?36:32),_e=Ke!=="none",d=_e?1:0,oe=ot!==void 0,Bt=(B==null?void 0:B.sticky)===!0,[el,En]=i.useState(!1),tl=wr??el,ol=i.useCallback(()=>{_o!==void 0?_o():En(!1)},[_o]),h=i.useMemo(()=>wt===void 0?void 0:$o(wt,d),[wt,d])??l,Me=i.useRef();Me.current===void 0&&(Me.current=new AbortController),i.useEffect(()=>()=>Me==null?void 0:Me.current.abort(),[]);const[fe,nl]=nc(No,O,d,Me.current,$),rl=i.useCallback((t,r,n)=>{if(vt===void 0)return!0;const s=[t[0]-d,t[1]];return vt==null?void 0:vt(s,r,n)},[d,vt]),vo=i.useRef(wt),Ie=i.useCallback((t,r)=>{r&&(t=Vl(t,fe,d,dt,Me.current)),Xo!==void 0?(vo.current=$o(t,-d),Xo(vo.current)):u(t)},[Xo,fe,d,dt]),Lt=kt(Nt,i.useCallback((t,r,n,s)=>{Nt==null||Nt(U[n-d],r,n-d,s)},[Nt,d,U])),ll=kt(Ot,i.useCallback((t,r,n,s)=>{Ot==null||Ot(U[n-d],r,n-d,s)},[Ot,d,U])),il=kt(Wt,i.useCallback((t,r,n,s)=>{Wt==null||Wt(U[n-d],r,n-d,s)},[Wt,d,U])),cl=kt(te,i.useCallback((t,r)=>(te==null?void 0:te({...t,columnIndex:t.columnIndex-d},r))??!1,[te,d])),sl=kt(_,i.useCallback((t,r)=>(_==null?void 0:_({...t,col:t.col-d},r))??!1,[_,d])),ct=i.useCallback(t=>{if(Uo!==void 0){const r=Uo($o(t,-d));return typeof r=="boolean"?r:$o(r,d)}return!0},[Uo,d]),[pe,be,ue]=oc(h,Ie,Wo,Ze,Je,Ve,eo),ve=i.useMemo(()=>fn(fr(),Dn),[Dn]),[jo,al]=i.useState([0,0,0]),In=i.useMemo(()=>{if(Yo===void 0)return{};const t={};for(const r of Yo)t[r.kind]=r;return t},[Yo]),ye=i.useCallback(t=>t.kind!==Q.Custom?In[t.kind]:fo==null?void 0:fo.find(r=>r.isMatch(t)),[fo,In]);let{sizedColumns:Se,nonGrowWidth:$n}=ec(U,$,nl,jo[0]-(d===0?0:Tt)-jo[2],zt,qr,ve,ye,Me.current);Ke!=="none"&&($n+=Tt);const Zo=i.useMemo(()=>Se.some(t=>t.group!==void 0),[Se]),Vt=Zo?qo+Hn:qo,Fn=h.rows.length,An=Ke==="none"?void 0:Fn===0?!1:Fn===$?!0:void 0,V=i.useMemo(()=>Ke==="none"?Se:[{title:"",width:Tt,icon:void 0,hasMenu:!1,style:"normal",themeOverride:kn,rowMarker:ho,rowMarkerChecked:An,headerRowMarkerTheme:Sn,headerRowMarkerAlwaysVisible:zn},...Se],[Ke,Se,Tt,kn,ho,An,Sn,zn]),ze=i.useRef({height:1,width:1,x:0,y:0}),mo=i.useRef(!1),{setVisibleRegion:Gn,visibleRegion:pt,scrollRef:q}=Cc(Rr,Mr,lt,ze,()=>mo.current=!0);ze.current=pt;const ul=pt.x+d,Co=pt.y,ke=i.useRef(null),xe=i.useCallback(t=>{var r;t===!0?(r=ke.current)==null||r.focus():window.requestAnimationFrame(()=>{var n;(n=ke.current)==null||n.focus()})},[]),me=oe?$+1:$,$e=i.useCallback(t=>{const r=d===0?t:t.map(s=>({...s,location:[s.location[0]-d,s.location[1]]})),n=De==null?void 0:De(r);if(n!==!0)for(const s of r)ae==null||ae(s.location,s.value);return n},[ae,De,d]),[bt,Jo]=i.useState(),wo=h.current!==void 0&&h.current.range.width*h.current.range.height>1?h.current.range:void 0,Ht=Rn?(Jn=h.current)==null?void 0:Jn.cell:void 0,po=Ht==null?void 0:Ht[0],bo=Ht==null?void 0:Ht[1],dl=i.useMemo(()=>{if((mt===void 0||mt.length===0)&&(wo??po??bo??bt)===void 0)return;const t=[];if(mt!==void 0)for(const r of mt){const n=V.length-r.range.x-d;n>0&&t.push({color:r.color,range:{...r.range,x:r.range.x+d,width:Math.min(n,r.range.width)},style:r.style})}return bt!==void 0&&t.push({color:nr(ve.accentColor,0),range:bt,style:"dashed"}),wo!==void 0&&t.push({color:nr(ve.accentColor,.5),range:wo,style:"solid-outline"}),po!==void 0&&bo!==void 0&&t.push({color:ve.accentColor,range:{x:po,y:bo,width:1,height:1},style:"solid-outline"}),t.length>0?t:void 0},[bt,wo,po,bo,mt,V.length,ve.accentColor,d]),Pn=i.useRef(V);Pn.current=V;const Te=i.useCallback(([t,r],n=!1)=>{var g,a,f,v,m,b,T;const s=oe&&r===me-1;if(t===0&&_e){if(s)return Fo;const y=Ln(r);return y===void 0?Fo:{kind:Do.Marker,allowOverlay:!1,checkboxStyle:ho,checked:(h==null?void 0:h.rows.hasIndex(r))===!0,markerKind:Ke==="clickable-number"?"number":Ke,row:Mn+y,drawHandle:Ut!==void 0,cursor:Ke==="clickable-number"?"pointer":void 0}}else if(s){const D=t===d?(B==null?void 0:B.hint)??"":"",R=Pn.current[t];if(((g=R==null?void 0:R.trailingRowOptions)==null?void 0:g.disabled)===!0)return Fo;{const P=((a=R==null?void 0:R.trailingRowOptions)==null?void 0:a.hint)??D,I=((f=R==null?void 0:R.trailingRowOptions)==null?void 0:f.addIcon)??(B==null?void 0:B.addIcon);return{kind:Do.NewRow,hint:P,allowOverlay:!1,icon:I}}}else{const y=t-d;if(n||(ge==null?void 0:ge.strict)===!0){const R=ze.current,P=R.x>y||y>R.x+R.width||R.y>r||r>R.y+R.height||r>=en.current,I=y===((m=(v=R.extras)==null?void 0:v.selected)==null?void 0:m[0])&&r===((b=R.extras)==null?void 0:b.selected[1]);let L=!1;if(((T=R.extras)==null?void 0:T.freezeRegions)!==void 0){for(const W of R.extras.freezeRegions)if(_l(W,y,r)){L=!0;break}}if(P&&!I&&!L)return Fo}let D=O([y,r]);return d!==0&&D.span!==void 0&&(D={...D,span:[D.span[0]+d,D.span[1]+d]}),D}},[oe,me,_e,Ln,ho,h==null?void 0:h.rows,Ke,Mn,Ut,d,B==null?void 0:B.hint,B==null?void 0:B.addIcon,ge==null?void 0:ge.strict,O]),Qo=i.useCallback(t=>{let r=(so==null?void 0:so(t))??{name:t};return re!==void 0&&t!==""&&(r={icon:r.icon,name:r.name,overrideTheme:r.overrideTheme,actions:[...r.actions??[],{title:"Rename",icon:"renameIcon",onClick:n=>on({group:r.name,bounds:n.bounds})}]}),r},[so,re]),yo=i.useCallback(t=>{var f;const[r,n]=t.cell,s=V[r],c=(s==null?void 0:s.group)!==void 0?(f=Qo(s.group))==null?void 0:f.overrideTheme:void 0,g=s==null?void 0:s.themeOverride,a=tt==null?void 0:tt(n);x({...t,theme:fn(ve,c,g,a,t.content.themeOverride)})},[tt,V,Qo,ve]),Dt=i.useCallback((t,r,n)=>{var a;if(h.current===void 0)return;const[s,c]=h.current.cell,g=Te([s,c]);if(g.kind!==Q.Boolean&&g.allowOverlay){let f=g;if(n!==void 0)switch(f.kind){case Q.Number:{const v=Xl(()=>n==="-"?-0:Number.parseFloat(n),0);f={...f,data:Number.isNaN(v)?0:v};break}case Q.Text:case Q.Markdown:case Q.Uri:f={...f,data:n};break}yo({target:t,content:f,initialValue:n,cell:[s,c],highlight:n===void 0,forceEditMode:n!==void 0})}else g.kind===Q.Boolean&&r&&g.readonly!==!0&&($e([{location:h.current.cell,value:{...g,data:Yl(g.data)}}]),(a=ke.current)==null||a.damage([{cell:h.current.cell}]))},[Te,h,$e,yo]),Kn=i.useCallback((t,r)=>{var c;const n=(c=ke.current)==null?void 0:c.getBounds(t,r);if(n===void 0||q.current===null)return;const s=Te([t,r]);s.allowOverlay&&yo({target:n,content:s,initialValue:void 0,highlight:!0,cell:[t,r],forceEditMode:!0})},[Te,q,yo]),ie=i.useCallback((t,r,n="both",s=0,c=0,g=void 0)=>{if(q.current!==null){const a=ke.current,f=z.current,v=typeof t!="number"?t.unit==="cell"?t.amount:void 0:t,m=typeof r!="number"?r.unit==="cell"?r.amount:void 0:r,b=typeof t!="number"&&t.unit==="px"?t.amount:void 0,T=typeof r!="number"&&r.unit==="px"?r.amount:void 0;if(a!==null&&f!==null){let y={x:0,y:0,width:0,height:0},D=0,R=0;if((v!==void 0||m!==void 0)&&(y=a.getBounds((v??0)+d,m??0)??y,y.width===0||y.height===0))return;const P=f.getBoundingClientRect(),I=P.width/f.offsetWidth;if(b!==void 0&&(y={...y,x:b-P.left-q.current.scrollLeft,width:1}),T!==void 0&&(y={...y,y:T+P.top-q.current.scrollTop,height:1}),y!==void 0){const L={x:y.x-s,y:y.y-c,width:y.width+2*s,height:y.height+2*c};let W=0;for(let un=0;un0&&(J=ql(me,ce,lt));let We=W*I+P.left+d*Tt*I,Ye=P.right,Ue=P.top+Vt*I,qe=P.bottom-J*I;const To=y.width+s*2;switch(g==null?void 0:g.hAlign){case"start":Ye=We+To;break;case"end":We=Ye-To;break;case"center":We=Math.floor((We+Ye)/2)-To/2,Ye=We+To;break}const Lo=y.height+c*2;switch(g==null?void 0:g.vAlign){case"start":qe=Ue+Lo;break;case"end":Ue=qe-Lo;break;case"center":Ue=Math.floor((Ue+qe)/2)-Lo/2,qe=Ue+Lo;break}We>L.x?D=L.x-We:YeL.y?R=L.y-Ue:qe=me-ce)&&(R=0),(D!==0||R!==0)&&(I!==1&&(D/=I,R/=I),q.current.scrollTo(D+q.current.scrollLeft,R+q.current.scrollTop))}}}},[d,et,Tt,q,Vt,Qe,Se,me,Bt,lt]),Nn=i.useRef(Kn),On=i.useRef(O),en=i.useRef($);Nn.current=Kn,On.current=O,en.current=$;const Et=i.useCallback(async(t,r=!0)=>{var v;const n=V[t];if(((v=n==null?void 0:n.trailingRowOptions)==null?void 0:v.disabled)===!0)return;const s=ot==null?void 0:ot();let c,g=!0;s!==void 0&&(c=await s,c==="top"&&(g=!1),typeof c=="number"&&(g=!1));let a=0;const f=()=>{if(en.current<=$){a<500&&window.setTimeout(f,a),a=50+a*2;return}const m=typeof c=="number"?c:g?$:0;zo.current(t-d,m),pe({cell:[t,m],range:{x:t,y:m,width:1,height:1}},!1,!1,"edit");const b=On.current([t-d,m]);b.allowOverlay&&Io(b)&&b.readonly!==!0&&r&&window.setTimeout(()=>{Nn.current(t,m)},0)};f()},[V,ot,d,$,pe]),xo=i.useCallback(t=>{var n,s;const r=((s=(n=Se[t])==null?void 0:n.trailingRowOptions)==null?void 0:s.targetColumn)??(B==null?void 0:B.targetColumn);if(typeof r=="number")return r+(_e?1:0);if(typeof r=="object"){const c=U.indexOf(r);if(c>=0)return c+(_e?1:0)}},[Se,U,_e,B==null?void 0:B.targetColumn]),st=i.useRef(),It=i.useRef(),_t=i.useCallback((t,r)=>{var c;const[n,s]=r;return fn(ve,(c=V[n])==null?void 0:c.themeOverride,tt==null?void 0:tt(s),t.themeOverride)},[tt,V,ve]),{mapper:yt}=vc(nt,F),Ne=nt==null?void 0:nt.navigationBehavior,Xt=i.useCallback(t=>{var b,T,y;const r=Po.value?t.metaKey:t.ctrlKey,n=r&&Ee==="multi",s=r&&we==="multi",[c,g]=t.location,a=h.columns,f=h.rows,[v,m]=((b=h.current)==null?void 0:b.cell)??[];if(t.kind==="cell"){if(It.current=void 0,xt.current=[c,g],c===0&&_e){if(oe===!0&&g===$||Ke==="number"||Ee==="none")return;const D=Te(t.location);if(D.kind!==Do.Marker)return;if(Ut!==void 0){const I=ye(D);Go((I==null?void 0:I.kind)===Do.Marker);const L=(T=I==null?void 0:I.onClick)==null?void 0:T.call(I,{...t,cell:D,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:_t(D,t.location),preventDefault:()=>{}});if(L===void 0||L.checked===D.checked)return}x(void 0),xe();const R=f.hasIndex(g),P=st.current;if(Ee==="multi"&&(t.shiftKey||t.isLongTouch===!0)&&P!==void 0&&f.hasIndex(P)){const I=[Math.min(P,g),Math.max(P,g)+1];n||Vo==="multi"?be(void 0,I,!0):be(X.fromSingleSelection(I),void 0,n)}else n||t.isTouch||Vo==="multi"?R?be(f.remove(g),void 0,!0):(be(void 0,g,!0),st.current=g):R&&f.length===1?be(X.empty(),void 0,r):(be(X.fromSingleSelection(g),void 0,r),st.current=g)}else if(c>=d&&oe&&g===$){const D=xo(c);Et(D??c)}else if(v!==c||m!==g){const D=Te(t.location),R=ye(D);if((R==null?void 0:R.onSelect)!==void 0){let L=!1;if(R.onSelect({...t,cell:D,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,preventDefault:()=>L=!0,theme:_t(D,t.location)}),L)return}if(Ne==="block"&&yt(g).isGroupHeader)return;const P=Bt&&g===$,I=Bt&&h!==void 0&&((y=h.current)==null?void 0:y.cell[1])===$;if((t.shiftKey||t.isLongTouch===!0)&&v!==void 0&&m!==void 0&&h.current!==void 0&&!I){if(P)return;const L=Math.min(c,v),W=Math.max(c,v),J=Math.min(g,m),ce=Math.max(g,m);pe({...h.current,range:{x:L,y:J,width:W-L+1,height:ce-J+1}},!0,r,"click"),st.current=void 0,xe()}else pe({cell:[c,g],range:{x:c,y:g,width:1,height:1}},!0,r,"click"),st.current=void 0,x(void 0),xe()}}else if(t.kind==="header")if(xt.current=[c,g],x(void 0),_e&&c===0)st.current=void 0,It.current=void 0,Ee==="multi"&&(f.length!==$?be(X.fromSingleSelection([0,$]),void 0,r):be(X.empty(),void 0,r),xe());else{const D=It.current;if(we==="multi"&&(t.shiftKey||t.isLongTouch===!0)&&D!==void 0&&a.hasIndex(D)){const R=[Math.min(D,c),Math.max(D,c)+1];s?ue(void 0,R,r):ue(X.fromSingleSelection(R),void 0,r)}else s?(a.hasIndex(c)?ue(a.remove(c),void 0,r):ue(void 0,c,r),It.current=c):we!=="none"&&(ue(X.fromSingleSelection(c),void 0,r),It.current=c);st.current=void 0,xe()}else t.kind===At?xt.current=[c,g]:t.kind===rr&&!t.isMaybeScrollbar&&(Ie(Ao,!1),x(void 0),xe(),rt==null||rt(),st.current=void 0,It.current=void 0)},[Ee,we,h,_e,d,oe,$,Ke,Te,Ut,xe,Vo,ye,_t,be,xo,Et,Ne,yt,Bt,pe,ue,Ie,rt]),Yt=i.useRef(!1),xt=i.useRef(),Wn=i.useRef(pt),Fe=i.useRef(),fl=i.useCallback(t=>{if($t.current=!1,Wn.current=ze.current,t.button!==0&&t.button!==1){Fe.current=void 0;return}const r=performance.now();Fe.current={button:t.button,time:r,location:t.location},(t==null?void 0:t.kind)==="header"&&(Yt.current=!0);const n=t.kind==="cell"&&t.isFillHandle;!n&&t.kind!=="cell"&&t.isEdge||(k({previousSelection:h,fillHandle:n}),xt.current=void 0,!t.isTouch&&t.button===0&&!n?Xt(t):!t.isTouch&&t.button===1&&(xt.current=t.location))},[h,Xt]),[tn,on]=i.useState(),Un=i.useCallback(t=>{if(t.kind!==At||we!=="multi")return;const r=Po.value?t.metaKey:t.ctrlKey,[n]=t.location,s=h.columns;if(n=d&&lr(c.group,V[f].group);f--)g--;for(let f=n+1;f{if(fe!==void 0&&Lt!==void 0){const r=ze.current.y,n=ze.current.height;let s=fe({x:t,y:r,width:1,height:Math.min(n,$-r)},Me.current.signal);typeof s!="object"&&(s=await s());const c=Se[t-d],a=document.createElement("canvas").getContext("2d",{alpha:!1});if(a!==null){a.font=ve.baseFontFull;const f=gr(a,ve,c,0,s,zt,go,!1,ye);Lt==null||Lt(c,f.width,t,f.width)}}},[Se,fe,go,ve,zt,Lt,d,$,ye]),[hl,nn]=i.useState(),Ft=i.useCallback(async(t,r)=>{var f,v;const n=(f=t.current)==null?void 0:f.range;if(n===void 0||fe===void 0||r.current===void 0)return;const s=r.current.range;if(de!==void 0){let m=!1;if(de({fillDestination:{...s,x:s.x-d},patternSource:{...n,x:n.x-d},preventDefault:()=>m=!0}),m)return}let c=fe(n,Me.current.signal);typeof c!="object"&&(c=await c());const g=c,a=[];for(let m=0;m({cell:m.location})))},[fe,$e,de,d]),Bn=i.useCallback(()=>{if(h.current===void 0||h.current.range.width<=1)return;const t={...h,current:{...h.current,range:{...h.current.range,width:1}}};Ft(t,h)},[Ft,h]),Vn=i.useCallback(()=>{if(h.current===void 0||h.current.range.height<=1)return;const t={...h,current:{...h.current,range:{...h.current.range,height:1}}};Ft(t,h)},[Ft,h]),gl=i.useCallback((t,r)=>{var b,T;const n=M;if(k(void 0),Jo(void 0),nn(void 0),Yt.current=!1,r)return;if((n==null?void 0:n.fillHandle)===!0&&h.current!==void 0&&((b=n.previousSelection)==null?void 0:b.current)!==void 0){if(bt===void 0)return;const y={...h,current:{...h.current,range:Zl(n.previousSelection.current.range,bt)}};Ft(n.previousSelection,y),Ie(y,!0);return}const[s,c]=t.location,[g,a]=xt.current??[],f=()=>{$t.current=!0},v=y=>{var R,P,I;const D=y.isTouch||g===s&&a===c;if(D&&(Ce==null||Ce([s-d,c],{...y,preventDefault:f})),y.button===1)return!$t.current;if(!$t.current){const L=Te(t.location),W=ye(L);if(W!==void 0&&W.onClick!==void 0&&D){const ce=W.onClick({...y,cell:L,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:_t(L,t.location),preventDefault:f});ce!==void 0&&!Eo(ce)&&Jt(ce)&&($e([{location:y.location,value:ce}]),(R=ke.current)==null||R.damage([{cell:y.location}]))}if($t.current||h.current===void 0)return!1;let J=!1;switch(L.activationBehaviorOverride??Bo){case"double-click":case"second-click":{if(((I=(P=n==null?void 0:n.previousSelection)==null?void 0:P.current)==null?void 0:I.cell)===void 0)break;const[ce,We]=h.current.cell,[Ye,Ue]=n.previousSelection.current.cell;J=s===ce&&s===Ye&&c===We&&c===Ue&&(y.isDoubleClick===!0||Bo==="second-click");break}case"single-click":{J=!0;break}}if(J)return se==null||se([s-d,c]),Dt(y.bounds,!1),!0}return!1},m=t.location[0]-d;if(t.isTouch){const y=ze.current,D=Wn.current;if(y.x!==D.x||y.y!==D.y)return;if(t.isLongTouch===!0){if(t.kind==="cell"&&Jl((T=h.current)==null?void 0:T.cell,t.location)){Ae==null||Ae([m,t.location[1]],{...t,preventDefault:f});return}else if(t.kind==="header"&&h.columns.hasIndex(s)){Ge==null||Ge(m,{...t,preventDefault:f});return}else if(t.kind===At){if(m<0)return;E==null||E(m,{...t,preventDefault:f});return}}t.kind==="cell"?v(t)||Xt(t):t.kind===At?He==null||He(m,{...t,preventDefault:f}):(t.kind===Ql&&(Le==null||Le(m,{...t,preventDefault:f})),Xt(t));return}if(t.kind==="header"){if(m<0)return;t.isEdge?t.isDoubleClick===!0&&Ro(s):t.button===0&&s===g&&c===a&&(Le==null||Le(m,{...t,preventDefault:f}))}if(t.kind===At){if(m<0)return;t.button===0&&s===g&&c===a&&(He==null||He(m,{...t,preventDefault:f}),$t.current||Un(t))}t.kind==="cell"&&(t.button===0||t.button===1)&&v(t),xt.current=void 0},[M,h,d,bt,Ft,Ie,Ce,Te,ye,Bo,_t,$e,se,Dt,Ae,Ge,E,Xt,He,Le,Ro,Un]),vl=i.useCallback(t=>{const r={...t,location:[t.location[0]-d,t.location[1]]};lo==null||lo(r),M!==void 0&&t.buttons===0&&(k(void 0),Jo(void 0),nn(void 0),Yt.current=!1),nn(n=>{var s;return Yt.current?[t.scrollEdge[0],0]:t.scrollEdge[0]===(n==null?void 0:n[0])&&t.scrollEdge[1]===n[1]?n:M===void 0||(((s=Fe.current)==null?void 0:s.location[0])??0){io==null||io(t-d,r)},[io,d]),Cl=i.useCallback((t,r)=>{co==null||co(t-d,r)},[co,d]),Xe=(Qn=h==null?void 0:h.current)==null?void 0:Qn.cell,wl=i.useCallback((t,r,n,s,c,g)=>{mo.current=!1;let a=Xe;a!==void 0&&(a=[a[0]-d,a[1]]);const f=Qe===0?void 0:{x:0,y:t.y,width:Qe,height:t.height},v=[];f!==void 0&&v.push(f),et>0&&(v.push({x:t.x-d,y:$-et,width:t.width,height:et}),Qe>0&&v.push({x:0,y:$-et,width:Qe,height:et}));const m={x:t.x-d,y:t.y,width:t.width,height:oe&&t.y+t.height>=$?t.height-1:t.height,tx:c,ty:g,extras:{selected:a,freezeRegion:f,freezeRegions:v}};ze.current=m,Gn(m),al([r,n,s]),uo==null||uo(m,m.tx,m.ty,m.extras)},[Xe,d,oe,$,Qe,et,Gn,uo]),pl=kt(gt,i.useCallback((t,r)=>{gt==null||gt(t-d,r-d),we!=="none"&&ue(X.fromSingleSelection(r),void 0,!0)},[we,gt,d,ue])),rn=i.useRef(!1),bl=i.useCallback(t=>{if(t.location[0]===0&&d>0){t.preventDefault();return}ro==null||ro({...t,location:[t.location[0]-d,t.location[1]]}),t.defaultPrevented()||(rn.current=!0),k(void 0)},[ro,d]),yl=i.useCallback(()=>{rn.current=!1},[]),_n=nt==null?void 0:nt.selectionBehavior,Mo=i.useCallback(t=>{if(_n!=="block-spanning")return;const{isGroupHeader:r,path:n,groupRows:s}=yt(t);if(r)return[t,t];const c=n[n.length-1],g=t-c,a=t+s-c-1;return[g,a]},[yt,_n]),ln=i.useRef(),cn=i.useCallback(t=>{var r,n,s;if(!ei(t,ln.current)&&(ln.current=t,!(((r=Fe==null?void 0:Fe.current)==null?void 0:r.button)!==void 0&&Fe.current.button>=1))){if(t.buttons!==0&&M!==void 0&&((n=Fe.current)==null?void 0:n.location[0])===0&&t.location[0]===0&&d===1&&Ee==="multi"&&M.previousSelection&&!M.previousSelection.rows.hasIndex(Fe.current.location[1])&&h.rows.hasIndex(Fe.current.location[1])){const c=Math.min(Fe.current.location[1],t.location[1]),g=Math.max(Fe.current.location[1],t.location[1])+1;be(X.fromSingleSelection([c,g]),void 0,!1)}if(t.buttons!==0&&M!==void 0&&h.current!==void 0&&!rn.current&&!Yt.current&&(Ve==="rect"||Ve==="multi-rect")){const[c,g]=h.current.cell;let[a,f]=t.location;if(f<0&&(f=ze.current.y),M.fillHandle===!0&&((s=M.previousSelection)==null?void 0:s.current)!==void 0){const v=M.previousSelection.current.range;f=Math.min(f,oe?$-1:$);const m=ti(v,a,f,wn);Jo(m)}else{if(oe&&g===$)return;if(oe&&f===$)if(t.kind===rr)f--;else return;a=Math.max(a,d);const b=Mo(g);f=b===void 0?f:Mt(f,b[0],b[1]);const T=a-c,y=f-g,D={x:T>=0?c:a,y:y>=0?g:f,width:Math.abs(T)+1,height:Math.abs(y)+1};pe({...h.current,range:D},!0,!1,"drag")}}ao==null||ao({...t,location:[t.location[0]-d,t.location[1]]})}},[M,d,Ee,h,Ve,ao,be,oe,$,wn,Mo,pe]),xl=i.useCallback(()=>{var a,f;const t=ln.current;if(t===void 0)return;const[r,n]=t.scrollEdge;let[s,c]=t.location;const g=ze.current;r===-1?s=((f=(a=g.extras)==null?void 0:a.freezeRegion)==null?void 0:f.x)??g.x:r===1&&(s=g.x+g.width),n===-1?c=Math.max(0,g.y):n===1&&(c=Math.min($-1,g.y+g.height)),s=Mt(s,0,V.length-1),c=Mt(c,0,$-1),cn({...t,location:[s,c]})},[V.length,cn,$]);uc(hl,q,xl);const Oe=i.useCallback(t=>{if(h.current===void 0)return;const[r,n]=t,[s,c]=h.current.cell,g=h.current.range;let a=g.x,f=g.x+g.width,v=g.y,m=g.y+g.height;const[b,T]=Mo(c)??[0,$-1],y=T+1;if(n!==0)switch(n){case 2:{m=y,v=c,ie(0,m,"vertical");break}case-2:{v=b,m=c+1,ie(0,v,"vertical");break}case 1:{vc+1?(m--,ie(0,m,"vertical")):(v=Math.max(b,v-1),ie(0,v,"vertical"));break}default:ir()}if(r!==0)if(r===2)f=V.length,a=s,ie(f-1-d,0,"horizontal");else if(r===-2)a=d,f=s+1,ie(a-d,0,"horizontal");else{let D=[];if(fe!==void 0){const R=fe({x:a,y:v,width:f-a-d,height:m-v},Me.current.signal);typeof R=="object"&&(D=bc(R))}if(r===1){let R=!1;if(a0){const P=Gt(a+1,s+1).find(I=>!D.includes(I-d));P!==void 0&&(a=P,R=!0)}else a++,R=!0;R&&ie(a,0,"horizontal")}R||(f=Math.min(V.length,f+1),ie(f-1-d,0,"horizontal"))}else if(r===-1){let R=!1;if(f>s+1){if(D.length>0){const P=Gt(f-1,s,-1).find(I=>!D.includes(I-d));P!==void 0&&(f=P,R=!0)}else f--,R=!0;R&&ie(f-d,0,"horizontal")}R||(a=Math.max(d,a-1),ie(a-d,0,"horizontal"))}else ir()}pe({cell:h.current.cell,range:{x:a,y:v,width:f-a,height:m-v}},!0,!1,"keyboard-select")},[fe,Mo,h,V.length,d,$,ie,pe]),sn=i.useRef(yn);sn.current=yn;const at=i.useCallback((t,r,n,s)=>{const c=me-(n?0:1);t=Mt(t,d,Se.length-1+d),r=Mt(r,0,c);const g=Xe==null?void 0:Xe[0],a=Xe==null?void 0:Xe[1];if(t===g&&r===a)return!1;if(s&&h.current!==void 0){const f=[...h.current.rangeStack];(h.current.range.width>1||h.current.range.height>1)&&f.push(h.current.range),Ie({...h,current:{cell:[t,r],range:{x:t,y:r,width:1,height:1},rangeStack:f}},!0)}else pe({cell:[t,r],range:{x:t,y:r,width:1,height:1}},!0,!1,"keyboard-nav");return C.current!==void 0&&C.current[0]===t&&C.current[1]===r&&(C.current=void 0),sn.current&&ie(t-d,r),!0},[me,d,Se.length,Xe,h,ie,Ie,pe]),Rl=i.useCallback((t,r)=>{(w==null?void 0:w.cell)!==void 0&&t!==void 0&&Jt(t)&&($e([{location:w.cell,value:t}]),window.requestAnimationFrame(()=>{var c;(c=ke.current)==null||c.damage([{cell:w.cell}])})),xe(!0),x(void 0);const[n,s]=r;if(h.current!==void 0&&(n!==0||s!==0)){const c=h.current.cell[1]===me-1&&t!==void 0;at(Mt(h.current.cell[0]+n,0,V.length-1),Mt(h.current.cell[1]+s,0,me-1),c,!1)}Y==null||Y(t,r)},[w==null?void 0:w.cell,xe,h,Y,$e,me,at,V.length]),Ml=i.useMemo(()=>`gdg-overlay-${pc++}`,[]),Rt=i.useCallback(t=>{var n,s,c,g;xe();const r=[];for(let a=t.x;a({cell:a.location})))},[xe,O,ye,$e,d]),qt=w!==void 0,Xn=i.useCallback(t=>{var P,I;const r=()=>{t.stopPropagation(),t.preventDefault()},n={didMatch:!1},{bounds:s}=t,c=h.columns,g=h.rows,a=it;if(!qt&&A(a.clear,t,n))Ie(Ao,!1),rt==null||rt();else if(!qt&&A(a.selectAll,t,n))Ie({columns:X.empty(),rows:X.empty(),current:{cell:((P=h.current)==null?void 0:P.cell)??[d,0],range:{x:d,y:0,width:U.length,height:$},rangeStack:[]}},!1);else if(A(a.search,t,n))(I=p==null?void 0:p.current)==null||I.focus({preventScroll:!0}),En(!0);else if(A(a.delete,t,n)){const L=(ct==null?void 0:ct(h))??!0;if(L!==!1){const W=L===!0?h:L;if(W.current!==void 0){Rt(W.current.range);for(const J of W.current.rangeStack)Rt(J)}for(const J of W.rows)Rt({x:d,y:J,width:U.length,height:1});for(const J of W.columns)Rt({x:J,y:0,width:1,height:$})}}if(n.didMatch)return r(),!0;if(h.current===void 0)return!1;let[f,v]=h.current.cell;const[,m]=h.current.cell;let b=!1,T=!1;if(A(a.scrollToSelectedCell,t,n)?zo.current(f-d,v):we!=="none"&&A(a.selectColumn,t,n)?c.hasIndex(f)?ue(c.remove(f),void 0,!0):we==="single"?ue(X.fromSingleSelection(f),void 0,!0):ue(void 0,f,!0):Ee!=="none"&&A(a.selectRow,t,n)?g.hasIndex(v)?be(g.remove(v),void 0,!0):Ee==="single"?be(X.fromSingleSelection(v),void 0,!0):be(void 0,v,!0):!qt&&s!==void 0&&A(a.activateCell,t,n)?v===$&&oe?window.setTimeout(()=>{const L=xo(f);Et(L??f)},0):(se==null||se([f-d,v]),Dt(s,!0)):h.current.range.height>1&&A(a.downFill,t,n)?Vn():h.current.range.width>1&&A(a.rightFill,t,n)?Bn():A(a.goToNextPage,t,n)?v+=Math.max(1,ze.current.height-4):A(a.goToPreviousPage,t,n)?v-=Math.max(1,ze.current.height-4):A(a.goToFirstCell,t,n)?(x(void 0),v=0,f=0):A(a.goToLastCell,t,n)?(x(void 0),v=Number.MAX_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER):A(a.selectToFirstCell,t,n)?(x(void 0),Oe([-2,-2])):A(a.selectToLastCell,t,n)?(x(void 0),Oe([2,2])):qt?(A(a.closeOverlay,t,n)&&x(void 0),A(a.acceptOverlayDown,t,n)&&(x(void 0),v++),A(a.acceptOverlayUp,t,n)&&(x(void 0),v--),A(a.acceptOverlayLeft,t,n)&&(x(void 0),f--),A(a.acceptOverlayRight,t,n)&&(x(void 0),f++)):(A(a.goDownCell,t,n)?v+=1:A(a.goUpCell,t,n)?v-=1:A(a.goRightCell,t,n)?f+=1:A(a.goLeftCell,t,n)?f-=1:A(a.goDownCellRetainSelection,t,n)?(v+=1,b=!0):A(a.goUpCellRetainSelection,t,n)?(v-=1,b=!0):A(a.goRightCellRetainSelection,t,n)?(f+=1,b=!0):A(a.goLeftCellRetainSelection,t,n)?(f-=1,b=!0):A(a.goToLastRow,t,n)?v=$-1:A(a.goToFirstRow,t,n)?v=Number.MIN_SAFE_INTEGER:A(a.goToLastColumn,t,n)?f=Number.MAX_SAFE_INTEGER:A(a.goToFirstColumn,t,n)?f=Number.MIN_SAFE_INTEGER:(Ve==="rect"||Ve==="multi-rect")&&(A(a.selectGrowDown,t,n)?Oe([0,1]):A(a.selectGrowUp,t,n)?Oe([0,-1]):A(a.selectGrowRight,t,n)?Oe([1,0]):A(a.selectGrowLeft,t,n)?Oe([-1,0]):A(a.selectToLastRow,t,n)?Oe([0,2]):A(a.selectToFirstRow,t,n)?Oe([0,-2]):A(a.selectToLastColumn,t,n)?Oe([2,0]):A(a.selectToFirstColumn,t,n)&&Oe([-2,0])),T=n.didMatch),Ne!==void 0&&Ne!=="normal"&&v!==m){const L=Ne==="skip-up"||Ne==="skip"||Ne==="block",W=Ne==="skip-down"||Ne==="skip"||Ne==="block",J=v=0&&yt(v).isGroupHeader;)v--;v<0&&(v=m)}else if(!J&&W){for(;v<$&&yt(v).isGroupHeader;)v++;v>=$&&(v=m)}}const D=at(f,v,!1,b),R=n.didMatch;return R&&(D||!T||pn)&&r(),R},[Ne,qt,h,it,we,Ee,Ve,d,yt,$,at,Ie,rt,U.length,ct,pn,Rt,ue,be,oe,xo,Et,se,Dt,Vn,Bn,Oe]),jt=i.useCallback(t=>{let r=!1;if(Kt!==void 0&&Kt({...t,cancel:()=>{r=!0}}),r||Xn(t)||h.current===void 0)return;const[n,s]=h.current.cell,c=ze.current;if(no&&!t.metaKey&&!t.ctrlKey&&h.current!==void 0&&t.key.length===1&&/[ -~]/g.test(t.key)&&t.bounds!==void 0&&Io(O([n-d,Math.max(0,Math.min(s,$-1))]))){if((!oe||s!==$)&&(c.y>s||s>c.y+c.height||c.x>n||n>c.x+c.width))return;Dt(t.bounds,!0,t.key),t.stopPropagation(),t.preventDefault()}},[no,Kt,Xn,h,O,d,$,oe,Dt]),kl=i.useCallback((t,r)=>{const n=t.location[0]-d;if(t.kind==="header"&&(Ge==null||Ge(n,{...t,preventDefault:r})),t.kind===At){if(n<0)return;E==null||E(n,{...t,preventDefault:r})}if(t.kind==="cell"){const[s,c]=t.location;Ae==null||Ae([n,c],{...t,preventDefault:r}),ni(h,t.location)||at(s,c,!1,!1)}},[h,Ae,E,Ge,d,at]),an=i.useCallback(async t=>{var a,f,v;if(!it.paste)return;function r(m,b,T,y){var R,P;const D=typeof T=="object"?(T==null?void 0:T.join(` +`))??"":(T==null?void 0:T.toString())??"";if(!Eo(m)&&Io(m)&&m.readonly!==!0){const I=ee==null?void 0:ee(D,m);if(I!==void 0&&Jt(I))return{location:b,value:I};const L=ye(m);if(L===void 0)return;if(L.kind===Q.Custom){Go(m.kind===Q.Custom);const W=(R=L.onPaste)==null?void 0:R.call(L,D,m.data);return W===void 0?void 0:{location:b,value:{...m,data:W}}}else{const W=(P=L.onPaste)==null?void 0:P.call(L,D,m,{formatted:y,formattedString:typeof y=="string"?y:y==null?void 0:y.join(` +`),rawValue:T});return W===void 0?void 0:(Go(W.kind===m.kind),{location:b,value:W})}}}const n=h.columns,s=h.rows,c=((a=q.current)==null?void 0:a.contains(document.activeElement))===!0||((f=z.current)==null?void 0:f.contains(document.activeElement))===!0;let g;if(h.current!==void 0?g=[h.current.range.x,h.current.range.y]:n.length===1?g=[n.first()??0,0]:s.length===1&&(g=[d,s.first()??0]),c&&g!==void 0){let m,b;const T="text/plain",y="text/html";if(navigator.clipboard.read!==void 0){const I=await navigator.clipboard.read();for(const L of I){if(L.types.includes(y)){const J=await(await L.getType(y)).text(),ce=cr(J);if(ce!==void 0){m=ce;break}}L.types.includes(T)&&(b=await(await L.getType(T)).text())}}else if(navigator.clipboard.readText!==void 0)b=await navigator.clipboard.readText();else if(t!==void 0&&(t==null?void 0:t.clipboardData)!==null){if(t.clipboardData.types.includes(y)){const I=t.clipboardData.getData(y);m=cr(I)}m===void 0&&t.clipboardData.types.includes(T)&&(b=t.clipboardData.getData(T))}else return;const[D,R]=g,P=[];do{if(Ct===void 0){const I=Te(g),L=b??(m==null?void 0:m.map(J=>J.map(ce=>ce.rawValue).join(" ")).join(" "))??"",W=r(I,g,L,void 0);W!==void 0&&P.push(W);break}if(m===void 0){if(b===void 0)return;m=ri(b)}if(Ct===!1||typeof Ct=="function"&&(Ct==null?void 0:Ct([g[0]-d,g[1]],m.map(I=>I.map(L=>{var W;return((W=L.rawValue)==null?void 0:W.toString())??""}))))!==!0)return;for(const[I,L]of m.entries()){if(I+R>=$)break;for(const[W,J]of L.entries()){const ce=[W+D,I+R],[We,Ye]=ce;if(We>=V.length||Ye>=me)continue;const Ue=Te(ce),qe=r(Ue,ce,J.rawValue,J.formatted);qe!==void 0&&P.push(qe)}}}while(!1);$e(P),(v=ke.current)==null||v.damage(P.map(I=>({cell:I.location})))}},[ee,ye,Te,h,it.paste,q,V.length,$e,me,Ct,d,$]);hn("paste",an,S,!1,!0);const Zt=i.useCallback(async(t,r)=>{var a,f;if(!it.copy)return;const n=r===!0||((a=q.current)==null?void 0:a.contains(document.activeElement))===!0||((f=z.current)==null?void 0:f.contains(document.activeElement))===!0,s=h.columns,c=h.rows,g=(v,m)=>{if(!Cn)sr(v,m,t);else{const b=m.map(T=>({kind:Q.Text,data:U[T].title,displayData:U[T].title,allowOverlay:!1}));sr([b,...v],m,t)}};if(n&&fe!==void 0){if(h.current!==void 0){let v=fe(h.current.range,Me.current.signal);typeof v!="object"&&(v=await v()),g(v,Gt(h.current.range.x-d,h.current.range.x+h.current.range.width-d))}else if(c!==void 0&&c.length>0){const m=[...c].map(b=>{const T=fe({x:d,y:b,width:U.length,height:1},Me.current.signal);return typeof T=="object"?T[0]:T().then(y=>y[0])});if(m.some(b=>b instanceof Promise)){const b=await Promise.all(m);g(b,Gt(U.length))}else g(m,Gt(U.length))}else if(s.length>0){const v=[],m=[];for(const b of s){let T=fe({x:b,y:0,width:1,height:$},Me.current.signal);typeof T!="object"&&(T=await T()),v.push(T),m.push(b-d)}if(v.length===1)g(v[0],m);else{const b=v.reduce((T,y)=>T.map((D,R)=>[...D,...y[R]]));g(b,m)}}}},[U,fe,h,it.copy,d,q,$,Cn]);hn("copy",Zt,S,!1,!1);const Sl=i.useCallback(async t=>{var n,s;if(!(!it.cut||!(((n=q.current)==null?void 0:n.contains(document.activeElement))===!0||((s=z.current)==null?void 0:s.contains(document.activeElement))===!0))&&(await Zt(t),h.current!==void 0)){let c={current:{cell:h.current.cell,range:h.current.range,rangeStack:[]},rows:X.empty(),columns:X.empty()};const g=ct==null?void 0:ct(c);if(g===!1||(c=g===!0?c:g,c.current===void 0))return;Rt(c.current.range)}},[Rt,h,it.cut,Zt,q,ct]);hn("cut",Sl,S,!1,!1);const zl=i.useCallback((t,r)=>{if(Pe!==void 0){d!==0&&(t=t.map(c=>[c[0]-d,c[1]])),Pe(t,r);return}if(t.length===0||r===-1)return;const[n,s]=t[r];C.current!==void 0&&C.current[0]===n&&C.current[1]===s||(C.current=[n,s],at(n,s,!1,!1))},[Pe,d,at]),[ko,So]=((er=wt==null?void 0:wt.current)==null?void 0:er.cell)??[],zo=i.useRef(ie);zo.current=ie,i.useLayoutEffect(()=>{var t,r,n,s;sn.current&&!mo.current&&ko!==void 0&&So!==void 0&&(ko!==((r=(t=vo.current)==null?void 0:t.current)==null?void 0:r.cell[0])||So!==((s=(n=vo.current)==null?void 0:n.current)==null?void 0:s.cell[1]))&&zo.current(ko,So),mo.current=!1},[ko,So]);const Yn=h.current!==void 0&&(h.current.cell[0]>=V.length||h.current.cell[1]>=me);i.useLayoutEffect(()=>{Yn&&Ie(Ao,!1)},[Yn,Ie]);const Tl=i.useMemo(()=>oe===!0&&(B==null?void 0:B.tint)===!0?X.fromSingleSelection(me-1):X.empty(),[me,oe,B==null?void 0:B.tint]),Ll=i.useCallback(t=>typeof St=="boolean"?St:(St==null?void 0:St(t-d))??!0,[d,St]),Hl=i.useMemo(()=>{if(tn===void 0||z.current===null)return null;const{bounds:t,group:r}=tn,n=z.current.getBoundingClientRect();return j(Ji,{bounds:t,group:r,canvasBounds:n,onClose:()=>on(void 0),onFinish:s=>{on(void 0),re==null||re(r,s)}})},[re,tn]),Dl=Math.min(V.length,Qe+(_e?1:0));i.useImperativeHandle(o,()=>({appendRow:(t,r)=>Et(t+d,r),updateCells:t=>{var r;return d!==0&&(t=t.map(n=>({cell:[n.cell[0]+d,n.cell[1]]}))),(r=ke.current)==null?void 0:r.damage(t)},getBounds:(t,r)=>{var n;if(!((z==null?void 0:z.current)===null||(q==null?void 0:q.current)===null)){if(t===void 0&&r===void 0){const s=z.current.getBoundingClientRect(),c=s.width/q.current.clientWidth;return{x:s.x-q.current.scrollLeft*c,y:s.y-q.current.scrollTop*c,width:q.current.scrollWidth*c,height:q.current.scrollHeight*c}}return(n=ke.current)==null?void 0:n.getBounds((t??0)+d,r)}},focus:()=>{var t;return(t=ke.current)==null?void 0:t.focus()},emit:async t=>{switch(t){case"delete":jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Zt(void 0,!0);break;case"paste":await an();break}},scrollTo:ie,remeasureColumns:t=>{for(const r of t)Ro(r+d)}}),[Et,Ro,q,Zt,jt,an,d,ie]);const[qn,jn]=Xe??[],El=i.useCallback(t=>{const[r,n]=t;if(n===-1){we!=="none"&&(ue(X.fromSingleSelection(r),void 0,!1),xe());return}qn===r&&jn===n||(pe({cell:t,range:{x:r,y:n,width:1,height:1}},!0,!1,"keyboard-nav"),ie(r,n))},[we,xe,ie,qn,jn,pe,ue]),[Il,$l]=i.useState(!1),Zn=i.useRef(ui(t=>{$l(t)},5)),Fl=i.useCallback(()=>{Zn.current(!0),h.current===void 0&&h.columns.length===0&&h.rows.length===0&&M===void 0&&pe({cell:[d,Co],range:{x:d,y:Co,width:1,height:1}},!0,!1,"keyboard-select")},[Co,h,M,d,pe]),Al=i.useCallback(()=>{Zn.current(!1)},[]),[Gl,Pl]=i.useMemo(()=>{let t;const r=(ge==null?void 0:ge.scrollbarWidthOverride)??li(),n=$+(oe?1:0);if(typeof lt=="number")t=Vt+n*lt;else{let c=0;const g=Math.min(n,10);for(let a=0;ag.width+c,0)+r;return[`${Math.min(1e5,s)}px`,`${Math.min(1e5,t)}px`]},[V,ge==null?void 0:ge.scrollbarWidthOverride,lt,$,oe,Vt]),Kl=i.useMemo(()=>ii(ve),[ve]);return j(ci.Provider,{value:ve,children:Qt(cc,{style:Kl,className:Pt,inWidth:ne??Gl,inHeight:he??Pl,children:[j(Yi,{fillHandle:zr,drawFocusRing:Rn,experimental:ge,fixedShadowX:Tr,fixedShadowY:Lr,getRowThemeOverride:tt,headerIcons:Hr,imageWindowLoader:Dr,initialSize:Er,isDraggable:Ir,onDragLeave:$r,onRowMoved:Ut,overscrollX:Jr,overscrollY:Qr,preventDiagonalScrolling:Gr,rightElement:Pr,rightElementProps:Kr,smoothScrollX:Nr,smoothScrollY:Or,className:Pt,enableGroups:Zo,onCanvasFocused:Fl,onCanvasBlur:Al,canvasRef:z,onContextMenu:kl,theme:ve,cellXOffset:ul,cellYOffset:Co,accessibilityHeight:pt.height,onDragEnd:yl,columns:V,nonGrowWidth:$n,drawHeader:cl,onColumnProposeMove:Be,drawCell:sl,disabledRows:Tl,freezeColumns:Dl,lockColumns:d,firstColAccessible:d===0,getCellContent:Te,minColumnWidth:zt,maxColumnWidth:go,searchInputRef:p,showSearch:tl,onSearchClose:ol,highlightRegions:dl,getCellsForSelection:fe,getGroupDetails:Qo,headerHeight:qo,isFocused:Il,groupHeaderHeight:Zo?Hn:0,freezeTrailingRows:et+(oe&&(B==null?void 0:B.sticky)===!0?1:0),hasAppendRow:oe,onColumnResize:Lt,onColumnResizeEnd:ll,onColumnResizeStart:il,onCellFocused:El,onColumnMoved:pl,onDragStart:bl,onHeaderMenuClick:ml,onHeaderIndicatorClick:Cl,onItemHovered:cn,isFilling:(M==null?void 0:M.fillHandle)===!0,onMouseMove:vl,onKeyDown:jt,onKeyUp:ht,onMouseDown:fl,onMouseUp:gl,onDragOverCell:kr,onDrop:Sr,onSearchResultsChanged:zl,onVisibleRegionChanged:wl,clientSize:jo,rowHeight:lt,searchResults:ft,searchValue:Oo,onSearchValueChange:to,rows:me,scrollRef:q,selection:h,translateX:pt.tx,translateY:pt.ty,verticalBorder:Ll,gridRef:ke,getCellRenderer:ye,resizeIndicator:Xr}),Hl,w!==void 0&&j(i.Suspense,{fallback:null,children:j(wc,{...w,validateCell:rl,bloom:je,id:Ml,getCellRenderer:ye,className:(ge==null?void 0:ge.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:xr,imageEditorOverride:H,onFinishEditing:Rl,markdownDivCreateNode:N,isOutsideClick:_r})})]})})},xc=i.forwardRef(yc),Rc=(e,o)=>{const l=i.useMemo(()=>({...Oi,...e.headerIcons}),[e.headerIcons]),u=i.useMemo(()=>e.imageWindowLoader??new si,[e.imageWindowLoader]);return j(xc,{...e,renderers:ai,headerIcons:l,ref:o,imageWindowLoader:u})},Ic=i.forwardRef(Rc);export{qi as C,Ic as D,ut as k,vc as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-XEAOWHGB.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./index-wocATsGp.js","./image-window-loader-ggeJlWLo.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./iframe-alOpk4ZG.js","./image-window-loader-1jHxuE_X.css","./flatten-qRvRBp6y.js","./scrolling-data-grid-wnX0bxop.js","./scrolling-data-grid-dE2iz8sf.css","./data-grid-overlay-editor-EbzU9_4i.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/docs/assets/data-editor-all-fnGrkeU4.js b/docs/assets/data-editor-all-fnGrkeU4.js new file mode 100644 index 000000000..385adef4a --- /dev/null +++ b/docs/assets/data-editor-all-fnGrkeU4.js @@ -0,0 +1,135 @@ +var Ws=Object.defineProperty;var $s=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xe=(e,t,n)=>($s(e,typeof t!="symbol"?t+"":t,n),n);import{r as a,R as pt}from"./index-BMVQvedj.js";import{_ as Ml}from"./iframe-alOpk4ZG.js";import{h as Os,d as Rl,j as Ns,v as Xs,_ as Ys,g as Gs,c as cn,r as ao,t as Ks}from"./throttle-7EuXLZa7.js";import{u as Us,f as ji}from"./flatten-qRvRBp6y.js";import{s as Jt,b as Vs}from"./marked.esm-dbrxtycE.js";function El(e="This should not happen"){throw new Error(e)}function jt(e,t="Assertion failed"){if(!e)return El(t)}function nr(e,t){return El(t??"Hell froze over")}function _s(e,t){try{return e()}catch{return t}}const Zi=Object.prototype.hasOwnProperty;function Fo(e,t){let n,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&Fo(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Zi.call(e,n)&&++o&&!Zi.call(t,n)||!(n in t)||!Fo(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const Lr=null,xi=void 0;var j;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(j||(j={}));var Ji;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Ji||(Ji={}));var Pr;(function(e){e.Triangle="triangle",e.Dots="dots"})(Pr||(Pr={}));function Fr(e){return"width"in e&&typeof e.width=="number"}async function Qi(e){return typeof e=="object"?e:await e()}function Eo(e){return!(e.kind===j.Loading||e.kind===j.Bubble||e.kind===j.RowID||e.kind===j.Protected||e.kind===j.Drilldown)}function Ru(e){return!(e.kind===j.Loading||e.kind===j.Bubble||e.kind===j.RowID||e.kind===j.Protected||e.kind===j.Drilldown||e.kind===j.Boolean||e.kind===j.Image||e.kind===j.Custom)}function Io(e){return e.kind===un.Marker||e.kind===un.NewRow}function Jo(e){if(!Eo(e)||e.kind===j.Image)return!1;if(e.kind===j.Text||e.kind===j.Number||e.kind===j.Markdown||e.kind===j.Uri||e.kind===j.Custom||e.kind===j.Boolean)return e.readonly!==!0;nr(e,"A cell was passed with an invalid kind")}function qs(e){return Os(e,"editor")}function ki(e){return!(e.readonly??!1)}var un;(function(e){e.NewRow="new-row",e.Marker="marker"})(un||(un={}));function js(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(o,r){return o[0]-r[0]}),n.push([...t[0]]);for(const o of t.slice(1)){const r=n[n.length-1];r[1][o[0]+t,o[1]+t]);return new Bn(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=js([...this.items,n]);return new Bn(o)}remove(t){const n=[...this.items],o=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[s,c]=l;if(s<=r&&o<=c){const f=[];s=o&&tel??(el=new Bn([]))),Xe(Bn,"fromSingleSelection",t=>Bn.empty().add(t));let it=Bn;const Zs=Jt("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});function Wt(e,t,n,o,r=!1){const i=a.useRef();i.current=t,a.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=c=>{var f;(f=i.current)==null||f.call(l,c)};return l.addEventListener(e,s,{passive:o,capture:r}),()=>{l.removeEventListener(e,s,{capture:r})}},[e,n,o,r])}function so(e,t){return e===void 0?void 0:t}const Js=Math.PI;function tl(e){return e*Js/180}const Il=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Dl=(e,t,n,o,r)=>{switch(e){case"left":return Math.floor(t)+o+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-o-r/2}},Fl=(e,t,n)=>Math.min(e,t-n*2),Hl=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Si=e=>{const t=e.fgColor??"currentColor";return a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),a.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Qs=e=>{const t=e.fgColor??"currentColor";return a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function ea(e,t,n){const[o,r]=a.useState(e),i=a.useRef(!0);a.useEffect(()=>()=>{i.current=!1},[]);const l=a.useRef(Rl(s=>{i.current&&r(s)},n));return a.useLayoutEffect(()=>{i.current&&l.current(()=>e())},t),o}const ta="֑-߿יִ-﷽ﹰ-ﻼ",na="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",oa=new RegExp("^[^"+na+"]*["+ta+"]");function Mi(e){return oa.test(e)?"rtl":"not-rtl"}let Hr;function bi(){if(typeof document>"u")return 0;if(Hr!==void 0)return Hr;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),Hr=n-o,Hr}const lo=Symbol();function ra(e){const t=a.useRef([lo,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=a.useState(e),[,r]=a.useState(),i=a.useCallback(s=>{const c=t.current[0];c!==lo&&(s=typeof s=="function"?s(c):s,s===c)||(c!==lo&&r({}),o(f=>typeof s=="function"?s(c===lo?f:c):s),t.current[0]=lo)},[]),l=a.useCallback(()=>{t.current[0]=lo,r({})},[]);return[t.current[0]===lo?n:t.current[0],i,l]}function Tl(e){if(e.length===0)return"";let t=0,n=0;for(const o of e){if(n+=o.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function ia(e){const t=a.useRef(e);return Fo(e,t.current)||(t.current=e),t.current}const la=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:r}=e,i=t.filter(s=>s!=="");if(i.length===0)return null;const l=i.length>1;return a.createElement(Zs,{"data-testid":"GDG-default-image-overlay-editor"},a.createElement(Ns.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(s=>{const c=(r==null?void 0:r(s))??a.createElement("img",{draggable:!1,src:s});return a.createElement("div",{className:"gdg-centering-container",key:s},c)})),n&&o&&a.createElement("button",{className:"gdg-edit-icon",onClick:o},a.createElement(Si,null)))},sa=Jt("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class aa extends pt.PureComponent{constructor(){super(...arguments);Xe(this,"targetElement",null);Xe(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:o}=this;if(n===null)return;const{contents:r,createNode:i}=o,l=Vs(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let c=i==null?void 0:i(l);if(c===void 0){const u=document.createElement("template");u.innerHTML=l,c=u.content}n.append(c);const f=n.getElementsByTagName("a");for(const u of f)u.target="_blank",u.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),pt.createElement(sa,{ref:this.containerRefHook})}}const ca=Jt("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),da=Jt("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),ua=Jt("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let nl=0;const Xr=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:r,altNewline:i,validatedSelection:l,...s}=e,{onChange:c,className:f}=s,u=a.useRef(null),b=n??"";jt(c!==void 0,"GrowingEntry must be a controlled input area");const[w]=a.useState(()=>"input-box-"+(nl=(nl+1)%1e7));a.useEffect(()=>{const h=u.current;if(h===null||h.disabled)return;const m=b.toString().length;h.focus(),h.setSelectionRange(r?0:m,m)},[]),a.useLayoutEffect(()=>{var h;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(h=u.current)==null||h.setSelectionRange(m[0],m[1])}},[l]);const g=a.useCallback(h=>{h.key==="Enter"&&h.shiftKey&&i===!0||o==null||o(h)},[i,o]);return a.createElement(ua,{className:"gdg-growing-entry"},a.createElement(da,{className:f},b+` +`),a.createElement(ca,{...s,className:(f??"")+" gdg-input",id:w,ref:u,onKeyDown:g,value:b,placeholder:t,dir:"auto"}))},di={};let Un=null;function fa(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function Ho(e){const t=e.toLowerCase().trim();if(di[t]!==void 0)return di[t];Un=Un||fa(),Un.style.color="#000",Un.style.color=t;const n=getComputedStyle(Un).color;Un.style.color="#fff",Un.style.color=t;const o=getComputedStyle(Un).color;if(o!==n)return[0,0,0,1];let r=o.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return r.length<4&&r.push(1),r=r.map(i=>Number.isNaN(i)?0:i),di[t]=r,r}function uo(e,t){const[n,o,r]=Ho(e);return`rgba(${n}, ${o}, ${r}, ${t})`}const ol=new Map;function rl(e,t){const n=`${e}-${t}`,o=ol.get(n);if(o!==void 0)return o;const r=Zt(e,t);return ol.set(n,r),r}function Zt(e,t){if(t===void 0)return e;const[n,o,r,i]=Ho(e);if(i===1)return e;const[l,s,c,f]=Ho(t),u=i+f*(1-i),b=(i*n+f*l*(1-i))/u,w=(i*o+f*s*(1-i))/u,g=(i*r+f*c*(1-i))/u;return`rgba(${b}, ${w}, ${g}, ${u})`}function Eu(e,t,n){if(n<=0)return e;if(n>=1)return t;const o=[...Ho(e)];o[0]=o[0]*o[3],o[1]=o[1]*o[3],o[2]=o[2]*o[3];const r=[...Ho(t)];r[0]=r[0]*r[3],r[1]=r[1]*r[3],r[2]=r[2]*r[3];const i=n,l=1-n,s=o[3]*l+r[3]*i,c=Math.floor((o[0]*l+r[0]*i)/s),f=Math.floor((o[1]*l+r[1]*i)/s),u=Math.floor((o[2]*l+r[2]*i)/s);return`rgba(${c}, ${f}, ${u}, ${s})`}function Iu(e){if(e==="transparent")return 0;function t(i){const l=i/255;return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}const[n,o,r]=Ho(e);return .2126*t(n)+.7152*t(o)+.0722*t(r)}function ha(e,t){return pt.useMemo(()=>e.map((n,o)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:o,sticky:o=i.x&&n=i.y&&o=t.span[0]&&n.current.cell[0]<=t.span[1]}function Al(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&ol)return!1;if(t.span===void 0)return s>=o&&s<=r;const[f,u]=t.span;return f>=o&&f<=r||u>=o&&f<=r||fr}function wa(e,t,n,o){let r=0;if(n.current===void 0)return r;const i=n.current.range;(o||i.height*i.width>1)&&il(e,t,i)&&r++;for(const l of n.current.rangeStack)il(e,t,l)&&r++;return r}function Bl(e,t){let n=e;if(t!==void 0){let o=[...e];const r=n[t.src];t.src>t.dest?(o.splice(t.src,1),o.splice(t.dest,0,r)):(o.splice(t.dest+1,0,r),o.splice(t.src,1)),o=o.map((i,l)=>({...i,sticky:e[l].sticky})),n=o}return n}function To(e,t){let n=0;const o=Bl(e,t);for(let r=0;r0)for(const f of l)n-=f.width;let s=t,c=r??0;for(;c<=n&&s=b)return m}const w=i-f,g=e-(c??0);if(typeof l=="number"){const h=Math.floor((g-u)/l)+s;return h>=w?void 0:h}else{let h=u;for(let m=s;m"u";async function va(){var e;pa||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,Br=0,er={},Xs())}va();function Ll(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Ao(e,t,n,o="middle"){const r=Ll(e,t,o,n);let i=er[r];return i===void 0&&(i=t.measureText(e),er[r]=i,Br++),Br>1e4&&(er={},Br=0),i}function Pl(e,t){const n=Ll(e,void 0,"middle",t);return er[n]}function qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Ca(e,t)}function ll(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const sl=[];function Ca(e,t){for(const i of sl)if(i.key===t)return i.val;const n=ll(e,"alphabetic"),r=-(ll(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return sl.push({key:t,val:r}),r}function xa(e,t,n,o,r,i){const{ctx:l,rect:s,theme:c}=e;let f=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(f=n-t,fn&&(e=e.slice(0,n)),e}function Sa(e,t,n,o,r,i,l,s,c,f){const u=s.baseFontFull,b=Ys(e,t,u,r-s.cellHorizontalPadding*2,f??!1),w=$l(e,u),g=s.lineHeight*w,h=w+g*(b.length-1),m=h+s.cellVerticalPadding>i;m&&(e.save(),e.rect(n,o,r,i),e.clip());const x=o+i/2-h/2;let C=Math.max(o+s.cellVerticalPadding,x);for(const v of b)if(Wl(e,v,n,C,r,w,l,s,c),C+=g,C>o+i)break;m&&e.restore()}function En(e,t,n,o,r){const{ctx:i,rect:l,theme:s}=e,{x:c,y:f,width:u,height:b}=l;o=o??!1,o||(t=ka(t,u));const w=qn(i,s),g=Mi(t)==="rtl";if(n===void 0&&g&&(n="right"),g&&(i.direction="rtl"),t.length>0){let h=!1;n==="right"?(i.textAlign="right",h=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,h=!0),o?Sa(i,t,c,f,u,b,w,s,n,r):Wl(i,t,c,f,u,b,w,s,n),h&&(i.textAlign="start"),g&&(i.direction="inherit")}}function In(e,t,n,o,r,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,r/2,o/2)),tr:Math.max(0,Math.min(i.tr,r/2,o/2)),bl:Math.max(0,Math.min(i.bl,r/2,o/2)),br:Math.max(0,Math.min(i.br,r/2,o/2))},e.moveTo(t+i.tl,n),e.arcTo(t+o,n,t+o,n+i.tr,i.tr),e.arcTo(t+o,n+r,t+o-i.br,n+r,i.br),e.arcTo(t,n+r,t,n+r-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Ma(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function Ra(e,t,n){const o=function(s,c){const f=c.x-s.x,u=c.y-s.y,b=Math.sqrt(f*f+u*u),w=f/b,g=u/b;return{x:f,y:c.y-s.y,len:b,nx:w,ny:g,ang:Math.atan2(g,w)}};let r;const i=t.length;let l=t[i-1];for(let s=0;s1?1:w),m=1,x=!1;g<0?h<0?h=Math.PI+h:(h=Math.PI-h,m=-1,x=!0):h>0&&(m=-1,x=!0),r=c.radius!==void 0?c.radius:n;const C=h/2;let v=Math.abs(Math.cos(C)*r/Math.sin(C)),E;v>Math.min(u.len/2,b.len/2)?(v=Math.min(u.len/2,b.len/2),E=Math.abs(v*Math.sin(C)/Math.cos(C))):E=r;let X=c.x+b.nx*v,N=c.y+b.ny*v;X+=-b.ny*E*m,N+=b.nx*E*m,e.arc(X,N,E,u.ang+Math.PI/2*m,b.ang-Math.PI/2*m,x),l=c,c=f}e.closePath()}function pi(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h){const m={x:0,y:i+f,width:0,height:0};if(e>=g.length||t>=u||t<-2||e<0)return m;const x=i-r;if(e>=b){const C=l>e?-1:1,v=To(g);m.x+=v+c;for(let E=l;E!==e;E+=C)m.x+=g[C===1?E:E-1].width*C}else for(let C=0;C0&&or(g[C-1].group,v)&&g[C-1].sticky===E;){const N=g[C-1];m.x-=N.width,m.width+=N.width,C--}let X=e;for(;X+1n&&(m.width=n-m.x)}}else if(t>=u-w){let C=u-t;for(m.y=o;C>0;){const v=t+C-1;m.height=typeof h=="number"?h:h(v),m.y-=m.height,C--}m.height+=1}else{const C=s>t?-1:1;if(typeof h=="number"){const v=t-s;m.y+=v*h}else for(let v=s;v!==t;v+=C)m.y+=h(v)*C;m.height=(typeof h=="number"?h:h(t))+1}return m}const Ri=1<<21;function yn(e,t){return(t+2)*Ri+e}function Ol(e){return e%Ri}function Ei(e){return Math.floor(e/Ri)-2}function Ii(e){const t=Ol(e),n=Ei(e);return[t,n]}class Nl{constructor(){Xe(this,"visibleWindow",{x:0,y:0,width:0,height:0});Xe(this,"freezeCols",0);Xe(this,"freezeRows",[]);Xe(this,"isInWindow",t=>{const n=Ol(t),o=Ei(t),r=this.visibleWindow,i=n>=r.x&&n<=r.x+r.width||n=r.y&&o<=r.y+r.height||this.freezeRows.includes(o);return i&&l})}setWindow(t,n,o){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Fo(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class Ea extends Nl{constructor(){super(...arguments);Xe(this,"cache",new Map);Xe(this,"setValue",(n,o)=>{this.cache.set(yn(n[0],n[1]),o)});Xe(this,"getValue",n=>this.cache.get(yn(n[0],n[1])));Xe(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class tr{constructor(t=[]){Xe(this,"cells");this.cells=new Set(t.map(n=>yn(n[0],n[1])))}add(t){this.cells.add(yn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(yn(t[0],t[1]))}remove(t){this.cells.delete(yn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Ei(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{const g=Da(e,w[o],t,c);return f=Math.max(f,g),g});if(u.length>5&&s){f=0;let w=0;for(const h of u)w+=h;const g=w/u.length;for(let h=0;h=g*2?u[h]=0:f=Math.max(f,u[h])}f=Math.max(f,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const b=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(f)));return{...n,width:b}}function Fa(e,t,n,o,r,i,l,s,c){const f=a.useRef(t),u=a.useRef(n),b=a.useRef(l);f.current=t,u.current=n,b.current=l;const[w,g]=a.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);a.useLayoutEffect(()=>(w&&document.documentElement.append(w),()=>{w==null||w.remove()}),[w]);const h=a.useRef({}),m=a.useRef(),[x,C]=a.useState();return a.useLayoutEffect(()=>{const v=u.current;if(v===void 0||e.every(Fr))return;let E=Math.max(1,10-Math.floor(e.length/1e4)),X=0;E1&&(E--,X=1);const N={x:0,y:0,width:e.length,height:Math.min(f.current,E)},A={x:0,y:f.current-1,width:e.length,height:1};(async()=>{const K=v(N,c.signal),S=X>0?v(A,c.signal):void 0;let $;typeof K=="object"?$=K:$=await Qi(K),S!==void 0&&(typeof S=="object"?$=[...$,...S]:$=[...$,...await Qi(S)]),m.current=e,C($)})()},[c.signal,e]),a.useMemo(()=>{let E=e.every(Fr)?e:g===null?e.map(z=>Fr(z)?z:{...z,width:vi}):(g.font=b.current.baseFontFull,e.map((z,K)=>{if(Fr(z))return z;if(h.current[z.id]!==void 0)return{...z,width:h.current[z.id]};if(x===void 0||m.current!==e||z.id===void 0)return{...z,width:vi};const S=Kl(g,l,z,K,x,r,i,!0,s);return h.current[z.id]=S.width,S})),X=0,N=0;const A=[];for(const[z,K]of E.entries())X+=K.width,K.grow!==void 0&&K.grow>0&&(N+=K.grow,A.push(z));if(X0){const z=[...E],K=o-X;let S=K;for(let $=0;${const t=e.fgColor,n=e.bgColor;return` + ${ct}`},Ta=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct}`},Aa=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + `},za=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},Ba=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},Ul=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + + + `},La=e=>{const t=e.bgColor;return`${ct} + + + + +`},Pa=Ul,Wa=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},$a=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + + + + + + `},Oa=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + +`},Na=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},Xa=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},Ya=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},Ga=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + + `},Ka=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + +`},Ua=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + + `},Va=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},_a=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},qa=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},ja=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},Za=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + + + +`},Ja=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},Qa=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},ec=e=>{const t=e.fgColor,n=e.bgColor;return` + ${ct} + + + `},tc=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + + +`},nc=e=>{const t=e.fgColor,n=e.bgColor;return`${ct} + + +`},oc=e=>{const t=e.fgColor;return` + + + `},rc=e=>{const t=e.fgColor;return` + + + +`},ic={headerRowID:Ha,headerNumber:Aa,headerCode:Ta,headerString:za,headerBoolean:Ba,headerAudioUri:Pa,headerVideoUri:Wa,headerEmoji:$a,headerImage:Oa,headerUri:Ul,headerPhone:Na,headerMarkdown:Xa,headerDate:Ya,headerTime:Ga,headerEmail:Ka,headerReference:Ua,headerIfThenElse:Va,headerSingleValue:_a,headerLookup:qa,headerTextTemplate:ja,headerMath:Za,headerRollup:Ja,headerJoinStrings:Qa,headerSplitString:ec,headerGeoDistance:tc,headerArray:nc,rowOwnerOverlay:oc,protectedColumnOverlay:rc,renameIcon:La};function lc(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class sc{constructor(t,n){Xe(this,"onSettled");Xe(this,"spriteMap",new Map);Xe(this,"headerIcons");Xe(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,o,r,i,l,s,c=1){const[f,u]=lc(n,s),b=l*Math.ceil(window.devicePixelRatio),w=`${f}_${u}_${b}_${t}`;let g=this.spriteMap.get(w);if(g===void 0){const h=this.headerIcons[t];if(h===void 0)return;g=document.createElement("canvas");const m=g.getContext("2d");if(m===null)return;const x=new Image;x.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h({fgColor:u,bgColor:f}))}`,this.spriteMap.set(w,g);const C=x.decode();if(C===void 0)return;this.inFlight++,C.then(()=>{m.drawImage(x,0,0,b,b)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else c<1&&(o.globalAlpha=c),o.drawImage(g,0,0,b,b,r,i,l,l),c<1&&(o.globalAlpha=1)}}function Vl(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Yr(e,t,n,o,r,i,l,s,c){s=s??t;let f=t,u=e;const b=o-i;let w=!1;for(;fs&&c(f,u,g,!1,l&&u===o-1)===!0){w=!0;break}f+=g,u++}if(!w){f=n;for(let g=0;g!g.sticky))==null?void 0:w.sourceIndex)??0;if(c>b){const g=Math.max(s,b);let h=t,m=o;for(let x=i.sourceIndex-1;x>=g;x--)h-=l[x].width,m+=l[x].width;for(let x=i.sourceIndex+1;x<=c;x++)m+=l[x].width;u={x:h,y:n,width:m,height:r}}if(b>s){const g=Math.min(c,b-1);let h=t,m=o;for(let x=i.sourceIndex-1;x>=s;x--)h-=l[x].width,m+=l[x].width;for(let x=i.sourceIndex+1;x<=g;x++)m+=l[x].width;f={x:h,y:n,width:m,height:r}}return[f,u]}function ac(e,t,n,o){if(o==="any")return jl(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),Al([t,n],e))return;const r=t-e.x,i=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,c=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="horizontal"?Number.MAX_SAFE_INTEGER:l,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===l?{x:e.x,y:n,width:e.width,height:e.y-n}:c===i?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function rr(e,t,n,o,r,i,l,s){return e<=r+l&&r<=e+n&&t<=i+s&&i<=t+o}function co(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function jl(e,t){const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-o;return{x:n,y:o,width:r,height:i}}function cc(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function dc(e,t,n,o){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const r=-4,i=-4,l=t+4,s=n+4,c=r-e.x,f=e.x+e.width-l,u=i-e.y,b=e.y+e.height-s,w=c>0?e.x+Math.floor(c/o)*o:e.x,g=f>0?e.x+e.width-Math.floor(f/o)*o:e.x+e.width,h=u>0?e.y+Math.floor(u/o)*o:e.y,m=b>0?e.y+e.height-Math.floor(b/o)*o:e.y+e.height;return{x:w,y:h,width:g-w,height:m-h}}function uc(e,t,n,o,r){const[i,l,s,c]=t,[f,u,b,w]=r,{x:g,y:h,width:m,height:x}=e,C=[];if(m<=0||x<=0)return C;const v=g+m,E=h+x,X=gs,z=h+x>c,K=g>=i&&gi&&v<=s||gs,S=h>=l&&hl&&E<=c||hc;if(K&&S){const W=Math.max(g,i),D=Math.max(h,l),R=Math.min(v,s),M=Math.min(E,c);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:f,y:u,width:b-f+1,height:w-u+1}})}if(X&&N){const W=g,D=h,R=Math.min(v,i),M=Math.min(E,l);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:0,width:f+1,height:u+1}})}if(N&&K){const W=Math.max(g,i),D=h,R=Math.min(v,s),M=Math.min(E,l);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:f,y:0,width:b-f+1,height:u+1}})}if(N&&A){const W=Math.max(g,s),D=h,R=v,M=Math.min(E,l);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:b,y:0,width:n-b+1,height:u+1}})}if(X&&S){const W=g,D=Math.max(h,l),R=Math.min(v,i),M=Math.min(E,c);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:u,width:f+1,height:w-u+1}})}if(A&&S){const W=Math.max(g,s),D=Math.max(h,l),R=v,M=Math.min(E,c);C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:b,y:u,width:n-b+1,height:w-u+1}})}if(X&&z){const W=g,D=Math.max(h,c),R=Math.min(v,i),M=E;C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:w,width:f+1,height:o-w+1}})}if(z&&K){const W=Math.max(g,i),D=Math.max(h,c),R=Math.min(v,s),M=E;C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:f,y:w,width:b-f+1,height:o-w+1}})}if(A&&z){const W=Math.max(g,s),D=Math.max(h,c),R=v,M=E;C.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:b,y:w,width:n-b+1,height:o-w+1}})}return C}const fc={kind:j.Loading,allowOverlay:!1};function al(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C,v,E,X,N,A,z,K,S,$,W,D,R,M,ae,ne,ie,Ie){let pe=(E==null?void 0:E.size)??Number.MAX_SAFE_INTEGER;const Z=performance.now();let U=R.baseFontFull;e.font=U;const me={ctx:e},oe=[0,0],we=x>0?fo(c,x,f):0;let ue,V;const xe=Vl(v);return jn(t,s,i,l,r,(ve,_e,nt,bt,ot)=>{const Ae=Math.max(0,bt-_e),qe=_e+Ae,Re=r+1,yt=ve.width-Ae,dt=o-r-1;if(v.length>0){let Ye=!1;for(let Pe=0;Pe{e.save(),e.beginPath(),e.rect(qe,Re,yt,dt),e.clip()},q=X.columns.hasIndex(ve.sourceIndex),Oe=b(ve.group??"").overrideTheme,De=ve.themeOverride===void 0&&Oe===void 0?R:Ln(R,Oe,ve.themeOverride),Fe=De.baseFontFull;Fe!==U&&(U=Fe,e.font=Fe),je();let fe;return Yr(ot,nt,o,c,f,x,C,xe,(Ye,Pe,We,de,ke)=>{var vn,Qt,en;if(Pe<0||(oe[0]=ve.sourceIndex,oe[1]=Pe,E!==void 0&&!E.has(oe)))return;if(v.length>0){let ze=!1;for(let Mt=0;MtUe.span!==void 0&&ze>=Ue.span[0]&&ze<=Ue.span[1]);Lt&&!h&&m?gt=0:Lt&&m&&(gt=Math.max(gt,1)),pn&>++,Lt||(et&>++,q&&!ke&>++);const Pn=Ue.kind===j.Protected?St.bgCellMedium:St.bgCell;let st;if((de||Pn!==R.bgCell)&&(st=Zt(Pn,st)),gt>0||Ge){Ge&&(st=Zt(St.bgHeader,st));for(let ze=0;zeIe&&!kt){const ze=St.baseFontFull;ze!==U&&(e.font=ze,U=ze),fe=Zl(e,Ue,ve.sourceIndex,Pe,fn,ye,ut,Ye,Ze,We,gt>0,St,st??St.bgCell,z,K,(mt==null?void 0:mt.hoverAmount)??0,$,D,Z,W,fe,M,ae,ne,ie)}return Dn&&e.restore(),Ue.style==="faded"&&(e.globalAlpha=1),pe--,Te&&(e.restore(),(en=fe==null?void 0:fe.deprep)==null||en.call(fe,me),fe=void 0,je(),U=Fe,e.font=Fe),pe<=0}),e.restore(),pe<=0}),ue}const _o=[0,0],qo={x:0,y:0,width:0,height:0},ui=[void 0,()=>{}];let Ci=!1;function hc(){Ci=!0}function Zl(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C,v,E,X,N,A,z,K){var ae,ne;let S,$;x!==void 0&&x[0][0]===n&&x[0][1]===o&&(S=x[1][0],$=x[1][1]);let W;_o[0]=n,_o[1]=o,qo.x=l,qo.y=s,qo.width=c,qo.height=f,ui[0]=A.getValue(_o),ui[1]=ie=>A.setValue(_o,ie),Ci=!1;const D={ctx:e,theme:b,col:n,row:o,cell:t,rect:qo,highlighted:u,cellFillColor:w,hoverAmount:m,frameTime:v,hoverX:S,drawState:ui,hoverY:$,imageLoader:g,spriteManager:h,hyperWrapping:C,overrideCursor:S!==void 0?K:void 0,requestAnimationFrame:hc},R=xa(D,t.lastUpdated,v,X,r,i),M=z(t);if(M!==void 0){(X==null?void 0:X.renderer)!==M&&((ae=X==null?void 0:X.deprep)==null||ae.call(X,D),X=void 0);const ie=(ne=M.drawPrep)==null?void 0:ne.call(M,D,X);E!==void 0&&!Io(D.cell)?E(D,()=>M.draw(D,t)):M.draw(D,t),W=ie===void 0?void 0:{deprep:ie==null?void 0:ie.deprep,fillStyle:ie==null?void 0:ie.fillStyle,font:ie==null?void 0:ie.font,renderer:M}}return(R||Ci)&&(N==null||N(_o)),W}function Di(e,t,n,o,r,i,l,s,c=-20,f=-20,u=32,b="center",w="square"){const g=Math.floor(r+l/2),h=w==="circle"?1e4:t.roundingRadius??4;let m=Fl(u,l,t.cellVerticalPadding),x=m/2;const C=Dl(b,o,i,t.cellHorizontalPadding,m),v=Il(C,g,m),E=Hl(o+c,r+f,v);switch(n){case!0:{e.beginPath(),In(e,C-m/2,g-m/2,m,m,h),w==="circle"&&(x*=.8,m*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(C-x+m/4.23,g-x+m/1.97),e.lineTo(C-x+m/2.42,g-x+m/1.44),e.lineTo(C-x+m/1.29,g-x+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case Lr:case!1:{e.beginPath(),In(e,C-m/2+.5,g-m/2+.5,m-1,m-1,h),e.lineWidth=1,e.strokeStyle=E?t.textDark:t.textMedium,e.stroke();break}case xi:{e.beginPath(),In(e,C-m/2,g-m/2,m,m,h),e.fillStyle=E?t.textMedium:t.textLight,e.fill(),w==="circle"&&(x*=.8,m*=.8),e.beginPath(),e.moveTo(C-m/3,g),e.lineTo(C+m/3,g),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:nr()}}function gc(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C,v){var S,$,W,D;const E=l+s;if(E<=0)return;e.fillStyle=b.bgHeader,e.fillRect(0,0,r,E);const X=(S=o==null?void 0:o[0])==null?void 0:S[0],N=($=o==null?void 0:o[0])==null?void 0:$[1],A=(W=o==null?void 0:o[1])==null?void 0:W[0],z=(D=o==null?void 0:o[1])==null?void 0:D[1],K=b.headerFontFull;e.font=K,jn(t,0,i,0,E,(R,M,ae,ne)=>{var ve;if(x!==void 0&&!x.has([R.sourceIndex,-1]))return;const ie=Math.max(0,ne-M);e.save(),e.beginPath(),e.rect(M+ie,s,R.width-ie,l),e.clip();const Ie=m(R.group??"").overrideTheme,pe=R.themeOverride===void 0&&Ie===void 0?b:Ln(b,Ie,R.themeOverride);pe.bgHeader!==b.bgHeader&&(e.fillStyle=pe.bgHeader,e.fill()),pe!==b&&(e.font=pe.baseFontFull);const Z=u.columns.hasIndex(R.sourceIndex),U=c!==void 0||f,me=!U&&N===-1&&X===R.sourceIndex,oe=U?0:((ve=g.find(_e=>_e.item[0]===R.sourceIndex&&_e.item[1]===-1))==null?void 0:ve.hoverAmount)??0,we=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===R.sourceIndex,ue=Z?pe.accentColor:we?pe.bgHeaderHasFocus:pe.bgHeader,V=n?s:0,xe=R.sourceIndex===0?0:1;Z?(e.fillStyle=ue,e.fillRect(M+xe,V,R.width-xe,l)):(we||oe>0)&&(e.beginPath(),e.rect(M+xe,V,R.width-xe,l),we&&(e.fillStyle=pe.bgHeaderHasFocus,e.fill()),oe>0&&(e.globalAlpha=oe,e.fillStyle=pe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),es(e,M,V,R.width,l,R,Z,pe,me,me?A:void 0,me?z:void 0,we,oe,w,C,v),e.restore()}),n&&mc(e,t,r,i,s,o,b,w,g,h,m,x)}function mc(e,t,n,o,r,i,l,s,c,f,u,b){const[g,h]=(i==null?void 0:i[0])??[];let m=0;_l(t,n,o,r,(x,C,v,E,X,N)=>{if(b!==void 0&&!b.hasItemInRectangle({x:x[0],y:-2,width:x[1]-x[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,E,X,N),e.clip();const A=u(C),z=(A==null?void 0:A.overrideTheme)===void 0?l:Ln(l,A.overrideTheme),K=h===-2&&g!==void 0&&g>=x[0]&&g<=x[1],S=K?z.bgHeaderHovered:z.bgHeader;if(S!==l.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=z.textGroupHeader??z.textHeader,A!==void 0){let $=v;if(A.icon!==void 0&&(s.drawSprite(A.icon,"normal",e,$+8,(r-20)/2,20,z),$+=26),e.fillText(A.name,$+8,r/2+qn(e,l.headerFontFull)),A.actions!==void 0&&K){const W=Jl({x:v,y:E,width:X,height:N},A.actions);e.beginPath();const D=W[0].x-10,R=v+X-D;e.rect(D,0,R,r);const M=e.createLinearGradient(D,0,D+R,0),ae=uo(S,0);M.addColorStop(0,ae),M.addColorStop(10/R,S),M.addColorStop(1,S),e.fillStyle=M,e.fill(),e.globalAlpha=.6;const[ne,ie]=(i==null?void 0:i[1])??[-1,-1];for(let Ie=0;Ie35){const E=h?35:o-35,X=h?35*.7:o-35*.7,N=E/o,A=X/o,z=e.createLinearGradient(t,0,t+o,0),K=uo(x,0);z.addColorStop(h?1:0,x),z.addColorStop(N,x),z.addColorStop(A,K),z.addColorStop(h?0:1,K),e.fillStyle=z}else e.fillStyle=x;if(h&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,h?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+r/2+qn(e,s.headerFontFull)),h&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!C||!rr(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let v=l?"selected":"normal";i.style==="highlight"&&(v=l?"selected":"special"),w.drawSprite(i.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,s)}if(C&&m.menuBounds!==void 0){const v=m.menuBounds,E=f!==void 0&&u!==void 0&&co(v,f+t,u+n);if(E||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===Pr.Triangle){e.beginPath();const X=v.x+v.width/2-5.5,N=v.y+v.height/2-3;Ra(e,[{x:X,y:N},{x:X+11,y:N},{x:X+5.5,y:N+6}],1),e.fillStyle=x,e.fill()}else if(i.menuIcon===Pr.Dots){e.beginPath();const X=v.x+v.width/2,N=v.y+v.height/2;Ma(e,X,N),e.fillStyle=x,e.fill()}else{const X=v.x+(v.width-s.headerIconSize)/2,N=v.y+(v.height-s.headerIconSize)/2;w.drawSprite(i.menuIcon,"normal",e,X,N,s.headerIconSize,s)}E||(e.globalAlpha=1)}}function es(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m){const x=Mi(i.title)==="rtl",C=Ql(e,i,t,n,o,r,s,x);h!==void 0?h({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:r},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:w,isHovered:c,hasSelectedCell:b,spriteManager:g,menuBounds:(C==null?void 0:C.menuBounds)??{x:0,y:0,height:0,width:0}},()=>cl(e,t,n,o,r,i,l,s,c,f,u,w,g,m,x,C)):cl(e,t,n,o,r,i,l,s,c,f,u,w,g,m,x,C)}function bc(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C,v){if(C!==void 0||t[t.length-1]!==n[t.length-1])return;const E=Vl(x);jn(t,c,l,s,i,(X,N,A,z,K)=>{if(X!==t[t.length-1])return;N+=X.width;const S=Math.max(N,z);S>o||(e.save(),e.beginPath(),e.rect(S,i+1,1e4,r-i-1),e.clip(),Yr(K,A,r,f,u,h,m,E,($,W,D,R)=>{if(!R&&x.length>0&&!x.some(Ie=>rr(N,$,1e4,D,Ie.x,Ie.y,Ie.width,Ie.height)))return;const M=w.hasIndex(W),ae=g.hasIndex(W);e.beginPath();const ne=b==null?void 0:b(W),ie=ne===void 0?v:Ln(v,ne);ie.bgCell!==v.bgCell&&(e.fillStyle=ie.bgCell,e.fillRect(N,$,1e4,D)),ae&&(e.fillStyle=ie.bgHeader,e.fillRect(N,$,1e4,D)),M&&(e.fillStyle=ie.accentLight,e.fillRect(N,$,1e4,D))}),e.restore())})}function yc(e,t,n,o,r,i,l,s,c){let f=!1;for(const h of t)if(!h.sticky){f=l(h.sourceIndex);break}const u=c.horizontalBorderColor??c.borderColor,b=c.borderColor,w=f?To(t):0;let g;if(w!==0&&(g=rl(b,c.bgCell),e.beginPath(),e.moveTo(w+.5,0),e.lineTo(w+.5,o),e.strokeStyle=g,e.stroke()),r>0){const h=b===u&&g!==void 0?g:rl(u,c.bgCell),m=fo(i,r,s);e.beginPath(),e.moveTo(0,o-m+.5),e.lineTo(n,o-m+.5),e.strokeStyle=h,e.stroke()}}const ts=(e,t,n)=>{let o=0,r=t,i=0,l=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)o=Math.min(o,s.x-1),r=Math.max(r,s.x+s.width+1),i=Math.min(i,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:o,maxX:r,minY:i,maxY:l}};function pc(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h){var D;const m=h.bgCell,{minX:x,maxX:C,minY:v,maxY:E}=ts(s,i,l),X=[],N=l-fo(g,w,f);let A=c,z=n,K=0;for(;A+r=v&&R<=E-1){const ae=u==null?void 0:u(z),ne=ae==null?void 0:ae.bgCell;ne!==void 0&&ne!==m&&z>=g-w&&X.push({x,y:R,w:C-x,h:M,color:ne})}A+=M,z0)for(let R=0;R=x&&ae<=C&&b(R+1)&&X.push({x:ae,y:K,w:M.width,h:$,color:ne}),S+=M.width}if(X.length===0)return;let W;e.beginPath();for(let R=X.length-1;R>=0;R--){const M=X[R];W===void 0?W=M.color:M.color!==W&&(e.fillStyle=W,e.fill(),e.beginPath(),W=M.color),e.rect(M.x,M.y,M.w,M.h)}W!==void 0&&(e.fillStyle=W,e.fill()),e.beginPath()}function dl(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const D of c)e.rect(D.x+1,D.y+1,D.width-1,D.height-1);e.clip("evenodd")}const v=x.horizontalBorderColor??x.borderColor,E=x.borderColor,{minX:X,maxX:N,minY:A,maxY:z}=ts(s,i,l),K=[];e.beginPath();let S=.5;for(let D=0;D=X&&M<=N&&g(D+1)&&K.push({x1:M,y1:Math.max(f,A),x2:M,y2:Math.min(l,z),color:E})}let $=l+.5;for(let D=m-h;D=A&&ae<=z-1){const ne=w==null?void 0:w(R);K.push({x1:X,y1:ae,x2:N,y2:ae,color:(ne==null?void 0:ne.horizontalBorderColor)??(ne==null?void 0:ne.borderColor)??v})}D+=b(R),R++}}const W=Gs(K,D=>D.color);for(const D of Object.keys(W)){e.strokeStyle=D;for(const R of W[D])e.moveTo(R.x1,R.y1),e.lineTo(R.x2,R.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}function vc(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x,C,v){const E=[];e.imageSmoothingEnabled=!1;const X=Math.min(r.cellYOffset,l),N=Math.max(r.cellYOffset,l);let A=0;if(typeof C=="number")A+=(N-X)*C;else for(let M=X;Mr.cellYOffset&&(A=-A),A+=c-r.translateY;const z=Math.min(r.cellXOffset,i),K=Math.max(r.cellXOffset,i);let S=0;for(let M=z;Mr.cellXOffset&&(S=-S),S+=s-r.translateX;const $=To(x);if(S!==0&&A!==0)return{regions:[]};const W=f>0?fo(w,f,C):0,D=u-$-Math.abs(S),R=b-g-W-Math.abs(A)-1;if(D>150&&R>150){const M={sx:0,sy:0,sw:u*h,sh:b*h,dx:0,dy:0,dw:u*h,dh:b*h};if(A>0?(M.sy=(g+1)*h,M.sh=R*h,M.dy=(A+g+1)*h,M.dh=R*h,E.push({x:0,y:g,width:u,height:A+1})):A<0&&(M.sy=(-A+g+1)*h,M.sh=R*h,M.dy=(g+1)*h,M.dh=R*h,E.push({x:0,y:b+A-W,width:u,height:-A+W})),S>0?(M.sx=$*h,M.sw=D*h,M.dx=(S+$)*h,M.dw=D*h,E.push({x:$-1,y:0,width:S+2,height:b})):S<0&&(M.sx=($-S)*h,M.sw=D*h,M.dx=$*h,M.dw=D*h,E.push({x:u+S,y:0,width:-S,height:b})),e.setTransform(1,0,0,1,0,0),v){if($>0&&S!==0&&A===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const ae=$*h,ne=b*h;e.drawImage(t,0,0,ae,ne,0,0,ae,ne)}if(W>0&&S===0&&A!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const ae=(b-W)*h,ne=u*h,ie=W*h;e.drawImage(t,0,ae,ne,ie,0,ae,ne,ie)}}e.drawImage(t,M.sx,M.sy,M.sw,M.sh,M.dx,M.dy,M.dw,M.dh),e.scale(h,h)}return e.imageSmoothingEnabled=!0,{regions:E}}function Cc(e,t,n,o,r,i,l,s,c,f){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||r!==e.translateY||jn(c,n,o,r,s,(b,w,g,h)=>{if(b.sourceIndex===f){const m=Math.max(w,h)+1;return u.push({x:m,y:0,width:i-m,height:l}),!0}}),u}function xc(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let o=0;oz.style!=="no-outline");if(x===void 0||x.length===0)return;const C=To(s),v=fo(g,w,b),E=[c,0,s.length,g-w],X=[C,0,t,n-v],N=x.map(z=>{const K=z.range,S=z.style??"dashed";return uc(K,E,t,n,X).map($=>{const W=$.rect,D=pi(W.x,W.y,t,n,u,f+u,o,r,i,l,g,c,w,s,b),R=W.width===1&&W.height===1?D:pi(W.x+W.width-1,W.y+W.height-1,t,n,u,f+u,o,r,i,l,g,c,w,s,b);return W.x+W.width>=s.length&&(R.width-=1),W.y+W.height>=g&&(R.height-=1),{color:z.color,style:S,clip:$.clip,rect:dc({x:D.x,y:D.y,width:R.x+R.width-D.x,height:R.y+R.height-D.y},t,n,8)}})}),A=()=>{e.lineWidth=1;let z=!1;for(const K of N)for(const S of K)if((S==null?void 0:S.rect)!==void 0&&rr(0,0,t,n,S.rect.x,S.rect.y,S.rect.width,S.rect.height)){const $=z,W=!cc(S.clip,S.rect);W&&(e.save(),e.rect(S.clip.x,S.clip.y,S.clip.width,S.clip.height),e.clip()),S.style==="dashed"&&!z?(e.setLineDash([5,3]),z=!0):(S.style==="solid"||S.style==="solid-outline")&&z&&(e.setLineDash([]),z=!1),e.strokeStyle=S.style==="solid-outline"?Zt(Zt(S.color,m.borderColor),m.bgCell):uo(S.color,1),e.strokeRect(S.rect.x+.5,S.rect.y+.5,S.rect.width-1,S.rect.height-1),W&&(e.restore(),z=$)}z&&e.setLineDash([])};return A(),A}function fl(e,t,n,o,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,o),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function fi(e,t,n,o,r,i,l,s,c,f,u,b,w,g,h,m,x){if(u.current===void 0)return;const C=u.current.range,v=u.current.cell,E=[C.x+C.width-1,C.y+C.height-1];if(v[1]>=x&&E[1]>=x||!l.some(M=>M.sourceIndex===v[0]||M.sourceIndex===E[0]))return;const[N,A]=u.current.cell,z=w(u.current.cell),K=z.span??[N,N],S=A>=x-g,$=g>0&&!S?fo(x,g,b)-1:0,W=E[1];let D;if(jn(l,o,r,i,f,(M,ae,ne,ie,Ie)=>{if(M.sticky&&N>M.sourceIndex)return;const pe=M.sourceIndexK[1],U=M.sourceIndex===E[0];if(!(!U&&(pe||Z)))return Yr(Ie,ne,n,x,b,g,h,void 0,(me,oe,we)=>{if(oe!==A&&oe!==W)return;let ue=ae,V=M.width;if(z.span!==void 0){const ve=ql(z.span,ae,me,M.width,we,M,s),_e=M.sticky?ve[0]:ve[1];_e!==void 0&&(ue=_e.x,V=_e.width)}return oe===W&&U&&m&&(D=()=>{var ve;ie>ue&&!M.sticky&&(e.beginPath(),e.rect(ie,0,t-ie,n),e.clip()),e.beginPath(),e.rect(ue+V-4,me+we-4,4,4),e.fillStyle=((ve=M.themeOverride)==null?void 0:ve.accentColor)??c.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;const R=()=>{e.save(),e.beginPath(),e.rect(0,f,t,n-f-$),e.clip(),D==null||D(),e.restore()};return R(),R}function kc(e,t,n,o,r,i,l,s,c){c===void 0||c.size===0||(e.beginPath(),_l(t,n,i,o,(f,u,b,w,g,h)=>{c.hasItemInRectangle({x:f[0],y:-2,width:f[1]-f[0]+1,height:1})&&e.rect(b,w,g,h)}),jn(t,s,i,l,r,(f,u,b,w)=>{const g=Math.max(0,w-u),h=u+g+1,m=f.width-g-1;c.has([f.sourceIndex,-1])&&e.rect(h,o,m,r-o)}),e.clip())}function Sc(e,t,n,o,r,i,l,s,c,f){let u=0;return jn(e,i,o,r,n,(b,w,g,h,m)=>(Yr(m,g,t,l,s,c,f,void 0,(x,C,v,E)=>{E||(u=Math.max(C,u))}),!0)),u}function hl(e,t){var fn;const{canvasCtx:n,headerCanvasCtx:o,width:r,height:i,cellXOffset:l,cellYOffset:s,translateX:c,translateY:f,mappedColumns:u,enableGroups:b,freezeColumns:w,dragAndDropState:g,theme:h,drawFocus:m,headerHeight:x,groupHeaderHeight:C,disabledRows:v,rowHeight:E,verticalBorder:X,overrideCursor:N,isResizing:A,selection:z,fillHandle:K,freezeTrailingRows:S,rows:$,getCellContent:W,getGroupDetails:D,getRowThemeOverride:R,isFocused:M,drawHeaderCallback:ae,prelightCells:ne,drawCellCallback:ie,highlightRegions:Ie,resizeCol:pe,imageLoader:Z,lastBlitData:U,hoverValues:me,hyperWrapping:oe,hoverInfo:we,spriteManager:ue,maxScaleFactor:V,hasAppendRow:xe,touchMode:ve,enqueue:_e,renderStateProvider:nt,getCellRenderer:bt,renderStrategy:ot,bufferACtx:Ae,bufferBCtx:qe,damage:Re,minimumCellWidth:yt,resizeIndicator:dt}=e;if(r===0||i===0)return;const je=ot==="double-buffer",q=Math.min(V,Math.ceil(window.devicePixelRatio??1)),Oe=ot!=="direct"&&xc(e,t),De=n.canvas;(De.width!==r*q||De.height!==i*q)&&(De.width=r*q,De.height=i*q,De.style.width=r+"px",De.style.height=i+"px");const Fe=o.canvas,fe=b?C+x:x,Ye=fe+1;(Fe.width!==r*q||Fe.height!==Ye*q)&&(Fe.width=r*q,Fe.height=Ye*q,Fe.style.width=r+"px",Fe.style.height=Ye+"px");const Pe=Ae.canvas,We=qe.canvas;je&&(Pe.width!==r*q||Pe.height!==i*q)&&(Pe.width=r*q,Pe.height=i*q,U.current!==void 0&&(U.current.aBufferScroll=void 0)),je&&(We.width!==r*q||We.height!==i*q)&&(We.width=r*q,We.height=i*q,U.current!==void 0&&(U.current.bBufferScroll=void 0));const de=U.current;if(Oe===!0&&l===(de==null?void 0:de.cellXOffset)&&s===(de==null?void 0:de.cellYOffset)&&c===(de==null?void 0:de.translateX)&&f===(de==null?void 0:de.translateY))return;let ke=null;je&&(ke=n);const et=o;let Ge;je?Re!==void 0?Ge=(de==null?void 0:de.lastBuffer)==="b"?qe:Ae:Ge=(de==null?void 0:de.lastBuffer)==="b"?Ae:qe:Ge=n;const Ue=Ge.canvas,ut=je?Ue===Pe?We:Pe:De,Ze=typeof E=="number"?()=>E:E;et.save(),Ge.save(),et.beginPath(),Ge.beginPath(),et.textBaseline="middle",Ge.textBaseline="middle",q!==1&&(et.scale(q,q),Ge.scale(q,q));const Te=yi(u,l,r,g,c);let kt=[];const zt=m&&((fn=z.current)==null?void 0:fn.cell[1])===s&&f===0;let vt=!1;if(Ie!==void 0){for(const ye of Ie)if(ye.style!=="no-outline"&&ye.range.y===s&&f===0){vt=!0;break}}const St=()=>{gc(et,Te,b,we,r,c,x,C,g,A,z,h,ue,me,X,D,Re,ae,ve),dl(et,Te,s,c,f,r,i,void 0,void 0,C,fe,Ze,R,X,S,$,h,!0),et.beginPath(),et.moveTo(0,Ye-.5),et.lineTo(r,Ye-.5),et.strokeStyle=Zt(h.headerBottomBorderColor??h.horizontalBorderColor??h.borderColor,h.bgHeader),et.stroke(),vt&&ul(et,r,i,l,s,c,f,u,w,x,C,E,S,$,Ie,h),zt&&fi(et,r,i,s,c,f,Te,u,h,fe,z,Ze,W,S,xe,K,$)};if(Re!==void 0){const ye=Te[Te.length-1].sourceIndex+1,mt=Re.hasItemInRegion([{x:l,y:-2,width:ye,height:2},{x:l,y:s,width:ye,height:300},{x:0,y:s,width:w,height:300},{x:0,y:-2,width:w,height:2},{x:l,y:$-S,width:ye,height:S,when:S>0}]),vn=Qt=>{al(Qt,Te,u,i,fe,c,f,s,$,Ze,W,D,R,v,M,m,S,xe,kt,Re,z,ne,Ie,Z,ue,me,we,ie,oe,h,_e,nt,bt,N,yt);const en=z.current;K&&m&&en!==void 0&&Re.has(zl(en.range))&&fi(Qt,r,i,s,c,f,Te,u,h,fe,z,Ze,W,S,xe,K,$)};mt&&(vn(Ge),ke!==null&&(ke.save(),ke.scale(q,q),ke.textBaseline="middle",vn(ke),ke.restore()),Re.hasHeader()&&(kc(et,Te,r,C,fe,c,f,s,Re),St())),Ge.restore(),et.restore();return}if((Oe!==!0||l!==(de==null?void 0:de.cellXOffset)||c!==(de==null?void 0:de.translateX)||zt!==(de==null?void 0:de.mustDrawFocusOnHeader)||vt!==(de==null?void 0:de.mustDrawHighlightRingsOnHeader))&&St(),Oe===!0){jt(ut!==void 0&&de!==void 0);const{regions:ye}=vc(Ge,ut,ut===Pe?de.aBufferScroll:de.bBufferScroll,ut===Pe?de.bBufferScroll:de.aBufferScroll,de,l,s,c,f,S,r,i,$,fe,q,u,Te,E,je);kt=ye}else Oe!==!1&&(jt(de!==void 0),kt=Cc(de,l,s,c,f,r,i,fe,Te,Oe));yc(Ge,Te,r,i,S,$,X,Ze,h);const Lt=ul(Ge,r,i,l,s,c,f,u,w,x,C,E,S,$,Ie,h),gt=m?fi(Ge,r,i,s,c,f,Te,u,h,fe,z,Ze,W,S,xe,K,$):void 0;if(Ge.fillStyle=h.bgCell,kt.length>0){Ge.beginPath();for(const ye of kt)Ge.rect(ye.x,ye.y,ye.width,ye.height);Ge.clip(),Ge.fill(),Ge.beginPath()}else Ge.fillRect(0,0,r,i);const pn=al(Ge,Te,u,i,fe,c,f,s,$,Ze,W,D,R,v,M,m,S,xe,kt,Re,z,ne,Ie,Z,ue,me,we,ie,oe,h,_e,nt,bt,N,yt);bc(Ge,Te,u,r,i,fe,c,f,s,$,Ze,R,z.rows,v,S,xe,kt,Re,h),pc(Ge,Te,s,c,f,r,i,kt,fe,Ze,R,X,S,$,h),dl(Ge,Te,s,c,f,r,i,kt,pn,C,fe,Ze,R,X,S,$,h),Lt==null||Lt(),gt==null||gt(),A&&dt!=="none"&&jn(Te,0,c,0,fe,(ye,mt)=>ye.sourceIndex===pe?(fl(et,mt+ye.width,0,fe+1,Zt(h.resizeIndicatorColor??h.accentLight,h.bgHeader)),dt==="full"&&fl(Ge,mt+ye.width,fe,i,Zt(h.resizeIndicatorColor??h.accentLight,h.bgCell)),!0):!1),ke!==null&&(ke.fillStyle=h.bgCell,ke.fillRect(0,0,r,i),ke.drawImage(Ge.canvas,0,0));const Pn=Sc(Te,i,fe,c,f,s,$,Ze,S,xe);Z==null||Z.setWindow({x:l,y:s,width:Te.length,height:Pn-s},w,Array.from({length:S},(ye,mt)=>$-1-mt));const st=de!==void 0&&(l!==de.cellXOffset||c!==de.translateX),Dn=de!==void 0&&(s!==de.cellYOffset||f!==de.translateY);U.current={cellXOffset:l,cellYOffset:s,translateX:c,translateY:f,mustDrawFocusOnHeader:zt,mustDrawHighlightRingsOnHeader:vt,lastBuffer:je?Ue===Pe?"a":"b":void 0,aBufferScroll:Ue===Pe?[st,Dn]:de==null?void 0:de.aBufferScroll,bBufferScroll:Ue===We?[st,Dn]:de==null?void 0:de.bBufferScroll},Ge.restore(),et.restore()}const Mc=80;function Rc(e){const t=e-1;return t*t*t+1}class Ec{constructor(t){Xe(this,"callback");Xe(this,"currentHoveredItem");Xe(this,"leavingItems",[]);Xe(this,"lastAnimationTime");Xe(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>Qo(o.item,t.item))||this.leavingItems.push(t)});Xe(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>Qo(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});Xe(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});Xe(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});Xe(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Rc(t.hoverAmount)})));Xe(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/Mc;for(const i of this.leavingItems)i.hoverAmount=cn(i.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=cn(this.currentHoveredItem.hoverAmount+o,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});Xe(this,"setHovered",t=>{var n;if(!Qo((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const o=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:o}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class Ic{constructor(t){Xe(this,"fn");Xe(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Fi(e){return new Ic(e)}const Dc=Fi(()=>window.navigator.userAgent.includes("Firefox")),Wr=Fi(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),$r=Fi(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Fc(e){const t=a.useRef([]),n=a.useRef(0),o=a.useRef(e);o.current=e;const r=a.useCallback(()=>{const i=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(Ii);t.current=[],o.current(new tr(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:l)},[]);return a.useCallback(i=>{t.current.length===0&&r();const l=yn(i[0],i[1]);t.current.includes(l)||t.current.push(l)},[r])}const _n="header",dn="group-header",Or="out-of-bounds";var Do;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Do||(Do={}));function ns(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const gl=6,Hc=(e,t)=>{if(e.kind===j.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},Tc=(e,t)=>{const{width:n,height:o,accessibilityHeight:r,columns:i,cellXOffset:l,cellYOffset:s,headerHeight:c,fillHandle:f=!1,groupHeaderHeight:u,rowHeight:b,rows:w,getCellContent:g,getRowThemeOverride:h,onHeaderMenuClick:m,onHeaderIndicatorClick:x,enableGroups:C,isFilling:v,onCanvasFocused:E,onCanvasBlur:X,isFocused:N,selection:A,freezeColumns:z,onContextMenu:K,freezeTrailingRows:S,fixedShadowX:$=!0,fixedShadowY:W=!0,drawFocusRing:D,onMouseDown:R,onMouseUp:M,onMouseMoveRaw:ae,onMouseMove:ne,onItemHovered:ie,dragAndDropState:Ie,firstColAccessible:pe,onKeyDown:Z,onKeyUp:U,highlightRegions:me,canvasRef:oe,onDragStart:we,onDragEnd:ue,eventTargetRef:V,isResizing:xe,resizeColumn:ve,isDragging:_e,isDraggable:nt=!1,allowResize:bt,disabledRows:ot,hasAppendRow:Ae,getGroupDetails:qe,theme:Re,prelightCells:yt,headerIcons:dt,verticalBorder:je,drawCell:q,drawHeader:Oe,onCellFocused:De,onDragOverCell:Fe,onDrop:fe,onDragLeave:Ye,imageWindowLoader:Pe,smoothScrollX:We=!1,smoothScrollY:de=!1,experimental:ke,getCellRenderer:et,resizeIndicator:Ge="full"}=e,Ue=e.translateX??0,ut=e.translateY??0,Ze=Math.max(z,Math.min(i.length-1,l)),Te=a.useRef(null),kt=a.useRef(window),zt=kt.current,vt=Pe,St=a.useRef(),[Lt,gt]=a.useState(!1),pn=a.useRef([]),Pn=a.useRef(),[st,Dn]=a.useState(),[fn,ye]=a.useState(),mt=a.useRef(null),[vn,Qt]=a.useState(),[en,ze]=a.useState(!1),Mt=a.useRef(en);Mt.current=en;const ft=a.useMemo(()=>new sc(dt,()=>{ho.current=void 0,Jn.current()}),[dt]),$t=C?u+c:c,Tt=a.useRef(-1),Yt=((ke==null?void 0:ke.enableFirefoxRescaling)??!1)&&Dc.value,Wn=((ke==null?void 0:ke.enableSafariRescaling)??!1)&&Wr.value;a.useLayoutEffect(()=>{window.devicePixelRatio===1||!Yt&&!Wn||(Tt.current!==-1&>(!0),window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{gt(!1),Tt.current=-1},200))},[s,Ze,Ue,ut,Yt,Wn]);const Rt=ha(i,z),Ft=$?To(Rt,Ie):0,Ht=a.useCallback((k,Y,le)=>{const ce=k.getBoundingClientRect();if(Y>=Rt.length||le>=w)return;const _=ce.width/n,re=pi(Y,le,n,o,u,$t,Ze,s,Ue,ut,w,z,S,Rt,b);return _!==1&&(re.x*=_,re.y*=_,re.width*=_,re.height*=_),re.x+=ce.x,re.y+=ce.y,re},[n,o,u,$t,Ze,s,Ue,ut,w,z,S,Rt,b]),Bt=a.useCallback((k,Y,le,ce)=>{const _=k.getBoundingClientRect(),re=_.width/n,He=(Y-_.left)/re,Ce=(le-_.top)/re,ee=5,Je=yi(Rt,Ze,n,void 0,Ue);let te=0,Ee=0;ce instanceof MouseEvent&&(te=ce.button,Ee=ce.buttons);const Ne=ba(He,Je,Ue),Ve=ya(Ce,o,C,c,u,w,b,s,ut,S),Et=(ce==null?void 0:ce.shiftKey)===!0,lt=(ce==null?void 0:ce.ctrlKey)===!0,tt=(ce==null?void 0:ce.metaKey)===!0,rn=ce!==void 0&&!(ce instanceof MouseEvent)||(ce==null?void 0:ce.pointerType)==="touch",ln=[He<0?-1:nn||Ce>o){const rt=He>n?1:He<0?-1:0,Kt=Ce>o?1:Ce<0?-1:0;let $e=rt*2,At=Kt*2;rt===0&&($e=Ne===-1?Do.EndPadding:Do.Center),Kt===0&&(At=Ve===void 0?Do.EndPadding:Do.Center);let Vt=!1;if(Ne===-1&&Ve===-1){const _t=Ht(k,Rt.length-1,-1);jt(_t!==void 0),Vt=Y<_t.x+_t.width+ee}const po=He>n&&Heo&&Ce=0?(Kt=!0,rt=Ht(k,$e,Ve),jt(rt!==void 0),Pt={kind:C&&Ve===-2?dn:_n,location:[$e,Ve],bounds:rt,group:Rt[$e].group??"",isEdge:Kt,shiftKey:Et,ctrlKey:lt,metaKey:tt,isTouch:rn,localEventX:Y-rt.x,localEventY:le-rt.y,button:te,buttons:Ee,scrollEdge:ln}):Pt={kind:C&&Ve===-2?dn:_n,group:Rt[Ne].group??"",location:[Ne,Ve],bounds:rt,isEdge:Kt,shiftKey:Et,ctrlKey:lt,metaKey:tt,isTouch:rn,localEventX:Y-rt.x,localEventY:le-rt.y,button:te,buttons:Ee,scrollEdge:ln}}else{const rt=Ht(k,Ne,Ve);jt(rt!==void 0);const Kt=rt!==void 0&&rt.x+rt.width-Y{}),$n=a.useRef(st);$n.current=st;const[Hn,Tn]=a.useMemo(()=>{const k=document.createElement("canvas"),Y=document.createElement("canvas");return k.style.display="none",k.style.opacity="0",k.style.position="fixed",Y.style.display="none",Y.style.opacity="0",Y.style.position="fixed",[k.getContext("2d",{alpha:!1}),Y.getContext("2d",{alpha:!1})]},[]);a.useLayoutEffect(()=>{if(!(Hn===null||Tn===null))return document.documentElement.append(Hn.canvas),document.documentElement.append(Tn.canvas),()=>{Hn.canvas.remove(),Tn.canvas.remove()}},[Hn,Tn]);const Cn=a.useMemo(()=>new Ea,[]),sr=Yt&&Lt?1:Wn&&Lt?2:5,ar=(ke==null?void 0:ke.disableMinimumCellWidth)===!0?1:10,ho=a.useRef(),go=a.useRef(null),mo=a.useRef(null),Zn=a.useCallback(()=>{var He;const k=Te.current,Y=mt.current;if(k===null||Y===null||(go.current===null&&(go.current=k.getContext("2d",{alpha:!1}),k.width=0,k.height=0),mo.current===null&&(mo.current=Y.getContext("2d",{alpha:!1}),Y.width=0,Y.height=0),go.current===null||mo.current===null||Hn===null||Tn===null))return;let le=!1;const ce=Ce=>{le=!0,Qt(Ce)},_=ho.current,re={headerCanvasCtx:mo.current,canvasCtx:go.current,bufferACtx:Hn,bufferBCtx:Tn,width:n,height:o,cellXOffset:Ze,cellYOffset:s,translateX:Math.round(Ue),translateY:Math.round(ut),mappedColumns:Rt,enableGroups:C,freezeColumns:z,dragAndDropState:Ie,theme:Re,headerHeight:c,groupHeaderHeight:u,disabledRows:ot??it.empty(),rowHeight:b,verticalBorder:je,isResizing:xe,resizeCol:ve,isFocused:N,selection:A,fillHandle:f,drawCellCallback:q,hasAppendRow:Ae,overrideCursor:ce,maxScaleFactor:sr,freezeTrailingRows:S,rows:w,drawFocus:D,getCellContent:g,getGroupDetails:qe??(Ce=>({name:Ce})),getRowThemeOverride:h,drawHeaderCallback:Oe,prelightCells:yt,highlightRegions:me,imageLoader:vt,lastBlitData:Pn,damage:St.current,hoverValues:pn.current,hoverInfo:$n.current,spriteManager:ft,scrolling:Lt,hyperWrapping:(ke==null?void 0:ke.hyperWrapping)??!1,touchMode:en,enqueue:lr.current,renderStateProvider:Cn,renderStrategy:(ke==null?void 0:ke.renderStrategy)??(Wr.value?"double-buffer":"single-buffer"),getCellRenderer:et,minimumCellWidth:ar,resizeIndicator:Ge};re.damage===void 0?(ho.current=re,hl(re,_)):hl(re,void 0),!le&&(re.damage===void 0||re.damage.has((He=$n==null?void 0:$n.current)==null?void 0:He[0]))&&Qt(void 0)},[Hn,Tn,n,o,Ze,s,Ue,ut,Rt,C,z,Ie,Re,c,u,ot,b,je,xe,Ae,ve,N,A,f,S,w,D,sr,g,qe,h,q,Oe,yt,me,vt,ft,Lt,ke==null?void 0:ke.hyperWrapping,ke==null?void 0:ke.renderStrategy,en,Cn,et,ar,Ge]),Jn=a.useRef(Zn);a.useLayoutEffect(()=>{Zn(),Jn.current=Zn},[Zn]),a.useLayoutEffect(()=>{(async()=>{var Y;((Y=document==null?void 0:document.fonts)==null?void 0:Y.ready)!==void 0&&(await document.fonts.ready,ho.current=void 0,Jn.current())})()},[]);const On=a.useCallback(k=>{St.current=k,Jn.current(),St.current=void 0},[]),Gr=Fc(On);lr.current=Gr;const cr=a.useCallback(k=>{On(new tr(k.map(Y=>Y.cell)))},[On]);vt.setCallback(On);const[dr,Kr]=a.useState(!1),[wo,Nn]=Fn??[],zo=wo!==void 0&&Nn===-1,Ur=wo!==void 0&&Nn===-2;let Bo=!1,Lo=!1,Qn=vn;if(Qn===void 0&&wo!==void 0&&Nn!==void 0&&Nn>-1&&Nn({contain:"strict",display:"block",cursor:Gt}),[Gt]),Wo=a.useRef("default"),bo=V==null?void 0:V.current;bo!=null&&Wo.current!==Po.cursor&&(bo.style.cursor=Wo.current=Po.cursor);const An=a.useCallback((k,Y,le,ce)=>{if(qe===void 0)return;const _=qe(k);if(_.actions!==void 0){const re=Jl(Y,_.actions);for(const[He,Ce]of re.entries())if(co(Ce,le+Y.x,ce+Ce.y))return _.actions[He]}},[qe]),zn=a.useCallback((k,Y,le,ce)=>{const _=Rt[Y];if(!_e&&!xe&&!(fn??!1)){const re=Ht(k,Y,-1);jt(re!==void 0);const He=Ql(void 0,_,re.x,re.y,re.width,re.height,Re,Mi(_.title)==="rtl");if(_.hasMenu===!0&&He.menuBounds!==void 0&&co(He.menuBounds,le,ce))return{area:"menu",bounds:He.menuBounds};if(_.indicatorIcon!==void 0&&He.indicatorIconBounds!==void 0&&co(He.indicatorIconBounds,le,ce))return{area:"indicator",bounds:He.indicatorIconBounds}}},[Rt,Ht,fn,_e,xe,Re]),Xn=a.useRef(0),tn=a.useRef(),Yn=a.useRef(!1),ur=a.useCallback(k=>{const Y=Te.current,le=V==null?void 0:V.current;if(Y===null||k.target!==Y&&k.target!==le)return;Yn.current=!0;let ce,_;if(k instanceof MouseEvent?(ce=k.clientX,_=k.clientY):(ce=k.touches[0].clientX,_=k.touches[0].clientY),k.target===le&&le!==null){const He=le.getBoundingClientRect();if(ce>He.right||_>He.bottom)return}const re=Bt(Y,ce,_,k);tn.current=re.location,re.isTouch&&(Xn.current=Date.now()),Mt.current!==re.isTouch&&ze(re.isTouch),!(re.kind===_n&&zn(Y,re.location[0],ce,_)!==void 0)&&(re.kind===dn&&An(re.group,re.bounds,re.localEventX,re.localEventY)!==void 0||(R==null||R(re),!re.isTouch&&nt!==!0&&nt!==re.kind&&re.button<3&&re.button!==1&&k.preventDefault()))},[V,nt,Bt,An,zn,R]);Wt("touchstart",ur,zt,!1),Wt("mousedown",ur,zt,!1);const $o=a.useRef(0),Se=a.useCallback(k=>{var Ee,Ne;const Y=$o.current;$o.current=Date.now();const le=Te.current;if(Yn.current=!1,M===void 0||le===null)return;const ce=V==null?void 0:V.current,_=k.target!==le&&k.target!==ce;let re,He,Ce=!0;if(k instanceof MouseEvent){if(re=k.clientX,He=k.clientY,Ce=k.button<3,k.pointerType==="touch")return}else re=k.changedTouches[0].clientX,He=k.changedTouches[0].clientY;let ee=Bt(le,re,He,k);ee.isTouch&&Xn.current!==0&&Date.now()-Xn.current>500&&(ee={...ee,isLongTouch:!0}),Y!==0&&Date.now()-Y<(ee.isTouch?1e3:500)&&(ee={...ee,isDoubleClick:!0}),Mt.current!==ee.isTouch&&ze(ee.isTouch),!_&&k.cancelable&&Ce&&k.preventDefault();const[Je]=ee.location,te=zn(le,Je,re,He);if(ee.kind===_n&&te!==void 0){(ee.button!==0||((Ee=tn.current)==null?void 0:Ee[0])!==Je||((Ne=tn.current)==null?void 0:Ne[1])!==-1)&&M(ee,!0);return}else if(ee.kind===dn){const Ve=An(ee.group,ee.bounds,ee.localEventX,ee.localEventY);if(Ve!==void 0){ee.button===0&&Ve.onClick(ee);return}}M(ee,_)},[M,V,Bt,zn,An]);Wt("mouseup",Se,zt,!1),Wt("touchend",Se,zt,!1);const fr=a.useCallback(k=>{var Je,te;const Y=Te.current;if(Y===null)return;const le=V==null?void 0:V.current,ce=k.target!==Y&&k.target!==le;let _,re,He=!0;k instanceof MouseEvent?(_=k.clientX,re=k.clientY,He=k.button<3):(_=k.changedTouches[0].clientX,re=k.changedTouches[0].clientY);const Ce=Bt(Y,_,re,k);Mt.current!==Ce.isTouch&&ze(Ce.isTouch),!ce&&k.cancelable&&He&&k.preventDefault();const[ee]=Ce.location;if(Ce.kind===_n){const Ee=zn(Y,ee,_,re);Ee!==void 0&&Ce.button===0&&((Je=tn.current)==null?void 0:Je[0])===ee&&((te=tn.current)==null?void 0:te[1])===-1&&(Ee.area==="menu"?m==null||m(ee,Ee.bounds):Ee.area==="indicator"&&(x==null||x(ee,Ee.bounds)))}else if(Ce.kind===dn){const Ee=An(Ce.group,Ce.bounds,Ce.localEventX,Ce.localEventY);Ee!==void 0&&Ce.button===0&&Ee.onClick(Ce)}},[V,Bt,zn,m,x,An]);Wt("click",fr,zt,!1);const Vr=a.useCallback(k=>{const Y=Te.current,le=V==null?void 0:V.current;if(Y===null||k.target!==Y&&k.target!==le||K===void 0)return;const ce=Bt(Y,k.clientX,k.clientY,k);K(ce,()=>{k.cancelable&&k.preventDefault()})},[V,Bt,K]);Wt("contextmenu",Vr,(V==null?void 0:V.current)??null,!1);const nn=a.useCallback(k=>{St.current=new tr(k.map(Y=>Y.item)),pn.current=k,Jn.current(),St.current=void 0},[]),hr=a.useMemo(()=>new Ec(nn),[nn]),hn=a.useRef(hr);hn.current=hr,a.useLayoutEffect(()=>{const k=hn.current;if(Fn===void 0||Fn[1]<0){k.setHovered(Fn);return}const Y=g(Fn,!0),le=et(Y),ce=le===void 0&&Y.kind===j.Custom||(le==null?void 0:le.needsHover)!==void 0&&(typeof le.needsHover=="boolean"?le.needsHover:le.needsHover(Y));k.setHovered(ce?Fn:void 0)},[g,et,Fn]);const yo=a.useRef(),gr=a.useCallback(k=>{var Ce;const Y=Te.current;if(Y===null)return;const le=V==null?void 0:V.current,ce=k.target!==Y&&k.target!==le,_=Bt(Y,k.clientX,k.clientY,k);if(_.kind!=="out-of-bounds"&&ce&&!Yn.current&&!_.isTouch)return;const re=(ee,Je)=>{Dn(te=>te===ee||(te==null?void 0:te[0][0])===(ee==null?void 0:ee[0][0])&&(te==null?void 0:te[0][1])===(ee==null?void 0:ee[0][1])&&((te==null?void 0:te[1][0])===(ee==null?void 0:ee[1][0])&&(te==null?void 0:te[1][1])===(ee==null?void 0:ee[1][1])||!Je)?te:ee)};if(!ns(_,yo.current))Qt(void 0),ie==null||ie(_),re(_.kind===Or?void 0:[_.location,[_.localEventX,_.localEventY]],!0),yo.current=_;else if(_.kind==="cell"||_.kind===_n||_.kind===dn){let ee=!1,Je=!0;if(_.kind==="cell"){const Ee=g(_.location);Je=((Ce=et(Ee))==null?void 0:Ce.needsHoverPosition)??Ee.kind===j.Custom,ee=Je}else ee=!0;const te=[_.location,[_.localEventX,_.localEventY]];re(te,Je),$n.current=te,ee&&On(new tr([_.location]))}const He=_.location[0]>=(pe?0:1);ye(_.kind===_n&&_.isEdge&&He&&bt===!0),Kr(_.kind==="cell"&&_.isFillHandle),ae==null||ae(k),ne(_)},[V,Bt,pe,bt,ae,ne,ie,g,et,On]);Wt("mousemove",gr,zt,!0);const mr=a.useCallback(k=>{const Y=Te.current;if(Y===null)return;let le,ce;A.current!==void 0&&(le=Ht(Y,A.current.cell[0],A.current.cell[1]),ce=A.current.cell),Z==null||Z({bounds:le,stopPropagation:()=>k.stopPropagation(),preventDefault:()=>k.preventDefault(),cancel:()=>{},ctrlKey:k.ctrlKey,metaKey:k.metaKey,shiftKey:k.shiftKey,altKey:k.altKey,key:k.key,keyCode:k.keyCode,rawEvent:k,location:ce})},[Z,A,Ht]),_r=a.useCallback(k=>{const Y=Te.current;if(Y===null)return;let le,ce;A.current!==void 0&&(le=Ht(Y,A.current.cell[0],A.current.cell[1]),ce=A.current.cell),U==null||U({bounds:le,stopPropagation:()=>k.stopPropagation(),preventDefault:()=>k.preventDefault(),cancel:()=>{},ctrlKey:k.ctrlKey,metaKey:k.metaKey,shiftKey:k.shiftKey,altKey:k.altKey,key:k.key,keyCode:k.keyCode,rawEvent:k,location:ce})},[U,A,Ht]),qr=a.useCallback(k=>{if(Te.current=k,oe!==void 0&&(oe.current=k),k===null)kt.current=window;else{const Y=k.getRootNode();Y===document&&(kt.current=window),kt.current=Y}},[oe]),xn=a.useCallback(k=>{const Y=Te.current;if(Y===null||nt===!1||xe){k.preventDefault();return}let le,ce;const _=Bt(Y,k.clientX,k.clientY);if(nt!==!0&&_.kind!==nt){k.preventDefault();return}const re=(Ee,Ne)=>{le=Ee,ce=Ne};let He,Ce,ee;const Je=(Ee,Ne,Ve)=>{He=Ee,Ce=Ne,ee=Ve};let te=!1;if(we==null||we({..._,setData:re,setDragImage:Je,preventDefault:()=>te=!0,defaultPrevented:()=>te}),!te&&le!==void 0&&ce!==void 0&&k.dataTransfer!==null)if(k.dataTransfer.setData(le,ce),k.dataTransfer.effectAllowed="copyLink",He!==void 0&&Ce!==void 0&&ee!==void 0)k.dataTransfer.setDragImage(He,Ce,ee);else{const[Ee,Ne]=_.location;if(Ne!==void 0){const Ve=document.createElement("canvas"),Et=Ht(Y,Ee,Ne);jt(Et!==void 0);const lt=Math.ceil(window.devicePixelRatio??1);Ve.width=Et.width*lt,Ve.height=Et.height*lt;const tt=Ve.getContext("2d");tt!==null&&(tt.scale(lt,lt),tt.textBaseline="middle",Ne===-1?(tt.font=Re.headerFontFull,tt.fillStyle=Re.bgHeader,tt.fillRect(0,0,Ve.width,Ve.height),es(tt,0,0,Et.width,Et.height,Rt[Ee],!1,Re,!1,void 0,void 0,!1,0,ft,Oe,!1)):(tt.font=Re.baseFontFull,tt.fillStyle=Re.bgCell,tt.fillRect(0,0,Ve.width,Ve.height),Zl(tt,g([Ee,Ne]),0,Ne,!1,!1,0,0,Et.width,Et.height,!1,Re,Re.bgCell,vt,ft,1,void 0,!1,0,void 0,void 0,void 0,Cn,et,()=>{}))),Ve.style.left="-100%",Ve.style.position="absolute",Ve.style.width=`${Et.width}px`,Ve.style.height=`${Et.height}px`,document.body.append(Ve),k.dataTransfer.setDragImage(Ve,Et.width/2,Et.height/2),window.setTimeout(()=>{Ve.remove()},0)}}else k.preventDefault()},[nt,xe,Bt,we,Ht,Re,Rt,ft,Oe,g,vt,Cn,et]);Wt("dragstart",xn,(V==null?void 0:V.current)??null,!1,!1);const kn=a.useRef(),on=a.useCallback(k=>{const Y=Te.current;if(fe!==void 0&&k.preventDefault(),Y===null||Fe===void 0)return;const le=Bt(Y,k.clientX,k.clientY),[ce,_]=le.location,re=ce-(pe?0:1),[He,Ce]=kn.current??[];(He!==re||Ce!==_)&&(kn.current=[re,_],Fe([re,_],k.dataTransfer))},[pe,Bt,Fe,fe]);Wt("dragover",on,(V==null?void 0:V.current)??null,!1,!1);const H=a.useCallback(()=>{kn.current=void 0,ue==null||ue()},[ue]);Wt("dragend",H,(V==null?void 0:V.current)??null,!1,!1);const wt=a.useCallback(k=>{const Y=Te.current;if(Y===null||fe===void 0)return;k.preventDefault();const le=Bt(Y,k.clientX,k.clientY),[ce,_]=le.location,re=ce-(pe?0:1);fe([re,_],k.dataTransfer)},[pe,Bt,fe]);Wt("drop",wt,(V==null?void 0:V.current)??null,!1,!1);const eo=a.useCallback(()=>{Ye==null||Ye()},[Ye]);Wt("dragleave",eo,(V==null?void 0:V.current)??null,!1,!1);const wr=a.useRef(A);wr.current=A;const to=a.useRef(null),Oo=a.useCallback(k=>{var Y;Te.current===null||!Te.current.contains(document.activeElement)||(k===null&&wr.current.current!==void 0?(Y=oe==null?void 0:oe.current)==null||Y.focus({preventScroll:!0}):k!==null&&k.focus({preventScroll:!0}),to.current=k)},[oe]);a.useImperativeHandle(t,()=>({focus:()=>{var Y;const k=to.current;k===null||!document.contains(k)?(Y=oe==null?void 0:oe.current)==null||Y.focus({preventScroll:!0}):k.focus({preventScroll:!0})},getBounds:(k,Y)=>{if(!(oe===void 0||oe.current===null))return Ht(oe.current,k??0,Y??-1)},damage:cr}),[oe,cr,Ht]);const No=a.useRef(),Ti=ea(()=>{var Ce,ee,Je;if(n<50||(ke==null?void 0:ke.disableAccessibilityTree)===!0)return null;let k=yi(Rt,Ze,n,Ie,Ue);const Y=pe?0:-1;!pe&&((Ce=k[0])==null?void 0:Ce.sourceIndex)===0&&(k=k.slice(1));const[le,ce]=((ee=A.current)==null?void 0:ee.cell)??[],_=(Je=A.current)==null?void 0:Je.range,re=k.map(te=>te.sourceIndex),He=ao(s,Math.min(w,s+r));return le!==void 0&&ce!==void 0&&!(re.includes(le)&&He.includes(ce))&&Oo(null),a.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":w+1,"aria-multiselectable":"true","aria-colcount":Rt.length+Y},a.createElement("thead",{role:"rowgroup"},a.createElement("tr",{role:"row","aria-rowindex":1},k.map(te=>a.createElement("th",{role:"columnheader","aria-selected":A.columns.hasIndex(te.sourceIndex),"aria-colindex":te.sourceIndex+1+Y,tabIndex:-1,onFocus:Ee=>{if(Ee.target!==to.current)return De==null?void 0:De([te.sourceIndex,-1])},key:te.sourceIndex},te.title)))),a.createElement("tbody",{role:"rowgroup"},He.map(te=>a.createElement("tr",{role:"row","aria-selected":A.rows.hasIndex(te),key:te,"aria-rowindex":te+2},k.map(Ee=>{const Ne=Ee.sourceIndex,Ve=yn(Ne,te),Et=le===Ne&&ce===te,lt=_!==void 0&&Ne>=_.x&&Ne<_.x+_.width&&te>=_.y&&te<_.y+_.height,tt=`glide-cell-${Ne}-${te}`,rn=[Ne,te],ln=g(rn,!0);return a.createElement("td",{key:Ve,role:"gridcell","aria-colindex":Ne+1+Y,"aria-selected":lt,"aria-readonly":Io(ln)||!Jo(ln),id:tt,"data-testid":tt,onClick:()=>{const Pt=oe==null?void 0:oe.current;if(Pt!=null)return Z==null?void 0:Z({bounds:Ht(Pt,Ne,te),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:rn})},onFocusCapture:Pt=>{var rt,Kt;if(!(Pt.target===to.current||((rt=No.current)==null?void 0:rt[0])===Ne&&((Kt=No.current)==null?void 0:Kt[1])===te))return No.current=rn,De==null?void 0:De(rn)},ref:Et?Oo:void 0,tabIndex:-1},Hc(ln,et))})))))},[n,Rt,Ze,Ie,Ue,w,s,r,A,Oo,g,oe,Z,Ht,De],200),B=z===0||!$?0:Ze>z?1:cn(-Ue/100,0,1),Ot=-s*32+ut,xt=W?cn(-Ot/100,0,1):0,jr=a.useMemo(()=>{if(!B&&!xt)return null;const k={position:"absolute",top:0,left:Ft,width:n-Ft,height:o,opacity:B,pointerEvents:"none",transition:We?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},Y={position:"absolute",top:$t,left:0,width:n,height:o,opacity:xt,pointerEvents:"none",transition:de?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return a.createElement(a.Fragment,null,B>0&&a.createElement("div",{id:"shadow-x",style:k}),xt>0&&a.createElement("div",{id:"shadow-y",style:Y}))},[B,xt,Ft,n,We,$t,o,de]),Zr=a.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return a.createElement(a.Fragment,null,a.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:mr,onKeyUp:_r,onFocus:E,onBlur:X,ref:qr,style:Po},Ti),a.createElement("canvas",{ref:mt,style:Zr}),jr)},Ac=a.memo(a.forwardRef(Tc));function Zo(e,t,n,o){return cn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(o))}const zc=e=>{const[t,n]=a.useState(),[o,r]=a.useState(),[i,l]=a.useState(),[s,c]=a.useState(),[f,u]=a.useState(!1),[b,w]=a.useState(),[g,h]=a.useState(),[m,x]=a.useState(),[C,v]=a.useState(!1),[E,X]=a.useState(),{onHeaderMenuClick:N,onHeaderIndicatorClick:A,getCellContent:z,onColumnMoved:K,onColumnResize:S,onColumnResizeStart:$,onColumnResizeEnd:W,gridRef:D,maxColumnWidth:R,minColumnWidth:M,onRowMoved:ae,lockColumns:ne,onColumnProposeMove:ie,onMouseDown:Ie,onMouseUp:pe,onItemHovered:Z,onDragStart:U,canvasRef:me}=e,oe=(S??W??$)!==void 0,{columns:we,selection:ue}=e,V=ue.columns,xe=a.useCallback(q=>{const[Oe,De]=q.location;i!==void 0&&s!==Oe&&Oe>=ne?(u(!0),c(Oe)):g!==void 0&&De!==void 0?(v(!0),x(Math.max(0,De))):o===void 0&&!f&&!C&&(Z==null||Z(q))},[i,g,s,Z,ne,o,f,C]),ve=K!==void 0,_e=a.useCallback(q=>{var Oe;if(q.button===0){const[De,Fe]=q.location;if(q.kind==="out-of-bounds"&&q.isEdge&&oe){const fe=(Oe=D==null?void 0:D.current)==null?void 0:Oe.getBounds(we.length-1,-1);fe!==void 0&&(n(fe.x),r(we.length-1))}else if(q.kind==="header"&&De>=ne){const fe=me==null?void 0:me.current;if(q.isEdge&&oe&&fe){n(q.bounds.x),r(De);const Pe=fe.getBoundingClientRect().width/fe.offsetWidth,We=q.bounds.width/Pe;$==null||$(we[De],We,De,We+(we[De].growOffset??0))}else q.kind==="header"&&ve&&(w(q.bounds.x),l(De))}else q.kind==="cell"&&ne>0&&De===0&&Fe!==void 0&&ae!==void 0&&(X(q.bounds.y),h(Fe))}Ie==null||Ie(q)},[Ie,oe,ne,ae,D,we,ve,$,me]),nt=a.useCallback((q,Oe)=>{f||C||N==null||N(q,Oe)},[f,C,N]),bt=a.useCallback((q,Oe)=>{f||C||A==null||A(q,Oe)},[f,C,A]),ot=a.useRef(-1),Ae=a.useCallback(()=>{ot.current=-1,h(void 0),x(void 0),X(void 0),v(!1),l(void 0),c(void 0),w(void 0),u(!1),r(void 0),n(void 0)},[]),qe=a.useCallback((q,Oe)=>{if(q.button===0){if(o!==void 0){if((V==null?void 0:V.hasIndex(o))===!0)for(const Fe of V){if(Fe===o)continue;const fe=we[Fe],Ye=Zo(fe,ot.current,M,R);S==null||S(fe,Ye,Fe,Ye+(fe.growOffset??0))}const De=Zo(we[o],ot.current,M,R);if(W==null||W(we[o],De,o,De+(we[o].growOffset??0)),V.hasIndex(o))for(const Fe of V){if(Fe===o)continue;const fe=we[Fe],Ye=Zo(fe,ot.current,M,R);W==null||W(fe,Ye,Fe,Ye+(fe.growOffset??0))}}Ae(),i!==void 0&&s!==void 0&&(K==null||K(i,s)),g!==void 0&&m!==void 0&&(ae==null||ae(g,m))}pe==null||pe(q,Oe)},[pe,o,i,s,g,m,V,W,we,M,R,S,K,ae,Ae]),Re=a.useMemo(()=>{if(!(i===void 0||s===void 0)&&i!==s&&(ie==null?void 0:ie(i,s))!==!1)return{src:i,dest:s}},[i,s,ie]),yt=a.useCallback(q=>{const Oe=me==null?void 0:me.current;if(i!==void 0&&b!==void 0)Math.abs(q.clientX-b)>20&&u(!0);else if(g!==void 0&&E!==void 0)Math.abs(q.clientY-E)>20&&v(!0);else if(o!==void 0&&t!==void 0&&Oe){const Fe=Oe.getBoundingClientRect().width/Oe.offsetWidth,fe=(q.clientX-t)/Fe,Ye=we[o],Pe=Zo(Ye,fe,M,R);if(S==null||S(Ye,Pe,o,Pe+(Ye.growOffset??0)),ot.current=fe,(V==null?void 0:V.first())===o)for(const We of V){if(We===o)continue;const de=we[We],ke=Zo(de,ot.current,M,R);S==null||S(de,ke,We,ke+(de.growOffset??0))}}},[i,b,g,E,o,t,we,M,R,S,V,me]),dt=a.useCallback((q,Oe)=>{if(g===void 0||m===void 0)return z(q,Oe);let[De,Fe]=q;return Fe===m?Fe=g:(Fe>m&&(Fe-=1),Fe>=g&&(Fe+=1)),z([De,Fe],Oe)},[g,m,z]),je=a.useCallback(q=>{U==null||U(q),q.defaultPrevented()||Ae()},[Ae,U]);return a.createElement(Ac,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:o,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:dt,isResizing:o!==void 0,onHeaderMenuClick:nt,onHeaderIndicatorClick:bt,isDragging:f,onItemHovered:xe,onDragStart:je,onMouseDown:_e,allowResize:oe,onMouseUp:qe,dragAndDropState:Re,onMouseMoveRaw:yt,ref:D})},Bc=zc;function Lc(e){const t=a.useRef(null),[n,o]=a.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return a.useLayoutEffect(()=>{const r=l=>{for(const s of l){const{width:c,height:f}=s&&s.contentRect||{};o(u=>u.width===c&&u.height===f?u:{width:c,height:f})}},i=new window.ResizeObserver(r);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const Pc=(e,t,n)=>{const o=a.useRef(null),r=a.useRef(null),i=a.useRef(null),l=a.useRef(0),s=a.useRef(t);s.current=t;const c=n.current;a.useEffect(()=>{const f=()=>{var w,g;if(r.current===!1&&c!==null){const h=[c.scrollLeft,c.scrollTop];if(((w=i.current)==null?void 0:w[0])===h[0]&&((g=i.current)==null?void 0:g[1])===h[1])if(l.current>10){i.current=null,r.current=null;return}else l.current++;else l.current=0,s.current(h[0],h[1]),i.current=h;o.current=window.setTimeout(f,8.333333333333334)}},u=()=>{r.current=!0,i.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},b=w=>{w.touches.length===0&&(r.current=!1,l.current=0,o.current=window.setTimeout(f,8.333333333333334))};if(e&&c!==null){const w=c;return w.addEventListener("touchstart",u),w.addEventListener("touchend",b),()=>{w.removeEventListener("touchstart",u),w.removeEventListener("touchend",b),o.current!==null&&window.clearTimeout(o.current)}}},[e,c])},Wc=Pc,$c=()=>e=>e.isSafari?"scroll":"auto",Oc=Jt("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[$c()]}});function Nc(e){const[t,n]=a.useState(!1),o=typeof window>"u"?null:window,r=a.useRef(0);return Wt("touchstart",a.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),o,!0,!1),Wt("touchend",a.useCallback(i=>{i.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),o,!0,!1),t}const Xc=e=>{var oe,we;const{children:t,clientHeight:n,scrollHeight:o,scrollWidth:r,update:i,draggable:l,className:s,preventDiagonalScrolling:c=!1,paddingBottom:f=0,paddingRight:u=0,rightElement:b,rightElementProps:w,kineticScrollPerfHack:g=!1,scrollRef:h,initialSize:m}=e,x=[],C=(w==null?void 0:w.sticky)??!1,v=(w==null?void 0:w.fill)??!1,E=a.useRef(0),X=a.useRef(0),N=a.useRef(null),A=typeof window>"u"?1:window.devicePixelRatio,z=a.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),K=a.useRef(null),S=Nc(200),[$,W]=a.useState(!0),D=a.useRef(0);a.useLayoutEffect(()=>{if(!$||S||z.current.lockDirection===void 0)return;const ue=N.current;if(ue===null)return;const[V,xe]=z.current.lockDirection;V!==void 0?ue.scrollLeft=V:xe!==void 0&&(ue.scrollTop=xe),z.current.lockDirection=void 0},[S,$]);const R=a.useCallback((ue,V)=>{var je;const xe=N.current;if(xe===null)return;V=V??xe.scrollTop,ue=ue??xe.scrollLeft;const ve=z.current.scrollTop,_e=z.current.scrollLeft,nt=ue-_e,bt=V-ve;S&&nt!==0&&bt!==0&&(Math.abs(nt)>3||Math.abs(bt)>3)&&c&&z.current.lockDirection===void 0&&(z.current.lockDirection=Math.abs(nt)0&&(Math.abs(yt)>2e3||Re===0||Re===dt)&&o>xe.scrollHeight+5){const q=Re/dt,Oe=(o-qe)*q;E.current=Oe-Re}ot!==void 0&&(window.clearTimeout(D.current),W(!1),D.current=window.setTimeout(()=>W(!0),200)),i({x:ue,y:Re+E.current,width:Ae-u,height:qe-f,paddingRight:((je=K.current)==null?void 0:je.clientWidth)??0})},[f,u,o,i,c,S]);Wc(g&&Wr.value,R,N);const M=a.useRef(R);M.current=R;const ae=a.useRef(),ne=a.useRef(!1);a.useLayoutEffect(()=>{ne.current?R():ne.current=!0},[R,f,u]);const ie=a.useCallback(ue=>{N.current=ue,h!==void 0&&(h.current=ue)},[h]);let Ie=0,pe=0;for(x.push(a.createElement("div",{key:Ie++,style:{width:r,height:0}}));peM.current(),0),ae.current={width:U,height:me}),(U??0)===0||(me??0)===0?a.createElement("div",{ref:Z}):a.createElement("div",{ref:Z},a.createElement(Oc,{isSafari:Wr.value},a.createElement("div",{className:"dvn-underlay"},t),a.createElement("div",{ref:ie,style:ae.current,draggable:l,onDragStart:ue=>{l||(ue.stopPropagation(),ue.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>R()},a.createElement("div",{className:"dvn-scroll-inner"+(b===void 0?" dvn-hidden":"")},a.createElement("div",{className:"dvn-stack"},x),b!==void 0&&a.createElement(a.Fragment,null,!v&&a.createElement("div",{className:"dvn-spacer"}),a.createElement("div",{ref:K,style:{height:me,maxHeight:n-Math.ceil(A%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:C?u??0:void 0,pointerEvents:"auto"}},b))))))},Yc=e=>{const{columns:t,rows:n,rowHeight:o,headerHeight:r,groupHeaderHeight:i,enableGroups:l,freezeColumns:s,experimental:c,nonGrowWidth:f,clientSize:u,className:b,onVisibleRegionChanged:w,scrollRef:g,preventDiagonalScrolling:h,rightElement:m,rightElementProps:x,overscrollX:C,overscrollY:v,initialSize:E,smoothScrollX:X=!1,smoothScrollY:N=!1,isDraggable:A}=e,{paddingRight:z,paddingBottom:K}=c??{},[S,$]=u,W=a.useRef(),D=a.useRef(),R=a.useRef(),M=a.useRef(),ae=f+Math.max(0,C??0);let ne=l?r+i:r;if(typeof o=="number")ne+=n*o;else for(let Z=0;Z{var bt,ot;if(ie.current===void 0)return;const Z={...ie.current};let U=0,me=Z.x<0?-Z.x:0,oe=0,we=0;Z.x=Z.x<0?0:Z.x;let ue=0;for(let Ae=0;Ae=qe+Ae.width)U+=Ae.width,we++,oe++;else if(Z.x>qe)U+=Ae.width,X?me+=qe-Z.x:we++,oe++;else if(Z.x+Z.width>qe)U+=Ae.width,oe++;else break}let V=0,xe=0,ve=0;if(typeof o=="number")N?(xe=Math.floor(Z.y/o),V=xe*o-Z.y):xe=Math.ceil(Z.y/o),ve=Math.ceil(Z.height/o)+xe,V<0&&ve++;else{let Ae=0;for(let qe=0;qe=Ae+Re)Ae+=Re,xe++,ve++;else if(Z.y>yt)Ae+=Re,N?V+=yt-Z.y:xe++,ve++;else if(Z.y+Z.height>Re/2+Ae)Ae+=Re,ve++;else break}}const _e={x:we,y:xe,width:oe-we,height:ve-xe},nt=W.current;(nt===void 0||nt.y!==_e.y||nt.x!==_e.x||nt.height!==_e.height||nt.width!==_e.width||D.current!==me||R.current!==V||Z.width!==((bt=M.current)==null?void 0:bt[0])||Z.height!==((ot=M.current)==null?void 0:ot[1]))&&(w==null||w({x:we,y:xe,width:oe-we,height:ve-xe},Z.width,Z.height,Z.paddingRight??0,me,V),W.current=_e,D.current=me,R.current=V,M.current=[Z.width,Z.height])},[t,o,n,w,s,X,N]),pe=a.useCallback(Z=>{ie.current=Z,Ie()},[Ie]);return a.useEffect(()=>{Ie()},[Ie]),a.createElement(Xc,{scrollRef:g,className:b,kineticScrollPerfHack:c==null?void 0:c.kineticScrollPerfHack,preventDiagonalScrolling:h,draggable:A===!0||typeof A=="string",scrollWidth:ae+(z??0),scrollHeight:ne+(K??0),clientHeight:$,rightElement:m,paddingBottom:K,paddingRight:z,rightElementProps:x,update:pe,initialSize:E},a.createElement(Bc,{eventTargetRef:g,width:S,height:$,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},Gc=Yc,Kc=Jt("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),Uc=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Vc=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),_c=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),qc=10,jc=e=>{const{canvasRef:t,cellYOffset:n,rows:o,columns:r,searchInputRef:i,searchValue:l,searchResults:s,onSearchValueChange:c,getCellsForSelection:f,onSearchResultsChanged:u,showSearch:b=!1,onSearchClose:w}=e,[g]=a.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[h,m]=a.useState(""),x=l??h,C=a.useCallback(U=>{m(U),c==null||c(U)},[c]),[v,E]=a.useState(),X=a.useRef(v);X.current=v,a.useEffect(()=>{s!==void 0&&(s.length>0?E(U=>({rowsSearched:o,results:s.length,selectedIndex:(U==null?void 0:U.selectedIndex)??-1})):E(void 0))},[o,s]);const N=a.useRef();N.current===void 0&&(N.current=new AbortController);const A=a.useRef(),[z,K]=a.useState([]),S=s??z,$=a.useCallback(()=>{A.current!==void 0&&(window.cancelAnimationFrame(A.current),A.current=void 0,N.current.abort())},[]),W=a.useRef(n);W.current=n;const D=a.useCallback(U=>{const me=new RegExp(U.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let oe=W.current,we=Math.min(10,o),ue=0;E(void 0),K([]);const V=[],xe=async()=>{var dt;if(f===void 0)return;const ve=performance.now(),_e=o-ue;let nt=f({x:0,y:oe,width:r.length,height:Math.min(we,_e,o-oe)},N.current.signal);typeof nt=="function"&&(nt=await nt());let bt=!1;for(const[je,q]of nt.entries())for(const[Oe,De]of q.entries()){let Fe;switch(De.kind){case j.Text:case j.Number:Fe=De.displayData;break;case j.Uri:case j.Markdown:Fe=De.data;break;case j.Boolean:Fe=typeof De.data=="boolean"?De.data.toString():void 0;break;case j.Image:case j.Bubble:Fe=De.data.join("🐳");break;case j.Custom:Fe=De.copyData;break}Fe!==void 0&&me.test(Fe)&&(V.push([Oe,je+oe]),bt=!0)}const ot=performance.now();bt&&K([...V]),ue+=nt.length,jt(ue<=o);const Ae=((dt=X.current)==null?void 0:dt.selectedIndex)??-1;E({results:V.length,rowsSearched:ue,selectedIndex:Ae}),u==null||u(V,Ae),oe+we>=o?oe=0:oe+=we;const qe=ot-ve,Re=Math.max(qe,1),yt=qc/Re;we=Math.ceil(we*yt),ue{var U;w==null||w(),E(void 0),K([]),u==null||u([],-1),$(),(U=t==null?void 0:t.current)==null||U.focus()},[$,t,w,u]),M=a.useCallback(U=>{C(U.target.value),s===void 0&&(U.target.value===""?(E(void 0),K([]),$()):D(U.target.value))},[D,$,C,s]);a.useEffect(()=>{b&&i.current!==null&&(C(""),i.current.focus({preventScroll:!0}))},[b,i,C]);const ae=a.useCallback(U=>{var oe;if((oe=U==null?void 0:U.stopPropagation)==null||oe.call(U),v===void 0)return;const me=(v.selectedIndex+1)%v.results;E({...v,selectedIndex:me}),u==null||u(S,me)},[v,u,S]),ne=a.useCallback(U=>{var oe;if((oe=U==null?void 0:U.stopPropagation)==null||oe.call(U),v===void 0)return;let me=(v.selectedIndex-1)%v.results;me<0&&(me+=v.results),E({...v,selectedIndex:me}),u==null||u(S,me)},[u,S,v]),ie=a.useCallback(U=>{(U.ctrlKey||U.metaKey)&&U.nativeEvent.code==="KeyF"||U.key==="Escape"?(R(),U.stopPropagation(),U.preventDefault()):U.key==="Enter"&&(U.shiftKey?ne():ae())},[R,ae,ne]);a.useEffect(()=>()=>{$()},[$]);const[Ie,pe]=a.useState(!1);a.useEffect(()=>{if(b)pe(!0);else{const U=setTimeout(()=>pe(!1),150);return()=>clearTimeout(U)}},[b]);const Z=a.useMemo(()=>{if(!b&&!Ie)return null;let U;v!==void 0&&(U=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(U=`${v.selectedIndex+1} of ${U}`));const me=ue=>{ue.stopPropagation()},we={width:`${Math.floor(((v==null?void 0:v.rowsSearched)??0)/o*100)}%`};return a.createElement(Kc,{className:b?"":"out",onMouseDown:me,onMouseMove:me,onMouseUp:me,onClick:me},a.createElement("div",{className:"gdg-search-bar-inner"},a.createElement("input",{id:g,"aria-hidden":!b,"data-testid":"search-input",ref:i,onChange:M,value:x,tabIndex:b?void 0:-1,onKeyDownCapture:ie}),a.createElement("button",{"aria-label":"Previous Result","aria-hidden":!b,tabIndex:b?void 0:-1,onClick:ne,disabled:((v==null?void 0:v.results)??0)===0},Uc),a.createElement("button",{"aria-label":"Next Result","aria-hidden":!b,tabIndex:b?void 0:-1,onClick:ae,disabled:((v==null?void 0:v.results)??0)===0},Vc),w!==void 0&&a.createElement("button",{"aria-label":"Close Search","aria-hidden":!b,"data-testid":"search-close-button",tabIndex:b?void 0:-1,onClick:R},_c)),v!==void 0?a.createElement(a.Fragment,null,a.createElement("div",{className:"gdg-search-status"},a.createElement("div",{"data-testid":"search-result-area"},U)),a.createElement("div",{className:"gdg-search-progress",style:we})):a.createElement("div",{className:"gdg-search-status"},a.createElement("label",{htmlFor:g},"Type to search")))},[b,Ie,v,o,g,i,M,x,ie,ne,ae,w,R]);return a.createElement(a.Fragment,null,a.createElement(Gc,{prelightCells:S,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Z)},Zc=jc;class Jc extends a.PureComponent{constructor(){super(...arguments);Xe(this,"wrapperRef",a.createRef());Xe(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let o=n.target;for(;o!==null;){if(o.classList.contains("click-outside-ignore"))return;o=o.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:o,...r}=this.props;return a.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const Qc=()=>e=>Math.max(16,e.targetHeight-10),ed=Jt("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[Qc(),"px"]}}),td=e=>{const{bounds:t,group:n,onClose:o,canvasBounds:r,onFinish:i}=e,[l,s]=pt.useState(n);return pt.createElement(Jc,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:o},pt.createElement(ed,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:o,onFocus:c=>c.target.setSelectionRange(0,l.length),onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"?i(l):c.key==="Escape"&&o()},autoFocus:!0}))};function nd(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Be(e,t,n){const o=os(e,t);return o&&(n.didMatch=!0),o}function os(e,t){if(e.length===0)return!1;if(e.includes("|")){const c=e.split("|");for(const f of c)if(os(f,t))return!0;return!1}let n=!1,o=!1,r=!1,i=!1;const l=e.split("+"),s=l.pop();if(!nd(s,t))return!1;if(l[0]==="any")return!0;for(const c of l)switch(c){case"ctrl":n=!0;break;case"shift":o=!0;break;case"alt":r=!0;break;case"meta":i=!0;break;case"primary":$r.value?i=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===o&&t.metaKey===i}function od(e,t,n,o,r,i,l){const s=pt.useCallback((u,b,w,g)=>{var E;(i==="cell"||i==="multi-cell")&&u!==void 0&&(u={...u,range:{x:u.cell[0],y:u.cell[1],width:1,height:1}}),!l&&u!==void 0&&u.range.width>1&&(u={...u,range:{...u.range,width:1,x:u.cell[0]}});const h=n==="mixed"&&(w||g==="drag"),m=o==="mixed"&&h,x=r==="mixed"&&h;let C={current:u===void 0?void 0:{...u,rangeStack:g==="drag"?((E=e.current)==null?void 0:E.rangeStack)??[]:[]},columns:m?e.columns:it.empty(),rows:x?e.rows:it.empty()};w&&(i==="multi-rect"||i==="multi-cell")&&C.current!==void 0&&e.current!==void 0&&(C={...C,current:{...C.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(C,b)},[o,e,n,i,l,r,t]),c=pt.useCallback((u,b,w)=>{u=u??e.rows,b!==void 0&&(u=u.add(b));let g;if(r==="exclusive"&&u.length>0)g={current:void 0,columns:it.empty(),rows:u};else{const h=w&&n==="mixed",m=w&&o==="mixed";g={current:h?e.current:void 0,columns:m?e.columns:it.empty(),rows:u}}t(g,!1)},[o,e,n,r,t]),f=pt.useCallback((u,b,w)=>{u=u??e.columns,b!==void 0&&(u=u.add(b));let g;if(o==="exclusive"&&u.length>0)g={current:void 0,rows:it.empty(),columns:u};else{const h=w&&n==="mixed",m=w&&r==="mixed";g={current:h?e.current:void 0,rows:m?e.rows:it.empty(),columns:u}}t(g,!1)},[o,e,n,r,t]);return[s,c,f]}function rd(e,t,n,o,r){const i=a.useCallback(f=>{if(e===!0){const u=[];for(let b=f.y;b=r?w.push({kind:j.Loading,allowOverlay:!1}):w.push(t([g,b]));u.push(w)}return u}return(e==null?void 0:e(f,o.signal))??[]},[o.signal,t,e,r]),l=e!==void 0?i:void 0,s=a.useCallback(f=>{if(l===void 0)return[];const u={...f,x:f.x-n};if(u.x<0){u.x=0,u.width--;const b=l(u,o.signal);return typeof b=="function"?async()=>(await b()).map(w=>[{kind:j.Loading,allowOverlay:!1},...w]):b.map(w=>[{kind:j.Loading,allowOverlay:!1},...w])}return l(u,o.signal)},[o.signal,l,n]);return[e!==void 0?s:void 0,l]}function id(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case j.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===xi?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case j.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case j.Image:case j.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case j.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case j.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case j.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case j.Markdown:case j.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case j.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case j.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case j.Protected:return{formatted:"************",rawValue:"",format:"string"};default:nr()}}function ld(e,t){return e.map((o,r)=>{const i=t[r];return o.map(l=>l.span!==void 0&&l.span[0]!==i?{formatted:"",rawValue:"",format:"string"}:id(l))})}function ml(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function sd(e){var n;const t=[];for(const o of e){const r=[];for(const i of o)i.format==="url"?r.push(((n=i.rawValue)==null?void 0:n.toString())??""):i.format==="string-array"?r.push(i.formatted.map(l=>ml(l,!0)).join(",")):r.push(ml(i.formatted,!1));t.push(r.join(" "))}return t.join(` +`)}function hi(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function wl(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function ad(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function cd(e){var n;const t=[];t.push('',"");for(const o of e){t.push("");for(const r of o){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(``):r.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${hi(r.formatted)}
    ${r.formatted.map((l,s)=>`
  1. `+hi(l)+"
  2. ").join("")}
${hi(r.formatted)}
"),t.join("")}function dd(e,t){const n=ld(e,t),o=sd(n),r=cd(n);return{textPlain:o,textHtml:r}}function bl(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const o=[n],r=[];let i;for(;o.length>0;){const s=o.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")o.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)i!==void 0&&r.push(i),i=[],o.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const c=s.cloneNode(!0),u=c.children.length===1&&c.children[0].nodeName==="P"?c.children[0]:null,b=(u==null?void 0:u.children.length)===1&&u.children[0].nodeName==="FONT",w=c.querySelectorAll("br");for(const m of w)m.replaceWith(` +`);const g=c.getAttribute("gdg-raw-value"),h=c.getAttribute("gdg-format")??"string";if(c.querySelector("a")!==null)i==null||i.push({rawValue:((l=c.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:c.textContent??"",format:h});else if(c.querySelector("ol")!==null){const m=c.querySelectorAll("li");i==null||i.push({rawValue:[...m].map(x=>x.getAttribute("gdg-raw-value")??""),formatted:[...m].map(x=>x.textContent??""),format:"string-array"})}else if(g!==null)i==null||i.push({rawValue:ad(g),formatted:c.textContent??"",format:h});else{let m=c.textContent??"";b&&(m=m.replace(/\n(?!\n)/g,"")),i==null||i.push({rawValue:m??"",formatted:m??"",format:h})}}}return i!==void 0&&r.push(i),r}function ud(e,t,n,o,r){var s;const i=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const c=(s=e.current)==null?void 0:s.range,f=[];if(c.width>2){const w=t({x:c.x,y:c.y,width:1,height:c.height},r.signal);if(typeof w=="function")return i;f.push(...w);const g=t({x:c.x+c.width-1,y:c.y,width:1,height:c.height},r.signal);if(typeof g=="function")return i;f.push(...g)}else{const w=t({x:c.x,y:c.y,width:c.width,height:c.height},r.signal);if(typeof w=="function")return i;f.push(...w)}let u=c.x-n,b=c.x+c.width-1-n;for(const w of f)for(const g of w)g.span!==void 0&&(u=Math.min(g.span[0],u),b=Math.max(g.span[1],b));u===c.x-n&&b===c.x+c.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:c.y,width:b-u+1,height:c.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function yl(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function fd(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let o=[],r=0,i=t.None;e=e.replace(/\r\n/g,` +`);let l=0;for(const s of e){switch(i){case t.None:s===" "||s===` +`?(o.push(e.slice(r,l)),r=l+1,s===` +`&&(n.push(o),o=[])):s==='"'&&(i=t.inString);break;case t.inString:s==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?i=t.inString:((s===" "||s===` +`)&&(o.push(yl(e.slice(r,l))),r=l+1,s===` +`&&(n.push(o),o=[])),i=t.None);break}l++}return rs.map(c=>({rawValue:c,formatted:c,format:"string"})))}function pl(e,t,n){var s;const o=dd(e,t),r=c=>{var f;(f=window.navigator.clipboard)==null||f.writeText(c)},i=(c,f)=>{var u;return((u=window.navigator.clipboard)==null?void 0:u.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([c],{type:"text/plain"}),"text/html":new Blob([f],{type:"text/html"})})]),!0)},l=(c,f)=>{var u,b;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(u=n==null?void 0:n.clipboardData)==null||u.setData("text/plain",c),(b=n==null?void 0:n.clipboardData)==null||b.setData("text/html",f)}catch{i(c,f)||r(c)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(o.textPlain,o.textHtml):r(o.textPlain),n==null||n.preventDefault()}function rs(e){return e!==!0}function vl(e){return typeof e=="string"?e:`${e}px`}const hd=()=>e=>e.innerWidth,gd=()=>e=>e.innerHeight,md=Jt("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[hd()],"wmyidgi-1":[gd()]}}),wd=e=>{const{inWidth:t,inHeight:n,children:o,...r}=e;return a.createElement(md,{innerHeight:vl(n),innerWidth:vl(t),...r},o)},bd=2,yd=1300;function pd(e,t,n){const o=pt.useRef(0),[r,i]=e??[0,0];pt.useEffect(()=>{if(r===0&&i===0){o.current=0;return}let l=!1,s=0;const c=f=>{var u;if(!l){if(s===0)s=f;else{const b=f-s;o.current=Math.min(1,o.current+b/yd);const w=o.current**1.618*b*bd;(u=t.current)==null||u.scrollBy(r*w,i*w),s=f,n==null||n()}window.requestAnimationFrame(c)}};return window.requestAnimationFrame(c),()=>{l=!0}},[t,r,i,n])}function vd({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:o,overscrollX:r,overscrollY:i,scaleToRem:l,remSize:s}){const[c,f,u,b,w,g]=pt.useMemo(()=>{if(!l||s===16)return[e,t,n,o,r,i];const h=s/16,m=e,x=Yl();return[typeof m=="number"?m*h:C=>Math.ceil(m(C)*h),Math.ceil(t*h),Math.ceil(n*h),{...o,headerIconSize:((o==null?void 0:o.headerIconSize)??x.headerIconSize)*h,cellHorizontalPadding:((o==null?void 0:o.cellHorizontalPadding)??x.cellHorizontalPadding)*h,cellVerticalPadding:((o==null?void 0:o.cellVerticalPadding)??x.cellVerticalPadding)*h},Math.ceil((r??0)*h),Math.ceil((i??0)*h)]},[n,t,r,i,s,e,l,o]);return{rowHeight:c,headerHeight:f,groupHeaderHeight:u,theme:b,overscrollX:w,overscrollY:g}}const Vn={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function Le(e,t){return e===!0?t:e===!1?"":e}function Cl(e){const t=$r.value;return{activateCell:Le(e.activateCell," |Enter|shift+Enter"),clear:Le(e.clear,"any+Escape"),closeOverlay:Le(e.closeOverlay,"any+Escape"),acceptOverlayDown:Le(e.acceptOverlayDown,"Enter"),acceptOverlayUp:Le(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:Le(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:Le(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:Le(e.delete,t?"Backspace|Delete":"Delete"),downFill:Le(e.downFill,"primary+_68"),scrollToSelectedCell:Le(e.scrollToSelectedCell,"primary+Enter"),goDownCell:Le(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:Le(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:Le(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:Le(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:Le(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:Le(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:Le(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:Le(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:Le(e.goToFirstCell,"primary+Home"),goToFirstColumn:Le(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:Le(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:Le(e.goToLastCell,"primary+End"),goToLastColumn:Le(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:Le(e.goToLastRow,"primary+ArrowDown"),goToNextPage:Le(e.goToNextPage,"PageDown"),goToPreviousPage:Le(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:Le(e.rightFill,"primary+_82"),search:Le(e.search,"primary+f"),selectAll:Le(e.selectAll,"primary+a"),selectColumn:Le(e.selectColumn,"ctrl+ "),selectGrowDown:Le(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:Le(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:Le(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:Le(e.selectGrowUp,"shift+ArrowUp"),selectRow:Le(e.selectRow,"shift+ "),selectToFirstCell:Le(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:Le(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:Le(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:Le(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:Le(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:Le(e.selectToLastRow,"primary+shift+ArrowDown")}}function Cd(e){const t=ia(e);return pt.useMemo(()=>{if(t===void 0)return Cl(Vn);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Vn.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Vn.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Vn.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Vn.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Vn.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Vn.selectToLastCell};return Cl({...Vn,...n})},[t])}function xd(e){function t(o,r,i){if(typeof o=="number")return{headerIndex:o,isCollapsed:!1,depth:r,path:i};const l={headerIndex:o.headerIndex,isCollapsed:o.isCollapsed,depth:r,path:i};return o.subGroups!==void 0&&(l.subGroups=o.subGroups.map((s,c)=>t(s,r+1,[...i,c])).sort((s,c)=>s.headerIndex-c.headerIndex)),l}return e.map((o,r)=>t(o,0,[r])).sort((o,r)=>o.headerIndex-r.headerIndex)}function Hi(e,t){const n=[];function o(l,s,c=!1){let f=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(f=l.subGroups[0].headerIndex-l.headerIndex),f--,n.push({headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:f}),l.subGroups)for(let u=0;ul.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Nr(e,t){if(t===void 0||Hi.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const o of t){if(n===0)return{path:[...o.path,-1],originalIndex:o.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:o.rows};if(n--,!o.isCollapsed){if(ne===void 0?void 0:Hi(e,t),[e,t]),i=pt.useMemo(()=>r===void 0?t:r.reduce((f,u)=>f+(u.isCollapsed?1:u.rows+1),0),[r,t]),l=pt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:f=>{const{isGroupHeader:u}=Nr(f,r);return u?e.height:typeof n=="number"?n:n(f)},[r,e,n]),s=pt.useCallback(f=>{if(r===void 0)return f;let u=f;for(const b of r){if(u===0)return;if(u--,!b.isCollapsed){if(u{if(e===void 0)return o==null?void 0:o(f,f,f);if(o===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:b,groupIndex:w}=Nr(f,r);return u?e.themeOverride:o==null?void 0:o(f,w,b)},[r,o,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:i,rowNumberMapper:s,getRowThemeOverride:c}}function Sd(e,t){const n=pt.useMemo(()=>e===void 0?void 0:Hi(e,t),[e,t]);return{getRowGroupingForPath:ls,updateRowGroupingByPath:is,mapper:pt.useCallback(o=>{if(typeof o=="number")return Nr(o,n);const r=Nr(o[1],n);return{...r,originalIndex:[o[0],r.originalIndex]}},[n])}}function is(e,t,n){const[o,...r]=t;return r[0]===-1?e.map((i,l)=>l===o?{...i,...n}:i):e.map((i,l)=>l===o?{...i,subGroups:is(i.subGroups??[],r,n)}:i)}function ls(e,t){const[n,...o]=t;return o[0]===-1?e[n]:ls(e[n].subGroups??[],o)}function Md(e,t){const[n]=a.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(o){const r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}));return n.callback=t,n.facade}function Rd(e,t,n,o,r){const[i,l]=a.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=a.useMemo(()=>({x:o.current.x,y:i,width:o.current.width??1,height:o.current.height??1,ty:l}),[o,l,i]),[c,f,u]=ra(s),b=a.useRef(r);b.current=r;const w=Md(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),g=(c.height??1)>1;a.useLayoutEffect(()=>{if(t!==void 0&&w.current!==null&&g){if(w.current.scrollTop===t)return;w.current.scrollTop=t,w.current.scrollTop!==t&&u(),b.current()}},[t,g,u,w]);const h=(c.width??1)>1;return a.useLayoutEffect(()=>{if(e!==void 0&&w.current!==null&&h){if(w.current.scrollLeft===e)return;w.current.scrollLeft=e,w.current.scrollLeft!==e&&u(),b.current()}},[e,h,u,w]),{visibleRegion:c,setVisibleRegion:f,scrollRef:w}}const Ed=a.lazy(async()=>await Ml(()=>import("./data-grid-overlay-editor-xe3yVD_U.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));let Id=0;function Dd(e){return Us(ji(ji(e).filter(t=>t.span!==void 0).map(t=>{var n,o;return ao((((n=t.span)==null?void 0:n[0])??0)+1,(((o=t.span)==null?void 0:o[1])??0)+1)})))}function Tr(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Ar={kind:j.Loading,allowOverlay:!1},zr={columns:it.empty(),rows:it.empty(),current:void 0},Fd=(e,t)=>{var Vi,_i,qi;const[n,o]=a.useState(zr),[r,i]=a.useState(),l=a.useRef(null),s=a.useRef(null),[c,f]=a.useState(),u=a.useRef(),b=typeof window>"u"?null:window,{imageEditorOverride:w,getRowThemeOverride:g,markdownDivCreateNode:h,width:m,height:x,columns:C,rows:v,getCellContent:E,onCellClicked:X,onCellActivated:N,onFillPattern:A,onFinishedEditing:z,coercePasteValue:K,drawHeader:S,drawCell:$,editorBloom:W,onHeaderClicked:D,onColumnProposeMove:R,rangeSelectionColumnSpanning:M=!0,spanRangeBehavior:ae="default",onGroupHeaderClicked:ne,onCellContextMenu:ie,className:Ie,onHeaderContextMenu:pe,getCellsForSelection:Z,onGroupHeaderContextMenu:U,onGroupHeaderRenamed:me,onCellEdited:oe,onCellsEdited:we,onSearchResultsChanged:ue,searchResults:V,onSearchValueChange:xe,searchValue:ve,onKeyDown:_e,onKeyUp:nt,keybindings:bt,editOnType:ot=!0,onRowAppended:Ae,onColumnMoved:qe,validateCell:Re,highlightRegions:yt,rangeSelect:dt="rect",columnSelect:je="multi",rowSelect:q="multi",rangeSelectionBlending:Oe="exclusive",columnSelectionBlending:De="exclusive",rowSelectionBlending:Fe="exclusive",onDelete:fe,onDragStart:Ye,onMouseMove:Pe,onPaste:We,copyHeaders:de=!1,freezeColumns:ke=0,cellActivationBehavior:et="second-click",rowSelectionMode:Ge="auto",onHeaderMenuClick:Ue,onHeaderIndicatorClick:ut,getGroupDetails:Ze,rowGrouping:Te,onSearchClose:kt,onItemHovered:zt,onSelectionCleared:vt,showSearch:St,onVisibleRegionChanged:Lt,gridSelection:gt,onGridSelectionChange:pn,minColumnWidth:Pn=50,maxColumnWidth:st=500,maxColumnAutoWidth:Dn,provideEditor:fn,trailingRowOptions:ye,freezeTrailingRows:mt=0,allowedFillDirections:vn="orthogonal",scrollOffsetX:Qt,scrollOffsetY:en,verticalBorder:ze,onDragOverCell:Mt,onDrop:ft,onColumnResize:$t,onColumnResizeEnd:Tt,onColumnResizeStart:Yt,customRenderers:Wn,fillHandle:Rt,experimental:Ft,fixedShadowX:Ht,fixedShadowY:Bt,headerIcons:Fn,imageWindowLoader:lr,initialSize:$n,isDraggable:Hn,onDragLeave:Tn,onRowMoved:Cn,overscrollX:sr,overscrollY:ar,preventDiagonalScrolling:ho,rightElement:go,rightElementProps:mo,trapFocus:Zn=!1,smoothScrollX:Jn,smoothScrollY:On,scaleToRem:Gr=!1,rowHeight:cr=34,headerHeight:dr=36,groupHeaderHeight:Kr=dr,theme:wo,isOutsideClick:Nn,renderers:zo,resizeIndicator:Ur,scrollToActiveCell:Bo=!0,drawFocusRing:Lo=!0}=e,Qn=Lo==="no-editor"?r===void 0:Lo,Ct=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Gt=(Ct==null?void 0:Ct.kind)??e.rowMarkers??"none",Po=(Ct==null?void 0:Ct.width)??e.rowMarkerWidth,Wo=(Ct==null?void 0:Ct.startIndex)??e.rowMarkerStartIndex??1,bo=(Ct==null?void 0:Ct.theme)??e.rowMarkerTheme,An=Ct==null?void 0:Ct.headerTheme,zn=Ct==null?void 0:Ct.headerAlwaysVisible,Xn=(Ct==null?void 0:Ct.checkboxStyle)??"square",tn=Math.max(Pn,20),Yn=Math.max(st,tn),ur=Math.max(Dn??Yn,tn),$o=a.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Se,rowNumberMapper:fr,rowHeight:Vr,getRowThemeOverride:nn}=kd(Te,v,cr,g),hr=a.useMemo(()=>Number.parseFloat($o.fontSize),[$o]),{rowHeight:hn,headerHeight:yo,groupHeaderHeight:gr,theme:mr,overscrollX:_r,overscrollY:qr}=vd({groupHeaderHeight:Kr,headerHeight:dr,overscrollX:sr,overscrollY:ar,remSize:hr,rowHeight:Vr,scaleToRem:Gr,theme:wo}),xn=Cd(bt),kn=Po??(v>1e4?48:v>1e3?44:v>100?36:32),on=Gt!=="none",H=on?1:0,wt=Ae!==void 0,eo=(ye==null?void 0:ye.sticky)===!0,[wr,to]=a.useState(!1),Oo=St??wr,No=a.useCallback(()=>{kt!==void 0?kt():to(!1)},[kt]),B=a.useMemo(()=>gt===void 0?void 0:Tr(gt,H),[gt,H])??n,Ot=a.useRef();Ot.current===void 0&&(Ot.current=new AbortController),a.useEffect(()=>()=>Ot==null?void 0:Ot.current.abort(),[]);const[xt,jr]=rd(Z,E,H,Ot.current,Se),Zr=a.useCallback((d,p,y)=>{if(Re===void 0)return!0;const F=[d[0]-H,d[1]];return Re==null?void 0:Re(F,p,y)},[H,Re]),k=a.useRef(gt),Y=a.useCallback((d,p)=>{p&&(d=ud(d,xt,H,ae,Ot.current)),pn!==void 0?(k.current=Tr(d,-H),pn(k.current)):o(d)},[pn,xt,H,ae]),le=so($t,a.useCallback((d,p,y,F)=>{$t==null||$t(C[y-H],p,y-H,F)},[$t,H,C])),ce=so(Tt,a.useCallback((d,p,y,F)=>{Tt==null||Tt(C[y-H],p,y-H,F)},[Tt,H,C])),_=so(Yt,a.useCallback((d,p,y,F)=>{Yt==null||Yt(C[y-H],p,y-H,F)},[Yt,H,C])),re=so(S,a.useCallback((d,p)=>(S==null?void 0:S({...d,columnIndex:d.columnIndex-H},p))??!1,[S,H])),He=so($,a.useCallback((d,p)=>($==null?void 0:$({...d,col:d.col-H},p))??!1,[$,H])),Ce=a.useCallback(d=>{if(fe!==void 0){const p=fe(Tr(d,-H));return typeof p=="boolean"?p:Tr(p,H)}return!0},[fe,H]),[ee,Je,te]=od(B,Y,Oe,De,Fe,dt,M),Ee=a.useMemo(()=>Ln(Yl(),mr),[mr]),[Ne,Ve]=a.useState([0,0,0]),Et=a.useMemo(()=>{if(zo===void 0)return{};const d={};for(const p of zo)d[p.kind]=p;return d},[zo]),lt=a.useCallback(d=>d.kind!==j.Custom?Et[d.kind]:Wn==null?void 0:Wn.find(p=>p.isMatch(d)),[Wn,Et]);let{sizedColumns:tt,nonGrowWidth:rn}=Fa(C,Se,jr,Ne[0]-(H===0?0:kn)-Ne[2],tn,ur,Ee,lt,Ot.current);Gt!=="none"&&(rn+=kn);const ln=a.useMemo(()=>tt.some(d=>d.group!==void 0),[tt]),Pt=ln?yo+gr:yo,rt=B.rows.length,Kt=Gt==="none"?void 0:rt===0?!1:rt===Se?!0:void 0,$e=a.useMemo(()=>Gt==="none"?tt:[{title:"",width:kn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:bo,rowMarker:Xn,rowMarkerChecked:Kt,headerRowMarkerTheme:An,headerRowMarkerAlwaysVisible:zn},...tt],[Gt,tt,kn,bo,Xn,Kt,An,zn]),At=a.useRef({height:1,width:1,x:0,y:0}),Vt=a.useRef(!1),{setVisibleRegion:po,visibleRegion:_t,scrollRef:at}=Rd(Qt,en,hn,At,()=>Vt.current=!0);At.current=_t;const as=_t.x+H,br=_t.y,Ut=a.useRef(null),Xt=a.useCallback(d=>{var p;d===!0?(p=Ut.current)==null||p.focus():window.requestAnimationFrame(()=>{var y;(y=Ut.current)==null||y.focus()})},[]),Nt=wt?Se+1:Se,sn=a.useCallback(d=>{const p=H===0?d:d.map(F=>({...F,location:[F.location[0]-H,F.location[1]]})),y=we==null?void 0:we(p);if(y!==!0)for(const F of p)oe==null||oe(F.location,F.value);return y},[oe,we,H]),[no,Jr]=a.useState(),yr=B.current!==void 0&&B.current.range.width*B.current.range.height>1?B.current.range:void 0,vo=Qn?(Vi=B.current)==null?void 0:Vi.cell:void 0,pr=vo==null?void 0:vo[0],vr=vo==null?void 0:vo[1],cs=a.useMemo(()=>{if((yt===void 0||yt.length===0)&&(yr??pr??vr??no)===void 0)return;const d=[];if(yt!==void 0)for(const p of yt){const y=$e.length-p.range.x-H;y>0&&d.push({color:p.color,range:{...p.range,x:p.range.x+H,width:Math.min(y,p.range.width)},style:p.style})}return no!==void 0&&d.push({color:uo(Ee.accentColor,0),range:no,style:"dashed"}),yr!==void 0&&d.push({color:uo(Ee.accentColor,.5),range:yr,style:"solid-outline"}),pr!==void 0&&vr!==void 0&&d.push({color:Ee.accentColor,range:{x:pr,y:vr,width:1,height:1},style:"solid-outline"}),d.length>0?d:void 0},[no,yr,pr,vr,yt,$e.length,Ee.accentColor,H]),Ai=a.useRef($e);Ai.current=$e;const qt=a.useCallback(([d,p],y=!1)=>{var P,T,L,O,G,J,he;const F=wt&&p===Nt-1;if(d===0&&on){if(F)return Ar;const Q=fr(p);return Q===void 0?Ar:{kind:un.Marker,allowOverlay:!1,checkboxStyle:Xn,checked:(B==null?void 0:B.rows.hasIndex(p))===!0,markerKind:Gt==="clickable-number"?"number":Gt,row:Wo+Q,drawHandle:Cn!==void 0,cursor:Gt==="clickable-number"?"pointer":void 0}}else if(F){const be=d===H?(ye==null?void 0:ye.hint)??"":"",se=Ai.current[d];if(((P=se==null?void 0:se.trailingRowOptions)==null?void 0:P.disabled)===!0)return Ar;{const Ke=((T=se==null?void 0:se.trailingRowOptions)==null?void 0:T.hint)??be,Me=((L=se==null?void 0:se.trailingRowOptions)==null?void 0:L.addIcon)??(ye==null?void 0:ye.addIcon);return{kind:un.NewRow,hint:Ke,allowOverlay:!1,icon:Me}}}else{const Q=d-H;if(y||(Ft==null?void 0:Ft.strict)===!0){const se=At.current,Ke=se.x>Q||Q>se.x+se.width||se.y>p||p>se.y+se.height||p>=ei.current,Me=Q===((G=(O=se.extras)==null?void 0:O.selected)==null?void 0:G[0])&&p===((J=se.extras)==null?void 0:J.selected[1]);let ge=!1;if(((he=se.extras)==null?void 0:he.freezeRegions)!==void 0){for(const Qe of se.extras.freezeRegions)if(co(Qe,Q,p)){ge=!0;break}}if(Ke&&!Me&&!ge)return Ar}let be=E([Q,p]);return H!==0&&be.span!==void 0&&(be={...be,span:[be.span[0]+H,be.span[1]+H]}),be}},[wt,Nt,on,fr,Xn,B==null?void 0:B.rows,Gt,Wo,Cn,H,ye==null?void 0:ye.hint,ye==null?void 0:ye.addIcon,Ft==null?void 0:Ft.strict,E]),Qr=a.useCallback(d=>{let p=(Ze==null?void 0:Ze(d))??{name:d};return me!==void 0&&d!==""&&(p={icon:p.icon,name:p.name,overrideTheme:p.overrideTheme,actions:[...p.actions??[],{title:"Rename",icon:"renameIcon",onClick:y=>ni({group:p.name,bounds:y.bounds})}]}),p},[Ze,me]),Cr=a.useCallback(d=>{var L;const[p,y]=d.cell,F=$e[p],I=(F==null?void 0:F.group)!==void 0?(L=Qr(F.group))==null?void 0:L.overrideTheme:void 0,P=F==null?void 0:F.themeOverride,T=nn==null?void 0:nn(y);i({...d,theme:Ln(Ee,I,P,T,d.content.themeOverride)})},[nn,$e,Qr,Ee]),Co=a.useCallback((d,p,y)=>{var T;if(B.current===void 0)return;const[F,I]=B.current.cell,P=qt([F,I]);if(P.kind!==j.Boolean&&P.allowOverlay){let L=P;if(y!==void 0)switch(L.kind){case j.Number:{const O=_s(()=>y==="-"?-0:Number.parseFloat(y),0);L={...L,data:Number.isNaN(O)?0:O};break}case j.Text:case j.Markdown:case j.Uri:L={...L,data:y};break}Cr({target:d,content:L,initialValue:y,cell:[F,I],highlight:y===void 0,forceEditMode:y!==void 0})}else P.kind===j.Boolean&&p&&P.readonly!==!0&&(sn([{location:B.current.cell,value:{...P,data:rs(P.data)}}]),(T=Ut.current)==null||T.damage([{cell:B.current.cell}]))},[qt,B,sn,Cr]),zi=a.useCallback((d,p)=>{var I;const y=(I=Ut.current)==null?void 0:I.getBounds(d,p);if(y===void 0||at.current===null)return;const F=qt([d,p]);F.allowOverlay&&Cr({target:y,content:F,initialValue:void 0,highlight:!0,cell:[d,p],forceEditMode:!0})},[qt,at,Cr]),It=a.useCallback((d,p,y="both",F=0,I=0,P=void 0)=>{if(at.current!==null){const T=Ut.current,L=s.current,O=typeof d!="number"?d.unit==="cell"?d.amount:void 0:d,G=typeof p!="number"?p.unit==="cell"?p.amount:void 0:p,J=typeof d!="number"&&d.unit==="px"?d.amount:void 0,he=typeof p!="number"&&p.unit==="px"?p.amount:void 0;if(T!==null&&L!==null){let Q={x:0,y:0,width:0,height:0},be=0,se=0;if((O!==void 0||G!==void 0)&&(Q=T.getBounds((O??0)+H,G??0)??Q,Q.width===0||Q.height===0))return;const Ke=L.getBoundingClientRect(),Me=Ke.width/L.offsetWidth;if(J!==void 0&&(Q={...Q,x:J-Ke.left-at.current.scrollLeft,width:1}),he!==void 0&&(Q={...Q,y:he+Ke.top-at.current.scrollTop,height:1}),Q!==void 0){const ge={x:Q.x-F,y:Q.y-I,width:Q.width+2*F,height:Q.height+2*I};let Qe=0;for(let ci=0;ci0&&(ht=fo(Nt,Dt,hn));let wn=Qe*Me+Ke.left+H*kn*Me,Mn=Ke.right,bn=Ke.top+Pt*Me,Rn=Ke.bottom-ht*Me;const Ir=Q.width+F*2;switch(P==null?void 0:P.hAlign){case"start":Mn=wn+Ir;break;case"end":wn=Mn-Ir;break;case"center":wn=Math.floor((wn+Mn)/2)-Ir/2,Mn=wn+Ir;break}const Dr=Q.height+I*2;switch(P==null?void 0:P.vAlign){case"start":Rn=bn+Dr;break;case"end":bn=Rn-Dr;break;case"center":bn=Math.floor((bn+Rn)/2)-Dr/2,Rn=bn+Dr;break}wn>ge.x?be=ge.x-wn:Mnge.y?se=ge.y-bn:Rn=Nt-Dt)&&(se=0),(be!==0||se!==0)&&(Me!==1&&(be/=Me,se/=Me),at.current.scrollTo(be+at.current.scrollLeft,se+at.current.scrollTop))}}}},[H,mt,kn,at,Pt,ke,tt,Nt,eo,hn]),Bi=a.useRef(zi),Li=a.useRef(E),ei=a.useRef(Se);Bi.current=zi,Li.current=E,ei.current=Se;const xo=a.useCallback(async(d,p=!0)=>{var O;const y=$e[d];if(((O=y==null?void 0:y.trailingRowOptions)==null?void 0:O.disabled)===!0)return;const F=Ae==null?void 0:Ae();let I,P=!0;F!==void 0&&(I=await F,I==="top"&&(P=!1),typeof I=="number"&&(P=!1));let T=0;const L=()=>{if(ei.current<=Se){T<500&&window.setTimeout(L,T),T=50+T*2;return}const G=typeof I=="number"?I:P?Se:0;Er.current(d-H,G),ee({cell:[d,G],range:{x:d,y:G,width:1,height:1}},!1,!1,"edit");const J=Li.current([d-H,G]);J.allowOverlay&&Jo(J)&&J.readonly!==!0&&p&&window.setTimeout(()=>{Bi.current(d,G)},0)};L()},[$e,Ae,H,Se,ee]),xr=a.useCallback(d=>{var y,F;const p=((F=(y=tt[d])==null?void 0:y.trailingRowOptions)==null?void 0:F.targetColumn)??(ye==null?void 0:ye.targetColumn);if(typeof p=="number")return p+(on?1:0);if(typeof p=="object"){const I=C.indexOf(p);if(I>=0)return I+(on?1:0)}},[tt,C,on,ye==null?void 0:ye.targetColumn]),Gn=a.useRef(),ko=a.useRef(),Xo=a.useCallback((d,p)=>{var I;const[y,F]=p;return Ln(Ee,(I=$e[y])==null?void 0:I.themeOverride,nn==null?void 0:nn(F),d.themeOverride)},[nn,$e,Ee]),{mapper:oo}=Sd(Te,v),gn=Te==null?void 0:Te.navigationBehavior,Yo=a.useCallback(d=>{var J,he,Q;const p=$r.value?d.metaKey:d.ctrlKey,y=p&&q==="multi",F=p&&je==="multi",[I,P]=d.location,T=B.columns,L=B.rows,[O,G]=((J=B.current)==null?void 0:J.cell)??[];if(d.kind==="cell"){if(ko.current=void 0,ro.current=[I,P],I===0&&on){if(wt===!0&&P===Se||Gt==="number"||q==="none")return;const be=qt(d.location);if(be.kind!==un.Marker)return;if(Cn!==void 0){const Me=lt(be);jt((Me==null?void 0:Me.kind)===un.Marker);const ge=(he=Me==null?void 0:Me.onClick)==null?void 0:he.call(Me,{...d,cell:be,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,theme:Xo(be,d.location),preventDefault:()=>{}});if(ge===void 0||ge.checked===be.checked)return}i(void 0),Xt();const se=L.hasIndex(P),Ke=Gn.current;if(q==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&Ke!==void 0&&L.hasIndex(Ke)){const Me=[Math.min(Ke,P),Math.max(Ke,P)+1];y||Ge==="multi"?Je(void 0,Me,!0):Je(it.fromSingleSelection(Me),void 0,y)}else y||d.isTouch||Ge==="multi"?se?Je(L.remove(P),void 0,!0):(Je(void 0,P,!0),Gn.current=P):se&&L.length===1?Je(it.empty(),void 0,p):(Je(it.fromSingleSelection(P),void 0,p),Gn.current=P)}else if(I>=H&&wt&&P===Se){const be=xr(I);xo(be??I)}else if(O!==I||G!==P){const be=qt(d.location),se=lt(be);if((se==null?void 0:se.onSelect)!==void 0){let ge=!1;if(se.onSelect({...d,cell:be,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,preventDefault:()=>ge=!0,theme:Xo(be,d.location)}),ge)return}if(gn==="block"&&oo(P).isGroupHeader)return;const Ke=eo&&P===Se,Me=eo&&B!==void 0&&((Q=B.current)==null?void 0:Q.cell[1])===Se;if((d.shiftKey||d.isLongTouch===!0)&&O!==void 0&&G!==void 0&&B.current!==void 0&&!Me){if(Ke)return;const ge=Math.min(I,O),Qe=Math.max(I,O),ht=Math.min(P,G),Dt=Math.max(P,G);ee({...B.current,range:{x:ge,y:ht,width:Qe-ge+1,height:Dt-ht+1}},!0,p,"click"),Gn.current=void 0,Xt()}else ee({cell:[I,P],range:{x:I,y:P,width:1,height:1}},!0,p,"click"),Gn.current=void 0,i(void 0),Xt()}}else if(d.kind==="header")if(ro.current=[I,P],i(void 0),on&&I===0)Gn.current=void 0,ko.current=void 0,q==="multi"&&(L.length!==Se?Je(it.fromSingleSelection([0,Se]),void 0,p):Je(it.empty(),void 0,p),Xt());else{const be=ko.current;if(je==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&be!==void 0&&T.hasIndex(be)){const se=[Math.min(be,I),Math.max(be,I)+1];F?te(void 0,se,p):te(it.fromSingleSelection(se),void 0,p)}else F?(T.hasIndex(I)?te(T.remove(I),void 0,p):te(void 0,I,p),ko.current=I):je!=="none"&&(te(it.fromSingleSelection(I),void 0,p),ko.current=I);Gn.current=void 0,Xt()}else d.kind===dn?ro.current=[I,P]:d.kind===Or&&!d.isMaybeScrollbar&&(Y(zr,!1),i(void 0),Xt(),vt==null||vt(),Gn.current=void 0,ko.current=void 0)},[q,je,B,on,H,wt,Se,Gt,qt,Cn,Xt,Ge,lt,Xo,Je,xr,xo,gn,oo,eo,ee,te,Y,vt]),Go=a.useRef(!1),ro=a.useRef(),Pi=a.useRef(_t),an=a.useRef(),ds=a.useCallback(d=>{if(So.current=!1,Pi.current=At.current,d.button!==0&&d.button!==1){an.current=void 0;return}const p=performance.now();an.current={button:d.button,time:p,location:d.location},(d==null?void 0:d.kind)==="header"&&(Go.current=!0);const y=d.kind==="cell"&&d.isFillHandle;!y&&d.kind!=="cell"&&d.isEdge||(f({previousSelection:B,fillHandle:y}),ro.current=void 0,!d.isTouch&&d.button===0&&!y?Yo(d):!d.isTouch&&d.button===1&&(ro.current=d.location))},[B,Yo]),[ti,ni]=a.useState(),Wi=a.useCallback(d=>{if(d.kind!==dn||je!=="multi")return;const p=$r.value?d.metaKey:d.ctrlKey,[y]=d.location,F=B.columns;if(y=H&&or(I.group,$e[L].group);L--)P--;for(let L=y+1;L<$e.length&&or(I.group,$e[L].group);L++)T++;if(Xt(),p)if(F.hasAll([P,T+1])){let L=F;for(let O=P;O<=T;O++)L=L.remove(O);te(L,void 0,p)}else te(void 0,[P,T+1],p);else te(it.fromSingleSelection([P,T+1]),void 0,p)},[je,Xt,B.columns,$e,H,te]),So=a.useRef(!1),kr=a.useCallback(async d=>{if(xt!==void 0&&le!==void 0){const p=At.current.y,y=At.current.height;let F=xt({x:d,y:p,width:1,height:Math.min(y,Se-p)},Ot.current.signal);typeof F!="object"&&(F=await F());const I=tt[d-H],T=document.createElement("canvas").getContext("2d",{alpha:!1});if(T!==null){T.font=Ee.baseFontFull;const L=Kl(T,Ee,I,0,F,tn,Yn,!1,lt);le==null||le(I,L.width,d,L.width)}}},[tt,xt,Yn,Ee,tn,le,H,Se,lt]),[us,oi]=a.useState(),Mo=a.useCallback(async(d,p)=>{var L,O;const y=(L=d.current)==null?void 0:L.range;if(y===void 0||xt===void 0||p.current===void 0)return;const F=p.current.range;if(A!==void 0){let G=!1;if(A({fillDestination:{...F,x:F.x-H},patternSource:{...y,x:y.x-H},preventDefault:()=>G=!0}),G)return}let I=xt(y,Ot.current.signal);typeof I!="object"&&(I=await I());const P=I,T=[];for(let G=0;G({cell:G.location})))},[xt,sn,A,H]),$i=a.useCallback(()=>{if(B.current===void 0||B.current.range.width<=1)return;const d={...B,current:{...B.current,range:{...B.current.range,width:1}}};Mo(d,B)},[Mo,B]),Oi=a.useCallback(()=>{if(B.current===void 0||B.current.range.height<=1)return;const d={...B,current:{...B.current,range:{...B.current.range,height:1}}};Mo(d,B)},[Mo,B]),fs=a.useCallback((d,p)=>{var J,he;const y=c;if(f(void 0),Jr(void 0),oi(void 0),Go.current=!1,p)return;if((y==null?void 0:y.fillHandle)===!0&&B.current!==void 0&&((J=y.previousSelection)==null?void 0:J.current)!==void 0){if(no===void 0)return;const Q={...B,current:{...B.current,range:jl(y.previousSelection.current.range,no)}};Mo(y.previousSelection,Q),Y(Q,!0);return}const[F,I]=d.location,[P,T]=ro.current??[],L=()=>{So.current=!0},O=Q=>{var se,Ke,Me;const be=Q.isTouch||P===F&&T===I;if(be&&(X==null||X([F-H,I],{...Q,preventDefault:L})),Q.button===1)return!So.current;if(!So.current){const ge=qt(d.location),Qe=lt(ge);if(Qe!==void 0&&Qe.onClick!==void 0&&be){const Dt=Qe.onClick({...Q,cell:ge,posX:Q.localEventX,posY:Q.localEventY,bounds:Q.bounds,theme:Xo(ge,d.location),preventDefault:L});Dt!==void 0&&!Io(Dt)&&Eo(Dt)&&(sn([{location:Q.location,value:Dt}]),(se=Ut.current)==null||se.damage([{cell:Q.location}]))}if(So.current||B.current===void 0)return!1;let ht=!1;switch(ge.activationBehaviorOverride??et){case"double-click":case"second-click":{if(((Me=(Ke=y==null?void 0:y.previousSelection)==null?void 0:Ke.current)==null?void 0:Me.cell)===void 0)break;const[Dt,wn]=B.current.cell,[Mn,bn]=y.previousSelection.current.cell;ht=F===Dt&&F===Mn&&I===wn&&I===bn&&(Q.isDoubleClick===!0||et==="second-click");break}case"single-click":{ht=!0;break}}if(ht)return N==null||N([F-H,I]),Co(Q.bounds,!1),!0}return!1},G=d.location[0]-H;if(d.isTouch){const Q=At.current,be=Pi.current;if(Q.x!==be.x||Q.y!==be.y)return;if(d.isLongTouch===!0){if(d.kind==="cell"&&Qo((he=B.current)==null?void 0:he.cell,d.location)){ie==null||ie([G,d.location[1]],{...d,preventDefault:L});return}else if(d.kind==="header"&&B.columns.hasIndex(F)){pe==null||pe(G,{...d,preventDefault:L});return}else if(d.kind===dn){if(G<0)return;U==null||U(G,{...d,preventDefault:L});return}}d.kind==="cell"?O(d)||Yo(d):d.kind===dn?ne==null||ne(G,{...d,preventDefault:L}):(d.kind===_n&&(D==null||D(G,{...d,preventDefault:L})),Yo(d));return}if(d.kind==="header"){if(G<0)return;d.isEdge?d.isDoubleClick===!0&&kr(F):d.button===0&&F===P&&I===T&&(D==null||D(G,{...d,preventDefault:L}))}if(d.kind===dn){if(G<0)return;d.button===0&&F===P&&I===T&&(ne==null||ne(G,{...d,preventDefault:L}),So.current||Wi(d))}d.kind==="cell"&&(d.button===0||d.button===1)&&O(d),ro.current=void 0},[c,B,H,no,Mo,Y,X,qt,lt,et,Xo,sn,N,Co,ie,pe,U,Yo,ne,D,kr,Wi]),hs=a.useCallback(d=>{const p={...d,location:[d.location[0]-H,d.location[1]]};Pe==null||Pe(p),c!==void 0&&d.buttons===0&&(f(void 0),Jr(void 0),oi(void 0),Go.current=!1),oi(y=>{var F;return Go.current?[d.scrollEdge[0],0]:d.scrollEdge[0]===(y==null?void 0:y[0])&&d.scrollEdge[1]===y[1]?y:c===void 0||(((F=an.current)==null?void 0:F.location[0])??0){Ue==null||Ue(d-H,p)},[Ue,H]),ms=a.useCallback((d,p)=>{ut==null||ut(d-H,p)},[ut,H]),Sn=(_i=B==null?void 0:B.current)==null?void 0:_i.cell,ws=a.useCallback((d,p,y,F,I,P)=>{Vt.current=!1;let T=Sn;T!==void 0&&(T=[T[0]-H,T[1]]);const L=ke===0?void 0:{x:0,y:d.y,width:ke,height:d.height},O=[];L!==void 0&&O.push(L),mt>0&&(O.push({x:d.x-H,y:Se-mt,width:d.width,height:mt}),ke>0&&O.push({x:0,y:Se-mt,width:ke,height:mt}));const G={x:d.x-H,y:d.y,width:d.width,height:wt&&d.y+d.height>=Se?d.height-1:d.height,tx:I,ty:P,extras:{selected:T,freezeRegion:L,freezeRegions:O}};At.current=G,po(G),Ve([p,y,F]),Lt==null||Lt(G,G.tx,G.ty,G.extras)},[Sn,H,wt,Se,ke,mt,po,Lt]),bs=so(qe,a.useCallback((d,p)=>{qe==null||qe(d-H,p-H),je!=="none"&&te(it.fromSingleSelection(p),void 0,!0)},[je,qe,H,te])),ri=a.useRef(!1),ys=a.useCallback(d=>{if(d.location[0]===0&&H>0){d.preventDefault();return}Ye==null||Ye({...d,location:[d.location[0]-H,d.location[1]]}),d.defaultPrevented()||(ri.current=!0),f(void 0)},[Ye,H]),ps=a.useCallback(()=>{ri.current=!1},[]),Ni=Te==null?void 0:Te.selectionBehavior,Sr=a.useCallback(d=>{if(Ni!=="block-spanning")return;const{isGroupHeader:p,path:y,groupRows:F}=oo(d);if(p)return[d,d];const I=y[y.length-1],P=d-I,T=d+F-I-1;return[P,T]},[oo,Ni]),ii=a.useRef(),li=a.useCallback(d=>{var p,y,F;if(!ns(d,ii.current)&&(ii.current=d,!(((p=an==null?void 0:an.current)==null?void 0:p.button)!==void 0&&an.current.button>=1))){if(d.buttons!==0&&c!==void 0&&((y=an.current)==null?void 0:y.location[0])===0&&d.location[0]===0&&H===1&&q==="multi"&&c.previousSelection&&!c.previousSelection.rows.hasIndex(an.current.location[1])&&B.rows.hasIndex(an.current.location[1])){const I=Math.min(an.current.location[1],d.location[1]),P=Math.max(an.current.location[1],d.location[1])+1;Je(it.fromSingleSelection([I,P]),void 0,!1)}if(d.buttons!==0&&c!==void 0&&B.current!==void 0&&!ri.current&&!Go.current&&(dt==="rect"||dt==="multi-rect")){const[I,P]=B.current.cell;let[T,L]=d.location;if(L<0&&(L=At.current.y),c.fillHandle===!0&&((F=c.previousSelection)==null?void 0:F.current)!==void 0){const O=c.previousSelection.current.range;L=Math.min(L,wt?Se-1:Se);const G=ac(O,T,L,vn);Jr(G)}else{if(wt&&P===Se)return;if(wt&&L===Se)if(d.kind===Or)L--;else return;T=Math.max(T,H);const J=Sr(P);L=J===void 0?L:cn(L,J[0],J[1]);const he=T-I,Q=L-P,be={x:he>=0?I:T,y:Q>=0?P:L,width:Math.abs(he)+1,height:Math.abs(Q)+1};ee({...B.current,range:be},!0,!1,"drag")}}zt==null||zt({...d,location:[d.location[0]-H,d.location[1]]})}},[c,H,q,B,dt,zt,Je,wt,Se,vn,Sr,ee]),vs=a.useCallback(()=>{var T,L;const d=ii.current;if(d===void 0)return;const[p,y]=d.scrollEdge;let[F,I]=d.location;const P=At.current;p===-1?F=((L=(T=P.extras)==null?void 0:T.freezeRegion)==null?void 0:L.x)??P.x:p===1&&(F=P.x+P.width),y===-1?I=Math.max(0,P.y):y===1&&(I=Math.min(Se-1,P.y+P.height)),F=cn(F,0,$e.length-1),I=cn(I,0,Se-1),li({...d,location:[F,I]})},[$e.length,li,Se]);pd(us,at,vs);const mn=a.useCallback(d=>{if(B.current===void 0)return;const[p,y]=d,[F,I]=B.current.cell,P=B.current.range;let T=P.x,L=P.x+P.width,O=P.y,G=P.y+P.height;const[J,he]=Sr(I)??[0,Se-1],Q=he+1;if(y!==0)switch(y){case 2:{G=Q,O=I,It(0,G,"vertical");break}case-2:{O=J,G=I+1,It(0,O,"vertical");break}case 1:{OI+1?(G--,It(0,G,"vertical")):(O=Math.max(J,O-1),It(0,O,"vertical"));break}default:nr()}if(p!==0)if(p===2)L=$e.length,T=F,It(L-1-H,0,"horizontal");else if(p===-2)T=H,L=F+1,It(T-H,0,"horizontal");else{let be=[];if(xt!==void 0){const se=xt({x:T,y:O,width:L-T-H,height:G-O},Ot.current.signal);typeof se=="object"&&(be=Dd(se))}if(p===1){let se=!1;if(T0){const Ke=ao(T+1,F+1).find(Me=>!be.includes(Me-H));Ke!==void 0&&(T=Ke,se=!0)}else T++,se=!0;se&&It(T,0,"horizontal")}se||(L=Math.min($e.length,L+1),It(L-1-H,0,"horizontal"))}else if(p===-1){let se=!1;if(L>F+1){if(be.length>0){const Ke=ao(L-1,F,-1).find(Me=>!be.includes(Me-H));Ke!==void 0&&(L=Ke,se=!0)}else L--,se=!0;se&&It(L-H,0,"horizontal")}se||(T=Math.max(H,T-1),It(T-H,0,"horizontal"))}else nr()}ee({cell:B.current.cell,range:{x:T,y:O,width:L-T,height:G-O}},!0,!1,"keyboard-select")},[xt,Sr,B,$e.length,H,Se,It,ee]),si=a.useRef(Bo);si.current=Bo;const Kn=a.useCallback((d,p,y,F)=>{const I=Nt-(y?0:1);d=cn(d,H,tt.length-1+H),p=cn(p,0,I);const P=Sn==null?void 0:Sn[0],T=Sn==null?void 0:Sn[1];if(d===P&&p===T)return!1;if(F&&B.current!==void 0){const L=[...B.current.rangeStack];(B.current.range.width>1||B.current.range.height>1)&&L.push(B.current.range),Y({...B,current:{cell:[d,p],range:{x:d,y:p,width:1,height:1},rangeStack:L}},!0)}else ee({cell:[d,p],range:{x:d,y:p,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===d&&u.current[1]===p&&(u.current=void 0),si.current&&It(d-H,p),!0},[Nt,H,tt.length,Sn,B,It,Y,ee]),Cs=a.useCallback((d,p)=>{(r==null?void 0:r.cell)!==void 0&&d!==void 0&&Eo(d)&&(sn([{location:r.cell,value:d}]),window.requestAnimationFrame(()=>{var I;(I=Ut.current)==null||I.damage([{cell:r.cell}])})),Xt(!0),i(void 0);const[y,F]=p;if(B.current!==void 0&&(y!==0||F!==0)){const I=B.current.cell[1]===Nt-1&&d!==void 0;Kn(cn(B.current.cell[0]+y,0,$e.length-1),cn(B.current.cell[1]+F,0,Nt-1),I,!1)}z==null||z(d,p)},[r==null?void 0:r.cell,Xt,B,z,sn,Nt,Kn,$e.length]),xs=a.useMemo(()=>`gdg-overlay-${Id++}`,[]),io=a.useCallback(d=>{var y,F,I,P;Xt();const p=[];for(let T=d.x;T({cell:T.location})))},[Xt,E,lt,sn,H]),Ko=r!==void 0,Xi=a.useCallback(d=>{var Ke,Me;const p=()=>{d.stopPropagation(),d.preventDefault()},y={didMatch:!1},{bounds:F}=d,I=B.columns,P=B.rows,T=xn;if(!Ko&&Be(T.clear,d,y))Y(zr,!1),vt==null||vt();else if(!Ko&&Be(T.selectAll,d,y))Y({columns:it.empty(),rows:it.empty(),current:{cell:((Ke=B.current)==null?void 0:Ke.cell)??[H,0],range:{x:H,y:0,width:C.length,height:Se},rangeStack:[]}},!1);else if(Be(T.search,d,y))(Me=l==null?void 0:l.current)==null||Me.focus({preventScroll:!0}),to(!0);else if(Be(T.delete,d,y)){const ge=(Ce==null?void 0:Ce(B))??!0;if(ge!==!1){const Qe=ge===!0?B:ge;if(Qe.current!==void 0){io(Qe.current.range);for(const ht of Qe.current.rangeStack)io(ht)}for(const ht of Qe.rows)io({x:H,y:ht,width:C.length,height:1});for(const ht of Qe.columns)io({x:ht,y:0,width:1,height:Se})}}if(y.didMatch)return p(),!0;if(B.current===void 0)return!1;let[L,O]=B.current.cell;const[,G]=B.current.cell;let J=!1,he=!1;if(Be(T.scrollToSelectedCell,d,y)?Er.current(L-H,O):je!=="none"&&Be(T.selectColumn,d,y)?I.hasIndex(L)?te(I.remove(L),void 0,!0):je==="single"?te(it.fromSingleSelection(L),void 0,!0):te(void 0,L,!0):q!=="none"&&Be(T.selectRow,d,y)?P.hasIndex(O)?Je(P.remove(O),void 0,!0):q==="single"?Je(it.fromSingleSelection(O),void 0,!0):Je(void 0,O,!0):!Ko&&F!==void 0&&Be(T.activateCell,d,y)?O===Se&&wt?window.setTimeout(()=>{const ge=xr(L);xo(ge??L)},0):(N==null||N([L-H,O]),Co(F,!0)):B.current.range.height>1&&Be(T.downFill,d,y)?Oi():B.current.range.width>1&&Be(T.rightFill,d,y)?$i():Be(T.goToNextPage,d,y)?O+=Math.max(1,At.current.height-4):Be(T.goToPreviousPage,d,y)?O-=Math.max(1,At.current.height-4):Be(T.goToFirstCell,d,y)?(i(void 0),O=0,L=0):Be(T.goToLastCell,d,y)?(i(void 0),O=Number.MAX_SAFE_INTEGER,L=Number.MAX_SAFE_INTEGER):Be(T.selectToFirstCell,d,y)?(i(void 0),mn([-2,-2])):Be(T.selectToLastCell,d,y)?(i(void 0),mn([2,2])):Ko?(Be(T.closeOverlay,d,y)&&i(void 0),Be(T.acceptOverlayDown,d,y)&&(i(void 0),O++),Be(T.acceptOverlayUp,d,y)&&(i(void 0),O--),Be(T.acceptOverlayLeft,d,y)&&(i(void 0),L--),Be(T.acceptOverlayRight,d,y)&&(i(void 0),L++)):(Be(T.goDownCell,d,y)?O+=1:Be(T.goUpCell,d,y)?O-=1:Be(T.goRightCell,d,y)?L+=1:Be(T.goLeftCell,d,y)?L-=1:Be(T.goDownCellRetainSelection,d,y)?(O+=1,J=!0):Be(T.goUpCellRetainSelection,d,y)?(O-=1,J=!0):Be(T.goRightCellRetainSelection,d,y)?(L+=1,J=!0):Be(T.goLeftCellRetainSelection,d,y)?(L-=1,J=!0):Be(T.goToLastRow,d,y)?O=Se-1:Be(T.goToFirstRow,d,y)?O=Number.MIN_SAFE_INTEGER:Be(T.goToLastColumn,d,y)?L=Number.MAX_SAFE_INTEGER:Be(T.goToFirstColumn,d,y)?L=Number.MIN_SAFE_INTEGER:(dt==="rect"||dt==="multi-rect")&&(Be(T.selectGrowDown,d,y)?mn([0,1]):Be(T.selectGrowUp,d,y)?mn([0,-1]):Be(T.selectGrowRight,d,y)?mn([1,0]):Be(T.selectGrowLeft,d,y)?mn([-1,0]):Be(T.selectToLastRow,d,y)?mn([0,2]):Be(T.selectToFirstRow,d,y)?mn([0,-2]):Be(T.selectToLastColumn,d,y)?mn([2,0]):Be(T.selectToFirstColumn,d,y)&&mn([-2,0])),he=y.didMatch),gn!==void 0&&gn!=="normal"&&O!==G){const ge=gn==="skip-up"||gn==="skip"||gn==="block",Qe=gn==="skip-down"||gn==="skip"||gn==="block",ht=O=0&&oo(O).isGroupHeader;)O--;O<0&&(O=G)}else if(!ht&&Qe){for(;O=Se&&(O=G)}}const be=Kn(L,O,!1,J),se=y.didMatch;return se&&(be||!he||Zn)&&p(),se},[gn,Ko,B,xn,je,q,dt,H,oo,Se,Kn,Y,vt,C.length,Ce,Zn,io,te,Je,wt,xr,xo,N,Co,Oi,$i,mn]),Uo=a.useCallback(d=>{let p=!1;if(_e!==void 0&&_e({...d,cancel:()=>{p=!0}}),p||Xi(d)||B.current===void 0)return;const[y,F]=B.current.cell,I=At.current;if(ot&&!d.metaKey&&!d.ctrlKey&&B.current!==void 0&&d.key.length===1&&/[ -~]/g.test(d.key)&&d.bounds!==void 0&&Jo(E([y-H,Math.max(0,Math.min(F,Se-1))]))){if((!wt||F!==Se)&&(I.y>F||F>I.y+I.height||I.x>y||y>I.x+I.width))return;Co(d.bounds,!0,d.key),d.stopPropagation(),d.preventDefault()}},[ot,_e,Xi,B,E,H,Se,wt,Co]),ks=a.useCallback((d,p)=>{const y=d.location[0]-H;if(d.kind==="header"&&(pe==null||pe(y,{...d,preventDefault:p})),d.kind===dn){if(y<0)return;U==null||U(y,{...d,preventDefault:p})}if(d.kind==="cell"){const[F,I]=d.location;ie==null||ie([y,I],{...d,preventDefault:p}),ga(B,d.location)||Kn(F,I,!1,!1)}},[B,ie,U,pe,H,Kn]),ai=a.useCallback(async d=>{var T,L,O;if(!xn.paste)return;function p(G,J,he,Q){var se,Ke;const be=typeof he=="object"?(he==null?void 0:he.join(` +`))??"":(he==null?void 0:he.toString())??"";if(!Io(G)&&Jo(G)&&G.readonly!==!0){const Me=K==null?void 0:K(be,G);if(Me!==void 0&&Eo(Me))return{location:J,value:Me};const ge=lt(G);if(ge===void 0)return;if(ge.kind===j.Custom){jt(G.kind===j.Custom);const Qe=(se=ge.onPaste)==null?void 0:se.call(ge,be,G.data);return Qe===void 0?void 0:{location:J,value:{...G,data:Qe}}}else{const Qe=(Ke=ge.onPaste)==null?void 0:Ke.call(ge,be,G,{formatted:Q,formattedString:typeof Q=="string"?Q:Q==null?void 0:Q.join(` +`),rawValue:he});return Qe===void 0?void 0:(jt(Qe.kind===G.kind),{location:J,value:Qe})}}}const y=B.columns,F=B.rows,I=((T=at.current)==null?void 0:T.contains(document.activeElement))===!0||((L=s.current)==null?void 0:L.contains(document.activeElement))===!0;let P;if(B.current!==void 0?P=[B.current.range.x,B.current.range.y]:y.length===1?P=[y.first()??0,0]:F.length===1&&(P=[H,F.first()??0]),I&&P!==void 0){let G,J;const he="text/plain",Q="text/html";if(navigator.clipboard.read!==void 0){const Me=await navigator.clipboard.read();for(const ge of Me){if(ge.types.includes(Q)){const ht=await(await ge.getType(Q)).text(),Dt=bl(ht);if(Dt!==void 0){G=Dt;break}}ge.types.includes(he)&&(J=await(await ge.getType(he)).text())}}else if(navigator.clipboard.readText!==void 0)J=await navigator.clipboard.readText();else if(d!==void 0&&(d==null?void 0:d.clipboardData)!==null){if(d.clipboardData.types.includes(Q)){const Me=d.clipboardData.getData(Q);G=bl(Me)}G===void 0&&d.clipboardData.types.includes(he)&&(J=d.clipboardData.getData(he))}else return;const[be,se]=P,Ke=[];do{if(We===void 0){const Me=qt(P),ge=J??(G==null?void 0:G.map(ht=>ht.map(Dt=>Dt.rawValue).join(" ")).join(" "))??"",Qe=p(Me,P,ge,void 0);Qe!==void 0&&Ke.push(Qe);break}if(G===void 0){if(J===void 0)return;G=fd(J)}if(We===!1||typeof We=="function"&&(We==null?void 0:We([P[0]-H,P[1]],G.map(Me=>Me.map(ge=>{var Qe;return((Qe=ge.rawValue)==null?void 0:Qe.toString())??""}))))!==!0)return;for(const[Me,ge]of G.entries()){if(Me+se>=Se)break;for(const[Qe,ht]of ge.entries()){const Dt=[Qe+be,Me+se],[wn,Mn]=Dt;if(wn>=$e.length||Mn>=Nt)continue;const bn=qt(Dt),Rn=p(bn,Dt,ht.rawValue,ht.formatted);Rn!==void 0&&Ke.push(Rn)}}}while(!1);sn(Ke),(O=Ut.current)==null||O.damage(Ke.map(Me=>({cell:Me.location})))}},[K,lt,qt,B,xn.paste,at,$e.length,sn,Nt,We,H,Se]);Wt("paste",ai,b,!1,!0);const Vo=a.useCallback(async(d,p)=>{var T,L;if(!xn.copy)return;const y=p===!0||((T=at.current)==null?void 0:T.contains(document.activeElement))===!0||((L=s.current)==null?void 0:L.contains(document.activeElement))===!0,F=B.columns,I=B.rows,P=(O,G)=>{if(!de)pl(O,G,d);else{const J=G.map(he=>({kind:j.Text,data:C[he].title,displayData:C[he].title,allowOverlay:!1}));pl([J,...O],G,d)}};if(y&&xt!==void 0){if(B.current!==void 0){let O=xt(B.current.range,Ot.current.signal);typeof O!="object"&&(O=await O()),P(O,ao(B.current.range.x-H,B.current.range.x+B.current.range.width-H))}else if(I!==void 0&&I.length>0){const G=[...I].map(J=>{const he=xt({x:H,y:J,width:C.length,height:1},Ot.current.signal);return typeof he=="object"?he[0]:he().then(Q=>Q[0])});if(G.some(J=>J instanceof Promise)){const J=await Promise.all(G);P(J,ao(C.length))}else P(G,ao(C.length))}else if(F.length>0){const O=[],G=[];for(const J of F){let he=xt({x:J,y:0,width:1,height:Se},Ot.current.signal);typeof he!="object"&&(he=await he()),O.push(he),G.push(J-H)}if(O.length===1)P(O[0],G);else{const J=O.reduce((he,Q)=>he.map((be,se)=>[...be,...Q[se]]));P(J,G)}}}},[C,xt,B,xn.copy,H,at,Se,de]);Wt("copy",Vo,b,!1,!1);const Ss=a.useCallback(async d=>{var y,F;if(!(!xn.cut||!(((y=at.current)==null?void 0:y.contains(document.activeElement))===!0||((F=s.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await Vo(d),B.current!==void 0)){let I={current:{cell:B.current.cell,range:B.current.range,rangeStack:[]},rows:it.empty(),columns:it.empty()};const P=Ce==null?void 0:Ce(I);if(P===!1||(I=P===!0?I:P,I.current===void 0))return;io(I.current.range)}},[io,B,xn.cut,Vo,at,Ce]);Wt("cut",Ss,b,!1,!1);const Ms=a.useCallback((d,p)=>{if(ue!==void 0){H!==0&&(d=d.map(I=>[I[0]-H,I[1]])),ue(d,p);return}if(d.length===0||p===-1)return;const[y,F]=d[p];u.current!==void 0&&u.current[0]===y&&u.current[1]===F||(u.current=[y,F],Kn(y,F,!1,!1))},[ue,H,Kn]),[Mr,Rr]=((qi=gt==null?void 0:gt.current)==null?void 0:qi.cell)??[],Er=a.useRef(It);Er.current=It,a.useLayoutEffect(()=>{var d,p,y,F;si.current&&!Vt.current&&Mr!==void 0&&Rr!==void 0&&(Mr!==((p=(d=k.current)==null?void 0:d.current)==null?void 0:p.cell[0])||Rr!==((F=(y=k.current)==null?void 0:y.current)==null?void 0:F.cell[1]))&&Er.current(Mr,Rr),Vt.current=!1},[Mr,Rr]);const Yi=B.current!==void 0&&(B.current.cell[0]>=$e.length||B.current.cell[1]>=Nt);a.useLayoutEffect(()=>{Yi&&Y(zr,!1)},[Yi,Y]);const Rs=a.useMemo(()=>wt===!0&&(ye==null?void 0:ye.tint)===!0?it.fromSingleSelection(Nt-1):it.empty(),[Nt,wt,ye==null?void 0:ye.tint]),Es=a.useCallback(d=>typeof ze=="boolean"?ze:(ze==null?void 0:ze(d-H))??!0,[H,ze]),Is=a.useMemo(()=>{if(ti===void 0||s.current===null)return null;const{bounds:d,group:p}=ti,y=s.current.getBoundingClientRect();return a.createElement(td,{bounds:d,group:p,canvasBounds:y,onClose:()=>ni(void 0),onFinish:F=>{ni(void 0),me==null||me(p,F)}})},[me,ti]),Ds=Math.min($e.length,ke+(on?1:0));a.useImperativeHandle(t,()=>({appendRow:(d,p)=>xo(d+H,p),updateCells:d=>{var p;return H!==0&&(d=d.map(y=>({cell:[y.cell[0]+H,y.cell[1]]}))),(p=Ut.current)==null?void 0:p.damage(d)},getBounds:(d,p)=>{var y;if(!((s==null?void 0:s.current)===null||(at==null?void 0:at.current)===null)){if(d===void 0&&p===void 0){const F=s.current.getBoundingClientRect(),I=F.width/at.current.clientWidth;return{x:F.x-at.current.scrollLeft*I,y:F.y-at.current.scrollTop*I,width:at.current.scrollWidth*I,height:at.current.scrollHeight*I}}return(y=Ut.current)==null?void 0:y.getBounds((d??0)+H,p)}},focus:()=>{var d;return(d=Ut.current)==null?void 0:d.focus()},emit:async d=>{switch(d){case"delete":Uo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Uo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Uo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Vo(void 0,!0);break;case"paste":await ai();break}},scrollTo:It,remeasureColumns:d=>{for(const p of d)kr(p+H)}}),[xo,kr,at,Vo,Uo,ai,H,It]);const[Gi,Ki]=Sn??[],Fs=a.useCallback(d=>{const[p,y]=d;if(y===-1){je!=="none"&&(te(it.fromSingleSelection(p),void 0,!1),Xt());return}Gi===p&&Ki===y||(ee({cell:d,range:{x:p,y,width:1,height:1}},!0,!1,"keyboard-nav"),It(p,y))},[je,Xt,It,Gi,Ki,ee,te]),[Hs,Ts]=a.useState(!1),Ui=a.useRef(Rl(d=>{Ts(d)},5)),As=a.useCallback(()=>{Ui.current(!0),B.current===void 0&&B.columns.length===0&&B.rows.length===0&&c===void 0&&ee({cell:[H,br],range:{x:H,y:br,width:1,height:1}},!0,!1,"keyboard-select")},[br,B,c,H,ee]),zs=a.useCallback(()=>{Ui.current(!1)},[]),[Bs,Ls]=a.useMemo(()=>{let d;const p=(Ft==null?void 0:Ft.scrollbarWidthOverride)??bi(),y=Se+(wt?1:0);if(typeof hn=="number")d=Pt+y*hn;else{let I=0;const P=Math.min(y,10);for(let T=0;TP.width+I,0)+p;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,d)}px`]},[$e,Ft==null?void 0:Ft.scrollbarWidthOverride,hn,Se,wt,Pt]),Ps=a.useMemo(()=>Ia(Ee),[Ee]);return a.createElement(Gl.Provider,{value:Ee},a.createElement(wd,{style:Ps,className:Ie,inWidth:m??Bs,inHeight:x??Ls},a.createElement(Zc,{fillHandle:Rt,drawFocusRing:Qn,experimental:Ft,fixedShadowX:Ht,fixedShadowY:Bt,getRowThemeOverride:nn,headerIcons:Fn,imageWindowLoader:lr,initialSize:$n,isDraggable:Hn,onDragLeave:Tn,onRowMoved:Cn,overscrollX:_r,overscrollY:qr,preventDiagonalScrolling:ho,rightElement:go,rightElementProps:mo,smoothScrollX:Jn,smoothScrollY:On,className:Ie,enableGroups:ln,onCanvasFocused:As,onCanvasBlur:zs,canvasRef:s,onContextMenu:ks,theme:Ee,cellXOffset:as,cellYOffset:br,accessibilityHeight:_t.height,onDragEnd:ps,columns:$e,nonGrowWidth:rn,drawHeader:re,onColumnProposeMove:R,drawCell:He,disabledRows:Rs,freezeColumns:Ds,lockColumns:H,firstColAccessible:H===0,getCellContent:qt,minColumnWidth:tn,maxColumnWidth:Yn,searchInputRef:l,showSearch:Oo,onSearchClose:No,highlightRegions:cs,getCellsForSelection:xt,getGroupDetails:Qr,headerHeight:yo,isFocused:Hs,groupHeaderHeight:ln?gr:0,freezeTrailingRows:mt+(wt&&(ye==null?void 0:ye.sticky)===!0?1:0),hasAppendRow:wt,onColumnResize:le,onColumnResizeEnd:ce,onColumnResizeStart:_,onCellFocused:Fs,onColumnMoved:bs,onDragStart:ys,onHeaderMenuClick:gs,onHeaderIndicatorClick:ms,onItemHovered:li,isFilling:(c==null?void 0:c.fillHandle)===!0,onMouseMove:hs,onKeyDown:Uo,onKeyUp:nt,onMouseDown:ds,onMouseUp:fs,onDragOverCell:Mt,onDrop:ft,onSearchResultsChanged:Ms,onVisibleRegionChanged:ws,clientSize:Ne,rowHeight:hn,searchResults:V,searchValue:ve,onSearchValueChange:xe,rows:Nt,scrollRef:at,selection:B,translateX:_t.tx,translateY:_t.ty,verticalBorder:Es,gridRef:Ut,getCellRenderer:lt,resizeIndicator:Ur}),Is,r!==void 0&&a.createElement(a.Suspense,{fallback:null},a.createElement(Ed,{...r,validateCell:Zr,bloom:W,id:xs,getCellRenderer:lt,className:(Ft==null?void 0:Ft.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:fn,imageEditorOverride:w,onFinishEditing:Cs,markdownDivCreateNode:h,isOutsideClick:Nn}))))},Hd=a.forwardRef(Fd),ss=20;function xl(e){const{cell:t,posX:n,posY:o,bounds:r,theme:i}=e,{width:l,height:s,x:c,y:f}=r,u=t.maxSize??ss,b=Math.floor(r.y+s/2),w=Fl(u,s,i.cellVerticalPadding),g=Dl(t.contentAlign??"center",c,l,i.cellHorizontalPadding,w),h=Il(g,b,w),m=Hl(c+n,f+o,h);return ki(t)&&m}const Td={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:j.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Ad(e,e.cell.data,ki(e.cell),e.cell.maxSize??ss,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{xl(e)&&e.preventDefault()},onClick:e=>{if(xl(e))return{...e.cell,data:rs(e.cell.data)}},onPaste:(e,t)=>{let n=Lr;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=xi),n===t.data?void 0:{...t,data:n}}};function Ad(e,t,n,o,r){if(!n&&t===Lr)return;const{ctx:i,hoverAmount:l,theme:s,rect:c,highlighted:f,hoverX:u,hoverY:b,cell:{contentAlign:w}}=e,{x:g,y:h,width:m,height:x}=c;let C=!1;if(r>0){let v=n?1-r+r*l:.4;if(t===Lr&&(v*=l),v===0)return;v<1&&(C=!0,i.globalAlpha=v)}Di(i,s,t,g,h,m,x,f,u,b,o,w),C&&(i.globalAlpha=1)}const zd=Jt("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Bd=e=>{const{bubbles:t}=e;return a.createElement(zd,null,t.map((n,o)=>a.createElement("div",{key:o,className:"boe-bubble"},n)),a.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Ld=Bd,Pd={getAccessibilityString:e=>Tl(e.data),kind:j.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r).width+o+20,0)+2*n.cellHorizontalPadding-4,draw:e=>$d(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return a.createElement(Ld,{bubbles:t.data})},onPaste:()=>{}},Wd=4;function $d(e,t){const{rect:n,theme:o,ctx:r,highlighted:i}=e,{x:l,y:s,width:c,height:f}=n,u=20,b=8,w=Wd;let g=l+o.cellHorizontalPadding;const h=[];for(const m of t){if(g>l+c)break;const x=Ao(m,r,o.baseFontFull).width;h.push({x:g,width:x}),g+=x+b*2+w}r.beginPath();for(const m of h)In(r,m.x,s+(f-u)/2,m.width+b*2,u,o.roundingRadius??u/2);r.fillStyle=i?o.bgBubbleSelected:o.bgBubble,r.fill();for(const[m,x]of h.entries())r.beginPath(),r.fillStyle=o.textBubble,r.fillText(t[m],x.x+b,s+f/2+qn(r,o))}const Od=Jt("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Nd=e=>{const{drilldowns:t}=e;return a.createElement(Od,null,t.map((n,o)=>a.createElement("div",{key:o,className:"doe-bubble"},n.img!==void 0&&a.createElement("img",{src:n.img}),a.createElement("div",null,n.text))))},Xd=Nd,Yd={getAccessibilityString:e=>Tl(e.data.map(t=>t.text)),kind:j.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r.text).width+o+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Ud(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return a.createElement(Xd,{drilldowns:t.data})},onPaste:()=>{}},Gd=4,gi={};function Kd(e,t,n,o){const r=Math.ceil(window.devicePixelRatio),i=5,l=n-i*2,s=4,c=n*r,f=o+i,u=o*3,b=(u+i*2)*r,w=`${e},${t},${r},${n}`;if(gi[w]!==void 0)return{el:gi[w],height:c,width:b,middleWidth:s*r,sideWidth:f*r,padding:i*r,dpr:r};const g=document.createElement("canvas"),h=g.getContext("2d");return h===null?null:(g.width=b,g.height=c,h.scale(r,r),gi[w]=g,h.beginPath(),In(h,i,i,u,l,o),h.shadowColor="rgba(24, 25, 34, 0.4)",h.shadowBlur=1,h.fillStyle=e,h.fill(),h.shadowColor="rgba(24, 25, 34, 0.3)",h.shadowOffsetY=1,h.shadowBlur=5,h.fillStyle=e,h.fill(),h.shadowOffsetY=0,h.shadowBlur=0,h.shadowBlur=0,h.beginPath(),In(h,i+.5,i+.5,u,l,o),h.strokeStyle=t,h.lineWidth=1,h.stroke(),{el:g,height:c,width:b,sideWidth:f*r,middleWidth:o*r,padding:i*r,dpr:r})}function Ud(e,t){const{rect:n,theme:o,ctx:r,imageLoader:i,col:l,row:s}=e,{x:c,width:f}=n,u=o.baseFontFull,b=$l(r,u),w=Math.min(n.height,Math.max(16,Math.ceil(b*o.lineHeight)*2)),g=Math.floor(n.y+(n.height-w)/2),h=w-10,m=8,x=Gd;let C=c+o.cellHorizontalPadding;const v=o.roundingRadius??6,E=Kd(o.bgCell,o.drilldownBorder,w,v),X=[];for(const N of t){if(C>c+f)break;const z=Ao(N.text,r,u).width;let K=0;N.img!==void 0&&i.loadOrGetImage(N.img,l,s)!==void 0&&(K=h-8+4);const S=z+K+m*2;X.push({x:C,width:S}),C+=S+x}if(E!==null){const{el:N,height:A,middleWidth:z,sideWidth:K,width:S,dpr:$,padding:W}=E,D=K/$,R=W/$;for(const M of X){const ae=Math.floor(M.x),ne=Math.floor(M.width),ie=ne-(D-R)*2;r.imageSmoothingEnabled=!1,r.drawImage(N,0,0,K,A,ae-R,g,D,w),ie>0&&r.drawImage(N,K,0,z,A,ae+(D-R),g,ie,w),r.drawImage(N,S-K,0,K,A,ae+ne-(D-R),g,D,w),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[N,A]of X.entries()){const z=t[N];let K=A.x+m;if(z.img!==void 0){const S=i.loadOrGetImage(z.img,l,s);if(S!==void 0){const $=h-8;let W=0,D=0,R=S.width,M=S.height;R>M?(W+=(R-M)/2,R=M):M>R&&(D+=(M-R)/2,M=R),r.beginPath(),In(r,K,g+w/2-$/2,$,$,o.roundingRadius??3),r.save(),r.clip(),r.drawImage(S,W,D,R,M,K,g+w/2-$/2,$,$),r.restore(),K+=$+4}}r.beginPath(),r.fillStyle=o.textBubble,r.fillText(z.text,K,g+w/2+qn(r,o))}}const Vd={getAccessibilityString:e=>e.data.join(", "),kind:j.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>_d(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:o}=e,r=o??la;return a.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const o=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(o.length===t.data.length&&o.every((r,i)=>r===t.data[i])))return{...t,data:o}}},mi=4;function _d(e,t,n,o){const{rect:r,col:i,row:l,theme:s,ctx:c,imageLoader:f}=e,{x:u,y:b,height:w,width:g}=r,h=w-s.cellVerticalPadding*2,m=[];let x=0;for(let v=0;v0&&(c.beginPath(),In(c,C,b+s.cellVerticalPadding,E,h,n),c.save(),c.clip()),c.drawImage(v,C,b+s.cellVerticalPadding,E,h),n>0&&c.restore(),C+=E+mi}}function qd(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const jd={getAccessibilityString:()=>"",kind:j.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:r,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(qd(n,o)*t.skeletonWidthVariability));const c=l.cellHorizontalPadding;s+c*2>=i.width&&(s=i.width-c*2-1);const f=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);In(r,i.x+c,i.y+(i.height-f)/2,s,f,l.roundingRadius??3),r.fillStyle=uo(l.textDark,.1),r.fill()},onPaste:()=>{}},Zd=()=>e=>e.targetWidth,kl=Jt("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Zd(),"px"]}}),Jd=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:r,targetRect:i,onFinish:l,validatedSelection:s}=e,c=t.data,f=t.readonly===!0,[u,b]=a.useState(c===""||o),w=a.useCallback(()=>{b(h=>!h)},[]),g=c?"gdg-ml-6":"";return u?a.createElement(kl,{targetWidth:i.width-20},a.createElement(Xr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},onChange:n}),a.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>l(t)},a.createElement(Qs,null))):a.createElement(kl,{targetWidth:i.width},a.createElement(aa,{contents:c,createNode:r}),!f&&a.createElement(a.Fragment,null,a.createElement("div",{className:"spacer"}),a.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:w},a.createElement(Si,null))),a.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Qd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:ir,measure:(e,t,n)=>{const o=t.data.split(` +`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>En(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:o,onFinishedEditing:r,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:s}=e;return a.createElement(Jd,{onFinish:r,targetRect:o,value:n,validatedSelection:s,onChange:c=>t({...n,data:c.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},eu={getAccessibilityString:e=>e.row.toString(),kind:un.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:tu,measure:()=>44,draw:e=>ou(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:o,posY:r}=e,{width:i,height:l}=t,s=n.drawHandle?7+(i-7)/2:i/2,c=l/2;if(Math.abs(o-s)<=10&&Math.abs(r-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function tu(e,t){const{ctx:n,theme:o}=e,r=o.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==r&&(n.font=r,i.font=r),i.deprep=nu,n.textAlign="center",i}function nu(e){const{ctx:t}=e;t.textAlign="start"}function ou(e,t,n,o,r,i){const{ctx:l,rect:s,hoverAmount:c,theme:f}=e,{x:u,y:b,width:w,height:g}=s,h=n?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&h>0){l.globalAlpha=h;const m=7*(n?c:1);if(Di(l,f,n,r?u+m:u,b,r?w-m:w,g,!0,void 0,void 0,18,"center",i),r){l.globalAlpha=c,l.beginPath();for(const x of[3,6])for(const C of[-5,-1,3])l.rect(u+x,b+g/2+C,2,2);l.fillStyle=f.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const m=t.toString(),x=f.markerFontFull,C=u+w/2;o==="both"&&c!==0&&(l.globalAlpha=1-c),l.fillStyle=f.textLight,l.font=x,l.fillText(m,C,b+g/2+qn(l,x)),c!==0&&(l.globalAlpha=1)}}const ru={getAccessibilityString:()=>"",kind:un.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>iu(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function iu(e,t,n){const{ctx:o,rect:r,hoverAmount:i,theme:l,spriteManager:s}=e,{x:c,y:f,width:u,height:b}=r;o.beginPath(),o.globalAlpha=i,o.rect(c+1,f+1,u,b-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const w=t!=="";let g=0;if(n!==void 0){const m=b-8,x=c+8/2,C=f+8/2;s.drawSprite(n,"normal",o,x,C,m,l,w?1:i),g=m}else{g=24;const h=12,m=w?h:i*h,x=w?0:(1-i)*h*.5,C=l.cellHorizontalPadding+4;m>0&&(o.moveTo(c+C+x,f+b/2),o.lineTo(c+C+x+m,f+b/2),o.moveTo(c+C+x+m*.5,f+b/2-m*.5),o.lineTo(c+C+x+m*.5,f+b/2+m*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,g+c+l.cellHorizontalPadding+.5,f+b/2+qn(o,l)),o.beginPath()}const lu=a.lazy(async()=>await Ml(()=>import("./number-overlay-editor-3ljU3NGx.js"),__vite__mapDeps([8,1,3,9]),import.meta.url)),su={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:ir,draw:e=>En(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:r}=e;return a.createElement(a.Suspense,{fallback:null},a.createElement(lu,{highlight:t,disabled:o.readonly===!0,value:o.data,fixedDecimals:o.fixedDecimals,allowNegative:o.allowNegative,thousandSeparator:o.thousandSeparator,decimalSeparator:o.decimalSeparator,validatedSelection:r,onChange:i=>n({...o,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const o=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(o)||t.data===o))return{...t,data:o,displayData:n.formattedString??t.displayData}}},au={getAccessibilityString:()=>"",measure:()=>108,kind:j.Protected,needsHover:!1,needsHoverPosition:!1,draw:cu,onPaste:()=>{}};function cu(e){const{ctx:t,theme:n,rect:o}=e,{x:r,y:i,height:l}=o;t.beginPath();const s=2.5;let c=r+n.cellHorizontalPadding+s;const f=i+l/2,u=Math.cos(tl(30))*s,b=Math.sin(tl(30))*s;for(let w=0;w<12;w++)t.moveTo(c,f-s),t.lineTo(c,f+s),t.moveTo(c+u,f-b),t.lineTo(c-u,f+b),t.moveTo(c-u,f-b),t.lineTo(c+u,f+b),c+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const du={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>ir(e,t,e.theme.textLight),draw:e=>En(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:r}=e;return pt.createElement(Xr,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:r,onChange:i=>n({...o,data:i.target.value})})},onPaste:()=>{}},uu={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:ir,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:r,rect:i,theme:l,overrideCursor:s}=e,{displayData:c,contentAlign:f,hoverEffect:u,allowWrapping:b}=t;if(u===!0&&n>0){r.textBaseline="alphabetic";const w=l.cellHorizontalPadding,g=l.cellVerticalPadding,h=Ao(c,r,l.baseFontFull,"alphabetic"),m=i.height-g,x=Math.min(m,h.actualBoundingBoxAscent*2.5);r.beginPath(),In(r,i.x+w/2,i.y+(i.height-x)/2+1,h.width+w*3,x-1,l.roundingRadius??4),r.globalAlpha=n,r.fillStyle=uo(l.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=l.textDark,r.textBaseline="middle",s==null||s("text")}En(e,c,f,b,o)},measure:(e,t,n)=>{const o=t.displayData.split(` +`,t.allowWrapping===!0?void 0:1);let r=0;for(const i of o)r=Math.max(r,e.measureText(i).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:o,value:r,validatedSelection:i}=t;return a.createElement(Xr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:i,onChange:l=>o({...r,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},fu=Jt("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),hu=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:r,validatedSelection:i,preview:l}=e,[s,c]=a.useState(!r&&(t===""||o)),f=a.useCallback(()=>{c(!0)},[]);return s?a.createElement(Xr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):a.createElement(fu,null,a.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!r&&a.createElement("div",{className:"gdg-edit-icon",onClick:f},a.createElement(Si,null)),a.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gu=hu;function Sl(e,t,n,o){let r=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return o==="right"?r=t.width-l-n.cellHorizontalPadding:o==="center"&&(r=t.width/2-l/2),{x:r,y:i,width:l,height:s}}const mu={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:ir,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:r,hoverY:i,rect:l,ctx:s}=e,c=t.displayData??t.data,f=t.hoverEffect===!0;if(o!==void 0&&f&&r!==void 0&&i!==void 0){const u=Ao(c,s,n.baseFontFull),b=Sl(u,l,n,t.contentAlign),{x:w,y:g,width:h,height:m}=b;if(r>=w-4&&r<=w-4+h+8&&i>=g-4&&i<=g-4+m+8){const x=qn(s,n.baseFontFull);o("pointer");const C=5,v=g-x;s.beginPath(),s.moveTo(l.x+w,Math.floor(l.y+v+m+C)+.5),s.lineTo(l.x+w+h,Math.floor(l.y+v+m+C)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,En({...e,rect:{...l,x:l.x-1}},c,t.contentAlign),En({...e,rect:{...l,x:l.x-2}},c,t.contentAlign),En({...e,rect:{...l,x:l.x+1}},c,t.contentAlign),En({...e,rect:{...l,x:l.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=f?n.linkColor:n.textDark,En(e,c,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:r,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=Pl(l,i.baseFontFull);if(s===void 0)return;const c=Sl(s,n,i,t.contentAlign);co({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},o,r)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:o,forceEditMode:r,validatedSelection:i}=t;return a.createElement(gu,{forceEditMode:o.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:o.data,preview:o.displayData??o.data,validatedSelection:i,readonly:o.readonly===!0,onChange:l=>n({...o,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},wu=[eu,ru,Td,Pd,Yd,Vd,jd,Qd,su,au,du,uu,mu],wi=[];class bu extends Nl{constructor(){super(...arguments);Xe(this,"imageLoaded",()=>{});Xe(this,"loadedLocations",[]);Xe(this,"cache",{});Xe(this,"sendLoaded",Ks(()=>{this.imageLoaded(new tr(this.loadedLocations)),this.loadedLocations=[]},20));Xe(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const o of n){const r=this.cache[o];let i=!1;for(let l=0;l{c||(c=!0,wi.length<12?wi.unshift(s):l||(s.src=""))}},u=new Promise(b=>s.addEventListener("load",()=>b(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,await s.decode();const b=this.cache[i];if(b!==void 0&&!c){b.img=s;for(const w of b.cells)this.loadedLocations.push(Ii(w));l=!0,this.sendLoaded()}}catch{f.cancel()}}),this.cache[i]=f}loadOrGetImage(n,o,r){const i=n,l=this.cache[i];if(l!==void 0){const s=yn(o,r);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,r,i)}}const yu=bu,pu=(e,t)=>{const n=a.useMemo(()=>({...ic,...e.headerIcons}),[e.headerIcons]),o=a.useMemo(()=>e.imageWindowLoader??new yu,[e.imageWindowLoader]);return a.createElement(Hd,{...e,renderers:wu,headerIcons:n,ref:t,imageWindowLoader:o})},Hu=a.forwardRef(pu);export{Jc as C,Hu as D,j as G,Gl as T,Xr as a,Zt as b,Iu as c,Du as d,Ru as e,Eo as f,qn as g,Ji as h,Eu as i,Io as j,qs as k,Ia as l,Ao as m,Ho as p,In as r,Fu as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-xe3yVD_U.js","./index-BMVQvedj.js","./index-wocATsGp.js","./marked.esm-dbrxtycE.js","./iframe-alOpk4ZG.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./number-overlay-editor-3ljU3NGx.js","./react-number-format.es-2Vaki8Uh.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/docs/assets/data-editor-all-kM-cjKZ5.js b/docs/assets/data-editor-all-kM-cjKZ5.js deleted file mode 100644 index 1520666d5..000000000 --- a/docs/assets/data-editor-all-kM-cjKZ5.js +++ /dev/null @@ -1,135 +0,0 @@ -var Bs=Object.defineProperty;var Ls=(e,t,n)=>t in e?Bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Oe=(e,t,n)=>(Ls(e,typeof t!="symbol"?t+"":t,n),n);import{r as a,R as vt}from"./index-BMVQvedj.js";import{_ as Sl}from"./iframe-0-Di66Z3.js";import{h as Ps,d as Ml,j as Ws,v as $s,_ as Os,g as Ns,c as sn,r as io,t as Xs}from"./throttle-7EuXLZa7.js";import{u as Ys,f as qi}from"./flatten-qRvRBp6y.js";import{s as tn,b as Gs}from"./marked.esm-dbrxtycE.js";function Rl(e="This should not happen"){throw new Error(e)}function Qt(e,t="Assertion failed"){if(!e)return Rl(t)}function or(e,t){return Rl(t??"Hell froze over")}function Ks(e,t){try{return e()}catch{return t}}const ji=Object.prototype.hasOwnProperty;function Ho(e,t){let n,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&Ho(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(ji.call(e,n)&&++o&&!ji.call(t,n)||!(n in t)||!Ho(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const Br=null,xi=void 0;var j;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(j||(j={}));var Zi;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Zi||(Zi={}));var Lr;(function(e){e.Triangle="triangle",e.Dots="dots"})(Lr||(Lr={}));function Dr(e){return"width"in e&&typeof e.width=="number"}async function Ji(e){return typeof e=="object"?e:await e()}function Io(e){return!(e.kind===j.Loading||e.kind===j.Bubble||e.kind===j.RowID||e.kind===j.Protected||e.kind===j.Drilldown)}function ku(e){return!(e.kind===j.Loading||e.kind===j.Bubble||e.kind===j.RowID||e.kind===j.Protected||e.kind===j.Drilldown||e.kind===j.Boolean||e.kind===j.Image||e.kind===j.Custom)}function Do(e){return e.kind===cn.Marker||e.kind===cn.NewRow}function Qo(e){if(!Io(e)||e.kind===j.Image)return!1;if(e.kind===j.Text||e.kind===j.Number||e.kind===j.Markdown||e.kind===j.Uri||e.kind===j.Custom||e.kind===j.Boolean)return e.readonly!==!0;or(e,"A cell was passed with an invalid kind")}function Us(e){return Ps(e,"editor")}function wi(e){return!(e.readonly??!1)}var cn;(function(e){e.NewRow="new-row",e.Marker="marker"})(cn||(cn={}));function Vs(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(o,r){return o[0]-r[0]}),n.push([...t[0]]);for(const o of t.slice(1)){const r=n[n.length-1];r[1][o[0]+t,o[1]+t]);return new Hn(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=Vs([...this.items,n]);return new Hn(o)}remove(t){const n=[...this.items],o=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[s,c]=l;if(s<=r&&o<=c){const u=[];s=o&&tQi??(Qi=new Hn([]))),Oe(Hn,"fromSingleSelection",t=>Hn.empty().add(t));let st=Hn;const _s=tn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});function Lt(e,t,n,o,r=!1){const i=a.useRef();i.current=t,a.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=c=>{var u;(u=i.current)==null||u.call(l,c)};return l.addEventListener(e,s,{passive:o,capture:r}),()=>{l.removeEventListener(e,s,{capture:r})}},[e,n,o,r])}function ro(e,t){return e===void 0?void 0:t}const qs=Math.PI;function el(e){return e*qs/180}const El=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Il=(e,t,n,o,r)=>{switch(e){case"left":return Math.floor(t)+o+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-o-r/2}},Dl=(e,t,n)=>Math.min(e,t-n*2),Fl=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ki=e=>{const t=e.fgColor??"currentColor";return a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),a.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},js=e=>{const t=e.fgColor??"currentColor";return a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Zs(e,t,n){const[o,r]=a.useState(e),i=a.useRef(!0);a.useEffect(()=>()=>{i.current=!1},[]);const l=a.useRef(Ml(s=>{i.current&&r(s)},n));return a.useLayoutEffect(()=>{i.current&&l.current(()=>e())},t),o}const Js="֑-߿יִ-﷽ﹰ-ﻼ",Qs="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ea=new RegExp("^[^"+Qs+"]*["+Js+"]");function Si(e){return ea.test(e)?"rtl":"not-rtl"}let Fr;function yi(){if(typeof document>"u")return 0;if(Fr!==void 0)return Fr;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),Fr=n-o,Fr}const oo=Symbol();function ta(e){const t=a.useRef([oo,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=a.useState(e),[,r]=a.useState(),i=a.useCallback(s=>{const c=t.current[0];c!==oo&&(s=typeof s=="function"?s(c):s,s===c)||(c!==oo&&r({}),o(u=>typeof s=="function"?s(c===oo?u:c):s),t.current[0]=oo)},[]),l=a.useCallback(()=>{t.current[0]=oo,r({})},[]);return[t.current[0]===oo?n:t.current[0],i,l]}function Hl(e){if(e.length===0)return"";let t=0,n=0;for(const o of e){if(n+=o.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function na(e){const t=a.useRef(e);return Ho(e,t.current)||(t.current=e),t.current}const oa=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:r}=e,i=t.filter(s=>s!=="");if(i.length===0)return null;const l=i.length>1;return a.createElement(_s,{"data-testid":"GDG-default-image-overlay-editor"},a.createElement(Ws.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(s=>{const c=(r==null?void 0:r(s))??a.createElement("img",{draggable:!1,src:s});return a.createElement("div",{className:"gdg-centering-container",key:s},c)})),n&&o&&a.createElement("button",{className:"gdg-edit-icon",onClick:o},a.createElement(ki,null)))},ra=tn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class ia extends vt.PureComponent{constructor(){super(...arguments);Oe(this,"targetElement",null);Oe(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:o}=this;if(n===null)return;const{contents:r,createNode:i}=o,l=Gs(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let c=i==null?void 0:i(l);if(c===void 0){const f=document.createElement("template");f.innerHTML=l,c=f.content}n.append(c);const u=n.getElementsByTagName("a");for(const f of u)f.target="_blank",f.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),vt.createElement(ra,{ref:this.containerRefHook})}}const la=tn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),sa=tn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),aa=tn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let tl=0;const Nr=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:r,altNewline:i,validatedSelection:l,...s}=e,{onChange:c,className:u}=s,f=a.useRef(null),m=n??"";Qt(c!==void 0,"GrowingEntry must be a controlled input area");const[g]=a.useState(()=>"input-box-"+(tl=(tl+1)%1e7));a.useEffect(()=>{const h=f.current;if(h===null||h.disabled)return;const y=m.toString().length;h.focus(),h.setSelectionRange(r?0:y,y)},[]),a.useLayoutEffect(()=>{var h;if(l!==void 0){const y=typeof l=="number"?[l,null]:l;(h=f.current)==null||h.setSelectionRange(y[0],y[1])}},[l]);const w=a.useCallback(h=>{h.key==="Enter"&&h.shiftKey&&i===!0||o==null||o(h)},[i,o]);return a.createElement(aa,{className:"gdg-growing-entry"},a.createElement(sa,{className:u},m+` -`),a.createElement(la,{...s,className:(u??"")+" gdg-input",id:g,ref:f,onKeyDown:w,value:m,placeholder:t,dir:"auto"}))},ci={};let Yn=null;function ca(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function To(e){const t=e.toLowerCase().trim();if(ci[t]!==void 0)return ci[t];Yn=Yn||ca(),Yn.style.color="#000",Yn.style.color=t;const n=getComputedStyle(Yn).color;Yn.style.color="#fff",Yn.style.color=t;const o=getComputedStyle(Yn).color;if(o!==n)return[0,0,0,1];let r=o.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return r.length<4&&r.push(1),r=r.map(i=>Number.isNaN(i)?0:i),ci[t]=r,r}function so(e,t){const[n,o,r]=To(e);return`rgba(${n}, ${o}, ${r}, ${t})`}const nl=new Map;function ol(e,t){const n=`${e}-${t}`,o=nl.get(n);if(o!==void 0)return o;const r=en(e,t);return nl.set(n,r),r}function en(e,t){if(t===void 0)return e;const[n,o,r,i]=To(e);if(i===1)return e;const[l,s,c,u]=To(t),f=i+u*(1-i),m=(i*n+u*l*(1-i))/f,g=(i*o+u*s*(1-i))/f,w=(i*r+u*c*(1-i))/f;return`rgba(${m}, ${g}, ${w}, ${f})`}function Su(e,t,n){if(n<=0)return e;if(n>=1)return t;const o=[...To(e)];o[0]=o[0]*o[3],o[1]=o[1]*o[3],o[2]=o[2]*o[3];const r=[...To(t)];r[0]=r[0]*r[3],r[1]=r[1]*r[3],r[2]=r[2]*r[3];const i=n,l=1-n,s=o[3]*l+r[3]*i,c=Math.floor((o[0]*l+r[0]*i)/s),u=Math.floor((o[1]*l+r[1]*i)/s),f=Math.floor((o[2]*l+r[2]*i)/s);return`rgba(${c}, ${u}, ${f}, ${s})`}function Mu(e){if(e==="transparent")return 0;function t(i){const l=i/255;return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}const[n,o,r]=To(e);return .2126*t(n)+.7152*t(o)+.0722*t(r)}function da(e,t){return vt.useMemo(()=>e.map((n,o)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:o,sticky:o=i.x&&n=i.y&&o=t.span[0]&&n.current.cell[0]<=t.span[1]}function Tl(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&ol)return!1;if(t.span===void 0)return s>=o&&s<=r;const[u,f]=t.span;return u>=o&&u<=r||f>=o&&u<=r||ur}function ha(e,t,n,o){let r=0;if(n.current===void 0)return r;const i=n.current.range;(o||i.height*i.width>1)&&rl(e,t,i)&&r++;for(const l of n.current.rangeStack)rl(e,t,l)&&r++;return r}function zl(e,t){let n=e;if(t!==void 0){let o=[...e];const r=n[t.src];t.src>t.dest?(o.splice(t.src,1),o.splice(t.dest,0,r)):(o.splice(t.dest+1,0,r),o.splice(t.src,1)),o=o.map((i,l)=>({...i,sticky:e[l].sticky})),n=o}return n}function Ao(e,t){let n=0;const o=zl(e,t);for(let r=0;r0)for(const u of l)n-=u.width;let s=t,c=r??0;for(;c<=n&&s=m)return y}const g=i-u,w=e-(c??0);if(typeof l=="number"){const h=Math.floor((w-f)/l)+s;return h>=g?void 0:h}else{let h=f;for(let y=s;y"u";async function ya(){var e;wa||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,zr=0,tr={},$s())}ya();function Bl(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function zo(e,t,n,o="middle"){const r=Bl(e,t,o,n);let i=tr[r];return i===void 0&&(i=t.measureText(e),tr[r]=i,zr++),zr>1e4&&(tr={},zr=0),i}function Ll(e,t){const n=Bl(e,void 0,"middle",t);return tr[n]}function Un(e,t){return typeof t!="string"&&(t=t.baseFontFull),ba(e,t)}function il(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const ll=[];function ba(e,t){for(const i of ll)if(i.key===t)return i.val;const n=il(e,"alphabetic"),r=-(il(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return ll.push({key:t,val:r}),r}function pa(e,t,n,o,r,i){const{ctx:l,rect:s,theme:c}=e;let u=Number.MAX_SAFE_INTEGER;const f=500;if(t!==void 0&&(u=n-t,un&&(e=e.slice(0,n)),e}function Ca(e,t,n,o,r,i,l,s,c,u){const f=s.baseFontFull,m=Os(e,t,f,r-s.cellHorizontalPadding*2,u??!1),g=Wl(e,f),w=s.lineHeight*g,h=g+w*(m.length-1),y=h+s.cellVerticalPadding>i;y&&(e.save(),e.rect(n,o,r,i),e.clip());const C=o+i/2-h/2;let x=Math.max(o+s.cellVerticalPadding,C);for(const v of m)if(Pl(e,v,n,x,r,g,l,s,c),x+=w,x>o+i)break;y&&e.restore()}function Sn(e,t,n,o,r){const{ctx:i,rect:l,theme:s}=e,{x:c,y:u,width:f,height:m}=l;o=o??!1,o||(t=va(t,f));const g=Un(i,s),w=Si(t)==="rtl";if(n===void 0&&w&&(n="right"),w&&(i.direction="rtl"),t.length>0){let h=!1;n==="right"?(i.textAlign="right",h=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,h=!0),o?Ca(i,t,c,u,f,m,g,s,n,r):Pl(i,t,c,u,f,m,g,s,n),h&&(i.textAlign="start"),w&&(i.direction="inherit")}}function Mn(e,t,n,o,r,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,r/2,o/2)),tr:Math.max(0,Math.min(i.tr,r/2,o/2)),bl:Math.max(0,Math.min(i.bl,r/2,o/2)),br:Math.max(0,Math.min(i.br,r/2,o/2))},e.moveTo(t+i.tl,n),e.arcTo(t+o,n,t+o,n+i.tr,i.tr),e.arcTo(t+o,n+r,t+o-i.br,n+r,i.br),e.arcTo(t,n+r,t,n+r-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function xa(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function ka(e,t,n){const o=function(s,c){const u=c.x-s.x,f=c.y-s.y,m=Math.sqrt(u*u+f*f),g=u/m,w=f/m;return{x:u,y:c.y-s.y,len:m,nx:g,ny:w,ang:Math.atan2(w,g)}};let r;const i=t.length;let l=t[i-1];for(let s=0;s1?1:g),y=1,C=!1;w<0?h<0?h=Math.PI+h:(h=Math.PI-h,y=-1,C=!0):h>0&&(y=-1,C=!0),r=c.radius!==void 0?c.radius:n;const x=h/2;let v=Math.abs(Math.cos(x)*r/Math.sin(x)),I;v>Math.min(f.len/2,m.len/2)?(v=Math.min(f.len/2,m.len/2),I=Math.abs(v*Math.sin(x)/Math.cos(x))):I=r;let X=c.x+m.nx*v,N=c.y+m.ny*v;X+=-m.ny*I*y,N+=m.nx*I*y,e.arc(X,N,I,f.ang+Math.PI/2*y,m.ang-Math.PI/2*y,C),l=c,c=u}e.closePath()}function pi(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h){const y={x:0,y:i+u,width:0,height:0};if(e>=w.length||t>=f||t<-2||e<0)return y;const C=i-r;if(e>=m){const x=l>e?-1:1,v=Ao(w);y.x+=v+c;for(let I=l;I!==e;I+=x)y.x+=w[x===1?I:I-1].width*x}else for(let x=0;x0&&rr(w[x-1].group,v)&&w[x-1].sticky===I;){const N=w[x-1];y.x-=N.width,y.width+=N.width,x--}let X=e;for(;X+1n&&(y.width=n-y.x)}}else if(t>=f-g){let x=f-t;for(y.y=o;x>0;){const v=t+x-1;y.height=typeof h=="number"?h:h(v),y.y-=y.height,x--}y.height+=1}else{const x=s>t?-1:1;if(typeof h=="number"){const v=t-s;y.y+=v*h}else for(let v=s;v!==t;v+=x)y.y+=h(v)*x;y.height=(typeof h=="number"?h:h(t))+1}return y}const Mi=1<<21;function bn(e,t){return(t+2)*Mi+e}function $l(e){return e%Mi}function Ri(e){return Math.floor(e/Mi)-2}function Ei(e){const t=$l(e),n=Ri(e);return[t,n]}class Ol{constructor(){Oe(this,"visibleWindow",{x:0,y:0,width:0,height:0});Oe(this,"freezeCols",0);Oe(this,"freezeRows",[]);Oe(this,"isInWindow",t=>{const n=$l(t),o=Ri(t),r=this.visibleWindow,i=n>=r.x&&n<=r.x+r.width||n=r.y&&o<=r.y+r.height||this.freezeRows.includes(o);return i&&l})}setWindow(t,n,o){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Ho(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class Sa extends Ol{constructor(){super(...arguments);Oe(this,"cache",new Map);Oe(this,"setValue",(n,o)=>{this.cache.set(bn(n[0],n[1]),o)});Oe(this,"getValue",n=>this.cache.get(bn(n[0],n[1])));Oe(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class nr{constructor(t=[]){Oe(this,"cells");this.cells=new Set(t.map(n=>bn(n[0],n[1])))}add(t){this.cells.add(bn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(bn(t[0],t[1]))}remove(t){this.cells.delete(bn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Ri(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{const w=Ra(e,g[o],t,c);return u=Math.max(u,w),w});if(f.length>5&&s){u=0;let g=0;for(const h of f)g+=h;const w=g/f.length;for(let h=0;h=w*2?f[h]=0:u=Math.max(u,f[h])}u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const m=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:m}}function Ea(e,t,n,o,r,i,l,s,c){const u=a.useRef(t),f=a.useRef(n),m=a.useRef(l);u.current=t,f.current=n,m.current=l;const[g,w]=a.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);a.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g==null||g.remove()}),[g]);const h=a.useRef({}),y=a.useRef(),[C,x]=a.useState();return a.useLayoutEffect(()=>{const v=f.current;if(v===void 0||e.every(Dr))return;let I=Math.max(1,10-Math.floor(e.length/1e4)),X=0;I1&&(I--,X=1);const N={x:0,y:0,width:e.length,height:Math.min(u.current,I)},A={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const K=v(N,c.signal),S=X>0?v(A,c.signal):void 0;let $;typeof K=="object"?$=K:$=await Ji(K),S!==void 0&&(typeof S=="object"?$=[...$,...S]:$=[...$,...await Ji(S)]),y.current=e,x($)})()},[c.signal,e]),a.useMemo(()=>{let I=e.every(Dr)?e:w===null?e.map(z=>Dr(z)?z:{...z,width:vi}):(w.font=m.current.baseFontFull,e.map((z,K)=>{if(Dr(z))return z;if(h.current[z.id]!==void 0)return{...z,width:h.current[z.id]};if(C===void 0||y.current!==e||z.id===void 0)return{...z,width:vi};const S=Gl(w,l,z,K,C,r,i,!0,s);return h.current[z.id]=S.width,S})),X=0,N=0;const A=[];for(const[z,K]of I.entries())X+=K.width,K.grow!==void 0&&K.grow>0&&(N+=K.grow,A.push(z));if(X0){const z=[...I],K=o-X;let S=K;for(let $=0;${const t=e.fgColor,n=e.bgColor;return` - ${dt}`},Da=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt}`},Fa=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - `},Ha=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},Ta=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},Kl=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - - - `},Aa=e=>{const t=e.bgColor;return`${dt} - - - - -`},za=Kl,Ba=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},La=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - - - - - - `},Pa=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - -`},Wa=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},$a=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},Oa=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},Na=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - - `},Xa=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - -`},Ya=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - - `},Ga=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},Ka=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},Ua=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},Va=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},_a=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - - - -`},qa=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},ja=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},Za=e=>{const t=e.fgColor,n=e.bgColor;return` - ${dt} - - - `},Ja=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - - -`},Qa=e=>{const t=e.fgColor,n=e.bgColor;return`${dt} - - -`},ec=e=>{const t=e.fgColor;return` - - - `},tc=e=>{const t=e.fgColor;return` - - - -`},nc={headerRowID:Ia,headerNumber:Fa,headerCode:Da,headerString:Ha,headerBoolean:Ta,headerAudioUri:za,headerVideoUri:Ba,headerEmoji:La,headerImage:Pa,headerUri:Kl,headerPhone:Wa,headerMarkdown:$a,headerDate:Oa,headerTime:Na,headerEmail:Xa,headerReference:Ya,headerIfThenElse:Ga,headerSingleValue:Ka,headerLookup:Ua,headerTextTemplate:Va,headerMath:_a,headerRollup:qa,headerJoinStrings:ja,headerSplitString:Za,headerGeoDistance:Ja,headerArray:Qa,rowOwnerOverlay:ec,protectedColumnOverlay:tc,renameIcon:Aa};function oc(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class rc{constructor(t,n){Oe(this,"onSettled");Oe(this,"spriteMap",new Map);Oe(this,"headerIcons");Oe(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,o,r,i,l,s,c=1){const[u,f]=oc(n,s),m=l*Math.ceil(window.devicePixelRatio),g=`${u}_${f}_${m}_${t}`;let w=this.spriteMap.get(g);if(w===void 0){const h=this.headerIcons[t];if(h===void 0)return;w=document.createElement("canvas");const y=w.getContext("2d");if(y===null)return;const C=new Image;C.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h({fgColor:f,bgColor:u}))}`,this.spriteMap.set(g,w);const x=C.decode();if(x===void 0)return;this.inFlight++,x.then(()=>{y.drawImage(C,0,0,m,m)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else c<1&&(o.globalAlpha=c),o.drawImage(w,0,0,m,m,r,i,l,l),c<1&&(o.globalAlpha=1)}}function Ul(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Xr(e,t,n,o,r,i,l,s,c){s=s??t;let u=t,f=e;const m=o-i;let g=!1;for(;us&&c(u,f,w,!1,l&&f===o-1)===!0){g=!0;break}u+=w,f++}if(!g){u=n;for(let w=0;w!w.sticky))==null?void 0:g.sourceIndex)??0;if(c>m){const w=Math.max(s,m);let h=t,y=o;for(let C=i.sourceIndex-1;C>=w;C--)h-=l[C].width,y+=l[C].width;for(let C=i.sourceIndex+1;C<=c;C++)y+=l[C].width;f={x:h,y:n,width:y,height:r}}if(m>s){const w=Math.min(c,m-1);let h=t,y=o;for(let C=i.sourceIndex-1;C>=s;C--)h-=l[C].width,y+=l[C].width;for(let C=i.sourceIndex+1;C<=w;C++)y+=l[C].width;u={x:h,y:n,width:y,height:r}}return[u,f]}function ic(e,t,n,o){if(o==="any")return ql(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),Tl([t,n],e))return;const r=t-e.x,i=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,c=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="horizontal"?Number.MAX_SAFE_INTEGER:l,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return c===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:c===l?{x:e.x,y:n,width:e.width,height:e.y-n}:c===i?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ir(e,t,n,o,r,i,l,s){return e<=r+l&&r<=e+n&&t<=i+s&&i<=t+o}function lo(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function ql(e,t){const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-o;return{x:n,y:o,width:r,height:i}}function lc(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function sc(e,t,n,o){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const r=-4,i=-4,l=t+4,s=n+4,c=r-e.x,u=e.x+e.width-l,f=i-e.y,m=e.y+e.height-s,g=c>0?e.x+Math.floor(c/o)*o:e.x,w=u>0?e.x+e.width-Math.floor(u/o)*o:e.x+e.width,h=f>0?e.y+Math.floor(f/o)*o:e.y,y=m>0?e.y+e.height-Math.floor(m/o)*o:e.y+e.height;return{x:g,y:h,width:w-g,height:y-h}}function ac(e,t,n,o,r){const[i,l,s,c]=t,[u,f,m,g]=r,{x:w,y:h,width:y,height:C}=e,x=[];if(y<=0||C<=0)return x;const v=w+y,I=h+C,X=ws,z=h+C>c,K=w>=i&&wi&&v<=s||ws,S=h>=l&&hl&&I<=c||hc;if(K&&S){const W=Math.max(w,i),D=Math.max(h,l),R=Math.min(v,s),M=Math.min(I,c);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:u,y:f,width:m-u+1,height:g-f+1}})}if(X&&N){const W=w,D=h,R=Math.min(v,i),M=Math.min(I,l);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:0,width:u+1,height:f+1}})}if(N&&K){const W=Math.max(w,i),D=h,R=Math.min(v,s),M=Math.min(I,l);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:u,y:0,width:m-u+1,height:f+1}})}if(N&&A){const W=Math.max(w,s),D=h,R=v,M=Math.min(I,l);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:m,y:0,width:n-m+1,height:f+1}})}if(X&&S){const W=w,D=Math.max(h,l),R=Math.min(v,i),M=Math.min(I,c);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:f,width:u+1,height:g-f+1}})}if(A&&S){const W=Math.max(w,s),D=Math.max(h,l),R=v,M=Math.min(I,c);x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:m,y:f,width:n-m+1,height:g-f+1}})}if(X&&z){const W=w,D=Math.max(h,c),R=Math.min(v,i),M=I;x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:0,y:g,width:u+1,height:o-g+1}})}if(z&&K){const W=Math.max(w,i),D=Math.max(h,c),R=Math.min(v,s),M=I;x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:u,y:g,width:m-u+1,height:o-g+1}})}if(A&&z){const W=Math.max(w,s),D=Math.max(h,c),R=v,M=I;x.push({rect:{x:W,y:D,width:R-W,height:M-D},clip:{x:m,y:g,width:n-m+1,height:o-g+1}})}return x}const cc={kind:j.Loading,allowOverlay:!1};function sl(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x,v,I,X,N,A,z,K,S,$,W,D,R,M,re,te,ce,Ce){let Fe=(I==null?void 0:I.size)??Number.MAX_SAFE_INTEGER;const _=performance.now();let V=R.baseFontFull;e.font=V;const xe={ctx:e},ne=[0,0],be=C>0?ao(c,C,u):0;let pe,U;const ke=Ul(v);return Vn(t,s,i,l,r,(ve,je,nt,mt,et)=>{const Ae=Math.max(0,mt-je),Ve=je+Ae,Re=r+1,ut=ve.width-Ae,rt=o-r-1;if(v.length>0){let Ne=!1;for(let Te=0;Te{e.save(),e.beginPath(),e.rect(Ve,Re,ut,rt),e.clip()},ie=X.columns.hasIndex(ve.sourceIndex),We=m(ve.group??"").overrideTheme,De=ve.themeOverride===void 0&&We===void 0?R:Tn(R,We,ve.themeOverride),Ie=De.baseFontFull;Ie!==V&&(V=Ie,e.font=Ie),it();let fe;return Xr(et,nt,o,c,u,C,x,ke,(Ne,Te,_e,oe,He)=>{var En,nn,Bt;if(Te<0||(ne[0]=ve.sourceIndex,ne[1]=Te,I!==void 0&&!I.has(ne)))return;if(v.length>0){let Ue=!1;for(let Mt=0;MtKe.span!==void 0&&Ue>=Ke.span[0]&&Ue<=Ke.span[1]);It&&!h&&y?Dt=0:It&&y&&(Dt=Math.max(Dt,1)),An&&Dt++,It||(tt&&Dt++,ie&&!He&&Dt++);const zn=Ke.kind===j.Protected?wt.bgCellMedium:wt.bgCell;let ct;if((oe||zn!==R.bgCell)&&(ct=en(zn,ct)),Dt>0||$e){$e&&(ct=en(wt.bgHeader,ct));for(let Ue=0;UeCe&&!Ct){const Ue=wt.baseFontFull;Ue!==V&&(e.font=Ue,V=Ue),fe=jl(e,Ke,ve.sourceIndex,Te,Pe,Ze,ft,Ne,Xe,_e,Dt>0,wt,ct??wt.bgCell,z,K,(zt==null?void 0:zt.hoverAmount)??0,$,D,_,W,fe,M,re,te,ce)}return Rn&&e.restore(),Ke.style==="faded"&&(e.globalAlpha=1),Fe--,ze&&(e.restore(),(Bt=fe==null?void 0:fe.deprep)==null||Bt.call(fe,xe),fe=void 0,it(),V=Ie,e.font=Ie),Fe<=0}),e.restore(),Fe<=0}),pe}const qo=[0,0],jo={x:0,y:0,width:0,height:0},di=[void 0,()=>{}];let Ci=!1;function dc(){Ci=!0}function jl(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x,v,I,X,N,A,z,K){var re,te;let S,$;C!==void 0&&C[0][0]===n&&C[0][1]===o&&(S=C[1][0],$=C[1][1]);let W;qo[0]=n,qo[1]=o,jo.x=l,jo.y=s,jo.width=c,jo.height=u,di[0]=A.getValue(qo),di[1]=ce=>A.setValue(qo,ce),Ci=!1;const D={ctx:e,theme:m,col:n,row:o,cell:t,rect:jo,highlighted:f,cellFillColor:g,hoverAmount:y,frameTime:v,hoverX:S,drawState:di,hoverY:$,imageLoader:w,spriteManager:h,hyperWrapping:x,overrideCursor:S!==void 0?K:void 0,requestAnimationFrame:dc},R=pa(D,t.lastUpdated,v,X,r,i),M=z(t);if(M!==void 0){(X==null?void 0:X.renderer)!==M&&((re=X==null?void 0:X.deprep)==null||re.call(X,D),X=void 0);const ce=(te=M.drawPrep)==null?void 0:te.call(M,D,X);I!==void 0&&!Do(D.cell)?I(D,()=>M.draw(D,t)):M.draw(D,t),W=ce===void 0?void 0:{deprep:ce==null?void 0:ce.deprep,fillStyle:ce==null?void 0:ce.fillStyle,font:ce==null?void 0:ce.font,renderer:M}}return(R||Ci)&&(N==null||N(qo)),W}function Ii(e,t,n,o,r,i,l,s,c=-20,u=-20,f=32,m="center",g="square"){const w=Math.floor(r+l/2),h=g==="circle"?1e4:t.roundingRadius??4;let y=Dl(f,l,t.cellVerticalPadding),C=y/2;const x=Il(m,o,i,t.cellHorizontalPadding,y),v=El(x,w,y),I=Fl(o+c,r+u,v);switch(n){case!0:{e.beginPath(),Mn(e,x-y/2,w-y/2,y,y,h),g==="circle"&&(C*=.8,y*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(x-C+y/4.23,w-C+y/1.97),e.lineTo(x-C+y/2.42,w-C+y/1.44),e.lineTo(x-C+y/1.29,w-C+y/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case Br:case!1:{e.beginPath(),Mn(e,x-y/2+.5,w-y/2+.5,y-1,y-1,h),e.lineWidth=1,e.strokeStyle=I?t.textDark:t.textMedium,e.stroke();break}case xi:{e.beginPath(),Mn(e,x-y/2,w-y/2,y,y,h),e.fillStyle=I?t.textMedium:t.textLight,e.fill(),g==="circle"&&(C*=.8,y*=.8),e.beginPath(),e.moveTo(x-y/3,w),e.lineTo(x+y/3,w),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:or()}}function uc(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x,v){var S,$,W,D;const I=l+s;if(I<=0)return;e.fillStyle=m.bgHeader,e.fillRect(0,0,r,I);const X=(S=o==null?void 0:o[0])==null?void 0:S[0],N=($=o==null?void 0:o[0])==null?void 0:$[1],A=(W=o==null?void 0:o[1])==null?void 0:W[0],z=(D=o==null?void 0:o[1])==null?void 0:D[1],K=m.headerFontFull;e.font=K,Vn(t,0,i,0,I,(R,M,re,te)=>{var ve;if(C!==void 0&&!C.has([R.sourceIndex,-1]))return;const ce=Math.max(0,te-M);e.save(),e.beginPath(),e.rect(M+ce,s,R.width-ce,l),e.clip();const Ce=y(R.group??"").overrideTheme,Fe=R.themeOverride===void 0&&Ce===void 0?m:Tn(m,Ce,R.themeOverride);Fe.bgHeader!==m.bgHeader&&(e.fillStyle=Fe.bgHeader,e.fill()),Fe!==m&&(e.font=Fe.baseFontFull);const _=f.columns.hasIndex(R.sourceIndex),V=c!==void 0||u,xe=!V&&N===-1&&X===R.sourceIndex,ne=V?0:((ve=w.find(je=>je.item[0]===R.sourceIndex&&je.item[1]===-1))==null?void 0:ve.hoverAmount)??0,be=(f==null?void 0:f.current)!==void 0&&f.current.cell[0]===R.sourceIndex,pe=_?Fe.accentColor:be?Fe.bgHeaderHasFocus:Fe.bgHeader,U=n?s:0,ke=R.sourceIndex===0?0:1;_?(e.fillStyle=pe,e.fillRect(M+ke,U,R.width-ke,l)):(be||ne>0)&&(e.beginPath(),e.rect(M+ke,U,R.width-ke,l),be&&(e.fillStyle=Fe.bgHeaderHasFocus,e.fill()),ne>0&&(e.globalAlpha=ne,e.fillStyle=Fe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Ql(e,M,U,R.width,l,R,_,Fe,xe,xe?A:void 0,xe?z:void 0,be,ne,g,x,v),e.restore()}),n&&fc(e,t,r,i,s,o,m,g,w,h,y,C)}function fc(e,t,n,o,r,i,l,s,c,u,f,m){const[w,h]=(i==null?void 0:i[0])??[];let y=0;Vl(t,n,o,r,(C,x,v,I,X,N)=>{if(m!==void 0&&!m.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,I,X,N),e.clip();const A=f(x),z=(A==null?void 0:A.overrideTheme)===void 0?l:Tn(l,A.overrideTheme),K=h===-2&&w!==void 0&&w>=C[0]&&w<=C[1],S=K?z.bgHeaderHovered:z.bgHeader;if(S!==l.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=z.textGroupHeader??z.textHeader,A!==void 0){let $=v;if(A.icon!==void 0&&(s.drawSprite(A.icon,"normal",e,$+8,(r-20)/2,20,z),$+=26),e.fillText(A.name,$+8,r/2+Un(e,l.headerFontFull)),A.actions!==void 0&&K){const W=Zl({x:v,y:I,width:X,height:N},A.actions);e.beginPath();const D=W[0].x-10,R=v+X-D;e.rect(D,0,R,r);const M=e.createLinearGradient(D,0,D+R,0),re=so(S,0);M.addColorStop(0,re),M.addColorStop(10/R,S),M.addColorStop(1,S),e.fillStyle=M,e.fill(),e.globalAlpha=.6;const[te,ce]=(i==null?void 0:i[1])??[-1,-1];for(let Ce=0;Ce35){const I=h?35:o-35,X=h?35*.7:o-35*.7,N=I/o,A=X/o,z=e.createLinearGradient(t,0,t+o,0),K=so(C,0);z.addColorStop(h?1:0,C),z.addColorStop(N,C),z.addColorStop(A,K),z.addColorStop(h?0:1,K),e.fillStyle=z}else e.fillStyle=C;if(h&&(e.textAlign="right"),y.textBounds!==void 0&&e.fillText(i.title,h?y.textBounds.x+y.textBounds.width:y.textBounds.x,n+r/2+Un(e,s.headerFontFull)),h&&(e.textAlign="left"),i.indicatorIcon!==void 0&&y.indicatorIconBounds!==void 0&&(!x||!ir(y.menuBounds.x,y.menuBounds.y,y.menuBounds.width,y.menuBounds.height,y.indicatorIconBounds.x,y.indicatorIconBounds.y,y.indicatorIconBounds.width,y.indicatorIconBounds.height))){let v=l?"selected":"normal";i.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(i.indicatorIcon,v,e,y.indicatorIconBounds.x,y.indicatorIconBounds.y,y.indicatorIconBounds.width,s)}if(x&&y.menuBounds!==void 0){const v=y.menuBounds,I=u!==void 0&&f!==void 0&&lo(v,u+t,f+n);if(I||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===Lr.Triangle){e.beginPath();const X=v.x+v.width/2-5.5,N=v.y+v.height/2-3;ka(e,[{x:X,y:N},{x:X+11,y:N},{x:X+5.5,y:N+6}],1),e.fillStyle=C,e.fill()}else if(i.menuIcon===Lr.Dots){e.beginPath();const X=v.x+v.width/2,N=v.y+v.height/2;xa(e,X,N),e.fillStyle=C,e.fill()}else{const X=v.x+(v.width-s.headerIconSize)/2,N=v.y+(v.height-s.headerIconSize)/2;g.drawSprite(i.menuIcon,"normal",e,X,N,s.headerIconSize,s)}I||(e.globalAlpha=1)}}function Ql(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y){const C=Si(i.title)==="rtl",x=Jl(e,i,t,n,o,r,s,C);h!==void 0?h({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:r},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:g,isHovered:c,hasSelectedCell:m,spriteManager:w,menuBounds:(x==null?void 0:x.menuBounds)??{x:0,y:0,height:0,width:0}},()=>al(e,t,n,o,r,i,l,s,c,u,f,g,w,y,C,x)):al(e,t,n,o,r,i,l,s,c,u,f,g,w,y,C,x)}function gc(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x,v){if(x!==void 0||t[t.length-1]!==n[t.length-1])return;const I=Ul(C);Vn(t,c,l,s,i,(X,N,A,z,K)=>{if(X!==t[t.length-1])return;N+=X.width;const S=Math.max(N,z);S>o||(e.save(),e.beginPath(),e.rect(S,i+1,1e4,r-i-1),e.clip(),Xr(K,A,r,u,f,h,y,I,($,W,D,R)=>{if(!R&&C.length>0&&!C.some(Ce=>ir(N,$,1e4,D,Ce.x,Ce.y,Ce.width,Ce.height)))return;const M=g.hasIndex(W),re=w.hasIndex(W);e.beginPath();const te=m==null?void 0:m(W),ce=te===void 0?v:Tn(v,te);ce.bgCell!==v.bgCell&&(e.fillStyle=ce.bgCell,e.fillRect(N,$,1e4,D)),re&&(e.fillStyle=ce.bgHeader,e.fillRect(N,$,1e4,D)),M&&(e.fillStyle=ce.accentLight,e.fillRect(N,$,1e4,D))}),e.restore())})}function mc(e,t,n,o,r,i,l,s,c){let u=!1;for(const h of t)if(!h.sticky){u=l(h.sourceIndex);break}const f=c.horizontalBorderColor??c.borderColor,m=c.borderColor,g=u?Ao(t):0;let w;if(g!==0&&(w=ol(m,c.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,o),e.strokeStyle=w,e.stroke()),r>0){const h=m===f&&w!==void 0?w:ol(f,c.bgCell),y=ao(i,r,s);e.beginPath(),e.moveTo(0,o-y+.5),e.lineTo(n,o-y+.5),e.strokeStyle=h,e.stroke()}}const es=(e,t,n)=>{let o=0,r=t,i=0,l=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)o=Math.min(o,s.x-1),r=Math.max(r,s.x+s.width+1),i=Math.min(i,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:o,maxX:r,minY:i,maxY:l}};function wc(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h){var D;const y=h.bgCell,{minX:C,maxX:x,minY:v,maxY:I}=es(s,i,l),X=[],N=l-ao(w,g,u);let A=c,z=n,K=0;for(;A+r=v&&R<=I-1){const re=f==null?void 0:f(z),te=re==null?void 0:re.bgCell;te!==void 0&&te!==y&&z>=w-g&&X.push({x:C,y:R,w:x-C,h:M,color:te})}A+=M,z0)for(let R=0;R=C&&re<=x&&m(R+1)&&X.push({x:re,y:K,w:M.width,h:$,color:te}),S+=M.width}if(X.length===0)return;let W;e.beginPath();for(let R=X.length-1;R>=0;R--){const M=X[R];W===void 0?W=M.color:M.color!==W&&(e.fillStyle=W,e.fill(),e.beginPath(),W=M.color),e.rect(M.x,M.y,M.w,M.h)}W!==void 0&&(e.fillStyle=W,e.fill()),e.beginPath()}function cl(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const D of c)e.rect(D.x+1,D.y+1,D.width-1,D.height-1);e.clip("evenodd")}const v=C.horizontalBorderColor??C.borderColor,I=C.borderColor,{minX:X,maxX:N,minY:A,maxY:z}=es(s,i,l),K=[];e.beginPath();let S=.5;for(let D=0;D=X&&M<=N&&w(D+1)&&K.push({x1:M,y1:Math.max(u,A),x2:M,y2:Math.min(l,z),color:I})}let $=l+.5;for(let D=y-h;D=A&&re<=z-1){const te=g==null?void 0:g(R);K.push({x1:X,y1:re,x2:N,y2:re,color:(te==null?void 0:te.horizontalBorderColor)??(te==null?void 0:te.borderColor)??v})}D+=m(R),R++}}const W=Ns(K,D=>D.color);for(const D of Object.keys(W)){e.strokeStyle=D;for(const R of W[D])e.moveTo(R.x1,R.y1),e.lineTo(R.x2,R.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}function yc(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C,x,v){const I=[];e.imageSmoothingEnabled=!1;const X=Math.min(r.cellYOffset,l),N=Math.max(r.cellYOffset,l);let A=0;if(typeof x=="number")A+=(N-X)*x;else for(let M=X;Mr.cellYOffset&&(A=-A),A+=c-r.translateY;const z=Math.min(r.cellXOffset,i),K=Math.max(r.cellXOffset,i);let S=0;for(let M=z;Mr.cellXOffset&&(S=-S),S+=s-r.translateX;const $=Ao(C);if(S!==0&&A!==0)return{regions:[]};const W=u>0?ao(g,u,x):0,D=f-$-Math.abs(S),R=m-w-W-Math.abs(A)-1;if(D>150&&R>150){const M={sx:0,sy:0,sw:f*h,sh:m*h,dx:0,dy:0,dw:f*h,dh:m*h};if(A>0?(M.sy=(w+1)*h,M.sh=R*h,M.dy=(A+w+1)*h,M.dh=R*h,I.push({x:0,y:w,width:f,height:A+1})):A<0&&(M.sy=(-A+w+1)*h,M.sh=R*h,M.dy=(w+1)*h,M.dh=R*h,I.push({x:0,y:m+A-W,width:f,height:-A+W})),S>0?(M.sx=$*h,M.sw=D*h,M.dx=(S+$)*h,M.dw=D*h,I.push({x:$-1,y:0,width:S+2,height:m})):S<0&&(M.sx=($-S)*h,M.sw=D*h,M.dx=$*h,M.dw=D*h,I.push({x:f+S,y:0,width:-S,height:m})),e.setTransform(1,0,0,1,0,0),v){if($>0&&S!==0&&A===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const re=$*h,te=m*h;e.drawImage(t,0,0,re,te,0,0,re,te)}if(W>0&&S===0&&A!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const re=(m-W)*h,te=f*h,ce=W*h;e.drawImage(t,0,re,te,ce,0,re,te,ce)}}e.drawImage(t,M.sx,M.sy,M.sw,M.sh,M.dx,M.dy,M.dw,M.dh),e.scale(h,h)}return e.imageSmoothingEnabled=!0,{regions:I}}function bc(e,t,n,o,r,i,l,s,c,u){const f=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||r!==e.translateY||Vn(c,n,o,r,s,(m,g,w,h)=>{if(m.sourceIndex===u){const y=Math.max(g,h)+1;return f.push({x:y,y:0,width:i-y,height:l}),!0}}),f}function pc(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let o=0;oz.style!=="no-outline");if(C===void 0||C.length===0)return;const x=Ao(s),v=ao(w,g,m),I=[c,0,s.length,w-g],X=[x,0,t,n-v],N=C.map(z=>{const K=z.range,S=z.style??"dashed";return ac(K,I,t,n,X).map($=>{const W=$.rect,D=pi(W.x,W.y,t,n,f,u+f,o,r,i,l,w,c,g,s,m),R=W.width===1&&W.height===1?D:pi(W.x+W.width-1,W.y+W.height-1,t,n,f,u+f,o,r,i,l,w,c,g,s,m);return W.x+W.width>=s.length&&(R.width-=1),W.y+W.height>=w&&(R.height-=1),{color:z.color,style:S,clip:$.clip,rect:sc({x:D.x,y:D.y,width:R.x+R.width-D.x,height:R.y+R.height-D.y},t,n,8)}})}),A=()=>{e.lineWidth=1;let z=!1;for(const K of N)for(const S of K)if((S==null?void 0:S.rect)!==void 0&&ir(0,0,t,n,S.rect.x,S.rect.y,S.rect.width,S.rect.height)){const $=z,W=!lc(S.clip,S.rect);W&&(e.save(),e.rect(S.clip.x,S.clip.y,S.clip.width,S.clip.height),e.clip()),S.style==="dashed"&&!z?(e.setLineDash([5,3]),z=!0):(S.style==="solid"||S.style==="solid-outline")&&z&&(e.setLineDash([]),z=!1),e.strokeStyle=S.style==="solid-outline"?en(en(S.color,y.borderColor),y.bgCell):so(S.color,1),e.strokeRect(S.rect.x+.5,S.rect.y+.5,S.rect.width-1,S.rect.height-1),W&&(e.restore(),z=$)}z&&e.setLineDash([])};return A(),A}function ul(e,t,n,o,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,o),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function ui(e,t,n,o,r,i,l,s,c,u,f,m,g,w,h,y,C){if(f.current===void 0)return;const x=f.current.range,v=f.current.cell,I=[x.x+x.width-1,x.y+x.height-1];if(v[1]>=C&&I[1]>=C||!l.some(M=>M.sourceIndex===v[0]||M.sourceIndex===I[0]))return;const[N,A]=f.current.cell,z=g(f.current.cell),K=z.span??[N,N],S=A>=C-w,$=w>0&&!S?ao(C,w,m)-1:0,W=I[1];let D;if(Vn(l,o,r,i,u,(M,re,te,ce,Ce)=>{if(M.sticky&&N>M.sourceIndex)return;const Fe=M.sourceIndexK[1],V=M.sourceIndex===I[0];if(!(!V&&(Fe||_)))return Xr(Ce,te,n,C,m,w,h,void 0,(xe,ne,be)=>{if(ne!==A&&ne!==W)return;let pe=re,U=M.width;if(z.span!==void 0){const ve=_l(z.span,re,xe,M.width,be,M,s),je=M.sticky?ve[0]:ve[1];je!==void 0&&(pe=je.x,U=je.width)}return ne===W&&V&&y&&(D=()=>{var ve;ce>pe&&!M.sticky&&(e.beginPath(),e.rect(ce,0,t-ce,n),e.clip()),e.beginPath(),e.rect(pe+U-4,xe+be-4,4,4),e.fillStyle=((ve=M.themeOverride)==null?void 0:ve.accentColor)??c.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;const R=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-$),e.clip(),D==null||D(),e.restore()};return R(),R}function vc(e,t,n,o,r,i,l,s,c){c===void 0||c.size===0||(e.beginPath(),Vl(t,n,i,o,(u,f,m,g,w,h)=>{c.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(m,g,w,h)}),Vn(t,s,i,l,r,(u,f,m,g)=>{const w=Math.max(0,g-f),h=f+w+1,y=u.width-w-1;c.has([u.sourceIndex,-1])&&e.rect(h,o,y,r-o)}),e.clip())}function Cc(e,t,n,o,r,i,l,s,c,u){let f=0;return Vn(e,i,o,r,n,(m,g,w,h,y)=>(Xr(y,w,t,l,s,c,u,void 0,(C,x,v,I)=>{I||(f=Math.max(x,f))}),!0)),f}function fl(e,t){var Pe;const{canvasCtx:n,headerCanvasCtx:o,width:r,height:i,cellXOffset:l,cellYOffset:s,translateX:c,translateY:u,mappedColumns:f,enableGroups:m,freezeColumns:g,dragAndDropState:w,theme:h,drawFocus:y,headerHeight:C,groupHeaderHeight:x,disabledRows:v,rowHeight:I,verticalBorder:X,overrideCursor:N,isResizing:A,selection:z,fillHandle:K,freezeTrailingRows:S,rows:$,getCellContent:W,getGroupDetails:D,getRowThemeOverride:R,isFocused:M,drawHeaderCallback:re,prelightCells:te,drawCellCallback:ce,highlightRegions:Ce,resizeCol:Fe,imageLoader:_,lastBlitData:V,hoverValues:xe,hyperWrapping:ne,hoverInfo:be,spriteManager:pe,maxScaleFactor:U,hasAppendRow:ke,touchMode:ve,enqueue:je,renderStateProvider:nt,getCellRenderer:mt,renderStrategy:et,bufferACtx:Ae,bufferBCtx:Ve,damage:Re,minimumCellWidth:ut,resizeIndicator:rt}=e;if(r===0||i===0)return;const it=et==="double-buffer",ie=Math.min(U,Math.ceil(window.devicePixelRatio??1)),We=et!=="direct"&&pc(e,t),De=n.canvas;(De.width!==r*ie||De.height!==i*ie)&&(De.width=r*ie,De.height=i*ie,De.style.width=r+"px",De.style.height=i+"px");const Ie=o.canvas,fe=m?x+C:C,Ne=fe+1;(Ie.width!==r*ie||Ie.height!==Ne*ie)&&(Ie.width=r*ie,Ie.height=Ne*ie,Ie.style.width=r+"px",Ie.style.height=Ne+"px");const Te=Ae.canvas,_e=Ve.canvas;it&&(Te.width!==r*ie||Te.height!==i*ie)&&(Te.width=r*ie,Te.height=i*ie,V.current!==void 0&&(V.current.aBufferScroll=void 0)),it&&(_e.width!==r*ie||_e.height!==i*ie)&&(_e.width=r*ie,_e.height=i*ie,V.current!==void 0&&(V.current.bBufferScroll=void 0));const oe=V.current;if(We===!0&&l===(oe==null?void 0:oe.cellXOffset)&&s===(oe==null?void 0:oe.cellYOffset)&&c===(oe==null?void 0:oe.translateX)&&u===(oe==null?void 0:oe.translateY))return;let He=null;it&&(He=n);const tt=o;let $e;it?Re!==void 0?$e=(oe==null?void 0:oe.lastBuffer)==="b"?Ve:Ae:$e=(oe==null?void 0:oe.lastBuffer)==="b"?Ae:Ve:$e=n;const Ke=$e.canvas,ft=it?Ke===Te?_e:Te:De,Xe=typeof I=="number"?()=>I:I;tt.save(),$e.save(),tt.beginPath(),$e.beginPath(),tt.textBaseline="middle",$e.textBaseline="middle",ie!==1&&(tt.scale(ie,ie),$e.scale(ie,ie));const ze=bi(f,l,r,w,c);let Ct=[];const xt=y&&((Pe=z.current)==null?void 0:Pe.cell[1])===s&&u===0;let Xt=!1;if(Ce!==void 0){for(const Ze of Ce)if(Ze.style!=="no-outline"&&Ze.range.y===s&&u===0){Xt=!0;break}}const wt=()=>{uc(tt,ze,m,be,r,c,C,x,w,A,z,h,pe,xe,X,D,Re,re,ve),cl(tt,ze,s,c,u,r,i,void 0,void 0,x,fe,Xe,R,X,S,$,h,!0),tt.beginPath(),tt.moveTo(0,Ne-.5),tt.lineTo(r,Ne-.5),tt.strokeStyle=en(h.headerBottomBorderColor??h.horizontalBorderColor??h.borderColor,h.bgHeader),tt.stroke(),Xt&&dl(tt,r,i,l,s,c,u,f,g,C,x,I,S,$,Ce,h),xt&&ui(tt,r,i,s,c,u,ze,f,h,fe,z,Xe,W,S,ke,K,$)};if(Re!==void 0){const Ze=ze[ze.length-1].sourceIndex+1,zt=Re.hasItemInRegion([{x:l,y:-2,width:Ze,height:2},{x:l,y:s,width:Ze,height:300},{x:0,y:s,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:$-S,width:Ze,height:S,when:S>0}]),En=nn=>{sl(nn,ze,f,i,fe,c,u,s,$,Xe,W,D,R,v,M,y,S,ke,Ct,Re,z,te,Ce,_,pe,xe,be,ce,ne,h,je,nt,mt,N,ut);const Bt=z.current;K&&y&&Bt!==void 0&&Re.has(Al(Bt.range))&&ui(nn,r,i,s,c,u,ze,f,h,fe,z,Xe,W,S,ke,K,$)};zt&&(En($e),He!==null&&(He.save(),He.scale(ie,ie),He.textBaseline="middle",En(He),He.restore()),Re.hasHeader()&&(vc(tt,ze,r,x,fe,c,u,s,Re),wt())),$e.restore(),tt.restore();return}if((We!==!0||l!==(oe==null?void 0:oe.cellXOffset)||c!==(oe==null?void 0:oe.translateX)||xt!==(oe==null?void 0:oe.mustDrawFocusOnHeader)||Xt!==(oe==null?void 0:oe.mustDrawHighlightRingsOnHeader))&&wt(),We===!0){Qt(ft!==void 0&&oe!==void 0);const{regions:Ze}=yc($e,ft,ft===Te?oe.aBufferScroll:oe.bBufferScroll,ft===Te?oe.bBufferScroll:oe.aBufferScroll,oe,l,s,c,u,S,r,i,$,fe,ie,f,ze,I,it);Ct=Ze}else We!==!1&&(Qt(oe!==void 0),Ct=bc(oe,l,s,c,u,r,i,fe,ze,We));mc($e,ze,r,i,S,$,X,Xe,h);const It=dl($e,r,i,l,s,c,u,f,g,C,x,I,S,$,Ce,h),Dt=y?ui($e,r,i,s,c,u,ze,f,h,fe,z,Xe,W,S,ke,K,$):void 0;if($e.fillStyle=h.bgCell,Ct.length>0){$e.beginPath();for(const Ze of Ct)$e.rect(Ze.x,Ze.y,Ze.width,Ze.height);$e.clip(),$e.fill(),$e.beginPath()}else $e.fillRect(0,0,r,i);const An=sl($e,ze,f,i,fe,c,u,s,$,Xe,W,D,R,v,M,y,S,ke,Ct,Re,z,te,Ce,_,pe,xe,be,ce,ne,h,je,nt,mt,N,ut);gc($e,ze,f,r,i,fe,c,u,s,$,Xe,R,z.rows,v,S,ke,Ct,Re,h),wc($e,ze,s,c,u,r,i,Ct,fe,Xe,R,X,S,$,h),cl($e,ze,s,c,u,r,i,Ct,An,x,fe,Xe,R,X,S,$,h),It==null||It(),Dt==null||Dt(),A&&rt!=="none"&&Vn(ze,0,c,0,fe,(Ze,zt)=>Ze.sourceIndex===Fe?(ul(tt,zt+Ze.width,0,fe+1,en(h.resizeIndicatorColor??h.accentLight,h.bgHeader)),rt==="full"&&ul($e,zt+Ze.width,fe,i,en(h.resizeIndicatorColor??h.accentLight,h.bgCell)),!0):!1),He!==null&&(He.fillStyle=h.bgCell,He.fillRect(0,0,r,i),He.drawImage($e.canvas,0,0));const zn=Cc(ze,i,fe,c,u,s,$,Xe,S,ke);_==null||_.setWindow({x:l,y:s,width:ze.length,height:zn-s},g,Array.from({length:S},(Ze,zt)=>$-1-zt));const ct=oe!==void 0&&(l!==oe.cellXOffset||c!==oe.translateX),Rn=oe!==void 0&&(s!==oe.cellYOffset||u!==oe.translateY);V.current={cellXOffset:l,cellYOffset:s,translateX:c,translateY:u,mustDrawFocusOnHeader:xt,mustDrawHighlightRingsOnHeader:Xt,lastBuffer:it?Ke===Te?"a":"b":void 0,aBufferScroll:Ke===Te?[ct,Rn]:oe==null?void 0:oe.aBufferScroll,bBufferScroll:Ke===_e?[ct,Rn]:oe==null?void 0:oe.bBufferScroll},$e.restore(),tt.restore()}const xc=80;function kc(e){const t=e-1;return t*t*t+1}class Sc{constructor(t){Oe(this,"callback");Oe(this,"currentHoveredItem");Oe(this,"leavingItems",[]);Oe(this,"lastAnimationTime");Oe(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>er(o.item,t.item))||this.leavingItems.push(t)});Oe(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>er(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});Oe(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});Oe(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});Oe(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:kc(t.hoverAmount)})));Oe(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/xc;for(const i of this.leavingItems)i.hoverAmount=sn(i.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=sn(this.currentHoveredItem.hoverAmount+o,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});Oe(this,"setHovered",t=>{var n;if(!er((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const o=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:o}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class Mc{constructor(t){Oe(this,"fn");Oe(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Di(e){return new Mc(e)}const Rc=Di(()=>window.navigator.userAgent.includes("Firefox")),Pr=Di(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),Wr=Di(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Ec(e){const t=a.useRef([]),n=a.useRef(0),o=a.useRef(e);o.current=e;const r=a.useCallback(()=>{const i=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(Ei);t.current=[],o.current(new nr(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:l)},[]);return a.useCallback(i=>{t.current.length===0&&r();const l=bn(i[0],i[1]);t.current.includes(l)||t.current.push(l)},[r])}const Kn="header",an="group-header",$r="out-of-bounds";var Fo;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Fo||(Fo={}));function ts(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const hl=6,Ic=(e,t)=>{if(e.kind===j.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},Dc=(e,t)=>{const{width:n,height:o,accessibilityHeight:r,columns:i,cellXOffset:l,cellYOffset:s,headerHeight:c,fillHandle:u=!1,groupHeaderHeight:f,rowHeight:m,rows:g,getCellContent:w,getRowThemeOverride:h,onHeaderMenuClick:y,onHeaderIndicatorClick:C,enableGroups:x,isFilling:v,onCanvasFocused:I,onCanvasBlur:X,isFocused:N,selection:A,freezeColumns:z,onContextMenu:K,freezeTrailingRows:S,fixedShadowX:$=!0,fixedShadowY:W=!0,drawFocusRing:D,onMouseDown:R,onMouseUp:M,onMouseMoveRaw:re,onMouseMove:te,onItemHovered:ce,dragAndDropState:Ce,firstColAccessible:Fe,onKeyDown:_,onKeyUp:V,highlightRegions:xe,canvasRef:ne,onDragStart:be,onDragEnd:pe,eventTargetRef:U,isResizing:ke,resizeColumn:ve,isDragging:je,isDraggable:nt=!1,allowResize:mt,disabledRows:et,hasAppendRow:Ae,getGroupDetails:Ve,theme:Re,prelightCells:ut,headerIcons:rt,verticalBorder:it,drawCell:ie,drawHeader:We,onCellFocused:De,onDragOverCell:Ie,onDrop:fe,onDragLeave:Ne,imageWindowLoader:Te,smoothScrollX:_e=!1,smoothScrollY:oe=!1,experimental:He,getCellRenderer:tt,resizeIndicator:$e="full"}=e,Ke=e.translateX??0,ft=e.translateY??0,Xe=Math.max(z,Math.min(i.length-1,l)),ze=a.useRef(null),Ct=a.useRef(window),xt=Ct.current,Xt=Te,wt=a.useRef(),[It,Dt]=a.useState(!1),An=a.useRef([]),zn=a.useRef(),[ct,Rn]=a.useState(),[Pe,Ze]=a.useState(),zt=a.useRef(null),[En,nn]=a.useState(),[Bt,Ue]=a.useState(!1),Mt=a.useRef(Bt);Mt.current=Bt;const at=a.useMemo(()=>new rc(rt,()=>{co.current=void 0,qn.current()}),[rt]),Pt=x?f+c:c,Tt=a.useRef(-1),jt=((He==null?void 0:He.enableFirefoxRescaling)??!1)&&Rc.value,Bo=((He==null?void 0:He.enableSafariRescaling)??!1)&&Pr.value;a.useLayoutEffect(()=>{window.devicePixelRatio===1||!jt&&!Bo||(Tt.current!==-1&&Dt(!0),window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{Dt(!1),Tt.current=-1},200))},[s,Xe,Ke,ft,jt,Bo]);const kt=da(i,z),Ft=$?Ao(kt,Ce):0,Ht=a.useCallback((k,G,de)=>{const se=k.getBoundingClientRect();if(G>=kt.length||de>=g)return;const q=se.width/n,J=pi(G,de,n,o,f,Pt,Xe,s,Ke,ft,g,z,S,kt,m);return q!==1&&(J.x*=q,J.y*=q,J.width*=q,J.height*=q),J.x+=se.x,J.y+=se.y,J},[n,o,f,Pt,Xe,s,Ke,ft,g,z,S,kt,m]),At=a.useCallback((k,G,de,se)=>{const q=k.getBoundingClientRect(),J=q.width/n,ae=(G-q.left)/J,ue=(de-q.top)/J,Z=5,qe=bi(kt,Xe,n,void 0,Ke);let he=0,Je=0;se instanceof MouseEvent&&(he=se.button,Je=se.buttons);const Ye=ga(ae,qe,Ke),Ee=ma(ue,o,x,c,f,g,m,s,ft,S),ot=(se==null?void 0:se.shiftKey)===!0,Vt=(se==null?void 0:se.ctrlKey)===!0,pt=(se==null?void 0:se.metaKey)===!0,Yt=se!==void 0&&!(se instanceof MouseEvent)||(se==null?void 0:se.pointerType)==="touch",hn=[ae<0?-1:nn||ue>o){const ge=ae>n?1:ae<0?-1:0,ht=ue>o?1:ue<0?-1:0;let Gt=ge*2,On=ht*2;ge===0&&(Gt=Ye===-1?Fo.EndPadding:Fo.Center),ht===0&&(On=Ee===void 0?Fo.EndPadding:Fo.Center);let Ot=!1;if(Ye===-1&&Ee===-1){const Jn=Ht(k,kt.length-1,-1);Qt(Jn!==void 0),Ot=Gn&&aeo&&ue=0?(ht=!0,ge=Ht(k,Gt,Ee),Qt(ge!==void 0),_t={kind:x&&Ee===-2?an:Kn,location:[Gt,Ee],bounds:ge,group:kt[Gt].group??"",isEdge:ht,shiftKey:ot,ctrlKey:Vt,metaKey:pt,isTouch:Yt,localEventX:G-ge.x,localEventY:de-ge.y,button:he,buttons:Je,scrollEdge:hn}):_t={kind:x&&Ee===-2?an:Kn,group:kt[Ye].group??"",location:[Ye,Ee],bounds:ge,isEdge:ht,shiftKey:ot,ctrlKey:Vt,metaKey:pt,isTouch:Yt,localEventX:G-ge.x,localEventY:de-ge.y,button:he,buttons:Je,scrollEdge:hn}}else{const ge=Ht(k,Ye,Ee);Qt(ge!==void 0);const ht=ge!==void 0&&ge.x+ge.width-G{}),Bn=a.useRef(ct);Bn.current=ct;const[Dn,Fn]=a.useMemo(()=>{const k=document.createElement("canvas"),G=document.createElement("canvas");return k.style.display="none",k.style.opacity="0",k.style.position="fixed",G.style.display="none",G.style.opacity="0",G.style.position="fixed",[k.getContext("2d",{alpha:!1}),G.getContext("2d",{alpha:!1})]},[]);a.useLayoutEffect(()=>{if(!(Dn===null||Fn===null))return document.documentElement.append(Dn.canvas),document.documentElement.append(Fn.canvas),()=>{Dn.canvas.remove(),Fn.canvas.remove()}},[Dn,Fn]);const pn=a.useMemo(()=>new Sa,[]),ar=jt&&It?1:Bo&&It?2:5,cr=(He==null?void 0:He.disableMinimumCellWidth)===!0?1:10,co=a.useRef(),uo=a.useRef(null),fo=a.useRef(null),_n=a.useCallback(()=>{var ae;const k=ze.current,G=zt.current;if(k===null||G===null||(uo.current===null&&(uo.current=k.getContext("2d",{alpha:!1}),k.width=0,k.height=0),fo.current===null&&(fo.current=G.getContext("2d",{alpha:!1}),G.width=0,G.height=0),uo.current===null||fo.current===null||Dn===null||Fn===null))return;let de=!1;const se=ue=>{de=!0,nn(ue)},q=co.current,J={headerCanvasCtx:fo.current,canvasCtx:uo.current,bufferACtx:Dn,bufferBCtx:Fn,width:n,height:o,cellXOffset:Xe,cellYOffset:s,translateX:Math.round(Ke),translateY:Math.round(ft),mappedColumns:kt,enableGroups:x,freezeColumns:z,dragAndDropState:Ce,theme:Re,headerHeight:c,groupHeaderHeight:f,disabledRows:et??st.empty(),rowHeight:m,verticalBorder:it,isResizing:ke,resizeCol:ve,isFocused:N,selection:A,fillHandle:u,drawCellCallback:ie,hasAppendRow:Ae,overrideCursor:se,maxScaleFactor:ar,freezeTrailingRows:S,rows:g,drawFocus:D,getCellContent:w,getGroupDetails:Ve??(ue=>({name:ue})),getRowThemeOverride:h,drawHeaderCallback:We,prelightCells:ut,highlightRegions:xe,imageLoader:Xt,lastBlitData:zn,damage:wt.current,hoverValues:An.current,hoverInfo:Bn.current,spriteManager:at,scrolling:It,hyperWrapping:(He==null?void 0:He.hyperWrapping)??!1,touchMode:Bt,enqueue:sr.current,renderStateProvider:pn,renderStrategy:(He==null?void 0:He.renderStrategy)??(Pr.value?"double-buffer":"single-buffer"),getCellRenderer:tt,minimumCellWidth:cr,resizeIndicator:$e};J.damage===void 0?(co.current=J,fl(J,q)):fl(J,void 0),!de&&(J.damage===void 0||J.damage.has((ae=Bn==null?void 0:Bn.current)==null?void 0:ae[0]))&&nn(void 0)},[Dn,Fn,n,o,Xe,s,Ke,ft,kt,x,z,Ce,Re,c,f,et,m,it,ke,Ae,ve,N,A,u,S,g,D,ar,w,Ve,h,ie,We,ut,xe,Xt,at,It,He==null?void 0:He.hyperWrapping,He==null?void 0:He.renderStrategy,Bt,pn,tt,cr,$e]),qn=a.useRef(_n);a.useLayoutEffect(()=>{_n(),qn.current=_n},[_n]),a.useLayoutEffect(()=>{(async()=>{var G;((G=document==null?void 0:document.fonts)==null?void 0:G.ready)!==void 0&&(await document.fonts.ready,co.current=void 0,qn.current())})()},[]);const Ln=a.useCallback(k=>{wt.current=k,qn.current(),wt.current=void 0},[]),Yr=Ec(Ln);sr.current=Yr;const dr=a.useCallback(k=>{Ln(new nr(k.map(G=>G.cell)))},[Ln]);Xt.setCallback(Ln);const[ur,Gr]=a.useState(!1),[ho,Pn]=In??[],Lo=ho!==void 0&&Pn===-1,Kr=ho!==void 0&&Pn===-2;let Po=!1,yt=!1,Wt=En;if(Wt===void 0&&ho!==void 0&&Pn!==void 0&&Pn>-1&&Pn({contain:"strict",display:"block",cursor:Wo}),[Wo]),$o=a.useRef("default"),mo=U==null?void 0:U.current;mo!=null&&$o.current!==go.cursor&&(mo.style.cursor=$o.current=go.cursor);const dn=a.useCallback((k,G,de,se)=>{if(Ve===void 0)return;const q=Ve(k);if(q.actions!==void 0){const J=Zl(G,q.actions);for(const[ae,ue]of J.entries())if(lo(ue,de+G.x,se+ue.y))return q.actions[ae]}},[Ve]),Zt=a.useCallback((k,G,de,se)=>{const q=kt[G];if(!je&&!ke&&!(Pe??!1)){const J=Ht(k,G,-1);Qt(J!==void 0);const ae=Jl(void 0,q,J.x,J.y,J.width,J.height,Re,Si(q.title)==="rtl");if(q.hasMenu===!0&&ae.menuBounds!==void 0&&lo(ae.menuBounds,de,se))return{area:"menu",bounds:ae.menuBounds};if(q.indicatorIcon!==void 0&&ae.indicatorIconBounds!==void 0&&lo(ae.indicatorIconBounds,de,se))return{area:"indicator",bounds:ae.indicatorIconBounds}}},[kt,Ht,Pe,je,ke,Re]),Wn=a.useRef(0),jn=a.useRef(),wo=a.useRef(!1),Se=a.useCallback(k=>{const G=ze.current,de=U==null?void 0:U.current;if(G===null||k.target!==G&&k.target!==de)return;wo.current=!0;let se,q;if(k instanceof MouseEvent?(se=k.clientX,q=k.clientY):(se=k.touches[0].clientX,q=k.touches[0].clientY),k.target===de&&de!==null){const ae=de.getBoundingClientRect();if(se>ae.right||q>ae.bottom)return}const J=At(G,se,q,k);jn.current=J.location,J.isTouch&&(Wn.current=Date.now()),Mt.current!==J.isTouch&&Ue(J.isTouch),!(J.kind===Kn&&Zt(G,J.location[0],se,q)!==void 0)&&(J.kind===an&&dn(J.group,J.bounds,J.localEventX,J.localEventY)!==void 0||(R==null||R(J),!J.isTouch&&nt!==!0&&nt!==J.kind&&J.button<3&&J.button!==1&&k.preventDefault()))},[U,nt,At,dn,Zt,R]);Lt("touchstart",Se,xt,!1),Lt("mousedown",Se,xt,!1);const Oo=a.useRef(0),fr=a.useCallback(k=>{var Je,Ye;const G=Oo.current;Oo.current=Date.now();const de=ze.current;if(wo.current=!1,M===void 0||de===null)return;const se=U==null?void 0:U.current,q=k.target!==de&&k.target!==se;let J,ae,ue=!0;if(k instanceof MouseEvent){if(J=k.clientX,ae=k.clientY,ue=k.button<3,k.pointerType==="touch")return}else J=k.changedTouches[0].clientX,ae=k.changedTouches[0].clientY;let Z=At(de,J,ae,k);Z.isTouch&&Wn.current!==0&&Date.now()-Wn.current>500&&(Z={...Z,isLongTouch:!0}),G!==0&&Date.now()-G<(Z.isTouch?1e3:500)&&(Z={...Z,isDoubleClick:!0}),Mt.current!==Z.isTouch&&Ue(Z.isTouch),!q&&k.cancelable&&ue&&k.preventDefault();const[qe]=Z.location,he=Zt(de,qe,J,ae);if(Z.kind===Kn&&he!==void 0){(Z.button!==0||((Je=jn.current)==null?void 0:Je[0])!==qe||((Ye=jn.current)==null?void 0:Ye[1])!==-1)&&M(Z,!0);return}else if(Z.kind===an){const Ee=dn(Z.group,Z.bounds,Z.localEventX,Z.localEventY);if(Ee!==void 0){Z.button===0&&Ee.onClick(Z);return}}M(Z,q)},[M,U,At,Zt,dn]);Lt("mouseup",fr,xt,!1),Lt("touchend",fr,xt,!1);const un=a.useCallback(k=>{var qe,he;const G=ze.current;if(G===null)return;const de=U==null?void 0:U.current,se=k.target!==G&&k.target!==de;let q,J,ae=!0;k instanceof MouseEvent?(q=k.clientX,J=k.clientY,ae=k.button<3):(q=k.changedTouches[0].clientX,J=k.changedTouches[0].clientY);const ue=At(G,q,J,k);Mt.current!==ue.isTouch&&Ue(ue.isTouch),!se&&k.cancelable&&ae&&k.preventDefault();const[Z]=ue.location;if(ue.kind===Kn){const Je=Zt(G,Z,q,J);Je!==void 0&&ue.button===0&&((qe=jn.current)==null?void 0:qe[0])===Z&&((he=jn.current)==null?void 0:he[1])===-1&&(Je.area==="menu"?y==null||y(Z,Je.bounds):Je.area==="indicator"&&(C==null||C(Z,Je.bounds)))}else if(ue.kind===an){const Je=dn(ue.group,ue.bounds,ue.localEventX,ue.localEventY);Je!==void 0&&ue.button===0&&Je.onClick(ue)}},[U,At,Zt,y,C,dn]);Lt("click",un,xt,!1);const Ur=a.useCallback(k=>{const G=ze.current,de=U==null?void 0:U.current;if(G===null||k.target!==G&&k.target!==de||K===void 0)return;const se=At(G,k.clientX,k.clientY,k);K(se,()=>{k.cancelable&&k.preventDefault()})},[U,At,K]);Lt("contextmenu",Ur,(U==null?void 0:U.current)??null,!1);const fn=a.useCallback(k=>{wt.current=new nr(k.map(G=>G.item)),An.current=k,qn.current(),wt.current=void 0},[]),yo=a.useMemo(()=>new Sc(fn),[fn]),No=a.useRef(yo);No.current=yo,a.useLayoutEffect(()=>{const k=No.current;if(In===void 0||In[1]<0){k.setHovered(In);return}const G=w(In,!0),de=tt(G),se=de===void 0&&G.kind===j.Custom||(de==null?void 0:de.needsHover)!==void 0&&(typeof de.needsHover=="boolean"?de.needsHover:de.needsHover(G));k.setHovered(se?In:void 0)},[w,tt,In]);const Xo=a.useRef(),Vr=a.useCallback(k=>{var ue;const G=ze.current;if(G===null)return;const de=U==null?void 0:U.current,se=k.target!==G&&k.target!==de,q=At(G,k.clientX,k.clientY,k);if(q.kind!=="out-of-bounds"&&se&&!wo.current&&!q.isTouch)return;const J=(Z,qe)=>{Rn(he=>he===Z||(he==null?void 0:he[0][0])===(Z==null?void 0:Z[0][0])&&(he==null?void 0:he[0][1])===(Z==null?void 0:Z[0][1])&&((he==null?void 0:he[1][0])===(Z==null?void 0:Z[1][0])&&(he==null?void 0:he[1][1])===(Z==null?void 0:Z[1][1])||!qe)?he:Z)};if(!ts(q,Xo.current))nn(void 0),ce==null||ce(q),J(q.kind===$r?void 0:[q.location,[q.localEventX,q.localEventY]],!0),Xo.current=q;else if(q.kind==="cell"||q.kind===Kn||q.kind===an){let Z=!1,qe=!0;if(q.kind==="cell"){const Je=w(q.location);qe=((ue=tt(Je))==null?void 0:ue.needsHoverPosition)??Je.kind===j.Custom,Z=qe}else Z=!0;const he=[q.location,[q.localEventX,q.localEventY]];J(he,qe),Bn.current=he,Z&&Ln(new nr([q.location]))}const ae=q.location[0]>=(Fe?0:1);Ze(q.kind===Kn&&q.isEdge&&ae&&mt===!0),Gr(q.kind==="cell"&&q.isFillHandle),re==null||re(k),te(q)},[U,At,Fe,mt,re,te,ce,w,tt,Ln]);Lt("mousemove",Vr,xt,!0);const _r=a.useCallback(k=>{const G=ze.current;if(G===null)return;let de,se;A.current!==void 0&&(de=Ht(G,A.current.cell[0],A.current.cell[1]),se=A.current.cell),_==null||_({bounds:de,stopPropagation:()=>k.stopPropagation(),preventDefault:()=>k.preventDefault(),cancel:()=>{},ctrlKey:k.ctrlKey,metaKey:k.metaKey,shiftKey:k.shiftKey,altKey:k.altKey,key:k.key,keyCode:k.keyCode,rawEvent:k,location:se})},[_,A,Ht]),vn=a.useCallback(k=>{const G=ze.current;if(G===null)return;let de,se;A.current!==void 0&&(de=Ht(G,A.current.cell[0],A.current.cell[1]),se=A.current.cell),V==null||V({bounds:de,stopPropagation:()=>k.stopPropagation(),preventDefault:()=>k.preventDefault(),cancel:()=>{},ctrlKey:k.ctrlKey,metaKey:k.metaKey,shiftKey:k.shiftKey,altKey:k.altKey,key:k.key,keyCode:k.keyCode,rawEvent:k,location:se})},[V,A,Ht]),$n=a.useCallback(k=>{if(ze.current=k,ne!==void 0&&(ne.current=k),k===null)Ct.current=window;else{const G=k.getRootNode();G===document&&(Ct.current=window),Ct.current=G}},[ne]),on=a.useCallback(k=>{const G=ze.current;if(G===null||nt===!1||ke){k.preventDefault();return}let de,se;const q=At(G,k.clientX,k.clientY);if(nt!==!0&&q.kind!==nt){k.preventDefault();return}const J=(Je,Ye)=>{de=Je,se=Ye};let ae,ue,Z;const qe=(Je,Ye,Ee)=>{ae=Je,ue=Ye,Z=Ee};let he=!1;if(be==null||be({...q,setData:J,setDragImage:qe,preventDefault:()=>he=!0,defaultPrevented:()=>he}),!he&&de!==void 0&&se!==void 0&&k.dataTransfer!==null)if(k.dataTransfer.setData(de,se),k.dataTransfer.effectAllowed="copyLink",ae!==void 0&&ue!==void 0&&Z!==void 0)k.dataTransfer.setDragImage(ae,ue,Z);else{const[Je,Ye]=q.location;if(Ye!==void 0){const Ee=document.createElement("canvas"),ot=Ht(G,Je,Ye);Qt(ot!==void 0);const Vt=Math.ceil(window.devicePixelRatio??1);Ee.width=ot.width*Vt,Ee.height=ot.height*Vt;const pt=Ee.getContext("2d");pt!==null&&(pt.scale(Vt,Vt),pt.textBaseline="middle",Ye===-1?(pt.font=Re.headerFontFull,pt.fillStyle=Re.bgHeader,pt.fillRect(0,0,Ee.width,Ee.height),Ql(pt,0,0,ot.width,ot.height,kt[Je],!1,Re,!1,void 0,void 0,!1,0,at,We,!1)):(pt.font=Re.baseFontFull,pt.fillStyle=Re.bgCell,pt.fillRect(0,0,Ee.width,Ee.height),jl(pt,w([Je,Ye]),0,Ye,!1,!1,0,0,ot.width,ot.height,!1,Re,Re.bgCell,Xt,at,1,void 0,!1,0,void 0,void 0,void 0,pn,tt,()=>{}))),Ee.style.left="-100%",Ee.style.position="absolute",Ee.style.width=`${ot.width}px`,Ee.style.height=`${ot.height}px`,document.body.append(Ee),k.dataTransfer.setDragImage(Ee,ot.width/2,ot.height/2),window.setTimeout(()=>{Ee.remove()},0)}}else k.preventDefault()},[nt,ke,At,be,Ht,Re,kt,at,We,w,Xt,pn,tt]);Lt("dragstart",on,(U==null?void 0:U.current)??null,!1,!1);const H=a.useRef(),bt=a.useCallback(k=>{const G=ze.current;if(fe!==void 0&&k.preventDefault(),G===null||Ie===void 0)return;const de=At(G,k.clientX,k.clientY),[se,q]=de.location,J=se-(Fe?0:1),[ae,ue]=H.current??[];(ae!==J||ue!==q)&&(H.current=[J,q],Ie([J,q],k.dataTransfer))},[Fe,At,Ie,fe]);Lt("dragover",bt,(U==null?void 0:U.current)??null,!1,!1);const Zn=a.useCallback(()=>{H.current=void 0,pe==null||pe()},[pe]);Lt("dragend",Zn,(U==null?void 0:U.current)??null,!1,!1);const qr=a.useCallback(k=>{const G=ze.current;if(G===null||fe===void 0)return;k.preventDefault();const de=At(G,k.clientX,k.clientY),[se,q]=de.location,J=se-(Fe?0:1);fe([J,q],k.dataTransfer)},[Fe,At,fe]);Lt("drop",qr,(U==null?void 0:U.current)??null,!1,!1);const hr=a.useCallback(()=>{Ne==null||Ne()},[Ne]);Lt("dragleave",hr,(U==null?void 0:U.current)??null,!1,!1);const gr=a.useRef(A);gr.current=A;const bo=a.useRef(null),mr=a.useCallback(k=>{var G;ze.current===null||!ze.current.contains(document.activeElement)||(k===null&&gr.current.current!==void 0?(G=ne==null?void 0:ne.current)==null||G.focus({preventScroll:!0}):k!==null&&k.focus({preventScroll:!0}),bo.current=k)},[ne]);a.useImperativeHandle(t,()=>({focus:()=>{var G;const k=bo.current;k===null||!document.contains(k)?(G=ne==null?void 0:ne.current)==null||G.focus({preventScroll:!0}):k.focus({preventScroll:!0})},getBounds:(k,G)=>{if(!(ne===void 0||ne.current===null))return Ht(ne.current,k??0,G??-1)},damage:dr}),[ne,dr,Ht]);const B=a.useRef(),$t=Zs(()=>{var ue,Z,qe;if(n<50||(He==null?void 0:He.disableAccessibilityTree)===!0)return null;let k=bi(kt,Xe,n,Ce,Ke);const G=Fe?0:-1;!Fe&&((ue=k[0])==null?void 0:ue.sourceIndex)===0&&(k=k.slice(1));const[de,se]=((Z=A.current)==null?void 0:Z.cell)??[],q=(qe=A.current)==null?void 0:qe.range,J=k.map(he=>he.sourceIndex),ae=io(s,Math.min(g,s+r));return de!==void 0&&se!==void 0&&!(J.includes(de)&&ae.includes(se))&&mr(null),a.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":kt.length+G},a.createElement("thead",{role:"rowgroup"},a.createElement("tr",{role:"row","aria-rowindex":1},k.map(he=>a.createElement("th",{role:"columnheader","aria-selected":A.columns.hasIndex(he.sourceIndex),"aria-colindex":he.sourceIndex+1+G,tabIndex:-1,onFocus:Je=>{if(Je.target!==bo.current)return De==null?void 0:De([he.sourceIndex,-1])},key:he.sourceIndex},he.title)))),a.createElement("tbody",{role:"rowgroup"},ae.map(he=>a.createElement("tr",{role:"row","aria-selected":A.rows.hasIndex(he),key:he,"aria-rowindex":he+2},k.map(Je=>{const Ye=Je.sourceIndex,Ee=bn(Ye,he),ot=de===Ye&&se===he,Vt=q!==void 0&&Ye>=q.x&&Ye=q.y&&he{const _t=ne==null?void 0:ne.current;if(_t!=null)return _==null?void 0:_({bounds:Ht(_t,Ye,he),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Yt})},onFocusCapture:_t=>{var ge,ht;if(!(_t.target===bo.current||((ge=B.current)==null?void 0:ge[0])===Ye&&((ht=B.current)==null?void 0:ht[1])===he))return B.current=Yt,De==null?void 0:De(Yt)},ref:ot?mr:void 0,tabIndex:-1},Ic(hn,tt))})))))},[n,kt,Xe,Ce,Ke,g,s,r,A,mr,w,ne,_,Ht,De],200),St=z===0||!$?0:Xe>z?1:sn(-Ke/100,0,1),jr=-s*32+ft,po=W?sn(-jr/100,0,1):0,vo=a.useMemo(()=>{if(!St&&!po)return null;const k={position:"absolute",top:0,left:Ft,width:n-Ft,height:o,opacity:St,pointerEvents:"none",transition:_e?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},G={position:"absolute",top:Pt,left:0,width:n,height:o,opacity:po,pointerEvents:"none",transition:oe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return a.createElement(a.Fragment,null,St>0&&a.createElement("div",{id:"shadow-x",style:k}),po>0&&a.createElement("div",{id:"shadow-y",style:G}))},[St,po,Ft,n,_e,Pt,o,oe]),Ut=a.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return a.createElement(a.Fragment,null,a.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:_r,onKeyUp:vn,onFocus:I,onBlur:X,ref:$n,style:go},$t),a.createElement("canvas",{ref:zt,style:Ut}),vo)},Fc=a.memo(a.forwardRef(Dc));function Jo(e,t,n,o){return sn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(o))}const Hc=e=>{const[t,n]=a.useState(),[o,r]=a.useState(),[i,l]=a.useState(),[s,c]=a.useState(),[u,f]=a.useState(!1),[m,g]=a.useState(),[w,h]=a.useState(),[y,C]=a.useState(),[x,v]=a.useState(!1),[I,X]=a.useState(),{onHeaderMenuClick:N,onHeaderIndicatorClick:A,getCellContent:z,onColumnMoved:K,onColumnResize:S,onColumnResizeStart:$,onColumnResizeEnd:W,gridRef:D,maxColumnWidth:R,minColumnWidth:M,onRowMoved:re,lockColumns:te,onColumnProposeMove:ce,onMouseDown:Ce,onMouseUp:Fe,onItemHovered:_,onDragStart:V,canvasRef:xe}=e,ne=(S??W??$)!==void 0,{columns:be,selection:pe}=e,U=pe.columns,ke=a.useCallback(ie=>{const[We,De]=ie.location;i!==void 0&&s!==We&&We>=te?(f(!0),c(We)):w!==void 0&&De!==void 0?(v(!0),C(Math.max(0,De))):o===void 0&&!u&&!x&&(_==null||_(ie))},[i,w,s,_,te,o,u,x]),ve=K!==void 0,je=a.useCallback(ie=>{var We;if(ie.button===0){const[De,Ie]=ie.location;if(ie.kind==="out-of-bounds"&&ie.isEdge&&ne){const fe=(We=D==null?void 0:D.current)==null?void 0:We.getBounds(be.length-1,-1);fe!==void 0&&(n(fe.x),r(be.length-1))}else if(ie.kind==="header"&&De>=te){const fe=xe==null?void 0:xe.current;if(ie.isEdge&&ne&&fe){n(ie.bounds.x),r(De);const Te=fe.getBoundingClientRect().width/fe.offsetWidth,_e=ie.bounds.width/Te;$==null||$(be[De],_e,De,_e+(be[De].growOffset??0))}else ie.kind==="header"&&ve&&(g(ie.bounds.x),l(De))}else ie.kind==="cell"&&te>0&&De===0&&Ie!==void 0&&re!==void 0&&(X(ie.bounds.y),h(Ie))}Ce==null||Ce(ie)},[Ce,ne,te,re,D,be,ve,$,xe]),nt=a.useCallback((ie,We)=>{u||x||N==null||N(ie,We)},[u,x,N]),mt=a.useCallback((ie,We)=>{u||x||A==null||A(ie,We)},[u,x,A]),et=a.useRef(-1),Ae=a.useCallback(()=>{et.current=-1,h(void 0),C(void 0),X(void 0),v(!1),l(void 0),c(void 0),g(void 0),f(!1),r(void 0),n(void 0)},[]),Ve=a.useCallback((ie,We)=>{if(ie.button===0){if(o!==void 0){if((U==null?void 0:U.hasIndex(o))===!0)for(const Ie of U){if(Ie===o)continue;const fe=be[Ie],Ne=Jo(fe,et.current,M,R);S==null||S(fe,Ne,Ie,Ne+(fe.growOffset??0))}const De=Jo(be[o],et.current,M,R);if(W==null||W(be[o],De,o,De+(be[o].growOffset??0)),U.hasIndex(o))for(const Ie of U){if(Ie===o)continue;const fe=be[Ie],Ne=Jo(fe,et.current,M,R);W==null||W(fe,Ne,Ie,Ne+(fe.growOffset??0))}}Ae(),i!==void 0&&s!==void 0&&(K==null||K(i,s)),w!==void 0&&y!==void 0&&(re==null||re(w,y))}Fe==null||Fe(ie,We)},[Fe,o,i,s,w,y,U,W,be,M,R,S,K,re,Ae]),Re=a.useMemo(()=>{if(!(i===void 0||s===void 0)&&i!==s&&(ce==null?void 0:ce(i,s))!==!1)return{src:i,dest:s}},[i,s,ce]),ut=a.useCallback(ie=>{const We=xe==null?void 0:xe.current;if(i!==void 0&&m!==void 0)Math.abs(ie.clientX-m)>20&&f(!0);else if(w!==void 0&&I!==void 0)Math.abs(ie.clientY-I)>20&&v(!0);else if(o!==void 0&&t!==void 0&&We){const Ie=We.getBoundingClientRect().width/We.offsetWidth,fe=(ie.clientX-t)/Ie,Ne=be[o],Te=Jo(Ne,fe,M,R);if(S==null||S(Ne,Te,o,Te+(Ne.growOffset??0)),et.current=fe,(U==null?void 0:U.first())===o)for(const _e of U){if(_e===o)continue;const oe=be[_e],He=Jo(oe,et.current,M,R);S==null||S(oe,He,_e,He+(oe.growOffset??0))}}},[i,m,w,I,o,t,be,M,R,S,U,xe]),rt=a.useCallback((ie,We)=>{if(w===void 0||y===void 0)return z(ie,We);let[De,Ie]=ie;return Ie===y?Ie=w:(Ie>y&&(Ie-=1),Ie>=w&&(Ie+=1)),z([De,Ie],We)},[w,y,z]),it=a.useCallback(ie=>{V==null||V(ie),ie.defaultPrevented()||Ae()},[Ae,V]);return a.createElement(Fc,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:o,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:rt,isResizing:o!==void 0,onHeaderMenuClick:nt,onHeaderIndicatorClick:mt,isDragging:u,onItemHovered:ke,onDragStart:it,onMouseDown:je,allowResize:ne,onMouseUp:Ve,dragAndDropState:Re,onMouseMoveRaw:ut,ref:D})},Tc=Hc;function Ac(e){const t=a.useRef(null),[n,o]=a.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return a.useLayoutEffect(()=>{const r=l=>{for(const s of l){const{width:c,height:u}=s&&s.contentRect||{};o(f=>f.width===c&&f.height===u?f:{width:c,height:u})}},i=new window.ResizeObserver(r);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const zc=(e,t,n)=>{const o=a.useRef(null),r=a.useRef(null),i=a.useRef(null),l=a.useRef(0),s=a.useRef(t);s.current=t;const c=n.current;a.useEffect(()=>{const u=()=>{var g,w;if(r.current===!1&&c!==null){const h=[c.scrollLeft,c.scrollTop];if(((g=i.current)==null?void 0:g[0])===h[0]&&((w=i.current)==null?void 0:w[1])===h[1])if(l.current>10){i.current=null,r.current=null;return}else l.current++;else l.current=0,s.current(h[0],h[1]),i.current=h;o.current=window.setTimeout(u,8.333333333333334)}},f=()=>{r.current=!0,i.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},m=g=>{g.touches.length===0&&(r.current=!1,l.current=0,o.current=window.setTimeout(u,8.333333333333334))};if(e&&c!==null){const g=c;return g.addEventListener("touchstart",f),g.addEventListener("touchend",m),()=>{g.removeEventListener("touchstart",f),g.removeEventListener("touchend",m),o.current!==null&&window.clearTimeout(o.current)}}},[e,c])},Bc=zc,Lc=()=>e=>e.isSafari?"scroll":"auto",Pc=tn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[Lc()]}});function Wc(e){const[t,n]=a.useState(!1),o=typeof window>"u"?null:window,r=a.useRef(0);return Lt("touchstart",a.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),o,!0,!1),Lt("touchend",a.useCallback(i=>{i.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),o,!0,!1),t}const $c=e=>{var ne,be;const{children:t,clientHeight:n,scrollHeight:o,scrollWidth:r,update:i,draggable:l,className:s,preventDiagonalScrolling:c=!1,paddingBottom:u=0,paddingRight:f=0,rightElement:m,rightElementProps:g,kineticScrollPerfHack:w=!1,scrollRef:h,initialSize:y}=e,C=[],x=(g==null?void 0:g.sticky)??!1,v=(g==null?void 0:g.fill)??!1,I=a.useRef(0),X=a.useRef(0),N=a.useRef(null),A=typeof window>"u"?1:window.devicePixelRatio,z=a.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),K=a.useRef(null),S=Wc(200),[$,W]=a.useState(!0),D=a.useRef(0);a.useLayoutEffect(()=>{if(!$||S||z.current.lockDirection===void 0)return;const pe=N.current;if(pe===null)return;const[U,ke]=z.current.lockDirection;U!==void 0?pe.scrollLeft=U:ke!==void 0&&(pe.scrollTop=ke),z.current.lockDirection=void 0},[S,$]);const R=a.useCallback((pe,U)=>{var it;const ke=N.current;if(ke===null)return;U=U??ke.scrollTop,pe=pe??ke.scrollLeft;const ve=z.current.scrollTop,je=z.current.scrollLeft,nt=pe-je,mt=U-ve;S&&nt!==0&&mt!==0&&(Math.abs(nt)>3||Math.abs(mt)>3)&&c&&z.current.lockDirection===void 0&&(z.current.lockDirection=Math.abs(nt)0&&(Math.abs(ut)>2e3||Re===0||Re===rt)&&o>ke.scrollHeight+5){const ie=Re/rt,We=(o-Ve)*ie;I.current=We-Re}et!==void 0&&(window.clearTimeout(D.current),W(!1),D.current=window.setTimeout(()=>W(!0),200)),i({x:pe,y:Re+I.current,width:Ae-f,height:Ve-u,paddingRight:((it=K.current)==null?void 0:it.clientWidth)??0})},[u,f,o,i,c,S]);Bc(w&&Pr.value,R,N);const M=a.useRef(R);M.current=R;const re=a.useRef(),te=a.useRef(!1);a.useLayoutEffect(()=>{te.current?R():te.current=!0},[R,u,f]);const ce=a.useCallback(pe=>{N.current=pe,h!==void 0&&(h.current=pe)},[h]);let Ce=0,Fe=0;for(C.push(a.createElement("div",{key:Ce++,style:{width:r,height:0}}));FeM.current(),0),re.current={width:V,height:xe}),(V??0)===0||(xe??0)===0?a.createElement("div",{ref:_}):a.createElement("div",{ref:_},a.createElement(Pc,{isSafari:Pr.value},a.createElement("div",{className:"dvn-underlay"},t),a.createElement("div",{ref:ce,style:re.current,draggable:l,onDragStart:pe=>{l||(pe.stopPropagation(),pe.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>R()},a.createElement("div",{className:"dvn-scroll-inner"+(m===void 0?" dvn-hidden":"")},a.createElement("div",{className:"dvn-stack"},C),m!==void 0&&a.createElement(a.Fragment,null,!v&&a.createElement("div",{className:"dvn-spacer"}),a.createElement("div",{ref:K,style:{height:xe,maxHeight:n-Math.ceil(A%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:f,flexGrow:v?1:void 0,right:x?f??0:void 0,pointerEvents:"auto"}},m))))))},Oc=e=>{const{columns:t,rows:n,rowHeight:o,headerHeight:r,groupHeaderHeight:i,enableGroups:l,freezeColumns:s,experimental:c,nonGrowWidth:u,clientSize:f,className:m,onVisibleRegionChanged:g,scrollRef:w,preventDiagonalScrolling:h,rightElement:y,rightElementProps:C,overscrollX:x,overscrollY:v,initialSize:I,smoothScrollX:X=!1,smoothScrollY:N=!1,isDraggable:A}=e,{paddingRight:z,paddingBottom:K}=c??{},[S,$]=f,W=a.useRef(),D=a.useRef(),R=a.useRef(),M=a.useRef(),re=u+Math.max(0,x??0);let te=l?r+i:r;if(typeof o=="number")te+=n*o;else for(let _=0;_{var mt,et;if(ce.current===void 0)return;const _={...ce.current};let V=0,xe=_.x<0?-_.x:0,ne=0,be=0;_.x=_.x<0?0:_.x;let pe=0;for(let Ae=0;Ae=Ve+Ae.width)V+=Ae.width,be++,ne++;else if(_.x>Ve)V+=Ae.width,X?xe+=Ve-_.x:be++,ne++;else if(_.x+_.width>Ve)V+=Ae.width,ne++;else break}let U=0,ke=0,ve=0;if(typeof o=="number")N?(ke=Math.floor(_.y/o),U=ke*o-_.y):ke=Math.ceil(_.y/o),ve=Math.ceil(_.height/o)+ke,U<0&&ve++;else{let Ae=0;for(let Ve=0;Ve=Ae+Re)Ae+=Re,ke++,ve++;else if(_.y>ut)Ae+=Re,N?U+=ut-_.y:ke++,ve++;else if(_.y+_.height>Re/2+Ae)Ae+=Re,ve++;else break}}const je={x:be,y:ke,width:ne-be,height:ve-ke},nt=W.current;(nt===void 0||nt.y!==je.y||nt.x!==je.x||nt.height!==je.height||nt.width!==je.width||D.current!==xe||R.current!==U||_.width!==((mt=M.current)==null?void 0:mt[0])||_.height!==((et=M.current)==null?void 0:et[1]))&&(g==null||g({x:be,y:ke,width:ne-be,height:ve-ke},_.width,_.height,_.paddingRight??0,xe,U),W.current=je,D.current=xe,R.current=U,M.current=[_.width,_.height])},[t,o,n,g,s,X,N]),Fe=a.useCallback(_=>{ce.current=_,Ce()},[Ce]);return a.useEffect(()=>{Ce()},[Ce]),a.createElement($c,{scrollRef:w,className:m,kineticScrollPerfHack:c==null?void 0:c.kineticScrollPerfHack,preventDiagonalScrolling:h,draggable:A===!0||typeof A=="string",scrollWidth:re+(z??0),scrollHeight:te+(K??0),clientHeight:$,rightElement:y,paddingBottom:K,paddingRight:z,rightElementProps:C,update:Fe,initialSize:I},a.createElement(Tc,{eventTargetRef:w,width:S,height:$,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},Nc=Oc,Xc=tn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),Yc=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Gc=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),Kc=a.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},a.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),Uc=10,Vc=e=>{const{canvasRef:t,cellYOffset:n,rows:o,columns:r,searchInputRef:i,searchValue:l,searchResults:s,onSearchValueChange:c,getCellsForSelection:u,onSearchResultsChanged:f,showSearch:m=!1,onSearchClose:g}=e,[w]=a.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[h,y]=a.useState(""),C=l??h,x=a.useCallback(V=>{y(V),c==null||c(V)},[c]),[v,I]=a.useState(),X=a.useRef(v);X.current=v,a.useEffect(()=>{s!==void 0&&(s.length>0?I(V=>({rowsSearched:o,results:s.length,selectedIndex:(V==null?void 0:V.selectedIndex)??-1})):I(void 0))},[o,s]);const N=a.useRef();N.current===void 0&&(N.current=new AbortController);const A=a.useRef(),[z,K]=a.useState([]),S=s??z,$=a.useCallback(()=>{A.current!==void 0&&(window.cancelAnimationFrame(A.current),A.current=void 0,N.current.abort())},[]),W=a.useRef(n);W.current=n;const D=a.useCallback(V=>{const xe=new RegExp(V.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ne=W.current,be=Math.min(10,o),pe=0;I(void 0),K([]);const U=[],ke=async()=>{var rt;if(u===void 0)return;const ve=performance.now(),je=o-pe;let nt=u({x:0,y:ne,width:r.length,height:Math.min(be,je,o-ne)},N.current.signal);typeof nt=="function"&&(nt=await nt());let mt=!1;for(const[it,ie]of nt.entries())for(const[We,De]of ie.entries()){let Ie;switch(De.kind){case j.Text:case j.Number:Ie=De.displayData;break;case j.Uri:case j.Markdown:Ie=De.data;break;case j.Boolean:Ie=typeof De.data=="boolean"?De.data.toString():void 0;break;case j.Image:case j.Bubble:Ie=De.data.join("🐳");break;case j.Custom:Ie=De.copyData;break}Ie!==void 0&&xe.test(Ie)&&(U.push([We,it+ne]),mt=!0)}const et=performance.now();mt&&K([...U]),pe+=nt.length,Qt(pe<=o);const Ae=((rt=X.current)==null?void 0:rt.selectedIndex)??-1;I({results:U.length,rowsSearched:pe,selectedIndex:Ae}),f==null||f(U,Ae),ne+be>=o?ne=0:ne+=be;const Ve=et-ve,Re=Math.max(Ve,1),ut=Uc/Re;be=Math.ceil(be*ut),pe{var V;g==null||g(),I(void 0),K([]),f==null||f([],-1),$(),(V=t==null?void 0:t.current)==null||V.focus()},[$,t,g,f]),M=a.useCallback(V=>{x(V.target.value),s===void 0&&(V.target.value===""?(I(void 0),K([]),$()):D(V.target.value))},[D,$,x,s]);a.useEffect(()=>{m&&i.current!==null&&(x(""),i.current.focus({preventScroll:!0}))},[m,i,x]);const re=a.useCallback(V=>{var ne;if((ne=V==null?void 0:V.stopPropagation)==null||ne.call(V),v===void 0)return;const xe=(v.selectedIndex+1)%v.results;I({...v,selectedIndex:xe}),f==null||f(S,xe)},[v,f,S]),te=a.useCallback(V=>{var ne;if((ne=V==null?void 0:V.stopPropagation)==null||ne.call(V),v===void 0)return;let xe=(v.selectedIndex-1)%v.results;xe<0&&(xe+=v.results),I({...v,selectedIndex:xe}),f==null||f(S,xe)},[f,S,v]),ce=a.useCallback(V=>{(V.ctrlKey||V.metaKey)&&V.nativeEvent.code==="KeyF"||V.key==="Escape"?(R(),V.stopPropagation(),V.preventDefault()):V.key==="Enter"&&(V.shiftKey?te():re())},[R,re,te]);a.useEffect(()=>()=>{$()},[$]);const[Ce,Fe]=a.useState(!1);a.useEffect(()=>{if(m)Fe(!0);else{const V=setTimeout(()=>Fe(!1),150);return()=>clearTimeout(V)}},[m]);const _=a.useMemo(()=>{if(!m&&!Ce)return null;let V;v!==void 0&&(V=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(V=`${v.selectedIndex+1} of ${V}`));const xe=pe=>{pe.stopPropagation()},be={width:`${Math.floor(((v==null?void 0:v.rowsSearched)??0)/o*100)}%`};return a.createElement(Xc,{className:m?"":"out",onMouseDown:xe,onMouseMove:xe,onMouseUp:xe,onClick:xe},a.createElement("div",{className:"gdg-search-bar-inner"},a.createElement("input",{id:w,"aria-hidden":!m,"data-testid":"search-input",ref:i,onChange:M,value:C,tabIndex:m?void 0:-1,onKeyDownCapture:ce}),a.createElement("button",{"aria-label":"Previous Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:te,disabled:((v==null?void 0:v.results)??0)===0},Yc),a.createElement("button",{"aria-label":"Next Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:re,disabled:((v==null?void 0:v.results)??0)===0},Gc),g!==void 0&&a.createElement("button",{"aria-label":"Close Search","aria-hidden":!m,"data-testid":"search-close-button",tabIndex:m?void 0:-1,onClick:R},Kc)),v!==void 0?a.createElement(a.Fragment,null,a.createElement("div",{className:"gdg-search-status"},a.createElement("div",{"data-testid":"search-result-area"},V)),a.createElement("div",{className:"gdg-search-progress",style:be})):a.createElement("div",{className:"gdg-search-status"},a.createElement("label",{htmlFor:w},"Type to search")))},[m,Ce,v,o,w,i,M,C,ce,te,re,g,R]);return a.createElement(a.Fragment,null,a.createElement(Nc,{prelightCells:S,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),_)},_c=Vc;class qc extends a.PureComponent{constructor(){super(...arguments);Oe(this,"wrapperRef",a.createRef());Oe(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let o=n.target;for(;o!==null;){if(o.classList.contains("click-outside-ignore"))return;o=o.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:o,...r}=this.props;return a.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const jc=()=>e=>Math.max(16,e.targetHeight-10),Zc=tn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[jc(),"px"]}}),Jc=e=>{const{bounds:t,group:n,onClose:o,canvasBounds:r,onFinish:i}=e,[l,s]=vt.useState(n);return vt.createElement(qc,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:o},vt.createElement(Zc,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:o,onFocus:c=>c.target.setSelectionRange(0,l.length),onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"?i(l):c.key==="Escape"&&o()},autoFocus:!0}))};function Qc(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function Be(e,t,n){const o=ns(e,t);return o&&(n.didMatch=!0),o}function ns(e,t){if(e.length===0)return!1;if(e.includes("|")){const c=e.split("|");for(const u of c)if(ns(u,t))return!0;return!1}let n=!1,o=!1,r=!1,i=!1;const l=e.split("+"),s=l.pop();if(!Qc(s,t))return!1;if(l[0]==="any")return!0;for(const c of l)switch(c){case"ctrl":n=!0;break;case"shift":o=!0;break;case"alt":r=!0;break;case"meta":i=!0;break;case"primary":Wr.value?i=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===o&&t.metaKey===i}function ed(e,t,n,o,r,i){const l=vt.useCallback((u,f,m,g)=>{var v;(i==="cell"||i==="multi-cell")&&u!==void 0&&(u={...u,range:{x:u.cell[0],y:u.cell[1],width:1,height:1}});const w=n==="mixed"&&(m||g==="drag"),h=o==="mixed"&&w,y=r==="mixed"&&w;let C={current:u===void 0?void 0:{...u,rangeStack:g==="drag"?((v=e.current)==null?void 0:v.rangeStack)??[]:[]},columns:h?e.columns:st.empty(),rows:y?e.rows:st.empty()};m&&(i==="multi-rect"||i==="multi-cell")&&C.current!==void 0&&e.current!==void 0&&(C={...C,current:{...C.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(C,f)},[o,e,n,i,r,t]),s=vt.useCallback((u,f,m)=>{u=u??e.rows,f!==void 0&&(u=u.add(f));let g;if(r==="exclusive"&&u.length>0)g={current:void 0,columns:st.empty(),rows:u};else{const w=m&&n==="mixed",h=m&&o==="mixed";g={current:w?e.current:void 0,columns:h?e.columns:st.empty(),rows:u}}t(g,!1)},[o,e,n,r,t]),c=vt.useCallback((u,f,m)=>{u=u??e.columns,f!==void 0&&(u=u.add(f));let g;if(o==="exclusive"&&u.length>0)g={current:void 0,rows:st.empty(),columns:u};else{const w=m&&n==="mixed",h=m&&r==="mixed";g={current:w?e.current:void 0,rows:h?e.rows:st.empty(),columns:u}}t(g,!1)},[o,e,n,r,t]);return[l,s,c]}function td(e,t,n,o,r){const i=a.useCallback(u=>{if(e===!0){const f=[];for(let m=u.y;m=r?g.push({kind:j.Loading,allowOverlay:!1}):g.push(t([w,m]));f.push(g)}return f}return(e==null?void 0:e(u,o.signal))??[]},[o.signal,t,e,r]),l=e!==void 0?i:void 0,s=a.useCallback(u=>{if(l===void 0)return[];const f={...u,x:u.x-n};if(f.x<0){f.x=0,f.width--;const m=l(f,o.signal);return typeof m=="function"?async()=>(await m()).map(g=>[{kind:j.Loading,allowOverlay:!1},...g]):m.map(g=>[{kind:j.Loading,allowOverlay:!1},...g])}return l(f,o.signal)},[o.signal,l,n]);return[e!==void 0?s:void 0,l]}function nd(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case j.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===xi?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case j.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case j.Image:case j.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case j.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case j.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case j.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case j.Markdown:case j.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case j.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case j.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case j.Protected:return{formatted:"************",rawValue:"",format:"string"};default:or()}}function od(e,t){return e.map((o,r)=>{const i=t[r];return o.map(l=>l.span!==void 0&&l.span[0]!==i?{formatted:"",rawValue:"",format:"string"}:nd(l))})}function gl(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function rd(e){var n;const t=[];for(const o of e){const r=[];for(const i of o)i.format==="url"?r.push(((n=i.rawValue)==null?void 0:n.toString())??""):i.format==="string-array"?r.push(i.formatted.map(l=>gl(l,!0)).join(",")):r.push(gl(i.formatted,!1));t.push(r.join(" "))}return t.join(` -`)}function fi(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function ml(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function id(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ld(e){var n;const t=[];t.push('',"");for(const o of e){t.push("");for(const r of o){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(``):r.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${fi(r.formatted)}
    ${r.formatted.map((l,s)=>`
  1. `+fi(l)+"
  2. ").join("")}
${fi(r.formatted)}
"),t.join("")}function sd(e,t){const n=od(e,t),o=rd(n),r=ld(n);return{textPlain:o,textHtml:r}}function wl(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const o=[n],r=[];let i;for(;o.length>0;){const s=o.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")o.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)i!==void 0&&r.push(i),i=[],o.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const c=s.cloneNode(!0),f=c.children.length===1&&c.children[0].nodeName==="P"?c.children[0]:null,m=(f==null?void 0:f.children.length)===1&&f.children[0].nodeName==="FONT",g=c.querySelectorAll("br");for(const y of g)y.replaceWith(` -`);const w=c.getAttribute("gdg-raw-value"),h=c.getAttribute("gdg-format")??"string";if(c.querySelector("a")!==null)i==null||i.push({rawValue:((l=c.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:c.textContent??"",format:h});else if(c.querySelector("ol")!==null){const y=c.querySelectorAll("li");i==null||i.push({rawValue:[...y].map(C=>C.getAttribute("gdg-raw-value")??""),formatted:[...y].map(C=>C.textContent??""),format:"string-array"})}else if(w!==null)i==null||i.push({rawValue:id(w),formatted:c.textContent??"",format:h});else{let y=c.textContent??"";m&&(y=y.replace(/\n(?!\n)/g,"")),i==null||i.push({rawValue:y??"",formatted:y??"",format:h})}}}return i!==void 0&&r.push(i),r}function ad(e,t,n,o,r){var s;const i=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const c=(s=e.current)==null?void 0:s.range,u=[];if(c.width>2){const g=t({x:c.x,y:c.y,width:1,height:c.height},r.signal);if(typeof g=="function")return i;u.push(...g);const w=t({x:c.x+c.width-1,y:c.y,width:1,height:c.height},r.signal);if(typeof w=="function")return i;u.push(...w)}else{const g=t({x:c.x,y:c.y,width:c.width,height:c.height},r.signal);if(typeof g=="function")return i;u.push(...g)}let f=c.x-n,m=c.x+c.width-1-n;for(const g of u)for(const w of g)w.span!==void 0&&(f=Math.min(w.span[0],f),m=Math.max(w.span[1],m));f===c.x-n&&m===c.x+c.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:f+n,y:c.y,width:m-f+1,height:c.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function yl(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function cd(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let o=[],r=0,i=t.None;e=e.replace(/\r\n/g,` -`);let l=0;for(const s of e){switch(i){case t.None:s===" "||s===` -`?(o.push(e.slice(r,l)),r=l+1,s===` -`&&(n.push(o),o=[])):s==='"'&&(i=t.inString);break;case t.inString:s==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?i=t.inString:((s===" "||s===` -`)&&(o.push(yl(e.slice(r,l))),r=l+1,s===` -`&&(n.push(o),o=[])),i=t.None);break}l++}return rs.map(c=>({rawValue:c,formatted:c,format:"string"})))}function bl(e,t,n){var s;const o=sd(e,t),r=c=>{var u;(u=window.navigator.clipboard)==null||u.writeText(c)},i=(c,u)=>{var f;return((f=window.navigator.clipboard)==null?void 0:f.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([c],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},l=(c,u)=>{var f,m;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(f=n==null?void 0:n.clipboardData)==null||f.setData("text/plain",c),(m=n==null?void 0:n.clipboardData)==null||m.setData("text/html",u)}catch{i(c,u)||r(c)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(o.textPlain,o.textHtml):r(o.textPlain),n==null||n.preventDefault()}function os(e){return e!==!0}function pl(e){return typeof e=="string"?e:`${e}px`}const dd=()=>e=>e.innerWidth,ud=()=>e=>e.innerHeight,fd=tn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[dd()],"wmyidgi-1":[ud()]}}),hd=e=>{const{inWidth:t,inHeight:n,children:o,...r}=e;return a.createElement(fd,{innerHeight:pl(n),innerWidth:pl(t),...r},o)},gd=2,md=1300;function wd(e,t,n){const o=vt.useRef(0),[r,i]=e??[0,0];vt.useEffect(()=>{if(r===0&&i===0){o.current=0;return}let l=!1,s=0;const c=u=>{var f;if(!l){if(s===0)s=u;else{const m=u-s;o.current=Math.min(1,o.current+m/md);const g=o.current**1.618*m*gd;(f=t.current)==null||f.scrollBy(r*g,i*g),s=u,n==null||n()}window.requestAnimationFrame(c)}};return window.requestAnimationFrame(c),()=>{l=!0}},[t,r,i,n])}function yd({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:o,overscrollX:r,overscrollY:i,scaleToRem:l,remSize:s}){const[c,u,f,m,g,w]=vt.useMemo(()=>{if(!l||s===16)return[e,t,n,o,r,i];const h=s/16,y=e,C=Xl();return[typeof y=="number"?y*h:x=>Math.ceil(y(x)*h),Math.ceil(t*h),Math.ceil(n*h),{...o,headerIconSize:((o==null?void 0:o.headerIconSize)??C.headerIconSize)*h,cellHorizontalPadding:((o==null?void 0:o.cellHorizontalPadding)??C.cellHorizontalPadding)*h,cellVerticalPadding:((o==null?void 0:o.cellVerticalPadding)??C.cellVerticalPadding)*h},Math.ceil((r??0)*h),Math.ceil((i??0)*h)]},[n,t,r,i,s,e,l,o]);return{rowHeight:c,headerHeight:u,groupHeaderHeight:f,theme:m,overscrollX:g,overscrollY:w}}const Gn={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function Le(e,t){return e===!0?t:e===!1?"":e}function vl(e){const t=Wr.value;return{activateCell:Le(e.activateCell," |Enter|shift+Enter"),clear:Le(e.clear,"any+Escape"),closeOverlay:Le(e.closeOverlay,"any+Escape"),acceptOverlayDown:Le(e.acceptOverlayDown,"Enter"),acceptOverlayUp:Le(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:Le(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:Le(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:Le(e.delete,t?"Backspace|Delete":"Delete"),downFill:Le(e.downFill,"primary+_68"),scrollToSelectedCell:Le(e.scrollToSelectedCell,"primary+Enter"),goDownCell:Le(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:Le(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:Le(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:Le(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:Le(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:Le(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:Le(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:Le(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:Le(e.goToFirstCell,"primary+Home"),goToFirstColumn:Le(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:Le(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:Le(e.goToLastCell,"primary+End"),goToLastColumn:Le(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:Le(e.goToLastRow,"primary+ArrowDown"),goToNextPage:Le(e.goToNextPage,"PageDown"),goToPreviousPage:Le(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:Le(e.rightFill,"primary+_82"),search:Le(e.search,"primary+f"),selectAll:Le(e.selectAll,"primary+a"),selectColumn:Le(e.selectColumn,"ctrl+ "),selectGrowDown:Le(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:Le(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:Le(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:Le(e.selectGrowUp,"shift+ArrowUp"),selectRow:Le(e.selectRow,"shift+ "),selectToFirstCell:Le(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:Le(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:Le(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:Le(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:Le(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:Le(e.selectToLastRow,"primary+shift+ArrowDown")}}function bd(e){const t=na(e);return vt.useMemo(()=>{if(t===void 0)return vl(Gn);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Gn.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Gn.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Gn.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Gn.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Gn.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Gn.selectToLastCell};return vl({...Gn,...n})},[t])}function pd(e){function t(o,r,i){if(typeof o=="number")return{headerIndex:o,isCollapsed:!1,depth:r,path:i};const l={headerIndex:o.headerIndex,isCollapsed:o.isCollapsed,depth:r,path:i};return o.subGroups!==void 0&&(l.subGroups=o.subGroups.map((s,c)=>t(s,r+1,[...i,c])).sort((s,c)=>s.headerIndex-c.headerIndex)),l}return e.map((o,r)=>t(o,0,[r])).sort((o,r)=>o.headerIndex-r.headerIndex)}function Fi(e,t){const n=[];function o(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let f=0;fl.skip===!1).map(l=>{const{skip:s,...c}=l;return c})}function Or(e,t){if(t===void 0||Fi.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const o of t){if(n===0)return{path:[...o.path,-1],originalIndex:o.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:o.rows};if(n--,!o.isCollapsed){if(ne===void 0?void 0:Fi(e,t),[e,t]),i=vt.useMemo(()=>r===void 0?t:r.reduce((u,f)=>u+(f.isCollapsed?1:f.rows+1),0),[r,t]),l=vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:f}=Or(u,r);return f?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=vt.useCallback(u=>{if(r===void 0)return u;let f=u;for(const m of r){if(f===0)return;if(f--,!m.isCollapsed){if(f{if(e===void 0)return o==null?void 0:o(u,u,u);if(o===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:f,contentIndex:m,groupIndex:g}=Or(u,r);return f?e.themeOverride:o==null?void 0:o(u,g,m)},[r,o,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:i,rowNumberMapper:s,getRowThemeOverride:c}}function Cd(e,t){const n=vt.useMemo(()=>e===void 0?void 0:Fi(e,t),[e,t]);return{getRowGroupingForPath:is,updateRowGroupingByPath:rs,mapper:vt.useCallback(o=>{if(typeof o=="number")return Or(o,n);const r=Or(o[1],n);return{...r,originalIndex:[o[0],r.originalIndex]}},[n])}}function rs(e,t,n){const[o,...r]=t;return r[0]===-1?e.map((i,l)=>l===o?{...i,...n}:i):e.map((i,l)=>l===o?{...i,subGroups:rs(i.subGroups??[],r,n)}:i)}function is(e,t){const[n,...o]=t;return o[0]===-1?e[n]:is(e[n].subGroups??[],o)}function xd(e,t){const[n]=a.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(o){const r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}));return n.callback=t,n.facade}function kd(e,t,n,o,r){const[i,l]=a.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=a.useMemo(()=>({x:o.current.x,y:i,width:o.current.width??1,height:o.current.height??1,ty:l}),[o,l,i]),[c,u,f]=ta(s),m=a.useRef(r);m.current=r;const g=xd(null,y=>{y!==null&&t!==void 0?y.scrollTop=t:y!==null&&e!==void 0&&(y.scrollLeft=e)}),w=(c.height??1)>1;a.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&w){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&f(),m.current()}},[t,w,f,g]);const h=(c.width??1)>1;return a.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&h){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&f(),m.current()}},[e,h,f,g]),{visibleRegion:c,setVisibleRegion:u,scrollRef:g}}const Sd=a.lazy(async()=>await Sl(()=>import("./data-grid-overlay-editor-K62UQj4H.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));let Md=0;function Rd(e){return Ys(qi(qi(e).filter(t=>t.span!==void 0).map(t=>{var n,o;return io((((n=t.span)==null?void 0:n[0])??0)+1,(((o=t.span)==null?void 0:o[1])??0)+1)})))}function Hr(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Tr={kind:j.Loading,allowOverlay:!1},Ar={columns:st.empty(),rows:st.empty(),current:void 0},Ed=(e,t)=>{var Ui,Vi,_i;const[n,o]=a.useState(Ar),[r,i]=a.useState(),l=a.useRef(null),s=a.useRef(null),[c,u]=a.useState(),f=a.useRef(),m=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:w,markdownDivCreateNode:h,width:y,height:C,columns:x,rows:v,getCellContent:I,onCellClicked:X,onCellActivated:N,onFillPattern:A,onFinishedEditing:z,coercePasteValue:K,drawHeader:S,drawCell:$,editorBloom:W,onHeaderClicked:D,onColumnProposeMove:R,spanRangeBehavior:M="default",onGroupHeaderClicked:re,onCellContextMenu:te,className:ce,onHeaderContextMenu:Ce,getCellsForSelection:Fe,onGroupHeaderContextMenu:_,onGroupHeaderRenamed:V,onCellEdited:xe,onCellsEdited:ne,onSearchResultsChanged:be,searchResults:pe,onSearchValueChange:U,searchValue:ke,onKeyDown:ve,onKeyUp:je,keybindings:nt,editOnType:mt=!0,onRowAppended:et,onColumnMoved:Ae,validateCell:Ve,highlightRegions:Re,rangeSelect:ut="rect",columnSelect:rt="multi",rowSelect:it="multi",rangeSelectionBlending:ie="exclusive",columnSelectionBlending:We="exclusive",rowSelectionBlending:De="exclusive",onDelete:Ie,onDragStart:fe,onMouseMove:Ne,onPaste:Te,copyHeaders:_e=!1,freezeColumns:oe=0,cellActivationBehavior:He="second-click",rowSelectionMode:tt="auto",onHeaderMenuClick:$e,onHeaderIndicatorClick:Ke,getGroupDetails:ft,rowGrouping:Xe,onSearchClose:ze,onItemHovered:Ct,onSelectionCleared:xt,showSearch:Xt,onVisibleRegionChanged:wt,gridSelection:It,onGridSelectionChange:Dt,minColumnWidth:An=50,maxColumnWidth:zn=500,maxColumnAutoWidth:ct,provideEditor:Rn,trailingRowOptions:Pe,freezeTrailingRows:Ze=0,allowedFillDirections:zt="orthogonal",scrollOffsetX:En,scrollOffsetY:nn,verticalBorder:Bt,onDragOverCell:Ue,onDrop:Mt,onColumnResize:at,onColumnResizeEnd:Pt,onColumnResizeStart:Tt,customRenderers:jt,fillHandle:Bo,drawFocusRing:kt=!0,experimental:Ft,fixedShadowX:Ht,fixedShadowY:At,headerIcons:In,imageWindowLoader:sr,initialSize:Bn,isDraggable:Dn,onDragLeave:Fn,onRowMoved:pn,overscrollX:ar,overscrollY:cr,preventDiagonalScrolling:co,rightElement:uo,rightElementProps:fo,trapFocus:_n=!1,smoothScrollX:qn,smoothScrollY:Ln,scaleToRem:Yr=!1,rowHeight:dr=34,headerHeight:ur=36,groupHeaderHeight:Gr=ur,theme:ho,isOutsideClick:Pn,renderers:Lo,resizeIndicator:Kr,scrollToActiveCell:Po=!0}=e,yt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Wt=(yt==null?void 0:yt.kind)??e.rowMarkers??"none",Hi=(yt==null?void 0:yt.width)??e.rowMarkerWidth,Wo=(yt==null?void 0:yt.startIndex)??e.rowMarkerStartIndex??1,go=(yt==null?void 0:yt.theme)??e.rowMarkerTheme,$o=yt==null?void 0:yt.headerTheme,mo=yt==null?void 0:yt.headerAlwaysVisible,dn=(yt==null?void 0:yt.checkboxStyle)??"square",Zt=Math.max(An,20),Wn=Math.max(zn,Zt),jn=Math.max(ct??Wn,Zt),wo=a.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Se,rowNumberMapper:Oo,rowHeight:fr,getRowThemeOverride:un}=vd(Xe,v,dr,w),Ur=a.useMemo(()=>Number.parseFloat(wo.fontSize),[wo]),{rowHeight:fn,headerHeight:yo,groupHeaderHeight:No,theme:Xo,overscrollX:Vr,overscrollY:_r}=yd({groupHeaderHeight:Gr,headerHeight:ur,overscrollX:ar,overscrollY:cr,remSize:Ur,rowHeight:fr,scaleToRem:Yr,theme:ho}),vn=bd(nt),$n=Hi??(v>1e4?48:v>1e3?44:v>100?36:32),on=Wt!=="none",H=on?1:0,bt=et!==void 0,Zn=(Pe==null?void 0:Pe.sticky)===!0,[qr,hr]=a.useState(!1),gr=Xt??qr,bo=a.useCallback(()=>{ze!==void 0?ze():hr(!1)},[ze]),B=a.useMemo(()=>It===void 0?void 0:Hr(It,H),[It,H])??n,$t=a.useRef();$t.current===void 0&&($t.current=new AbortController),a.useEffect(()=>()=>$t==null?void 0:$t.current.abort(),[]);const[St,jr]=td(Fe,I,H,$t.current,Se),po=a.useCallback((d,p,b)=>{if(Ve===void 0)return!0;const F=[d[0]-H,d[1]];return Ve==null?void 0:Ve(F,p,b)},[H,Ve]),vo=a.useRef(It),Ut=a.useCallback((d,p)=>{p&&(d=ad(d,St,H,M,$t.current)),Dt!==void 0?(vo.current=Hr(d,-H),Dt(vo.current)):o(d)},[Dt,St,H,M]),k=ro(at,a.useCallback((d,p,b,F)=>{at==null||at(x[b-H],p,b-H,F)},[at,H,x])),G=ro(Pt,a.useCallback((d,p,b,F)=>{Pt==null||Pt(x[b-H],p,b-H,F)},[Pt,H,x])),de=ro(Tt,a.useCallback((d,p,b,F)=>{Tt==null||Tt(x[b-H],p,b-H,F)},[Tt,H,x])),se=ro(S,a.useCallback((d,p)=>(S==null?void 0:S({...d,columnIndex:d.columnIndex-H},p))??!1,[S,H])),q=ro($,a.useCallback((d,p)=>($==null?void 0:$({...d,col:d.col-H},p))??!1,[$,H])),J=a.useCallback(d=>{if(Ie!==void 0){const p=Ie(Hr(d,-H));return typeof p=="boolean"?p:Hr(p,H)}return!0},[Ie,H]),[ae,ue,Z]=ed(B,Ut,ie,We,De,ut),qe=a.useMemo(()=>Tn(Xl(),Xo),[Xo]),[he,Je]=a.useState([0,0,0]),Ye=a.useMemo(()=>{if(Lo===void 0)return{};const d={};for(const p of Lo)d[p.kind]=p;return d},[Lo]),Ee=a.useCallback(d=>d.kind!==j.Custom?Ye[d.kind]:jt==null?void 0:jt.find(p=>p.isMatch(d)),[jt,Ye]);let{sizedColumns:ot,nonGrowWidth:Vt}=Ea(x,Se,jr,he[0]-(H===0?0:$n)-he[2],Zt,jn,qe,Ee,$t.current);Wt!=="none"&&(Vt+=$n);const pt=a.useMemo(()=>ot.some(d=>d.group!==void 0),[ot]),Yt=pt?yo+No:yo,hn=B.rows.length,_t=Wt==="none"?void 0:hn===0?!1:hn===Se?!0:void 0,ge=a.useMemo(()=>Wt==="none"?ot:[{title:"",width:$n,icon:void 0,hasMenu:!1,style:"normal",themeOverride:go,rowMarker:dn,rowMarkerChecked:_t,headerRowMarkerTheme:$o,headerRowMarkerAlwaysVisible:mo},...ot],[Wt,ot,$n,go,dn,_t,$o,mo]),ht=a.useRef({height:1,width:1,x:0,y:0}),Gt=a.useRef(!1),{setVisibleRegion:On,visibleRegion:Ot,scrollRef:lt}=kd(En,nn,fn,ht,()=>Gt.current=!0);ht.current=Ot;const Jn=Ot.x+H,wr=Ot.y,qt=a.useRef(null),Kt=a.useCallback(d=>{var p;d===!0?(p=qt.current)==null||p.focus():window.requestAnimationFrame(()=>{var b;(b=qt.current)==null||b.focus()})},[]),Nt=bt?Se+1:Se,rn=a.useCallback(d=>{const p=H===0?d:d.map(F=>({...F,location:[F.location[0]-H,F.location[1]]})),b=ne==null?void 0:ne(p);if(b!==!0)for(const F of p)xe==null||xe(F.location,F.value);return b},[xe,ne,H]),[Qn,Zr]=a.useState(),yr=B.current!==void 0&&B.current.range.width*B.current.range.height>1?B.current.range:void 0,Co=kt?(Ui=B.current)==null?void 0:Ui.cell:void 0,br=Co==null?void 0:Co[0],pr=Co==null?void 0:Co[1],ls=a.useMemo(()=>{if((Re===void 0||Re.length===0)&&(yr??br??pr??Qn)===void 0)return;const d=[];if(Re!==void 0)for(const p of Re){const b=ge.length-p.range.x-H;b>0&&d.push({color:p.color,range:{...p.range,x:p.range.x+H,width:Math.min(b,p.range.width)},style:p.style})}return Qn!==void 0&&d.push({color:so(qe.accentColor,0),range:Qn,style:"dashed"}),yr!==void 0&&d.push({color:so(qe.accentColor,.5),range:yr,style:"solid-outline"}),br!==void 0&&pr!==void 0&&d.push({color:qe.accentColor,range:{x:br,y:pr,width:1,height:1},style:"solid-outline"}),d.length>0?d:void 0},[Qn,yr,br,pr,Re,ge.length,qe.accentColor,H]),Ti=a.useRef(ge);Ti.current=ge;const Jt=a.useCallback(([d,p],b=!1)=>{var P,T,L,O,Y,Q,me;const F=bt&&p===Nt-1;if(d===0&&on){if(F)return Tr;const ee=Oo(p);return ee===void 0?Tr:{kind:cn.Marker,allowOverlay:!1,checkboxStyle:dn,checked:(B==null?void 0:B.rows.hasIndex(p))===!0,markerKind:Wt==="clickable-number"?"number":Wt,row:Wo+ee,drawHandle:pn!==void 0,cursor:Wt==="clickable-number"?"pointer":void 0}}else if(F){const ye=d===H?(Pe==null?void 0:Pe.hint)??"":"",le=Ti.current[d];if(((P=le==null?void 0:le.trailingRowOptions)==null?void 0:P.disabled)===!0)return Tr;{const Ge=((T=le==null?void 0:le.trailingRowOptions)==null?void 0:T.hint)??ye,Me=((L=le==null?void 0:le.trailingRowOptions)==null?void 0:L.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:cn.NewRow,hint:Ge,allowOverlay:!1,icon:Me}}}else{const ee=d-H;if(b||(Ft==null?void 0:Ft.strict)===!0){const le=ht.current,Ge=le.x>ee||ee>le.x+le.width||le.y>p||p>le.y+le.height||p>=Qr.current,Me=ee===((Y=(O=le.extras)==null?void 0:O.selected)==null?void 0:Y[0])&&p===((Q=le.extras)==null?void 0:Q.selected[1]);let we=!1;if(((me=le.extras)==null?void 0:me.freezeRegions)!==void 0){for(const Qe of le.extras.freezeRegions)if(lo(Qe,ee,p)){we=!0;break}}if(Ge&&!Me&&!we)return Tr}let ye=I([ee,p]);return H!==0&&ye.span!==void 0&&(ye={...ye,span:[ye.span[0]+H,ye.span[1]+H]}),ye}},[bt,Nt,on,Oo,dn,B==null?void 0:B.rows,Wt,Wo,pn,H,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Ft==null?void 0:Ft.strict,I]),Jr=a.useCallback(d=>{let p=(ft==null?void 0:ft(d))??{name:d};return V!==void 0&&d!==""&&(p={icon:p.icon,name:p.name,overrideTheme:p.overrideTheme,actions:[...p.actions??[],{title:"Rename",icon:"renameIcon",onClick:b=>ti({group:p.name,bounds:b.bounds})}]}),p},[ft,V]),vr=a.useCallback(d=>{var L;const[p,b]=d.cell,F=ge[p],E=(F==null?void 0:F.group)!==void 0?(L=Jr(F.group))==null?void 0:L.overrideTheme:void 0,P=F==null?void 0:F.themeOverride,T=un==null?void 0:un(b);i({...d,theme:Tn(qe,E,P,T,d.content.themeOverride)})},[un,ge,Jr,qe]),xo=a.useCallback((d,p,b)=>{var T;if(B.current===void 0)return;const[F,E]=B.current.cell,P=Jt([F,E]);if(P.kind!==j.Boolean&&P.allowOverlay){let L=P;if(b!==void 0)switch(L.kind){case j.Number:{const O=Ks(()=>b==="-"?-0:Number.parseFloat(b),0);L={...L,data:Number.isNaN(O)?0:O};break}case j.Text:case j.Markdown:case j.Uri:L={...L,data:b};break}vr({target:d,content:L,initialValue:b,cell:[F,E],highlight:b===void 0,forceEditMode:b!==void 0})}else P.kind===j.Boolean&&p&&P.readonly!==!0&&(rn([{location:B.current.cell,value:{...P,data:os(P.data)}}]),(T=qt.current)==null||T.damage([{cell:B.current.cell}]))},[Jt,B,rn,vr]),Ai=a.useCallback((d,p)=>{var E;const b=(E=qt.current)==null?void 0:E.getBounds(d,p);if(b===void 0||lt.current===null)return;const F=Jt([d,p]);F.allowOverlay&&vr({target:b,content:F,initialValue:void 0,highlight:!0,cell:[d,p],forceEditMode:!0})},[Jt,lt,vr]),Rt=a.useCallback((d,p,b="both",F=0,E=0,P=void 0)=>{if(lt.current!==null){const T=qt.current,L=s.current,O=typeof d!="number"?d.unit==="cell"?d.amount:void 0:d,Y=typeof p!="number"?p.unit==="cell"?p.amount:void 0:p,Q=typeof d!="number"&&d.unit==="px"?d.amount:void 0,me=typeof p!="number"&&p.unit==="px"?p.amount:void 0;if(T!==null&&L!==null){let ee={x:0,y:0,width:0,height:0},ye=0,le=0;if((O!==void 0||Y!==void 0)&&(ee=T.getBounds((O??0)+H,Y??0)??ee,ee.width===0||ee.height===0))return;const Ge=L.getBoundingClientRect(),Me=Ge.width/L.offsetWidth;if(Q!==void 0&&(ee={...ee,x:Q-Ge.left-lt.current.scrollLeft,width:1}),me!==void 0&&(ee={...ee,y:me+Ge.top-lt.current.scrollTop,height:1}),ee!==void 0){const we={x:ee.x-F,y:ee.y-E,width:ee.width+2*F,height:ee.height+2*E};let Qe=0;for(let ai=0;ai0&&(gt=ao(Nt,Et,fn));let wn=Qe*Me+Ge.left+H*$n*Me,xn=Ge.right,yn=Ge.top+Yt*Me,kn=Ge.bottom-gt*Me;const Er=ee.width+F*2;switch(P==null?void 0:P.hAlign){case"start":xn=wn+Er;break;case"end":wn=xn-Er;break;case"center":wn=Math.floor((wn+xn)/2)-Er/2,xn=wn+Er;break}const Ir=ee.height+E*2;switch(P==null?void 0:P.vAlign){case"start":kn=yn+Ir;break;case"end":yn=kn-Ir;break;case"center":yn=Math.floor((yn+kn)/2)-Ir/2,kn=yn+Ir;break}wn>we.x?ye=we.x-wn:xnwe.y?le=we.y-yn:kn=Nt-Et)&&(le=0),(ye!==0||le!==0)&&(Me!==1&&(ye/=Me,le/=Me),lt.current.scrollTo(ye+lt.current.scrollLeft,le+lt.current.scrollTop))}}}},[H,Ze,$n,lt,Yt,oe,ot,Nt,Zn,fn]),zi=a.useRef(Ai),Bi=a.useRef(I),Qr=a.useRef(Se);zi.current=Ai,Bi.current=I,Qr.current=Se;const ko=a.useCallback(async(d,p=!0)=>{var O;const b=ge[d];if(((O=b==null?void 0:b.trailingRowOptions)==null?void 0:O.disabled)===!0)return;const F=et==null?void 0:et();let E,P=!0;F!==void 0&&(E=await F,E==="top"&&(P=!1),typeof E=="number"&&(P=!1));let T=0;const L=()=>{if(Qr.current<=Se){T<500&&window.setTimeout(L,T),T=50+T*2;return}const Y=typeof E=="number"?E:P?Se:0;Rr.current(d-H,Y),ae({cell:[d,Y],range:{x:d,y:Y,width:1,height:1}},!1,!1,"edit");const Q=Bi.current([d-H,Y]);Q.allowOverlay&&Qo(Q)&&Q.readonly!==!0&&p&&window.setTimeout(()=>{zi.current(d,Y)},0)};L()},[ge,et,H,Se,ae]),Cr=a.useCallback(d=>{var b,F;const p=((F=(b=ot[d])==null?void 0:b.trailingRowOptions)==null?void 0:F.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof p=="number")return p+(on?1:0);if(typeof p=="object"){const E=x.indexOf(p);if(E>=0)return E+(on?1:0)}},[ot,x,on,Pe==null?void 0:Pe.targetColumn]),Nn=a.useRef(),So=a.useRef(),Yo=a.useCallback((d,p)=>{var E;const[b,F]=p;return Tn(qe,(E=ge[b])==null?void 0:E.themeOverride,un==null?void 0:un(F),d.themeOverride)},[un,ge,qe]),{mapper:eo}=Cd(Xe,v),gn=Xe==null?void 0:Xe.navigationBehavior,Go=a.useCallback(d=>{var Q,me,ee;const p=Wr.value?d.metaKey:d.ctrlKey,b=p&&it==="multi",F=p&&rt==="multi",[E,P]=d.location,T=B.columns,L=B.rows,[O,Y]=((Q=B.current)==null?void 0:Q.cell)??[];if(d.kind==="cell"){if(So.current=void 0,to.current=[E,P],E===0&&on){if(bt===!0&&P===Se||Wt==="number"||it==="none")return;const ye=Jt(d.location);if(ye.kind!==cn.Marker)return;if(pn!==void 0){const Me=Ee(ye);Qt((Me==null?void 0:Me.kind)===cn.Marker);const we=(me=Me==null?void 0:Me.onClick)==null?void 0:me.call(Me,{...d,cell:ye,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,theme:Yo(ye,d.location),preventDefault:()=>{}});if(we===void 0||we.checked===ye.checked)return}i(void 0),Kt();const le=L.hasIndex(P),Ge=Nn.current;if(it==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&Ge!==void 0&&L.hasIndex(Ge)){const Me=[Math.min(Ge,P),Math.max(Ge,P)+1];b||tt==="multi"?ue(void 0,Me,!0):ue(st.fromSingleSelection(Me),void 0,b)}else b||d.isTouch||tt==="multi"?le?ue(L.remove(P),void 0,!0):(ue(void 0,P,!0),Nn.current=P):le&&L.length===1?ue(st.empty(),void 0,p):(ue(st.fromSingleSelection(P),void 0,p),Nn.current=P)}else if(E>=H&&bt&&P===Se){const ye=Cr(E);ko(ye??E)}else if(O!==E||Y!==P){const ye=Jt(d.location),le=Ee(ye);if((le==null?void 0:le.onSelect)!==void 0){let we=!1;if(le.onSelect({...d,cell:ye,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,preventDefault:()=>we=!0,theme:Yo(ye,d.location)}),we)return}if(gn==="block"&&eo(P).isGroupHeader)return;const Ge=Zn&&P===Se,Me=Zn&&B!==void 0&&((ee=B.current)==null?void 0:ee.cell[1])===Se;if((d.shiftKey||d.isLongTouch===!0)&&O!==void 0&&Y!==void 0&&B.current!==void 0&&!Me){if(Ge)return;const we=Math.min(E,O),Qe=Math.max(E,O),gt=Math.min(P,Y),Et=Math.max(P,Y);ae({...B.current,range:{x:we,y:gt,width:Qe-we+1,height:Et-gt+1}},!0,p,"click"),Nn.current=void 0,Kt()}else ae({cell:[E,P],range:{x:E,y:P,width:1,height:1}},!0,p,"click"),Nn.current=void 0,i(void 0),Kt()}}else if(d.kind==="header")if(to.current=[E,P],i(void 0),on&&E===0)Nn.current=void 0,So.current=void 0,it==="multi"&&(L.length!==Se?ue(st.fromSingleSelection([0,Se]),void 0,p):ue(st.empty(),void 0,p),Kt());else{const ye=So.current;if(rt==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&ye!==void 0&&T.hasIndex(ye)){const le=[Math.min(ye,E),Math.max(ye,E)+1];F?Z(void 0,le,p):Z(st.fromSingleSelection(le),void 0,p)}else F?(T.hasIndex(E)?Z(T.remove(E),void 0,p):Z(void 0,E,p),So.current=E):rt!=="none"&&(Z(st.fromSingleSelection(E),void 0,p),So.current=E);Nn.current=void 0,Kt()}else d.kind===an?to.current=[E,P]:d.kind===$r&&!d.isMaybeScrollbar&&(Ut(Ar,!1),i(void 0),Kt(),xt==null||xt(),Nn.current=void 0,So.current=void 0)},[it,rt,B,on,H,bt,Se,Wt,Jt,pn,Kt,tt,Ee,Yo,ue,Cr,ko,gn,eo,Zn,ae,Z,Ut,xt]),Ko=a.useRef(!1),to=a.useRef(),Li=a.useRef(Ot),ln=a.useRef(),ss=a.useCallback(d=>{if(Mo.current=!1,Li.current=ht.current,d.button!==0&&d.button!==1){ln.current=void 0;return}const p=performance.now();ln.current={button:d.button,time:p,location:d.location},(d==null?void 0:d.kind)==="header"&&(Ko.current=!0);const b=d.kind==="cell"&&d.isFillHandle;!b&&d.kind!=="cell"&&d.isEdge||(u({previousSelection:B,fillHandle:b}),to.current=void 0,!d.isTouch&&d.button===0&&!b?Go(d):!d.isTouch&&d.button===1&&(to.current=d.location))},[B,Go]),[ei,ti]=a.useState(),Pi=a.useCallback(d=>{if(d.kind!==an||rt!=="multi")return;const p=Wr.value?d.metaKey:d.ctrlKey,[b]=d.location,F=B.columns;if(b=H&&rr(E.group,ge[L].group);L--)P--;for(let L=b+1;L{if(St!==void 0&&k!==void 0){const p=ht.current.y,b=ht.current.height;let F=St({x:d,y:p,width:1,height:Math.min(b,Se-p)},$t.current.signal);typeof F!="object"&&(F=await F());const E=ot[d-H],T=document.createElement("canvas").getContext("2d",{alpha:!1});if(T!==null){T.font=qe.baseFontFull;const L=Gl(T,qe,E,0,F,Zt,Wn,!1,Ee);k==null||k(E,L.width,d,L.width)}}},[ot,St,Wn,qe,Zt,k,H,Se,Ee]),[as,ni]=a.useState(),Ro=a.useCallback(async(d,p)=>{var L,O;const b=(L=d.current)==null?void 0:L.range;if(b===void 0||St===void 0||p.current===void 0)return;const F=p.current.range;if(A!==void 0){let Y=!1;if(A({fillDestination:{...F,x:F.x-H},patternSource:{...b,x:b.x-H},preventDefault:()=>Y=!0}),Y)return}let E=St(b,$t.current.signal);typeof E!="object"&&(E=await E());const P=E,T=[];for(let Y=0;Y({cell:Y.location})))},[St,rn,A,H]),Wi=a.useCallback(()=>{if(B.current===void 0||B.current.range.width<=1)return;const d={...B,current:{...B.current,range:{...B.current.range,width:1}}};Ro(d,B)},[Ro,B]),$i=a.useCallback(()=>{if(B.current===void 0||B.current.range.height<=1)return;const d={...B,current:{...B.current,range:{...B.current.range,height:1}}};Ro(d,B)},[Ro,B]),cs=a.useCallback((d,p)=>{var Q,me;const b=c;if(u(void 0),Zr(void 0),ni(void 0),Ko.current=!1,p)return;if((b==null?void 0:b.fillHandle)===!0&&B.current!==void 0&&((Q=b.previousSelection)==null?void 0:Q.current)!==void 0){if(Qn===void 0)return;const ee={...B,current:{...B.current,range:ql(b.previousSelection.current.range,Qn)}};Ro(b.previousSelection,ee),Ut(ee,!0);return}const[F,E]=d.location,[P,T]=to.current??[],L=()=>{Mo.current=!0},O=ee=>{var le,Ge,Me;const ye=ee.isTouch||P===F&&T===E;if(ye&&(X==null||X([F-H,E],{...ee,preventDefault:L})),ee.button===1)return!Mo.current;if(!Mo.current){const we=Jt(d.location),Qe=Ee(we);if(Qe!==void 0&&Qe.onClick!==void 0&&ye){const Et=Qe.onClick({...ee,cell:we,posX:ee.localEventX,posY:ee.localEventY,bounds:ee.bounds,theme:Yo(we,d.location),preventDefault:L});Et!==void 0&&!Do(Et)&&Io(Et)&&(rn([{location:ee.location,value:Et}]),(le=qt.current)==null||le.damage([{cell:ee.location}]))}if(Mo.current||B.current===void 0)return!1;let gt=!1;switch(we.activationBehaviorOverride??He){case"double-click":case"second-click":{if(((Me=(Ge=b==null?void 0:b.previousSelection)==null?void 0:Ge.current)==null?void 0:Me.cell)===void 0)break;const[Et,wn]=B.current.cell,[xn,yn]=b.previousSelection.current.cell;gt=F===Et&&F===xn&&E===wn&&E===yn&&(ee.isDoubleClick===!0||He==="second-click");break}case"single-click":{gt=!0;break}}if(gt)return N==null||N([F-H,E]),xo(ee.bounds,!1),!0}return!1},Y=d.location[0]-H;if(d.isTouch){const ee=ht.current,ye=Li.current;if(ee.x!==ye.x||ee.y!==ye.y)return;if(d.isLongTouch===!0){if(d.kind==="cell"&&er((me=B.current)==null?void 0:me.cell,d.location)){te==null||te([Y,d.location[1]],{...d,preventDefault:L});return}else if(d.kind==="header"&&B.columns.hasIndex(F)){Ce==null||Ce(Y,{...d,preventDefault:L});return}else if(d.kind===an){if(Y<0)return;_==null||_(Y,{...d,preventDefault:L});return}}d.kind==="cell"?O(d)||Go(d):d.kind===an?re==null||re(Y,{...d,preventDefault:L}):(d.kind===Kn&&(D==null||D(Y,{...d,preventDefault:L})),Go(d));return}if(d.kind==="header"){if(Y<0)return;d.isEdge?d.isDoubleClick===!0&&xr(F):d.button===0&&F===P&&E===T&&(D==null||D(Y,{...d,preventDefault:L}))}if(d.kind===an){if(Y<0)return;d.button===0&&F===P&&E===T&&(re==null||re(Y,{...d,preventDefault:L}),Mo.current||Pi(d))}d.kind==="cell"&&(d.button===0||d.button===1)&&O(d),to.current=void 0},[c,B,H,Qn,Ro,Ut,X,Jt,Ee,He,Yo,rn,N,xo,te,Ce,_,Go,re,D,xr,Pi]),ds=a.useCallback(d=>{const p={...d,location:[d.location[0]-H,d.location[1]]};Ne==null||Ne(p),c!==void 0&&d.buttons===0&&(u(void 0),Zr(void 0),ni(void 0),Ko.current=!1),ni(b=>{var F;return Ko.current?[d.scrollEdge[0],0]:d.scrollEdge[0]===(b==null?void 0:b[0])&&d.scrollEdge[1]===b[1]?b:c===void 0||(((F=ln.current)==null?void 0:F.location[0])??0){$e==null||$e(d-H,p)},[$e,H]),fs=a.useCallback((d,p)=>{Ke==null||Ke(d-H,p)},[Ke,H]),Cn=(Vi=B==null?void 0:B.current)==null?void 0:Vi.cell,hs=a.useCallback((d,p,b,F,E,P)=>{Gt.current=!1;let T=Cn;T!==void 0&&(T=[T[0]-H,T[1]]);const L=oe===0?void 0:{x:0,y:d.y,width:oe,height:d.height},O=[];L!==void 0&&O.push(L),Ze>0&&(O.push({x:d.x-H,y:Se-Ze,width:d.width,height:Ze}),oe>0&&O.push({x:0,y:Se-Ze,width:oe,height:Ze}));const Y={x:d.x-H,y:d.y,width:d.width,height:bt&&d.y+d.height>=Se?d.height-1:d.height,tx:E,ty:P,extras:{selected:T,freezeRegion:L,freezeRegions:O}};ht.current=Y,On(Y),Je([p,b,F]),wt==null||wt(Y,Y.tx,Y.ty,Y.extras)},[Cn,H,bt,Se,oe,Ze,On,wt]),gs=ro(Ae,a.useCallback((d,p)=>{Ae==null||Ae(d-H,p-H),rt!=="none"&&Z(st.fromSingleSelection(p),void 0,!0)},[rt,Ae,H,Z])),oi=a.useRef(!1),ms=a.useCallback(d=>{if(d.location[0]===0&&H>0){d.preventDefault();return}fe==null||fe({...d,location:[d.location[0]-H,d.location[1]]}),d.defaultPrevented()||(oi.current=!0),u(void 0)},[fe,H]),ws=a.useCallback(()=>{oi.current=!1},[]),Oi=Xe==null?void 0:Xe.selectionBehavior,kr=a.useCallback(d=>{if(Oi!=="block-spanning")return;const{isGroupHeader:p,path:b,groupRows:F}=eo(d);if(p)return[d,d];const E=b[b.length-1],P=d-E,T=d+F-E-1;return[P,T]},[eo,Oi]),ri=a.useRef(),ii=a.useCallback(d=>{var p,b,F;if(!ts(d,ri.current)&&(ri.current=d,!(((p=ln==null?void 0:ln.current)==null?void 0:p.button)!==void 0&&ln.current.button>=1))){if(d.buttons!==0&&c!==void 0&&((b=ln.current)==null?void 0:b.location[0])===0&&d.location[0]===0&&H===1&&it==="multi"&&c.previousSelection&&!c.previousSelection.rows.hasIndex(ln.current.location[1])&&B.rows.hasIndex(ln.current.location[1])){const E=Math.min(ln.current.location[1],d.location[1]),P=Math.max(ln.current.location[1],d.location[1])+1;ue(st.fromSingleSelection([E,P]),void 0,!1)}if(d.buttons!==0&&c!==void 0&&B.current!==void 0&&!oi.current&&!Ko.current&&(ut==="rect"||ut==="multi-rect")){const[E,P]=B.current.cell;let[T,L]=d.location;if(L<0&&(L=ht.current.y),c.fillHandle===!0&&((F=c.previousSelection)==null?void 0:F.current)!==void 0){const O=c.previousSelection.current.range;L=Math.min(L,bt?Se-1:Se);const Y=ic(O,T,L,zt);Zr(Y)}else{if(bt&&P===Se)return;if(bt&&L===Se)if(d.kind===$r)L--;else return;T=Math.max(T,H);const Q=kr(P);L=Q===void 0?L:sn(L,Q[0],Q[1]);const me=T-E,ee=L-P,ye={x:me>=0?E:T,y:ee>=0?P:L,width:Math.abs(me)+1,height:Math.abs(ee)+1};ae({...B.current,range:ye},!0,!1,"drag")}}Ct==null||Ct({...d,location:[d.location[0]-H,d.location[1]]})}},[c,H,it,B,ut,Ct,ue,bt,Se,zt,kr,ae]),ys=a.useCallback(()=>{var T,L;const d=ri.current;if(d===void 0)return;const[p,b]=d.scrollEdge;let[F,E]=d.location;const P=ht.current;p===-1?F=((L=(T=P.extras)==null?void 0:T.freezeRegion)==null?void 0:L.x)??P.x:p===1&&(F=P.x+P.width),b===-1?E=Math.max(0,P.y):b===1&&(E=Math.min(Se-1,P.y+P.height)),F=sn(F,0,ge.length-1),E=sn(E,0,Se-1),ii({...d,location:[F,E]})},[ge.length,ii,Se]);wd(as,lt,ys);const mn=a.useCallback(d=>{if(B.current===void 0)return;const[p,b]=d,[F,E]=B.current.cell,P=B.current.range;let T=P.x,L=P.x+P.width,O=P.y,Y=P.y+P.height;const[Q,me]=kr(E)??[0,Se-1],ee=me+1;if(b!==0)switch(b){case 2:{Y=ee,O=E,Rt(0,Y,"vertical");break}case-2:{O=Q,Y=E+1,Rt(0,O,"vertical");break}case 1:{OE+1?(Y--,Rt(0,Y,"vertical")):(O=Math.max(Q,O-1),Rt(0,O,"vertical"));break}default:or()}if(p!==0)if(p===2)L=ge.length,T=F,Rt(L-1-H,0,"horizontal");else if(p===-2)T=H,L=F+1,Rt(T-H,0,"horizontal");else{let ye=[];if(St!==void 0){const le=St({x:T,y:O,width:L-T-H,height:Y-O},$t.current.signal);typeof le=="object"&&(ye=Rd(le))}if(p===1){let le=!1;if(T0){const Ge=io(T+1,F+1).find(Me=>!ye.includes(Me-H));Ge!==void 0&&(T=Ge,le=!0)}else T++,le=!0;le&&Rt(T,0,"horizontal")}le||(L=Math.min(ge.length,L+1),Rt(L-1-H,0,"horizontal"))}else if(p===-1){let le=!1;if(L>F+1){if(ye.length>0){const Ge=io(L-1,F,-1).find(Me=>!ye.includes(Me-H));Ge!==void 0&&(L=Ge,le=!0)}else L--,le=!0;le&&Rt(L-H,0,"horizontal")}le||(T=Math.max(H,T-1),Rt(T-H,0,"horizontal"))}else or()}ae({cell:B.current.cell,range:{x:T,y:O,width:L-T,height:Y-O}},!0,!1,"keyboard-select")},[St,kr,B,ge.length,H,Se,Rt,ae]),li=a.useRef(Po);li.current=Po;const Xn=a.useCallback((d,p,b,F)=>{const E=Nt-(b?0:1);d=sn(d,H,ot.length-1+H),p=sn(p,0,E);const P=Cn==null?void 0:Cn[0],T=Cn==null?void 0:Cn[1];if(d===P&&p===T)return!1;if(F&&B.current!==void 0){const L=[...B.current.rangeStack];(B.current.range.width>1||B.current.range.height>1)&&L.push(B.current.range),Ut({...B,current:{cell:[d,p],range:{x:d,y:p,width:1,height:1},rangeStack:L}},!0)}else ae({cell:[d,p],range:{x:d,y:p,width:1,height:1}},!0,!1,"keyboard-nav");return f.current!==void 0&&f.current[0]===d&&f.current[1]===p&&(f.current=void 0),li.current&&Rt(d-H,p),!0},[Nt,H,ot.length,Cn,B,Rt,Ut,ae]),bs=a.useCallback((d,p)=>{(r==null?void 0:r.cell)!==void 0&&d!==void 0&&Io(d)&&(rn([{location:r.cell,value:d}]),window.requestAnimationFrame(()=>{var E;(E=qt.current)==null||E.damage([{cell:r.cell}])})),Kt(!0),i(void 0);const[b,F]=p;if(B.current!==void 0&&(b!==0||F!==0)){const E=B.current.cell[1]===Nt-1&&d!==void 0;Xn(sn(B.current.cell[0]+b,0,ge.length-1),sn(B.current.cell[1]+F,0,Nt-1),E,!1)}z==null||z(d,p)},[r==null?void 0:r.cell,Kt,B,z,rn,Nt,Xn,ge.length]),ps=a.useMemo(()=>`gdg-overlay-${Md++}`,[]),no=a.useCallback(d=>{var b,F,E,P;Kt();const p=[];for(let T=d.x;T({cell:T.location})))},[Kt,I,Ee,rn,H]),Uo=r!==void 0,Ni=a.useCallback(d=>{var Ge,Me;const p=()=>{d.stopPropagation(),d.preventDefault()},b={didMatch:!1},{bounds:F}=d,E=B.columns,P=B.rows,T=vn;if(!Uo&&Be(T.clear,d,b))Ut(Ar,!1),xt==null||xt();else if(!Uo&&Be(T.selectAll,d,b))Ut({columns:st.empty(),rows:st.empty(),current:{cell:((Ge=B.current)==null?void 0:Ge.cell)??[H,0],range:{x:H,y:0,width:x.length,height:Se},rangeStack:[]}},!1);else if(Be(T.search,d,b))(Me=l==null?void 0:l.current)==null||Me.focus({preventScroll:!0}),hr(!0);else if(Be(T.delete,d,b)){const we=(J==null?void 0:J(B))??!0;if(we!==!1){const Qe=we===!0?B:we;if(Qe.current!==void 0){no(Qe.current.range);for(const gt of Qe.current.rangeStack)no(gt)}for(const gt of Qe.rows)no({x:H,y:gt,width:x.length,height:1});for(const gt of Qe.columns)no({x:gt,y:0,width:1,height:Se})}}if(b.didMatch)return p(),!0;if(B.current===void 0)return!1;let[L,O]=B.current.cell;const[,Y]=B.current.cell;let Q=!1,me=!1;if(Be(T.scrollToSelectedCell,d,b)?Rr.current(L-H,O):rt!=="none"&&Be(T.selectColumn,d,b)?E.hasIndex(L)?Z(E.remove(L),void 0,!0):rt==="single"?Z(st.fromSingleSelection(L),void 0,!0):Z(void 0,L,!0):it!=="none"&&Be(T.selectRow,d,b)?P.hasIndex(O)?ue(P.remove(O),void 0,!0):it==="single"?ue(st.fromSingleSelection(O),void 0,!0):ue(void 0,O,!0):!Uo&&F!==void 0&&Be(T.activateCell,d,b)?O===Se&&bt?window.setTimeout(()=>{const we=Cr(L);ko(we??L)},0):(N==null||N([L-H,O]),xo(F,!0)):B.current.range.height>1&&Be(T.downFill,d,b)?$i():B.current.range.width>1&&Be(T.rightFill,d,b)?Wi():Be(T.goToNextPage,d,b)?O+=Math.max(1,ht.current.height-4):Be(T.goToPreviousPage,d,b)?O-=Math.max(1,ht.current.height-4):Be(T.goToFirstCell,d,b)?(i(void 0),O=0,L=0):Be(T.goToLastCell,d,b)?(i(void 0),O=Number.MAX_SAFE_INTEGER,L=Number.MAX_SAFE_INTEGER):Be(T.selectToFirstCell,d,b)?(i(void 0),mn([-2,-2])):Be(T.selectToLastCell,d,b)?(i(void 0),mn([2,2])):Uo?(Be(T.closeOverlay,d,b)&&i(void 0),Be(T.acceptOverlayDown,d,b)&&(i(void 0),O++),Be(T.acceptOverlayUp,d,b)&&(i(void 0),O--),Be(T.acceptOverlayLeft,d,b)&&(i(void 0),L--),Be(T.acceptOverlayRight,d,b)&&(i(void 0),L++)):(Be(T.goDownCell,d,b)?O+=1:Be(T.goUpCell,d,b)?O-=1:Be(T.goRightCell,d,b)?L+=1:Be(T.goLeftCell,d,b)?L-=1:Be(T.goDownCellRetainSelection,d,b)?(O+=1,Q=!0):Be(T.goUpCellRetainSelection,d,b)?(O-=1,Q=!0):Be(T.goRightCellRetainSelection,d,b)?(L+=1,Q=!0):Be(T.goLeftCellRetainSelection,d,b)?(L-=1,Q=!0):Be(T.goToLastRow,d,b)?O=Se-1:Be(T.goToFirstRow,d,b)?O=Number.MIN_SAFE_INTEGER:Be(T.goToLastColumn,d,b)?L=Number.MAX_SAFE_INTEGER:Be(T.goToFirstColumn,d,b)?L=Number.MIN_SAFE_INTEGER:(ut==="rect"||ut==="multi-rect")&&(Be(T.selectGrowDown,d,b)?mn([0,1]):Be(T.selectGrowUp,d,b)?mn([0,-1]):Be(T.selectGrowRight,d,b)?mn([1,0]):Be(T.selectGrowLeft,d,b)?mn([-1,0]):Be(T.selectToLastRow,d,b)?mn([0,2]):Be(T.selectToFirstRow,d,b)?mn([0,-2]):Be(T.selectToLastColumn,d,b)?mn([2,0]):Be(T.selectToFirstColumn,d,b)&&mn([-2,0])),me=b.didMatch),gn!==void 0&&gn!=="normal"&&O!==Y){const we=gn==="skip-up"||gn==="skip"||gn==="block",Qe=gn==="skip-down"||gn==="skip"||gn==="block",gt=O=0&&eo(O).isGroupHeader;)O--;O<0&&(O=Y)}else if(!gt&&Qe){for(;O=Se&&(O=Y)}}const ye=Xn(L,O,!1,Q),le=b.didMatch;return le&&(ye||!me||_n)&&p(),le},[gn,Uo,B,vn,rt,it,ut,H,eo,Se,Xn,Ut,xt,x.length,J,_n,no,Z,ue,bt,Cr,ko,N,xo,$i,Wi,mn]),Vo=a.useCallback(d=>{let p=!1;if(ve!==void 0&&ve({...d,cancel:()=>{p=!0}}),p||Ni(d)||B.current===void 0)return;const[b,F]=B.current.cell,E=ht.current;if(mt&&!d.metaKey&&!d.ctrlKey&&B.current!==void 0&&d.key.length===1&&/[ -~]/g.test(d.key)&&d.bounds!==void 0&&Qo(I([b-H,Math.max(0,Math.min(F,Se-1))]))){if((!bt||F!==Se)&&(E.y>F||F>E.y+E.height||E.x>b||b>E.x+E.width))return;xo(d.bounds,!0,d.key),d.stopPropagation(),d.preventDefault()}},[mt,ve,Ni,B,I,H,Se,bt,xo]),vs=a.useCallback((d,p)=>{const b=d.location[0]-H;if(d.kind==="header"&&(Ce==null||Ce(b,{...d,preventDefault:p})),d.kind===an){if(b<0)return;_==null||_(b,{...d,preventDefault:p})}if(d.kind==="cell"){const[F,E]=d.location;te==null||te([b,E],{...d,preventDefault:p}),ua(B,d.location)||Xn(F,E,!1,!1)}},[B,te,_,Ce,H,Xn]),si=a.useCallback(async d=>{var T,L,O;if(!vn.paste)return;function p(Y,Q,me,ee){var le,Ge;const ye=typeof me=="object"?(me==null?void 0:me.join(` -`))??"":(me==null?void 0:me.toString())??"";if(!Do(Y)&&Qo(Y)&&Y.readonly!==!0){const Me=K==null?void 0:K(ye,Y);if(Me!==void 0&&Io(Me))return{location:Q,value:Me};const we=Ee(Y);if(we===void 0)return;if(we.kind===j.Custom){Qt(Y.kind===j.Custom);const Qe=(le=we.onPaste)==null?void 0:le.call(we,ye,Y.data);return Qe===void 0?void 0:{location:Q,value:{...Y,data:Qe}}}else{const Qe=(Ge=we.onPaste)==null?void 0:Ge.call(we,ye,Y,{formatted:ee,formattedString:typeof ee=="string"?ee:ee==null?void 0:ee.join(` -`),rawValue:me});return Qe===void 0?void 0:(Qt(Qe.kind===Y.kind),{location:Q,value:Qe})}}}const b=B.columns,F=B.rows,E=((T=lt.current)==null?void 0:T.contains(document.activeElement))===!0||((L=s.current)==null?void 0:L.contains(document.activeElement))===!0;let P;if(B.current!==void 0?P=[B.current.range.x,B.current.range.y]:b.length===1?P=[b.first()??0,0]:F.length===1&&(P=[H,F.first()??0]),E&&P!==void 0){let Y,Q;const me="text/plain",ee="text/html";if(navigator.clipboard.read!==void 0){const Me=await navigator.clipboard.read();for(const we of Me){if(we.types.includes(ee)){const gt=await(await we.getType(ee)).text(),Et=wl(gt);if(Et!==void 0){Y=Et;break}}we.types.includes(me)&&(Q=await(await we.getType(me)).text())}}else if(navigator.clipboard.readText!==void 0)Q=await navigator.clipboard.readText();else if(d!==void 0&&(d==null?void 0:d.clipboardData)!==null){if(d.clipboardData.types.includes(ee)){const Me=d.clipboardData.getData(ee);Y=wl(Me)}Y===void 0&&d.clipboardData.types.includes(me)&&(Q=d.clipboardData.getData(me))}else return;const[ye,le]=P,Ge=[];do{if(Te===void 0){const Me=Jt(P),we=Q??(Y==null?void 0:Y.map(gt=>gt.map(Et=>Et.rawValue).join(" ")).join(" "))??"",Qe=p(Me,P,we,void 0);Qe!==void 0&&Ge.push(Qe);break}if(Y===void 0){if(Q===void 0)return;Y=cd(Q)}if(Te===!1||typeof Te=="function"&&(Te==null?void 0:Te([P[0]-H,P[1]],Y.map(Me=>Me.map(we=>{var Qe;return((Qe=we.rawValue)==null?void 0:Qe.toString())??""}))))!==!0)return;for(const[Me,we]of Y.entries()){if(Me+le>=Se)break;for(const[Qe,gt]of we.entries()){const Et=[Qe+ye,Me+le],[wn,xn]=Et;if(wn>=ge.length||xn>=Nt)continue;const yn=Jt(Et),kn=p(yn,Et,gt.rawValue,gt.formatted);kn!==void 0&&Ge.push(kn)}}}while(!1);rn(Ge),(O=qt.current)==null||O.damage(Ge.map(Me=>({cell:Me.location})))}},[K,Ee,Jt,B,vn.paste,lt,ge.length,rn,Nt,Te,H,Se]);Lt("paste",si,m,!1,!0);const _o=a.useCallback(async(d,p)=>{var T,L;if(!vn.copy)return;const b=p===!0||((T=lt.current)==null?void 0:T.contains(document.activeElement))===!0||((L=s.current)==null?void 0:L.contains(document.activeElement))===!0,F=B.columns,E=B.rows,P=(O,Y)=>{if(!_e)bl(O,Y,d);else{const Q=Y.map(me=>({kind:j.Text,data:x[me].title,displayData:x[me].title,allowOverlay:!1}));bl([Q,...O],Y,d)}};if(b&&St!==void 0){if(B.current!==void 0){let O=St(B.current.range,$t.current.signal);typeof O!="object"&&(O=await O()),P(O,io(B.current.range.x-H,B.current.range.x+B.current.range.width-H))}else if(E!==void 0&&E.length>0){const Y=[...E].map(Q=>{const me=St({x:H,y:Q,width:x.length,height:1},$t.current.signal);return typeof me=="object"?me[0]:me().then(ee=>ee[0])});if(Y.some(Q=>Q instanceof Promise)){const Q=await Promise.all(Y);P(Q,io(x.length))}else P(Y,io(x.length))}else if(F.length>0){const O=[],Y=[];for(const Q of F){let me=St({x:Q,y:0,width:1,height:Se},$t.current.signal);typeof me!="object"&&(me=await me()),O.push(me),Y.push(Q-H)}if(O.length===1)P(O[0],Y);else{const Q=O.reduce((me,ee)=>me.map((ye,le)=>[...ye,...ee[le]]));P(Q,Y)}}}},[x,St,B,vn.copy,H,lt,Se,_e]);Lt("copy",_o,m,!1,!1);const Cs=a.useCallback(async d=>{var b,F;if(!(!vn.cut||!(((b=lt.current)==null?void 0:b.contains(document.activeElement))===!0||((F=s.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await _o(d),B.current!==void 0)){let E={current:{cell:B.current.cell,range:B.current.range,rangeStack:[]},rows:st.empty(),columns:st.empty()};const P=J==null?void 0:J(E);if(P===!1||(E=P===!0?E:P,E.current===void 0))return;no(E.current.range)}},[no,B,vn.cut,_o,lt,J]);Lt("cut",Cs,m,!1,!1);const xs=a.useCallback((d,p)=>{if(be!==void 0){H!==0&&(d=d.map(E=>[E[0]-H,E[1]])),be(d,p);return}if(d.length===0||p===-1)return;const[b,F]=d[p];f.current!==void 0&&f.current[0]===b&&f.current[1]===F||(f.current=[b,F],Xn(b,F,!1,!1))},[be,H,Xn]),[Sr,Mr]=((_i=It==null?void 0:It.current)==null?void 0:_i.cell)??[],Rr=a.useRef(Rt);Rr.current=Rt,a.useLayoutEffect(()=>{var d,p,b,F;li.current&&!Gt.current&&Sr!==void 0&&Mr!==void 0&&(Sr!==((p=(d=vo.current)==null?void 0:d.current)==null?void 0:p.cell[0])||Mr!==((F=(b=vo.current)==null?void 0:b.current)==null?void 0:F.cell[1]))&&Rr.current(Sr,Mr),Gt.current=!1},[Sr,Mr]);const Xi=B.current!==void 0&&(B.current.cell[0]>=ge.length||B.current.cell[1]>=Nt);a.useLayoutEffect(()=>{Xi&&Ut(Ar,!1)},[Xi,Ut]);const ks=a.useMemo(()=>bt===!0&&(Pe==null?void 0:Pe.tint)===!0?st.fromSingleSelection(Nt-1):st.empty(),[Nt,bt,Pe==null?void 0:Pe.tint]),Ss=a.useCallback(d=>typeof Bt=="boolean"?Bt:(Bt==null?void 0:Bt(d-H))??!0,[H,Bt]),Ms=a.useMemo(()=>{if(ei===void 0||s.current===null)return null;const{bounds:d,group:p}=ei,b=s.current.getBoundingClientRect();return a.createElement(Jc,{bounds:d,group:p,canvasBounds:b,onClose:()=>ti(void 0),onFinish:F=>{ti(void 0),V==null||V(p,F)}})},[V,ei]),Rs=Math.min(ge.length,oe+(on?1:0));a.useImperativeHandle(t,()=>({appendRow:(d,p)=>ko(d+H,p),updateCells:d=>{var p;return H!==0&&(d=d.map(b=>({cell:[b.cell[0]+H,b.cell[1]]}))),(p=qt.current)==null?void 0:p.damage(d)},getBounds:(d,p)=>{var b;if(!((s==null?void 0:s.current)===null||(lt==null?void 0:lt.current)===null)){if(d===void 0&&p===void 0){const F=s.current.getBoundingClientRect(),E=F.width/lt.current.clientWidth;return{x:F.x-lt.current.scrollLeft*E,y:F.y-lt.current.scrollTop*E,width:lt.current.scrollWidth*E,height:lt.current.scrollHeight*E}}return(b=qt.current)==null?void 0:b.getBounds((d??0)+H,p)}},focus:()=>{var d;return(d=qt.current)==null?void 0:d.focus()},emit:async d=>{switch(d){case"delete":Vo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Vo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Vo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await _o(void 0,!0);break;case"paste":await si();break}},scrollTo:Rt,remeasureColumns:d=>{for(const p of d)xr(p+H)}}),[ko,xr,lt,_o,Vo,si,H,Rt]);const[Yi,Gi]=Cn??[],Es=a.useCallback(d=>{const[p,b]=d;if(b===-1){rt!=="none"&&(Z(st.fromSingleSelection(p),void 0,!1),Kt());return}Yi===p&&Gi===b||(ae({cell:d,range:{x:p,y:b,width:1,height:1}},!0,!1,"keyboard-nav"),Rt(p,b))},[rt,Kt,Rt,Yi,Gi,ae,Z]),[Is,Ds]=a.useState(!1),Ki=a.useRef(Ml(d=>{Ds(d)},5)),Fs=a.useCallback(()=>{Ki.current(!0),B.current===void 0&&B.columns.length===0&&B.rows.length===0&&c===void 0&&ae({cell:[H,wr],range:{x:H,y:wr,width:1,height:1}},!0,!1,"keyboard-select")},[wr,B,c,H,ae]),Hs=a.useCallback(()=>{Ki.current(!1)},[]),[Ts,As]=a.useMemo(()=>{let d;const p=(Ft==null?void 0:Ft.scrollbarWidthOverride)??yi(),b=Se+(bt?1:0);if(typeof fn=="number")d=Yt+b*fn;else{let E=0;const P=Math.min(b,10);for(let T=0;TP.width+E,0)+p;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,d)}px`]},[ge,Ft==null?void 0:Ft.scrollbarWidthOverride,fn,Se,bt,Yt]),zs=a.useMemo(()=>Ma(qe),[qe]);return a.createElement(Yl.Provider,{value:qe},a.createElement(hd,{style:zs,className:ce,inWidth:y??Ts,inHeight:C??As},a.createElement(_c,{fillHandle:Bo,drawFocusRing:kt,experimental:Ft,fixedShadowX:Ht,fixedShadowY:At,getRowThemeOverride:un,headerIcons:In,imageWindowLoader:sr,initialSize:Bn,isDraggable:Dn,onDragLeave:Fn,onRowMoved:pn,overscrollX:Vr,overscrollY:_r,preventDiagonalScrolling:co,rightElement:uo,rightElementProps:fo,smoothScrollX:qn,smoothScrollY:Ln,className:ce,enableGroups:pt,onCanvasFocused:Fs,onCanvasBlur:Hs,canvasRef:s,onContextMenu:vs,theme:qe,cellXOffset:Jn,cellYOffset:wr,accessibilityHeight:Ot.height,onDragEnd:ws,columns:ge,nonGrowWidth:Vt,drawHeader:se,onColumnProposeMove:R,drawCell:q,disabledRows:ks,freezeColumns:Rs,lockColumns:H,firstColAccessible:H===0,getCellContent:Jt,minColumnWidth:Zt,maxColumnWidth:Wn,searchInputRef:l,showSearch:gr,onSearchClose:bo,highlightRegions:ls,getCellsForSelection:St,getGroupDetails:Jr,headerHeight:yo,isFocused:Is,groupHeaderHeight:pt?No:0,freezeTrailingRows:Ze+(bt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:bt,onColumnResize:k,onColumnResizeEnd:G,onColumnResizeStart:de,onCellFocused:Es,onColumnMoved:gs,onDragStart:ms,onHeaderMenuClick:us,onHeaderIndicatorClick:fs,onItemHovered:ii,isFilling:(c==null?void 0:c.fillHandle)===!0,onMouseMove:ds,onKeyDown:Vo,onKeyUp:je,onMouseDown:ss,onMouseUp:cs,onDragOverCell:Ue,onDrop:Mt,onSearchResultsChanged:xs,onVisibleRegionChanged:hs,clientSize:he,rowHeight:fn,searchResults:pe,searchValue:ke,onSearchValueChange:U,rows:Nt,scrollRef:lt,selection:B,translateX:Ot.tx,translateY:Ot.ty,verticalBorder:Ss,gridRef:qt,getCellRenderer:Ee,resizeIndicator:Kr}),Ms,r!==void 0&&a.createElement(a.Suspense,{fallback:null},a.createElement(Sd,{...r,validateCell:po,bloom:W,id:ps,getCellRenderer:Ee,className:(Ft==null?void 0:Ft.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:Rn,imageEditorOverride:g,onFinishEditing:bs,markdownDivCreateNode:h,isOutsideClick:Pn}))))},Id=a.forwardRef(Ed),Cl=20,Dd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:j.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Fd(e,e.cell.data,wi(e.cell),e.cell.maxSize??Cl,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onClick:e=>{const{cell:t,posX:n,posY:o,bounds:r,theme:i}=e,{width:l,height:s,x:c,y:u}=r,f=t.maxSize??Cl,m=Math.floor(r.y+s/2),g=Dl(f,s,i.cellVerticalPadding),w=Il(t.contentAlign??"center",c,l,i.cellHorizontalPadding,g),h=El(w,m,g),y=Fl(c+n,u+o,h);if(wi(t)&&y)return{...t,data:os(t.data)}},onPaste:(e,t)=>{let n=Br;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=xi),n===t.data?void 0:{...t,data:n}}};function Fd(e,t,n,o,r){if(!n&&t===Br)return;const{ctx:i,hoverAmount:l,theme:s,rect:c,highlighted:u,hoverX:f,hoverY:m,cell:{contentAlign:g}}=e,{x:w,y:h,width:y,height:C}=c;let x=!1;if(r>0){let v=n?1-r+r*l:.4;if(t===Br&&(v*=l),v===0)return;v<1&&(x=!0,i.globalAlpha=v)}Ii(i,s,t,w,h,y,C,u,f,m,o,g),x&&(i.globalAlpha=1)}const Hd=tn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Td=e=>{const{bubbles:t}=e;return a.createElement(Hd,null,t.map((n,o)=>a.createElement("div",{key:o,className:"boe-bubble"},n)),a.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Ad=Td,zd={getAccessibilityString:e=>Hl(e.data),kind:j.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r).width+o+20,0)+2*n.cellHorizontalPadding-4,draw:e=>Ld(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return a.createElement(Ad,{bubbles:t.data})},onPaste:()=>{}},Bd=4;function Ld(e,t){const{rect:n,theme:o,ctx:r,highlighted:i}=e,{x:l,y:s,width:c,height:u}=n,f=20,m=8,g=Bd;let w=l+o.cellHorizontalPadding;const h=[];for(const y of t){if(w>l+c)break;const C=zo(y,r,o.baseFontFull).width;h.push({x:w,width:C}),w+=C+m*2+g}r.beginPath();for(const y of h)Mn(r,y.x,s+(u-f)/2,y.width+m*2,f,o.roundingRadius??f/2);r.fillStyle=i?o.bgBubbleSelected:o.bgBubble,r.fill();for(const[y,C]of h.entries())r.beginPath(),r.fillStyle=o.textBubble,r.fillText(t[y],C.x+m,s+u/2+Un(r,o))}const Pd=tn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Wd=e=>{const{drilldowns:t}=e;return a.createElement(Pd,null,t.map((n,o)=>a.createElement("div",{key:o,className:"doe-bubble"},n.img!==void 0&&a.createElement("img",{src:n.img}),a.createElement("div",null,n.text))))},$d=Wd,Od={getAccessibilityString:e=>Hl(e.data.map(t=>t.text)),kind:j.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,r)=>e.measureText(r.text).width+o+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Yd(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return a.createElement($d,{drilldowns:t.data})},onPaste:()=>{}},Nd=4,hi={};function Xd(e,t,n,o){const r=Math.ceil(window.devicePixelRatio),i=5,l=n-i*2,s=4,c=n*r,u=o+i,f=o*3,m=(f+i*2)*r,g=`${e},${t},${r},${n}`;if(hi[g]!==void 0)return{el:hi[g],height:c,width:m,middleWidth:s*r,sideWidth:u*r,padding:i*r,dpr:r};const w=document.createElement("canvas"),h=w.getContext("2d");return h===null?null:(w.width=m,w.height=c,h.scale(r,r),hi[g]=w,h.beginPath(),Mn(h,i,i,f,l,o),h.shadowColor="rgba(24, 25, 34, 0.4)",h.shadowBlur=1,h.fillStyle=e,h.fill(),h.shadowColor="rgba(24, 25, 34, 0.3)",h.shadowOffsetY=1,h.shadowBlur=5,h.fillStyle=e,h.fill(),h.shadowOffsetY=0,h.shadowBlur=0,h.shadowBlur=0,h.beginPath(),Mn(h,i+.5,i+.5,f,l,o),h.strokeStyle=t,h.lineWidth=1,h.stroke(),{el:w,height:c,width:m,sideWidth:u*r,middleWidth:o*r,padding:i*r,dpr:r})}function Yd(e,t){const{rect:n,theme:o,ctx:r,imageLoader:i,col:l,row:s}=e,{x:c,width:u}=n,f=o.baseFontFull,m=Wl(r,f),g=Math.min(n.height,Math.max(16,Math.ceil(m*o.lineHeight)*2)),w=Math.floor(n.y+(n.height-g)/2),h=g-10,y=8,C=Nd;let x=c+o.cellHorizontalPadding;const v=o.roundingRadius??6,I=Xd(o.bgCell,o.drilldownBorder,g,v),X=[];for(const N of t){if(x>c+u)break;const z=zo(N.text,r,f).width;let K=0;N.img!==void 0&&i.loadOrGetImage(N.img,l,s)!==void 0&&(K=h-8+4);const S=z+K+y*2;X.push({x,width:S}),x+=S+C}if(I!==null){const{el:N,height:A,middleWidth:z,sideWidth:K,width:S,dpr:$,padding:W}=I,D=K/$,R=W/$;for(const M of X){const re=Math.floor(M.x),te=Math.floor(M.width),ce=te-(D-R)*2;r.imageSmoothingEnabled=!1,r.drawImage(N,0,0,K,A,re-R,w,D,g),ce>0&&r.drawImage(N,K,0,z,A,re+(D-R),w,ce,g),r.drawImage(N,S-K,0,K,A,re+te-(D-R),w,D,g),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[N,A]of X.entries()){const z=t[N];let K=A.x+y;if(z.img!==void 0){const S=i.loadOrGetImage(z.img,l,s);if(S!==void 0){const $=h-8;let W=0,D=0,R=S.width,M=S.height;R>M?(W+=(R-M)/2,R=M):M>R&&(D+=(M-R)/2,M=R),r.beginPath(),Mn(r,K,w+g/2-$/2,$,$,o.roundingRadius??3),r.save(),r.clip(),r.drawImage(S,W,D,R,M,K,w+g/2-$/2,$,$),r.restore(),K+=$+4}}r.beginPath(),r.fillStyle=o.textBubble,r.fillText(z.text,K,w+g/2+Un(r,o))}}const Gd={getAccessibilityString:e=>e.data.join(", "),kind:j.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Kd(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:o}=e,r=o??oa;return a.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const o=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(o.length===t.data.length&&o.every((r,i)=>r===t.data[i])))return{...t,data:o}}},gi=4;function Kd(e,t,n,o){const{rect:r,col:i,row:l,theme:s,ctx:c,imageLoader:u}=e,{x:f,y:m,height:g,width:w}=r,h=g-s.cellVerticalPadding*2,y=[];let C=0;for(let v=0;v0&&(c.beginPath(),Mn(c,x,m+s.cellVerticalPadding,I,h,n),c.save(),c.clip()),c.drawImage(v,x,m+s.cellVerticalPadding,I,h),n>0&&c.restore(),x+=I+gi}}function Ud(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Vd={getAccessibilityString:()=>"",kind:j.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:r,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Ud(n,o)*t.skeletonWidthVariability));const c=l.cellHorizontalPadding,u=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Mn(r,i.x+c,i.y+(i.height-u)/2,s,u,l.roundingRadius??3),r.fillStyle=so(l.textDark,.1),r.fill()},onPaste:()=>{}},_d=()=>e=>e.targetWidth,xl=tn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[_d(),"px"]}}),qd=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:r,targetRect:i,onFinish:l,validatedSelection:s}=e,c=t.data,u=t.readonly===!0,[f,m]=a.useState(c===""||o),g=a.useCallback(()=>{m(h=>!h)},[]),w=c?"gdg-ml-6":"";return f?a.createElement(xl,{targetWidth:i.width-20},a.createElement(Nr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},onChange:n}),a.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${w}`,onClick:()=>l(t)},a.createElement(js,null))):a.createElement(xl,{targetWidth:i.width},a.createElement(ia,{contents:c,createNode:r}),!u&&a.createElement(a.Fragment,null,a.createElement("div",{className:"spacer"}),a.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${w}`,onClick:g},a.createElement(ki,null))),a.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},jd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:lr,measure:(e,t,n)=>{const o=t.data.split(` -`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>Sn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:o,onFinishedEditing:r,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:s}=e;return a.createElement(qd,{onFinish:r,targetRect:o,value:n,validatedSelection:s,onChange:c=>t({...n,data:c.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Zd={getAccessibilityString:e=>e.row.toString(),kind:cn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Jd,measure:()=>44,draw:e=>eu(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:o,posY:r}=e,{width:i,height:l}=t,s=n.drawHandle?7+(i-7)/2:i/2,c=l/2;if(Math.abs(o-s)<=10&&Math.abs(r-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Jd(e,t){const{ctx:n,theme:o}=e,r=o.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==r&&(n.font=r,i.font=r),i.deprep=Qd,n.textAlign="center",i}function Qd(e){const{ctx:t}=e;t.textAlign="start"}function eu(e,t,n,o,r,i){const{ctx:l,rect:s,hoverAmount:c,theme:u}=e,{x:f,y:m,width:g,height:w}=s,h=n?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&h>0){l.globalAlpha=h;const y=7*(n?c:1);if(Ii(l,u,n,r?f+y:f,m,r?g-y:g,w,!0,void 0,void 0,18,"center",i),r){l.globalAlpha=c,l.beginPath();for(const C of[3,6])for(const x of[-5,-1,3])l.rect(f+C,m+w/2+x,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const y=t.toString(),C=u.markerFontFull,x=f+g/2;o==="both"&&c!==0&&(l.globalAlpha=1-c),l.fillStyle=u.textLight,l.font=C,l.fillText(y,x,m+w/2+Un(l,C)),c!==0&&(l.globalAlpha=1)}}const tu={getAccessibilityString:()=>"",kind:cn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>nu(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function nu(e,t,n){const{ctx:o,rect:r,hoverAmount:i,theme:l,spriteManager:s}=e,{x:c,y:u,width:f,height:m}=r;o.beginPath(),o.globalAlpha=i,o.rect(c+1,u+1,f,m-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const g=t!=="";let w=0;if(n!==void 0){const y=m-8,C=c+8/2,x=u+8/2;s.drawSprite(n,"normal",o,C,x,y,l,g?1:i),w=y}else{w=24;const h=12,y=g?h:i*h,C=g?0:(1-i)*h*.5,x=l.cellHorizontalPadding+4;y>0&&(o.moveTo(c+x+C,u+m/2),o.lineTo(c+x+C+y,u+m/2),o.moveTo(c+x+C+y*.5,u+m/2-y*.5),o.lineTo(c+x+C+y*.5,u+m/2+y*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,w+c+l.cellHorizontalPadding+.5,u+m/2+Un(o,l)),o.beginPath()}const ou=a.lazy(async()=>await Sl(()=>import("./number-overlay-editor-3ljU3NGx.js"),__vite__mapDeps([8,1,3,9]),import.meta.url)),ru={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:lr,draw:e=>Sn(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:r}=e;return a.createElement(a.Suspense,{fallback:null},a.createElement(ou,{highlight:t,disabled:o.readonly===!0,value:o.data,fixedDecimals:o.fixedDecimals,allowNegative:o.allowNegative,thousandSeparator:o.thousandSeparator,decimalSeparator:o.decimalSeparator,validatedSelection:r,onChange:i=>n({...o,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const o=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(o)||t.data===o))return{...t,data:o,displayData:n.formattedString??t.displayData}}},iu={getAccessibilityString:()=>"",measure:()=>108,kind:j.Protected,needsHover:!1,needsHoverPosition:!1,draw:lu,onPaste:()=>{}};function lu(e){const{ctx:t,theme:n,rect:o}=e,{x:r,y:i,height:l}=o;t.beginPath();const s=2.5;let c=r+n.cellHorizontalPadding+s;const u=i+l/2,f=Math.cos(el(30))*s,m=Math.sin(el(30))*s;for(let g=0;g<12;g++)t.moveTo(c,u-s),t.lineTo(c,u+s),t.moveTo(c+f,u-m),t.lineTo(c-f,u+m),t.moveTo(c-f,u-m),t.lineTo(c+f,u+m),c+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const su={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>lr(e,t,e.theme.textLight),draw:e=>Sn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:r}=e;return vt.createElement(Nr,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:r,onChange:i=>n({...o,data:i.target.value})})},onPaste:()=>{}},au={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:lr,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:r,rect:i,theme:l,overrideCursor:s}=e,{displayData:c,contentAlign:u,hoverEffect:f,allowWrapping:m}=t;if(f===!0&&n>0){r.textBaseline="alphabetic";const g=l.cellHorizontalPadding,w=l.cellVerticalPadding,h=zo(c,r,l.baseFontFull,"alphabetic"),y=i.height-w,C=Math.min(y,h.actualBoundingBoxAscent*2.5);r.beginPath(),Mn(r,i.x+g/2,i.y+(i.height-C)/2+1,h.width+g*3,C-1,l.roundingRadius??4),r.globalAlpha=n,r.fillStyle=so(l.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=l.textDark,r.textBaseline="middle",s==null||s("text")}Sn(e,c,u,m,o)},measure:(e,t,n)=>{const o=t.displayData.split(` -`,t.allowWrapping===!0?void 0:1);let r=0;for(const i of o)r=Math.max(r,e.measureText(i).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:o,value:r,validatedSelection:i}=t;return a.createElement(Nr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:i,onChange:l=>o({...r,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},cu=tn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),du=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:r,validatedSelection:i,preview:l}=e,[s,c]=a.useState(!r&&(t===""||o)),u=a.useCallback(()=>{c(!0)},[]);return s?a.createElement(Nr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):a.createElement(cu,null,a.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!r&&a.createElement("div",{className:"gdg-edit-icon",onClick:u},a.createElement(ki,null)),a.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},uu=du;function kl(e,t,n,o){let r=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return o==="right"?r=t.width-l-n.cellHorizontalPadding:o==="center"&&(r=t.width/2-l/2),{x:r,y:i,width:l,height:s}}const fu={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:j.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:lr,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:r,hoverY:i,rect:l,ctx:s}=e,c=t.displayData??t.data,u=t.hoverEffect===!0;if(o!==void 0&&u&&r!==void 0&&i!==void 0){const f=zo(c,s,n.baseFontFull),m=kl(f,l,n,t.contentAlign),{x:g,y:w,width:h,height:y}=m;if(r>=g-4&&r<=g-4+h+8&&i>=w-4&&i<=w-4+y+8){const C=Un(s,n.baseFontFull);o("pointer");const x=5,v=w-C;s.beginPath(),s.moveTo(l.x+g,Math.floor(l.y+v+y+x)+.5),s.lineTo(l.x+g+h,Math.floor(l.y+v+y+x)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,Sn({...e,rect:{...l,x:l.x-1}},c,t.contentAlign),Sn({...e,rect:{...l,x:l.x-2}},c,t.contentAlign),Sn({...e,rect:{...l,x:l.x+1}},c,t.contentAlign),Sn({...e,rect:{...l,x:l.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=u?n.linkColor:n.textDark,Sn(e,c,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:r,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=Ll(l,i.baseFontFull);if(s===void 0)return;const c=kl(s,n,i,t.contentAlign);lo({x:c.x-4,y:c.y-4,width:c.width+8,height:c.height+8},o,r)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:o,forceEditMode:r,validatedSelection:i}=t;return a.createElement(uu,{forceEditMode:o.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:o.data,preview:o.displayData??o.data,validatedSelection:i,readonly:o.readonly===!0,onChange:l=>n({...o,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},hu=[Zd,tu,Dd,zd,Od,Gd,Vd,jd,ru,iu,su,au,fu],mi=[];class gu extends Ol{constructor(){super(...arguments);Oe(this,"imageLoaded",()=>{});Oe(this,"loadedLocations",[]);Oe(this,"cache",{});Oe(this,"sendLoaded",Xs(()=>{this.imageLoaded(new nr(this.loadedLocations)),this.loadedLocations=[]},20));Oe(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const o of n){const r=this.cache[o];let i=!1;for(let l=0;l{c||(c=!0,mi.length<12?mi.unshift(s):l||(s.src=""))}},f=new Promise(m=>s.addEventListener("load",()=>m(null)));requestAnimationFrame(async()=>{try{s.src=n,await f,await s.decode();const m=this.cache[i];if(m!==void 0&&!c){m.img=s;for(const g of m.cells)this.loadedLocations.push(Ei(g));l=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[i]=u}loadOrGetImage(n,o,r){const i=n,l=this.cache[i];if(l!==void 0){const s=bn(o,r);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,r,i)}}const mu=gu,wu=(e,t)=>{const n=a.useMemo(()=>({...nc,...e.headerIcons}),[e.headerIcons]),o=a.useMemo(()=>e.imageWindowLoader??new mu,[e.imageWindowLoader]);return a.createElement(Id,{...e,renderers:hu,headerIcons:n,ref:t,imageWindowLoader:o})},Iu=a.forwardRef(wu);export{qc as C,Iu as D,j as G,Yl as T,Nr as a,en as b,Mu as c,Ru as d,ku as e,Io as f,Un as g,Zi as h,Su as i,Do as j,Us as k,Ma as l,zo as m,To as p,Mn as r,Eu as u}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-K62UQj4H.js","./index-BMVQvedj.js","./index-wocATsGp.js","./marked.esm-dbrxtycE.js","./iframe-0-Di66Z3.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./number-overlay-editor-3ljU3NGx.js","./react-number-format.es-2Vaki8Uh.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} \ No newline at end of file diff --git a/docs/assets/data-editor-all-zTb9g2fv.js b/docs/assets/data-editor-all-zTb9g2fv.js deleted file mode 100644 index bab8a31ef..000000000 --- a/docs/assets/data-editor-all-zTb9g2fv.js +++ /dev/null @@ -1,124 +0,0 @@ -var Pl=Object.defineProperty;var Kl=(e,o,l)=>o in e?Pl(e,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[o]=l;var un=(e,o,l)=>(Kl(e,typeof o!="symbol"?o+"":o,l),l);import{s as gn,a as to,j,F as Qn}from"./marked.esm-dbrxtycE.js";import{r as i,R as Me}from"./index-BMVQvedj.js";import{_ as Nl}from"./iframe-0-Di66Z3.js";import{G as Q,b as Go,i as Ho,r as er,c as Po,C as X,g as ur,d as Ol,w as kt,e as Wl,f as Ul,m as dn,h as tr,I as Do,p as Bl,j as Vl,t as _l,k as Xl,l as At,o as or,n as nr,q as Yl,s as Eo,v as Io,x as ql,y as jl,z as Zl,A as Jl,B as Ql,D as rr,E as eo,F as ei,H as ti,J as lr,K as oi,u as fn,L as ni,M as ri,T as li,N as ir,O as ii,P as ci}from"./image-window-loader--5E_ifQX.js";import{c as Rt,r as Gt,d as si}from"./throttle-7EuXLZa7.js";import{u as ai,f as cr}from"./flatten-qRvRBp6y.js";import{G as ui}from"./scrolling-data-grid-rB9VuUnF.js";const Z='',di=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z}`},fi=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z}`},hi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - `},gi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},vi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},dr=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - - - `},mi=e=>{const o=e.bgColor;return`${Z} - - - - -`},Ci=dr,wi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},pi=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - - - - - - `},bi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - -`},yi=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},xi=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},Mi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},Ri=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - - `},ki=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - -`},Si=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - - `},zi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},Ti=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},Li=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},Hi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},Di=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - - - -`},Ei=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},Ii=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},$i=e=>{const o=e.fgColor,l=e.bgColor;return` - ${Z} - - - `},Fi=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - - -`},Ai=e=>{const o=e.fgColor,l=e.bgColor;return`${Z} - - -`},Gi=e=>{const o=e.fgColor;return` - - - `},Pi=e=>{const o=e.fgColor;return` - - - -`},Ki={headerRowID:di,headerNumber:hi,headerCode:fi,headerString:gi,headerBoolean:vi,headerAudioUri:Ci,headerVideoUri:wi,headerEmoji:pi,headerImage:bi,headerUri:dr,headerPhone:yi,headerMarkdown:xi,headerDate:Mi,headerTime:Ri,headerEmail:ki,headerReference:Si,headerIfThenElse:zi,headerSingleValue:Ti,headerLookup:Li,headerTextTemplate:Hi,headerMath:Di,headerRollup:Ei,headerJoinStrings:Ii,headerSplitString:$i,headerGeoDistance:Fi,headerArray:Ai,rowOwnerOverlay:Gi,protectedColumnOverlay:Pi,renameIcon:mi},Ni=gn("div")({name:"SearchWrapper",class:"slyseh9",propsAsIs:!1}),Oi=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})}),Wi=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})}),Ui=j("svg",{className:"button-icon",viewBox:"0 0 512 512",children:j("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}),Bi=10,Vi=e=>{const{canvasRef:o,cellYOffset:l,rows:u,columns:C,searchInputRef:M,searchValue:b,searchResults:T,onSearchValueChange:k,getCellsForSelection:w,onSearchResultsChanged:p,showSearch:S=!1,onSearchClose:z}=e,[O]=i.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[K,ie]=i.useState(""),se=b??K,V=i.useCallback($=>{ie($),k==null||k($)},[k]),[I,W]=i.useState(),we=i.useRef(I);we.current=I,i.useEffect(()=>{T!==void 0&&(T.length>0?W($=>({rowsSearched:u,results:T.length,selectedIndex:($==null?void 0:$.selectedIndex)??-1})):W(void 0))},[u,T]);const ae=i.useRef();ae.current===void 0&&(ae.current=new AbortController);const fe=i.useRef(),[Y,ee]=i.useState([]),te=T??Y,_=i.useCallback(()=>{fe.current!==void 0&&(window.cancelAnimationFrame(fe.current),fe.current=void 0,ae.current.abort())},[]),je=i.useRef(l);je.current=l;const He=i.useCallback($=>{const ce=new RegExp($.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ue=je.current,Ge=Math.min(10,u),Ze=0;W(void 0),ee([]);const ft=[],no=async()=>{var ge;if(w===void 0)return;const Nt=performance.now(),No=u-Ze;let ht=w({x:0,y:ue,width:C.length,height:Math.min(Ge,No,u-ue)},ae.current.signal);typeof ht=="function"&&(ht=await ht());let Ot=!1;for(const[Ee,Oo]of ht.entries())for(const[Wo,Qe]of Oo.entries()){let Pe;switch(Qe.kind){case Q.Text:case Q.Number:Pe=Qe.displayData;break;case Q.Uri:case Q.Markdown:Pe=Qe.data;break;case Q.Boolean:Pe=typeof Qe.data=="boolean"?Qe.data.toString():void 0;break;case Q.Image:case Q.Bubble:Pe=Qe.data.join("🐳");break;case Q.Custom:Pe=Qe.copyData;break}Pe!==void 0&&ce.test(Pe)&&(ft.push([Wo,Ee+ue]),Ot=!0)}const gt=performance.now();Ot&&ee([...ft]),Ze+=ht.length,Go(Ze<=u);const nt=((ge=we.current)==null?void 0:ge.selectedIndex)??-1;W({results:ft.length,rowsSearched:Ze,selectedIndex:nt}),p==null||p(ft,nt),ue+Ge>=u?ue=0:ue+=Ge;const vt=gt-Nt,mt=Math.max(vt,1),Je=Bi/mt;Ge=Math.ceil(Ge*Je),Ze{var $;z==null||z(),W(void 0),ee([]),p==null||p([],-1),_(),($=o==null?void 0:o.current)==null||$.focus()},[_,o,z,p]),Pt=i.useCallback($=>{V($.target.value),T===void 0&&($.target.value===""?(W(void 0),ee([]),_()):He($.target.value))},[He,_,V,T]);i.useEffect(()=>{S&&M.current!==null&&(V(""),M.current.focus({preventScroll:!0}))},[S,M,V]);const De=i.useCallback($=>{var ue;if((ue=$==null?void 0:$.stopPropagation)==null||ue.call($),I===void 0)return;const ce=(I.selectedIndex+1)%I.results;W({...I,selectedIndex:ce}),p==null||p(te,ce)},[I,p,te]),Se=i.useCallback($=>{var ue;if((ue=$==null?void 0:$.stopPropagation)==null||ue.call($),I===void 0)return;let ce=(I.selectedIndex-1)%I.results;ce<0&&(ce+=I.results),W({...I,selectedIndex:ce}),p==null||p(te,ce)},[p,te,I]),Kt=i.useCallback($=>{($.ctrlKey||$.metaKey)&&$.nativeEvent.code==="KeyF"||$.key==="Escape"?(Be(),$.stopPropagation(),$.preventDefault()):$.key==="Enter"&&($.shiftKey?Se():De())},[Be,De,Se]);i.useEffect(()=>()=>{_()},[_]);const[Ae,oo]=i.useState(!1);i.useEffect(()=>{if(S)oo(!0);else{const $=setTimeout(()=>oo(!1),150);return()=>clearTimeout($)}},[S]);const Ve=i.useMemo(()=>{if(!S&&!Ae)return null;let $;I!==void 0&&($=I.results>=1e3?"over 1000":`${I.results} result${I.results!==1?"s":""}`,I.selectedIndex>=0&&($=`${I.selectedIndex+1} of ${$}`));const ce=Ze=>{Ze.stopPropagation()},Ge={width:`${Math.floor(((I==null?void 0:I.rowsSearched)??0)/u*100)}%`};return to(Ni,{className:S?"":"out",onMouseDown:ce,onMouseMove:ce,onMouseUp:ce,onClick:ce,children:[to("div",{className:"gdg-search-bar-inner",children:[j("input",{id:O,"aria-hidden":!S,"data-testid":"search-input",ref:M,onChange:Pt,value:se,tabIndex:S?void 0:-1,onKeyDownCapture:Kt}),j("button",{"aria-label":"Previous Result","aria-hidden":!S,tabIndex:S?void 0:-1,onClick:Se,disabled:((I==null?void 0:I.results)??0)===0,children:Oi}),j("button",{"aria-label":"Next Result","aria-hidden":!S,tabIndex:S?void 0:-1,onClick:De,disabled:((I==null?void 0:I.results)??0)===0,children:Wi}),z!==void 0&&j("button",{"aria-label":"Close Search","aria-hidden":!S,"data-testid":"search-close-button",tabIndex:S?void 0:-1,onClick:Be,children:Ui})]}),I!==void 0?to(Qn,{children:[j("div",{className:"gdg-search-status",children:j("div",{"data-testid":"search-result-area",children:$})}),j("div",{className:"gdg-search-progress",style:Ge})]}):j("div",{className:"gdg-search-status",children:j("label",{htmlFor:O,children:"Type to search"})})]})},[S,Ae,I,u,O,M,Pt,se,Kt,Se,De,z,Be]);return to(Qn,{children:[j(ui,{prelightCells:te,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Ve]})},_i=Vi;class Xi extends i.PureComponent{constructor(){super(...arguments);un(this,"wrapperRef",i.createRef());un(this,"clickOutside",l=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(l))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(l.target)){let u=l.target;for(;u!==null;){if(u.classList.contains("click-outside-ignore"))return;u=u.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:l,isOutsideClick:u,...C}=this.props;return j("div",{...C,ref:this.wrapperRef,children:this.props.children})}}const Yi=()=>e=>Math.max(16,e.targetHeight-10),qi=gn("input")({name:"RenameInput",class:"r1fzhvm4",propsAsIs:!1,vars:{"r1fzhvm4-0":[Yi(),"px"]}}),ji=e=>{const{bounds:o,group:l,onClose:u,canvasBounds:C,onFinish:M}=e,[b,T]=Me.useState(l);return j(Xi,{style:{position:"absolute",left:o.x-C.left+1,top:o.y-C.top,width:o.width-2,height:o.height},className:"c181oggi",onClickOutside:u,children:j(qi,{targetHeight:o.height,"data-testid":"group-rename-input",value:b,onBlur:u,onFocus:k=>k.target.setSelectionRange(0,b.length),onChange:k=>T(k.target.value),onKeyDown:k=>{k.key==="Enter"?M(b):k.key==="Escape"&&u()},autoFocus:!0})})},hn=150;function Zi(e,o,l,u){var M;const C=u(o);return((M=C==null?void 0:C.measure)==null?void 0:M.call(C,e,o,l))??hn}function fr(e,o,l,u,C,M,b,T,k){let w=0;const p=C===void 0?[]:C.map(z=>{const O=Zi(e,z[u],o,k);return w=Math.max(w,O),O});if(p.length>5&&T){w=0;let z=0;for(const K of p)z+=K;const O=z/p.length;for(let K=0;K=O*2?p[K]=0:w=Math.max(w,p[K])}w=Math.max(w,e.measureText(l.title).width+o.cellHorizontalPadding*2+(l.icon===void 0?0:28));const S=Math.max(Math.ceil(M),Math.min(Math.floor(b),Math.ceil(w)));return{...l,width:S}}function Ji(e,o,l,u,C,M,b,T,k){const w=i.useRef(o),p=i.useRef(l),S=i.useRef(b);w.current=o,p.current=l,S.current=b;const[z,O]=i.useMemo(()=>{if(typeof window>"u")return[null,null];const I=document.createElement("canvas");return I.style.display="none",I.style.opacity="0",I.style.position="fixed",[I,I.getContext("2d",{alpha:!1})]},[]);i.useLayoutEffect(()=>(z&&document.documentElement.append(z),()=>{z==null||z.remove()}),[z]);const K=i.useRef({}),ie=i.useRef(),[se,V]=i.useState();return i.useLayoutEffect(()=>{const I=p.current;if(I===void 0||e.every(Ho))return;let W=Math.max(1,10-Math.floor(e.length/1e4)),we=0;W1&&(W--,we=1);const ae={x:0,y:0,width:e.length,height:Math.min(w.current,W)},fe={x:0,y:w.current-1,width:e.length,height:1};(async()=>{const ee=I(ae,k.signal),te=we>0?I(fe,k.signal):void 0;let _;typeof ee=="object"?_=ee:_=await er(ee),te!==void 0&&(typeof te=="object"?_=[..._,...te]:_=[..._,...await er(te)]),ie.current=e,V(_)})()},[k.signal,e]),i.useMemo(()=>{let W=e.every(Ho)?e:O===null?e.map(Y=>Ho(Y)?Y:{...Y,width:hn}):(O.font=S.current.baseFontFull,e.map((Y,ee)=>{if(Ho(Y))return Y;if(K.current[Y.id]!==void 0)return{...Y,width:K.current[Y.id]};if(se===void 0||ie.current!==e||Y.id===void 0)return{...Y,width:hn};const te=fr(O,b,Y,ee,se,C,M,!0,T);return K.current[Y.id]=te.width,te})),we=0,ae=0;const fe=[];for(const[Y,ee]of W.entries())we+=ee.width,ee.grow!==void 0&&ee.grow>0&&(ae+=ee.grow,fe.push(Y));if(we0){const Y=[...W],ee=u-we;let te=ee;for(let _=0;_1&&e.startsWith("_")?Number.parseInt(e.slice(1))===o.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===o.keyCode:e===o.key}function A(e,o,l){const u=hr(e,o);return u&&(l.didMatch=!0),u}function hr(e,o){if(e.length===0)return!1;if(e.includes("|")){const k=e.split("|");for(const w of k)if(hr(w,o))return!0;return!1}let l=!1,u=!1,C=!1,M=!1;const b=e.split("+"),T=b.pop();if(!Qi(T,o))return!1;if(b[0]==="any")return!0;for(const k of b)switch(k){case"ctrl":l=!0;break;case"shift":u=!0;break;case"alt":C=!0;break;case"meta":M=!0;break;case"primary":Po.value?M=!0:l=!0;break}return o.altKey===C&&o.ctrlKey===l&&o.shiftKey===u&&o.metaKey===M}function ec(e,o,l,u,C,M){const b=Me.useCallback((w,p,S,z)=>{var I;(M==="cell"||M==="multi-cell")&&w!==void 0&&(w={...w,range:{x:w.cell[0],y:w.cell[1],width:1,height:1}});const O=l==="mixed"&&(S||z==="drag"),K=u==="mixed"&&O,ie=C==="mixed"&&O;let se={current:w===void 0?void 0:{...w,rangeStack:z==="drag"?((I=e.current)==null?void 0:I.rangeStack)??[]:[]},columns:K?e.columns:X.empty(),rows:ie?e.rows:X.empty()};S&&(M==="multi-rect"||M==="multi-cell")&&se.current!==void 0&&e.current!==void 0&&(se={...se,current:{...se.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),o(se,p)},[u,e,l,M,C,o]),T=Me.useCallback((w,p,S)=>{w=w??e.rows,p!==void 0&&(w=w.add(p));let z;if(C==="exclusive"&&w.length>0)z={current:void 0,columns:X.empty(),rows:w};else{const O=S&&l==="mixed",K=S&&u==="mixed";z={current:O?e.current:void 0,columns:K?e.columns:X.empty(),rows:w}}o(z,!1)},[u,e,l,C,o]),k=Me.useCallback((w,p,S)=>{w=w??e.columns,p!==void 0&&(w=w.add(p));let z;if(u==="exclusive"&&w.length>0)z={current:void 0,rows:X.empty(),columns:w};else{const O=S&&l==="mixed",K=S&&C==="mixed";z={current:O?e.current:void 0,rows:K?e.rows:X.empty(),columns:w}}o(z,!1)},[u,e,l,C,o]);return[b,T,k]}function tc(e,o,l,u,C){const M=i.useCallback(w=>{if(e===!0){const p=[];for(let S=w.y;S=C?z.push({kind:Q.Loading,allowOverlay:!1}):z.push(o([O,S]));p.push(z)}return p}return(e==null?void 0:e(w,u.signal))??[]},[u.signal,o,e,C]),b=e!==void 0?M:void 0,T=i.useCallback(w=>{if(b===void 0)return[];const p={...w,x:w.x-l};if(p.x<0){p.x=0,p.width--;const S=b(p,u.signal);return typeof S=="function"?async()=>(await S()).map(z=>[{kind:Q.Loading,allowOverlay:!1},...z]):S.map(z=>[{kind:Q.Loading,allowOverlay:!1},...z])}return b(p,u.signal)},[u.signal,b,l]);return[e!==void 0?T:void 0,b]}function sr(e){return typeof e=="string"?e:`${e}px`}const oc=()=>e=>e.innerWidth,nc=()=>e=>e.innerHeight,rc=gn("div")({name:"Wrapper",class:"w2q57ts",propsAsIs:!1,vars:{"w2q57ts-0":[oc()],"w2q57ts-1":[nc()]}}),lc=e=>{const{inWidth:o,inHeight:l,children:u,...C}=e;return j(rc,{innerHeight:sr(l),innerWidth:sr(o),...C,children:u})},ic=2,cc=1300;function sc(e,o,l){const u=Me.useRef(0),[C,M]=e??[0,0];Me.useEffect(()=>{if(C===0&&M===0){u.current=0;return}let b=!1,T=0;const k=w=>{var p;if(!b){if(T===0)T=w;else{const S=w-T;u.current=Math.min(1,u.current+S/cc);const z=u.current**1.618*S*ic;(p=o.current)==null||p.scrollBy(C*z,M*z),T=w,l==null||l()}window.requestAnimationFrame(k)}};return window.requestAnimationFrame(k),()=>{b=!0}},[o,C,M,l])}function ac({rowHeight:e,headerHeight:o,groupHeaderHeight:l,theme:u,overscrollX:C,overscrollY:M,scaleToRem:b,remSize:T}){const[k,w,p,S,z,O]=Me.useMemo(()=>{if(!b||T===16)return[e,o,l,u,C,M];const K=T/16,ie=e,se=ur();return[typeof ie=="number"?ie*K:V=>Math.ceil(ie(V)*K),Math.ceil(o*K),Math.ceil(l*K),{...u,headerIconSize:((u==null?void 0:u.headerIconSize)??se.headerIconSize)*K,cellHorizontalPadding:((u==null?void 0:u.cellHorizontalPadding)??se.cellHorizontalPadding)*K,cellVerticalPadding:((u==null?void 0:u.cellVerticalPadding)??se.cellVerticalPadding)*K},Math.ceil((C??0)*K),Math.ceil((M??0)*K)]},[l,o,C,M,T,e,b,u]);return{rowHeight:k,headerHeight:w,groupHeaderHeight:p,theme:S,overscrollX:z,overscrollY:O}}const dt={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function G(e,o){return e===!0?o:e===!1?"":e}function ar(e){const o=Po.value;return{activateCell:G(e.activateCell," |Enter|shift+Enter"),clear:G(e.clear,"any+Escape"),closeOverlay:G(e.closeOverlay,"any+Escape"),acceptOverlayDown:G(e.acceptOverlayDown,"Enter"),acceptOverlayUp:G(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:G(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:G(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:G(e.delete,o?"Backspace|Delete":"Delete"),downFill:G(e.downFill,"primary+_68"),scrollToSelectedCell:G(e.scrollToSelectedCell,"primary+Enter"),goDownCell:G(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:G(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:G(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:G(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:G(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:G(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:G(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:G(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:G(e.goToFirstCell,"primary+Home"),goToFirstColumn:G(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:G(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:G(e.goToLastCell,"primary+End"),goToLastColumn:G(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:G(e.goToLastRow,"primary+ArrowDown"),goToNextPage:G(e.goToNextPage,"PageDown"),goToPreviousPage:G(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:G(e.rightFill,"primary+_82"),search:G(e.search,"primary+f"),selectAll:G(e.selectAll,"primary+a"),selectColumn:G(e.selectColumn,"ctrl+ "),selectGrowDown:G(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:G(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:G(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:G(e.selectGrowUp,"shift+ArrowUp"),selectRow:G(e.selectRow,"shift+ "),selectToFirstCell:G(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:G(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:G(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:G(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:G(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:G(e.selectToLastRow,"primary+shift+ArrowDown")}}function uc(e){const o=Ol(e);return Me.useMemo(()=>{if(o===void 0)return ar(dt);const l={...o,goToNextPage:(o==null?void 0:o.goToNextPage)??(o==null?void 0:o.pageDown)??dt.goToNextPage,goToPreviousPage:(o==null?void 0:o.goToPreviousPage)??(o==null?void 0:o.pageUp)??dt.goToPreviousPage,goToFirstCell:(o==null?void 0:o.goToFirstCell)??(o==null?void 0:o.first)??dt.goToFirstCell,goToLastCell:(o==null?void 0:o.goToLastCell)??(o==null?void 0:o.last)??dt.goToLastCell,selectToFirstCell:(o==null?void 0:o.selectToFirstCell)??(o==null?void 0:o.first)??dt.selectToFirstCell,selectToLastCell:(o==null?void 0:o.selectToLastCell)??(o==null?void 0:o.last)??dt.selectToLastCell};return ar({...dt,...l})},[o])}function dc(e){function o(u,C,M){if(typeof u=="number")return{headerIndex:u,isCollapsed:!1,depth:C,path:M};const b={headerIndex:u.headerIndex,isCollapsed:u.isCollapsed,depth:C,path:M};return u.subGroups!==void 0&&(b.subGroups=u.subGroups.map((T,k)=>o(T,C+1,[...M,k])).sort((T,k)=>T.headerIndex-k.headerIndex)),b}return e.map((u,C)=>o(u,0,[C])).sort((u,C)=>u.headerIndex-C.headerIndex)}function vn(e,o){const l=[];function u(b,T,k=!1){let w=T!==null?T-b.headerIndex:o-b.headerIndex;if(b.subGroups!==void 0&&(w=b.subGroups[0].headerIndex-b.headerIndex),w--,l.push({headerIndex:b.headerIndex,contentIndex:-1,skip:k,isCollapsed:b.isCollapsed,depth:b.depth,path:b.path,rows:w}),b.subGroups)for(let p=0;pb.skip===!1).map(b=>{const{skip:T,...k}=b;return k})}function Ko(e,o){if(o===void 0||vn.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let l=e;for(const u of o){if(l===0)return{path:[...u.path,-1],originalIndex:u.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:u.rows};if(l--,!u.isCollapsed){if(le===void 0?void 0:vn(e,o),[e,o]),M=Me.useMemo(()=>C===void 0?o:C.reduce((w,p)=>w+(p.isCollapsed?1:p.rows+1),0),[C,o]),b=Me.useMemo(()=>e===void 0||typeof l=="number"&&e.height===l?l:w=>{const{isGroupHeader:p}=Ko(w,C);return p?e.height:typeof l=="number"?l:l(w)},[C,e,l]),T=Me.useCallback(w=>{if(C===void 0)return w;let p=w;for(const S of C){if(p===0)return;if(p--,!S.isCollapsed){if(p{if(e===void 0)return u==null?void 0:u(w,w,w);if(u===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:p,contentIndex:S,groupIndex:z}=Ko(w,C);return p?e.themeOverride:u==null?void 0:u(w,z,S)},[C,u,e]));return e===void 0?{rowHeight:b,rows:o,rowNumberMapper:T,getRowThemeOverride:k}:{rowHeight:b,rows:M,rowNumberMapper:T,getRowThemeOverride:k}}function hc(e,o){const l=Me.useMemo(()=>e===void 0?void 0:vn(e,o),[e,o]);return{getRowGroupingForPath:vr,updateRowGroupingByPath:gr,mapper:Me.useCallback(u=>{if(typeof u=="number")return Ko(u,l);const C=Ko(u[1],l);return{...C,originalIndex:[u[0],C.originalIndex]}},[l])}}function gr(e,o,l){const[u,...C]=o;return C[0]===-1?e.map((M,b)=>b===u?{...M,...l}:M):e.map((M,b)=>b===u?{...M,subGroups:gr(M.subGroups??[],C,l)}:M)}function vr(e,o){const[l,...u]=o;return u[0]===-1?e[l]:vr(e[l].subGroups??[],u)}function gc(e,o){const[l]=i.useState(()=>({value:e,callback:o,facade:{get current(){return l.value},set current(u){const C=l.value;C!==u&&(l.value=u,l.callback(u,C))}}}));return l.callback=o,l.facade}function vc(e,o,l,u,C){const[M,b]=i.useMemo(()=>[o!==void 0&&typeof l=="number"?Math.floor(o/l):0,o!==void 0&&typeof l=="number"?-(o%l):0],[o,l]),T=i.useMemo(()=>({x:u.current.x,y:M,width:u.current.width??1,height:u.current.height??1,ty:b}),[u,b,M]),[k,w,p]=Wl(T),S=i.useRef(C);S.current=C;const z=gc(null,ie=>{ie!==null&&o!==void 0?ie.scrollTop=o:ie!==null&&e!==void 0&&(ie.scrollLeft=e)}),O=(k.height??1)>1;i.useLayoutEffect(()=>{if(o!==void 0&&z.current!==null&&O){if(z.current.scrollTop===o)return;z.current.scrollTop=o,z.current.scrollTop!==o&&p(),S.current()}},[o,O,p,z]);const K=(k.width??1)>1;return i.useLayoutEffect(()=>{if(e!==void 0&&z.current!==null&&K){if(z.current.scrollLeft===e)return;z.current.scrollLeft=e,z.current.scrollLeft!==e&&p(),S.current()}},[e,K,p,z]),{visibleRegion:k,setVisibleRegion:w,scrollRef:z}}const mc=i.lazy(async()=>await Nl(()=>import("./data-grid-overlay-editor-B2IrFVCJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Cc=0;function wc(e){return ai(cr(cr(e).filter(o=>o.span!==void 0).map(o=>{var l,u;return Gt((((l=o.span)==null?void 0:l[0])??0)+1,(((u=o.span)==null?void 0:u[1])??0)+1)})))}function $o(e,o){return e===void 0||o===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+o,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+o},rangeStack:e.current.rangeStack.map(l=>({...l,x:l.x+o}))},rows:e.rows,columns:e.columns.offset(o)}}const Fo={kind:Q.Loading,allowOverlay:!1},Ao={columns:X.empty(),rows:X.empty(),current:void 0},pc=(e,o)=>{var jn,Zn,Jn;const[l,u]=i.useState(Ao),[C,M]=i.useState(),b=i.useRef(null),T=i.useRef(null),[k,w]=i.useState(),p=i.useRef(),S=typeof window>"u"?null:window,{imageEditorOverride:z,getRowThemeOverride:O,markdownDivCreateNode:K,width:ie,height:se,columns:V,rows:I,getCellContent:W,onCellClicked:we,onCellActivated:ae,onFillPattern:fe,onFinishedEditing:Y,coercePasteValue:ee,drawHeader:te,drawCell:_,editorBloom:je,onHeaderClicked:He,onColumnProposeMove:Be,spanRangeBehavior:Pt="default",onGroupHeaderClicked:De,onCellContextMenu:Se,className:Kt,onHeaderContextMenu:Ae,getCellsForSelection:oo,onGroupHeaderContextMenu:Ve,onGroupHeaderRenamed:$,onCellEdited:ce,onCellsEdited:ue,onSearchResultsChanged:Ge,searchResults:Ze,onSearchValueChange:ft,searchValue:no,onKeyDown:Nt,onKeyUp:No,keybindings:ht,editOnType:Ot=!0,onRowAppended:gt,onColumnMoved:nt,validateCell:vt,highlightRegions:mt,rangeSelect:Je="rect",columnSelect:ge="multi",rowSelect:Ee="multi",rangeSelectionBlending:Oo="exclusive",columnSelectionBlending:Wo="exclusive",rowSelectionBlending:Qe="exclusive",onDelete:Pe,onDragStart:ro,onMouseMove:lo,onPaste:Ct,copyHeaders:mn=!1,freezeColumns:et=0,cellActivationBehavior:Uo="second-click",rowSelectionMode:Bo="auto",onHeaderMenuClick:io,onHeaderIndicatorClick:co,getGroupDetails:so,rowGrouping:rt,onSearchClose:Vo,onItemHovered:ao,onSelectionCleared:lt,showSearch:mr,onVisibleRegionChanged:uo,gridSelection:wt,onGridSelectionChange:_o,minColumnWidth:Cr=50,maxColumnWidth:wr=500,maxColumnAutoWidth:pr,provideEditor:br,trailingRowOptions:U,freezeTrailingRows:tt=0,allowedFillDirections:Cn="orthogonal",scrollOffsetX:yr,scrollOffsetY:xr,verticalBorder:St,onDragOverCell:Mr,onDrop:Rr,onColumnResize:Wt,onColumnResizeEnd:Ut,onColumnResizeStart:Bt,customRenderers:fo,fillHandle:kr,drawFocusRing:wn=!0,experimental:ve,fixedShadowX:Sr,fixedShadowY:zr,headerIcons:Tr,imageWindowLoader:Lr,initialSize:Hr,isDraggable:Dr,onDragLeave:Er,onRowMoved:Vt,overscrollX:Ir,overscrollY:$r,preventDiagonalScrolling:Fr,rightElement:Ar,rightElementProps:Gr,trapFocus:pn=!1,smoothScrollX:Pr,smoothScrollY:Kr,scaleToRem:Nr=!1,rowHeight:Or=34,headerHeight:bn=36,groupHeaderHeight:Wr=bn,theme:Ur,isOutsideClick:Br,renderers:Xo,resizeIndicator:Vr,scrollToActiveCell:yn=!0}=e,ne=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Ke=(ne==null?void 0:ne.kind)??e.rowMarkers??"none",_r=(ne==null?void 0:ne.width)??e.rowMarkerWidth,xn=(ne==null?void 0:ne.startIndex)??e.rowMarkerStartIndex??1,Mn=(ne==null?void 0:ne.theme)??e.rowMarkerTheme,Rn=ne==null?void 0:ne.headerTheme,kn=ne==null?void 0:ne.headerAlwaysVisible,ho=(ne==null?void 0:ne.checkboxStyle)??"square",zt=Math.max(Cr,20),go=Math.max(wr,zt),Xr=Math.max(pr??go,zt),Sn=i.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:F,rowNumberMapper:zn,rowHeight:Yr,getRowThemeOverride:ot}=fc(rt,I,Or,O),qr=i.useMemo(()=>Number.parseFloat(Sn.fontSize),[Sn]),{rowHeight:it,headerHeight:Yo,groupHeaderHeight:Tn,theme:Ln,overscrollX:jr,overscrollY:Zr}=ac({groupHeaderHeight:Wr,headerHeight:bn,overscrollX:Ir,overscrollY:$r,remSize:qr,rowHeight:Yr,scaleToRem:Nr,theme:Ur}),ct=uc(ht),Tt=_r??(I>1e4?48:I>1e3?44:I>100?36:32),_e=Ke!=="none",d=_e?1:0,oe=gt!==void 0,_t=(U==null?void 0:U.sticky)===!0,[Jr,Hn]=i.useState(!1),Qr=mr??Jr,el=i.useCallback(()=>{Vo!==void 0?Vo():Hn(!1)},[Vo]),h=i.useMemo(()=>wt===void 0?void 0:$o(wt,d),[wt,d])??l,Re=i.useRef();Re.current===void 0&&(Re.current=new AbortController),i.useEffect(()=>()=>Re==null?void 0:Re.current.abort(),[]);const[he,tl]=tc(oo,W,d,Re.current,F),ol=i.useCallback((t,r,n)=>{if(vt===void 0)return!0;const s=[t[0]-d,t[1]];return vt==null?void 0:vt(s,r,n)},[d,vt]),vo=i.useRef(wt),Ie=i.useCallback((t,r)=>{r&&(t=Ul(t,he,d,Pt,Re.current)),_o!==void 0?(vo.current=$o(t,-d),_o(vo.current)):u(t)},[_o,he,d,Pt]),Lt=kt(Wt,i.useCallback((t,r,n,s)=>{Wt==null||Wt(V[n-d],r,n-d,s)},[Wt,d,V])),nl=kt(Ut,i.useCallback((t,r,n,s)=>{Ut==null||Ut(V[n-d],r,n-d,s)},[Ut,d,V])),rl=kt(Bt,i.useCallback((t,r,n,s)=>{Bt==null||Bt(V[n-d],r,n-d,s)},[Bt,d,V])),ll=kt(te,i.useCallback((t,r)=>(te==null?void 0:te({...t,columnIndex:t.columnIndex-d},r))??!1,[te,d])),il=kt(_,i.useCallback((t,r)=>(_==null?void 0:_({...t,col:t.col-d},r))??!1,[_,d])),st=i.useCallback(t=>{if(Pe!==void 0){const r=Pe($o(t,-d));return typeof r=="boolean"?r:$o(r,d)}return!0},[Pe,d]),[pe,be,de]=ec(h,Ie,Oo,Wo,Qe,Je),me=i.useMemo(()=>dn(ur(),Ln),[Ln]),[qo,cl]=i.useState([0,0,0]),Dn=i.useMemo(()=>{if(Xo===void 0)return{};const t={};for(const r of Xo)t[r.kind]=r;return t},[Xo]),ye=i.useCallback(t=>t.kind!==Q.Custom?Dn[t.kind]:fo==null?void 0:fo.find(r=>r.isMatch(t)),[fo,Dn]);let{sizedColumns:ze,nonGrowWidth:En}=Ji(V,F,tl,qo[0]-(d===0?0:Tt)-qo[2],zt,Xr,me,ye,Re.current);Ke!=="none"&&(En+=Tt);const jo=i.useMemo(()=>ze.some(t=>t.group!==void 0),[ze]),Xt=jo?Yo+Tn:Yo,In=h.rows.length,$n=Ke==="none"?void 0:In===0?!1:In===F?!0:void 0,B=i.useMemo(()=>Ke==="none"?ze:[{title:"",width:Tt,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Mn,rowMarker:ho,rowMarkerChecked:$n,headerRowMarkerTheme:Rn,headerRowMarkerAlwaysVisible:kn},...ze],[Ke,ze,Tt,Mn,ho,$n,Rn,kn]),Te=i.useRef({height:1,width:1,x:0,y:0}),mo=i.useRef(!1),{setVisibleRegion:Fn,visibleRegion:pt,scrollRef:q}=vc(yr,xr,it,Te,()=>mo.current=!0);Te.current=pt;const sl=pt.x+d,Co=pt.y,ke=i.useRef(null),xe=i.useCallback(t=>{var r;t===!0?(r=ke.current)==null||r.focus():window.requestAnimationFrame(()=>{var n;(n=ke.current)==null||n.focus()})},[]),Ce=oe?F+1:F,$e=i.useCallback(t=>{const r=d===0?t:t.map(s=>({...s,location:[s.location[0]-d,s.location[1]]})),n=ue==null?void 0:ue(r);if(n!==!0)for(const s of r)ce==null||ce(s.location,s.value);return n},[ce,ue,d]),[bt,Zo]=i.useState(),wo=h.current!==void 0&&h.current.range.width*h.current.range.height>1?h.current.range:void 0,Ht=wn?(jn=h.current)==null?void 0:jn.cell:void 0,po=Ht==null?void 0:Ht[0],bo=Ht==null?void 0:Ht[1],al=i.useMemo(()=>{if((mt===void 0||mt.length===0)&&(wo??po??bo??bt)===void 0)return;const t=[];if(mt!==void 0)for(const r of mt){const n=B.length-r.range.x-d;n>0&&t.push({color:r.color,range:{...r.range,x:r.range.x+d,width:Math.min(n,r.range.width)},style:r.style})}return bt!==void 0&&t.push({color:tr(me.accentColor,0),range:bt,style:"dashed"}),wo!==void 0&&t.push({color:tr(me.accentColor,.5),range:wo,style:"solid-outline"}),po!==void 0&&bo!==void 0&&t.push({color:me.accentColor,range:{x:po,y:bo,width:1,height:1},style:"solid-outline"}),t.length>0?t:void 0},[bt,wo,po,bo,mt,B.length,me.accentColor,d]),An=i.useRef(B);An.current=B;const Le=i.useCallback(([t,r],n=!1)=>{var g,a,f,v,m,y,L;const s=oe&&r===Ce-1;if(t===0&&_e){if(s)return Fo;const x=zn(r);return x===void 0?Fo:{kind:Do.Marker,allowOverlay:!1,checkboxStyle:ho,checked:(h==null?void 0:h.rows.hasIndex(r))===!0,markerKind:Ke==="clickable-number"?"number":Ke,row:xn+x,drawHandle:Vt!==void 0,cursor:Ke==="clickable-number"?"pointer":void 0}}else if(s){const D=t===d?(U==null?void 0:U.hint)??"":"",R=An.current[t];if(((g=R==null?void 0:R.trailingRowOptions)==null?void 0:g.disabled)===!0)return Fo;{const P=((a=R==null?void 0:R.trailingRowOptions)==null?void 0:a.hint)??D,E=((f=R==null?void 0:R.trailingRowOptions)==null?void 0:f.addIcon)??(U==null?void 0:U.addIcon);return{kind:Do.NewRow,hint:P,allowOverlay:!1,icon:E}}}else{const x=t-d;if(n||(ve==null?void 0:ve.strict)===!0){const R=Te.current,P=R.x>x||x>R.x+R.width||R.y>r||r>R.y+R.height||r>=Qo.current,E=x===((m=(v=R.extras)==null?void 0:v.selected)==null?void 0:m[0])&&r===((y=R.extras)==null?void 0:y.selected[1]);let H=!1;if(((L=R.extras)==null?void 0:L.freezeRegions)!==void 0){for(const N of R.extras.freezeRegions)if(Bl(N,x,r)){H=!0;break}}if(P&&!E&&!H)return Fo}let D=W([x,r]);return d!==0&&D.span!==void 0&&(D={...D,span:[D.span[0]+d,D.span[1]+d]}),D}},[oe,Ce,_e,zn,ho,h==null?void 0:h.rows,Ke,xn,Vt,d,U==null?void 0:U.hint,U==null?void 0:U.addIcon,ve==null?void 0:ve.strict,W]),Jo=i.useCallback(t=>{let r=(so==null?void 0:so(t))??{name:t};return $!==void 0&&t!==""&&(r={icon:r.icon,name:r.name,overrideTheme:r.overrideTheme,actions:[...r.actions??[],{title:"Rename",icon:"renameIcon",onClick:n=>tn({group:r.name,bounds:n.bounds})}]}),r},[so,$]),yo=i.useCallback(t=>{var f;const[r,n]=t.cell,s=B[r],c=(s==null?void 0:s.group)!==void 0?(f=Jo(s.group))==null?void 0:f.overrideTheme:void 0,g=s==null?void 0:s.themeOverride,a=ot==null?void 0:ot(n);M({...t,theme:dn(me,c,g,a,t.content.themeOverride)})},[ot,B,Jo,me]),Dt=i.useCallback((t,r,n)=>{var a;if(h.current===void 0)return;const[s,c]=h.current.cell,g=Le([s,c]);if(g.kind!==Q.Boolean&&g.allowOverlay){let f=g;if(n!==void 0)switch(f.kind){case Q.Number:{const v=Vl(()=>n==="-"?-0:Number.parseFloat(n),0);f={...f,data:Number.isNaN(v)?0:v};break}case Q.Text:case Q.Markdown:case Q.Uri:f={...f,data:n};break}yo({target:t,content:f,initialValue:n,cell:[s,c],highlight:n===void 0,forceEditMode:n!==void 0})}else g.kind===Q.Boolean&&r&&g.readonly!==!0&&($e([{location:h.current.cell,value:{...g,data:_l(g.data)}}]),(a=ke.current)==null||a.damage([{cell:h.current.cell}]))},[Le,h,$e,yo]),Gn=i.useCallback((t,r)=>{var c;const n=(c=ke.current)==null?void 0:c.getBounds(t,r);if(n===void 0||q.current===null)return;const s=Le([t,r]);s.allowOverlay&&yo({target:n,content:s,initialValue:void 0,highlight:!0,cell:[t,r],forceEditMode:!0})},[Le,q,yo]),re=i.useCallback((t,r,n="both",s=0,c=0,g=void 0)=>{if(q.current!==null){const a=ke.current,f=T.current,v=typeof t!="number"?t.unit==="cell"?t.amount:void 0:t,m=typeof r!="number"?r.unit==="cell"?r.amount:void 0:r,y=typeof t!="number"&&t.unit==="px"?t.amount:void 0,L=typeof r!="number"&&r.unit==="px"?r.amount:void 0;if(a!==null&&f!==null){let x={x:0,y:0,width:0,height:0},D=0,R=0;if((v!==void 0||m!==void 0)&&(x=a.getBounds((v??0)+d,m??0)??x,x.width===0||x.height===0))return;const P=f.getBoundingClientRect(),E=P.width/f.offsetWidth;if(y!==void 0&&(x={...x,x:y-P.left-q.current.scrollLeft,width:1}),L!==void 0&&(x={...x,y:L+P.top-q.current.scrollTop,height:1}),x!==void 0){const H={x:x.x-s,y:x.y-c,width:x.width+2*s,height:x.height+2*c};let N=0;for(let an=0;an0&&(J=Xl(Ce,le,it));let We=N*E+P.left+d*Tt*E,Ye=P.right,Ue=P.top+Xt*E,qe=P.bottom-J*E;const To=x.width+s*2;switch(g==null?void 0:g.hAlign){case"start":Ye=We+To;break;case"end":We=Ye-To;break;case"center":We=Math.floor((We+Ye)/2)-To/2,Ye=We+To;break}const Lo=x.height+c*2;switch(g==null?void 0:g.vAlign){case"start":qe=Ue+Lo;break;case"end":Ue=qe-Lo;break;case"center":Ue=Math.floor((Ue+qe)/2)-Lo/2,qe=Ue+Lo;break}We>H.x?D=H.x-We:YeH.y?R=H.y-Ue:qe=Ce-le)&&(R=0),(D!==0||R!==0)&&(E!==1&&(D/=E,R/=E),q.current.scrollTo(D+q.current.scrollLeft,R+q.current.scrollTop))}}}},[d,tt,Tt,q,Xt,et,ze,Ce,_t,it]),Pn=i.useRef(Gn),Kn=i.useRef(W),Qo=i.useRef(F);Pn.current=Gn,Kn.current=W,Qo.current=F;const Et=i.useCallback(async(t,r=!0)=>{var v;const n=B[t];if(((v=n==null?void 0:n.trailingRowOptions)==null?void 0:v.disabled)===!0)return;const s=gt==null?void 0:gt();let c,g=!0;s!==void 0&&(c=await s,c==="top"&&(g=!1),typeof c=="number"&&(g=!1));let a=0;const f=()=>{if(Qo.current<=F){a<500&&window.setTimeout(f,a),a=50+a*2;return}const m=typeof c=="number"?c:g?F:0;zo.current(t-d,m),pe({cell:[t,m],range:{x:t,y:m,width:1,height:1}},!1,!1,"edit");const y=Kn.current([t-d,m]);y.allowOverlay&&Io(y)&&y.readonly!==!0&&r&&window.setTimeout(()=>{Pn.current(t,m)},0)};f()},[B,gt,d,F,pe]),xo=i.useCallback(t=>{var n,s;const r=((s=(n=ze[t])==null?void 0:n.trailingRowOptions)==null?void 0:s.targetColumn)??(U==null?void 0:U.targetColumn);if(typeof r=="number")return r+(_e?1:0);if(typeof r=="object"){const c=V.indexOf(r);if(c>=0)return c+(_e?1:0)}},[ze,V,_e,U==null?void 0:U.targetColumn]),at=i.useRef(),It=i.useRef(),Yt=i.useCallback((t,r)=>{var c;const[n,s]=r;return dn(me,(c=B[n])==null?void 0:c.themeOverride,ot==null?void 0:ot(s),t.themeOverride)},[ot,B,me]),{mapper:yt}=hc(rt,I),Ne=rt==null?void 0:rt.navigationBehavior,qt=i.useCallback(t=>{var y,L,x;const r=Po.value?t.metaKey:t.ctrlKey,n=r&&Ee==="multi",s=r&&ge==="multi",[c,g]=t.location,a=h.columns,f=h.rows,[v,m]=((y=h.current)==null?void 0:y.cell)??[];if(t.kind==="cell"){if(It.current=void 0,xt.current=[c,g],c===0&&_e){if(oe===!0&&g===F||Ke==="number"||Ee==="none")return;const D=Le(t.location);if(D.kind!==Do.Marker)return;if(Vt!==void 0){const E=ye(D);Go((E==null?void 0:E.kind)===Do.Marker);const H=(L=E==null?void 0:E.onClick)==null?void 0:L.call(E,{...t,cell:D,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,theme:Yt(D,t.location),preventDefault:()=>{}});if(H===void 0||H.checked===D.checked)return}M(void 0),xe();const R=f.hasIndex(g),P=at.current;if(Ee==="multi"&&(t.shiftKey||t.isLongTouch===!0)&&P!==void 0&&f.hasIndex(P)){const E=[Math.min(P,g),Math.max(P,g)+1];n||Bo==="multi"?be(void 0,E,!0):be(X.fromSingleSelection(E),void 0,n)}else n||t.isTouch||Bo==="multi"?R?be(f.remove(g),void 0,!0):(be(void 0,g,!0),at.current=g):R&&f.length===1?be(X.empty(),void 0,r):(be(X.fromSingleSelection(g),void 0,r),at.current=g)}else if(c>=d&&oe&&g===F){const D=xo(c);Et(D??c)}else if(v!==c||m!==g){const D=Le(t.location),R=ye(D);if((R==null?void 0:R.onSelect)!==void 0){let H=!1;if(R.onSelect({...t,cell:D,posX:t.localEventX,posY:t.localEventY,bounds:t.bounds,preventDefault:()=>H=!0,theme:Yt(D,t.location)}),H)return}if(Ne==="block"&&yt(g).isGroupHeader)return;const P=_t&&g===F,E=_t&&h!==void 0&&((x=h.current)==null?void 0:x.cell[1])===F;if((t.shiftKey||t.isLongTouch===!0)&&v!==void 0&&m!==void 0&&h.current!==void 0&&!E){if(P)return;const H=Math.min(c,v),N=Math.max(c,v),J=Math.min(g,m),le=Math.max(g,m);pe({...h.current,range:{x:H,y:J,width:N-H+1,height:le-J+1}},!0,r,"click"),at.current=void 0,xe()}else pe({cell:[c,g],range:{x:c,y:g,width:1,height:1}},!0,r,"click"),at.current=void 0,M(void 0),xe()}}else if(t.kind==="header")if(xt.current=[c,g],M(void 0),_e&&c===0)at.current=void 0,It.current=void 0,Ee==="multi"&&(f.length!==F?be(X.fromSingleSelection([0,F]),void 0,r):be(X.empty(),void 0,r),xe());else{const D=It.current;if(ge==="multi"&&(t.shiftKey||t.isLongTouch===!0)&&D!==void 0&&a.hasIndex(D)){const R=[Math.min(D,c),Math.max(D,c)+1];s?de(void 0,R,r):de(X.fromSingleSelection(R),void 0,r)}else s?(a.hasIndex(c)?de(a.remove(c),void 0,r):de(void 0,c,r),It.current=c):ge!=="none"&&(de(X.fromSingleSelection(c),void 0,r),It.current=c);at.current=void 0,xe()}else t.kind===At?xt.current=[c,g]:t.kind===or&&!t.isMaybeScrollbar&&(Ie(Ao,!1),M(void 0),xe(),lt==null||lt(),at.current=void 0,It.current=void 0)},[Ee,ge,h,_e,d,oe,F,Ke,Le,Vt,xe,Bo,ye,Yt,be,xo,Et,Ne,yt,_t,pe,de,Ie,lt]),jt=i.useRef(!1),xt=i.useRef(),Nn=i.useRef(pt),Fe=i.useRef(),ul=i.useCallback(t=>{if($t.current=!1,Nn.current=Te.current,t.button!==0&&t.button!==1){Fe.current=void 0;return}const r=performance.now();Fe.current={button:t.button,time:r,location:t.location},(t==null?void 0:t.kind)==="header"&&(jt.current=!0);const n=t.kind==="cell"&&t.isFillHandle;!n&&t.kind!=="cell"&&t.isEdge||(w({previousSelection:h,fillHandle:n}),xt.current=void 0,!t.isTouch&&t.button===0&&!n?qt(t):!t.isTouch&&t.button===1&&(xt.current=t.location))},[h,qt]),[en,tn]=i.useState(),On=i.useCallback(t=>{if(t.kind!==At||ge!=="multi")return;const r=Po.value?t.metaKey:t.ctrlKey,[n]=t.location,s=h.columns;if(n=d&&nr(c.group,B[f].group);f--)g--;for(let f=n+1;f{if(he!==void 0&&Lt!==void 0){const r=Te.current.y,n=Te.current.height;let s=he({x:t,y:r,width:1,height:Math.min(n,F-r)},Re.current.signal);typeof s!="object"&&(s=await s());const c=ze[t-d],a=document.createElement("canvas").getContext("2d",{alpha:!1});if(a!==null){a.font=me.baseFontFull;const f=fr(a,me,c,0,s,zt,go,!1,ye);Lt==null||Lt(c,f.width,t,f.width)}}},[ze,he,go,me,zt,Lt,d,F,ye]),[dl,on]=i.useState(),Ft=i.useCallback(async(t,r)=>{var f,v;const n=(f=t.current)==null?void 0:f.range;if(n===void 0||he===void 0||r.current===void 0)return;const s=r.current.range;if(fe!==void 0){let m=!1;if(fe({fillDestination:{...s,x:s.x-d},patternSource:{...n,x:n.x-d},preventDefault:()=>m=!0}),m)return}let c=he(n,Re.current.signal);typeof c!="object"&&(c=await c());const g=c,a=[];for(let m=0;m({cell:m.location})))},[he,$e,fe,d]),Wn=i.useCallback(()=>{if(h.current===void 0||h.current.range.width<=1)return;const t={...h,current:{...h.current,range:{...h.current.range,width:1}}};Ft(t,h)},[Ft,h]),Un=i.useCallback(()=>{if(h.current===void 0||h.current.range.height<=1)return;const t={...h,current:{...h.current,range:{...h.current.range,height:1}}};Ft(t,h)},[Ft,h]),fl=i.useCallback((t,r)=>{var y,L;const n=k;if(w(void 0),Zo(void 0),on(void 0),jt.current=!1,r)return;if((n==null?void 0:n.fillHandle)===!0&&h.current!==void 0&&((y=n.previousSelection)==null?void 0:y.current)!==void 0){if(bt===void 0)return;const x={...h,current:{...h.current,range:ql(n.previousSelection.current.range,bt)}};Ft(n.previousSelection,x),Ie(x,!0);return}const[s,c]=t.location,[g,a]=xt.current??[],f=()=>{$t.current=!0},v=x=>{var R,P,E;const D=x.isTouch||g===s&&a===c;if(D&&(we==null||we([s-d,c],{...x,preventDefault:f})),x.button===1)return!$t.current;if(!$t.current){const H=Le(t.location),N=ye(H);if(N!==void 0&&N.onClick!==void 0&&D){const le=N.onClick({...x,cell:H,posX:x.localEventX,posY:x.localEventY,bounds:x.bounds,theme:Yt(H,t.location),preventDefault:f});le!==void 0&&!Eo(le)&&eo(le)&&($e([{location:x.location,value:le}]),(R=ke.current)==null||R.damage([{cell:x.location}]))}if($t.current||h.current===void 0)return!1;let J=!1;switch(H.activationBehaviorOverride??Uo){case"double-click":case"second-click":{if(((E=(P=n==null?void 0:n.previousSelection)==null?void 0:P.current)==null?void 0:E.cell)===void 0)break;const[le,We]=h.current.cell,[Ye,Ue]=n.previousSelection.current.cell;J=s===le&&s===Ye&&c===We&&c===Ue&&(x.isDoubleClick===!0||Uo==="second-click");break}case"single-click":{J=!0;break}}if(J)return ae==null||ae([s-d,c]),Dt(x.bounds,!1),!0}return!1},m=t.location[0]-d;if(t.isTouch){const x=Te.current,D=Nn.current;if(x.x!==D.x||x.y!==D.y)return;if(t.isLongTouch===!0){if(t.kind==="cell"&&jl((L=h.current)==null?void 0:L.cell,t.location)){Se==null||Se([m,t.location[1]],{...t,preventDefault:f});return}else if(t.kind==="header"&&h.columns.hasIndex(s)){Ae==null||Ae(m,{...t,preventDefault:f});return}else if(t.kind===At){if(m<0)return;Ve==null||Ve(m,{...t,preventDefault:f});return}}t.kind==="cell"?v(t)||qt(t):t.kind===At?De==null||De(m,{...t,preventDefault:f}):(t.kind===Zl&&(He==null||He(m,{...t,preventDefault:f})),qt(t));return}if(t.kind==="header"){if(m<0)return;t.isEdge?t.isDoubleClick===!0&&Mo(s):t.button===0&&s===g&&c===a&&(He==null||He(m,{...t,preventDefault:f}))}if(t.kind===At){if(m<0)return;t.button===0&&s===g&&c===a&&(De==null||De(m,{...t,preventDefault:f}),$t.current||On(t))}t.kind==="cell"&&(t.button===0||t.button===1)&&v(t),xt.current=void 0},[k,h,d,bt,Ft,Ie,we,Le,ye,Uo,Yt,$e,ae,Dt,Se,Ae,Ve,qt,De,He,Mo,On]),hl=i.useCallback(t=>{const r={...t,location:[t.location[0]-d,t.location[1]]};lo==null||lo(r),k!==void 0&&t.buttons===0&&(w(void 0),Zo(void 0),on(void 0),jt.current=!1),on(n=>{var s;return jt.current?[t.scrollEdge[0],0]:t.scrollEdge[0]===(n==null?void 0:n[0])&&t.scrollEdge[1]===n[1]?n:k===void 0||(((s=Fe.current)==null?void 0:s.location[0])??0){io==null||io(t-d,r)},[io,d]),vl=i.useCallback((t,r)=>{co==null||co(t-d,r)},[co,d]),Xe=(Zn=h==null?void 0:h.current)==null?void 0:Zn.cell,ml=i.useCallback((t,r,n,s,c,g)=>{mo.current=!1;let a=Xe;a!==void 0&&(a=[a[0]-d,a[1]]);const f=et===0?void 0:{x:0,y:t.y,width:et,height:t.height},v=[];f!==void 0&&v.push(f),tt>0&&(v.push({x:t.x-d,y:F-tt,width:t.width,height:tt}),et>0&&v.push({x:0,y:F-tt,width:et,height:tt}));const m={x:t.x-d,y:t.y,width:t.width,height:oe&&t.y+t.height>=F?t.height-1:t.height,tx:c,ty:g,extras:{selected:a,freezeRegion:f,freezeRegions:v}};Te.current=m,Fn(m),cl([r,n,s]),uo==null||uo(m,m.tx,m.ty,m.extras)},[Xe,d,oe,F,et,tt,Fn,uo]),Cl=kt(nt,i.useCallback((t,r)=>{nt==null||nt(t-d,r-d),ge!=="none"&&de(X.fromSingleSelection(r),void 0,!0)},[ge,nt,d,de])),nn=i.useRef(!1),wl=i.useCallback(t=>{if(t.location[0]===0&&d>0){t.preventDefault();return}ro==null||ro({...t,location:[t.location[0]-d,t.location[1]]}),t.defaultPrevented()||(nn.current=!0),w(void 0)},[ro,d]),pl=i.useCallback(()=>{nn.current=!1},[]),Bn=rt==null?void 0:rt.selectionBehavior,Ro=i.useCallback(t=>{if(Bn!=="block-spanning")return;const{isGroupHeader:r,path:n,groupRows:s}=yt(t);if(r)return[t,t];const c=n[n.length-1],g=t-c,a=t+s-c-1;return[g,a]},[yt,Bn]),rn=i.useRef(),ln=i.useCallback(t=>{var r,n,s;if(!Jl(t,rn.current)&&(rn.current=t,!(((r=Fe==null?void 0:Fe.current)==null?void 0:r.button)!==void 0&&Fe.current.button>=1))){if(t.buttons!==0&&k!==void 0&&((n=Fe.current)==null?void 0:n.location[0])===0&&t.location[0]===0&&d===1&&Ee==="multi"&&k.previousSelection&&!k.previousSelection.rows.hasIndex(Fe.current.location[1])&&h.rows.hasIndex(Fe.current.location[1])){const c=Math.min(Fe.current.location[1],t.location[1]),g=Math.max(Fe.current.location[1],t.location[1])+1;be(X.fromSingleSelection([c,g]),void 0,!1)}if(t.buttons!==0&&k!==void 0&&h.current!==void 0&&!nn.current&&!jt.current&&(Je==="rect"||Je==="multi-rect")){const[c,g]=h.current.cell;let[a,f]=t.location;if(f<0&&(f=Te.current.y),k.fillHandle===!0&&((s=k.previousSelection)==null?void 0:s.current)!==void 0){const v=k.previousSelection.current.range;f=Math.min(f,oe?F-1:F);const m=Ql(v,a,f,Cn);Zo(m)}else{if(oe&&g===F)return;if(oe&&f===F)if(t.kind===or)f--;else return;a=Math.max(a,d);const y=Ro(g);f=y===void 0?f:Rt(f,y[0],y[1]);const L=a-c,x=f-g,D={x:L>=0?c:a,y:x>=0?g:f,width:Math.abs(L)+1,height:Math.abs(x)+1};pe({...h.current,range:D},!0,!1,"drag")}}ao==null||ao({...t,location:[t.location[0]-d,t.location[1]]})}},[k,d,Ee,h,Je,ao,be,oe,F,Cn,Ro,pe]),bl=i.useCallback(()=>{var a,f;const t=rn.current;if(t===void 0)return;const[r,n]=t.scrollEdge;let[s,c]=t.location;const g=Te.current;r===-1?s=((f=(a=g.extras)==null?void 0:a.freezeRegion)==null?void 0:f.x)??g.x:r===1&&(s=g.x+g.width),n===-1?c=Math.max(0,g.y):n===1&&(c=Math.min(F-1,g.y+g.height)),s=Rt(s,0,B.length-1),c=Rt(c,0,F-1),ln({...t,location:[s,c]})},[B.length,ln,F]);sc(dl,q,bl);const Oe=i.useCallback(t=>{if(h.current===void 0)return;const[r,n]=t,[s,c]=h.current.cell,g=h.current.range;let a=g.x,f=g.x+g.width,v=g.y,m=g.y+g.height;const[y,L]=Ro(c)??[0,F-1],x=L+1;if(n!==0)switch(n){case 2:{m=x,v=c,re(0,m,"vertical");break}case-2:{v=y,m=c+1,re(0,v,"vertical");break}case 1:{vc+1?(m--,re(0,m,"vertical")):(v=Math.max(y,v-1),re(0,v,"vertical"));break}default:rr()}if(r!==0)if(r===2)f=B.length,a=s,re(f-1-d,0,"horizontal");else if(r===-2)a=d,f=s+1,re(a-d,0,"horizontal");else{let D=[];if(he!==void 0){const R=he({x:a,y:v,width:f-a-d,height:m-v},Re.current.signal);typeof R=="object"&&(D=wc(R))}if(r===1){let R=!1;if(a0){const P=Gt(a+1,s+1).find(E=>!D.includes(E-d));P!==void 0&&(a=P,R=!0)}else a++,R=!0;R&&re(a,0,"horizontal")}R||(f=Math.min(B.length,f+1),re(f-1-d,0,"horizontal"))}else if(r===-1){let R=!1;if(f>s+1){if(D.length>0){const P=Gt(f-1,s,-1).find(E=>!D.includes(E-d));P!==void 0&&(f=P,R=!0)}else f--,R=!0;R&&re(f-d,0,"horizontal")}R||(a=Math.max(d,a-1),re(a-d,0,"horizontal"))}else rr()}pe({cell:h.current.cell,range:{x:a,y:v,width:f-a,height:m-v}},!0,!1,"keyboard-select")},[he,Ro,h,B.length,d,F,re,pe]),cn=i.useRef(yn);cn.current=yn;const ut=i.useCallback((t,r,n,s)=>{const c=Ce-(n?0:1);t=Rt(t,d,ze.length-1+d),r=Rt(r,0,c);const g=Xe==null?void 0:Xe[0],a=Xe==null?void 0:Xe[1];if(t===g&&r===a)return!1;if(s&&h.current!==void 0){const f=[...h.current.rangeStack];(h.current.range.width>1||h.current.range.height>1)&&f.push(h.current.range),Ie({...h,current:{cell:[t,r],range:{x:t,y:r,width:1,height:1},rangeStack:f}},!0)}else pe({cell:[t,r],range:{x:t,y:r,width:1,height:1}},!0,!1,"keyboard-nav");return p.current!==void 0&&p.current[0]===t&&p.current[1]===r&&(p.current=void 0),cn.current&&re(t-d,r),!0},[Ce,d,ze.length,Xe,h,re,Ie,pe]),yl=i.useCallback((t,r)=>{(C==null?void 0:C.cell)!==void 0&&t!==void 0&&eo(t)&&($e([{location:C.cell,value:t}]),window.requestAnimationFrame(()=>{var c;(c=ke.current)==null||c.damage([{cell:C.cell}])})),xe(!0),M(void 0);const[n,s]=r;if(h.current!==void 0&&(n!==0||s!==0)){const c=h.current.cell[1]===Ce-1&&t!==void 0;ut(Rt(h.current.cell[0]+n,0,B.length-1),Rt(h.current.cell[1]+s,0,Ce-1),c,!1)}Y==null||Y(t,r)},[C==null?void 0:C.cell,xe,h,Y,$e,Ce,ut,B.length]),xl=i.useMemo(()=>`gdg-overlay-${Cc++}`,[]),Mt=i.useCallback(t=>{var n,s,c,g;xe();const r=[];for(let a=t.x;a({cell:a.location})))},[xe,W,ye,$e,d]),Zt=C!==void 0,Vn=i.useCallback(t=>{var P,E;const r=()=>{t.stopPropagation(),t.preventDefault()},n={didMatch:!1},{bounds:s}=t,c=h.columns,g=h.rows,a=ct;if(!Zt&&A(a.clear,t,n))Ie(Ao,!1),lt==null||lt();else if(!Zt&&A(a.selectAll,t,n))Ie({columns:X.empty(),rows:X.empty(),current:{cell:((P=h.current)==null?void 0:P.cell)??[d,0],range:{x:d,y:0,width:V.length,height:F},rangeStack:[]}},!1);else if(A(a.search,t,n))(E=b==null?void 0:b.current)==null||E.focus({preventScroll:!0}),Hn(!0);else if(A(a.delete,t,n)){const H=(st==null?void 0:st(h))??!0;if(H!==!1){const N=H===!0?h:H;if(N.current!==void 0){Mt(N.current.range);for(const J of N.current.rangeStack)Mt(J)}for(const J of N.rows)Mt({x:d,y:J,width:V.length,height:1});for(const J of N.columns)Mt({x:J,y:0,width:1,height:F})}}if(n.didMatch)return r(),!0;if(h.current===void 0)return!1;let[f,v]=h.current.cell;const[,m]=h.current.cell;let y=!1,L=!1;if(A(a.scrollToSelectedCell,t,n)?zo.current(f-d,v):ge!=="none"&&A(a.selectColumn,t,n)?c.hasIndex(f)?de(c.remove(f),void 0,!0):ge==="single"?de(X.fromSingleSelection(f),void 0,!0):de(void 0,f,!0):Ee!=="none"&&A(a.selectRow,t,n)?g.hasIndex(v)?be(g.remove(v),void 0,!0):Ee==="single"?be(X.fromSingleSelection(v),void 0,!0):be(void 0,v,!0):!Zt&&s!==void 0&&A(a.activateCell,t,n)?v===F&&oe?window.setTimeout(()=>{const H=xo(f);Et(H??f)},0):(ae==null||ae([f-d,v]),Dt(s,!0)):h.current.range.height>1&&A(a.downFill,t,n)?Un():h.current.range.width>1&&A(a.rightFill,t,n)?Wn():A(a.goToNextPage,t,n)?v+=Math.max(1,Te.current.height-4):A(a.goToPreviousPage,t,n)?v-=Math.max(1,Te.current.height-4):A(a.goToFirstCell,t,n)?(M(void 0),v=0,f=0):A(a.goToLastCell,t,n)?(M(void 0),v=Number.MAX_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER):A(a.selectToFirstCell,t,n)?(M(void 0),Oe([-2,-2])):A(a.selectToLastCell,t,n)?(M(void 0),Oe([2,2])):Zt?(A(a.closeOverlay,t,n)&&M(void 0),A(a.acceptOverlayDown,t,n)&&(M(void 0),v++),A(a.acceptOverlayUp,t,n)&&(M(void 0),v--),A(a.acceptOverlayLeft,t,n)&&(M(void 0),f--),A(a.acceptOverlayRight,t,n)&&(M(void 0),f++)):(A(a.goDownCell,t,n)?v+=1:A(a.goUpCell,t,n)?v-=1:A(a.goRightCell,t,n)?f+=1:A(a.goLeftCell,t,n)?f-=1:A(a.goDownCellRetainSelection,t,n)?(v+=1,y=!0):A(a.goUpCellRetainSelection,t,n)?(v-=1,y=!0):A(a.goRightCellRetainSelection,t,n)?(f+=1,y=!0):A(a.goLeftCellRetainSelection,t,n)?(f-=1,y=!0):A(a.goToLastRow,t,n)?v=F-1:A(a.goToFirstRow,t,n)?v=Number.MIN_SAFE_INTEGER:A(a.goToLastColumn,t,n)?f=Number.MAX_SAFE_INTEGER:A(a.goToFirstColumn,t,n)?f=Number.MIN_SAFE_INTEGER:(Je==="rect"||Je==="multi-rect")&&(A(a.selectGrowDown,t,n)?Oe([0,1]):A(a.selectGrowUp,t,n)?Oe([0,-1]):A(a.selectGrowRight,t,n)?Oe([1,0]):A(a.selectGrowLeft,t,n)?Oe([-1,0]):A(a.selectToLastRow,t,n)?Oe([0,2]):A(a.selectToFirstRow,t,n)?Oe([0,-2]):A(a.selectToLastColumn,t,n)?Oe([2,0]):A(a.selectToFirstColumn,t,n)&&Oe([-2,0])),L=n.didMatch),Ne!==void 0&&Ne!=="normal"&&v!==m){const H=Ne==="skip-up"||Ne==="skip"||Ne==="block",N=Ne==="skip-down"||Ne==="skip"||Ne==="block",J=v=0&&yt(v).isGroupHeader;)v--;v<0&&(v=m)}else if(!J&&N){for(;v=F&&(v=m)}}const D=ut(f,v,!1,y),R=n.didMatch;return R&&(D||!L||pn)&&r(),R},[Ne,Zt,h,ct,ge,Ee,Je,d,yt,F,ut,Ie,lt,V.length,st,pn,Mt,de,be,oe,xo,Et,ae,Dt,Un,Wn,Oe]),Jt=i.useCallback(t=>{let r=!1;if(Nt!==void 0&&Nt({...t,cancel:()=>{r=!0}}),r||Vn(t)||h.current===void 0)return;const[n,s]=h.current.cell,c=Te.current;if(Ot&&!t.metaKey&&!t.ctrlKey&&h.current!==void 0&&t.key.length===1&&/[ -~]/g.test(t.key)&&t.bounds!==void 0&&Io(W([n-d,Math.max(0,Math.min(s,F-1))]))){if((!oe||s!==F)&&(c.y>s||s>c.y+c.height||c.x>n||n>c.x+c.width))return;Dt(t.bounds,!0,t.key),t.stopPropagation(),t.preventDefault()}},[Ot,Nt,Vn,h,W,d,F,oe,Dt]),Ml=i.useCallback((t,r)=>{const n=t.location[0]-d;if(t.kind==="header"&&(Ae==null||Ae(n,{...t,preventDefault:r})),t.kind===At){if(n<0)return;Ve==null||Ve(n,{...t,preventDefault:r})}if(t.kind==="cell"){const[s,c]=t.location;Se==null||Se([n,c],{...t,preventDefault:r}),ti(h,t.location)||ut(s,c,!1,!1)}},[h,Se,Ve,Ae,d,ut]),sn=i.useCallback(async t=>{var a,f,v;if(!ct.paste)return;function r(m,y,L,x){var R,P;const D=typeof L=="object"?(L==null?void 0:L.join(` -`))??"":(L==null?void 0:L.toString())??"";if(!Eo(m)&&Io(m)&&m.readonly!==!0){const E=ee==null?void 0:ee(D,m);if(E!==void 0&&eo(E))return{location:y,value:E};const H=ye(m);if(H===void 0)return;if(H.kind===Q.Custom){Go(m.kind===Q.Custom);const N=(R=H.onPaste)==null?void 0:R.call(H,D,m.data);return N===void 0?void 0:{location:y,value:{...m,data:N}}}else{const N=(P=H.onPaste)==null?void 0:P.call(H,D,m,{formatted:x,formattedString:typeof x=="string"?x:x==null?void 0:x.join(` -`),rawValue:L});return N===void 0?void 0:(Go(N.kind===m.kind),{location:y,value:N})}}}const n=h.columns,s=h.rows,c=((a=q.current)==null?void 0:a.contains(document.activeElement))===!0||((f=T.current)==null?void 0:f.contains(document.activeElement))===!0;let g;if(h.current!==void 0?g=[h.current.range.x,h.current.range.y]:n.length===1?g=[n.first()??0,0]:s.length===1&&(g=[d,s.first()??0]),c&&g!==void 0){let m,y;const L="text/plain",x="text/html";if(navigator.clipboard.read!==void 0){const E=await navigator.clipboard.read();for(const H of E){if(H.types.includes(x)){const J=await(await H.getType(x)).text(),le=lr(J);if(le!==void 0){m=le;break}}H.types.includes(L)&&(y=await(await H.getType(L)).text())}}else if(navigator.clipboard.readText!==void 0)y=await navigator.clipboard.readText();else if(t!==void 0&&(t==null?void 0:t.clipboardData)!==null){if(t.clipboardData.types.includes(x)){const E=t.clipboardData.getData(x);m=lr(E)}m===void 0&&t.clipboardData.types.includes(L)&&(y=t.clipboardData.getData(L))}else return;const[D,R]=g,P=[];do{if(Ct===void 0){const E=Le(g),H=y??(m==null?void 0:m.map(J=>J.map(le=>le.rawValue).join(" ")).join(" "))??"",N=r(E,g,H,void 0);N!==void 0&&P.push(N);break}if(m===void 0){if(y===void 0)return;m=oi(y)}if(Ct===!1||typeof Ct=="function"&&(Ct==null?void 0:Ct([g[0]-d,g[1]],m.map(E=>E.map(H=>{var N;return((N=H.rawValue)==null?void 0:N.toString())??""}))))!==!0)return;for(const[E,H]of m.entries()){if(E+R>=F)break;for(const[N,J]of H.entries()){const le=[N+D,E+R],[We,Ye]=le;if(We>=B.length||Ye>=Ce)continue;const Ue=Le(le),qe=r(Ue,le,J.rawValue,J.formatted);qe!==void 0&&P.push(qe)}}}while(!1);$e(P),(v=ke.current)==null||v.damage(P.map(E=>({cell:E.location})))}},[ee,ye,Le,h,ct.paste,q,B.length,$e,Ce,Ct,d,F]);fn("paste",sn,S,!1,!0);const Qt=i.useCallback(async(t,r)=>{var a,f;if(!ct.copy)return;const n=r===!0||((a=q.current)==null?void 0:a.contains(document.activeElement))===!0||((f=T.current)==null?void 0:f.contains(document.activeElement))===!0,s=h.columns,c=h.rows,g=(v,m)=>{if(!mn)ir(v,m,t);else{const y=m.map(L=>({kind:Q.Text,data:V[L].title,displayData:V[L].title,allowOverlay:!1}));ir([y,...v],m,t)}};if(n&&he!==void 0){if(h.current!==void 0){let v=he(h.current.range,Re.current.signal);typeof v!="object"&&(v=await v()),g(v,Gt(h.current.range.x-d,h.current.range.x+h.current.range.width-d))}else if(c!==void 0&&c.length>0){const m=[...c].map(y=>{const L=he({x:d,y,width:V.length,height:1},Re.current.signal);return typeof L=="object"?L[0]:L().then(x=>x[0])});if(m.some(y=>y instanceof Promise)){const y=await Promise.all(m);g(y,Gt(V.length))}else g(m,Gt(V.length))}else if(s.length>0){const v=[],m=[];for(const y of s){let L=he({x:y,y:0,width:1,height:F},Re.current.signal);typeof L!="object"&&(L=await L()),v.push(L),m.push(y-d)}if(v.length===1)g(v[0],m);else{const y=v.reduce((L,x)=>L.map((D,R)=>[...D,...x[R]]));g(y,m)}}}},[V,he,h,ct.copy,d,q,F,mn]);fn("copy",Qt,S,!1,!1);const Rl=i.useCallback(async t=>{var n,s;if(!(!ct.cut||!(((n=q.current)==null?void 0:n.contains(document.activeElement))===!0||((s=T.current)==null?void 0:s.contains(document.activeElement))===!0))&&(await Qt(t),h.current!==void 0)){let c={current:{cell:h.current.cell,range:h.current.range,rangeStack:[]},rows:X.empty(),columns:X.empty()};const g=st==null?void 0:st(c);if(g===!1||(c=g===!0?c:g,c.current===void 0))return;Mt(c.current.range)}},[Mt,h,ct.cut,Qt,q,st]);fn("cut",Rl,S,!1,!1);const kl=i.useCallback((t,r)=>{if(Ge!==void 0){d!==0&&(t=t.map(c=>[c[0]-d,c[1]])),Ge(t,r);return}if(t.length===0||r===-1)return;const[n,s]=t[r];p.current!==void 0&&p.current[0]===n&&p.current[1]===s||(p.current=[n,s],ut(n,s,!1,!1))},[Ge,d,ut]),[ko,So]=((Jn=wt==null?void 0:wt.current)==null?void 0:Jn.cell)??[],zo=i.useRef(re);zo.current=re,i.useLayoutEffect(()=>{var t,r,n,s;cn.current&&!mo.current&&ko!==void 0&&So!==void 0&&(ko!==((r=(t=vo.current)==null?void 0:t.current)==null?void 0:r.cell[0])||So!==((s=(n=vo.current)==null?void 0:n.current)==null?void 0:s.cell[1]))&&zo.current(ko,So),mo.current=!1},[ko,So]);const _n=h.current!==void 0&&(h.current.cell[0]>=B.length||h.current.cell[1]>=Ce);i.useLayoutEffect(()=>{_n&&Ie(Ao,!1)},[_n,Ie]);const Sl=i.useMemo(()=>oe===!0&&(U==null?void 0:U.tint)===!0?X.fromSingleSelection(Ce-1):X.empty(),[Ce,oe,U==null?void 0:U.tint]),zl=i.useCallback(t=>typeof St=="boolean"?St:(St==null?void 0:St(t-d))??!0,[d,St]),Tl=i.useMemo(()=>{if(en===void 0||T.current===null)return null;const{bounds:t,group:r}=en,n=T.current.getBoundingClientRect();return j(ji,{bounds:t,group:r,canvasBounds:n,onClose:()=>tn(void 0),onFinish:s=>{tn(void 0),$==null||$(r,s)}})},[$,en]),Ll=Math.min(B.length,et+(_e?1:0));i.useImperativeHandle(o,()=>({appendRow:(t,r)=>Et(t+d,r),updateCells:t=>{var r;return d!==0&&(t=t.map(n=>({cell:[n.cell[0]+d,n.cell[1]]}))),(r=ke.current)==null?void 0:r.damage(t)},getBounds:(t,r)=>{var n;if(!((T==null?void 0:T.current)===null||(q==null?void 0:q.current)===null)){if(t===void 0&&r===void 0){const s=T.current.getBoundingClientRect(),c=s.width/q.current.clientWidth;return{x:s.x-q.current.scrollLeft*c,y:s.y-q.current.scrollTop*c,width:q.current.scrollWidth*c,height:q.current.scrollHeight*c}}return(n=ke.current)==null?void 0:n.getBounds((t??0)+d,r)}},focus:()=>{var t;return(t=ke.current)==null?void 0:t.focus()},emit:async t=>{switch(t){case"delete":Jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Jt({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Qt(void 0,!0);break;case"paste":await sn();break}},scrollTo:re,remeasureColumns:t=>{for(const r of t)Mo(r+d)}}),[Et,Mo,q,Qt,Jt,sn,d,re]);const[Xn,Yn]=Xe??[],Hl=i.useCallback(t=>{const[r,n]=t;if(n===-1){ge!=="none"&&(de(X.fromSingleSelection(r),void 0,!1),xe());return}Xn===r&&Yn===n||(pe({cell:t,range:{x:r,y:n,width:1,height:1}},!0,!1,"keyboard-nav"),re(r,n))},[ge,xe,re,Xn,Yn,pe,de]),[Dl,El]=i.useState(!1),qn=i.useRef(si(t=>{El(t)},5)),Il=i.useCallback(()=>{qn.current(!0),h.current===void 0&&h.columns.length===0&&h.rows.length===0&&k===void 0&&pe({cell:[d,Co],range:{x:d,y:Co,width:1,height:1}},!0,!1,"keyboard-select")},[Co,h,k,d,pe]),$l=i.useCallback(()=>{qn.current(!1)},[]),[Fl,Al]=i.useMemo(()=>{let t;const r=(ve==null?void 0:ve.scrollbarWidthOverride)??ni(),n=F+(oe?1:0);if(typeof it=="number")t=Xt+n*it;else{let c=0;const g=Math.min(n,10);for(let a=0;ag.width+c,0)+r;return[`${Math.min(1e5,s)}px`,`${Math.min(1e5,t)}px`]},[B,ve==null?void 0:ve.scrollbarWidthOverride,it,F,oe,Xt]),Gl=i.useMemo(()=>ri(me),[me]);return j(li.Provider,{value:me,children:to(lc,{style:Gl,className:Kt,inWidth:ie??Fl,inHeight:se??Al,children:[j(_i,{fillHandle:kr,drawFocusRing:wn,experimental:ve,fixedShadowX:Sr,fixedShadowY:zr,getRowThemeOverride:ot,headerIcons:Tr,imageWindowLoader:Lr,initialSize:Hr,isDraggable:Dr,onDragLeave:Er,onRowMoved:Vt,overscrollX:jr,overscrollY:Zr,preventDiagonalScrolling:Fr,rightElement:Ar,rightElementProps:Gr,smoothScrollX:Pr,smoothScrollY:Kr,className:Kt,enableGroups:jo,onCanvasFocused:Il,onCanvasBlur:$l,canvasRef:T,onContextMenu:Ml,theme:me,cellXOffset:sl,cellYOffset:Co,accessibilityHeight:pt.height,onDragEnd:pl,columns:B,nonGrowWidth:En,drawHeader:ll,onColumnProposeMove:Be,drawCell:il,disabledRows:Sl,freezeColumns:Ll,lockColumns:d,firstColAccessible:d===0,getCellContent:Le,minColumnWidth:zt,maxColumnWidth:go,searchInputRef:b,showSearch:Qr,onSearchClose:el,highlightRegions:al,getCellsForSelection:he,getGroupDetails:Jo,headerHeight:Yo,isFocused:Dl,groupHeaderHeight:jo?Tn:0,freezeTrailingRows:tt+(oe&&(U==null?void 0:U.sticky)===!0?1:0),hasAppendRow:oe,onColumnResize:Lt,onColumnResizeEnd:nl,onColumnResizeStart:rl,onCellFocused:Hl,onColumnMoved:Cl,onDragStart:wl,onHeaderMenuClick:gl,onHeaderIndicatorClick:vl,onItemHovered:ln,isFilling:(k==null?void 0:k.fillHandle)===!0,onMouseMove:hl,onKeyDown:Jt,onKeyUp:No,onMouseDown:ul,onMouseUp:fl,onDragOverCell:Mr,onDrop:Rr,onSearchResultsChanged:kl,onVisibleRegionChanged:ml,clientSize:qo,rowHeight:it,searchResults:Ze,searchValue:no,onSearchValueChange:ft,rows:Ce,scrollRef:q,selection:h,translateX:pt.tx,translateY:pt.ty,verticalBorder:zl,gridRef:ke,getCellRenderer:ye,resizeIndicator:Vr}),Tl,C!==void 0&&j(i.Suspense,{fallback:null,children:j(mc,{...C,validateCell:ol,bloom:je,id:xl,getCellRenderer:ye,className:(ve==null?void 0:ve.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:br,imageEditorOverride:z,onFinishEditing:yl,markdownDivCreateNode:K,isOutsideClick:Br})})]})})},bc=i.forwardRef(pc),yc=(e,o)=>{const l=i.useMemo(()=>({...Ki,...e.headerIcons}),[e.headerIcons]),u=i.useMemo(()=>e.imageWindowLoader??new ii,[e.imageWindowLoader]);return j(bc,{...e,renderers:ci,headerIcons:l,ref:o,imageWindowLoader:u})},Dc=i.forwardRef(yc);export{Xi as C,Dc as D,dt as k,hc as u}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-B2IrFVCJ.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./index-wocATsGp.js","./image-window-loader--5E_ifQX.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./iframe-0-Di66Z3.js","./image-window-loader-1jHxuE_X.css","./flatten-qRvRBp6y.js","./scrolling-data-grid-rB9VuUnF.js","./scrolling-data-grid-dE2iz8sf.css","./data-grid-overlay-editor-EbzU9_4i.css"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} \ No newline at end of file diff --git a/docs/assets/data-editor-repros.stories-Exc9lGv1.js b/docs/assets/data-editor-repros.stories-9nGWjuU7.js similarity index 92% rename from docs/assets/data-editor-repros.stories-Exc9lGv1.js rename to docs/assets/data-editor-repros.stories-9nGWjuU7.js index 5e3c67bc3..fa8f5bd54 100644 --- a/docs/assets/data-editor-repros.stories-Exc9lGv1.js +++ b/docs/assets/data-editor-repros.stories-9nGWjuU7.js @@ -1,4 +1,4 @@ -import{j as t,a as m,s as w}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{B as f}from"./story-utils-K2EZnGjM.js";import{G as p}from"./image-window-loader--5E_ifQX.js";import{D as g}from"./data-editor-all-zTb9g2fv.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";const{useState:T,useMemo:S}=__STORYBOOK_MODULE_ADDONS__,$={title:"Tests/TestCases/Bugs",decorators:[e=>t(f,{width:1e3,height:800,children:t(e,{})})]},A=([,e])=>({allowOverlay:!0,kind:p.Number,data:e,displayData:e.toString()}),x=()=>{},v=w("div")({name:"Bug70Style",class:"b1nvh7n2",propsAsIs:!1});function o(){return m(v,{className:"App",children:[t("p",{children:"To cause error: scroll down at least one row, edit a cell in Col2, and hit Tab"}),t("a",{href:"https://github.com/glideapps/glide-data-grid/issues/70",target:"_blank",rel:"noreferrer",children:"Original report"}),t(g,{width:500,height:500,rows:100,columns:[{title:"Col1",width:100},{title:"Col2",width:100}],getCellContent:A,onCellEdited:x})]})}const _=([e,r])=>({allowOverlay:!0,kind:p.Text,data:`${e} - ${r}`,displayData:`${e} - ${r}`}),l=[{title:"Col AAAA",width:120},{title:"Col AAA",width:120},{title:"Col AA",width:120},{title:"Col A",width:120},{title:"Col",width:120}];function n(){const[e,r]=T(""),C=S(()=>e===""?l:l.filter(s=>s.title.toLowerCase().includes(e.toLowerCase())),[e]);return m("div",{children:[t("input",{value:e,onChange:s=>{r(s.target.value)}}),t(g,{width:1e3,height:500,rows:100,columns:C,getCellContent:_,smoothScrollX:!0,smoothScrollY:!0})]})}var a,i,c;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`function Bug70() { +import{j as t,a as m,s as w}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{B as f}from"./story-utils-K2EZnGjM.js";import{G as p}from"./image-window-loader-ggeJlWLo.js";import{D as g}from"./data-editor-all-ZeeWpldS.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";const{useState:T,useMemo:S}=__STORYBOOK_MODULE_ADDONS__,$={title:"Tests/TestCases/Bugs",decorators:[e=>t(f,{width:1e3,height:800,children:t(e,{})})]},A=([,e])=>({allowOverlay:!0,kind:p.Number,data:e,displayData:e.toString()}),x=()=>{},v=w("div")({name:"Bug70Style",class:"b1nvh7n2",propsAsIs:!1});function o(){return m(v,{className:"App",children:[t("p",{children:"To cause error: scroll down at least one row, edit a cell in Col2, and hit Tab"}),t("a",{href:"https://github.com/glideapps/glide-data-grid/issues/70",target:"_blank",rel:"noreferrer",children:"Original report"}),t(g,{width:500,height:500,rows:100,columns:[{title:"Col1",width:100},{title:"Col2",width:100}],getCellContent:A,onCellEdited:x})]})}const _=([e,r])=>({allowOverlay:!0,kind:p.Text,data:`${e} - ${r}`,displayData:`${e} - ${r}`}),l=[{title:"Col AAAA",width:120},{title:"Col AAA",width:120},{title:"Col AA",width:120},{title:"Col A",width:120},{title:"Col",width:120}];function n(){const[e,r]=T(""),C=S(()=>e===""?l:l.filter(s=>s.title.toLowerCase().includes(e.toLowerCase())),[e]);return m("div",{children:[t("input",{value:e,onChange:s=>{r(s.target.value)}}),t(g,{width:1e3,height:500,rows:100,columns:C,getCellContent:_,smoothScrollX:!0,smoothScrollY:!0})]})}var a,i,c;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`function Bug70() { const cols = [{ title: "Col1", width: 100 diff --git a/docs/assets/data-editor.stories-lLnDOuJ2.js b/docs/assets/data-editor.stories-gYDN_QGF.js similarity index 98% rename from docs/assets/data-editor.stories-lLnDOuJ2.js rename to docs/assets/data-editor.stories-gYDN_QGF.js index dc4490827..92acacd36 100644 --- a/docs/assets/data-editor.stories-lLnDOuJ2.js +++ b/docs/assets/data-editor.stories-gYDN_QGF.js @@ -1,4 +1,4 @@ -import{j as a}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{B as Me}from"./story-utils-K2EZnGjM.js";import{C,G as i}from"./image-window-loader--5E_ifQX.js";import{D as c}from"./data-editor-all-zTb9g2fv.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";const{useState:d,useCallback:m,useMemo:g}=__STORYBOOK_MODULE_ADDONS__,Fe={title:"Tests/TestCases",decorators:[e=>a(Me,{width:1e3,height:800,children:a(e,{})})]};function w([e,t]){return e===0?{kind:i.RowID,data:`RowID ${e}, ${t}`,allowOverlay:!1}:e===1?{kind:i.Bubble,data:[`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`],allowOverlay:!0}:e===2?{kind:i.Image,data:["https://i.imgur.com/5J0BftG.jpg","https://preview.redd.it/7jlqkp2cyap51.jpg?width=575&auto=webp&s=26fa9ed15b16fb450ee08ed1f2f0ccb5e0223581"],allowOverlay:!0,readonly:!1}:e===3?{kind:i.Markdown,data:`## Markdown has titles +import{j as a}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{B as Me}from"./story-utils-K2EZnGjM.js";import{C,G as i}from"./image-window-loader-ggeJlWLo.js";import{D as c}from"./data-editor-all-ZeeWpldS.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";const{useState:d,useCallback:m,useMemo:g}=__STORYBOOK_MODULE_ADDONS__,Fe={title:"Tests/TestCases",decorators:[e=>a(Me,{width:1e3,height:800,children:a(e,{})})]};function w([e,t]){return e===0?{kind:i.RowID,data:`RowID ${e}, ${t}`,allowOverlay:!1}:e===1?{kind:i.Bubble,data:[`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`,`Bub ${e}`,`Bub ${t}`],allowOverlay:!0}:e===2?{kind:i.Image,data:["https://i.imgur.com/5J0BftG.jpg","https://preview.redd.it/7jlqkp2cyap51.jpg?width=575&auto=webp&s=26fa9ed15b16fb450ee08ed1f2f0ccb5e0223581"],allowOverlay:!0,readonly:!1}:e===3?{kind:i.Markdown,data:`## Markdown has titles And supports newline chars and automatic wrapping text that just needs to be long enough to trigger it. diff --git a/docs/assets/data-grid-overlay-editor-B2IrFVCJ.js b/docs/assets/data-grid-overlay-editor-XEAOWHGB.js similarity index 93% rename from docs/assets/data-grid-overlay-editor-B2IrFVCJ.js rename to docs/assets/data-grid-overlay-editor-XEAOWHGB.js index b3cd80289..1ed132b7e 100644 --- a/docs/assets/data-grid-overlay-editor-B2IrFVCJ.js +++ b/docs/assets/data-grid-overlay-editor-XEAOWHGB.js @@ -1 +1 @@ -import{s as $,j as h}from"./marked.esm-dbrxtycE.js";import{r as i}from"./index-BMVQvedj.js";import{r as J}from"./index-wocATsGp.js";import{C as Q}from"./data-editor-all-zTb9g2fv.js";import{E as P,s as U,F as Z,T as ee,M as te}from"./image-window-loader--5E_ifQX.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";const re=()=>t=>t.targetX,ie=()=>t=>t.targetY,se=()=>t=>t.targetWidth,ne=()=>t=>t.targetHeight,oe=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),le=$("div")({name:"DataGridOverlayEditorStyle",class:"d16c1ze1",propsAsIs:!1,vars:{"d16c1ze1-0":[ie(),"px"],"d16c1ze1-1":[re(),"px"],"d16c1ze1-2":[se(),"px"],"d16c1ze1-3":[ne(),"px"],"d16c1ze1-4":[oe(),"px"],"d16c1ze1-5":[ae(),"px"]}});function ce(){const[t,n]=i.useState();return[t??void 0,n]}function de(){const[t,n]=ce(),[s,y]=i.useState(0),[p,C]=i.useState(!0);i.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const o=new IntersectionObserver(a=>{a.length!==0&&C(a[0].isIntersecting)},{threshold:1});return o.observe(t),()=>o.disconnect()},[t]),i.useEffect(()=>{if(p||t===void 0)return;let o;const a=()=>{const{right:O}=t.getBoundingClientRect();y(m=>Math.min(m+window.innerWidth-O-10,0)),o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>{o!==void 0&&cancelAnimationFrame(o)}},[t,p]);const S=i.useMemo(()=>({transform:`translateX(${s}px)`}),[s]);return{ref:n,style:S}}const Ce=t=>{const{target:n,content:s,onFinishEditing:y,forceEditMode:p,initialValue:C,imageEditorOverride:S,markdownDivCreateNode:o,highlight:a,className:O,theme:m,id:X,cell:k,bloom:u,validateCell:l,getCellRenderer:w,provideEditor:v,isOutsideClick:A}=t,[c,N]=i.useState(p?s:void 0),R=i.useRef(c??s);R.current=c??s;const[E,I]=i.useState(()=>l===void 0?!0:!(P(s)&&(l==null?void 0:l(k,s,R.current))===!1)),f=i.useCallback((e,r)=>{y(E?e:void 0,r)},[E,y]),V=i.useCallback(e=>{if(l!==void 0&&e!==void 0&&P(e)){const r=l(k,e,R.current);r===!1?I(!1):(typeof r=="object"&&(e=r),I(!0))}N(e)},[k,l]),x=i.useRef(!1),g=i.useRef(void 0),W=i.useCallback(()=>{f(c,[0,0]),x.current=!0},[c,f]),Y=i.useCallback((e,r)=>{f(e,r??g.current??[0,0]),x.current=!0},[f]),K=i.useCallback(async e=>{let r=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),g.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),g.current=[0,1],r=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),g.current=[e.shiftKey?-1:1,0],r=!0),window.setTimeout(()=>{!x.current&&g.current!==void 0&&(f(r?c:void 0,g.current),x.current=!0)},0)},[f,c]),D=c??s,[d,q]=i.useMemo(()=>{var r,H;if(U(s))return[];const e=v==null?void 0:v(s);return e!==void 0?[e,!1]:[(H=(r=w(s))==null?void 0:r.provideEditor)==null?void 0:H.call(r,s),!1]},[s,w,v]),{ref:B,style:L}=de();let z=!0,M,_=!0,b;if(d!==void 0){z=d.disablePadding!==!0,_=d.disableStyling!==!0;const e=Z(d);e&&(b=d.styleOverride);const r=e?d.editor:d;M=h(r,{isHighlighted:a,onChange:V,value:D,initialValue:C,onFinishedEditing:Y,validatedSelection:P(D)?D.selectionRange:void 0,forceEditMode:p,target:n,imageEditorOverride:S,markdownDivCreateNode:o,isValid:E,theme:m})}b={...b,...L};const T=document.getElementById("portal");if(T===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `
` as the last child of your ``.'),null;let F=_?"gdg-style":"gdg-unstyle";E||(F+=" gdg-invalid"),z&&(F+=" gdg-pad");const j=(u==null?void 0:u[0])??1,G=(u==null?void 0:u[1])??1;return J.createPortal(h(ee.Provider,{value:m,children:h(Q,{style:te(m),className:O,onClickOutside:W,isOutsideClick:A,children:h(le,{ref:B,id:X,className:F,style:b,as:q===!0?"label":void 0,targetX:n.x-j,targetY:n.y-G,targetWidth:n.width+j*2,targetHeight:n.height+G*2,children:h("div",{className:"gdg-clip-region",onKeyDown:K,children:M})})})}),T)};export{Ce as default}; +import{s as $,j as h}from"./marked.esm-dbrxtycE.js";import{r as i}from"./index-BMVQvedj.js";import{r as J}from"./index-wocATsGp.js";import{C as Q}from"./data-editor-all-ZeeWpldS.js";import{E as P,s as U,F as Z,T as ee,M as te}from"./image-window-loader-ggeJlWLo.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";const re=()=>t=>t.targetX,ie=()=>t=>t.targetY,se=()=>t=>t.targetWidth,ne=()=>t=>t.targetHeight,oe=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),le=$("div")({name:"DataGridOverlayEditorStyle",class:"d16c1ze1",propsAsIs:!1,vars:{"d16c1ze1-0":[ie(),"px"],"d16c1ze1-1":[re(),"px"],"d16c1ze1-2":[se(),"px"],"d16c1ze1-3":[ne(),"px"],"d16c1ze1-4":[oe(),"px"],"d16c1ze1-5":[ae(),"px"]}});function ce(){const[t,n]=i.useState();return[t??void 0,n]}function de(){const[t,n]=ce(),[s,y]=i.useState(0),[p,C]=i.useState(!0);i.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const o=new IntersectionObserver(a=>{a.length!==0&&C(a[0].isIntersecting)},{threshold:1});return o.observe(t),()=>o.disconnect()},[t]),i.useEffect(()=>{if(p||t===void 0)return;let o;const a=()=>{const{right:O}=t.getBoundingClientRect();y(m=>Math.min(m+window.innerWidth-O-10,0)),o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>{o!==void 0&&cancelAnimationFrame(o)}},[t,p]);const S=i.useMemo(()=>({transform:`translateX(${s}px)`}),[s]);return{ref:n,style:S}}const Ce=t=>{const{target:n,content:s,onFinishEditing:y,forceEditMode:p,initialValue:C,imageEditorOverride:S,markdownDivCreateNode:o,highlight:a,className:O,theme:m,id:X,cell:k,bloom:u,validateCell:l,getCellRenderer:w,provideEditor:v,isOutsideClick:A}=t,[c,N]=i.useState(p?s:void 0),R=i.useRef(c??s);R.current=c??s;const[E,I]=i.useState(()=>l===void 0?!0:!(P(s)&&(l==null?void 0:l(k,s,R.current))===!1)),f=i.useCallback((e,r)=>{y(E?e:void 0,r)},[E,y]),V=i.useCallback(e=>{if(l!==void 0&&e!==void 0&&P(e)){const r=l(k,e,R.current);r===!1?I(!1):(typeof r=="object"&&(e=r),I(!0))}N(e)},[k,l]),x=i.useRef(!1),g=i.useRef(void 0),W=i.useCallback(()=>{f(c,[0,0]),x.current=!0},[c,f]),Y=i.useCallback((e,r)=>{f(e,r??g.current??[0,0]),x.current=!0},[f]),K=i.useCallback(async e=>{let r=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),g.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),g.current=[0,1],r=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),g.current=[e.shiftKey?-1:1,0],r=!0),window.setTimeout(()=>{!x.current&&g.current!==void 0&&(f(r?c:void 0,g.current),x.current=!0)},0)},[f,c]),D=c??s,[d,q]=i.useMemo(()=>{var r,H;if(U(s))return[];const e=v==null?void 0:v(s);return e!==void 0?[e,!1]:[(H=(r=w(s))==null?void 0:r.provideEditor)==null?void 0:H.call(r,s),!1]},[s,w,v]),{ref:B,style:L}=de();let z=!0,M,_=!0,b;if(d!==void 0){z=d.disablePadding!==!0,_=d.disableStyling!==!0;const e=Z(d);e&&(b=d.styleOverride);const r=e?d.editor:d;M=h(r,{isHighlighted:a,onChange:V,value:D,initialValue:C,onFinishedEditing:Y,validatedSelection:P(D)?D.selectionRange:void 0,forceEditMode:p,target:n,imageEditorOverride:S,markdownDivCreateNode:o,isValid:E,theme:m})}b={...b,...L};const T=document.getElementById("portal");if(T===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `
` as the last child of your ``.'),null;let F=_?"gdg-style":"gdg-unstyle";E||(F+=" gdg-invalid"),z&&(F+=" gdg-pad");const j=(u==null?void 0:u[0])??1,G=(u==null?void 0:u[1])??1;return J.createPortal(h(ee.Provider,{value:m,children:h(Q,{style:te(m),className:O,onClickOutside:W,isOutsideClick:A,children:h(le,{ref:B,id:X,className:F,style:b,as:q===!0?"label":void 0,targetX:n.x-j,targetY:n.y-G,targetWidth:n.width+j*2,targetHeight:n.height+G*2,children:h("div",{className:"gdg-clip-region",onKeyDown:K,children:M})})})}),T)};export{Ce as default}; diff --git a/docs/assets/data-grid-overlay-editor-K62UQj4H.js b/docs/assets/data-grid-overlay-editor-xe3yVD_U.js similarity index 96% rename from docs/assets/data-grid-overlay-editor-K62UQj4H.js rename to docs/assets/data-grid-overlay-editor-xe3yVD_U.js index 17136a966..d7fe26a95 100644 --- a/docs/assets/data-grid-overlay-editor-K62UQj4H.js +++ b/docs/assets/data-grid-overlay-editor-xe3yVD_U.js @@ -1 +1 @@ -import{r}from"./index-BMVQvedj.js";import{r as $}from"./index-wocATsGp.js";import{f as w,j as z,k as J,T as Q,C as U,l as Z}from"./data-editor-all-kM-cjKZ5.js";import{s as ee}from"./marked.esm-dbrxtycE.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";const te=()=>t=>t.targetX,re=()=>t=>t.targetY,ne=()=>t=>t.targetWidth,ie=()=>t=>t.targetHeight,se=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),oe=ee("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[re(),"px"],"d19meir1-1":[te(),"px"],"d19meir1-2":[ne(),"px"],"d19meir1-3":[ie(),"px"],"d19meir1-4":[se(),"px"],"d19meir1-5":[ae(),"px"]}});function de(){const[t,s]=r.useState();return[t??void 0,s]}function le(){const[t,s]=de(),[i,y]=r.useState(0),[g,O]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&O(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(g||t===void 0)return;let a;const o=()=>{const{right:S}=t.getBoundingClientRect();y(p=>Math.min(p+window.innerWidth-S-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,g]);const b=r.useMemo(()=>({transform:`translateX(${i}px)`}),[i]);return{ref:s,style:b}}const Ce=t=>{const{target:s,content:i,onFinishEditing:y,forceEditMode:g,initialValue:O,imageEditorOverride:b,markdownDivCreateNode:a,highlight:o,className:S,theme:p,id:H,cell:k,bloom:c,validateCell:d,getCellRenderer:F,provideEditor:h,isOutsideClick:X}=t,[l,j]=r.useState(g?i:void 0),v=r.useRef(l??i);v.current=l??i;const[E,R]=r.useState(()=>d===void 0?!0:!(w(i)&&(d==null?void 0:d(k,i,v.current))===!1)),f=r.useCallback((e,n)=>{y(E?e:void 0,n)},[E,y]),A=r.useCallback(e=>{if(d!==void 0&&e!==void 0&&w(e)){const n=d(k,e,v.current);n===!1?R(!1):(typeof n=="object"&&(e=n),R(!0))}j(e)},[k,d]),C=r.useRef(!1),m=r.useRef(void 0),K=r.useCallback(()=>{f(l,[0,0]),C.current=!0},[l,f]),W=r.useCallback((e,n)=>{f(e,n??m.current??[0,0]),C.current=!0},[f]),Y=r.useCallback(async e=>{let n=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),m.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),m.current=[0,1],n=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),m.current=[e.shiftKey?-1:1,0],n=!0),window.setTimeout(()=>{!C.current&&m.current!==void 0&&(f(n?l:void 0,m.current),C.current=!0)},0)},[f,l]),D=l??i,[u,q]=r.useMemo(()=>{var n,G;if(z(i))return[];const e=h==null?void 0:h(i);return e!==void 0?[e,!1]:[(G=(n=F(i))==null?void 0:n.provideEditor)==null?void 0:G.call(n,i),!1]},[i,F,h]),{ref:B,style:L}=le();let P=!0,M,_=!0,x;if(u!==void 0){P=u.disablePadding!==!0,_=u.disableStyling!==!0;const e=J(u);e&&(x=u.styleOverride);const n=e?u.editor:u;M=r.createElement(n,{isHighlighted:o,onChange:A,value:D,initialValue:O,onFinishedEditing:W,validatedSelection:w(D)?D.selectionRange:void 0,forceEditMode:g,target:s,imageEditorOverride:b,markdownDivCreateNode:a,isValid:E,theme:p})}x={...x,...L};const N=document.getElementById("portal");if(N===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `
` as the last child of your ``.'),null;let I=_?"gdg-style":"gdg-unstyle";E||(I+=" gdg-invalid"),P&&(I+=" gdg-pad");const T=(c==null?void 0:c[0])??1,V=(c==null?void 0:c[1])??1;return $.createPortal(r.createElement(Q.Provider,{value:p},r.createElement(U,{style:Z(p),className:S,onClickOutside:K,isOutsideClick:X},r.createElement(oe,{ref:B,id:H,className:I,style:x,as:q===!0?"label":void 0,targetX:s.x-T,targetY:s.y-V,targetWidth:s.width+T*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:Y},M)))),N)};export{Ce as default}; +import{r}from"./index-BMVQvedj.js";import{r as $}from"./index-wocATsGp.js";import{f as w,j as z,k as J,T as Q,C as U,l as Z}from"./data-editor-all-fnGrkeU4.js";import{s as ee}from"./marked.esm-dbrxtycE.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";const te=()=>t=>t.targetX,re=()=>t=>t.targetY,ne=()=>t=>t.targetWidth,ie=()=>t=>t.targetHeight,se=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),oe=ee("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[re(),"px"],"d19meir1-1":[te(),"px"],"d19meir1-2":[ne(),"px"],"d19meir1-3":[ie(),"px"],"d19meir1-4":[se(),"px"],"d19meir1-5":[ae(),"px"]}});function de(){const[t,s]=r.useState();return[t??void 0,s]}function le(){const[t,s]=de(),[i,y]=r.useState(0),[g,O]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&O(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(g||t===void 0)return;let a;const o=()=>{const{right:S}=t.getBoundingClientRect();y(p=>Math.min(p+window.innerWidth-S-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,g]);const b=r.useMemo(()=>({transform:`translateX(${i}px)`}),[i]);return{ref:s,style:b}}const Ce=t=>{const{target:s,content:i,onFinishEditing:y,forceEditMode:g,initialValue:O,imageEditorOverride:b,markdownDivCreateNode:a,highlight:o,className:S,theme:p,id:H,cell:k,bloom:c,validateCell:d,getCellRenderer:F,provideEditor:h,isOutsideClick:X}=t,[l,j]=r.useState(g?i:void 0),v=r.useRef(l??i);v.current=l??i;const[E,R]=r.useState(()=>d===void 0?!0:!(w(i)&&(d==null?void 0:d(k,i,v.current))===!1)),f=r.useCallback((e,n)=>{y(E?e:void 0,n)},[E,y]),A=r.useCallback(e=>{if(d!==void 0&&e!==void 0&&w(e)){const n=d(k,e,v.current);n===!1?R(!1):(typeof n=="object"&&(e=n),R(!0))}j(e)},[k,d]),C=r.useRef(!1),m=r.useRef(void 0),K=r.useCallback(()=>{f(l,[0,0]),C.current=!0},[l,f]),W=r.useCallback((e,n)=>{f(e,n??m.current??[0,0]),C.current=!0},[f]),Y=r.useCallback(async e=>{let n=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),m.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),m.current=[0,1],n=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),m.current=[e.shiftKey?-1:1,0],n=!0),window.setTimeout(()=>{!C.current&&m.current!==void 0&&(f(n?l:void 0,m.current),C.current=!0)},0)},[f,l]),D=l??i,[u,q]=r.useMemo(()=>{var n,G;if(z(i))return[];const e=h==null?void 0:h(i);return e!==void 0?[e,!1]:[(G=(n=F(i))==null?void 0:n.provideEditor)==null?void 0:G.call(n,i),!1]},[i,F,h]),{ref:B,style:L}=le();let P=!0,M,_=!0,x;if(u!==void 0){P=u.disablePadding!==!0,_=u.disableStyling!==!0;const e=J(u);e&&(x=u.styleOverride);const n=e?u.editor:u;M=r.createElement(n,{isHighlighted:o,onChange:A,value:D,initialValue:O,onFinishedEditing:W,validatedSelection:w(D)?D.selectionRange:void 0,forceEditMode:g,target:s,imageEditorOverride:b,markdownDivCreateNode:a,isValid:E,theme:p})}x={...x,...L};const N=document.getElementById("portal");if(N===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `
` as the last child of your ``.'),null;let I=_?"gdg-style":"gdg-unstyle";E||(I+=" gdg-invalid"),P&&(I+=" gdg-pad");const T=(c==null?void 0:c[0])??1,V=(c==null?void 0:c[1])??1;return $.createPortal(r.createElement(Q.Provider,{value:p},r.createElement(U,{style:Z(p),className:S,onClickOutside:K,isOutsideClick:X},r.createElement(oe,{ref:B,id:H,className:I,style:x,as:q===!0?"label":void 0,targetX:s.x-T,targetY:s.y-V,targetWidth:s.width+T*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:Y},M)))),N)};export{Ce as default}; diff --git a/docs/assets/data-grid.stories-lpcbsBmC.js b/docs/assets/data-grid.stories-sK45HGli.js similarity index 99% rename from docs/assets/data-grid.stories-lpcbsBmC.js rename to docs/assets/data-grid.stories-sK45HGli.js index ca1221ea8..f2473872c 100644 --- a/docs/assets/data-grid.stories-lpcbsBmC.js +++ b/docs/assets/data-grid.stories-sK45HGli.js @@ -1,4 +1,4 @@ -import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj.js";import{B as b}from"./story-utils-K2EZnGjM.js";import{C as d,Q as g,O as v,G as r,m as c,g as h,P as I}from"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";const B={title:"Subcomponents/DataGrid",decorators:[n=>i("div",{children:i(b,{width:1800,height:1e3,children:i("div",{style:{position:"relative"},children:i(n,{})})})})]},Y={columns:d.empty(),rows:d.empty(),current:void 0},w=n=>{if(n.kind!==r.Custom)return I.find(e=>e.kind===n.kind)};function l(){let n=0;const[e,o]=m.useState(0);return m.useEffect(()=>{let t=0;const a=()=>{o(O=>O+1),t=window.requestAnimationFrame(a)};return a(),()=>window.cancelAnimationFrame(t)},[]),i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,drawHeader:void 0,drawCell:void 0,experimental:void 0,onHeaderIndicatorClick:()=>{},headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},resizeColumn:void 0,smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,isFocused:!0,cellYOffset:e,isFilling:!1,onMouseMove:()=>{},groupHeaderHeight:0,accessibilityHeight:50,enableGroups:!1,selection:Y,rows:1e5,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven"].map(t=>({title:t,width:122+(n+=10)})),getCellContent:([t,a])=>({kind:r.Text,displayData:`${t},${a} Testing things that are way too long`,data:`${t},${a} Testing things that are way too long`,allowOverlay:!1,owned:!0}),freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h()),resizeIndicator:"full"})}function s(){let n=0;return i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,isFocused:!0,resizeIndicator:"full",drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onHeaderIndicatorClick:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,resizeColumn:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,onMouseMove:()=>{},accessibilityHeight:50,isFilling:!1,cellYOffset:0,groupHeaderHeight:34,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:{cell:[2,2],range:{x:2,y:2,width:1,height:1},rangeStack:[]},columns:d.empty(),rows:d.empty()},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})}function u(){let n=0;return i(g,{getCellRenderer:w,onMouseMove:()=>{},width:1800,height:1e3,cellXOffset:0,cellYOffset:0,isFocused:!0,resizeIndicator:"full",resizeColumn:void 0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onHeaderIndicatorClick:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,groupHeaderHeight:34,accessibilityHeight:50,isFilling:!1,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:void 0,rows:d.fromSingleSelection([2,4]),columns:d.empty()},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})}const f=()=>{let n=0;return i(g,{getCellRenderer:w,onMouseMove:()=>{},width:1800,height:1e3,cellXOffset:0,cellYOffset:0,isFocused:!0,resizeIndicator:"full",resizeColumn:void 0,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onHeaderIndicatorClick:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawCell:void 0,drawFocusRing:!0,accessibilityHeight:50,isFilling:!1,groupHeaderHeight:34,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:void 0,rows:d.empty(),columns:d.fromSingleSelection([2,4])},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})};var p,C,R;l.parameters={...l.parameters,docs:{...(p=l.parameters)==null?void 0:p.docs,source:{originalSource:`function Simplenotest() { +import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj.js";import{B as b}from"./story-utils-K2EZnGjM.js";import{C as d,Q as g,O as v,G as r,m as c,g as h,P as I}from"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";const B={title:"Subcomponents/DataGrid",decorators:[n=>i("div",{children:i(b,{width:1800,height:1e3,children:i("div",{style:{position:"relative"},children:i(n,{})})})})]},Y={columns:d.empty(),rows:d.empty(),current:void 0},w=n=>{if(n.kind!==r.Custom)return I.find(e=>e.kind===n.kind)};function l(){let n=0;const[e,o]=m.useState(0);return m.useEffect(()=>{let t=0;const a=()=>{o(O=>O+1),t=window.requestAnimationFrame(a)};return a(),()=>window.cancelAnimationFrame(t)},[]),i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,drawHeader:void 0,drawCell:void 0,experimental:void 0,onHeaderIndicatorClick:()=>{},headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},resizeColumn:void 0,smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,isFocused:!0,cellYOffset:e,isFilling:!1,onMouseMove:()=>{},groupHeaderHeight:0,accessibilityHeight:50,enableGroups:!1,selection:Y,rows:1e5,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven"].map(t=>({title:t,width:122+(n+=10)})),getCellContent:([t,a])=>({kind:r.Text,displayData:`${t},${a} Testing things that are way too long`,data:`${t},${a} Testing things that are way too long`,allowOverlay:!1,owned:!0}),freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h()),resizeIndicator:"full"})}function s(){let n=0;return i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,isFocused:!0,resizeIndicator:"full",drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onHeaderIndicatorClick:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,resizeColumn:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,onMouseMove:()=>{},accessibilityHeight:50,isFilling:!1,cellYOffset:0,groupHeaderHeight:34,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:{cell:[2,2],range:{x:2,y:2,width:1,height:1},rangeStack:[]},columns:d.empty(),rows:d.empty()},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})}function u(){let n=0;return i(g,{getCellRenderer:w,onMouseMove:()=>{},width:1800,height:1e3,cellXOffset:0,cellYOffset:0,isFocused:!0,resizeIndicator:"full",resizeColumn:void 0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onHeaderIndicatorClick:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawFocusRing:!0,groupHeaderHeight:34,accessibilityHeight:50,isFilling:!1,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:void 0,rows:d.fromSingleSelection([2,4]),columns:d.empty()},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})}const f=()=>{let n=0;return i(g,{getCellRenderer:w,onMouseMove:()=>{},width:1800,height:1e3,cellXOffset:0,cellYOffset:0,isFocused:!0,resizeIndicator:"full",resizeColumn:void 0,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onHeaderIndicatorClick:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseMoveRaw:()=>{},onMouseUp:()=>{},smoothScrollX:void 0,smoothScrollY:void 0,allowResize:void 0,canvasRef:void 0,disabledRows:void 0,eventTargetRef:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new v,onHeaderMenuClick:void 0,prelightCells:void 0,translateX:void 0,translateY:void 0,dragAndDropState:void 0,drawCell:void 0,drawFocusRing:!0,accessibilityHeight:50,isFilling:!1,groupHeaderHeight:34,enableGroups:!1,rows:1e3,headerHeight:44,rowHeight:34,columns:["One","Two","Three","Four","Five","Six","Seven"].map(e=>({title:e,width:122+(n+=10)})),getCellContent:([e,o])=>({kind:r.Text,displayData:`${e},${o} Testing things that are way too long`,data:`${e},${o} Testing things that are way too long`,allowOverlay:!1,owned:!0}),selection:{current:void 0,rows:d.empty(),columns:d.fromSingleSelection([2,4])},freezeColumns:0,firstColAccessible:!0,verticalBorder:()=>!0,freezeTrailingRows:0,hasAppendRow:!1,isResizing:!1,isDragging:!1,theme:c(h())})};var p,C,R;l.parameters={...l.parameters,docs:{...(p=l.parameters)==null?void 0:p.docs,source:{originalSource:`function Simplenotest() { let x = 0; const [y, setY] = React.useState(0); React.useEffect(() => { diff --git a/docs/assets/drag-source.stories-mSx5ttsZ.js b/docs/assets/drag-source.stories-aEzkiqBC.js similarity index 81% rename from docs/assets/drag-source.stories-mSx5ttsZ.js rename to docs/assets/drag-source.stories-aEzkiqBC.js index 14626ceaf..0edf798f0 100644 --- a/docs/assets/drag-source.stories-mSx5ttsZ.js +++ b/docs/assets/drag-source.stories-aEzkiqBC.js @@ -1,4 +1,4 @@ -import{j as e,F as m,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as g}from"./data-editor-all-zTb9g2fv.js";import{B as u,D,P as w,u as h,d as C}from"./utils-qU2KzddR.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(M,{children:e(u,{title:"Drag source",description:e(m,{children:c(D,{children:["Setting the ",e(w,{children:"isDraggable"})," prop can allow for more granular control over what is draggable in the grid via HTML drag and drop."]})}),children:e(a,{})})})]},o=a=>{const{cols:i,getCellContent:d,onColumnResize:p}=h(200);return e(g,{...C,getCellContent:d,columns:i,rowMarkers:"both",rows:5e3,onRowMoved:(r,t)=>window.alert(`Moved row ${r} to ${t}`),onColumnMoved:(r,t)=>window.alert(`Moved col ${r} to ${t}`),onColumnResize:p,isDraggable:a.isDraggable,onDragStart:r=>{r.setData("text/plain","Drag data here!")}})};o.argTypes={isDraggable:{control:{type:"select"},options:[!0,!1,"cell","header"]}};o.args={isDraggable:!1};var s,n,l;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`p => { +import{j as e,F as m,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as g}from"./data-editor-all-ZeeWpldS.js";import{B as u,D,P as w,u as h,d as C}from"./utils-MADpeXg5.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(M,{children:e(u,{title:"Drag source",description:e(m,{children:c(D,{children:["Setting the ",e(w,{children:"isDraggable"})," prop can allow for more granular control over what is draggable in the grid via HTML drag and drop."]})}),children:e(a,{})})})]},o=a=>{const{cols:i,getCellContent:d,onColumnResize:p}=h(200);return e(g,{...C,getCellContent:d,columns:i,rowMarkers:"both",rows:5e3,onRowMoved:(r,t)=>window.alert(`Moved row ${r} to ${t}`),onColumnMoved:(r,t)=>window.alert(`Moved col ${r} to ${t}`),onColumnResize:p,isDraggable:a.isDraggable,onDragStart:r=>{r.setData("text/plain","Drag data here!")}})};o.argTypes={isDraggable:{control:{type:"select"},options:[!0,!1,"cell","header"]}};o.args={isDraggable:!1};var s,n,l;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`p => { const { cols, getCellContent, diff --git a/docs/assets/drop-events.stories-8CKkmqK5.js b/docs/assets/drop-events.stories-NILeIqbJ.js similarity index 93% rename from docs/assets/drop-events.stories-8CKkmqK5.js rename to docs/assets/drop-events.stories-NILeIqbJ.js index 17feeb394..e2ab06a2e 100644 --- a/docs/assets/drop-events.stories-8CKkmqK5.js +++ b/docs/assets/drop-events.stories-NILeIqbJ.js @@ -1,4 +1,4 @@ -import{j as e,a as g,F as h}from"./marked.esm-dbrxtycE.js";import{R as o}from"./index-BMVQvedj.js";import{D as M}from"./data-editor-all-zTb9g2fv.js";import{a as w,B as b,D as L,P as u,M as f,d as N}from"./utils-qU2KzddR.js";import{G as C}from"./image-window-loader--5E_ifQX.js";import{S as U}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(U,{children:e(a,{})})]},D=new Set(["image/png","image/gif","image/bmp","image/jpeg"]),i=()=>{const{cols:a,getCellContent:c,onColumnResize:P,setCellValue:p}=w(),[E,l]=o.useState([]),[m,O]=o.useState(),S=o.useCallback((n,t)=>{if(l([]),t===null)return;const{files:r}=t;if(r.length!==1)return;const[s]=r;if(!D.has(s.type))return;const d=URL.createObjectURL(s);p(n,{kind:C.Image,data:[d],allowOverlay:!0,readonly:!0},!0,!0),O(n)},[p]),I=o.useCallback((n,t)=>{if(t===null)return;const{items:r}=t;if(r.length!==1)return;const[s]=r;if(!D.has(s.type))return;const[d,k]=n;c(n).kind===C.Image?l([{color:"#44BB0022",range:{x:d,y:k,width:1,height:1}}]):l([])},[c]),T=o.useCallback(()=>{l([])},[]);return e(b,{title:"Drop events",description:g(h,{children:[g(L,{children:["You can drag and drop into cells by using ",e(u,{children:"onDragOverCell"})," and"," ",e(u,{children:"onDrop"}),"."]}),e("div",{children:m===void 0?e(f,{children:"Nothing dropped, yet"}):e(h,{children:g(f,{children:["You last dropped in cell ",e(u,{children:JSON.stringify(m)})]})})})]}),children:e(M,{...N,getCellContent:c,columns:a,onCellEdited:p,onColumnResize:P,rows:1e3,onDrop:S,onDragOverCell:I,onDragLeave:T,highlightRegions:E,rowMarkers:"none"})})};var v,R,y;i.parameters={...i.parameters,docs:{...(v=i.parameters)==null?void 0:v.docs,source:{originalSource:`() => { +import{j as e,a as g,F as h}from"./marked.esm-dbrxtycE.js";import{R as o}from"./index-BMVQvedj.js";import{D as M}from"./data-editor-all-ZeeWpldS.js";import{a as w,B as b,D as L,P as u,M as f,d as N}from"./utils-MADpeXg5.js";import{G as C}from"./image-window-loader-ggeJlWLo.js";import{S as U}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(U,{children:e(a,{})})]},D=new Set(["image/png","image/gif","image/bmp","image/jpeg"]),i=()=>{const{cols:a,getCellContent:c,onColumnResize:P,setCellValue:p}=w(),[E,l]=o.useState([]),[m,O]=o.useState(),S=o.useCallback((n,t)=>{if(l([]),t===null)return;const{files:r}=t;if(r.length!==1)return;const[s]=r;if(!D.has(s.type))return;const d=URL.createObjectURL(s);p(n,{kind:C.Image,data:[d],allowOverlay:!0,readonly:!0},!0,!0),O(n)},[p]),I=o.useCallback((n,t)=>{if(t===null)return;const{items:r}=t;if(r.length!==1)return;const[s]=r;if(!D.has(s.type))return;const[d,k]=n;c(n).kind===C.Image?l([{color:"#44BB0022",range:{x:d,y:k,width:1,height:1}}]):l([])},[c]),T=o.useCallback(()=>{l([])},[]);return e(b,{title:"Drop events",description:g(h,{children:[g(L,{children:["You can drag and drop into cells by using ",e(u,{children:"onDragOverCell"})," and"," ",e(u,{children:"onDrop"}),"."]}),e("div",{children:m===void 0?e(f,{children:"Nothing dropped, yet"}):e(h,{children:g(f,{children:["You last dropped in cell ",e(u,{children:JSON.stringify(m)})]})})})]}),children:e(M,{...N,getCellContent:c,columns:a,onCellEdited:p,onColumnResize:P,rows:1e3,onDrop:S,onDragOverCell:I,onDragLeave:T,highlightRegions:E,rowMarkers:"none"})})};var v,R,y;i.parameters={...i.parameters,docs:{...(v=i.parameters)==null?void 0:v.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/fill-handle.stories-X5hFdMzp.js b/docs/assets/fill-handle.stories-eTGLgxP6.js similarity index 88% rename from docs/assets/fill-handle.stories-X5hFdMzp.js rename to docs/assets/fill-handle.stories-eTGLgxP6.js index 9eb2e1232..39fa30f89 100644 --- a/docs/assets/fill-handle.stories-X5hFdMzp.js +++ b/docs/assets/fill-handle.stories-eTGLgxP6.js @@ -1,4 +1,4 @@ -import{j as t,a as c,F as f}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{B as k,D as b,M as D,P as F,u as M,c as v,d as y}from"./utils-qU2KzddR.js";import{G as E}from"./image-window-loader--5E_ifQX.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(G,{children:t(k,{title:"Fill handle",description:c(f,{children:[t(b,{children:"Fill handles can be used to downfill data with the mouse."}),c(D,{children:["Just click and drag, the top row will be copied down. Enable using the"," ",t(F,{children:"fillHandle"})," prop."]})]}),children:t(r,{})})})]},o=()=>{const{cols:r,getCellContent:n,setCellValueRaw:i,setCellValue:m}=M(60,!1),[a,w]=s.useState(50),C=s.useCallback(l=>{let e=n(l);return l[0]===1&&e.kind===E.Text&&(e={...e,readonly:!0}),e},[n]),R=s.useCallback(()=>{const l=a;for(let e=0;e<6;e++){const g=n([e,l]);i([e,l],v(g))}w(e=>e+1)},[n,a,i]);return t(h,{...y,getCellContent:C,columns:r,rowMarkers:"both",onPaste:!0,fillHandle:!0,keybindings:{downFill:!0,rightFill:!0},onCellEdited:m,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:a,onRowAppended:R})};var d,u,p;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{j as t,a as c,F as f}from"./marked.esm-dbrxtycE.js";import{R as s}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{B as k,D as b,M as D,P as F,u as M,c as v,d as y}from"./utils-MADpeXg5.js";import{G as E}from"./image-window-loader-ggeJlWLo.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(G,{children:t(k,{title:"Fill handle",description:c(f,{children:[t(b,{children:"Fill handles can be used to downfill data with the mouse."}),c(D,{children:["Just click and drag, the top row will be copied down. Enable using the"," ",t(F,{children:"fillHandle"})," prop."]})]}),children:t(r,{})})})]},o=()=>{const{cols:r,getCellContent:n,setCellValueRaw:i,setCellValue:m}=M(60,!1),[a,w]=s.useState(50),C=s.useCallback(l=>{let e=n(l);return l[0]===1&&e.kind===E.Text&&(e={...e,readonly:!0}),e},[n]),R=s.useCallback(()=>{const l=a;for(let e=0;e<6;e++){const g=n([e,l]);i([e,l],v(g))}w(e=>e+1)},[n,a,i]);return t(h,{...y,getCellContent:C,columns:r,rowMarkers:"both",onPaste:!0,fillHandle:!0,keybindings:{downFill:!0,rightFill:!0},onCellEdited:m,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:a,onRowAppended:R})};var d,u,p;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/freeze-columns.stories-B34272mh.js b/docs/assets/freeze-columns.stories-7zVe9neV.js similarity index 77% rename from docs/assets/freeze-columns.stories-B34272mh.js rename to docs/assets/freeze-columns.stories-7zVe9neV.js index 3f1077cb4..76da9121a 100644 --- a/docs/assets/freeze-columns.stories-B34272mh.js +++ b/docs/assets/freeze-columns.stories-7zVe9neV.js @@ -1,4 +1,4 @@ -import{j as r,a as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as c,P as u,u as d,d as f}from"./utils-qU2KzddR.js";import{S as C}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(C,{children:r(p,{title:"Freeze columns",description:m(c,{children:["Columns at the start of your grid can be frozen in place by settings"," ",r(u,{children:"freezeColumns"})," to a number greater than 0."]}),children:r(o,{})})})]},e=o=>{const{cols:n,getCellContent:l}=d(100);return r(i,{...f,rowMarkers:"both",freezeColumns:o.freezeColumns,getCellContent:l,columns:n,verticalBorder:!1,rows:1e3})};e.argTypes={freezeColumns:{control:{type:"range",min:0,max:10}}};e.args={freezeColumns:1};var t,s,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`(p: { +import{j as r,a as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as c,P as u,u as d,d as f}from"./utils-MADpeXg5.js";import{S as C}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(C,{children:r(p,{title:"Freeze columns",description:m(c,{children:["Columns at the start of your grid can be frozen in place by settings"," ",r(u,{children:"freezeColumns"})," to a number greater than 0."]}),children:r(o,{})})})]},e=o=>{const{cols:n,getCellContent:l}=d(100);return r(i,{...f,rowMarkers:"both",freezeColumns:o.freezeColumns,getCellContent:l,columns:n,verticalBorder:!1,rows:1e3})};e.argTypes={freezeColumns:{control:{type:"range",min:0,max:10}}};e.args={freezeColumns:1};var t,s,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`(p: { freezeColumns: number; }) => { const { diff --git a/docs/assets/freeze-rows.stories-43HikPpp.js b/docs/assets/freeze-rows.stories-89-Y26fw.js similarity index 88% rename from docs/assets/freeze-rows.stories-43HikPpp.js rename to docs/assets/freeze-rows.stories-89-Y26fw.js index e403eb4a2..336f5f9c4 100644 --- a/docs/assets/freeze-rows.stories-43HikPpp.js +++ b/docs/assets/freeze-rows.stories-89-Y26fw.js @@ -1,4 +1,4 @@ -import{j as t,F as h}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-zTb9g2fv.js";import{B as g,D as f,u as k,c as D,d as S}from"./utils-qU2KzddR.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(z,{children:t(g,{title:"Freeze rows",description:t(h,{children:t(f,{children:"Rows can be frozen to make sure the user always sees them."})}),children:t(o,{})})})]},r=()=>{const{cols:o,getCellContent:n,setCellValueRaw:l,setCellValue:m}=k(60,!1),[s,p]=c.useState(50),d=c.useCallback(()=>{const a=s;for(let e=0;ee+1)},[o.length,n,s,l]);return t(C,{...S,getCellContent:n,columns:o,rowMarkers:"both",freezeTrailingRows:2,experimental:{kineticScrollPerfHack:!0},onPaste:!0,onCellEdited:m,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:s,onRowAppended:d})};var i,u,w;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as t,F as h}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-ZeeWpldS.js";import{B as g,D as f,u as k,c as D,d as S}from"./utils-MADpeXg5.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(z,{children:t(g,{title:"Freeze rows",description:t(h,{children:t(f,{children:"Rows can be frozen to make sure the user always sees them."})}),children:t(o,{})})})]},r=()=>{const{cols:o,getCellContent:n,setCellValueRaw:l,setCellValue:m}=k(60,!1),[s,p]=c.useState(50),d=c.useCallback(()=>{const a=s;for(let e=0;ee+1)},[o.length,n,s,l]);return t(C,{...S,getCellContent:n,columns:o,rowMarkers:"both",freezeTrailingRows:2,experimental:{kineticScrollPerfHack:!0},onPaste:!0,onCellEdited:m,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:s,onRowAppended:d})};var i,u,w;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/header-menus.stories-Y3C9yIAK.js b/docs/assets/header-menus.stories-dRSmfSg8.js similarity index 93% rename from docs/assets/header-menus.stories-Y3C9yIAK.js rename to docs/assets/header-menus.stories-dRSmfSg8.js index 89447fdc7..0a41fa984 100644 --- a/docs/assets/header-menus.stories-Y3C9yIAK.js +++ b/docs/assets/header-menus.stories-dRSmfSg8.js @@ -1,4 +1,4 @@ -import{j as n,F as p,a as l,s as y}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{u as H}from"./react-laag.esm-PpDllAFI.js";import{D as x}from"./data-editor-all-zTb9g2fv.js";import{B as O,D as w,P as D,a as R,d as S}from"./utils-qU2KzddR.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>n(A,{children:n(O,{title:"Header menus",description:n(p,{children:l(w,{children:["Headers on the data grid can be configured to support menus. We provide the events and the menu icon, you provide the menu. The menu icon can be modified via the"," ",n(D,{children:"menuIcon"})," prop."]})}),children:n(s,{})})})]},I=y("div")({name:"SimpleMenu",class:"s7szcfi",propsAsIs:!1}),i=()=>{const{cols:s,getCellContent:h,onColumnResize:C,setCellValue:g}=R(),f=d.useMemo(()=>s.map((t,r)=>r===2?{...t,hasMenu:!0,menuIcon:"dots",overlayIcon:"rowOwnerOverlay"}:r===3?{...t,hasMenu:!0,menuIcon:"headerUri"}:{...t,hasMenu:!0}),[s]),[e,o]=d.useState(),a=e!==void 0,{layerProps:b,renderLayer:M}=H({isOpen:a,auto:!0,placement:"bottom-end",triggerOffset:2,onOutsideClick:()=>o(void 0),trigger:{getBounds:()=>({left:(e==null?void 0:e.bounds.x)??0,top:(e==null?void 0:e.bounds.y)??0,width:(e==null?void 0:e.bounds.width)??0,height:(e==null?void 0:e.bounds.height)??0,right:((e==null?void 0:e.bounds.x)??0)+((e==null?void 0:e.bounds.width)??0),bottom:((e==null?void 0:e.bounds.y)??0)+((e==null?void 0:e.bounds.height)??0)})}}),v=d.useCallback((t,r)=>{o({col:t,bounds:r})},[]),k=d.useCallback(()=>{console.log("Header clicked")},[]);return l(p,{children:[n(x,{...S,getCellContent:h,onHeaderMenuClick:v,onHeaderClicked:k,columns:f,onCellContextMenu:(t,r)=>r.preventDefault(),onCellEdited:g,onColumnResize:C,rows:1e3}),a&&M(l(I,{...b,children:[n("div",{onClick:()=>o(void 0),children:"These do nothing"}),n("div",{onClick:()=>o(void 0),children:"Add column right"}),n("div",{onClick:()=>o(void 0),children:"Add column left"}),n("div",{className:"danger",onClick:()=>o(void 0),children:"Delete"})]}))]})};var u,c,m;i.parameters={...i.parameters,docs:{...(u=i.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{j as n,F as p,a as l,s as y}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{u as H}from"./react-laag.esm-PpDllAFI.js";import{D as x}from"./data-editor-all-ZeeWpldS.js";import{B as O,D as w,P as D,a as R,d as S}from"./utils-MADpeXg5.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>n(A,{children:n(O,{title:"Header menus",description:n(p,{children:l(w,{children:["Headers on the data grid can be configured to support menus. We provide the events and the menu icon, you provide the menu. The menu icon can be modified via the"," ",n(D,{children:"menuIcon"})," prop."]})}),children:n(s,{})})})]},I=y("div")({name:"SimpleMenu",class:"s7szcfi",propsAsIs:!1}),i=()=>{const{cols:s,getCellContent:h,onColumnResize:C,setCellValue:g}=R(),f=d.useMemo(()=>s.map((t,r)=>r===2?{...t,hasMenu:!0,menuIcon:"dots",overlayIcon:"rowOwnerOverlay"}:r===3?{...t,hasMenu:!0,menuIcon:"headerUri"}:{...t,hasMenu:!0}),[s]),[e,o]=d.useState(),a=e!==void 0,{layerProps:b,renderLayer:M}=H({isOpen:a,auto:!0,placement:"bottom-end",triggerOffset:2,onOutsideClick:()=>o(void 0),trigger:{getBounds:()=>({left:(e==null?void 0:e.bounds.x)??0,top:(e==null?void 0:e.bounds.y)??0,width:(e==null?void 0:e.bounds.width)??0,height:(e==null?void 0:e.bounds.height)??0,right:((e==null?void 0:e.bounds.x)??0)+((e==null?void 0:e.bounds.width)??0),bottom:((e==null?void 0:e.bounds.y)??0)+((e==null?void 0:e.bounds.height)??0)})}}),v=d.useCallback((t,r)=>{o({col:t,bounds:r})},[]),k=d.useCallback(()=>{console.log("Header clicked")},[]);return l(p,{children:[n(x,{...S,getCellContent:h,onHeaderMenuClick:v,onHeaderClicked:k,columns:f,onCellContextMenu:(t,r)=>r.preventDefault(),onCellEdited:g,onColumnResize:C,rows:1e3}),a&&M(l(I,{...b,children:[n("div",{onClick:()=>o(void 0),children:"These do nothing"}),n("div",{onClick:()=>o(void 0),children:"Add column right"}),n("div",{onClick:()=>o(void 0),children:"Add column left"}),n("div",{className:"danger",onClick:()=>o(void 0),children:"Delete"})]}))]})};var u,c,m;i.parameters={...i.parameters,docs:{...(u=i.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/highlight-cells.stories-K9fd6qTU.js b/docs/assets/highlight-cells.stories-5mGy7815.js similarity index 87% rename from docs/assets/highlight-cells.stories-K9fd6qTU.js rename to docs/assets/highlight-cells.stories-5mGy7815.js index 879ac4eb2..658a2ede0 100644 --- a/docs/assets/highlight-cells.stories-K9fd6qTU.js +++ b/docs/assets/highlight-cells.stories-5mGy7815.js @@ -1,4 +1,4 @@ -import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as S,D as C,P as f,u as w,d as D}from"./utils-qU2KzddR.js";import{C as s}from"./image-window-loader--5E_ifQX.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(y,{children:e(S,{title:"HighlightCells",description:p(C,{children:["The ",e(f,{children:"highlightRegions"})," prop can be set to provide additional hinting or context for the current selection."]}),children:e(n,{})})})]},r=()=>{const{cols:n,getCellContent:d}=w(100),[t,g]=l.useState({columns:s.empty(),rows:s.empty()}),m=l.useMemo(()=>{if(t.current===void 0)return;const[o,i]=t.current.cell;return[{color:"#44BB0022",range:{x:o+2,y:i,width:10,height:10},style:"solid"},{color:"#b000b021",range:{x:o,y:i+2,width:1,height:1}}]},[t]);return e(u,{...D,rowMarkers:"both",freezeColumns:1,highlightRegions:m,gridSelection:t,onGridSelectionChange:g,getCellContent:d,columns:n,verticalBorder:o=>o>0,rows:1e3})};var c,a,h;r.parameters={...r.parameters,docs:{...(c=r.parameters)==null?void 0:c.docs,source:{originalSource:`() => { +import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as S,D as C,P as f,u as w,d as D}from"./utils-MADpeXg5.js";import{C as s}from"./image-window-loader-ggeJlWLo.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(y,{children:e(S,{title:"HighlightCells",description:p(C,{children:["The ",e(f,{children:"highlightRegions"})," prop can be set to provide additional hinting or context for the current selection."]}),children:e(n,{})})})]},r=()=>{const{cols:n,getCellContent:d}=w(100),[t,g]=l.useState({columns:s.empty(),rows:s.empty()}),m=l.useMemo(()=>{if(t.current===void 0)return;const[o,i]=t.current.cell;return[{color:"#44BB0022",range:{x:o+2,y:i,width:10,height:10},style:"solid"},{color:"#b000b021",range:{x:o,y:i+2,width:1,height:1}}]},[t]);return e(u,{...D,rowMarkers:"both",freezeColumns:1,highlightRegions:m,gridSelection:t,onGridSelectionChange:g,getCellContent:d,columns:n,verticalBorder:o=>o>0,rows:1e3})};var c,a,h;r.parameters={...r.parameters,docs:{...(c=r.parameters)==null?void 0:c.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/iframe-0-Di66Z3.js b/docs/assets/iframe-alOpk4ZG.js similarity index 61% rename from docs/assets/iframe-0-Di66Z3.js rename to docs/assets/iframe-alOpk4ZG.js index d9118c97e..ad48b811d 100644 --- a/docs/assets/iframe-0-Di66Z3.js +++ b/docs/assets/iframe-alOpk4ZG.js @@ -1,7 +1,7 @@ -import"../sb-preview/runtime.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))_(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const t of s.addedNodes)t.tagName==="LINK"&&t.rel==="modulepreload"&&_(t)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function _(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();const u="modulepreload",E=function(a,o){return new URL(a,o).href},n={},e=function(o,i,_){if(!i||i.length===0)return o();const r=document.getElementsByTagName("link");return Promise.all(i.map(s=>{if(s=E(s,_),s in n)return;n[s]=!0;const t=s.endsWith(".css"),d=t?'[rel="stylesheet"]':"";if(!!_)for(let m=r.length-1;m>=0;m--){const p=r[m];if(p.href===s&&(!t||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${d}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":u,t||(c.as="script",c.crossOrigin=""),c.href=s,document.head.appendChild(c),t)return new Promise((m,p)=>{c.addEventListener("load",m),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>o()).catch(s=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=s,window.dispatchEvent(t),!t.defaultPrevented)throw s})},{createBrowserChannel:x}=__STORYBOOK_MODULE_CHANNELS__,{addons:O}=__STORYBOOK_MODULE_PREVIEW_API__,l=x({page:"preview"});O.setChannel(l);window.__STORYBOOK_ADDONS_CHANNEL__=l;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=l);const g={"./packages/cells/src/cell.stories.tsx":async()=>e(()=>import("./cell.stories-4eUYRTdX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),"./packages/core/src/data-editor/stories/data-editor-repros.stories.tsx":async()=>e(()=>import("./data-editor-repros.stories-Exc9lGv1.js"),__vite__mapDeps([11,1,2,12,13,14,4,5,15,16,6,17,18,19,20]),import.meta.url),"./packages/core/src/data-editor/stories/data-editor.stories.tsx":async()=>e(()=>import("./data-editor.stories-lLnDOuJ2.js"),__vite__mapDeps([21,1,2,12,13,14,4,5,15,16,6,17,18,19]),import.meta.url),"./packages/core/src/docs/00-faq.stories.tsx":async()=>e(()=>import("./00-faq.stories-PKS7OADQ.js"),__vite__mapDeps([22,1,2,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/01-getting-started.stories.tsx":async()=>e(()=>import("./01-getting-started.stories-I5lnvGfZ.js"),__vite__mapDeps([25,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/02-editing-data.stories.tsx":async()=>e(()=>import("./02-editing-data.stories-Ybg3Js5e.js"),__vite__mapDeps([26,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/03-grid-column.stories.tsx":async()=>e(()=>import("./03-grid-column.stories-P60uWubs.js"),__vite__mapDeps([27,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/04-streaming-data.stories.tsx":async()=>e(()=>import("./04-streaming-data.stories-2jkbEPbR.js"),__vite__mapDeps([28,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/06-search.stories.tsx":async()=>e(()=>import("./06-search.stories-_h21YrTI.js"),__vite__mapDeps([29,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/07-column-grouping.stories.tsx":async()=>e(()=>import("./07-column-grouping.stories-iIWli84A.js"),__vite__mapDeps([30,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/08-theming.stories.tsx":async()=>e(()=>import("./08-theming.stories-TO36rufF.js"),__vite__mapDeps([31,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/09-menus.stories.tsx":async()=>e(()=>import("./09-menus.stories-DHuUaNJ-.js"),__vite__mapDeps([32,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24,33,8]),import.meta.url),"./packages/core/src/docs/examples/add-column.stories.tsx":async()=>e(()=>import("./add-column.stories-qJd3E4Gn.js"),__vite__mapDeps([34,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data-to-middle.stories.tsx":async()=>e(()=>import("./add-data-to-middle.stories-bzixFsHE.js"),__vite__mapDeps([38,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data-to-top.stories.tsx":async()=>e(()=>import("./add-data-to-top.stories-VjNp9gVs.js"),__vite__mapDeps([39,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data.stories.tsx":async()=>e(()=>import("./add-data.stories-aXlkRdaQ.js"),__vite__mapDeps([40,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/all-cell-kinds.stories.tsx":async()=>e(()=>import("./all-cell-kinds.stories-fHIsKU4O.js"),__vite__mapDeps([41,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/append-row-handle.stories.tsx":async()=>e(()=>import("./append-row-handle.stories-mXWrYEJH.js"),__vite__mapDeps([42,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/automatic-row-markers.stories.tsx":async()=>e(()=>import("./automatic-row-markers.stories-ia88nBlQ.js"),__vite__mapDeps([43,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/built-in-search.stories.tsx":async()=>e(()=>import("./built-in-search.stories-6a9Si4Mh.js"),__vite__mapDeps([44,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/cell-activated-event.stories.tsx":async()=>e(()=>import("./cell-activated-event.stories-2uo3VD4n.js"),__vite__mapDeps([45,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/column-group-collapse.stories.tsx":async()=>e(()=>import("./column-group-collapse.stories-mvtXkbjB.js"),__vite__mapDeps([46,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/column-groups.stories.tsx":async()=>e(()=>import("./column-groups.stories-KDyARjGV.js"),__vite__mapDeps([47,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/content-alignment.stories.tsx":async()=>e(()=>import("./content-alignment.stories-M5AzCjo1.js"),__vite__mapDeps([48,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/controlled-search.stories.tsx":async()=>e(()=>import("./controlled-search.stories-1bZF0uVx.js"),__vite__mapDeps([49,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/controlled-selection.stories.tsx":async()=>e(()=>import("./controlled-selection.stories-mNmRkBMo.js"),__vite__mapDeps([50,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/copy-support.stories.tsx":async()=>e(()=>import("./copy-support.stories-5RB4fQs8.js"),__vite__mapDeps([51,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/custom-header-icons.stories.tsx":async()=>e(()=>import("./custom-header-icons.stories-TyvbcE1O.js"),__vite__mapDeps([52,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/custom-header.stories.tsx":async()=>e(()=>import("./custom-header.stories-xcKX1MW6.js"),__vite__mapDeps([53,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/drag-source.stories.tsx":async()=>e(()=>import("./drag-source.stories-mSx5ttsZ.js"),__vite__mapDeps([54,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/drop-events.stories.tsx":async()=>e(()=>import("./drop-events.stories-8CKkmqK5.js"),__vite__mapDeps([55,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/fill-handle.stories.tsx":async()=>e(()=>import("./fill-handle.stories-X5hFdMzp.js"),__vite__mapDeps([56,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/freeze-columns.stories.tsx":async()=>e(()=>import("./freeze-columns.stories-B34272mh.js"),__vite__mapDeps([57,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/freeze-rows.stories.tsx":async()=>e(()=>import("./freeze-rows.stories-43HikPpp.js"),__vite__mapDeps([58,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/header-menus.stories.tsx":async()=>e(()=>import("./header-menus.stories-Y3C9yIAK.js"),__vite__mapDeps([59,1,2,33,8,16,14,4,5,15,6,17,18,19,35,36,9,37,12,13,60]),import.meta.url),"./packages/core/src/docs/examples/highlight-cells.stories.tsx":async()=>e(()=>import("./highlight-cells.stories-K9fd6qTU.js"),__vite__mapDeps([61,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/imperative-scroll.stories.tsx":async()=>e(()=>import("./imperative-scroll.stories-oW8fncC4.js"),__vite__mapDeps([62,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/input-blending.stories.tsx":async()=>e(()=>import("./input-blending.stories-7l7a8cEj.js"),__vite__mapDeps([63,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/keybindings.stories.tsx":async()=>e(()=>import("./keybindings.stories-n34M31zn.js"),__vite__mapDeps([64,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/layout-integration.stories.tsx":async()=>e(()=>import("./layout-integration.stories-oXBi69Mb.js"),__vite__mapDeps([65,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/multi-select-columns.stories.tsx":async()=>e(()=>import("./multi-select-columns.stories-vgNzpHed.js"),__vite__mapDeps([66,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/new-column-button.stories.tsx":async()=>e(()=>import("./new-column-button.stories-_UjPFsep.js"),__vite__mapDeps([67,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/obscured-grid.stories.tsx":async()=>e(()=>import("./obscured-grid.stories-8VUfU7HC.js"),__vite__mapDeps([68,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/observe-visible-region.stories.tsx":async()=>e(()=>import("./observe-visible-region.stories-hggE4aBc.js"),__vite__mapDeps([69,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/one-hundred-thousand-columns.stories.tsx":async()=>e(()=>import("./one-hundred-thousand-columns.stories-dDLvE0PG.js"),__vite__mapDeps([70,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/one-million-rows.stories.tsx":async()=>e(()=>import("./one-million-rows.stories-ztAARuLY.js"),__vite__mapDeps([71,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/overscroll.stories.tsx":async()=>e(()=>import("./overscroll.stories-hbmC9HSu.js"),__vite__mapDeps([72,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/padding.stories.tsx":async()=>e(()=>import("./padding.stories-QYa0-po6.js"),__vite__mapDeps([73,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/paste-support.stories.tsx":async()=>e(()=>import("./paste-support.stories-RpELQuPB.js"),__vite__mapDeps([74,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/prevent-diagonal-scroll.stories.tsx":async()=>e(()=>import("./prevent-diagonal-scroll.stories-M-p0URcv.js"),__vite__mapDeps([75,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/rapid-updates.stories.tsx":async()=>e(()=>import("./rapid-updates.stories-uoglvjgu.js"),__vite__mapDeps([76,1,2,35,14,4,5,15,36,9,8,6,37,12,13,16,17,18,19]),import.meta.url),"./packages/core/src/docs/examples/rearrange-columns.stories.tsx":async()=>e(()=>import("./rearrange-columns.stories-sF1dM7Mx.js"),__vite__mapDeps([77,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/reorder-rows.stories.tsx":async()=>e(()=>import("./reorder-rows.stories-O3M8AWLP.js"),__vite__mapDeps([78,1,2,79,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/resizable-columns.stories.tsx":async()=>e(()=>import("./resizable-columns.stories-XXhh_SVO.js"),__vite__mapDeps([80,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/right-element.stories.tsx":async()=>e(()=>import("./right-element.stories-NA-kKa_l.js"),__vite__mapDeps([81,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/right-to-left.stories.tsx":async()=>e(()=>import("./right-to-left.stories-VyfcM2n5.js"),__vite__mapDeps([82,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-and-header-sizes.stories.tsx":async()=>e(()=>import("./row-and-header-sizes.stories-zl2epROy.js"),__vite__mapDeps([83,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-grouping.stories.tsx":async()=>e(()=>import("./row-grouping.stories-NeYCW-VK.js"),__vite__mapDeps([84,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13,79]),import.meta.url),"./packages/core/src/docs/examples/row-hover.stories.tsx":async()=>e(()=>import("./row-hover.stories-4MjAgYiU.js"),__vite__mapDeps([85,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-markers.stories.tsx":async()=>e(()=>import("./row-markers.stories-IsElw6i9.js"),__vite__mapDeps([86,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/scaled-view.stories.tsx":async()=>e(()=>import("./scaled-view.stories-8zeM-CR3.js"),__vite__mapDeps([87,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/scroll-offset.stories.tsx":async()=>e(()=>import("./scroll-offset.stories-Uz4w97or.js"),__vite__mapDeps([88,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13,79]),import.meta.url),"./packages/core/src/docs/examples/scroll-shadows.stories.tsx":async()=>e(()=>import("./scroll-shadows.stories-jclChxEm.js"),__vite__mapDeps([89,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/search-as-filter.stories.tsx":async()=>e(()=>import("./search-as-filter.stories-rGOo9giK.js"),__vite__mapDeps([90,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/server-side-data.stories.tsx":async()=>e(()=>import("./server-side-data.stories-d_4a-drI.js"),__vite__mapDeps([91,1,2,14,4,5,15,12,13,16,6,17,18,19,35,36,9,8,37,23,7,24]),import.meta.url),"./packages/core/src/docs/examples/shadow-dom.stories.tsx":async()=>e(()=>import("./shadow-dom.stories-7TXZtV5D.js"),__vite__mapDeps([92,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/silly-numbers.stories.tsx":async()=>e(()=>import("./silly-numbers.stories-xhq3GNLr.js"),__vite__mapDeps([93,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/small-editable-grid.stories.tsx":async()=>e(()=>import("./small-editable-grid.stories-1GHfUE3O.js"),__vite__mapDeps([94,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/smooth-scrolling-grid.stories.tsx":async()=>e(()=>import("./smooth-scrolling-grid.stories-DSIsyYN3.js"),__vite__mapDeps([95,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/span-cell.stories.tsx":async()=>e(()=>import("./span-cell.stories-tX8hzNLk.js"),__vite__mapDeps([96,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/stretch-column-size.stories.tsx":async()=>e(()=>import("./stretch-column-size.stories-je-gWdg3.js"),__vite__mapDeps([97,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/ten-million-cells.stories.tsx":async()=>e(()=>import("./ten-million-cells.stories-1_UuWv9S.js"),__vite__mapDeps([98,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-per-column.stories.tsx":async()=>e(()=>import("./theme-per-column.stories-isrD9oZt.js"),__vite__mapDeps([99,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-per-row.stories.tsx":async()=>e(()=>import("./theme-per-row.stories-IBnFrFRd.js"),__vite__mapDeps([100,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-support.stories.tsx":async()=>e(()=>import("./theme-support.stories-2BOQXcq1.js"),__vite__mapDeps([101,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/tooltips.stories.tsx":async()=>e(()=>import("./tooltips.stories-JLwf15EA.js"),__vite__mapDeps([102,1,2,33,8,16,14,4,5,15,6,17,18,19,35,36,9,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/trailing-row-options.stories.tsx":async()=>e(()=>import("./trailing-row-options.stories-riMxTVcx.js"),__vite__mapDeps([103,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/uneven-rows.stories.tsx":async()=>e(()=>import("./uneven-rows.stories-XkRXih74.js"),__vite__mapDeps([104,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/validate-data.stories.tsx":async()=>e(()=>import("./validate-data.stories-E60M8lNF.js"),__vite__mapDeps([105,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/wrapping-text.stories.tsx":async()=>e(()=>import("./wrapping-text.stories-5GtqZrPS.js"),__vite__mapDeps([106,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/internal/data-grid/data-grid.stories.tsx":async()=>e(()=>import("./data-grid.stories-lpcbsBmC.js"),__vite__mapDeps([107,1,2,12,13,14,4,5,15]),import.meta.url),"./packages/core/src/internal/scrolling-data-grid/scrolling-data-grid.stories.tsx":async()=>e(()=>import("./scrolling-data-grid.stories-BLD-s3DI.js"),__vite__mapDeps([108,1,2,12,13,17,4,5,14,15,18,109]),import.meta.url),"./packages/source/src/stories/use-data-source.stories.tsx":async()=>e(()=>import("./use-data-source.stories-ys8NwUsp.js"),__vite__mapDeps([110,1,2,9,8,36,5,3,4,6,111]),import.meta.url)};async function R(a){return g[a]()}const{composeConfigs:v,PreviewWeb:P,ClientApi:T}=__STORYBOOK_MODULE_PREVIEW_API__,y=async()=>{const a=await Promise.all([e(()=>import("./entry-preview-rD48AoDU.js"),__vite__mapDeps([112,2,8]),import.meta.url),e(()=>import("./entry-preview-docs-TnItVWWf.js"),__vite__mapDeps([113,2,5]),import.meta.url),e(()=>import("./preview-z4T7Lhw3.js"),__vite__mapDeps([]),import.meta.url)]);return v(a)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new P;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new T({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:R,getProjectAnnotations:y});export{e as _}; +import"../sb-preview/runtime.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))_(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const t of s.addedNodes)t.tagName==="LINK"&&t.rel==="modulepreload"&&_(t)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function _(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();const u="modulepreload",E=function(a,o){return new URL(a,o).href},n={},e=function(o,i,_){if(!i||i.length===0)return o();const r=document.getElementsByTagName("link");return Promise.all(i.map(s=>{if(s=E(s,_),s in n)return;n[s]=!0;const t=s.endsWith(".css"),d=t?'[rel="stylesheet"]':"";if(!!_)for(let m=r.length-1;m>=0;m--){const p=r[m];if(p.href===s&&(!t||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${d}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":u,t||(c.as="script",c.crossOrigin=""),c.href=s,document.head.appendChild(c),t)return new Promise((m,p)=>{c.addEventListener("load",m),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>o()).catch(s=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=s,window.dispatchEvent(t),!t.defaultPrevented)throw s})},{createBrowserChannel:x}=__STORYBOOK_MODULE_CHANNELS__,{addons:O}=__STORYBOOK_MODULE_PREVIEW_API__,l=x({page:"preview"});O.setChannel(l);window.__STORYBOOK_ADDONS_CHANNEL__=l;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=l);const g={"./packages/cells/src/cell.stories.tsx":async()=>e(()=>import("./cell.stories-_g0ubFdV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),"./packages/core/src/data-editor/stories/data-editor-repros.stories.tsx":async()=>e(()=>import("./data-editor-repros.stories-9nGWjuU7.js"),__vite__mapDeps([11,1,2,12,13,14,4,5,15,16,6,17,18,19,20]),import.meta.url),"./packages/core/src/data-editor/stories/data-editor.stories.tsx":async()=>e(()=>import("./data-editor.stories-gYDN_QGF.js"),__vite__mapDeps([21,1,2,12,13,14,4,5,15,16,6,17,18,19]),import.meta.url),"./packages/core/src/docs/00-faq.stories.tsx":async()=>e(()=>import("./00-faq.stories-PKS7OADQ.js"),__vite__mapDeps([22,1,2,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/01-getting-started.stories.tsx":async()=>e(()=>import("./01-getting-started.stories-pReBqtRc.js"),__vite__mapDeps([25,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/02-editing-data.stories.tsx":async()=>e(()=>import("./02-editing-data.stories-BQj7fCeJ.js"),__vite__mapDeps([26,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/03-grid-column.stories.tsx":async()=>e(()=>import("./03-grid-column.stories-M9wjl6_S.js"),__vite__mapDeps([27,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/04-streaming-data.stories.tsx":async()=>e(()=>import("./04-streaming-data.stories-vLZm8kin.js"),__vite__mapDeps([28,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/06-search.stories.tsx":async()=>e(()=>import("./06-search.stories-HT4OBHAI.js"),__vite__mapDeps([29,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/07-column-grouping.stories.tsx":async()=>e(()=>import("./07-column-grouping.stories-5voO87Gi.js"),__vite__mapDeps([30,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/08-theming.stories.tsx":async()=>e(()=>import("./08-theming.stories-2t9RmZTv.js"),__vite__mapDeps([31,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24]),import.meta.url),"./packages/core/src/docs/09-menus.stories.tsx":async()=>e(()=>import("./09-menus.stories-e6AvaNtK.js"),__vite__mapDeps([32,1,2,14,4,5,15,16,6,17,18,19,12,13,23,7,24,33,8]),import.meta.url),"./packages/core/src/docs/examples/add-column.stories.tsx":async()=>e(()=>import("./add-column.stories-_EqbBQr_.js"),__vite__mapDeps([34,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data-to-middle.stories.tsx":async()=>e(()=>import("./add-data-to-middle.stories-tQw-dOJ-.js"),__vite__mapDeps([38,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data-to-top.stories.tsx":async()=>e(()=>import("./add-data-to-top.stories-Y48s8jn2.js"),__vite__mapDeps([39,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/add-data.stories.tsx":async()=>e(()=>import("./add-data.stories-E0FdRGvU.js"),__vite__mapDeps([40,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/all-cell-kinds.stories.tsx":async()=>e(()=>import("./all-cell-kinds.stories--ALeAPbB.js"),__vite__mapDeps([41,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/append-row-handle.stories.tsx":async()=>e(()=>import("./append-row-handle.stories-rOWS4lXQ.js"),__vite__mapDeps([42,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/automatic-row-markers.stories.tsx":async()=>e(()=>import("./automatic-row-markers.stories-DpSDMBm4.js"),__vite__mapDeps([43,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/built-in-search.stories.tsx":async()=>e(()=>import("./built-in-search.stories-mWtMZkcZ.js"),__vite__mapDeps([44,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/cell-activated-event.stories.tsx":async()=>e(()=>import("./cell-activated-event.stories-koZ0slRi.js"),__vite__mapDeps([45,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/column-group-collapse.stories.tsx":async()=>e(()=>import("./column-group-collapse.stories-n1L-OcXE.js"),__vite__mapDeps([46,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/column-groups.stories.tsx":async()=>e(()=>import("./column-groups.stories-hfw5JFYP.js"),__vite__mapDeps([47,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/content-alignment.stories.tsx":async()=>e(()=>import("./content-alignment.stories-xW0P0pcx.js"),__vite__mapDeps([48,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/controlled-search.stories.tsx":async()=>e(()=>import("./controlled-search.stories-Wwgq4vZY.js"),__vite__mapDeps([49,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/controlled-selection.stories.tsx":async()=>e(()=>import("./controlled-selection.stories-lniLWk35.js"),__vite__mapDeps([50,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/copy-support.stories.tsx":async()=>e(()=>import("./copy-support.stories-WvtcgNF-.js"),__vite__mapDeps([51,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/custom-header-icons.stories.tsx":async()=>e(()=>import("./custom-header-icons.stories-UqnmJb04.js"),__vite__mapDeps([52,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/custom-header.stories.tsx":async()=>e(()=>import("./custom-header.stories-WQ7yFD8e.js"),__vite__mapDeps([53,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/drag-source.stories.tsx":async()=>e(()=>import("./drag-source.stories-aEzkiqBC.js"),__vite__mapDeps([54,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/drop-events.stories.tsx":async()=>e(()=>import("./drop-events.stories-NILeIqbJ.js"),__vite__mapDeps([55,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/fill-handle.stories.tsx":async()=>e(()=>import("./fill-handle.stories-eTGLgxP6.js"),__vite__mapDeps([56,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/freeze-columns.stories.tsx":async()=>e(()=>import("./freeze-columns.stories-7zVe9neV.js"),__vite__mapDeps([57,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/freeze-rows.stories.tsx":async()=>e(()=>import("./freeze-rows.stories-89-Y26fw.js"),__vite__mapDeps([58,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/header-menus.stories.tsx":async()=>e(()=>import("./header-menus.stories-dRSmfSg8.js"),__vite__mapDeps([59,1,2,33,8,16,14,4,5,15,6,17,18,19,35,36,9,37,12,13,60]),import.meta.url),"./packages/core/src/docs/examples/highlight-cells.stories.tsx":async()=>e(()=>import("./highlight-cells.stories-5mGy7815.js"),__vite__mapDeps([61,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/imperative-scroll.stories.tsx":async()=>e(()=>import("./imperative-scroll.stories-Yaxb7oEo.js"),__vite__mapDeps([62,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/input-blending.stories.tsx":async()=>e(()=>import("./input-blending.stories-zezAtL-R.js"),__vite__mapDeps([63,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/keybindings.stories.tsx":async()=>e(()=>import("./keybindings.stories-qU4VQLV1.js"),__vite__mapDeps([64,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/layout-integration.stories.tsx":async()=>e(()=>import("./layout-integration.stories-lu4Lde2T.js"),__vite__mapDeps([65,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/multi-select-columns.stories.tsx":async()=>e(()=>import("./multi-select-columns.stories-2oeztbOf.js"),__vite__mapDeps([66,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/new-column-button.stories.tsx":async()=>e(()=>import("./new-column-button.stories-KCBl3BdD.js"),__vite__mapDeps([67,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/obscured-grid.stories.tsx":async()=>e(()=>import("./obscured-grid.stories-Do_HI9sC.js"),__vite__mapDeps([68,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/observe-visible-region.stories.tsx":async()=>e(()=>import("./observe-visible-region.stories-z9Laxci_.js"),__vite__mapDeps([69,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/one-hundred-thousand-columns.stories.tsx":async()=>e(()=>import("./one-hundred-thousand-columns.stories-H4KjbryM.js"),__vite__mapDeps([70,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/one-million-rows.stories.tsx":async()=>e(()=>import("./one-million-rows.stories-p8UsVN67.js"),__vite__mapDeps([71,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/overscroll.stories.tsx":async()=>e(()=>import("./overscroll.stories-jctFGx74.js"),__vite__mapDeps([72,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/padding.stories.tsx":async()=>e(()=>import("./padding.stories-YAYw5imX.js"),__vite__mapDeps([73,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/paste-support.stories.tsx":async()=>e(()=>import("./paste-support.stories--aYIJkKr.js"),__vite__mapDeps([74,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/prevent-diagonal-scroll.stories.tsx":async()=>e(()=>import("./prevent-diagonal-scroll.stories-1SfpzkSI.js"),__vite__mapDeps([75,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/rapid-updates.stories.tsx":async()=>e(()=>import("./rapid-updates.stories-AEZyu2Ww.js"),__vite__mapDeps([76,1,2,35,14,4,5,15,36,9,8,6,37,12,13,16,17,18,19]),import.meta.url),"./packages/core/src/docs/examples/rearrange-columns.stories.tsx":async()=>e(()=>import("./rearrange-columns.stories-3_bNW4sh.js"),__vite__mapDeps([77,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/reorder-rows.stories.tsx":async()=>e(()=>import("./reorder-rows.stories-FwicXjYY.js"),__vite__mapDeps([78,1,2,79,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/resizable-columns.stories.tsx":async()=>e(()=>import("./resizable-columns.stories-Dibf-Amn.js"),__vite__mapDeps([80,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/right-element.stories.tsx":async()=>e(()=>import("./right-element.stories-m3yQrSTF.js"),__vite__mapDeps([81,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/right-to-left.stories.tsx":async()=>e(()=>import("./right-to-left.stories-uW6E-20L.js"),__vite__mapDeps([82,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-and-header-sizes.stories.tsx":async()=>e(()=>import("./row-and-header-sizes.stories-sNSldu-6.js"),__vite__mapDeps([83,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-grouping.stories.tsx":async()=>e(()=>import("./row-grouping.stories-ONZORBKM.js"),__vite__mapDeps([84,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13,79]),import.meta.url),"./packages/core/src/docs/examples/row-hover.stories.tsx":async()=>e(()=>import("./row-hover.stories-nRHuwzz4.js"),__vite__mapDeps([85,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/row-markers.stories.tsx":async()=>e(()=>import("./row-markers.stories-wk8qKt8n.js"),__vite__mapDeps([86,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/scaled-view.stories.tsx":async()=>e(()=>import("./scaled-view.stories-1QjGLbTA.js"),__vite__mapDeps([87,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/scroll-offset.stories.tsx":async()=>e(()=>import("./scroll-offset.stories-eyu0T1ZU.js"),__vite__mapDeps([88,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13,79]),import.meta.url),"./packages/core/src/docs/examples/scroll-shadows.stories.tsx":async()=>e(()=>import("./scroll-shadows.stories-hVBm2cZ6.js"),__vite__mapDeps([89,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/search-as-filter.stories.tsx":async()=>e(()=>import("./search-as-filter.stories-l3udCDZ_.js"),__vite__mapDeps([90,1,2,14,4,5,15,16,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/server-side-data.stories.tsx":async()=>e(()=>import("./server-side-data.stories-lxb0GRUD.js"),__vite__mapDeps([91,1,2,14,4,5,15,12,13,16,6,17,18,19,35,36,9,8,37,23,7,24]),import.meta.url),"./packages/core/src/docs/examples/shadow-dom.stories.tsx":async()=>e(()=>import("./shadow-dom.stories-gOMw4cfa.js"),__vite__mapDeps([92,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/silly-numbers.stories.tsx":async()=>e(()=>import("./silly-numbers.stories-pjTTVQ6Y.js"),__vite__mapDeps([93,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/small-editable-grid.stories.tsx":async()=>e(()=>import("./small-editable-grid.stories-l1Vy5okC.js"),__vite__mapDeps([94,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/smooth-scrolling-grid.stories.tsx":async()=>e(()=>import("./smooth-scrolling-grid.stories-4dHWEWrt.js"),__vite__mapDeps([95,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/span-cell.stories.tsx":async()=>e(()=>import("./span-cell.stories-WMdPvU3C.js"),__vite__mapDeps([96,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/stretch-column-size.stories.tsx":async()=>e(()=>import("./stretch-column-size.stories-iOY1CWt9.js"),__vite__mapDeps([97,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/ten-million-cells.stories.tsx":async()=>e(()=>import("./ten-million-cells.stories-uQH2qa2w.js"),__vite__mapDeps([98,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-per-column.stories.tsx":async()=>e(()=>import("./theme-per-column.stories-21oCUHRj.js"),__vite__mapDeps([99,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-per-row.stories.tsx":async()=>e(()=>import("./theme-per-row.stories-QYCshzOF.js"),__vite__mapDeps([100,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/theme-support.stories.tsx":async()=>e(()=>import("./theme-support.stories-Tbsj0CEF.js"),__vite__mapDeps([101,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/tooltips.stories.tsx":async()=>e(()=>import("./tooltips.stories-L9--bKUS.js"),__vite__mapDeps([102,1,2,33,8,16,14,4,5,15,6,17,18,19,35,36,9,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/trailing-row-options.stories.tsx":async()=>e(()=>import("./trailing-row-options.stories-JJNnNKur.js"),__vite__mapDeps([103,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/uneven-rows.stories.tsx":async()=>e(()=>import("./uneven-rows.stories-LG_7MDCI.js"),__vite__mapDeps([104,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/validate-data.stories.tsx":async()=>e(()=>import("./validate-data.stories-AR2BMamQ.js"),__vite__mapDeps([105,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/docs/examples/wrapping-text.stories.tsx":async()=>e(()=>import("./wrapping-text.stories-A-X6NF7r.js"),__vite__mapDeps([106,1,2,16,14,4,5,15,6,17,18,19,35,36,9,8,37,12,13]),import.meta.url),"./packages/core/src/internal/data-grid/data-grid.stories.tsx":async()=>e(()=>import("./data-grid.stories-sK45HGli.js"),__vite__mapDeps([107,1,2,12,13,14,4,5,15]),import.meta.url),"./packages/core/src/internal/scrolling-data-grid/scrolling-data-grid.stories.tsx":async()=>e(()=>import("./scrolling-data-grid.stories-hHj024-J.js"),__vite__mapDeps([108,1,2,12,13,17,4,5,14,15,18,109]),import.meta.url),"./packages/source/src/stories/use-data-source.stories.tsx":async()=>e(()=>import("./use-data-source.stories-Fo8NpI-_.js"),__vite__mapDeps([110,1,2,9,8,36,5,3,4,6,111]),import.meta.url)};async function R(a){return g[a]()}const{composeConfigs:v,PreviewWeb:P,ClientApi:T}=__STORYBOOK_MODULE_PREVIEW_API__,y=async()=>{const a=await Promise.all([e(()=>import("./entry-preview-rD48AoDU.js"),__vite__mapDeps([112,2,8]),import.meta.url),e(()=>import("./entry-preview-docs-TnItVWWf.js"),__vite__mapDeps([113,2,5]),import.meta.url),e(()=>import("./preview-z4T7Lhw3.js"),__vite__mapDeps([]),import.meta.url)]);return v(a)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new P;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new T({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:R,getProjectAnnotations:y});export{e as _}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./cell.stories-4eUYRTdX.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./data-editor-all-kM-cjKZ5.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./toConsumableArray-ppDpjNRJ.js","./index-wocATsGp.js","./index.esm-Ejw8GwRl.js","./cell-D_AExon_.css","./data-editor-repros.stories-Exc9lGv1.js","./story-utils-K2EZnGjM.js","./story-utils-P19cgLKl.css","./image-window-loader--5E_ifQX.js","./image-window-loader-1jHxuE_X.css","./data-editor-all-zTb9g2fv.js","./scrolling-data-grid-rB9VuUnF.js","./scrolling-data-grid-dE2iz8sf.css","./data-editor-all-n_zxn1vv.css","./data-editor-repros-3oka-WZT.css","./data-editor.stories-lLnDOuJ2.js","./00-faq.stories-PKS7OADQ.js","./doc-wrapper-m1-LpzDL.js","./doc-wrapper-WI-RO4K9.css","./01-getting-started.stories-I5lnvGfZ.js","./02-editing-data.stories-Ybg3Js5e.js","./03-grid-column.stories-P60uWubs.js","./04-streaming-data.stories-2jkbEPbR.js","./06-search.stories-_h21YrTI.js","./07-column-grouping.stories-iIWli84A.js","./08-theming.stories-TO36rufF.js","./09-menus.stories-DHuUaNJ-.js","./react-laag.esm-PpDllAFI.js","./add-column.stories-qJd3E4Gn.js","./utils-qU2KzddR.js","./index-PWBWJyi_.js","./utils-ybqXy1Bp.css","./add-data-to-middle.stories-bzixFsHE.js","./add-data-to-top.stories-VjNp9gVs.js","./add-data.stories-aXlkRdaQ.js","./all-cell-kinds.stories-fHIsKU4O.js","./append-row-handle.stories-mXWrYEJH.js","./automatic-row-markers.stories-ia88nBlQ.js","./built-in-search.stories-6a9Si4Mh.js","./cell-activated-event.stories-2uo3VD4n.js","./column-group-collapse.stories-mvtXkbjB.js","./column-groups.stories-KDyARjGV.js","./content-alignment.stories-M5AzCjo1.js","./controlled-search.stories-1bZF0uVx.js","./controlled-selection.stories-mNmRkBMo.js","./copy-support.stories-5RB4fQs8.js","./custom-header-icons.stories-TyvbcE1O.js","./custom-header.stories-xcKX1MW6.js","./drag-source.stories-mSx5ttsZ.js","./drop-events.stories-8CKkmqK5.js","./fill-handle.stories-X5hFdMzp.js","./freeze-columns.stories-B34272mh.js","./freeze-rows.stories-43HikPpp.js","./header-menus.stories-Y3C9yIAK.js","./header-menus-N_BOUD_t.css","./highlight-cells.stories-K9fd6qTU.js","./imperative-scroll.stories-oW8fncC4.js","./input-blending.stories-7l7a8cEj.js","./keybindings.stories-n34M31zn.js","./layout-integration.stories-oXBi69Mb.js","./multi-select-columns.stories-vgNzpHed.js","./new-column-button.stories-_UjPFsep.js","./obscured-grid.stories-8VUfU7HC.js","./observe-visible-region.stories-hggE4aBc.js","./one-hundred-thousand-columns.stories-dDLvE0PG.js","./one-million-rows.stories-ztAARuLY.js","./overscroll.stories-hbmC9HSu.js","./padding.stories-QYa0-po6.js","./paste-support.stories-RpELQuPB.js","./prevent-diagonal-scroll.stories-M-p0URcv.js","./rapid-updates.stories-uoglvjgu.js","./rearrange-columns.stories-sF1dM7Mx.js","./reorder-rows.stories-O3M8AWLP.js","./lodash-8jIGfDyZ.js","./resizable-columns.stories-XXhh_SVO.js","./right-element.stories-NA-kKa_l.js","./right-to-left.stories-VyfcM2n5.js","./row-and-header-sizes.stories-zl2epROy.js","./row-grouping.stories-NeYCW-VK.js","./row-hover.stories-4MjAgYiU.js","./row-markers.stories-IsElw6i9.js","./scaled-view.stories-8zeM-CR3.js","./scroll-offset.stories-Uz4w97or.js","./scroll-shadows.stories-jclChxEm.js","./search-as-filter.stories-rGOo9giK.js","./server-side-data.stories-d_4a-drI.js","./shadow-dom.stories-7TXZtV5D.js","./silly-numbers.stories-xhq3GNLr.js","./small-editable-grid.stories-1GHfUE3O.js","./smooth-scrolling-grid.stories-DSIsyYN3.js","./span-cell.stories-tX8hzNLk.js","./stretch-column-size.stories-je-gWdg3.js","./ten-million-cells.stories-1_UuWv9S.js","./theme-per-column.stories-isrD9oZt.js","./theme-per-row.stories-IBnFrFRd.js","./theme-support.stories-2BOQXcq1.js","./tooltips.stories-JLwf15EA.js","./trailing-row-options.stories-riMxTVcx.js","./uneven-rows.stories-XkRXih74.js","./validate-data.stories-E60M8lNF.js","./wrapping-text.stories-5GtqZrPS.js","./data-grid.stories-lpcbsBmC.js","./scrolling-data-grid.stories-BLD-s3DI.js","./scrolling-data-grid-OMNPNZ5X.css","./use-data-source.stories-ys8NwUsp.js","./use-data-source-ruk7orBA.css","./entry-preview-rD48AoDU.js","./entry-preview-docs-TnItVWWf.js"] + __vite__mapDeps.viteFileDeps = ["./cell.stories-_g0ubFdV.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./data-editor-all-fnGrkeU4.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./toConsumableArray-ppDpjNRJ.js","./index-wocATsGp.js","./index.esm-Ejw8GwRl.js","./cell-D_AExon_.css","./data-editor-repros.stories-9nGWjuU7.js","./story-utils-K2EZnGjM.js","./story-utils-P19cgLKl.css","./image-window-loader-ggeJlWLo.js","./image-window-loader-1jHxuE_X.css","./data-editor-all-ZeeWpldS.js","./scrolling-data-grid-wnX0bxop.js","./scrolling-data-grid-dE2iz8sf.css","./data-editor-all-n_zxn1vv.css","./data-editor-repros-3oka-WZT.css","./data-editor.stories-gYDN_QGF.js","./00-faq.stories-PKS7OADQ.js","./doc-wrapper-m1-LpzDL.js","./doc-wrapper-WI-RO4K9.css","./01-getting-started.stories-pReBqtRc.js","./02-editing-data.stories-BQj7fCeJ.js","./03-grid-column.stories-M9wjl6_S.js","./04-streaming-data.stories-vLZm8kin.js","./06-search.stories-HT4OBHAI.js","./07-column-grouping.stories-5voO87Gi.js","./08-theming.stories-2t9RmZTv.js","./09-menus.stories-e6AvaNtK.js","./react-laag.esm-PpDllAFI.js","./add-column.stories-_EqbBQr_.js","./utils-MADpeXg5.js","./index-PWBWJyi_.js","./utils-ybqXy1Bp.css","./add-data-to-middle.stories-tQw-dOJ-.js","./add-data-to-top.stories-Y48s8jn2.js","./add-data.stories-E0FdRGvU.js","./all-cell-kinds.stories--ALeAPbB.js","./append-row-handle.stories-rOWS4lXQ.js","./automatic-row-markers.stories-DpSDMBm4.js","./built-in-search.stories-mWtMZkcZ.js","./cell-activated-event.stories-koZ0slRi.js","./column-group-collapse.stories-n1L-OcXE.js","./column-groups.stories-hfw5JFYP.js","./content-alignment.stories-xW0P0pcx.js","./controlled-search.stories-Wwgq4vZY.js","./controlled-selection.stories-lniLWk35.js","./copy-support.stories-WvtcgNF-.js","./custom-header-icons.stories-UqnmJb04.js","./custom-header.stories-WQ7yFD8e.js","./drag-source.stories-aEzkiqBC.js","./drop-events.stories-NILeIqbJ.js","./fill-handle.stories-eTGLgxP6.js","./freeze-columns.stories-7zVe9neV.js","./freeze-rows.stories-89-Y26fw.js","./header-menus.stories-dRSmfSg8.js","./header-menus-N_BOUD_t.css","./highlight-cells.stories-5mGy7815.js","./imperative-scroll.stories-Yaxb7oEo.js","./input-blending.stories-zezAtL-R.js","./keybindings.stories-qU4VQLV1.js","./layout-integration.stories-lu4Lde2T.js","./multi-select-columns.stories-2oeztbOf.js","./new-column-button.stories-KCBl3BdD.js","./obscured-grid.stories-Do_HI9sC.js","./observe-visible-region.stories-z9Laxci_.js","./one-hundred-thousand-columns.stories-H4KjbryM.js","./one-million-rows.stories-p8UsVN67.js","./overscroll.stories-jctFGx74.js","./padding.stories-YAYw5imX.js","./paste-support.stories--aYIJkKr.js","./prevent-diagonal-scroll.stories-1SfpzkSI.js","./rapid-updates.stories-AEZyu2Ww.js","./rearrange-columns.stories-3_bNW4sh.js","./reorder-rows.stories-FwicXjYY.js","./lodash-8jIGfDyZ.js","./resizable-columns.stories-Dibf-Amn.js","./right-element.stories-m3yQrSTF.js","./right-to-left.stories-uW6E-20L.js","./row-and-header-sizes.stories-sNSldu-6.js","./row-grouping.stories-ONZORBKM.js","./row-hover.stories-nRHuwzz4.js","./row-markers.stories-wk8qKt8n.js","./scaled-view.stories-1QjGLbTA.js","./scroll-offset.stories-eyu0T1ZU.js","./scroll-shadows.stories-hVBm2cZ6.js","./search-as-filter.stories-l3udCDZ_.js","./server-side-data.stories-lxb0GRUD.js","./shadow-dom.stories-gOMw4cfa.js","./silly-numbers.stories-pjTTVQ6Y.js","./small-editable-grid.stories-l1Vy5okC.js","./smooth-scrolling-grid.stories-4dHWEWrt.js","./span-cell.stories-WMdPvU3C.js","./stretch-column-size.stories-iOY1CWt9.js","./ten-million-cells.stories-uQH2qa2w.js","./theme-per-column.stories-21oCUHRj.js","./theme-per-row.stories-QYCshzOF.js","./theme-support.stories-Tbsj0CEF.js","./tooltips.stories-L9--bKUS.js","./trailing-row-options.stories-JJNnNKur.js","./uneven-rows.stories-LG_7MDCI.js","./validate-data.stories-AR2BMamQ.js","./wrapping-text.stories-A-X6NF7r.js","./data-grid.stories-sK45HGli.js","./scrolling-data-grid.stories-hHj024-J.js","./scrolling-data-grid-OMNPNZ5X.css","./use-data-source.stories-Fo8NpI-_.js","./use-data-source-ruk7orBA.css","./entry-preview-rD48AoDU.js","./entry-preview-docs-TnItVWWf.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } \ No newline at end of file diff --git a/docs/assets/image-window-loader--5E_ifQX.js b/docs/assets/image-window-loader-ggeJlWLo.js similarity index 77% rename from docs/assets/image-window-loader--5E_ifQX.js rename to docs/assets/image-window-loader-ggeJlWLo.js index 0ff9a3a6b..1a6d7c1ba 100644 --- a/docs/assets/image-window-loader--5E_ifQX.js +++ b/docs/assets/image-window-loader-ggeJlWLo.js @@ -1,15 +1,15 @@ -var Li=Object.defineProperty;var Ni=(e,t,n)=>t in e?Li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>(Ni(e,typeof t!="symbol"?t+"":t,n),n);import{a as Je,j as $,F as Xn,s as gt,b as Oi}from"./marked.esm-dbrxtycE.js";import{r as I,R as Gn}from"./index-BMVQvedj.js";import{h as Xi,d as $i,v as Yi,_ as _i,g as Vi,c as wn,r as Ui,j as qi,t as ji}from"./throttle-7EuXLZa7.js";import{_ as Ki}from"./iframe-0-Di66Z3.js";function jo(e="This should not happen"){throw new Error(e)}function ft(e,t="Assertion failed"){if(!e)return jo(t)}function Jn(e,t){return jo(t??"Hell froze over")}function tl(e,t){try{return e()}catch{return t}}const Co=Object.prototype.hasOwnProperty;function Xt(e,t){let n,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&Xt(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Co.call(e,n)&&++o&&!Co.call(t,n)||!(n in t)||!Xt(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const kn=null,Qn=void 0;var ae=(e=>(e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom",e))(ae||{}),Gi=(e=>(e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay",e))(Gi||{}),$n=(e=>(e.Triangle="triangle",e.Dots="dots",e))($n||{});function nl(e){return"width"in e&&typeof e.width=="number"}async function ol(e){return typeof e=="object"?e:await e()}function Ji(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown")}function il(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown"||e.kind==="boolean"||e.kind==="image"||e.kind==="custom")}function Ko(e){return e.kind==="marker"||e.kind==="new-row"}function Qi(e){if(!Ji(e)||e.kind==="image")return!1;if(e.kind==="text"||e.kind==="number"||e.kind==="markdown"||e.kind==="uri"||e.kind==="custom"||e.kind==="boolean")return e.readonly!==!0;Jn(e,"A cell was passed with an invalid kind")}function rl(e){return Xi(e,"editor")}function Yn(e){return!(e.readonly??!1)}var nn=(e=>(e.NewRow="new-row",e.Marker="marker",e))(nn||{});function Zi(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(o,i){return o[0]-i[0]}),n.push([...t[0]]);for(const o of t.slice(1)){const i=n[n.length-1];i[1][o[0]+t,o[1]+t]);return new ut(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=Zi([...this.items,n]);return new ut(o)}remove(t){const n=[...this.items],o=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[r,l]of n.entries()){const[s,a]=l;if(s<=i&&o<=a){const d=[];s=o&&tSo??(So=new ut([]))),oe(ut,"fromSingleSelection",t=>ut.empty().add(t));let _n=ut;function Ge(e,t,n,o,i=!1){const r=I.useRef();r.current=t,I.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=a=>{var d;(d=r.current)==null||d.call(l,a)};return l.addEventListener(e,s,{passive:o,capture:i}),()=>{l.removeEventListener(e,s,{capture:i})}},[e,n,o,i])}function sl(e,t){return e===void 0?void 0:t}const er=Math.PI;function Io(e){return e*er/180}const Go=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Jo=(e,t,n,o,i)=>{switch(e){case"left":return Math.floor(t)+o+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-o-i/2}},Qo=(e,t,n)=>Math.min(e,t-n*2),Zo=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Zn=e=>{const t=e.fgColor??"currentColor";return Je("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),$("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"})]})},tr=e=>{const t=e.fgColor??"currentColor";return $("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})};function nr(e,t,n){const[o,i]=I.useState(e),r=I.useRef(!0);I.useEffect(()=>()=>{r.current=!1},[]);const l=I.useRef($i(s=>{r.current&&i(s)},n));return I.useLayoutEffect(()=>{r.current&&l.current(()=>e())},t),o}const or="֑-߿יִ-﷽ﹰ-ﻼ",ir="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",rr=new RegExp("^[^"+ir+"]*["+or+"]");function eo(e){return rr.test(e)?"rtl":"not-rtl"}let bn;function Mo(){if(typeof document>"u")return 0;if(bn!==void 0)return bn;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),bn=n-o,bn}const Ft=Symbol();function ll(e){const t=I.useRef([Ft,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=I.useState(e),[,i]=I.useState(),r=I.useCallback(s=>{const a=t.current[0];a!==Ft&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Ft&&i({}),o(d=>typeof s=="function"?s(a===Ft?d:a):s),t.current[0]=Ft)},[]),l=I.useCallback(()=>{t.current[0]=Ft,i({})},[]);return[t.current[0]===Ft?n:t.current[0],r,l]}function ei(e){if(e.length===0)return"";let t=0,n=0;for(const o of e){if(n+=o.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function al(e){const t=I.useRef(e);return Xt(e,t.current)||(t.current=e),t.current}function sr(e,t){return Gn.useMemo(()=>e.map((n,o)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:o,sticky:o=r.x&&n=r.y&&o=t.span[0]&&n.current.cell[0]<=t.span[1]}function ar(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&ol)return!1;if(t.span===void 0)return s>=o&&s<=i;const[d,f]=t.span;return d>=o&&d<=i||f>=o&&d<=i||di}function cr(e,t,n,o){let i=0;if(n.current===void 0)return i;const r=n.current.range;(o||r.height*r.width>1)&&Eo(e,t,r)&&i++;for(const l of n.current.rangeStack)Eo(e,t,l)&&i++;return i}function ni(e,t){let n=e;if(t!==void 0){let o=[...e];const i=n[t.src];t.src>t.dest?(o.splice(t.src,1),o.splice(t.dest,0,i)):(o.splice(t.dest+1,0,i),o.splice(t.src,1)),o=o.map((r,l)=>({...r,sticky:e[l].sticky})),n=o}return n}function $t(e,t){let n=0;const o=ni(e,t);for(let i=0;i0)for(const d of l)n-=d.width;let s=t,a=i??0;for(;a<=n&&s=g)return u}const m=r-d,h=e-(a??0);if(typeof l=="number"){const c=Math.floor((h-f)/l)+s;return c>=m?void 0:c}else{let c=f;for(let u=s;u"u";async function hr(){var e;fr||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,pn=0,en={},Yi())}hr();function oi(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Vt(e,t,n,o="middle"){const i=oi(e,t,o,n);let r=en[i];return r===void 0&&(r=t.measureText(e),en[i]=r,pn++),pn>1e4&&(en={},pn=0),r}function ii(e,t){const n=oi(e,void 0,"middle",t);return en[n]}function kt(e,t){return typeof t!="string"&&(t=t.baseFontFull),gr(e,t)}function Bo(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const Fo=[];function gr(e,t){for(const r of Fo)if(r.key===t)return r.val;const n=Bo(e,"alphabetic"),i=-(Bo(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Fo.push({key:t,val:i}),i}function mr(e,t,n,o,i,r){const{ctx:l,rect:s,theme:a}=e;let d=Number.MAX_SAFE_INTEGER;const f=500;if(t!==void 0&&(d=n-t,dn&&(e=e.slice(0,n)),e}function br(e,t,n,o,i,r,l,s,a,d){const f=s.baseFontFull,g=_i(e,t,f,i-s.cellHorizontalPadding*2,d??!1),m=si(e,f),h=s.lineHeight*m,c=m+h*(g.length-1),u=c+s.cellVerticalPadding>r;u&&(e.save(),e.rect(n,o,i,r),e.clip());const y=o+r/2-c/2;let v=Math.max(o+s.cellVerticalPadding,y);for(const w of g)if(ri(e,w,n,v,i,m,l,s,a),v+=h,v>o+r)break;u&&e.restore()}function ht(e,t,n,o,i){const{ctx:r,rect:l,theme:s}=e,{x:a,y:d,width:f,height:g}=l;o=o??!1,o||(t=yr(t,f));const m=kt(r,s),h=eo(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(r.direction="rtl"),t.length>0){let c=!1;n==="right"?(r.textAlign="right",c=!0):n!==void 0&&n!=="left"&&(r.textAlign=n,c=!0),o?br(r,t,a,d,f,g,m,s,n,i):ri(r,t,a,d,f,g,m,s,n),c&&(r.textAlign="start"),h&&(r.direction="inherit")}}function st(e,t,n,o,i,r){typeof r=="number"&&(r={tl:r,tr:r,br:r,bl:r}),r={tl:Math.max(0,Math.min(r.tl,i/2,o/2)),tr:Math.max(0,Math.min(r.tr,i/2,o/2)),bl:Math.max(0,Math.min(r.bl,i/2,o/2)),br:Math.max(0,Math.min(r.br,i/2,o/2))},e.moveTo(t+r.tl,n),e.arcTo(t+o,n,t+o,n+r.tr,r.tr),e.arcTo(t+o,n+i,t+o-r.br,n+i,r.br),e.arcTo(t,n+i,t,n+i-r.bl,r.bl),e.arcTo(t,n,t+r.tl,n,r.tl)}function vr(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function pr(e,t,n){const o=function(s,a){const d=a.x-s.x,f=a.y-s.y,g=Math.sqrt(d*d+f*f),m=d/g,h=f/g;return{x:d,y:a.y-s.y,len:g,nx:m,ny:h,ang:Math.atan2(h,m)}};let i;const r=t.length;let l=t[r-1];for(let s=0;s1?1:m),u=1,y=!1;h<0?c<0?c=Math.PI+c:(c=Math.PI-c,u=-1,y=!0):c>0&&(u=-1,y=!0),i=a.radius!==void 0?a.radius:n;const v=c/2;let w=Math.abs(Math.cos(v)*i/Math.sin(v)),M;w>Math.min(f.len/2,g.len/2)?(w=Math.min(f.len/2,g.len/2),M=Math.abs(w*Math.sin(v)/Math.cos(v))):M=i;let F=a.x+g.nx*w,P=a.y+g.ny*w;F+=-g.ny*M*u,P+=g.nx*M*u,e.arc(F,P,M,f.ang+Math.PI/2*u,g.ang-Math.PI/2*u,y),l=a,a=d}e.closePath()}function qn(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c){const u={x:0,y:r+d,width:0,height:0};if(e>=h.length||t>=f||t<-2||e<0)return u;const y=r-i;if(e>=g){const v=l>e?-1:1,w=$t(h);u.x+=w+a;for(let M=l;M!==e;M+=v)u.x+=h[v===1?M:M-1].width*v}else for(let v=0;v0&&Vn(h[v-1].group,w)&&h[v-1].sticky===M;){const P=h[v-1];u.x-=P.width,u.width+=P.width,v--}let F=e;for(;F+1n&&(u.width=n-u.x)}}else if(t>=f-m){let v=f-t;for(u.y=o;v>0;){const w=t+v-1;u.height=typeof c=="number"?c:c(w),u.y-=u.height,v--}u.height+=1}else{const v=s>t?-1:1;if(typeof c=="number"){const w=t-s;u.y+=w*c}else for(let w=s;w!==t;w+=v)u.y+=c(w)*v;u.height=(typeof c=="number"?c:c(t))+1}return u}const to=1<<21;function tt(e,t){return(t+2)*to+e}function li(e){return e%to}function no(e){return Math.floor(e/to)-2}function oo(e){const t=li(e),n=no(e);return[t,n]}class ai{constructor(){oe(this,"visibleWindow",{x:0,y:0,width:0,height:0});oe(this,"freezeCols",0);oe(this,"freezeRows",[]);oe(this,"isInWindow",t=>{const n=li(t),o=no(t),i=this.visibleWindow,r=n>=i.x&&n<=i.x+i.width||n=i.y&&o<=i.y+i.height||this.freezeRows.includes(o);return r&&l})}setWindow(t,n,o){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Xt(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class wr extends ai{constructor(){super(...arguments);oe(this,"cache",new Map);oe(this,"setValue",(n,o)=>{this.cache.set(tt(n[0],n[1]),o)});oe(this,"getValue",n=>this.cache.get(tt(n[0],n[1])));oe(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class tn{constructor(t=[]){oe(this,"cells");this.cells=new Set(t.map(n=>tt(n[0],n[1])))}add(t){this.cells.add(tt(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(tt(t[0],t[1]))}remove(t){this.cells.delete(tt(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(no(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{u.drawImage(y,0,0,g,g)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(o.globalAlpha=a),o.drawImage(h,0,0,g,g,i,r,l,l),a<1&&(o.globalAlpha=1)}}const Rn={};let wt=null;function Cr(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function jn(e){const t=e.toLowerCase().trim();if(Rn[t]!==void 0)return Rn[t];wt=wt||Cr(),wt.style.color="#000",wt.style.color=t;const n=getComputedStyle(wt).color;wt.style.color="#fff",wt.style.color=t;const o=getComputedStyle(wt).color;if(o!==n)return[0,0,0,1];let i=o.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(r=>Number.isNaN(r)?0:r),Rn[t]=i,i}function sn(e,t){const[n,o,i]=jn(e);return`rgba(${n}, ${o}, ${i}, ${t})`}const Ao=new Map;function Do(e,t){const n=`${e}-${t}`,o=Ao.get(n);if(o!==void 0)return o;const i=Ue(e,t);return Ao.set(n,i),i}function Ue(e,t){if(t===void 0)return e;const[n,o,i,r]=jn(e);if(r===1)return e;const[l,s,a,d]=jn(t),f=r+d*(1-r),g=(r*n+d*l*(1-r))/f,m=(r*o+d*s*(1-r))/f,h=(r*i+d*a*(1-r))/f;return`rgba(${g}, ${m}, ${h}, ${f})`}function ci(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function xn(e,t,n,o,i,r,l,s,a){s=s??t;let d=t,f=e;const g=o-r;let m=!1;for(;ds&&a(d,f,h,!1,l&&f===o-1)===!0){m=!0;break}d+=h,f++}if(!m){d=n;for(let h=0;h!h.sticky))==null?void 0:m.sourceIndex)??0;if(a>g){const h=Math.max(s,g);let c=t,u=o;for(let y=r.sourceIndex-1;y>=h;y--)c-=l[y].width,u+=l[y].width;for(let y=r.sourceIndex+1;y<=a;y++)u+=l[y].width;f={x:c,y:n,width:u,height:i}}if(g>s){const h=Math.min(a,g-1);let c=t,u=o;for(let y=r.sourceIndex-1;y>=s;y--)c-=l[y].width,u+=l[y].width;for(let y=r.sourceIndex+1;y<=h;y++)u+=l[y].width;d={x:c,y:n,width:u,height:i}}return[d,f]}function dl(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const fi={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4};function ul(){return fi}const fl=Gn.createContext(fi);function Yt(e,...t){const n={...e};for(const o of t)if(o!==void 0)for(const i in o)o.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Ue(o[i],n[i]):n[i]=o[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function hl(e,t,n,o){if(o==="any")return Sr(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),ar([t,n],e))return;const i=t-e.x,r=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,a=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="horizontal"?Number.MAX_SAFE_INTEGER:l,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return a===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:a===l?{x:e.x,y:n,width:e.width,height:e.y-n}:a===r?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function on(e,t,n,o,i,r,l,s){return e<=i+l&&i<=e+n&&t<=r+s&&r<=t+o}function Ot(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Sr(e,t){const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,r=Math.max(e.y+e.height,t.y+t.height)-o;return{x:n,y:o,width:i,height:r}}function Ir(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Mr(e,t,n,o){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,r=-4,l=t+4,s=n+4,a=i-e.x,d=e.x+e.width-l,f=r-e.y,g=e.y+e.height-s,m=a>0?e.x+Math.floor(a/o)*o:e.x,h=d>0?e.x+e.width-Math.floor(d/o)*o:e.x+e.width,c=f>0?e.y+Math.floor(f/o)*o:e.y,u=g>0?e.y+e.height-Math.floor(g/o)*o:e.y+e.height;return{x:m,y:c,width:h-m,height:u-c}}function Er(e,t,n,o,i){const[r,l,s,a]=t,[d,f,g,m]=i,{x:h,y:c,width:u,height:y}=e,v=[];if(u<=0||y<=0)return v;const w=h+u,M=c+y,F=hs,A=c+y>a,W=h>=r&&hr&&w<=s||hs,C=c>=l&&cl&&M<=a||ca;if(W&&C){const B=Math.max(h,r),x=Math.max(c,l),k=Math.min(w,s),p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:f,width:g-d+1,height:m-f+1}})}if(F&&P){const B=h,x=c,k=Math.min(w,r),p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:0,width:d+1,height:f+1}})}if(P&&W){const B=Math.max(h,r),x=c,k=Math.min(w,s),p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:0,width:g-d+1,height:f+1}})}if(P&&S){const B=Math.max(h,s),x=c,k=w,p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:0,width:n-g+1,height:f+1}})}if(F&&C){const B=h,x=Math.max(c,l),k=Math.min(w,r),p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:f,width:d+1,height:m-f+1}})}if(S&&C){const B=Math.max(h,s),x=Math.max(c,l),k=w,p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:f,width:n-g+1,height:m-f+1}})}if(F&&A){const B=h,x=Math.max(c,a),k=Math.min(w,r),p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:m,width:d+1,height:o-m+1}})}if(A&&W){const B=Math.max(h,r),x=Math.max(c,a),k=Math.min(w,s),p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:m,width:g-d+1,height:o-m+1}})}if(S&&A){const B=Math.max(h,s),x=Math.max(c,a),k=w,p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:m,width:n-g+1,height:o-m+1}})}return v}const Br={kind:ae.Loading,allowOverlay:!1};function Po(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w,M,F,P,S,A,W,C,H,B,x,k,p,q,V,U,ce){let se=(M==null?void 0:M.size)??Number.MAX_SAFE_INTEGER;const he=performance.now();let ge=k.baseFontFull;e.font=ge;const Ne={ctx:e},K=[0,0],De=y>0?_t(a,y,d):0;let Se,O;const we=ci(w);return xt(t,s,r,l,i,(J,Ie,qe,lt,Ct)=>{const at=Math.max(0,lt-Ie),je=Ie+at,ye=i+1,mt=J.width-at,yt=o-i-1;if(w.length>0){let xe=!1;for(let le=0;le{e.save(),e.beginPath(),e.rect(je,ye,mt,yt),e.clip()},de=F.columns.hasIndex(J.sourceIndex),$e=g(J.group??"").overrideTheme,Me=J.themeOverride===void 0&&$e===void 0?k:Yt(k,$e,J.themeOverride),We=Me.baseFontFull;We!==ge&&(ge=We,e.font=We),Xe();let Q;return xn(Ct,qe,o,a,d,y,v,we,(xe,le,be,L,j)=>{var It,nt,ot;if(le<0||(K[0]=J.sourceIndex,K[1]=le,M!==void 0&&!M.has(K)))return;if(w.length>0){let ne=!1;for(let Be=0;Beie.span!==void 0&&ne>=ie.span[0]&&ne<=ie.span[1]);Ke&&!c&&u?ze=0:Ke&&u&&(ze=Math.max(ze,1)),Dt&&ze++,Ke||(ue&&ze++,de&&!j&&ze++);const Pt=ie.kind===ae.Protected?Ee.bgCellMedium:Ee.bgCell;let ve;if((L||Pt!==k.bgCell)&&(ve=Ue(Pt,ve)),ze>0||te){te&&(ve=Ue(Ee.bgHeader,ve));for(let ne=0;nece&&!Te){const ne=Ee.baseFontFull;ne!==ge&&(e.font=ne,ge=ne),Q=hi(e,ie,J.sourceIndex,le,ct,pe,Ce,xe,fe,be,ze>0,Ee,ve??Ee.bgCell,A,W,(Oe==null?void 0:Oe.hoverAmount)??0,H,x,he,B,Q,p,q,V,U)}return St&&e.restore(),ie.style==="faded"&&(e.globalAlpha=1),se--,G&&(e.restore(),(ot=Q==null?void 0:Q.deprep)==null||ot.call(Q,Ne),Q=void 0,Xe(),ge=We,e.font=We),se<=0}),e.restore(),se<=0}),Se}const Gt=[0,0],Jt={x:0,y:0,width:0,height:0},Tn=[void 0,()=>{}];let Kn=!1;function Fr(){Kn=!0}function hi(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w,M,F,P,S,A,W){var q,V;let C,H;y!==void 0&&y[0][0]===n&&y[0][1]===o&&(C=y[1][0],H=y[1][1]);let B;Gt[0]=n,Gt[1]=o,Jt.x=l,Jt.y=s,Jt.width=a,Jt.height=d,Tn[0]=S.getValue(Gt),Tn[1]=U=>S.setValue(Gt,U),Kn=!1;const x={ctx:e,theme:g,col:n,row:o,cell:t,rect:Jt,highlighted:f,cellFillColor:m,hoverAmount:u,frameTime:w,hoverX:C,drawState:Tn,hoverY:H,imageLoader:h,spriteManager:c,hyperWrapping:v,overrideCursor:C!==void 0?W:void 0,requestAnimationFrame:Fr},k=mr(x,t.lastUpdated,w,F,i,r),p=A(t);if(p!==void 0){(F==null?void 0:F.renderer)!==p&&((q=F==null?void 0:F.deprep)==null||q.call(F,x),F=void 0);const U=(V=p.drawPrep)==null?void 0:V.call(p,x,F);M!==void 0&&!Ko(x.cell)?M(x,()=>p.draw(x,t)):p.draw(x,t),B=U===void 0?void 0:{deprep:U==null?void 0:U.deprep,fillStyle:U==null?void 0:U.fillStyle,font:U==null?void 0:U.font,renderer:p}}return(k||Kn)&&(P==null||P(Gt)),B}function io(e,t,n,o,i,r,l,s,a=-20,d=-20,f=32,g="center",m="square"){const h=Math.floor(i+l/2),c=m==="circle"?1e4:t.roundingRadius??4;let u=Qo(f,l,t.cellVerticalPadding),y=u/2;const v=Jo(g,o,r,t.cellHorizontalPadding,u),w=Go(v,h,u),M=Zo(o+a,i+d,w);switch(n){case!0:{e.beginPath(),st(e,v-u/2,h-u/2,u,u,c),m==="circle"&&(y*=.8,u*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+u/4.23,h-y+u/1.97),e.lineTo(v-y+u/2.42,h-y+u/1.44),e.lineTo(v-y+u/1.29,h-y+u/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case kn:case!1:{e.beginPath(),st(e,v-u/2+.5,h-u/2+.5,u-1,u-1,c),e.lineWidth=1,e.strokeStyle=M?t.textDark:t.textMedium,e.stroke();break}case Qn:{e.beginPath(),st(e,v-u/2,h-u/2,u,u,c),e.fillStyle=M?t.textMedium:t.textLight,e.fill(),m==="circle"&&(y*=.8,u*=.8),e.beginPath(),e.moveTo(v-u/3,h),e.lineTo(v+u/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Jn()}}function Ar(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){var C,H,B,x;const M=l+s;if(M<=0)return;e.fillStyle=g.bgHeader,e.fillRect(0,0,i,M);const F=(C=o==null?void 0:o[0])==null?void 0:C[0],P=(H=o==null?void 0:o[0])==null?void 0:H[1],S=(B=o==null?void 0:o[1])==null?void 0:B[0],A=(x=o==null?void 0:o[1])==null?void 0:x[1],W=g.headerFontFull;e.font=W,xt(t,0,r,0,M,(k,p,q,V)=>{var J;if(y!==void 0&&!y.has([k.sourceIndex,-1]))return;const U=Math.max(0,V-p);e.save(),e.beginPath(),e.rect(p+U,s,k.width-U,l),e.clip();const ce=u(k.group??"").overrideTheme,se=k.themeOverride===void 0&&ce===void 0?g:Yt(g,ce,k.themeOverride);se.bgHeader!==g.bgHeader&&(e.fillStyle=se.bgHeader,e.fill()),se!==g&&(e.font=se.baseFontFull);const he=f.columns.hasIndex(k.sourceIndex),ge=a!==void 0||d,Ne=!ge&&P===-1&&F===k.sourceIndex,K=ge?0:((J=h.find(Ie=>Ie.item[0]===k.sourceIndex&&Ie.item[1]===-1))==null?void 0:J.hoverAmount)??0,De=(f==null?void 0:f.current)!==void 0&&f.current.cell[0]===k.sourceIndex,Se=he?se.accentColor:De?se.bgHeaderHasFocus:se.bgHeader,O=n?s:0,we=k.sourceIndex===0?0:1;he?(e.fillStyle=Se,e.fillRect(p+we,O,k.width-we,l)):(De||K>0)&&(e.beginPath(),e.rect(p+we,O,k.width-we,l),De&&(e.fillStyle=se.bgHeaderHasFocus,e.fill()),K>0&&(e.globalAlpha=K,e.fillStyle=se.bgHeaderHovered,e.fill(),e.globalAlpha=1)),yi(e,p,O,k.width,l,k,he,se,Ne,Ne?S:void 0,Ne?A:void 0,De,K,m,v,w),e.restore()}),n&&Dr(e,t,i,r,s,o,g,m,h,c,u,y)}function Dr(e,t,n,o,i,r,l,s,a,d,f,g){const[h,c]=(r==null?void 0:r[0])??[];let u=0;di(t,n,o,i,(y,v,w,M,F,P)=>{if(g!==void 0&&!g.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(w,M,F,P),e.clip();const S=f(v),A=(S==null?void 0:S.overrideTheme)===void 0?l:Yt(l,S.overrideTheme),W=c===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=W?A.bgHeaderHovered:A.bgHeader;if(C!==l.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=A.textGroupHeader??A.textHeader,S!==void 0){let H=w;if(S.icon!==void 0&&(s.drawSprite(S.icon,"normal",e,H+8,(i-20)/2,20,A),H+=26),e.fillText(S.name,H+8,i/2+kt(e,l.headerFontFull)),S.actions!==void 0&&W){const B=gi({x:w,y:M,width:F,height:P},S.actions);e.beginPath();const x=B[0].x-10,k=w+F-x;e.rect(x,0,k,i);const p=e.createLinearGradient(x,0,x+k,0),q=sn(C,0);p.addColorStop(0,q),p.addColorStop(10/k,C),p.addColorStop(1,C),e.fillStyle=p,e.fill(),e.globalAlpha=.6;const[V,U]=(r==null?void 0:r[1])??[-1,-1];for(let ce=0;ce35){const M=c?35:o-35,F=c?35*.7:o-35*.7,P=M/o,S=F/o,A=e.createLinearGradient(t,0,t+o,0),W=sn(y,0);A.addColorStop(c?1:0,y),A.addColorStop(P,y),A.addColorStop(S,W),A.addColorStop(c?0:1,W),e.fillStyle=A}else e.fillStyle=y;if(c&&(e.textAlign="right"),u.textBounds!==void 0&&e.fillText(r.title,c?u.textBounds.x+u.textBounds.width:u.textBounds.x,n+i/2+kt(e,s.headerFontFull)),c&&(e.textAlign="left"),r.indicatorIcon!==void 0&&u.indicatorIconBounds!==void 0&&(!v||!on(u.menuBounds.x,u.menuBounds.y,u.menuBounds.width,u.menuBounds.height,u.indicatorIconBounds.x,u.indicatorIconBounds.y,u.indicatorIconBounds.width,u.indicatorIconBounds.height))){let w=l?"selected":"normal";r.style==="highlight"&&(w=l?"selected":"special"),m.drawSprite(r.indicatorIcon,w,e,u.indicatorIconBounds.x,u.indicatorIconBounds.y,u.indicatorIconBounds.width,s)}if(v&&u.menuBounds!==void 0){const w=u.menuBounds,M=d!==void 0&&f!==void 0&&Ot(w,d+t,f+n);if(M||(e.globalAlpha=.7),r.menuIcon===void 0||r.menuIcon===$n.Triangle){e.beginPath();const F=w.x+w.width/2-5.5,P=w.y+w.height/2-3;pr(e,[{x:F,y:P},{x:F+11,y:P},{x:F+5.5,y:P+6}],1),e.fillStyle=y,e.fill()}else if(r.menuIcon===$n.Dots){e.beginPath();const F=w.x+w.width/2,P=w.y+w.height/2;vr(e,F,P),e.fillStyle=y,e.fill()}else{const F=w.x+(w.width-s.headerIconSize)/2,P=w.y+(w.height-s.headerIconSize)/2;m.drawSprite(r.menuIcon,"normal",e,F,P,s.headerIconSize,s)}M||(e.globalAlpha=1)}}function yi(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u){const y=eo(r.title)==="rtl",v=mi(e,r,t,n,o,i,s,y);c!==void 0?c({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:i},column:r,columnIndex:r.sourceIndex,isSelected:l,hoverAmount:m,isHovered:a,hasSelectedCell:g,spriteManager:h,menuBounds:(v==null?void 0:v.menuBounds)??{x:0,y:0,height:0,width:0}},()=>Ho(e,t,n,o,i,r,l,s,a,d,f,m,h,u,y,v)):Ho(e,t,n,o,i,r,l,s,a,d,f,m,h,u,y,v)}function Hr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const M=ci(y);xt(t,a,l,s,r,(F,P,S,A,W)=>{if(F!==t[t.length-1])return;P+=F.width;const C=Math.max(P,A);C>o||(e.save(),e.beginPath(),e.rect(C,r+1,1e4,i-r-1),e.clip(),xn(W,S,i,d,f,c,u,M,(H,B,x,k)=>{if(!k&&y.length>0&&!y.some(ce=>on(P,H,1e4,x,ce.x,ce.y,ce.width,ce.height)))return;const p=m.hasIndex(B),q=h.hasIndex(B);e.beginPath();const V=g==null?void 0:g(B),U=V===void 0?w:Yt(w,V);U.bgCell!==w.bgCell&&(e.fillStyle=U.bgCell,e.fillRect(P,H,1e4,x)),q&&(e.fillStyle=U.bgHeader,e.fillRect(P,H,1e4,x)),p&&(e.fillStyle=U.accentLight,e.fillRect(P,H,1e4,x))}),e.restore())})}function Rr(e,t,n,o,i,r,l,s,a){let d=!1;for(const c of t)if(!c.sticky){d=l(c.sourceIndex);break}const f=a.horizontalBorderColor??a.borderColor,g=a.borderColor,m=d?$t(t):0;let h;if(m!==0&&(h=Do(g,a.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=h,e.stroke()),i>0){const c=g===f&&h!==void 0?h:Do(f,a.bgCell),u=_t(r,i,s);e.beginPath(),e.moveTo(0,o-u+.5),e.lineTo(n,o-u+.5),e.strokeStyle=c,e.stroke()}}const bi=(e,t,n)=>{let o=0,i=t,r=0,l=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)o=Math.min(o,s.x-1),i=Math.max(i,s.x+s.width+1),r=Math.min(r,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:o,maxX:i,minY:r,maxY:l}};function Tr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c){var x;const u=c.bgCell,{minX:y,maxX:v,minY:w,maxY:M}=bi(s,r,l),F=[],P=l-_t(h,m,d);let S=a,A=n,W=0;for(;S+i=w&&k<=M-1){const q=f==null?void 0:f(A),V=q==null?void 0:q.bgCell;V!==void 0&&V!==u&&A>=h-m&&F.push({x:y,y:k,w:v-y,h:p,color:V})}S+=p,A0)for(let k=0;k=y&&q<=v&&g(k+1)&&F.push({x:q,y:W,w:p.width,h:H,color:V}),C+=p.width}if(F.length===0)return;let B;e.beginPath();for(let k=F.length-1;k>=0;k--){const p=F[k];B===void 0?B=p.color:p.color!==B&&(e.fillStyle=B,e.fill(),e.beginPath(),B=p.color),e.rect(p.x,p.y,p.w,p.h)}B!==void 0&&(e.fillStyle=B,e.fill()),e.beginPath()}function Ro(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,r,l);for(const x of a)e.rect(x.x+1,x.y+1,x.width-1,x.height-1);e.clip("evenodd")}const w=y.horizontalBorderColor??y.borderColor,M=y.borderColor,{minX:F,maxX:P,minY:S,maxY:A}=bi(s,r,l),W=[];e.beginPath();let C=.5;for(let x=0;x=F&&p<=P&&h(x+1)&&W.push({x1:p,y1:Math.max(d,S),x2:p,y2:Math.min(l,A),color:M})}let H=l+.5;for(let x=u-c;x=S&&q<=A-1){const V=m==null?void 0:m(k);W.push({x1:F,y1:q,x2:P,y2:q,color:(V==null?void 0:V.horizontalBorderColor)??(V==null?void 0:V.borderColor)??w})}x+=g(k),k++}}const B=Vi(W,x=>x.color);for(const x of Object.keys(B)){e.strokeStyle=x;for(const k of B[x])e.moveTo(k.x1,k.y1),e.lineTo(k.x2,k.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function Wr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){const M=[];e.imageSmoothingEnabled=!1;const F=Math.min(i.cellYOffset,l),P=Math.max(i.cellYOffset,l);let S=0;if(typeof v=="number")S+=(P-F)*v;else for(let p=F;pi.cellYOffset&&(S=-S),S+=a-i.translateY;const A=Math.min(i.cellXOffset,r),W=Math.max(i.cellXOffset,r);let C=0;for(let p=A;pi.cellXOffset&&(C=-C),C+=s-i.translateX;const H=$t(y);if(C!==0&&S!==0)return{regions:[]};const B=d>0?_t(m,d,v):0,x=f-H-Math.abs(C),k=g-h-B-Math.abs(S)-1;if(x>150&&k>150){const p={sx:0,sy:0,sw:f*c,sh:g*c,dx:0,dy:0,dw:f*c,dh:g*c};if(S>0?(p.sy=(h+1)*c,p.sh=k*c,p.dy=(S+h+1)*c,p.dh=k*c,M.push({x:0,y:h,width:f,height:S+1})):S<0&&(p.sy=(-S+h+1)*c,p.sh=k*c,p.dy=(h+1)*c,p.dh=k*c,M.push({x:0,y:g+S-B,width:f,height:-S+B})),C>0?(p.sx=H*c,p.sw=x*c,p.dx=(C+H)*c,p.dw=x*c,M.push({x:H-1,y:0,width:C+2,height:g})):C<0&&(p.sx=(H-C)*c,p.sw=x*c,p.dx=H*c,p.dw=x*c,M.push({x:f+C,y:0,width:-C,height:g})),e.setTransform(1,0,0,1,0,0),w){if(H>0&&C!==0&&S===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const q=H*c,V=g*c;e.drawImage(t,0,0,q,V,0,0,q,V)}if(B>0&&C===0&&S!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const q=(g-B)*c,V=f*c,U=B*c;e.drawImage(t,0,q,V,U,0,q,V,U)}}e.drawImage(t,p.sx,p.sy,p.sw,p.sh,p.dx,p.dy,p.dw,p.dh),e.scale(c,c)}return e.imageSmoothingEnabled=!0,{regions:M}}function zr(e,t,n,o,i,r,l,s,a,d){const f=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||i!==e.translateY||xt(a,n,o,i,s,(g,m,h,c)=>{if(g.sourceIndex===d){const u=Math.max(m,c)+1;return f.push({x:u,y:0,width:r-u,height:l}),!0}}),f}function Lr(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let o=0;oA.style!=="no-outline");if(y===void 0||y.length===0)return;const v=$t(s),w=_t(h,m,g),M=[a,0,s.length,h-m],F=[v,0,t,n-w],P=y.map(A=>{const W=A.range,C=A.style??"dashed";return Er(W,M,t,n,F).map(H=>{const B=H.rect,x=qn(B.x,B.y,t,n,f,d+f,o,i,r,l,h,a,m,s,g),k=B.width===1&&B.height===1?x:qn(B.x+B.width-1,B.y+B.height-1,t,n,f,d+f,o,i,r,l,h,a,m,s,g);return B.x+B.width>=s.length&&(k.width-=1),B.y+B.height>=h&&(k.height-=1),{color:A.color,style:C,clip:H.clip,rect:Mr({x:x.x,y:x.y,width:k.x+k.width-x.x,height:k.y+k.height-x.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let A=!1;for(const W of P)for(const C of W)if((C==null?void 0:C.rect)!==void 0&&on(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const H=A,B=!Ir(C.clip,C.rect);B&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!A?(e.setLineDash([5,3]),A=!0):(C.style==="solid"||C.style==="solid-outline")&&A&&(e.setLineDash([]),A=!1),e.strokeStyle=C.style==="solid-outline"?Ue(Ue(C.color,u.borderColor),u.bgCell):sn(C.color,1),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),B&&(e.restore(),A=H)}A&&e.setLineDash([])};return S(),S}function Wo(e,t,n,o,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,o),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function Wn(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y){if(f.current===void 0)return;const v=f.current.range,w=f.current.cell,M=[v.x+v.width-1,v.y+v.height-1];if(w[1]>=y&&M[1]>=y||!l.some(p=>p.sourceIndex===w[0]||p.sourceIndex===M[0]))return;const[P,S]=f.current.cell,A=m(f.current.cell),W=A.span??[P,P],C=S>=y-h,H=h>0&&!C?_t(y,h,g)-1:0,B=M[1];let x;if(xt(l,o,i,r,d,(p,q,V,U,ce)=>{if(p.sticky&&P>p.sourceIndex)return;const se=p.sourceIndexW[1],ge=p.sourceIndex===M[0];if(!(!ge&&(se||he)))return xn(ce,V,n,y,g,h,c,void 0,(Ne,K,De)=>{if(K!==S&&K!==B)return;let Se=q,O=p.width;if(A.span!==void 0){const J=ui(A.span,q,Ne,p.width,De,p,s),Ie=p.sticky?J[0]:J[1];Ie!==void 0&&(Se=Ie.x,O=Ie.width)}return K===B&&ge&&u&&(x=()=>{var J;U>Se&&!p.sticky&&(e.beginPath(),e.rect(U,0,t-U,n),e.clip()),e.beginPath(),e.rect(Se+O-4,Ne+De-4,4,4),e.fillStyle=((J=p.themeOverride)==null?void 0:J.accentColor)??a.accentColor,e.fill()}),x!==void 0}),x!==void 0}),x===void 0)return;const k=()=>{e.save(),e.beginPath(),e.rect(0,d,t,n-d-H),e.clip(),x==null||x(),e.restore()};return k(),k}function Nr(e,t,n,o,i,r,l,s,a){a===void 0||a.size===0||(e.beginPath(),di(t,n,r,o,(d,f,g,m,h,c)=>{a.hasItemInRectangle({x:d[0],y:-2,width:d[1]-d[0]+1,height:1})&&e.rect(g,m,h,c)}),xt(t,s,r,l,i,(d,f,g,m)=>{const h=Math.max(0,m-f),c=f+h+1,u=d.width-h-1;a.has([d.sourceIndex,-1])&&e.rect(c,o,u,i-o)}),e.clip())}function Or(e,t,n,o,i,r,l,s,a,d){let f=0;return xt(e,r,o,i,n,(g,m,h,c,u)=>(xn(u,h,t,l,s,a,d,void 0,(y,v,w,M)=>{M||(f=Math.max(v,f))}),!0)),f}function zo(e,t){var ct;const{canvasCtx:n,headerCanvasCtx:o,width:i,height:r,cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mappedColumns:f,enableGroups:g,freezeColumns:m,dragAndDropState:h,theme:c,drawFocus:u,headerHeight:y,groupHeaderHeight:v,disabledRows:w,rowHeight:M,verticalBorder:F,overrideCursor:P,isResizing:S,selection:A,fillHandle:W,freezeTrailingRows:C,rows:H,getCellContent:B,getGroupDetails:x,getRowThemeOverride:k,isFocused:p,drawHeaderCallback:q,prelightCells:V,drawCellCallback:U,highlightRegions:ce,resizeCol:se,imageLoader:he,lastBlitData:ge,hoverValues:Ne,hyperWrapping:K,hoverInfo:De,spriteManager:Se,maxScaleFactor:O,hasAppendRow:we,touchMode:J,enqueue:Ie,renderStateProvider:qe,getCellRenderer:lt,renderStrategy:Ct,bufferACtx:at,bufferBCtx:je,damage:ye,minimumCellWidth:mt,resizeIndicator:yt}=e;if(i===0||r===0)return;const Xe=Ct==="double-buffer",de=Math.min(O,Math.ceil(window.devicePixelRatio??1)),$e=Ct!=="direct"&&Lr(e,t),Me=n.canvas;(Me.width!==i*de||Me.height!==r*de)&&(Me.width=i*de,Me.height=r*de,Me.style.width=i+"px",Me.style.height=r+"px");const We=o.canvas,Q=g?v+y:y,xe=Q+1;(We.width!==i*de||We.height!==xe*de)&&(We.width=i*de,We.height=xe*de,We.style.width=i+"px",We.style.height=xe+"px");const le=at.canvas,be=je.canvas;Xe&&(le.width!==i*de||le.height!==r*de)&&(le.width=i*de,le.height=r*de,ge.current!==void 0&&(ge.current.aBufferScroll=void 0)),Xe&&(be.width!==i*de||be.height!==r*de)&&(be.width=i*de,be.height=r*de,ge.current!==void 0&&(ge.current.bBufferScroll=void 0));const L=ge.current;if($e===!0&&l===(L==null?void 0:L.cellXOffset)&&s===(L==null?void 0:L.cellYOffset)&&a===(L==null?void 0:L.translateX)&&d===(L==null?void 0:L.translateY))return;let j=null;Xe&&(j=n);const ue=o;let te;Xe?ye!==void 0?te=(L==null?void 0:L.lastBuffer)==="b"?je:at:te=(L==null?void 0:L.lastBuffer)==="b"?at:je:te=n;const ie=te.canvas,Ce=Xe?ie===le?be:le:Me,fe=typeof M=="number"?()=>M:M;ue.save(),te.save(),ue.beginPath(),te.beginPath(),ue.textBaseline="middle",te.textBaseline="middle",de!==1&&(ue.scale(de,de),te.scale(de,de));const G=Un(f,l,i,h,a);let Te=[];const Ye=u&&((ct=A.current)==null?void 0:ct.cell[1])===s&&d===0;let _e=!1;if(ce!==void 0){for(const pe of ce)if(pe.style!=="no-outline"&&pe.range.y===s&&d===0){_e=!0;break}}const Ee=()=>{Ar(ue,G,g,De,i,a,y,v,h,S,A,c,Se,Ne,F,x,ye,q,J),Ro(ue,G,s,a,d,i,r,void 0,void 0,v,Q,fe,k,F,C,H,c,!0),ue.beginPath(),ue.moveTo(0,xe-.5),ue.lineTo(i,xe-.5),ue.strokeStyle=Ue(c.headerBottomBorderColor??c.horizontalBorderColor??c.borderColor,c.bgHeader),ue.stroke(),_e&&To(ue,i,r,l,s,a,d,f,m,y,v,M,C,H,ce,c),Ye&&Wn(ue,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H)};if(ye!==void 0){const pe=G[G.length-1].sourceIndex+1,Oe=ye.hasItemInRegion([{x:l,y:-2,width:pe,height:2},{x:l,y:s,width:pe,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:l,y:H-C,width:pe,height:C,when:C>0}]),It=nt=>{Po(nt,G,f,r,Q,a,d,s,H,fe,B,x,k,w,p,u,C,we,Te,ye,A,V,ce,he,Se,Ne,De,U,K,c,Ie,qe,lt,P,mt);const ot=A.current;W&&u&&ot!==void 0&&ye.has(ti(ot.range))&&Wn(nt,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H)};Oe&&(It(te),j!==null&&(j.save(),j.scale(de,de),j.textBaseline="middle",It(j),j.restore()),ye.hasHeader()&&(Nr(ue,G,i,v,Q,a,d,s,ye),Ee())),te.restore(),ue.restore();return}if(($e!==!0||l!==(L==null?void 0:L.cellXOffset)||a!==(L==null?void 0:L.translateX)||Ye!==(L==null?void 0:L.mustDrawFocusOnHeader)||_e!==(L==null?void 0:L.mustDrawHighlightRingsOnHeader))&&Ee(),$e===!0){ft(Ce!==void 0&&L!==void 0);const{regions:pe}=Wr(te,Ce,Ce===le?L.aBufferScroll:L.bBufferScroll,Ce===le?L.bBufferScroll:L.aBufferScroll,L,l,s,a,d,C,i,r,H,Q,de,f,G,M,Xe);Te=pe}else $e!==!1&&(ft(L!==void 0),Te=zr(L,l,s,a,d,i,r,Q,G,$e));Rr(te,G,i,r,C,H,F,fe,c);const Ke=To(te,i,r,l,s,a,d,f,m,y,v,M,C,H,ce,c),ze=u?Wn(te,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H):void 0;if(te.fillStyle=c.bgCell,Te.length>0){te.beginPath();for(const pe of Te)te.rect(pe.x,pe.y,pe.width,pe.height);te.clip(),te.fill(),te.beginPath()}else te.fillRect(0,0,i,r);const Dt=Po(te,G,f,r,Q,a,d,s,H,fe,B,x,k,w,p,u,C,we,Te,ye,A,V,ce,he,Se,Ne,De,U,K,c,Ie,qe,lt,P,mt);Hr(te,G,f,i,r,Q,a,d,s,H,fe,k,A.rows,w,C,we,Te,ye,c),Tr(te,G,s,a,d,i,r,Te,Q,fe,k,F,C,H,c),Ro(te,G,s,a,d,i,r,Te,Dt,v,Q,fe,k,F,C,H,c),Ke==null||Ke(),ze==null||ze(),S&&yt!=="none"&&xt(G,0,a,0,Q,(pe,Oe)=>pe.sourceIndex===se?(Wo(ue,Oe+pe.width,0,Q+1,Ue(c.resizeIndicatorColor??c.accentLight,c.bgHeader)),yt==="full"&&Wo(te,Oe+pe.width,Q,r,Ue(c.resizeIndicatorColor??c.accentLight,c.bgCell)),!0):!1),j!==null&&(j.fillStyle=c.bgCell,j.fillRect(0,0,i,r),j.drawImage(te.canvas,0,0));const Pt=Or(G,r,Q,a,d,s,H,fe,C,we);he==null||he.setWindow({x:l,y:s,width:G.length,height:Pt-s},m,Array.from({length:C},(pe,Oe)=>H-1-Oe));const ve=L!==void 0&&(l!==L.cellXOffset||a!==L.translateX),St=L!==void 0&&(s!==L.cellYOffset||d!==L.translateY);ge.current={cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mustDrawFocusOnHeader:Ye,mustDrawHighlightRingsOnHeader:_e,lastBuffer:Xe?ie===le?"a":"b":void 0,aBufferScroll:ie===le?[ve,St]:L==null?void 0:L.aBufferScroll,bBufferScroll:ie===be?[ve,St]:L==null?void 0:L.bBufferScroll},te.restore(),ue.restore()}const Xr=80;function $r(e){const t=e-1;return t*t*t+1}class Yr{constructor(t){oe(this,"currentHoveredItem");oe(this,"leavingItems",[]);oe(this,"lastAnimationTime");oe(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>vn(o.item,t.item))||this.leavingItems.push(t)});oe(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>vn(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});oe(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});oe(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});oe(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:$r(t.hoverAmount)})));oe(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/Xr;for(const r of this.leavingItems)r.hoverAmount=wn(r.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=wn(this.currentHoveredItem.hoverAmount+o,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});oe(this,"setHovered",t=>{var n;if(!vn((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const o=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:o}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class _r{constructor(t){oe(this,"fn");oe(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ro(e){return new _r(e)}const Vr=ro(()=>window.navigator.userAgent.includes("Firefox")),Lo=ro(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),gl=ro(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Ur(e){const t=I.useRef([]),n=I.useRef(0),o=I.useRef(e);o.current=e;const i=I.useCallback(()=>{const r=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(oo);t.current=[],o.current(new tn(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?r:l)},[]);return I.useCallback(r=>{t.current.length===0&&i();const l=tt(r[0],r[1]);t.current.includes(l)||t.current.push(l)},[i])}const At="header",Nt="group-header",No="out-of-bounds";var Zt=(e=>(e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End",e))(Zt||{});function qr(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const Oo=6,jr=(e,t)=>{if(e.kind===ae.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},Kr=(e,t)=>{const{width:n,height:o,accessibilityHeight:i,columns:r,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:d=!1,groupHeaderHeight:f,rowHeight:g,rows:m,getCellContent:h,getRowThemeOverride:c,onHeaderMenuClick:u,onHeaderIndicatorClick:y,enableGroups:v,isFilling:w,onCanvasFocused:M,onCanvasBlur:F,isFocused:P,selection:S,freezeColumns:A,onContextMenu:W,freezeTrailingRows:C,fixedShadowX:H=!0,fixedShadowY:B=!0,drawFocusRing:x,onMouseDown:k,onMouseUp:p,onMouseMoveRaw:q,onMouseMove:V,onItemHovered:U,dragAndDropState:ce,firstColAccessible:se,onKeyDown:he,onKeyUp:ge,highlightRegions:Ne,canvasRef:K,onDragStart:De,onDragEnd:Se,eventTargetRef:O,isResizing:we,resizeColumn:J,isDragging:Ie,isDraggable:qe=!1,allowResize:lt,disabledRows:Ct,hasAppendRow:at,getGroupDetails:je,theme:ye,prelightCells:mt,headerIcons:yt,verticalBorder:Xe,drawCell:de,drawHeader:$e,onCellFocused:Me,onDragOverCell:We,onDrop:Q,onDragLeave:xe,imageWindowLoader:le,smoothScrollX:be=!1,smoothScrollY:L=!1,experimental:j,getCellRenderer:ue,resizeIndicator:te="full"}=e,ie=e.translateX??0,Ce=e.translateY??0,fe=Math.max(A,Math.min(r.length-1,l)),G=I.useRef(null),Te=I.useRef(window),Ye=Te.current,_e=le,Ee=I.useRef(),[Ke,ze]=I.useState(!1),Dt=I.useRef([]),Pt=I.useRef(),[ve,St]=I.useState(),[ct,pe]=I.useState(),Oe=I.useRef(null),[It,nt]=I.useState(),[ot,ne]=I.useState(!1),Be=I.useRef(ot);Be.current=ot;const ke=I.useMemo(()=>new xr(yt,()=>{an.current=void 0,Ut.current()}),[yt]),it=v?f+a:a,Ve=I.useRef(-1),bt=((j==null?void 0:j.enableFirefoxRescaling)??!1)&&Vr.value,Sn=((j==null?void 0:j.enableSafariRescaling)??!1)&&Lo.value;I.useLayoutEffect(()=>{window.devicePixelRatio===1||!bt&&!Sn||(Ve.current!==-1&&ze(!0),window.clearTimeout(Ve.current),Ve.current=window.setTimeout(()=>{ze(!1),Ve.current=-1},200))},[s,fe,ie,Ce,bt,Sn]);const Fe=sr(r,A),In=H?$t(Fe,ce):0,Pe=I.useCallback((b,E,z)=>{const T=b.getBoundingClientRect();if(E>=Fe.length||z>=m)return;const D=T.width/n,R=qn(E,z,n,o,f,it,fe,s,ie,Ce,m,A,C,Fe,g);return D!==1&&(R.x*=D,R.y*=D,R.width*=D,R.height*=D),R.x+=T.x,R.y+=T.y,R},[n,o,f,it,fe,s,ie,Ce,m,A,C,Fe,g]),Le=I.useCallback((b,E,z,T)=>{const D=b.getBoundingClientRect(),R=D.width/n,Y=(E-D.left)/R,_=(z-D.top)/R,N=5,He=Un(Fe,fe,n,void 0,ie);let X=0,re=0;T instanceof MouseEvent&&(X=T.button,re=T.buttons);const Z=dr(Y,He,ie),ee=ur(_,o,v,a,f,m,g,s,Ce,C),Re=(T==null?void 0:T.shiftKey)===!0,Qe=(T==null?void 0:T.ctrlKey)===!0,Ae=(T==null?void 0:T.metaKey)===!0,dt=T!==void 0&&!(T instanceof MouseEvent)||(T==null?void 0:T.pointerType)==="touch",vt=[Y<0?-1:nn||_>o){const me=Y>n?1:Y<0?-1:0,et=_>o?1:_<0?-1:0;let rt=me*2,jt=et*2;me===0&&(rt=Z===-1?Zt.EndPadding:Zt.Center),et===0&&(jt=ee===void 0?Zt.EndPadding:Zt.Center);let pt=!1;if(Z===-1&&ee===-1){const Kt=Pe(b,Fe.length-1,-1);ft(Kt!==void 0),pt=En&&Yo&&_=0?(et=!0,me=Pe(b,rt,ee),ft(me!==void 0),Ze={kind:v&&ee===-2?Nt:At,location:[rt,ee],bounds:me,group:Fe[rt].group??"",isEdge:et,shiftKey:Re,ctrlKey:Qe,metaKey:Ae,isTouch:dt,localEventX:E-me.x,localEventY:z-me.y,button:X,buttons:re,scrollEdge:vt}):Ze={kind:v&&ee===-2?Nt:At,group:Fe[Z].group??"",location:[Z,ee],bounds:me,isEdge:et,shiftKey:Re,ctrlKey:Qe,metaKey:Ae,isTouch:dt,localEventX:E-me.x,localEventY:z-me.y,button:X,buttons:re,scrollEdge:vt}}else{const me=Pe(b,Z,ee);ft(me!==void 0);const et=me!==void 0&&me.x+me.width-E{}),Ht=I.useRef(ve);Ht.current=ve;const[Et,Bt]=I.useMemo(()=>{const b=document.createElement("canvas"),E=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",E.style.display="none",E.style.opacity="0",E.style.position="fixed",[b.getContext("2d",{alpha:!1}),E.getContext("2d",{alpha:!1})]},[]);I.useLayoutEffect(()=>{if(!(Et===null||Bt===null))return document.documentElement.append(Et.canvas),document.documentElement.append(Bt.canvas),()=>{Et.canvas.remove(),Bt.canvas.remove()}},[Et,Bt]);const ln=I.useMemo(()=>new wr,[]),lo=bt&&Ke?1:Sn&&Ke?2:5,ao=(j==null?void 0:j.disableMinimumCellWidth)===!0?1:10,an=I.useRef(),cn=I.useRef(null),dn=I.useRef(null),un=I.useCallback(()=>{var Y;const b=G.current,E=Oe.current;if(b===null||E===null||(cn.current===null&&(cn.current=b.getContext("2d",{alpha:!1}),b.width=0,b.height=0),dn.current===null&&(dn.current=E.getContext("2d",{alpha:!1}),E.width=0,E.height=0),cn.current===null||dn.current===null||Et===null||Bt===null))return;let z=!1;const T=_=>{z=!0,nt(_)},D=an.current,R={headerCanvasCtx:dn.current,canvasCtx:cn.current,bufferACtx:Et,bufferBCtx:Bt,width:n,height:o,cellXOffset:fe,cellYOffset:s,translateX:Math.round(ie),translateY:Math.round(Ce),mappedColumns:Fe,enableGroups:v,freezeColumns:A,dragAndDropState:ce,theme:ye,headerHeight:a,groupHeaderHeight:f,disabledRows:Ct??_n.empty(),rowHeight:g,verticalBorder:Xe,isResizing:we,resizeCol:J,isFocused:P,selection:S,fillHandle:d,drawCellCallback:de,hasAppendRow:at,overrideCursor:T,maxScaleFactor:lo,freezeTrailingRows:C,rows:m,drawFocus:x,getCellContent:h,getGroupDetails:je??(_=>({name:_})),getRowThemeOverride:c,drawHeaderCallback:$e,prelightCells:mt,highlightRegions:Ne,imageLoader:_e,lastBlitData:Pt,damage:Ee.current,hoverValues:Dt.current,hoverInfo:Ht.current,spriteManager:ke,scrolling:Ke,hyperWrapping:(j==null?void 0:j.hyperWrapping)??!1,touchMode:ot,enqueue:so.current,renderStateProvider:ln,renderStrategy:(j==null?void 0:j.renderStrategy)??(Lo.value?"double-buffer":"single-buffer"),getCellRenderer:ue,minimumCellWidth:ao,resizeIndicator:te};R.damage===void 0?(an.current=R,zo(R,D)):zo(R,void 0),!z&&(R.damage===void 0||R.damage.has((Y=Ht==null?void 0:Ht.current)==null?void 0:Y[0]))&&nt(void 0)},[Et,Bt,n,o,fe,s,ie,Ce,Fe,v,A,ce,ye,a,f,Ct,g,Xe,we,at,J,P,S,d,C,m,x,lo,h,je,c,de,$e,mt,Ne,_e,ke,Ke,j==null?void 0:j.hyperWrapping,j==null?void 0:j.renderStrategy,ot,ln,ue,ao,te]),Ut=I.useRef(un);I.useLayoutEffect(()=>{un(),Ut.current=un},[un]),I.useLayoutEffect(()=>{(async()=>{var E;((E=document==null?void 0:document.fonts)==null?void 0:E.ready)!==void 0&&(await document.fonts.ready,an.current=void 0,Ut.current())})()},[]);const Rt=I.useCallback(b=>{Ee.current=b,Ut.current(),Ee.current=void 0},[]),vi=Ur(Rt);so.current=vi;const co=I.useCallback(b=>{Rt(new tn(b.map(E=>E.cell)))},[Rt]);_e.setCallback(Rt);const[pi,wi]=I.useState(!1),[fn,Tt]=Mt??[],ki=fn!==void 0&&Tt===-1,xi=fn!==void 0&&Tt===-2;let uo=!1,fo=!1,hn=It;if(hn===void 0&&fn!==void 0&&Tt!==void 0&&Tt>-1&&Tt({contain:"strict",display:"block",cursor:ho}),[ho]),go=I.useRef("default"),En=O==null?void 0:O.current;En!=null&&go.current!==Mn.cursor&&(En.style.cursor=go.current=Mn.cursor);const Wt=I.useCallback((b,E,z,T)=>{if(je===void 0)return;const D=je(b);if(D.actions!==void 0){const R=gi(E,D.actions);for(const[Y,_]of R.entries())if(Ot(_,z+E.x,T+_.y))return D.actions[Y]}},[je]),zt=I.useCallback((b,E,z,T)=>{const D=Fe[E];if(!Ie&&!we&&!(ct??!1)){const R=Pe(b,E,-1);ft(R!==void 0);const Y=mi(void 0,D,R.x,R.y,R.width,R.height,ye,eo(D.title)==="rtl");if(D.hasMenu===!0&&Y.menuBounds!==void 0&&Ot(Y.menuBounds,z,T))return{area:"menu",bounds:Y.menuBounds};if(D.indicatorIcon!==void 0&&Y.indicatorIconBounds!==void 0&&Ot(Y.indicatorIconBounds,z,T))return{area:"indicator",bounds:Y.indicatorIconBounds}}},[Fe,Pe,ct,Ie,we,ye]),Bn=I.useRef(0),qt=I.useRef(),Fn=I.useRef(!1),mo=I.useCallback(b=>{const E=G.current,z=O==null?void 0:O.current;if(E===null||b.target!==E&&b.target!==z)return;Fn.current=!0;let T,D;if(b instanceof MouseEvent?(T=b.clientX,D=b.clientY):(T=b.touches[0].clientX,D=b.touches[0].clientY),b.target===z&&z!==null){const Y=z.getBoundingClientRect();if(T>Y.right||D>Y.bottom)return}const R=Le(E,T,D,b);qt.current=R.location,R.isTouch&&(Bn.current=Date.now()),Be.current!==R.isTouch&&ne(R.isTouch),!(R.kind===At&&zt(E,R.location[0],T,D)!==void 0)&&(R.kind===Nt&&Wt(R.group,R.bounds,R.localEventX,R.localEventY)!==void 0||(k==null||k(R),!R.isTouch&&qe!==!0&&qe!==R.kind&&R.button<3&&R.button!==1&&b.preventDefault()))},[O,qe,Le,Wt,zt,k]);Ge("touchstart",mo,Ye,!1),Ge("mousedown",mo,Ye,!1);const yo=I.useRef(0),bo=I.useCallback(b=>{var re,Z;const E=yo.current;yo.current=Date.now();const z=G.current;if(Fn.current=!1,p===void 0||z===null)return;const T=O==null?void 0:O.current,D=b.target!==z&&b.target!==T;let R,Y,_=!0;if(b instanceof MouseEvent){if(R=b.clientX,Y=b.clientY,_=b.button<3,b.pointerType==="touch")return}else R=b.changedTouches[0].clientX,Y=b.changedTouches[0].clientY;let N=Le(z,R,Y,b);N.isTouch&&Bn.current!==0&&Date.now()-Bn.current>500&&(N={...N,isLongTouch:!0}),E!==0&&Date.now()-E<(N.isTouch?1e3:500)&&(N={...N,isDoubleClick:!0}),Be.current!==N.isTouch&&ne(N.isTouch),!D&&b.cancelable&&_&&b.preventDefault();const[He]=N.location,X=zt(z,He,R,Y);if(N.kind===At&&X!==void 0){(N.button!==0||((re=qt.current)==null?void 0:re[0])!==He||((Z=qt.current)==null?void 0:Z[1])!==-1)&&p(N,!0);return}else if(N.kind===Nt){const ee=Wt(N.group,N.bounds,N.localEventX,N.localEventY);if(ee!==void 0){N.button===0&&ee.onClick(N);return}}p(N,D)},[p,O,Le,zt,Wt]);Ge("mouseup",bo,Ye,!1),Ge("touchend",bo,Ye,!1);const Ci=I.useCallback(b=>{var He,X;const E=G.current;if(E===null)return;const z=O==null?void 0:O.current,T=b.target!==E&&b.target!==z;let D,R,Y=!0;b instanceof MouseEvent?(D=b.clientX,R=b.clientY,Y=b.button<3):(D=b.changedTouches[0].clientX,R=b.changedTouches[0].clientY);const _=Le(E,D,R,b);Be.current!==_.isTouch&&ne(_.isTouch),!T&&b.cancelable&&Y&&b.preventDefault();const[N]=_.location;if(_.kind===At){const re=zt(E,N,D,R);re!==void 0&&_.button===0&&((He=qt.current)==null?void 0:He[0])===N&&((X=qt.current)==null?void 0:X[1])===-1&&(re.area==="menu"?u==null||u(N,re.bounds):re.area==="indicator"&&(y==null||y(N,re.bounds)))}else if(_.kind===Nt){const re=Wt(_.group,_.bounds,_.localEventX,_.localEventY);re!==void 0&&_.button===0&&re.onClick(_)}},[O,Le,zt,u,y,Wt]);Ge("click",Ci,Ye,!1);const Si=I.useCallback(b=>{const E=G.current,z=O==null?void 0:O.current;if(E===null||b.target!==E&&b.target!==z||W===void 0)return;const T=Le(E,b.clientX,b.clientY,b);W(T,()=>{b.cancelable&&b.preventDefault()})},[O,Le,W]);Ge("contextmenu",Si,(O==null?void 0:O.current)??null,!1);const vo=I.useCallback(b=>{Ee.current=new tn(b.map(E=>E.item)),Dt.current=b,Ut.current(),Ee.current=void 0},[]),po=I.useMemo(()=>new Yr(vo),[vo]),wo=I.useRef(po);wo.current=po,I.useLayoutEffect(()=>{const b=wo.current;if(Mt===void 0||Mt[1]<0){b.setHovered(Mt);return}const E=h(Mt,!0),z=ue(E),T=z===void 0&&E.kind===ae.Custom||(z==null?void 0:z.needsHover)!==void 0&&(typeof z.needsHover=="boolean"?z.needsHover:z.needsHover(E));b.setHovered(T?Mt:void 0)},[h,ue,Mt]);const ko=I.useRef(),Ii=I.useCallback(b=>{var _;const E=G.current;if(E===null)return;const z=O==null?void 0:O.current,T=b.target!==E&&b.target!==z,D=Le(E,b.clientX,b.clientY,b);if(D.kind!=="out-of-bounds"&&T&&!Fn.current&&!D.isTouch)return;const R=(N,He)=>{St(X=>X===N||(X==null?void 0:X[0][0])===(N==null?void 0:N[0][0])&&(X==null?void 0:X[0][1])===(N==null?void 0:N[0][1])&&((X==null?void 0:X[1][0])===(N==null?void 0:N[1][0])&&(X==null?void 0:X[1][1])===(N==null?void 0:N[1][1])||!He)?X:N)};if(!qr(D,ko.current))nt(void 0),U==null||U(D),R(D.kind===No?void 0:[D.location,[D.localEventX,D.localEventY]],!0),ko.current=D;else if(D.kind==="cell"||D.kind===At||D.kind===Nt){let N=!1,He=!0;if(D.kind==="cell"){const re=h(D.location);He=((_=ue(re))==null?void 0:_.needsHoverPosition)??re.kind===ae.Custom,N=He}else N=!0;const X=[D.location,[D.localEventX,D.localEventY]];R(X,He),Ht.current=X,N&&Rt(new tn([D.location]))}const Y=D.location[0]>=(se?0:1);pe(D.kind===At&&D.isEdge&&Y&<===!0),wi(D.kind==="cell"&&D.isFillHandle),q==null||q(b),V(D)},[O,Le,se,lt,q,V,U,h,ue,Rt]);Ge("mousemove",Ii,Ye,!0);const Mi=I.useCallback(b=>{const E=G.current;if(E===null)return;let z,T;S.current!==void 0&&(z=Pe(E,S.current.cell[0],S.current.cell[1]),T=S.current.cell),he==null||he({bounds:z,stopPropagation:()=>b.stopPropagation(),preventDefault:()=>b.preventDefault(),cancel:()=>{},ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,altKey:b.altKey,key:b.key,keyCode:b.keyCode,rawEvent:b,location:T})},[he,S,Pe]),Ei=I.useCallback(b=>{const E=G.current;if(E===null)return;let z,T;S.current!==void 0&&(z=Pe(E,S.current.cell[0],S.current.cell[1]),T=S.current.cell),ge==null||ge({bounds:z,stopPropagation:()=>b.stopPropagation(),preventDefault:()=>b.preventDefault(),cancel:()=>{},ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,altKey:b.altKey,key:b.key,keyCode:b.keyCode,rawEvent:b,location:T})},[ge,S,Pe]),Bi=I.useCallback(b=>{if(G.current=b,K!==void 0&&(K.current=b),b===null)Te.current=window;else{const E=b.getRootNode();E===document&&(Te.current=window),Te.current=E}},[K]),Fi=I.useCallback(b=>{const E=G.current;if(E===null||qe===!1||we){b.preventDefault();return}let z,T;const D=Le(E,b.clientX,b.clientY);if(qe!==!0&&D.kind!==qe){b.preventDefault();return}const R=(re,Z)=>{z=re,T=Z};let Y,_,N;const He=(re,Z,ee)=>{Y=re,_=Z,N=ee};let X=!1;if(De==null||De({...D,setData:R,setDragImage:He,preventDefault:()=>X=!0,defaultPrevented:()=>X}),!X&&z!==void 0&&T!==void 0&&b.dataTransfer!==null)if(b.dataTransfer.setData(z,T),b.dataTransfer.effectAllowed="copyLink",Y!==void 0&&_!==void 0&&N!==void 0)b.dataTransfer.setDragImage(Y,_,N);else{const[re,Z]=D.location;if(Z!==void 0){const ee=document.createElement("canvas"),Re=Pe(E,re,Z);ft(Re!==void 0);const Qe=Math.ceil(window.devicePixelRatio??1);ee.width=Re.width*Qe,ee.height=Re.height*Qe;const Ae=ee.getContext("2d");Ae!==null&&(Ae.scale(Qe,Qe),Ae.textBaseline="middle",Z===-1?(Ae.font=ye.headerFontFull,Ae.fillStyle=ye.bgHeader,Ae.fillRect(0,0,ee.width,ee.height),yi(Ae,0,0,Re.width,Re.height,Fe[re],!1,ye,!1,void 0,void 0,!1,0,ke,$e,!1)):(Ae.font=ye.baseFontFull,Ae.fillStyle=ye.bgCell,Ae.fillRect(0,0,ee.width,ee.height),hi(Ae,h([re,Z]),0,Z,!1,!1,0,0,Re.width,Re.height,!1,ye,ye.bgCell,_e,ke,1,void 0,!1,0,void 0,void 0,void 0,ln,ue,()=>{}))),ee.style.left="-100%",ee.style.position="absolute",ee.style.width=`${Re.width}px`,ee.style.height=`${Re.height}px`,document.body.append(ee),b.dataTransfer.setDragImage(ee,Re.width/2,Re.height/2),window.setTimeout(()=>{ee.remove()},0)}}else b.preventDefault()},[qe,we,Le,De,Pe,ye,Fe,ke,$e,h,_e,ln,ue]);Ge("dragstart",Fi,(O==null?void 0:O.current)??null,!1,!1);const An=I.useRef(),Ai=I.useCallback(b=>{const E=G.current;if(Q!==void 0&&b.preventDefault(),E===null||We===void 0)return;const z=Le(E,b.clientX,b.clientY),[T,D]=z.location,R=T-(se?0:1),[Y,_]=An.current??[];(Y!==R||_!==D)&&(An.current=[R,D],We([R,D],b.dataTransfer))},[se,Le,We,Q]);Ge("dragover",Ai,(O==null?void 0:O.current)??null,!1,!1);const Di=I.useCallback(()=>{An.current=void 0,Se==null||Se()},[Se]);Ge("dragend",Di,(O==null?void 0:O.current)??null,!1,!1);const Pi=I.useCallback(b=>{const E=G.current;if(E===null||Q===void 0)return;b.preventDefault();const z=Le(E,b.clientX,b.clientY),[T,D]=z.location,R=T-(se?0:1);Q([R,D],b.dataTransfer)},[se,Le,Q]);Ge("drop",Pi,(O==null?void 0:O.current)??null,!1,!1);const Hi=I.useCallback(()=>{xe==null||xe()},[xe]);Ge("dragleave",Hi,(O==null?void 0:O.current)??null,!1,!1);const xo=I.useRef(S);xo.current=S;const gn=I.useRef(null),Dn=I.useCallback(b=>{var E;G.current===null||!G.current.contains(document.activeElement)||(b===null&&xo.current.current!==void 0?(E=K==null?void 0:K.current)==null||E.focus({preventScroll:!0}):b!==null&&b.focus({preventScroll:!0}),gn.current=b)},[K]);I.useImperativeHandle(t,()=>({focus:()=>{var E;const b=gn.current;b===null||!document.contains(b)?(E=K==null?void 0:K.current)==null||E.focus({preventScroll:!0}):b.focus({preventScroll:!0})},getBounds:(b,E)=>{if(!(K===void 0||K.current===null))return Pe(K.current,b??0,E??-1)},damage:co}),[K,co,Pe]);const Pn=I.useRef(),Ri=nr(()=>{var _,N,He;if(n<50||(j==null?void 0:j.disableAccessibilityTree)===!0)return null;let b=Un(Fe,fe,n,ce,ie);const E=se?0:-1;!se&&((_=b[0])==null?void 0:_.sourceIndex)===0&&(b=b.slice(1));const[z,T]=((N=S.current)==null?void 0:N.cell)??[],D=(He=S.current)==null?void 0:He.range,R=b.map(X=>X.sourceIndex),Y=Ui(s,Math.min(m,s+i));return z!==void 0&&T!==void 0&&!(R.includes(z)&&Y.includes(T))&&Dn(null),Je("table",{role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":Fe.length+E,children:[$("thead",{role:"rowgroup",children:$("tr",{role:"row","aria-rowindex":1,children:b.map(X=>$("th",{role:"columnheader","aria-selected":S.columns.hasIndex(X.sourceIndex),"aria-colindex":X.sourceIndex+1+E,tabIndex:-1,onFocus:re=>{if(re.target!==gn.current)return Me==null?void 0:Me([X.sourceIndex,-1])},children:X.title},X.sourceIndex))})}),$("tbody",{role:"rowgroup",children:Y.map(X=>$("tr",{role:"row","aria-selected":S.rows.hasIndex(X),"aria-rowindex":X+2,children:b.map(re=>{const Z=re.sourceIndex,ee=tt(Z,X),Re=z===Z&&T===X,Qe=D!==void 0&&Z>=D.x&&Z=D.y&&X{const Ze=K==null?void 0:K.current;if(Ze!=null)return he==null?void 0:he({bounds:Pe(Ze,Z,X),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:dt})},onFocusCapture:Ze=>{var me,et;if(!(Ze.target===gn.current||((me=Pn.current)==null?void 0:me[0])===Z&&((et=Pn.current)==null?void 0:et[1])===X))return Pn.current=dt,Me==null?void 0:Me(dt)},ref:Re?Dn:void 0,tabIndex:-1,children:jr(vt,ue)},ee)})},X))})]},"access-tree")},[n,Fe,fe,ce,ie,m,s,i,S,Dn,h,K,he,Pe,Me],200),mn=A===0||!H?0:fe>A?1:wn(-ie/100,0,1),Ti=-s*32+Ce,yn=B?wn(-Ti/100,0,1):0,Wi=I.useMemo(()=>{if(!mn&&!yn)return null;const b={position:"absolute",top:0,left:In,width:n-In,height:o,opacity:mn,pointerEvents:"none",transition:be?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},E={position:"absolute",top:it,left:0,width:n,height:o,opacity:yn,pointerEvents:"none",transition:L?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return Je(Xn,{children:[mn>0&&$("div",{id:"shadow-x",style:b}),yn>0&&$("div",{id:"shadow-y",style:E})]})},[mn,yn,In,n,be,it,o,L]),zi=I.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return Je(Xn,{children:[$("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Mi,onKeyUp:Ei,onFocus:M,onBlur:F,ref:Bi,style:Mn,children:Ri}),$("canvas",{ref:Oe,style:zi}),Wi]})},ml=I.memo(I.forwardRef(Kr));function Gr(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case ae.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Qn?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case ae.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case ae.Image:case ae.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case ae.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case ae.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case ae.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case ae.Markdown:case ae.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case ae.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case ae.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case ae.Protected:return{formatted:"************",rawValue:"",format:"string"};default:Jn()}}function Jr(e,t){return e.map((o,i)=>{const r=t[i];return o.map(l=>l.span!==void 0&&l.span[0]!==r?{formatted:"",rawValue:"",format:"string"}:Gr(l))})}function Xo(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Qr(e){var n;const t=[];for(const o of e){const i=[];for(const r of o)r.format==="url"?i.push(((n=r.rawValue)==null?void 0:n.toString())??""):r.format==="string-array"?i.push(r.formatted.map(l=>Xo(l,!0)).join(",")):i.push(Xo(r.formatted,!1));t.push(i.join(" "))}return t.join(` -`)}function zn(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function $o(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function Zr(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function es(e){var n;const t=[];t.push('',"");for(const o of e){t.push("");for(const i of o){const r=`gdg-format="${i.format}"`;i.format==="url"?t.push(``):i.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${zn(i.formatted)}
    ${i.formatted.map((l,s)=>`
  1. `+zn(l)+"
  2. ").join("")}
${zn(i.formatted)}
"),t.join("")}function ts(e,t){const n=Jr(e,t),o=Qr(n),i=es(n);return{textPlain:o,textHtml:i}}function yl(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const o=[n],i=[];let r;for(;o.length>0;){const s=o.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")o.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)r!==void 0&&i.push(r),r=[],o.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),f=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,g=(f==null?void 0:f.children.length)===1&&f.children[0].nodeName==="FONT",m=a.querySelectorAll("br");for(const u of m)u.replaceWith(` -`);const h=a.getAttribute("gdg-raw-value"),c=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)r==null||r.push({rawValue:((l=a.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:a.textContent??"",format:c});else if(a.querySelector("ol")!==null){const u=a.querySelectorAll("li");r==null||r.push({rawValue:[...u].map(y=>y.getAttribute("gdg-raw-value")??""),formatted:[...u].map(y=>y.textContent??""),format:"string-array"})}else if(h!==null)r==null||r.push({rawValue:Zr(h),formatted:a.textContent??"",format:c});else{let u=a.textContent??"";g&&(u=u.replace(/\n(?!\n)/g,"")),r==null||r.push({rawValue:u??"",formatted:u??"",format:c})}}}return r!==void 0&&i.push(r),i}function bl(e,t,n,o,i){var s;const r=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const a=(s=e.current)==null?void 0:s.range,d=[];if(a.width>2){const m=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof m=="function")return r;d.push(...m);const h=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof h=="function")return r;d.push(...h)}else{const m=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof m=="function")return r;d.push(...m)}let f=a.x-n,g=a.x+a.width-1-n;for(const m of d)for(const h of m)h.span!==void 0&&(f=Math.min(h.span[0],f),g=Math.max(h.span[1],g));f===a.x-n&&g===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:f+n,y:a.y,width:g-f+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function Yo(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function vl(e){let t;(s=>{s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let o=[],i=0,r=0;e=e.replace(/\r\n/g,` +var Ni=Object.defineProperty;var Oi=(e,t,n)=>t in e?Ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>(Oi(e,typeof t!="symbol"?t+"":t,n),n);import{a as Je,j as $,F as Xn,s as gt,b as Xi}from"./marked.esm-dbrxtycE.js";import{r as I,R as Kn}from"./index-BMVQvedj.js";import{h as $i,d as Yi,v as _i,_ as Vi,g as Ui,c as wn,r as qi,j as ji,t as Ki}from"./throttle-7EuXLZa7.js";import{_ as Gi}from"./iframe-alOpk4ZG.js";function jo(e="This should not happen"){throw new Error(e)}function ft(e,t="Assertion failed"){if(!e)return jo(t)}function Gn(e,t){return jo(t??"Hell froze over")}function nl(e,t){try{return e()}catch{return t}}const Co=Object.prototype.hasOwnProperty;function Xt(e,t){let n,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((o=e.length)===t.length)for(;o--&&Xt(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Co.call(e,n)&&++o&&!Co.call(t,n)||!(n in t)||!Xt(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const kn=null,Jn=void 0;var ae=(e=>(e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom",e))(ae||{}),Ji=(e=>(e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay",e))(Ji||{}),$n=(e=>(e.Triangle="triangle",e.Dots="dots",e))($n||{});function ol(e){return"width"in e&&typeof e.width=="number"}async function il(e){return typeof e=="object"?e:await e()}function Qi(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown")}function rl(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown"||e.kind==="boolean"||e.kind==="image"||e.kind==="custom")}function Ko(e){return e.kind==="marker"||e.kind==="new-row"}function Zi(e){if(!Qi(e)||e.kind==="image")return!1;if(e.kind==="text"||e.kind==="number"||e.kind==="markdown"||e.kind==="uri"||e.kind==="custom"||e.kind==="boolean")return e.readonly!==!0;Gn(e,"A cell was passed with an invalid kind")}function sl(e){return $i(e,"editor")}function Qn(e){return!(e.readonly??!1)}var nn=(e=>(e.NewRow="new-row",e.Marker="marker",e))(nn||{});function er(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(o,i){return o[0]-i[0]}),n.push([...t[0]]);for(const o of t.slice(1)){const i=n[n.length-1];i[1][o[0]+t,o[1]+t]);return new ut(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=er([...this.items,n]);return new ut(o)}remove(t){const n=[...this.items],o=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[r,l]of n.entries()){const[s,a]=l;if(s<=i&&o<=a){const d=[];s=o&&tSo??(So=new ut([]))),oe(ut,"fromSingleSelection",t=>ut.empty().add(t));let Yn=ut;function Ge(e,t,n,o,i=!1){const r=I.useRef();r.current=t,I.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,s=a=>{var d;(d=r.current)==null||d.call(l,a)};return l.addEventListener(e,s,{passive:o,capture:i}),()=>{l.removeEventListener(e,s,{capture:i})}},[e,n,o,i])}function ll(e,t){return e===void 0?void 0:t}const tr=Math.PI;function Io(e){return e*tr/180}const Go=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Jo=(e,t,n,o,i)=>{switch(e){case"left":return Math.floor(t)+o+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-o-i/2}},Qo=(e,t,n)=>Math.min(e,t-n*2),Zo=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Zn=e=>{const t=e.fgColor??"currentColor";return Je("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),$("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"})]})},nr=e=>{const t=e.fgColor??"currentColor";return $("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})};function or(e,t,n){const[o,i]=I.useState(e),r=I.useRef(!0);I.useEffect(()=>()=>{r.current=!1},[]);const l=I.useRef(Yi(s=>{r.current&&i(s)},n));return I.useLayoutEffect(()=>{r.current&&l.current(()=>e())},t),o}const ir="֑-߿יִ-﷽ﹰ-ﻼ",rr="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",sr=new RegExp("^[^"+rr+"]*["+ir+"]");function eo(e){return sr.test(e)?"rtl":"not-rtl"}let bn;function Mo(){if(typeof document>"u")return 0;if(bn!==void 0)return bn;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let o=e.offsetWidth;return n===o&&(o=t.clientWidth),t.remove(),bn=n-o,bn}const Ft=Symbol();function al(e){const t=I.useRef([Ft,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=I.useState(e),[,i]=I.useState(),r=I.useCallback(s=>{const a=t.current[0];a!==Ft&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Ft&&i({}),o(d=>typeof s=="function"?s(a===Ft?d:a):s),t.current[0]=Ft)},[]),l=I.useCallback(()=>{t.current[0]=Ft,i({})},[]);return[t.current[0]===Ft?n:t.current[0],r,l]}function ei(e){if(e.length===0)return"";let t=0,n=0;for(const o of e){if(n+=o.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function cl(e){const t=I.useRef(e);return Xt(e,t.current)||(t.current=e),t.current}function lr(e,t){return Kn.useMemo(()=>e.map((n,o)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:o,sticky:o=r.x&&n=r.y&&o=t.span[0]&&n.current.cell[0]<=t.span[1]}function cr(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&ol)return!1;if(t.span===void 0)return s>=o&&s<=i;const[d,f]=t.span;return d>=o&&d<=i||f>=o&&d<=i||di}function dr(e,t,n,o){let i=0;if(n.current===void 0)return i;const r=n.current.range;(o||r.height*r.width>1)&&Eo(e,t,r)&&i++;for(const l of n.current.rangeStack)Eo(e,t,l)&&i++;return i}function ni(e,t){let n=e;if(t!==void 0){let o=[...e];const i=n[t.src];t.src>t.dest?(o.splice(t.src,1),o.splice(t.dest,0,i)):(o.splice(t.dest+1,0,i),o.splice(t.src,1)),o=o.map((r,l)=>({...r,sticky:e[l].sticky})),n=o}return n}function $t(e,t){let n=0;const o=ni(e,t);for(let i=0;i0)for(const d of l)n-=d.width;let s=t,a=i??0;for(;a<=n&&s=g)return u}const m=r-d,h=e-(a??0);if(typeof l=="number"){const c=Math.floor((h-f)/l)+s;return c>=m?void 0:c}else{let c=f;for(let u=s;u"u";async function gr(){var e;hr||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,pn=0,en={},_i())}gr();function oi(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Vt(e,t,n,o="middle"){const i=oi(e,t,o,n);let r=en[i];return r===void 0&&(r=t.measureText(e),en[i]=r,pn++),pn>1e4&&(en={},pn=0),r}function ii(e,t){const n=oi(e,void 0,"middle",t);return en[n]}function kt(e,t){return typeof t!="string"&&(t=t.baseFontFull),mr(e,t)}function Bo(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const Fo=[];function mr(e,t){for(const r of Fo)if(r.key===t)return r.val;const n=Bo(e,"alphabetic"),i=-(Bo(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Fo.push({key:t,val:i}),i}function yr(e,t,n,o,i,r){const{ctx:l,rect:s,theme:a}=e;let d=Number.MAX_SAFE_INTEGER;const f=500;if(t!==void 0&&(d=n-t,dn&&(e=e.slice(0,n)),e}function vr(e,t,n,o,i,r,l,s,a,d){const f=s.baseFontFull,g=Vi(e,t,f,i-s.cellHorizontalPadding*2,d??!1),m=si(e,f),h=s.lineHeight*m,c=m+h*(g.length-1),u=c+s.cellVerticalPadding>r;u&&(e.save(),e.rect(n,o,i,r),e.clip());const y=o+r/2-c/2;let v=Math.max(o+s.cellVerticalPadding,y);for(const w of g)if(ri(e,w,n,v,i,m,l,s,a),v+=h,v>o+r)break;u&&e.restore()}function ht(e,t,n,o,i){const{ctx:r,rect:l,theme:s}=e,{x:a,y:d,width:f,height:g}=l;o=o??!1,o||(t=br(t,f));const m=kt(r,s),h=eo(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(r.direction="rtl"),t.length>0){let c=!1;n==="right"?(r.textAlign="right",c=!0):n!==void 0&&n!=="left"&&(r.textAlign=n,c=!0),o?vr(r,t,a,d,f,g,m,s,n,i):ri(r,t,a,d,f,g,m,s,n),c&&(r.textAlign="start"),h&&(r.direction="inherit")}}function st(e,t,n,o,i,r){typeof r=="number"&&(r={tl:r,tr:r,br:r,bl:r}),r={tl:Math.max(0,Math.min(r.tl,i/2,o/2)),tr:Math.max(0,Math.min(r.tr,i/2,o/2)),bl:Math.max(0,Math.min(r.bl,i/2,o/2)),br:Math.max(0,Math.min(r.br,i/2,o/2))},e.moveTo(t+r.tl,n),e.arcTo(t+o,n,t+o,n+r.tr,r.tr),e.arcTo(t+o,n+i,t+o-r.br,n+i,r.br),e.arcTo(t,n+i,t,n+i-r.bl,r.bl),e.arcTo(t,n,t+r.tl,n,r.tl)}function pr(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function wr(e,t,n){const o=function(s,a){const d=a.x-s.x,f=a.y-s.y,g=Math.sqrt(d*d+f*f),m=d/g,h=f/g;return{x:d,y:a.y-s.y,len:g,nx:m,ny:h,ang:Math.atan2(h,m)}};let i;const r=t.length;let l=t[r-1];for(let s=0;s1?1:m),u=1,y=!1;h<0?c<0?c=Math.PI+c:(c=Math.PI-c,u=-1,y=!0):c>0&&(u=-1,y=!0),i=a.radius!==void 0?a.radius:n;const v=c/2;let w=Math.abs(Math.cos(v)*i/Math.sin(v)),M;w>Math.min(f.len/2,g.len/2)?(w=Math.min(f.len/2,g.len/2),M=Math.abs(w*Math.sin(v)/Math.cos(v))):M=i;let F=a.x+g.nx*w,P=a.y+g.ny*w;F+=-g.ny*M*u,P+=g.nx*M*u,e.arc(F,P,M,f.ang+Math.PI/2*u,g.ang-Math.PI/2*u,y),l=a,a=d}e.closePath()}function Un(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c){const u={x:0,y:r+d,width:0,height:0};if(e>=h.length||t>=f||t<-2||e<0)return u;const y=r-i;if(e>=g){const v=l>e?-1:1,w=$t(h);u.x+=w+a;for(let M=l;M!==e;M+=v)u.x+=h[v===1?M:M-1].width*v}else for(let v=0;v0&&_n(h[v-1].group,w)&&h[v-1].sticky===M;){const P=h[v-1];u.x-=P.width,u.width+=P.width,v--}let F=e;for(;F+1n&&(u.width=n-u.x)}}else if(t>=f-m){let v=f-t;for(u.y=o;v>0;){const w=t+v-1;u.height=typeof c=="number"?c:c(w),u.y-=u.height,v--}u.height+=1}else{const v=s>t?-1:1;if(typeof c=="number"){const w=t-s;u.y+=w*c}else for(let w=s;w!==t;w+=v)u.y+=c(w)*v;u.height=(typeof c=="number"?c:c(t))+1}return u}const to=1<<21;function tt(e,t){return(t+2)*to+e}function li(e){return e%to}function no(e){return Math.floor(e/to)-2}function oo(e){const t=li(e),n=no(e);return[t,n]}class ai{constructor(){oe(this,"visibleWindow",{x:0,y:0,width:0,height:0});oe(this,"freezeCols",0);oe(this,"freezeRows",[]);oe(this,"isInWindow",t=>{const n=li(t),o=no(t),i=this.visibleWindow,r=n>=i.x&&n<=i.x+i.width||n=i.y&&o<=i.y+i.height||this.freezeRows.includes(o);return r&&l})}setWindow(t,n,o){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Xt(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class kr extends ai{constructor(){super(...arguments);oe(this,"cache",new Map);oe(this,"setValue",(n,o)=>{this.cache.set(tt(n[0],n[1]),o)});oe(this,"getValue",n=>this.cache.get(tt(n[0],n[1])));oe(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class tn{constructor(t=[]){oe(this,"cells");this.cells=new Set(t.map(n=>tt(n[0],n[1])))}add(t){this.cells.add(tt(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(tt(t[0],t[1]))}remove(t){this.cells.delete(tt(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(no(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{u.drawImage(y,0,0,g,g)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(o.globalAlpha=a),o.drawImage(h,0,0,g,g,i,r,l,l),a<1&&(o.globalAlpha=1)}}const Rn={};let wt=null;function Sr(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function qn(e){const t=e.toLowerCase().trim();if(Rn[t]!==void 0)return Rn[t];wt=wt||Sr(),wt.style.color="#000",wt.style.color=t;const n=getComputedStyle(wt).color;wt.style.color="#fff",wt.style.color=t;const o=getComputedStyle(wt).color;if(o!==n)return[0,0,0,1];let i=o.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(r=>Number.isNaN(r)?0:r),Rn[t]=i,i}function sn(e,t){const[n,o,i]=qn(e);return`rgba(${n}, ${o}, ${i}, ${t})`}const Ao=new Map;function Do(e,t){const n=`${e}-${t}`,o=Ao.get(n);if(o!==void 0)return o;const i=Ue(e,t);return Ao.set(n,i),i}function Ue(e,t){if(t===void 0)return e;const[n,o,i,r]=qn(e);if(r===1)return e;const[l,s,a,d]=qn(t),f=r+d*(1-r),g=(r*n+d*l*(1-r))/f,m=(r*o+d*s*(1-r))/f,h=(r*i+d*a*(1-r))/f;return`rgba(${g}, ${m}, ${h}, ${f})`}function ci(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function xn(e,t,n,o,i,r,l,s,a){s=s??t;let d=t,f=e;const g=o-r;let m=!1;for(;ds&&a(d,f,h,!1,l&&f===o-1)===!0){m=!0;break}d+=h,f++}if(!m){d=n;for(let h=0;h!h.sticky))==null?void 0:m.sourceIndex)??0;if(a>g){const h=Math.max(s,g);let c=t,u=o;for(let y=r.sourceIndex-1;y>=h;y--)c-=l[y].width,u+=l[y].width;for(let y=r.sourceIndex+1;y<=a;y++)u+=l[y].width;f={x:c,y:n,width:u,height:i}}if(g>s){const h=Math.min(a,g-1);let c=t,u=o;for(let y=r.sourceIndex-1;y>=s;y--)c-=l[y].width,u+=l[y].width;for(let y=r.sourceIndex+1;y<=h;y++)u+=l[y].width;d={x:c,y:n,width:u,height:i}}return[d,f]}function ul(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const fi={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4};function fl(){return fi}const hl=Kn.createContext(fi);function Yt(e,...t){const n={...e};for(const o of t)if(o!==void 0)for(const i in o)o.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Ue(o[i],n[i]):n[i]=o[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function gl(e,t,n,o){if(o==="any")return Ir(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),cr([t,n],e))return;const i=t-e.x,r=e.x+e.width-t,l=n-e.y+1,s=e.y+e.height-n,a=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="horizontal"?Number.MAX_SAFE_INTEGER:l,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return a===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:a===l?{x:e.x,y:n,width:e.width,height:e.y-n}:a===r?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function on(e,t,n,o,i,r,l,s){return e<=i+l&&i<=e+n&&t<=r+s&&r<=t+o}function Ot(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Ir(e,t){const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,r=Math.max(e.y+e.height,t.y+t.height)-o;return{x:n,y:o,width:i,height:r}}function Mr(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Er(e,t,n,o){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,r=-4,l=t+4,s=n+4,a=i-e.x,d=e.x+e.width-l,f=r-e.y,g=e.y+e.height-s,m=a>0?e.x+Math.floor(a/o)*o:e.x,h=d>0?e.x+e.width-Math.floor(d/o)*o:e.x+e.width,c=f>0?e.y+Math.floor(f/o)*o:e.y,u=g>0?e.y+e.height-Math.floor(g/o)*o:e.y+e.height;return{x:m,y:c,width:h-m,height:u-c}}function Br(e,t,n,o,i){const[r,l,s,a]=t,[d,f,g,m]=i,{x:h,y:c,width:u,height:y}=e,v=[];if(u<=0||y<=0)return v;const w=h+u,M=c+y,F=hs,A=c+y>a,W=h>=r&&hr&&w<=s||hs,C=c>=l&&cl&&M<=a||ca;if(W&&C){const B=Math.max(h,r),x=Math.max(c,l),k=Math.min(w,s),p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:f,width:g-d+1,height:m-f+1}})}if(F&&P){const B=h,x=c,k=Math.min(w,r),p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:0,width:d+1,height:f+1}})}if(P&&W){const B=Math.max(h,r),x=c,k=Math.min(w,s),p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:0,width:g-d+1,height:f+1}})}if(P&&S){const B=Math.max(h,s),x=c,k=w,p=Math.min(M,l);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:0,width:n-g+1,height:f+1}})}if(F&&C){const B=h,x=Math.max(c,l),k=Math.min(w,r),p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:f,width:d+1,height:m-f+1}})}if(S&&C){const B=Math.max(h,s),x=Math.max(c,l),k=w,p=Math.min(M,a);v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:f,width:n-g+1,height:m-f+1}})}if(F&&A){const B=h,x=Math.max(c,a),k=Math.min(w,r),p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:0,y:m,width:d+1,height:o-m+1}})}if(A&&W){const B=Math.max(h,r),x=Math.max(c,a),k=Math.min(w,s),p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:d,y:m,width:g-d+1,height:o-m+1}})}if(S&&A){const B=Math.max(h,s),x=Math.max(c,a),k=w,p=M;v.push({rect:{x:B,y:x,width:k-B,height:p-x},clip:{x:g,y:m,width:n-g+1,height:o-m+1}})}return v}const Fr={kind:ae.Loading,allowOverlay:!1};function Po(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w,M,F,P,S,A,W,C,H,B,x,k,p,q,V,U,ce){let se=(M==null?void 0:M.size)??Number.MAX_SAFE_INTEGER;const he=performance.now();let ge=k.baseFontFull;e.font=ge;const Ne={ctx:e},K=[0,0],De=y>0?_t(a,y,d):0;let Se,O;const we=ci(w);return xt(t,s,r,l,i,(J,Ie,qe,lt,Ct)=>{const at=Math.max(0,lt-Ie),je=Ie+at,ye=i+1,mt=J.width-at,yt=o-i-1;if(w.length>0){let xe=!1;for(let le=0;le{e.save(),e.beginPath(),e.rect(je,ye,mt,yt),e.clip()},de=F.columns.hasIndex(J.sourceIndex),$e=g(J.group??"").overrideTheme,Me=J.themeOverride===void 0&&$e===void 0?k:Yt(k,$e,J.themeOverride),We=Me.baseFontFull;We!==ge&&(ge=We,e.font=We),Xe();let Q;return xn(Ct,qe,o,a,d,y,v,we,(xe,le,be,L,j)=>{var It,nt,ot;if(le<0||(K[0]=J.sourceIndex,K[1]=le,M!==void 0&&!M.has(K)))return;if(w.length>0){let ne=!1;for(let Be=0;Beie.span!==void 0&&ne>=ie.span[0]&&ne<=ie.span[1]);Ke&&!c&&u?ze=0:Ke&&u&&(ze=Math.max(ze,1)),Dt&&ze++,Ke||(ue&&ze++,de&&!j&&ze++);const Pt=ie.kind===ae.Protected?Ee.bgCellMedium:Ee.bgCell;let ve;if((L||Pt!==k.bgCell)&&(ve=Ue(Pt,ve)),ze>0||te){te&&(ve=Ue(Ee.bgHeader,ve));for(let ne=0;nece&&!Te){const ne=Ee.baseFontFull;ne!==ge&&(e.font=ne,ge=ne),Q=hi(e,ie,J.sourceIndex,le,ct,pe,Ce,xe,fe,be,ze>0,Ee,ve??Ee.bgCell,A,W,(Oe==null?void 0:Oe.hoverAmount)??0,H,x,he,B,Q,p,q,V,U)}return St&&e.restore(),ie.style==="faded"&&(e.globalAlpha=1),se--,G&&(e.restore(),(ot=Q==null?void 0:Q.deprep)==null||ot.call(Q,Ne),Q=void 0,Xe(),ge=We,e.font=We),se<=0}),e.restore(),se<=0}),Se}const Gt=[0,0],Jt={x:0,y:0,width:0,height:0},Tn=[void 0,()=>{}];let jn=!1;function Ar(){jn=!0}function hi(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w,M,F,P,S,A,W){var q,V;let C,H;y!==void 0&&y[0][0]===n&&y[0][1]===o&&(C=y[1][0],H=y[1][1]);let B;Gt[0]=n,Gt[1]=o,Jt.x=l,Jt.y=s,Jt.width=a,Jt.height=d,Tn[0]=S.getValue(Gt),Tn[1]=U=>S.setValue(Gt,U),jn=!1;const x={ctx:e,theme:g,col:n,row:o,cell:t,rect:Jt,highlighted:f,cellFillColor:m,hoverAmount:u,frameTime:w,hoverX:C,drawState:Tn,hoverY:H,imageLoader:h,spriteManager:c,hyperWrapping:v,overrideCursor:C!==void 0?W:void 0,requestAnimationFrame:Ar},k=yr(x,t.lastUpdated,w,F,i,r),p=A(t);if(p!==void 0){(F==null?void 0:F.renderer)!==p&&((q=F==null?void 0:F.deprep)==null||q.call(F,x),F=void 0);const U=(V=p.drawPrep)==null?void 0:V.call(p,x,F);M!==void 0&&!Ko(x.cell)?M(x,()=>p.draw(x,t)):p.draw(x,t),B=U===void 0?void 0:{deprep:U==null?void 0:U.deprep,fillStyle:U==null?void 0:U.fillStyle,font:U==null?void 0:U.font,renderer:p}}return(k||jn)&&(P==null||P(Gt)),B}function io(e,t,n,o,i,r,l,s,a=-20,d=-20,f=32,g="center",m="square"){const h=Math.floor(i+l/2),c=m==="circle"?1e4:t.roundingRadius??4;let u=Qo(f,l,t.cellVerticalPadding),y=u/2;const v=Jo(g,o,r,t.cellHorizontalPadding,u),w=Go(v,h,u),M=Zo(o+a,i+d,w);switch(n){case!0:{e.beginPath(),st(e,v-u/2,h-u/2,u,u,c),m==="circle"&&(y*=.8,u*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+u/4.23,h-y+u/1.97),e.lineTo(v-y+u/2.42,h-y+u/1.44),e.lineTo(v-y+u/1.29,h-y+u/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case kn:case!1:{e.beginPath(),st(e,v-u/2+.5,h-u/2+.5,u-1,u-1,c),e.lineWidth=1,e.strokeStyle=M?t.textDark:t.textMedium,e.stroke();break}case Jn:{e.beginPath(),st(e,v-u/2,h-u/2,u,u,c),e.fillStyle=M?t.textMedium:t.textLight,e.fill(),m==="circle"&&(y*=.8,u*=.8),e.beginPath(),e.moveTo(v-u/3,h),e.lineTo(v+u/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Gn()}}function Dr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){var C,H,B,x;const M=l+s;if(M<=0)return;e.fillStyle=g.bgHeader,e.fillRect(0,0,i,M);const F=(C=o==null?void 0:o[0])==null?void 0:C[0],P=(H=o==null?void 0:o[0])==null?void 0:H[1],S=(B=o==null?void 0:o[1])==null?void 0:B[0],A=(x=o==null?void 0:o[1])==null?void 0:x[1],W=g.headerFontFull;e.font=W,xt(t,0,r,0,M,(k,p,q,V)=>{var J;if(y!==void 0&&!y.has([k.sourceIndex,-1]))return;const U=Math.max(0,V-p);e.save(),e.beginPath(),e.rect(p+U,s,k.width-U,l),e.clip();const ce=u(k.group??"").overrideTheme,se=k.themeOverride===void 0&&ce===void 0?g:Yt(g,ce,k.themeOverride);se.bgHeader!==g.bgHeader&&(e.fillStyle=se.bgHeader,e.fill()),se!==g&&(e.font=se.baseFontFull);const he=f.columns.hasIndex(k.sourceIndex),ge=a!==void 0||d,Ne=!ge&&P===-1&&F===k.sourceIndex,K=ge?0:((J=h.find(Ie=>Ie.item[0]===k.sourceIndex&&Ie.item[1]===-1))==null?void 0:J.hoverAmount)??0,De=(f==null?void 0:f.current)!==void 0&&f.current.cell[0]===k.sourceIndex,Se=he?se.accentColor:De?se.bgHeaderHasFocus:se.bgHeader,O=n?s:0,we=k.sourceIndex===0?0:1;he?(e.fillStyle=Se,e.fillRect(p+we,O,k.width-we,l)):(De||K>0)&&(e.beginPath(),e.rect(p+we,O,k.width-we,l),De&&(e.fillStyle=se.bgHeaderHasFocus,e.fill()),K>0&&(e.globalAlpha=K,e.fillStyle=se.bgHeaderHovered,e.fill(),e.globalAlpha=1)),yi(e,p,O,k.width,l,k,he,se,Ne,Ne?S:void 0,Ne?A:void 0,De,K,m,v,w),e.restore()}),n&&Pr(e,t,i,r,s,o,g,m,h,c,u,y)}function Pr(e,t,n,o,i,r,l,s,a,d,f,g){const[h,c]=(r==null?void 0:r[0])??[];let u=0;di(t,n,o,i,(y,v,w,M,F,P)=>{if(g!==void 0&&!g.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(w,M,F,P),e.clip();const S=f(v),A=(S==null?void 0:S.overrideTheme)===void 0?l:Yt(l,S.overrideTheme),W=c===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=W?A.bgHeaderHovered:A.bgHeader;if(C!==l.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=A.textGroupHeader??A.textHeader,S!==void 0){let H=w;if(S.icon!==void 0&&(s.drawSprite(S.icon,"normal",e,H+8,(i-20)/2,20,A),H+=26),e.fillText(S.name,H+8,i/2+kt(e,l.headerFontFull)),S.actions!==void 0&&W){const B=gi({x:w,y:M,width:F,height:P},S.actions);e.beginPath();const x=B[0].x-10,k=w+F-x;e.rect(x,0,k,i);const p=e.createLinearGradient(x,0,x+k,0),q=sn(C,0);p.addColorStop(0,q),p.addColorStop(10/k,C),p.addColorStop(1,C),e.fillStyle=p,e.fill(),e.globalAlpha=.6;const[V,U]=(r==null?void 0:r[1])??[-1,-1];for(let ce=0;ce35){const M=c?35:o-35,F=c?35*.7:o-35*.7,P=M/o,S=F/o,A=e.createLinearGradient(t,0,t+o,0),W=sn(y,0);A.addColorStop(c?1:0,y),A.addColorStop(P,y),A.addColorStop(S,W),A.addColorStop(c?0:1,W),e.fillStyle=A}else e.fillStyle=y;if(c&&(e.textAlign="right"),u.textBounds!==void 0&&e.fillText(r.title,c?u.textBounds.x+u.textBounds.width:u.textBounds.x,n+i/2+kt(e,s.headerFontFull)),c&&(e.textAlign="left"),r.indicatorIcon!==void 0&&u.indicatorIconBounds!==void 0&&(!v||!on(u.menuBounds.x,u.menuBounds.y,u.menuBounds.width,u.menuBounds.height,u.indicatorIconBounds.x,u.indicatorIconBounds.y,u.indicatorIconBounds.width,u.indicatorIconBounds.height))){let w=l?"selected":"normal";r.style==="highlight"&&(w=l?"selected":"special"),m.drawSprite(r.indicatorIcon,w,e,u.indicatorIconBounds.x,u.indicatorIconBounds.y,u.indicatorIconBounds.width,s)}if(v&&u.menuBounds!==void 0){const w=u.menuBounds,M=d!==void 0&&f!==void 0&&Ot(w,d+t,f+n);if(M||(e.globalAlpha=.7),r.menuIcon===void 0||r.menuIcon===$n.Triangle){e.beginPath();const F=w.x+w.width/2-5.5,P=w.y+w.height/2-3;wr(e,[{x:F,y:P},{x:F+11,y:P},{x:F+5.5,y:P+6}],1),e.fillStyle=y,e.fill()}else if(r.menuIcon===$n.Dots){e.beginPath();const F=w.x+w.width/2,P=w.y+w.height/2;pr(e,F,P),e.fillStyle=y,e.fill()}else{const F=w.x+(w.width-s.headerIconSize)/2,P=w.y+(w.height-s.headerIconSize)/2;m.drawSprite(r.menuIcon,"normal",e,F,P,s.headerIconSize,s)}M||(e.globalAlpha=1)}}function yi(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u){const y=eo(r.title)==="rtl",v=mi(e,r,t,n,o,i,s,y);c!==void 0?c({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:i},column:r,columnIndex:r.sourceIndex,isSelected:l,hoverAmount:m,isHovered:a,hasSelectedCell:g,spriteManager:h,menuBounds:(v==null?void 0:v.menuBounds)??{x:0,y:0,height:0,width:0}},()=>Ho(e,t,n,o,i,r,l,s,a,d,f,m,h,u,y,v)):Ho(e,t,n,o,i,r,l,s,a,d,f,m,h,u,y,v)}function Rr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const M=ci(y);xt(t,a,l,s,r,(F,P,S,A,W)=>{if(F!==t[t.length-1])return;P+=F.width;const C=Math.max(P,A);C>o||(e.save(),e.beginPath(),e.rect(C,r+1,1e4,i-r-1),e.clip(),xn(W,S,i,d,f,c,u,M,(H,B,x,k)=>{if(!k&&y.length>0&&!y.some(ce=>on(P,H,1e4,x,ce.x,ce.y,ce.width,ce.height)))return;const p=m.hasIndex(B),q=h.hasIndex(B);e.beginPath();const V=g==null?void 0:g(B),U=V===void 0?w:Yt(w,V);U.bgCell!==w.bgCell&&(e.fillStyle=U.bgCell,e.fillRect(P,H,1e4,x)),q&&(e.fillStyle=U.bgHeader,e.fillRect(P,H,1e4,x)),p&&(e.fillStyle=U.accentLight,e.fillRect(P,H,1e4,x))}),e.restore())})}function Tr(e,t,n,o,i,r,l,s,a){let d=!1;for(const c of t)if(!c.sticky){d=l(c.sourceIndex);break}const f=a.horizontalBorderColor??a.borderColor,g=a.borderColor,m=d?$t(t):0;let h;if(m!==0&&(h=Do(g,a.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=h,e.stroke()),i>0){const c=g===f&&h!==void 0?h:Do(f,a.bgCell),u=_t(r,i,s);e.beginPath(),e.moveTo(0,o-u+.5),e.lineTo(n,o-u+.5),e.strokeStyle=c,e.stroke()}}const bi=(e,t,n)=>{let o=0,i=t,r=0,l=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const s of e)o=Math.min(o,s.x-1),i=Math.max(i,s.x+s.width+1),r=Math.min(r,s.y-1),l=Math.max(l,s.y+s.height+1)}return{minX:o,maxX:i,minY:r,maxY:l}};function Wr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c){var x;const u=c.bgCell,{minX:y,maxX:v,minY:w,maxY:M}=bi(s,r,l),F=[],P=l-_t(h,m,d);let S=a,A=n,W=0;for(;S+i=w&&k<=M-1){const q=f==null?void 0:f(A),V=q==null?void 0:q.bgCell;V!==void 0&&V!==u&&A>=h-m&&F.push({x:y,y:k,w:v-y,h:p,color:V})}S+=p,A0)for(let k=0;k=y&&q<=v&&g(k+1)&&F.push({x:q,y:W,w:p.width,h:H,color:V}),C+=p.width}if(F.length===0)return;let B;e.beginPath();for(let k=F.length-1;k>=0;k--){const p=F[k];B===void 0?B=p.color:p.color!==B&&(e.fillStyle=B,e.fill(),e.beginPath(),B=p.color),e.rect(p.x,p.y,p.w,p.h)}B!==void 0&&(e.fillStyle=B,e.fill()),e.beginPath()}function Ro(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,r,l);for(const x of a)e.rect(x.x+1,x.y+1,x.width-1,x.height-1);e.clip("evenodd")}const w=y.horizontalBorderColor??y.borderColor,M=y.borderColor,{minX:F,maxX:P,minY:S,maxY:A}=bi(s,r,l),W=[];e.beginPath();let C=.5;for(let x=0;x=F&&p<=P&&h(x+1)&&W.push({x1:p,y1:Math.max(d,S),x2:p,y2:Math.min(l,A),color:M})}let H=l+.5;for(let x=u-c;x=S&&q<=A-1){const V=m==null?void 0:m(k);W.push({x1:F,y1:q,x2:P,y2:q,color:(V==null?void 0:V.horizontalBorderColor)??(V==null?void 0:V.borderColor)??w})}x+=g(k),k++}}const B=Ui(W,x=>x.color);for(const x of Object.keys(B)){e.strokeStyle=x;for(const k of B[x])e.moveTo(k.x1,k.y1),e.lineTo(k.x2,k.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function zr(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y,v,w){const M=[];e.imageSmoothingEnabled=!1;const F=Math.min(i.cellYOffset,l),P=Math.max(i.cellYOffset,l);let S=0;if(typeof v=="number")S+=(P-F)*v;else for(let p=F;pi.cellYOffset&&(S=-S),S+=a-i.translateY;const A=Math.min(i.cellXOffset,r),W=Math.max(i.cellXOffset,r);let C=0;for(let p=A;pi.cellXOffset&&(C=-C),C+=s-i.translateX;const H=$t(y);if(C!==0&&S!==0)return{regions:[]};const B=d>0?_t(m,d,v):0,x=f-H-Math.abs(C),k=g-h-B-Math.abs(S)-1;if(x>150&&k>150){const p={sx:0,sy:0,sw:f*c,sh:g*c,dx:0,dy:0,dw:f*c,dh:g*c};if(S>0?(p.sy=(h+1)*c,p.sh=k*c,p.dy=(S+h+1)*c,p.dh=k*c,M.push({x:0,y:h,width:f,height:S+1})):S<0&&(p.sy=(-S+h+1)*c,p.sh=k*c,p.dy=(h+1)*c,p.dh=k*c,M.push({x:0,y:g+S-B,width:f,height:-S+B})),C>0?(p.sx=H*c,p.sw=x*c,p.dx=(C+H)*c,p.dw=x*c,M.push({x:H-1,y:0,width:C+2,height:g})):C<0&&(p.sx=(H-C)*c,p.sw=x*c,p.dx=H*c,p.dw=x*c,M.push({x:f+C,y:0,width:-C,height:g})),e.setTransform(1,0,0,1,0,0),w){if(H>0&&C!==0&&S===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const q=H*c,V=g*c;e.drawImage(t,0,0,q,V,0,0,q,V)}if(B>0&&C===0&&S!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const q=(g-B)*c,V=f*c,U=B*c;e.drawImage(t,0,q,V,U,0,q,V,U)}}e.drawImage(t,p.sx,p.sy,p.sw,p.sh,p.dx,p.dy,p.dw,p.dh),e.scale(c,c)}return e.imageSmoothingEnabled=!0,{regions:M}}function Lr(e,t,n,o,i,r,l,s,a,d){const f=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||i!==e.translateY||xt(a,n,o,i,s,(g,m,h,c)=>{if(g.sourceIndex===d){const u=Math.max(m,c)+1;return f.push({x:u,y:0,width:r-u,height:l}),!0}}),f}function Nr(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let o=0;oA.style!=="no-outline");if(y===void 0||y.length===0)return;const v=$t(s),w=_t(h,m,g),M=[a,0,s.length,h-m],F=[v,0,t,n-w],P=y.map(A=>{const W=A.range,C=A.style??"dashed";return Br(W,M,t,n,F).map(H=>{const B=H.rect,x=Un(B.x,B.y,t,n,f,d+f,o,i,r,l,h,a,m,s,g),k=B.width===1&&B.height===1?x:Un(B.x+B.width-1,B.y+B.height-1,t,n,f,d+f,o,i,r,l,h,a,m,s,g);return B.x+B.width>=s.length&&(k.width-=1),B.y+B.height>=h&&(k.height-=1),{color:A.color,style:C,clip:H.clip,rect:Er({x:x.x,y:x.y,width:k.x+k.width-x.x,height:k.y+k.height-x.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let A=!1;for(const W of P)for(const C of W)if((C==null?void 0:C.rect)!==void 0&&on(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const H=A,B=!Mr(C.clip,C.rect);B&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!A?(e.setLineDash([5,3]),A=!0):(C.style==="solid"||C.style==="solid-outline")&&A&&(e.setLineDash([]),A=!1),e.strokeStyle=C.style==="solid-outline"?Ue(Ue(C.color,u.borderColor),u.bgCell):sn(C.color,1),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),B&&(e.restore(),A=H)}A&&e.setLineDash([])};return S(),S}function Wo(e,t,n,o,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,o),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function Wn(e,t,n,o,i,r,l,s,a,d,f,g,m,h,c,u,y){if(f.current===void 0)return;const v=f.current.range,w=f.current.cell,M=[v.x+v.width-1,v.y+v.height-1];if(w[1]>=y&&M[1]>=y||!l.some(p=>p.sourceIndex===w[0]||p.sourceIndex===M[0]))return;const[P,S]=f.current.cell,A=m(f.current.cell),W=A.span??[P,P],C=S>=y-h,H=h>0&&!C?_t(y,h,g)-1:0,B=M[1];let x;if(xt(l,o,i,r,d,(p,q,V,U,ce)=>{if(p.sticky&&P>p.sourceIndex)return;const se=p.sourceIndexW[1],ge=p.sourceIndex===M[0];if(!(!ge&&(se||he)))return xn(ce,V,n,y,g,h,c,void 0,(Ne,K,De)=>{if(K!==S&&K!==B)return;let Se=q,O=p.width;if(A.span!==void 0){const J=ui(A.span,q,Ne,p.width,De,p,s),Ie=p.sticky?J[0]:J[1];Ie!==void 0&&(Se=Ie.x,O=Ie.width)}return K===B&&ge&&u&&(x=()=>{var J;U>Se&&!p.sticky&&(e.beginPath(),e.rect(U,0,t-U,n),e.clip()),e.beginPath(),e.rect(Se+O-4,Ne+De-4,4,4),e.fillStyle=((J=p.themeOverride)==null?void 0:J.accentColor)??a.accentColor,e.fill()}),x!==void 0}),x!==void 0}),x===void 0)return;const k=()=>{e.save(),e.beginPath(),e.rect(0,d,t,n-d-H),e.clip(),x==null||x(),e.restore()};return k(),k}function Or(e,t,n,o,i,r,l,s,a){a===void 0||a.size===0||(e.beginPath(),di(t,n,r,o,(d,f,g,m,h,c)=>{a.hasItemInRectangle({x:d[0],y:-2,width:d[1]-d[0]+1,height:1})&&e.rect(g,m,h,c)}),xt(t,s,r,l,i,(d,f,g,m)=>{const h=Math.max(0,m-f),c=f+h+1,u=d.width-h-1;a.has([d.sourceIndex,-1])&&e.rect(c,o,u,i-o)}),e.clip())}function Xr(e,t,n,o,i,r,l,s,a,d){let f=0;return xt(e,r,o,i,n,(g,m,h,c,u)=>(xn(u,h,t,l,s,a,d,void 0,(y,v,w,M)=>{M||(f=Math.max(v,f))}),!0)),f}function zo(e,t){var ct;const{canvasCtx:n,headerCanvasCtx:o,width:i,height:r,cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mappedColumns:f,enableGroups:g,freezeColumns:m,dragAndDropState:h,theme:c,drawFocus:u,headerHeight:y,groupHeaderHeight:v,disabledRows:w,rowHeight:M,verticalBorder:F,overrideCursor:P,isResizing:S,selection:A,fillHandle:W,freezeTrailingRows:C,rows:H,getCellContent:B,getGroupDetails:x,getRowThemeOverride:k,isFocused:p,drawHeaderCallback:q,prelightCells:V,drawCellCallback:U,highlightRegions:ce,resizeCol:se,imageLoader:he,lastBlitData:ge,hoverValues:Ne,hyperWrapping:K,hoverInfo:De,spriteManager:Se,maxScaleFactor:O,hasAppendRow:we,touchMode:J,enqueue:Ie,renderStateProvider:qe,getCellRenderer:lt,renderStrategy:Ct,bufferACtx:at,bufferBCtx:je,damage:ye,minimumCellWidth:mt,resizeIndicator:yt}=e;if(i===0||r===0)return;const Xe=Ct==="double-buffer",de=Math.min(O,Math.ceil(window.devicePixelRatio??1)),$e=Ct!=="direct"&&Nr(e,t),Me=n.canvas;(Me.width!==i*de||Me.height!==r*de)&&(Me.width=i*de,Me.height=r*de,Me.style.width=i+"px",Me.style.height=r+"px");const We=o.canvas,Q=g?v+y:y,xe=Q+1;(We.width!==i*de||We.height!==xe*de)&&(We.width=i*de,We.height=xe*de,We.style.width=i+"px",We.style.height=xe+"px");const le=at.canvas,be=je.canvas;Xe&&(le.width!==i*de||le.height!==r*de)&&(le.width=i*de,le.height=r*de,ge.current!==void 0&&(ge.current.aBufferScroll=void 0)),Xe&&(be.width!==i*de||be.height!==r*de)&&(be.width=i*de,be.height=r*de,ge.current!==void 0&&(ge.current.bBufferScroll=void 0));const L=ge.current;if($e===!0&&l===(L==null?void 0:L.cellXOffset)&&s===(L==null?void 0:L.cellYOffset)&&a===(L==null?void 0:L.translateX)&&d===(L==null?void 0:L.translateY))return;let j=null;Xe&&(j=n);const ue=o;let te;Xe?ye!==void 0?te=(L==null?void 0:L.lastBuffer)==="b"?je:at:te=(L==null?void 0:L.lastBuffer)==="b"?at:je:te=n;const ie=te.canvas,Ce=Xe?ie===le?be:le:Me,fe=typeof M=="number"?()=>M:M;ue.save(),te.save(),ue.beginPath(),te.beginPath(),ue.textBaseline="middle",te.textBaseline="middle",de!==1&&(ue.scale(de,de),te.scale(de,de));const G=Vn(f,l,i,h,a);let Te=[];const Ye=u&&((ct=A.current)==null?void 0:ct.cell[1])===s&&d===0;let _e=!1;if(ce!==void 0){for(const pe of ce)if(pe.style!=="no-outline"&&pe.range.y===s&&d===0){_e=!0;break}}const Ee=()=>{Dr(ue,G,g,De,i,a,y,v,h,S,A,c,Se,Ne,F,x,ye,q,J),Ro(ue,G,s,a,d,i,r,void 0,void 0,v,Q,fe,k,F,C,H,c,!0),ue.beginPath(),ue.moveTo(0,xe-.5),ue.lineTo(i,xe-.5),ue.strokeStyle=Ue(c.headerBottomBorderColor??c.horizontalBorderColor??c.borderColor,c.bgHeader),ue.stroke(),_e&&To(ue,i,r,l,s,a,d,f,m,y,v,M,C,H,ce,c),Ye&&Wn(ue,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H)};if(ye!==void 0){const pe=G[G.length-1].sourceIndex+1,Oe=ye.hasItemInRegion([{x:l,y:-2,width:pe,height:2},{x:l,y:s,width:pe,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:l,y:H-C,width:pe,height:C,when:C>0}]),It=nt=>{Po(nt,G,f,r,Q,a,d,s,H,fe,B,x,k,w,p,u,C,we,Te,ye,A,V,ce,he,Se,Ne,De,U,K,c,Ie,qe,lt,P,mt);const ot=A.current;W&&u&&ot!==void 0&&ye.has(ti(ot.range))&&Wn(nt,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H)};Oe&&(It(te),j!==null&&(j.save(),j.scale(de,de),j.textBaseline="middle",It(j),j.restore()),ye.hasHeader()&&(Or(ue,G,i,v,Q,a,d,s,ye),Ee())),te.restore(),ue.restore();return}if(($e!==!0||l!==(L==null?void 0:L.cellXOffset)||a!==(L==null?void 0:L.translateX)||Ye!==(L==null?void 0:L.mustDrawFocusOnHeader)||_e!==(L==null?void 0:L.mustDrawHighlightRingsOnHeader))&&Ee(),$e===!0){ft(Ce!==void 0&&L!==void 0);const{regions:pe}=zr(te,Ce,Ce===le?L.aBufferScroll:L.bBufferScroll,Ce===le?L.bBufferScroll:L.aBufferScroll,L,l,s,a,d,C,i,r,H,Q,de,f,G,M,Xe);Te=pe}else $e!==!1&&(ft(L!==void 0),Te=Lr(L,l,s,a,d,i,r,Q,G,$e));Tr(te,G,i,r,C,H,F,fe,c);const Ke=To(te,i,r,l,s,a,d,f,m,y,v,M,C,H,ce,c),ze=u?Wn(te,i,r,s,a,d,G,f,c,Q,A,fe,B,C,we,W,H):void 0;if(te.fillStyle=c.bgCell,Te.length>0){te.beginPath();for(const pe of Te)te.rect(pe.x,pe.y,pe.width,pe.height);te.clip(),te.fill(),te.beginPath()}else te.fillRect(0,0,i,r);const Dt=Po(te,G,f,r,Q,a,d,s,H,fe,B,x,k,w,p,u,C,we,Te,ye,A,V,ce,he,Se,Ne,De,U,K,c,Ie,qe,lt,P,mt);Rr(te,G,f,i,r,Q,a,d,s,H,fe,k,A.rows,w,C,we,Te,ye,c),Wr(te,G,s,a,d,i,r,Te,Q,fe,k,F,C,H,c),Ro(te,G,s,a,d,i,r,Te,Dt,v,Q,fe,k,F,C,H,c),Ke==null||Ke(),ze==null||ze(),S&&yt!=="none"&&xt(G,0,a,0,Q,(pe,Oe)=>pe.sourceIndex===se?(Wo(ue,Oe+pe.width,0,Q+1,Ue(c.resizeIndicatorColor??c.accentLight,c.bgHeader)),yt==="full"&&Wo(te,Oe+pe.width,Q,r,Ue(c.resizeIndicatorColor??c.accentLight,c.bgCell)),!0):!1),j!==null&&(j.fillStyle=c.bgCell,j.fillRect(0,0,i,r),j.drawImage(te.canvas,0,0));const Pt=Xr(G,r,Q,a,d,s,H,fe,C,we);he==null||he.setWindow({x:l,y:s,width:G.length,height:Pt-s},m,Array.from({length:C},(pe,Oe)=>H-1-Oe));const ve=L!==void 0&&(l!==L.cellXOffset||a!==L.translateX),St=L!==void 0&&(s!==L.cellYOffset||d!==L.translateY);ge.current={cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mustDrawFocusOnHeader:Ye,mustDrawHighlightRingsOnHeader:_e,lastBuffer:Xe?ie===le?"a":"b":void 0,aBufferScroll:ie===le?[ve,St]:L==null?void 0:L.aBufferScroll,bBufferScroll:ie===be?[ve,St]:L==null?void 0:L.bBufferScroll},te.restore(),ue.restore()}const $r=80;function Yr(e){const t=e-1;return t*t*t+1}class _r{constructor(t){oe(this,"currentHoveredItem");oe(this,"leavingItems",[]);oe(this,"lastAnimationTime");oe(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>vn(o.item,t.item))||this.leavingItems.push(t)});oe(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>vn(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});oe(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});oe(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});oe(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Yr(t.hoverAmount)})));oe(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/$r;for(const r of this.leavingItems)r.hoverAmount=wn(r.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=wn(this.currentHoveredItem.hoverAmount+o,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});oe(this,"setHovered",t=>{var n;if(!vn((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const o=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:o}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class Vr{constructor(t){oe(this,"fn");oe(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ro(e){return new Vr(e)}const Ur=ro(()=>window.navigator.userAgent.includes("Firefox")),Lo=ro(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ml=ro(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function qr(e){const t=I.useRef([]),n=I.useRef(0),o=I.useRef(e);o.current=e;const i=I.useCallback(()=>{const r=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(oo);t.current=[],o.current(new tn(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?r:l)},[]);return I.useCallback(r=>{t.current.length===0&&i();const l=tt(r[0],r[1]);t.current.includes(l)||t.current.push(l)},[i])}const At="header",Nt="group-header",No="out-of-bounds";var Zt=(e=>(e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End",e))(Zt||{});function jr(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const Oo=6,Kr=(e,t)=>{if(e.kind===ae.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},Gr=(e,t)=>{const{width:n,height:o,accessibilityHeight:i,columns:r,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:d=!1,groupHeaderHeight:f,rowHeight:g,rows:m,getCellContent:h,getRowThemeOverride:c,onHeaderMenuClick:u,onHeaderIndicatorClick:y,enableGroups:v,isFilling:w,onCanvasFocused:M,onCanvasBlur:F,isFocused:P,selection:S,freezeColumns:A,onContextMenu:W,freezeTrailingRows:C,fixedShadowX:H=!0,fixedShadowY:B=!0,drawFocusRing:x,onMouseDown:k,onMouseUp:p,onMouseMoveRaw:q,onMouseMove:V,onItemHovered:U,dragAndDropState:ce,firstColAccessible:se,onKeyDown:he,onKeyUp:ge,highlightRegions:Ne,canvasRef:K,onDragStart:De,onDragEnd:Se,eventTargetRef:O,isResizing:we,resizeColumn:J,isDragging:Ie,isDraggable:qe=!1,allowResize:lt,disabledRows:Ct,hasAppendRow:at,getGroupDetails:je,theme:ye,prelightCells:mt,headerIcons:yt,verticalBorder:Xe,drawCell:de,drawHeader:$e,onCellFocused:Me,onDragOverCell:We,onDrop:Q,onDragLeave:xe,imageWindowLoader:le,smoothScrollX:be=!1,smoothScrollY:L=!1,experimental:j,getCellRenderer:ue,resizeIndicator:te="full"}=e,ie=e.translateX??0,Ce=e.translateY??0,fe=Math.max(A,Math.min(r.length-1,l)),G=I.useRef(null),Te=I.useRef(window),Ye=Te.current,_e=le,Ee=I.useRef(),[Ke,ze]=I.useState(!1),Dt=I.useRef([]),Pt=I.useRef(),[ve,St]=I.useState(),[ct,pe]=I.useState(),Oe=I.useRef(null),[It,nt]=I.useState(),[ot,ne]=I.useState(!1),Be=I.useRef(ot);Be.current=ot;const ke=I.useMemo(()=>new Cr(yt,()=>{an.current=void 0,Ut.current()}),[yt]),it=v?f+a:a,Ve=I.useRef(-1),bt=((j==null?void 0:j.enableFirefoxRescaling)??!1)&&Ur.value,Sn=((j==null?void 0:j.enableSafariRescaling)??!1)&&Lo.value;I.useLayoutEffect(()=>{window.devicePixelRatio===1||!bt&&!Sn||(Ve.current!==-1&&ze(!0),window.clearTimeout(Ve.current),Ve.current=window.setTimeout(()=>{ze(!1),Ve.current=-1},200))},[s,fe,ie,Ce,bt,Sn]);const Fe=lr(r,A),In=H?$t(Fe,ce):0,Pe=I.useCallback((b,E,z)=>{const T=b.getBoundingClientRect();if(E>=Fe.length||z>=m)return;const D=T.width/n,R=Un(E,z,n,o,f,it,fe,s,ie,Ce,m,A,C,Fe,g);return D!==1&&(R.x*=D,R.y*=D,R.width*=D,R.height*=D),R.x+=T.x,R.y+=T.y,R},[n,o,f,it,fe,s,ie,Ce,m,A,C,Fe,g]),Le=I.useCallback((b,E,z,T)=>{const D=b.getBoundingClientRect(),R=D.width/n,Y=(E-D.left)/R,_=(z-D.top)/R,N=5,He=Vn(Fe,fe,n,void 0,ie);let X=0,re=0;T instanceof MouseEvent&&(X=T.button,re=T.buttons);const Z=ur(Y,He,ie),ee=fr(_,o,v,a,f,m,g,s,Ce,C),Re=(T==null?void 0:T.shiftKey)===!0,Qe=(T==null?void 0:T.ctrlKey)===!0,Ae=(T==null?void 0:T.metaKey)===!0,dt=T!==void 0&&!(T instanceof MouseEvent)||(T==null?void 0:T.pointerType)==="touch",vt=[Y<0?-1:nn||_>o){const me=Y>n?1:Y<0?-1:0,et=_>o?1:_<0?-1:0;let rt=me*2,jt=et*2;me===0&&(rt=Z===-1?Zt.EndPadding:Zt.Center),et===0&&(jt=ee===void 0?Zt.EndPadding:Zt.Center);let pt=!1;if(Z===-1&&ee===-1){const Kt=Pe(b,Fe.length-1,-1);ft(Kt!==void 0),pt=En&&Yo&&_=0?(et=!0,me=Pe(b,rt,ee),ft(me!==void 0),Ze={kind:v&&ee===-2?Nt:At,location:[rt,ee],bounds:me,group:Fe[rt].group??"",isEdge:et,shiftKey:Re,ctrlKey:Qe,metaKey:Ae,isTouch:dt,localEventX:E-me.x,localEventY:z-me.y,button:X,buttons:re,scrollEdge:vt}):Ze={kind:v&&ee===-2?Nt:At,group:Fe[Z].group??"",location:[Z,ee],bounds:me,isEdge:et,shiftKey:Re,ctrlKey:Qe,metaKey:Ae,isTouch:dt,localEventX:E-me.x,localEventY:z-me.y,button:X,buttons:re,scrollEdge:vt}}else{const me=Pe(b,Z,ee);ft(me!==void 0);const et=me!==void 0&&me.x+me.width-E{}),Ht=I.useRef(ve);Ht.current=ve;const[Et,Bt]=I.useMemo(()=>{const b=document.createElement("canvas"),E=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",E.style.display="none",E.style.opacity="0",E.style.position="fixed",[b.getContext("2d",{alpha:!1}),E.getContext("2d",{alpha:!1})]},[]);I.useLayoutEffect(()=>{if(!(Et===null||Bt===null))return document.documentElement.append(Et.canvas),document.documentElement.append(Bt.canvas),()=>{Et.canvas.remove(),Bt.canvas.remove()}},[Et,Bt]);const ln=I.useMemo(()=>new kr,[]),lo=bt&&Ke?1:Sn&&Ke?2:5,ao=(j==null?void 0:j.disableMinimumCellWidth)===!0?1:10,an=I.useRef(),cn=I.useRef(null),dn=I.useRef(null),un=I.useCallback(()=>{var Y;const b=G.current,E=Oe.current;if(b===null||E===null||(cn.current===null&&(cn.current=b.getContext("2d",{alpha:!1}),b.width=0,b.height=0),dn.current===null&&(dn.current=E.getContext("2d",{alpha:!1}),E.width=0,E.height=0),cn.current===null||dn.current===null||Et===null||Bt===null))return;let z=!1;const T=_=>{z=!0,nt(_)},D=an.current,R={headerCanvasCtx:dn.current,canvasCtx:cn.current,bufferACtx:Et,bufferBCtx:Bt,width:n,height:o,cellXOffset:fe,cellYOffset:s,translateX:Math.round(ie),translateY:Math.round(Ce),mappedColumns:Fe,enableGroups:v,freezeColumns:A,dragAndDropState:ce,theme:ye,headerHeight:a,groupHeaderHeight:f,disabledRows:Ct??Yn.empty(),rowHeight:g,verticalBorder:Xe,isResizing:we,resizeCol:J,isFocused:P,selection:S,fillHandle:d,drawCellCallback:de,hasAppendRow:at,overrideCursor:T,maxScaleFactor:lo,freezeTrailingRows:C,rows:m,drawFocus:x,getCellContent:h,getGroupDetails:je??(_=>({name:_})),getRowThemeOverride:c,drawHeaderCallback:$e,prelightCells:mt,highlightRegions:Ne,imageLoader:_e,lastBlitData:Pt,damage:Ee.current,hoverValues:Dt.current,hoverInfo:Ht.current,spriteManager:ke,scrolling:Ke,hyperWrapping:(j==null?void 0:j.hyperWrapping)??!1,touchMode:ot,enqueue:so.current,renderStateProvider:ln,renderStrategy:(j==null?void 0:j.renderStrategy)??(Lo.value?"double-buffer":"single-buffer"),getCellRenderer:ue,minimumCellWidth:ao,resizeIndicator:te};R.damage===void 0?(an.current=R,zo(R,D)):zo(R,void 0),!z&&(R.damage===void 0||R.damage.has((Y=Ht==null?void 0:Ht.current)==null?void 0:Y[0]))&&nt(void 0)},[Et,Bt,n,o,fe,s,ie,Ce,Fe,v,A,ce,ye,a,f,Ct,g,Xe,we,at,J,P,S,d,C,m,x,lo,h,je,c,de,$e,mt,Ne,_e,ke,Ke,j==null?void 0:j.hyperWrapping,j==null?void 0:j.renderStrategy,ot,ln,ue,ao,te]),Ut=I.useRef(un);I.useLayoutEffect(()=>{un(),Ut.current=un},[un]),I.useLayoutEffect(()=>{(async()=>{var E;((E=document==null?void 0:document.fonts)==null?void 0:E.ready)!==void 0&&(await document.fonts.ready,an.current=void 0,Ut.current())})()},[]);const Rt=I.useCallback(b=>{Ee.current=b,Ut.current(),Ee.current=void 0},[]),pi=qr(Rt);so.current=pi;const co=I.useCallback(b=>{Rt(new tn(b.map(E=>E.cell)))},[Rt]);_e.setCallback(Rt);const[wi,ki]=I.useState(!1),[fn,Tt]=Mt??[],xi=fn!==void 0&&Tt===-1,Ci=fn!==void 0&&Tt===-2;let uo=!1,fo=!1,hn=It;if(hn===void 0&&fn!==void 0&&Tt!==void 0&&Tt>-1&&Tt({contain:"strict",display:"block",cursor:ho}),[ho]),go=I.useRef("default"),En=O==null?void 0:O.current;En!=null&&go.current!==Mn.cursor&&(En.style.cursor=go.current=Mn.cursor);const Wt=I.useCallback((b,E,z,T)=>{if(je===void 0)return;const D=je(b);if(D.actions!==void 0){const R=gi(E,D.actions);for(const[Y,_]of R.entries())if(Ot(_,z+E.x,T+_.y))return D.actions[Y]}},[je]),zt=I.useCallback((b,E,z,T)=>{const D=Fe[E];if(!Ie&&!we&&!(ct??!1)){const R=Pe(b,E,-1);ft(R!==void 0);const Y=mi(void 0,D,R.x,R.y,R.width,R.height,ye,eo(D.title)==="rtl");if(D.hasMenu===!0&&Y.menuBounds!==void 0&&Ot(Y.menuBounds,z,T))return{area:"menu",bounds:Y.menuBounds};if(D.indicatorIcon!==void 0&&Y.indicatorIconBounds!==void 0&&Ot(Y.indicatorIconBounds,z,T))return{area:"indicator",bounds:Y.indicatorIconBounds}}},[Fe,Pe,ct,Ie,we,ye]),Bn=I.useRef(0),qt=I.useRef(),Fn=I.useRef(!1),mo=I.useCallback(b=>{const E=G.current,z=O==null?void 0:O.current;if(E===null||b.target!==E&&b.target!==z)return;Fn.current=!0;let T,D;if(b instanceof MouseEvent?(T=b.clientX,D=b.clientY):(T=b.touches[0].clientX,D=b.touches[0].clientY),b.target===z&&z!==null){const Y=z.getBoundingClientRect();if(T>Y.right||D>Y.bottom)return}const R=Le(E,T,D,b);qt.current=R.location,R.isTouch&&(Bn.current=Date.now()),Be.current!==R.isTouch&&ne(R.isTouch),!(R.kind===At&&zt(E,R.location[0],T,D)!==void 0)&&(R.kind===Nt&&Wt(R.group,R.bounds,R.localEventX,R.localEventY)!==void 0||(k==null||k(R),!R.isTouch&&qe!==!0&&qe!==R.kind&&R.button<3&&R.button!==1&&b.preventDefault()))},[O,qe,Le,Wt,zt,k]);Ge("touchstart",mo,Ye,!1),Ge("mousedown",mo,Ye,!1);const yo=I.useRef(0),bo=I.useCallback(b=>{var re,Z;const E=yo.current;yo.current=Date.now();const z=G.current;if(Fn.current=!1,p===void 0||z===null)return;const T=O==null?void 0:O.current,D=b.target!==z&&b.target!==T;let R,Y,_=!0;if(b instanceof MouseEvent){if(R=b.clientX,Y=b.clientY,_=b.button<3,b.pointerType==="touch")return}else R=b.changedTouches[0].clientX,Y=b.changedTouches[0].clientY;let N=Le(z,R,Y,b);N.isTouch&&Bn.current!==0&&Date.now()-Bn.current>500&&(N={...N,isLongTouch:!0}),E!==0&&Date.now()-E<(N.isTouch?1e3:500)&&(N={...N,isDoubleClick:!0}),Be.current!==N.isTouch&&ne(N.isTouch),!D&&b.cancelable&&_&&b.preventDefault();const[He]=N.location,X=zt(z,He,R,Y);if(N.kind===At&&X!==void 0){(N.button!==0||((re=qt.current)==null?void 0:re[0])!==He||((Z=qt.current)==null?void 0:Z[1])!==-1)&&p(N,!0);return}else if(N.kind===Nt){const ee=Wt(N.group,N.bounds,N.localEventX,N.localEventY);if(ee!==void 0){N.button===0&&ee.onClick(N);return}}p(N,D)},[p,O,Le,zt,Wt]);Ge("mouseup",bo,Ye,!1),Ge("touchend",bo,Ye,!1);const Si=I.useCallback(b=>{var He,X;const E=G.current;if(E===null)return;const z=O==null?void 0:O.current,T=b.target!==E&&b.target!==z;let D,R,Y=!0;b instanceof MouseEvent?(D=b.clientX,R=b.clientY,Y=b.button<3):(D=b.changedTouches[0].clientX,R=b.changedTouches[0].clientY);const _=Le(E,D,R,b);Be.current!==_.isTouch&&ne(_.isTouch),!T&&b.cancelable&&Y&&b.preventDefault();const[N]=_.location;if(_.kind===At){const re=zt(E,N,D,R);re!==void 0&&_.button===0&&((He=qt.current)==null?void 0:He[0])===N&&((X=qt.current)==null?void 0:X[1])===-1&&(re.area==="menu"?u==null||u(N,re.bounds):re.area==="indicator"&&(y==null||y(N,re.bounds)))}else if(_.kind===Nt){const re=Wt(_.group,_.bounds,_.localEventX,_.localEventY);re!==void 0&&_.button===0&&re.onClick(_)}},[O,Le,zt,u,y,Wt]);Ge("click",Si,Ye,!1);const Ii=I.useCallback(b=>{const E=G.current,z=O==null?void 0:O.current;if(E===null||b.target!==E&&b.target!==z||W===void 0)return;const T=Le(E,b.clientX,b.clientY,b);W(T,()=>{b.cancelable&&b.preventDefault()})},[O,Le,W]);Ge("contextmenu",Ii,(O==null?void 0:O.current)??null,!1);const vo=I.useCallback(b=>{Ee.current=new tn(b.map(E=>E.item)),Dt.current=b,Ut.current(),Ee.current=void 0},[]),po=I.useMemo(()=>new _r(vo),[vo]),wo=I.useRef(po);wo.current=po,I.useLayoutEffect(()=>{const b=wo.current;if(Mt===void 0||Mt[1]<0){b.setHovered(Mt);return}const E=h(Mt,!0),z=ue(E),T=z===void 0&&E.kind===ae.Custom||(z==null?void 0:z.needsHover)!==void 0&&(typeof z.needsHover=="boolean"?z.needsHover:z.needsHover(E));b.setHovered(T?Mt:void 0)},[h,ue,Mt]);const ko=I.useRef(),Mi=I.useCallback(b=>{var _;const E=G.current;if(E===null)return;const z=O==null?void 0:O.current,T=b.target!==E&&b.target!==z,D=Le(E,b.clientX,b.clientY,b);if(D.kind!=="out-of-bounds"&&T&&!Fn.current&&!D.isTouch)return;const R=(N,He)=>{St(X=>X===N||(X==null?void 0:X[0][0])===(N==null?void 0:N[0][0])&&(X==null?void 0:X[0][1])===(N==null?void 0:N[0][1])&&((X==null?void 0:X[1][0])===(N==null?void 0:N[1][0])&&(X==null?void 0:X[1][1])===(N==null?void 0:N[1][1])||!He)?X:N)};if(!jr(D,ko.current))nt(void 0),U==null||U(D),R(D.kind===No?void 0:[D.location,[D.localEventX,D.localEventY]],!0),ko.current=D;else if(D.kind==="cell"||D.kind===At||D.kind===Nt){let N=!1,He=!0;if(D.kind==="cell"){const re=h(D.location);He=((_=ue(re))==null?void 0:_.needsHoverPosition)??re.kind===ae.Custom,N=He}else N=!0;const X=[D.location,[D.localEventX,D.localEventY]];R(X,He),Ht.current=X,N&&Rt(new tn([D.location]))}const Y=D.location[0]>=(se?0:1);pe(D.kind===At&&D.isEdge&&Y&<===!0),ki(D.kind==="cell"&&D.isFillHandle),q==null||q(b),V(D)},[O,Le,se,lt,q,V,U,h,ue,Rt]);Ge("mousemove",Mi,Ye,!0);const Ei=I.useCallback(b=>{const E=G.current;if(E===null)return;let z,T;S.current!==void 0&&(z=Pe(E,S.current.cell[0],S.current.cell[1]),T=S.current.cell),he==null||he({bounds:z,stopPropagation:()=>b.stopPropagation(),preventDefault:()=>b.preventDefault(),cancel:()=>{},ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,altKey:b.altKey,key:b.key,keyCode:b.keyCode,rawEvent:b,location:T})},[he,S,Pe]),Bi=I.useCallback(b=>{const E=G.current;if(E===null)return;let z,T;S.current!==void 0&&(z=Pe(E,S.current.cell[0],S.current.cell[1]),T=S.current.cell),ge==null||ge({bounds:z,stopPropagation:()=>b.stopPropagation(),preventDefault:()=>b.preventDefault(),cancel:()=>{},ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey,altKey:b.altKey,key:b.key,keyCode:b.keyCode,rawEvent:b,location:T})},[ge,S,Pe]),Fi=I.useCallback(b=>{if(G.current=b,K!==void 0&&(K.current=b),b===null)Te.current=window;else{const E=b.getRootNode();E===document&&(Te.current=window),Te.current=E}},[K]),Ai=I.useCallback(b=>{const E=G.current;if(E===null||qe===!1||we){b.preventDefault();return}let z,T;const D=Le(E,b.clientX,b.clientY);if(qe!==!0&&D.kind!==qe){b.preventDefault();return}const R=(re,Z)=>{z=re,T=Z};let Y,_,N;const He=(re,Z,ee)=>{Y=re,_=Z,N=ee};let X=!1;if(De==null||De({...D,setData:R,setDragImage:He,preventDefault:()=>X=!0,defaultPrevented:()=>X}),!X&&z!==void 0&&T!==void 0&&b.dataTransfer!==null)if(b.dataTransfer.setData(z,T),b.dataTransfer.effectAllowed="copyLink",Y!==void 0&&_!==void 0&&N!==void 0)b.dataTransfer.setDragImage(Y,_,N);else{const[re,Z]=D.location;if(Z!==void 0){const ee=document.createElement("canvas"),Re=Pe(E,re,Z);ft(Re!==void 0);const Qe=Math.ceil(window.devicePixelRatio??1);ee.width=Re.width*Qe,ee.height=Re.height*Qe;const Ae=ee.getContext("2d");Ae!==null&&(Ae.scale(Qe,Qe),Ae.textBaseline="middle",Z===-1?(Ae.font=ye.headerFontFull,Ae.fillStyle=ye.bgHeader,Ae.fillRect(0,0,ee.width,ee.height),yi(Ae,0,0,Re.width,Re.height,Fe[re],!1,ye,!1,void 0,void 0,!1,0,ke,$e,!1)):(Ae.font=ye.baseFontFull,Ae.fillStyle=ye.bgCell,Ae.fillRect(0,0,ee.width,ee.height),hi(Ae,h([re,Z]),0,Z,!1,!1,0,0,Re.width,Re.height,!1,ye,ye.bgCell,_e,ke,1,void 0,!1,0,void 0,void 0,void 0,ln,ue,()=>{}))),ee.style.left="-100%",ee.style.position="absolute",ee.style.width=`${Re.width}px`,ee.style.height=`${Re.height}px`,document.body.append(ee),b.dataTransfer.setDragImage(ee,Re.width/2,Re.height/2),window.setTimeout(()=>{ee.remove()},0)}}else b.preventDefault()},[qe,we,Le,De,Pe,ye,Fe,ke,$e,h,_e,ln,ue]);Ge("dragstart",Ai,(O==null?void 0:O.current)??null,!1,!1);const An=I.useRef(),Di=I.useCallback(b=>{const E=G.current;if(Q!==void 0&&b.preventDefault(),E===null||We===void 0)return;const z=Le(E,b.clientX,b.clientY),[T,D]=z.location,R=T-(se?0:1),[Y,_]=An.current??[];(Y!==R||_!==D)&&(An.current=[R,D],We([R,D],b.dataTransfer))},[se,Le,We,Q]);Ge("dragover",Di,(O==null?void 0:O.current)??null,!1,!1);const Pi=I.useCallback(()=>{An.current=void 0,Se==null||Se()},[Se]);Ge("dragend",Pi,(O==null?void 0:O.current)??null,!1,!1);const Hi=I.useCallback(b=>{const E=G.current;if(E===null||Q===void 0)return;b.preventDefault();const z=Le(E,b.clientX,b.clientY),[T,D]=z.location,R=T-(se?0:1);Q([R,D],b.dataTransfer)},[se,Le,Q]);Ge("drop",Hi,(O==null?void 0:O.current)??null,!1,!1);const Ri=I.useCallback(()=>{xe==null||xe()},[xe]);Ge("dragleave",Ri,(O==null?void 0:O.current)??null,!1,!1);const xo=I.useRef(S);xo.current=S;const gn=I.useRef(null),Dn=I.useCallback(b=>{var E;G.current===null||!G.current.contains(document.activeElement)||(b===null&&xo.current.current!==void 0?(E=K==null?void 0:K.current)==null||E.focus({preventScroll:!0}):b!==null&&b.focus({preventScroll:!0}),gn.current=b)},[K]);I.useImperativeHandle(t,()=>({focus:()=>{var E;const b=gn.current;b===null||!document.contains(b)?(E=K==null?void 0:K.current)==null||E.focus({preventScroll:!0}):b.focus({preventScroll:!0})},getBounds:(b,E)=>{if(!(K===void 0||K.current===null))return Pe(K.current,b??0,E??-1)},damage:co}),[K,co,Pe]);const Pn=I.useRef(),Ti=or(()=>{var _,N,He;if(n<50||(j==null?void 0:j.disableAccessibilityTree)===!0)return null;let b=Vn(Fe,fe,n,ce,ie);const E=se?0:-1;!se&&((_=b[0])==null?void 0:_.sourceIndex)===0&&(b=b.slice(1));const[z,T]=((N=S.current)==null?void 0:N.cell)??[],D=(He=S.current)==null?void 0:He.range,R=b.map(X=>X.sourceIndex),Y=qi(s,Math.min(m,s+i));return z!==void 0&&T!==void 0&&!(R.includes(z)&&Y.includes(T))&&Dn(null),Je("table",{role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":Fe.length+E,children:[$("thead",{role:"rowgroup",children:$("tr",{role:"row","aria-rowindex":1,children:b.map(X=>$("th",{role:"columnheader","aria-selected":S.columns.hasIndex(X.sourceIndex),"aria-colindex":X.sourceIndex+1+E,tabIndex:-1,onFocus:re=>{if(re.target!==gn.current)return Me==null?void 0:Me([X.sourceIndex,-1])},children:X.title},X.sourceIndex))})}),$("tbody",{role:"rowgroup",children:Y.map(X=>$("tr",{role:"row","aria-selected":S.rows.hasIndex(X),"aria-rowindex":X+2,children:b.map(re=>{const Z=re.sourceIndex,ee=tt(Z,X),Re=z===Z&&T===X,Qe=D!==void 0&&Z>=D.x&&Z=D.y&&X{const Ze=K==null?void 0:K.current;if(Ze!=null)return he==null?void 0:he({bounds:Pe(Ze,Z,X),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:dt})},onFocusCapture:Ze=>{var me,et;if(!(Ze.target===gn.current||((me=Pn.current)==null?void 0:me[0])===Z&&((et=Pn.current)==null?void 0:et[1])===X))return Pn.current=dt,Me==null?void 0:Me(dt)},ref:Re?Dn:void 0,tabIndex:-1,children:Kr(vt,ue)},ee)})},X))})]},"access-tree")},[n,Fe,fe,ce,ie,m,s,i,S,Dn,h,K,he,Pe,Me],200),mn=A===0||!H?0:fe>A?1:wn(-ie/100,0,1),Wi=-s*32+Ce,yn=B?wn(-Wi/100,0,1):0,zi=I.useMemo(()=>{if(!mn&&!yn)return null;const b={position:"absolute",top:0,left:In,width:n-In,height:o,opacity:mn,pointerEvents:"none",transition:be?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},E={position:"absolute",top:it,left:0,width:n,height:o,opacity:yn,pointerEvents:"none",transition:L?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return Je(Xn,{children:[mn>0&&$("div",{id:"shadow-x",style:b}),yn>0&&$("div",{id:"shadow-y",style:E})]})},[mn,yn,In,n,be,it,o,L]),Li=I.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return Je(Xn,{children:[$("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ei,onKeyUp:Bi,onFocus:M,onBlur:F,ref:Fi,style:Mn,children:Ti}),$("canvas",{ref:Oe,style:Li}),zi]})},yl=I.memo(I.forwardRef(Gr));function Jr(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case ae.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Jn?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case ae.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case ae.Image:case ae.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case ae.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case ae.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case ae.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case ae.Markdown:case ae.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case ae.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case ae.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case ae.Protected:return{formatted:"************",rawValue:"",format:"string"};default:Gn()}}function Qr(e,t){return e.map((o,i)=>{const r=t[i];return o.map(l=>l.span!==void 0&&l.span[0]!==r?{formatted:"",rawValue:"",format:"string"}:Jr(l))})}function Xo(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Zr(e){var n;const t=[];for(const o of e){const i=[];for(const r of o)r.format==="url"?i.push(((n=r.rawValue)==null?void 0:n.toString())??""):r.format==="string-array"?i.push(r.formatted.map(l=>Xo(l,!0)).join(",")):i.push(Xo(r.formatted,!1));t.push(i.join(" "))}return t.join(` +`)}function zn(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function $o(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function es(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ts(e){var n;const t=[];t.push('',"");for(const o of e){t.push("");for(const i of o){const r=`gdg-format="${i.format}"`;i.format==="url"?t.push(``):i.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${zn(i.formatted)}
    ${i.formatted.map((l,s)=>`
  1. `+zn(l)+"
  2. ").join("")}
${zn(i.formatted)}
"),t.join("")}function ns(e,t){const n=Qr(e,t),o=Zr(n),i=ts(n);return{textPlain:o,textHtml:i}}function bl(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const o=[n],i=[];let r;for(;o.length>0;){const s=o.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")o.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)r!==void 0&&i.push(r),r=[],o.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),f=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,g=(f==null?void 0:f.children.length)===1&&f.children[0].nodeName==="FONT",m=a.querySelectorAll("br");for(const u of m)u.replaceWith(` +`);const h=a.getAttribute("gdg-raw-value"),c=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)r==null||r.push({rawValue:((l=a.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:a.textContent??"",format:c});else if(a.querySelector("ol")!==null){const u=a.querySelectorAll("li");r==null||r.push({rawValue:[...u].map(y=>y.getAttribute("gdg-raw-value")??""),formatted:[...u].map(y=>y.textContent??""),format:"string-array"})}else if(h!==null)r==null||r.push({rawValue:es(h),formatted:a.textContent??"",format:c});else{let u=a.textContent??"";g&&(u=u.replace(/\n(?!\n)/g,"")),r==null||r.push({rawValue:u??"",formatted:u??"",format:c})}}}return r!==void 0&&i.push(r),i}function vl(e,t,n,o,i){var s;const r=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const a=(s=e.current)==null?void 0:s.range,d=[];if(a.width>2){const m=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof m=="function")return r;d.push(...m);const h=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof h=="function")return r;d.push(...h)}else{const m=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof m=="function")return r;d.push(...m)}let f=a.x-n,g=a.x+a.width-1-n;for(const m of d)for(const h of m)h.span!==void 0&&(f=Math.min(h.span[0],f),g=Math.max(h.span[1],g));f===a.x-n&&g===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:f+n,y:a.y,width:g-f+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function Yo(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function pl(e){let t;(s=>{s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let o=[],i=0,r=0;e=e.replace(/\r\n/g,` `);let l=0;for(const s of e){switch(r){case 0:s===" "||s===` `?(o.push(e.slice(i,l)),i=l+1,s===` `&&(n.push(o),o=[])):s==='"'&&(r=1);break;case 1:s==='"'&&(r=2);break;case 2:s==='"'?r=1:((s===" "||s===` `)&&(o.push(Yo(e.slice(i,l))),i=l+1,s===` -`&&(n.push(o),o=[])),r=0);break}l++}return is.map(a=>({rawValue:a,formatted:a,format:"string"})))}function pl(e,t,n){var s;const o=ts(e,t),i=a=>{var d;(d=window.navigator.clipboard)==null||d.writeText(a)},r=(a,d)=>{var f;return((f=window.navigator.clipboard)==null?void 0:f.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([d],{type:"text/html"})})]),!0)},l=(a,d)=>{var f,g;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(f=n==null?void 0:n.clipboardData)==null||f.setData("text/plain",a),(g=n==null?void 0:n.clipboardData)==null||g.setData("text/html",d)}catch{r(a,d)||i(a)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(o.textPlain,o.textHtml):i(o.textPlain),n==null||n.preventDefault()}function ns(e){return e!==!0}const _o=20,os={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:ae.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>is(e,e.cell.data,Yn(e.cell),e.cell.maxSize??_o,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onClick:e=>{const{cell:t,posX:n,posY:o,bounds:i,theme:r}=e,{width:l,height:s,x:a,y:d}=i,f=t.maxSize??_o,g=Math.floor(i.y+s/2),m=Qo(f,s,r.cellVerticalPadding),h=Jo(t.contentAlign??"center",a,l,r.cellHorizontalPadding,m),c=Go(h,g,m),u=Zo(a+n,d+o,c);if(Yn(t)&&u)return{...t,data:ns(t.data)}},onPaste:(e,t)=>{let n=kn;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Qn),n===t.data?void 0:{...t,data:n}}};function is(e,t,n,o,i){if(!n&&t===kn)return;const{ctx:r,hoverAmount:l,theme:s,rect:a,highlighted:d,hoverX:f,hoverY:g,cell:{contentAlign:m}}=e,{x:h,y:c,width:u,height:y}=a;let v=!1;if(i>0){let w=n?1-i+i*l:.4;if(t===kn&&(w*=l),w===0)return;w<1&&(v=!0,r.globalAlpha=w)}io(r,s,t,h,c,u,y,d,f,g,o,m),v&&(r.globalAlpha=1)}const rs=gt("div")({name:"BubblesOverlayEditorStyle",class:"bed7b9f",propsAsIs:!1}),ss=e=>{const{bubbles:t}=e;return Je(rs,{children:[t.map((n,o)=>$("div",{className:"boe-bubble",children:n},o)),$("textarea",{className:"gdg-input",autoFocus:!0})]})},ls=ss,as={getAccessibilityString:e=>ei(e.data),kind:ae.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,i)=>e.measureText(i).width+o+20,0)+2*n.cellHorizontalPadding-4,draw:e=>ds(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(ls,{bubbles:t.data})},onPaste:()=>{}},cs=4;function ds(e,t){const{rect:n,theme:o,ctx:i,highlighted:r}=e,{x:l,y:s,width:a,height:d}=n,f=20,g=8,m=cs;let h=l+o.cellHorizontalPadding;const c=[];for(const u of t){if(h>l+a)break;const y=Vt(u,i,o.baseFontFull).width;c.push({x:h,width:y}),h+=y+g*2+m}i.beginPath();for(const u of c)st(i,u.x,s+(d-f)/2,u.width+g*2,f,o.roundingRadius??f/2);i.fillStyle=r?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[u,y]of c.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(t[u],y.x+g,s+d/2+kt(i,o))}const us=gt("div")({name:"DrilldownOverlayEditorStyle",class:"dy18k32",propsAsIs:!1}),fs=e=>{const{drilldowns:t}=e;return $(us,{children:t.map((n,o)=>Je("div",{className:"doe-bubble",children:[n.img!==void 0&&$("img",{src:n.img}),$("div",{children:n.text})]},o))})},hs=fs,gs={getAccessibilityString:e=>ei(e.data.map(t=>t.text)),kind:ae.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,i)=>e.measureText(i.text).width+o+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>bs(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(hs,{drilldowns:t.data})},onPaste:()=>{}},ms=4,Ln={};function ys(e,t,n,o){const i=Math.ceil(window.devicePixelRatio),r=5,l=n-r*2,s=4,a=n*i,d=o+r,f=o*3,g=(f+r*2)*i,m=`${e},${t},${i},${n}`;if(Ln[m]!==void 0)return{el:Ln[m],height:a,width:g,middleWidth:s*i,sideWidth:d*i,padding:r*i,dpr:i};const h=document.createElement("canvas"),c=h.getContext("2d");return c===null?null:(h.width=g,h.height=a,c.scale(i,i),Ln[m]=h,c.beginPath(),st(c,r,r,f,l,o),c.shadowColor="rgba(24, 25, 34, 0.4)",c.shadowBlur=1,c.fillStyle=e,c.fill(),c.shadowColor="rgba(24, 25, 34, 0.3)",c.shadowOffsetY=1,c.shadowBlur=5,c.fillStyle=e,c.fill(),c.shadowOffsetY=0,c.shadowBlur=0,c.shadowBlur=0,c.beginPath(),st(c,r+.5,r+.5,f,l,o),c.strokeStyle=t,c.lineWidth=1,c.stroke(),{el:h,height:a,width:g,sideWidth:d*i,middleWidth:o*i,padding:r*i,dpr:i})}function bs(e,t){const{rect:n,theme:o,ctx:i,imageLoader:r,col:l,row:s}=e,{x:a,width:d}=n,f=o.baseFontFull,g=si(i,f),m=Math.min(n.height,Math.max(16,Math.ceil(g*o.lineHeight)*2)),h=Math.floor(n.y+(n.height-m)/2),c=m-10,u=8,y=ms;let v=a+o.cellHorizontalPadding;const w=o.roundingRadius??6,M=ys(o.bgCell,o.drilldownBorder,m,w),F=[];for(const P of t){if(v>a+d)break;const A=Vt(P.text,i,f).width;let W=0;P.img!==void 0&&r.loadOrGetImage(P.img,l,s)!==void 0&&(W=c-8+4);const C=A+W+u*2;F.push({x:v,width:C}),v+=C+y}if(M!==null){const{el:P,height:S,middleWidth:A,sideWidth:W,width:C,dpr:H,padding:B}=M,x=W/H,k=B/H;for(const p of F){const q=Math.floor(p.x),V=Math.floor(p.width),U=V-(x-k)*2;i.imageSmoothingEnabled=!1,i.drawImage(P,0,0,W,S,q-k,h,x,m),U>0&&i.drawImage(P,W,0,A,S,q+(x-k),h,U,m),i.drawImage(P,C-W,0,W,S,q+V-(x-k),h,x,m),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[P,S]of F.entries()){const A=t[P];let W=S.x+u;if(A.img!==void 0){const C=r.loadOrGetImage(A.img,l,s);if(C!==void 0){const H=c-8;let B=0,x=0,k=C.width,p=C.height;k>p?(B+=(k-p)/2,k=p):p>k&&(x+=(p-k)/2,p=k),i.beginPath(),st(i,W,h+m/2-H/2,H,H,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,B,x,k,p,W,h+m/2-H/2,H,H),i.restore(),W+=H+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(A.text,W,h+m/2+kt(i,o))}}const vs=gt("div")({name:"ImageOverlayEditorStyle",class:"i1f2fhaz",propsAsIs:!1}),ps=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:i}=e,r=t.filter(s=>s!=="");if(r.length===0)return null;const l=r.length>1;return Je(vs,{"data-testid":"GDG-default-image-overlay-editor",children:[$(qi.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l,children:r.map(s=>{const a=(i==null?void 0:i(s))??$("img",{draggable:!1,src:s});return $("div",{className:"gdg-centering-container",children:a},s)})}),n&&o&&$("button",{className:"gdg-edit-icon",onClick:o,children:$(Zn,{})})]})},ws={getAccessibilityString:e=>e.data.join(", "),kind:ae.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>ks(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:o}=e;return $(o??ps,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:r=>{n({...t,data:[r]})}})},onPaste:(e,t)=>{e=e.trim();const o=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(o.length===t.data.length&&o.every((i,r)=>i===t.data[r])))return{...t,data:o}}},Nn=4;function ks(e,t,n,o){const{rect:i,col:r,row:l,theme:s,ctx:a,imageLoader:d}=e,{x:f,y:g,height:m,width:h}=i,c=m-s.cellVerticalPadding*2,u=[];let y=0;for(let w=0;w0&&(a.beginPath(),st(a,v,g+s.cellVerticalPadding,M,c,n),a.save(),a.clip()),a.drawImage(w,v,g+s.cellVerticalPadding,M,c),n>0&&a.restore(),v+=M+Nn}}function xs(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Cs={getAccessibilityString:()=>"",kind:ae.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:i,rect:r,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(xs(n,o)*t.skeletonWidthVariability));const a=l.cellHorizontalPadding,d=t.skeletonHeight??Math.min(18,r.height-2*l.cellVerticalPadding);st(i,r.x+a,r.y+(r.height-d)/2,s,d,l.roundingRadius??3),i.fillStyle=sn(l.textDark,.1),i.fill()},onPaste:()=>{}},Ss=gt("div")({name:"MarkdownContainer",class:"m1ec5h7p",propsAsIs:!1});class Is extends Gn.PureComponent{constructor(){super(...arguments);oe(this,"targetElement",null);oe(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:o}=this;if(n===null)return;const{contents:i,createNode:r}=o,l=Oi(i),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let a=r==null?void 0:r(l);if(a===void 0){const f=document.createElement("template");f.innerHTML=l,a=f.content}n.append(a);const d=n.getElementsByTagName("a");for(const f of d)f.target="_blank",f.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$(Ss,{ref:this.containerRefHook})}}const Ms=gt("textarea")({name:"InputBox",class:"iotb8b8",propsAsIs:!1}),Es=gt("div")({name:"ShadowBox",class:"s1xtsfdl",propsAsIs:!1}),Bs=gt("div")({name:"GrowingEntryStyle",class:"g1d7u5bt",propsAsIs:!1});let Vo=0;const Cn=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:i,altNewline:r,validatedSelection:l,...s}=e,{onChange:a,className:d}=s,f=I.useRef(null),g=n??"";ft(a!==void 0,"GrowingEntry must be a controlled input area");const[m]=I.useState(()=>"input-box-"+(Vo=(Vo+1)%1e7));I.useEffect(()=>{const c=f.current;if(c===null||c.disabled)return;const u=g.toString().length;c.focus(),c.setSelectionRange(i?0:u,u)},[]),I.useLayoutEffect(()=>{var c;if(l!==void 0){const u=typeof l=="number"?[l,null]:l;(c=f.current)==null||c.setSelectionRange(u[0],u[1])}},[l]);const h=I.useCallback(c=>{c.key==="Enter"&&c.shiftKey&&r===!0||o==null||o(c)},[r,o]);return Je(Bs,{className:"gdg-growing-entry",children:[$(Es,{className:d,children:g+` -`}),$(Ms,{...s,className:(d??"")+" gdg-input",id:m,ref:f,onKeyDown:h,value:g,placeholder:t,dir:"auto"})]})},Fs=()=>e=>e.targetWidth,Uo=gt("div")({name:"MarkdownOverlayEditorStyle",class:"mmv7gx6",propsAsIs:!1,vars:{"mmv7gx6-0":[Fs(),"px"]}}),As=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:i,targetRect:r,onFinish:l,validatedSelection:s}=e,a=t.data,d=t.readonly===!0,[f,g]=I.useState(a===""||o),m=I.useCallback(()=>{g(c=>!c)},[]),h=a?"gdg-ml-6":"";return f?Je(Uo,{targetWidth:r.width-20,children:[$(Cn,{autoFocus:!0,highlight:!1,validatedSelection:s,value:a,onKeyDown:c=>{c.key==="Enter"&&c.stopPropagation()},onChange:n}),$("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t),children:$(tr,{})})]}):Je(Uo,{targetWidth:r.width,children:[$(Is,{contents:a,createNode:i}),!d&&Je(Xn,{children:[$("div",{className:"spacer"}),$("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:m,children:$(Zn,{})})]}),$("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0})]})},Ds={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:rn,measure:(e,t,n)=>{const o=t.data.split(` -`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>ht(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:o,onFinishedEditing:i,markdownDivCreateNode:r,forceEditMode:l,validatedSelection:s}=e;return $(As,{onFinish:i,targetRect:o,value:n,validatedSelection:s,onChange:a=>t({...n,data:a.target.value}),forceEditMode:l,createNode:r})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ps={getAccessibilityString:e=>e.row.toString(),kind:nn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Hs,measure:()=>44,draw:e=>Ts(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:o,posY:i}=e,{width:r,height:l}=t,s=n.drawHandle?7+(r-7)/2:r/2,a=l/2;if(Math.abs(o-s)<=10&&Math.abs(i-a)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Hs(e,t){const{ctx:n,theme:o}=e,i=o.markerFontFull,r=t??{};return(r==null?void 0:r.font)!==i&&(n.font=i,r.font=i),r.deprep=Rs,n.textAlign="center",r}function Rs(e){const{ctx:t}=e;t.textAlign="start"}function Ts(e,t,n,o,i,r){const{ctx:l,rect:s,hoverAmount:a,theme:d}=e,{x:f,y:g,width:m,height:h}=s,c=n?1:o==="checkbox-visible"?.6+.4*a:a;if(o!=="number"&&c>0){l.globalAlpha=c;const u=7*(n?a:1);if(io(l,d,n,i?f+u:f,g,i?m-u:m,h,!0,void 0,void 0,18,"center",r),i){l.globalAlpha=a,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(f+y,g+h/2+v,2,2);l.fillStyle=d.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const u=t.toString(),y=d.markerFontFull,v=f+m/2;o==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=d.textLight,l.font=y,l.fillText(u,v,g+h/2+kt(l,y)),a!==0&&(l.globalAlpha=1)}}const Ws={getAccessibilityString:()=>"",kind:nn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>zs(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function zs(e,t,n){const{ctx:o,rect:i,hoverAmount:r,theme:l,spriteManager:s}=e,{x:a,y:d,width:f,height:g}=i;o.beginPath(),o.globalAlpha=r,o.rect(a+1,d+1,f,g-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let h=0;if(n!==void 0){const u=g-8,y=a+8/2,v=d+8/2;s.drawSprite(n,"normal",o,y,v,u,l,m?1:r),h=u}else{h=24;const c=12,u=m?c:r*c,y=m?0:(1-r)*c*.5,v=l.cellHorizontalPadding+4;u>0&&(o.moveTo(a+v+y,d+g/2),o.lineTo(a+v+y+u,d+g/2),o.moveTo(a+v+y+u*.5,d+g/2-u*.5),o.lineTo(a+v+y+u*.5,d+g/2+u*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,h+a+l.cellHorizontalPadding+.5,d+g/2+kt(o,l)),o.beginPath()}const Ls=I.lazy(async()=>await Ki(()=>import("./number-overlay-editor-wZgFM_Mr.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),Ns={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:rn,draw:e=>ht(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:i}=e;return $(I.Suspense,{fallback:null,children:$(Ls,{highlight:t,disabled:o.readonly===!0,value:o.data,fixedDecimals:o.fixedDecimals,allowNegative:o.allowNegative,thousandSeparator:o.thousandSeparator,decimalSeparator:o.decimalSeparator,validatedSelection:i,onChange:r=>n({...o,data:Number.isNaN(r.floatValue??0)?0:r.floatValue})})})},onPaste:(e,t,n)=>{const o=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(o)||t.data===o))return{...t,data:o,displayData:n.formattedString??t.displayData}}},Os={getAccessibilityString:()=>"",measure:()=>108,kind:ae.Protected,needsHover:!1,needsHoverPosition:!1,draw:Xs,onPaste:()=>{}};function Xs(e){const{ctx:t,theme:n,rect:o}=e,{x:i,y:r,height:l}=o;t.beginPath();const s=2.5;let a=i+n.cellHorizontalPadding+s;const d=r+l/2,f=Math.cos(Io(30))*s,g=Math.sin(Io(30))*s;for(let m=0;m<12;m++)t.moveTo(a,d-s),t.lineTo(a,d+s),t.moveTo(a+f,d-g),t.lineTo(a-f,d+g),t.moveTo(a-f,d-g),t.lineTo(a+f,d+g),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const $s={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>rn(e,t,e.theme.textLight),draw:e=>ht(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:i}=e;return $(Cn,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:i,onChange:r=>n({...o,data:r.target.value})})},onPaste:()=>{}},Ys={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:rn,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:i,rect:r,theme:l,overrideCursor:s}=e,{displayData:a,contentAlign:d,hoverEffect:f,allowWrapping:g}=t;if(f===!0&&n>0){i.textBaseline="alphabetic";const m=l.cellHorizontalPadding,h=l.cellVerticalPadding,c=Vt(a,i,l.baseFontFull,"alphabetic"),u=r.height-h,y=Math.min(u,c.actualBoundingBoxAscent*2.5);i.beginPath(),st(i,r.x+m/2,r.y+(r.height-y)/2+1,c.width+m*3,y-1,l.roundingRadius??4),i.globalAlpha=n,i.fillStyle=sn(l.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=l.textDark,i.textBaseline="middle",s==null||s("text")}ht(e,a,d,g,o)},measure:(e,t,n)=>{const o=t.displayData.split(` -`,t.allowWrapping===!0?void 0:1);let i=0;for(const r of o)i=Math.max(i,e.measureText(r).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:o,value:i,validatedSelection:r}=t;return $(Cn,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:r,onChange:l=>o({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},_s=gt("div")({name:"UriOverlayEditorStyle",class:"uwr6ffw",propsAsIs:!1}),Vs=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:i,validatedSelection:r,preview:l}=e,[s,a]=I.useState(!i&&(t===""||o)),d=I.useCallback(()=>{a(!0)},[]);return s?$(Cn,{validatedSelection:r,highlight:!0,autoFocus:!0,value:t,onChange:n}):Je(_s,{children:[$("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer",children:l}),!i&&$("div",{className:"gdg-edit-icon",onClick:d,children:$(Zn,{})}),$("textarea",{className:"gdg-input",autoFocus:!0})]})},Us=Vs;function qo(e,t,n,o){let i=n.cellHorizontalPadding;const r=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return o==="right"?i=t.width-l-n.cellHorizontalPadding:o==="center"&&(i=t.width/2-l/2),{x:i,y:r,width:l,height:s}}const qs={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:rn,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:i,hoverY:r,rect:l,ctx:s}=e,a=t.displayData??t.data,d=t.hoverEffect===!0;if(o!==void 0&&d&&i!==void 0&&r!==void 0){const f=Vt(a,s,n.baseFontFull),g=qo(f,l,n,t.contentAlign),{x:m,y:h,width:c,height:u}=g;if(i>=m-4&&i<=m-4+c+8&&r>=h-4&&r<=h-4+u+8){const y=kt(s,n.baseFontFull);o("pointer");const v=5,w=h-y;s.beginPath(),s.moveTo(l.x+m,Math.floor(l.y+w+u+v)+.5),s.lineTo(l.x+m+c,Math.floor(l.y+w+u+v)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,ht({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=d?n.linkColor:n.textDark,ht(e,a,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:i,theme:r}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=ii(l,r.baseFontFull);if(s===void 0)return;const a=qo(s,n,r,t.contentAlign);Ot({x:a.x-4,y:a.y-4,width:a.width+8,height:a.height+8},o,i)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:o,forceEditMode:i,validatedSelection:r}=t;return $(Us,{forceEditMode:o.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:o.data,preview:o.displayData??o.data,validatedSelection:r,readonly:o.readonly===!0,onChange:l=>n({...o,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},wl=[Ps,Ws,os,as,gs,ws,Cs,Ds,Ns,Os,$s,Ys,qs],On=[];class js extends ai{constructor(){super(...arguments);oe(this,"imageLoaded",()=>{});oe(this,"loadedLocations",[]);oe(this,"cache",{});oe(this,"sendLoaded",ji(()=>{this.imageLoaded(new tn(this.loadedLocations)),this.loadedLocations=[]},20));oe(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const o of n){const i=this.cache[o];let r=!1;for(let l=0;l{a||(a=!0,On.length<12?On.unshift(s):l||(s.src=""))}},f=new Promise(g=>s.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{s.src=n,await f,await s.decode();const g=this.cache[r];if(g!==void 0&&!a){g.img=s;for(const m of g.cells)this.loadedLocations.push(oo(m));l=!0,this.sendLoaded()}}catch{d.cancel()}}),this.cache[r]=d}loadOrGetImage(n,o,i){const r=n,l=this.cache[r];if(l!==void 0){const s=tt(o,i);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,i,r)}}const kl=js;export{qr as A,hl as B,_n as C,Jn as D,Ji as E,rl as F,ae as G,cl as H,nn as I,yl as J,vl as K,Mo as L,dl as M,pl as N,kl as O,wl as P,ml as Q,Lo as R,Vr as S,fl as T,il as U,Gi as a,ft as b,gl as c,al as d,ll as e,bl as f,ul as g,sn as h,nl as i,tl as j,_t as k,Nt as l,Yt as m,Vn as n,No as o,Ot as p,ar as q,ol as r,Ko as s,ns as t,Ge as u,Qi as v,sl as w,Sr as x,vn as y,At as z}; +`&&(n.push(o),o=[])),r=0);break}l++}return is.map(a=>({rawValue:a,formatted:a,format:"string"})))}function wl(e,t,n){var s;const o=ns(e,t),i=a=>{var d;(d=window.navigator.clipboard)==null||d.writeText(a)},r=(a,d)=>{var f;return((f=window.navigator.clipboard)==null?void 0:f.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([d],{type:"text/html"})})]),!0)},l=(a,d)=>{var f,g;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(f=n==null?void 0:n.clipboardData)==null||f.setData("text/plain",a),(g=n==null?void 0:n.clipboardData)==null||g.setData("text/html",d)}catch{r(a,d)||i(a)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(o.textPlain,o.textHtml):i(o.textPlain),n==null||n.preventDefault()}function os(e){return e!==!0}const vi=20;function _o(e){const{cell:t,posX:n,posY:o,bounds:i,theme:r}=e,{width:l,height:s,x:a,y:d}=i,f=t.maxSize??vi,g=Math.floor(i.y+s/2),m=Qo(f,s,r.cellVerticalPadding),h=Jo(t.contentAlign??"center",a,l,r.cellHorizontalPadding,m),c=Go(h,g,m),u=Zo(a+n,d+o,c);return Qn(t)&&u}const is={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:ae.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>rs(e,e.cell.data,Qn(e.cell),e.cell.maxSize??vi,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{_o(e)&&e.preventDefault()},onClick:e=>{if(_o(e))return{...e.cell,data:os(e.cell.data)}},onPaste:(e,t)=>{let n=kn;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Jn),n===t.data?void 0:{...t,data:n}}};function rs(e,t,n,o,i){if(!n&&t===kn)return;const{ctx:r,hoverAmount:l,theme:s,rect:a,highlighted:d,hoverX:f,hoverY:g,cell:{contentAlign:m}}=e,{x:h,y:c,width:u,height:y}=a;let v=!1;if(i>0){let w=n?1-i+i*l:.4;if(t===kn&&(w*=l),w===0)return;w<1&&(v=!0,r.globalAlpha=w)}io(r,s,t,h,c,u,y,d,f,g,o,m),v&&(r.globalAlpha=1)}const ss=gt("div")({name:"BubblesOverlayEditorStyle",class:"bed7b9f",propsAsIs:!1}),ls=e=>{const{bubbles:t}=e;return Je(ss,{children:[t.map((n,o)=>$("div",{className:"boe-bubble",children:n},o)),$("textarea",{className:"gdg-input",autoFocus:!0})]})},as=ls,cs={getAccessibilityString:e=>ei(e.data),kind:ae.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,i)=>e.measureText(i).width+o+20,0)+2*n.cellHorizontalPadding-4,draw:e=>us(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(as,{bubbles:t.data})},onPaste:()=>{}},ds=4;function us(e,t){const{rect:n,theme:o,ctx:i,highlighted:r}=e,{x:l,y:s,width:a,height:d}=n,f=20,g=8,m=ds;let h=l+o.cellHorizontalPadding;const c=[];for(const u of t){if(h>l+a)break;const y=Vt(u,i,o.baseFontFull).width;c.push({x:h,width:y}),h+=y+g*2+m}i.beginPath();for(const u of c)st(i,u.x,s+(d-f)/2,u.width+g*2,f,o.roundingRadius??f/2);i.fillStyle=r?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[u,y]of c.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(t[u],y.x+g,s+d/2+kt(i,o))}const fs=gt("div")({name:"DrilldownOverlayEditorStyle",class:"dy18k32",propsAsIs:!1}),hs=e=>{const{drilldowns:t}=e;return $(fs,{children:t.map((n,o)=>Je("div",{className:"doe-bubble",children:[n.img!==void 0&&$("img",{src:n.img}),$("div",{children:n.text})]},o))})},gs=hs,ms={getAccessibilityString:e=>ei(e.data.map(t=>t.text)),kind:ae.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((o,i)=>e.measureText(i.text).width+o+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>vs(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(gs,{drilldowns:t.data})},onPaste:()=>{}},ys=4,Ln={};function bs(e,t,n,o){const i=Math.ceil(window.devicePixelRatio),r=5,l=n-r*2,s=4,a=n*i,d=o+r,f=o*3,g=(f+r*2)*i,m=`${e},${t},${i},${n}`;if(Ln[m]!==void 0)return{el:Ln[m],height:a,width:g,middleWidth:s*i,sideWidth:d*i,padding:r*i,dpr:i};const h=document.createElement("canvas"),c=h.getContext("2d");return c===null?null:(h.width=g,h.height=a,c.scale(i,i),Ln[m]=h,c.beginPath(),st(c,r,r,f,l,o),c.shadowColor="rgba(24, 25, 34, 0.4)",c.shadowBlur=1,c.fillStyle=e,c.fill(),c.shadowColor="rgba(24, 25, 34, 0.3)",c.shadowOffsetY=1,c.shadowBlur=5,c.fillStyle=e,c.fill(),c.shadowOffsetY=0,c.shadowBlur=0,c.shadowBlur=0,c.beginPath(),st(c,r+.5,r+.5,f,l,o),c.strokeStyle=t,c.lineWidth=1,c.stroke(),{el:h,height:a,width:g,sideWidth:d*i,middleWidth:o*i,padding:r*i,dpr:i})}function vs(e,t){const{rect:n,theme:o,ctx:i,imageLoader:r,col:l,row:s}=e,{x:a,width:d}=n,f=o.baseFontFull,g=si(i,f),m=Math.min(n.height,Math.max(16,Math.ceil(g*o.lineHeight)*2)),h=Math.floor(n.y+(n.height-m)/2),c=m-10,u=8,y=ys;let v=a+o.cellHorizontalPadding;const w=o.roundingRadius??6,M=bs(o.bgCell,o.drilldownBorder,m,w),F=[];for(const P of t){if(v>a+d)break;const A=Vt(P.text,i,f).width;let W=0;P.img!==void 0&&r.loadOrGetImage(P.img,l,s)!==void 0&&(W=c-8+4);const C=A+W+u*2;F.push({x:v,width:C}),v+=C+y}if(M!==null){const{el:P,height:S,middleWidth:A,sideWidth:W,width:C,dpr:H,padding:B}=M,x=W/H,k=B/H;for(const p of F){const q=Math.floor(p.x),V=Math.floor(p.width),U=V-(x-k)*2;i.imageSmoothingEnabled=!1,i.drawImage(P,0,0,W,S,q-k,h,x,m),U>0&&i.drawImage(P,W,0,A,S,q+(x-k),h,U,m),i.drawImage(P,C-W,0,W,S,q+V-(x-k),h,x,m),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[P,S]of F.entries()){const A=t[P];let W=S.x+u;if(A.img!==void 0){const C=r.loadOrGetImage(A.img,l,s);if(C!==void 0){const H=c-8;let B=0,x=0,k=C.width,p=C.height;k>p?(B+=(k-p)/2,k=p):p>k&&(x+=(p-k)/2,p=k),i.beginPath(),st(i,W,h+m/2-H/2,H,H,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,B,x,k,p,W,h+m/2-H/2,H,H),i.restore(),W+=H+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(A.text,W,h+m/2+kt(i,o))}}const ps=gt("div")({name:"ImageOverlayEditorStyle",class:"i1f2fhaz",propsAsIs:!1}),ws=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:i}=e,r=t.filter(s=>s!=="");if(r.length===0)return null;const l=r.length>1;return Je(ps,{"data-testid":"GDG-default-image-overlay-editor",children:[$(ji.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l,children:r.map(s=>{const a=(i==null?void 0:i(s))??$("img",{draggable:!1,src:s});return $("div",{className:"gdg-centering-container",children:a},s)})}),n&&o&&$("button",{className:"gdg-edit-icon",onClick:o,children:$(Zn,{})})]})},ks={getAccessibilityString:e=>e.data.join(", "),kind:ae.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>xs(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:o}=e;return $(o??ws,{urls:t.data,canWrite:t.readonly!==!1,onCancel:n,onChange:r=>{n({...t,data:[r]})}})},onPaste:(e,t)=>{e=e.trim();const o=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(o.length===t.data.length&&o.every((i,r)=>i===t.data[r])))return{...t,data:o}}},Nn=4;function xs(e,t,n,o){const{rect:i,col:r,row:l,theme:s,ctx:a,imageLoader:d}=e,{x:f,y:g,height:m,width:h}=i,c=m-s.cellVerticalPadding*2,u=[];let y=0;for(let w=0;w0&&(a.beginPath(),st(a,v,g+s.cellVerticalPadding,M,c,n),a.save(),a.clip()),a.drawImage(w,v,g+s.cellVerticalPadding,M,c),n>0&&a.restore(),v+=M+Nn}}function Cs(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Ss={getAccessibilityString:()=>"",kind:ae.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:i,rect:r,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Cs(n,o)*t.skeletonWidthVariability));const a=l.cellHorizontalPadding;s+a*2>=r.width&&(s=r.width-a*2-1);const d=t.skeletonHeight??Math.min(18,r.height-2*l.cellVerticalPadding);st(i,r.x+a,r.y+(r.height-d)/2,s,d,l.roundingRadius??3),i.fillStyle=sn(l.textDark,.1),i.fill()},onPaste:()=>{}},Is=gt("div")({name:"MarkdownContainer",class:"m1ec5h7p",propsAsIs:!1});class Ms extends Kn.PureComponent{constructor(){super(...arguments);oe(this,"targetElement",null);oe(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:o}=this;if(n===null)return;const{contents:i,createNode:r}=o,l=Xi(i),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let a=r==null?void 0:r(l);if(a===void 0){const f=document.createElement("template");f.innerHTML=l,a=f.content}n.append(a);const d=n.getElementsByTagName("a");for(const f of d)f.target="_blank",f.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$(Is,{ref:this.containerRefHook})}}const Es=gt("textarea")({name:"InputBox",class:"iotb8b8",propsAsIs:!1}),Bs=gt("div")({name:"ShadowBox",class:"s1xtsfdl",propsAsIs:!1}),Fs=gt("div")({name:"GrowingEntryStyle",class:"g1d7u5bt",propsAsIs:!1});let Vo=0;const Cn=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:i,altNewline:r,validatedSelection:l,...s}=e,{onChange:a,className:d}=s,f=I.useRef(null),g=n??"";ft(a!==void 0,"GrowingEntry must be a controlled input area");const[m]=I.useState(()=>"input-box-"+(Vo=(Vo+1)%1e7));I.useEffect(()=>{const c=f.current;if(c===null||c.disabled)return;const u=g.toString().length;c.focus(),c.setSelectionRange(i?0:u,u)},[]),I.useLayoutEffect(()=>{var c;if(l!==void 0){const u=typeof l=="number"?[l,null]:l;(c=f.current)==null||c.setSelectionRange(u[0],u[1])}},[l]);const h=I.useCallback(c=>{c.key==="Enter"&&c.shiftKey&&r===!0||o==null||o(c)},[r,o]);return Je(Fs,{className:"gdg-growing-entry",children:[$(Bs,{className:d,children:g+` +`}),$(Es,{...s,className:(d??"")+" gdg-input",id:m,ref:f,onKeyDown:h,value:g,placeholder:t,dir:"auto"})]})},As=()=>e=>e.targetWidth,Uo=gt("div")({name:"MarkdownOverlayEditorStyle",class:"mmv7gx6",propsAsIs:!1,vars:{"mmv7gx6-0":[As(),"px"]}}),Ds=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:i,targetRect:r,onFinish:l,validatedSelection:s}=e,a=t.data,d=t.readonly===!0,[f,g]=I.useState(a===""||o),m=I.useCallback(()=>{g(c=>!c)},[]),h=a?"gdg-ml-6":"";return f?Je(Uo,{targetWidth:r.width-20,children:[$(Cn,{autoFocus:!0,highlight:!1,validatedSelection:s,value:a,onKeyDown:c=>{c.key==="Enter"&&c.stopPropagation()},onChange:n}),$("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t),children:$(nr,{})})]}):Je(Uo,{targetWidth:r.width,children:[$(Ms,{contents:a,createNode:i}),!d&&Je(Xn,{children:[$("div",{className:"spacer"}),$("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:m,children:$(Zn,{})})]}),$("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0})]})},Ps={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:rn,measure:(e,t,n)=>{const o=t.data.split(` +`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>ht(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:o,onFinishedEditing:i,markdownDivCreateNode:r,forceEditMode:l,validatedSelection:s}=e;return $(Ds,{onFinish:i,targetRect:o,value:n,validatedSelection:s,onChange:a=>t({...n,data:a.target.value}),forceEditMode:l,createNode:r})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Hs={getAccessibilityString:e=>e.row.toString(),kind:nn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Rs,measure:()=>44,draw:e=>Ws(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:o,posY:i}=e,{width:r,height:l}=t,s=n.drawHandle?7+(r-7)/2:r/2,a=l/2;if(Math.abs(o-s)<=10&&Math.abs(i-a)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Rs(e,t){const{ctx:n,theme:o}=e,i=o.markerFontFull,r=t??{};return(r==null?void 0:r.font)!==i&&(n.font=i,r.font=i),r.deprep=Ts,n.textAlign="center",r}function Ts(e){const{ctx:t}=e;t.textAlign="start"}function Ws(e,t,n,o,i,r){const{ctx:l,rect:s,hoverAmount:a,theme:d}=e,{x:f,y:g,width:m,height:h}=s,c=n?1:o==="checkbox-visible"?.6+.4*a:a;if(o!=="number"&&c>0){l.globalAlpha=c;const u=7*(n?a:1);if(io(l,d,n,i?f+u:f,g,i?m-u:m,h,!0,void 0,void 0,18,"center",r),i){l.globalAlpha=a,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(f+y,g+h/2+v,2,2);l.fillStyle=d.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const u=t.toString(),y=d.markerFontFull,v=f+m/2;o==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=d.textLight,l.font=y,l.fillText(u,v,g+h/2+kt(l,y)),a!==0&&(l.globalAlpha=1)}}const zs={getAccessibilityString:()=>"",kind:nn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ls(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Ls(e,t,n){const{ctx:o,rect:i,hoverAmount:r,theme:l,spriteManager:s}=e,{x:a,y:d,width:f,height:g}=i;o.beginPath(),o.globalAlpha=r,o.rect(a+1,d+1,f,g-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let h=0;if(n!==void 0){const u=g-8,y=a+8/2,v=d+8/2;s.drawSprite(n,"normal",o,y,v,u,l,m?1:r),h=u}else{h=24;const c=12,u=m?c:r*c,y=m?0:(1-r)*c*.5,v=l.cellHorizontalPadding+4;u>0&&(o.moveTo(a+v+y,d+g/2),o.lineTo(a+v+y+u,d+g/2),o.moveTo(a+v+y+u*.5,d+g/2-u*.5),o.lineTo(a+v+y+u*.5,d+g/2+u*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,h+a+l.cellHorizontalPadding+.5,d+g/2+kt(o,l)),o.beginPath()}const Ns=I.lazy(async()=>await Gi(()=>import("./number-overlay-editor-wZgFM_Mr.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),Os={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:rn,draw:e=>ht(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:i}=e;return $(I.Suspense,{fallback:null,children:$(Ns,{highlight:t,disabled:o.readonly===!0,value:o.data,fixedDecimals:o.fixedDecimals,allowNegative:o.allowNegative,thousandSeparator:o.thousandSeparator,decimalSeparator:o.decimalSeparator,validatedSelection:i,onChange:r=>n({...o,data:Number.isNaN(r.floatValue??0)?0:r.floatValue})})})},onPaste:(e,t,n)=>{const o=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(o)||t.data===o))return{...t,data:o,displayData:n.formattedString??t.displayData}}},Xs={getAccessibilityString:()=>"",measure:()=>108,kind:ae.Protected,needsHover:!1,needsHoverPosition:!1,draw:$s,onPaste:()=>{}};function $s(e){const{ctx:t,theme:n,rect:o}=e,{x:i,y:r,height:l}=o;t.beginPath();const s=2.5;let a=i+n.cellHorizontalPadding+s;const d=r+l/2,f=Math.cos(Io(30))*s,g=Math.sin(Io(30))*s;for(let m=0;m<12;m++)t.moveTo(a,d-s),t.lineTo(a,d+s),t.moveTo(a+f,d-g),t.lineTo(a-f,d+g),t.moveTo(a-f,d-g),t.lineTo(a+f,d+g),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Ys={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>rn(e,t,e.theme.textLight),draw:e=>ht(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:o,validatedSelection:i}=e;return $(Cn,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:i,onChange:r=>n({...o,data:r.target.value})})},onPaste:()=>{}},_s={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:rn,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:i,rect:r,theme:l,overrideCursor:s}=e,{displayData:a,contentAlign:d,hoverEffect:f,allowWrapping:g}=t;if(f===!0&&n>0){i.textBaseline="alphabetic";const m=l.cellHorizontalPadding,h=l.cellVerticalPadding,c=Vt(a,i,l.baseFontFull,"alphabetic"),u=r.height-h,y=Math.min(u,c.actualBoundingBoxAscent*2.5);i.beginPath(),st(i,r.x+m/2,r.y+(r.height-y)/2+1,c.width+m*3,y-1,l.roundingRadius??4),i.globalAlpha=n,i.fillStyle=sn(l.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=l.textDark,i.textBaseline="middle",s==null||s("text")}ht(e,a,d,g,o)},measure:(e,t,n)=>{const o=t.displayData.split(` +`,t.allowWrapping===!0?void 0:1);let i=0;for(const r of o)i=Math.max(i,e.measureText(r).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:o,value:i,validatedSelection:r}=t;return $(Cn,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:r,onChange:l=>o({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Vs=gt("div")({name:"UriOverlayEditorStyle",class:"uwr6ffw",propsAsIs:!1}),Us=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:i,validatedSelection:r,preview:l}=e,[s,a]=I.useState(!i&&(t===""||o)),d=I.useCallback(()=>{a(!0)},[]);return s?$(Cn,{validatedSelection:r,highlight:!0,autoFocus:!0,value:t,onChange:n}):Je(Vs,{children:[$("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer",children:l}),!i&&$("div",{className:"gdg-edit-icon",onClick:d,children:$(Zn,{})}),$("textarea",{className:"gdg-input",autoFocus:!0})]})},qs=Us;function qo(e,t,n,o){let i=n.cellHorizontalPadding;const r=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,s=e.actualBoundingBoxAscent;return o==="right"?i=t.width-l-n.cellHorizontalPadding:o==="center"&&(i=t.width/2-l/2),{x:i,y:r,width:l,height:s}}const js={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:rn,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:i,hoverY:r,rect:l,ctx:s}=e,a=t.displayData??t.data,d=t.hoverEffect===!0;if(o!==void 0&&d&&i!==void 0&&r!==void 0){const f=Vt(a,s,n.baseFontFull),g=qo(f,l,n,t.contentAlign),{x:m,y:h,width:c,height:u}=g;if(i>=m-4&&i<=m-4+c+8&&r>=h-4&&r<=h-4+u+8){const y=kt(s,n.baseFontFull);o("pointer");const v=5,w=h-y;s.beginPath(),s.moveTo(l.x+m,Math.floor(l.y+w+u+v)+.5),s.lineTo(l.x+m+c,Math.floor(l.y+w+u+v)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,ht({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),ht({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=d?n.linkColor:n.textDark,ht(e,a,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:i,theme:r}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=ii(l,r.baseFontFull);if(s===void 0)return;const a=qo(s,n,r,t.contentAlign);Ot({x:a.x-4,y:a.y-4,width:a.width+8,height:a.height+8},o,i)&&t.onClickUri(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:o,forceEditMode:i,validatedSelection:r}=t;return $(qs,{forceEditMode:o.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:o.data,preview:o.displayData??o.data,validatedSelection:r,readonly:o.readonly===!0,onChange:l=>n({...o,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},kl=[Hs,zs,is,cs,ms,ks,Ss,Ps,Os,Xs,Ys,_s,js],On=[];class Ks extends ai{constructor(){super(...arguments);oe(this,"imageLoaded",()=>{});oe(this,"loadedLocations",[]);oe(this,"cache",{});oe(this,"sendLoaded",Ki(()=>{this.imageLoaded(new tn(this.loadedLocations)),this.loadedLocations=[]},20));oe(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const o of n){const i=this.cache[o];let r=!1;for(let l=0;l{a||(a=!0,On.length<12?On.unshift(s):l||(s.src=""))}},f=new Promise(g=>s.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{s.src=n,await f,await s.decode();const g=this.cache[r];if(g!==void 0&&!a){g.img=s;for(const m of g.cells)this.loadedLocations.push(oo(m));l=!0,this.sendLoaded()}}catch{d.cancel()}}),this.cache[r]=d}loadOrGetImage(n,o,i){const r=n,l=this.cache[r];if(l!==void 0){const s=tt(o,i);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,i,r)}}const xl=Ks;export{jr as A,gl as B,Yn as C,Gn as D,Qi as E,sl as F,ae as G,dl as H,nn as I,bl as J,pl as K,Mo as L,ul as M,wl as N,xl as O,kl as P,yl as Q,Lo as R,Ur as S,hl as T,rl as U,Ji as a,ft as b,ml as c,cl as d,al as e,vl as f,fl as g,sn as h,ol as i,nl as j,_t as k,Nt as l,Yt as m,_n as n,No as o,Ot as p,cr as q,il as r,Ko as s,os as t,Ge as u,Zi as v,ll as w,Ir as x,vn as y,At as z}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["./number-overlay-editor-wZgFM_Mr.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./react-number-format.es-2Vaki8Uh.js","./number-overlay-editor-8QJ1sjy4.css"] diff --git a/docs/assets/imperative-scroll.stories-oW8fncC4.js b/docs/assets/imperative-scroll.stories-Yaxb7oEo.js similarity index 88% rename from docs/assets/imperative-scroll.stories-oW8fncC4.js rename to docs/assets/imperative-scroll.stories-Yaxb7oEo.js index 3972d7c7c..d23d520fc 100644 --- a/docs/assets/imperative-scroll.stories-oW8fncC4.js +++ b/docs/assets/imperative-scroll.stories-Yaxb7oEo.js @@ -1,4 +1,4 @@ -import{j as o,a as n,F as u}from"./marked.esm-dbrxtycE.js";import{R as g}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-zTb9g2fv.js";import{a as C,B as h,D as v,P as A,M as k,d as D}from"./utils-qU2KzddR.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>o(b,{children:o(e,{})})]},r=e=>{const{cols:c,getCellContent:p,onColumnResize:d,setCellValue:m}=C(),t=g.useRef(null);return o(h,{title:"Imperative scrolling",description:n(u,{children:[n(v,{children:["You can imperatively scroll to a cell by calling ",o(A,{children:"scrollTo"})," on a DataEditor ref."]}),n(k,{children:["Click ",o("button",{onClick:()=>{var l;(l=t.current)==null||l.scrollTo(4,99,"both",e.paddingX,e.paddingY,{vAlign:e.vAlign,hAlign:e.hAlign})},children:"Here"})," to scroll to column 4 row 100"]})]}),children:o(f,{...D,ref:t,rowMarkers:"clickable-number",getCellContent:p,columns:c,onCellEdited:m,onColumnResize:d,rows:1e4})})};r.args={paddingY:0,paddingX:0,vAlign:"start",hAlign:"start"};r.argTypes={paddingY:0,paddingX:0,vAlign:{control:{type:"select"},options:["start","center","end",void 0]},hAlign:{control:{type:"select"},options:["start","center","end",void 0]}};var i,a,s;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`p => { +import{j as o,a as n,F as u}from"./marked.esm-dbrxtycE.js";import{R as g}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-ZeeWpldS.js";import{a as C,B as h,D as v,P as A,M as k,d as D}from"./utils-MADpeXg5.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>o(b,{children:o(e,{})})]},r=e=>{const{cols:c,getCellContent:p,onColumnResize:d,setCellValue:m}=C(),t=g.useRef(null);return o(h,{title:"Imperative scrolling",description:n(u,{children:[n(v,{children:["You can imperatively scroll to a cell by calling ",o(A,{children:"scrollTo"})," on a DataEditor ref."]}),n(k,{children:["Click ",o("button",{onClick:()=>{var l;(l=t.current)==null||l.scrollTo(4,99,"both",e.paddingX,e.paddingY,{vAlign:e.vAlign,hAlign:e.hAlign})},children:"Here"})," to scroll to column 4 row 100"]})]}),children:o(f,{...D,ref:t,rowMarkers:"clickable-number",getCellContent:p,columns:c,onCellEdited:m,onColumnResize:d,rows:1e4})})};r.args={paddingY:0,paddingX:0,vAlign:"start",hAlign:"start"};r.argTypes={paddingY:0,paddingX:0,vAlign:{control:{type:"select"},options:["start","center","end",void 0]},hAlign:{control:{type:"select"},options:["start","center","end",void 0]}};var i,a,s;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`p => { const { cols, getCellContent, diff --git a/docs/assets/input-blending.stories-7l7a8cEj.js b/docs/assets/input-blending.stories-zezAtL-R.js similarity index 89% rename from docs/assets/input-blending.stories-7l7a8cEj.js rename to docs/assets/input-blending.stories-zezAtL-R.js index 400988b24..eda989ab3 100644 --- a/docs/assets/input-blending.stories-7l7a8cEj.js +++ b/docs/assets/input-blending.stories-zezAtL-R.js @@ -1,4 +1,4 @@ -import{j as n}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as s,D as a,u as p,d as m}from"./utils-qU2KzddR.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const E={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>n(d,{children:n(s,{title:"Input blending",description:n(a,{children:"Input blending can be enabled or disable between row, column, and range selections. Multi-selections can also be enabled or disabled with the same level of granularity."}),children:n(e,{})})})]},t=e=>{const{cols:i,getCellContent:c}=p(30);return n(u,{...m,rowMarkers:e.rowMultiSelect==="none"?"number":"both",keybindings:{clear:!0,copy:!0,downFill:!0,rightFill:!0,pageDown:!0,pageUp:!0,paste:!0,search:!0,selectAll:!0,selectColumn:!0,selectRow:!0},getCellsForSelection:!0,rangeSelect:e.rangeMultiSelect,columnSelect:e.columnMultiSelect,rowSelect:e.rowMultiSelect,rangeSelectionBlending:e.rangeBlending,columnSelectionBlending:e.columnBlending,rowSelectionBlending:e.rowBlending,getCellContent:c,columns:i,rows:1e4})};t.args={rangeBlending:"mixed",columnBlending:"mixed",rowBlending:"mixed",rangeMultiSelect:"rect",columnMultiSelect:"multi",rowMultiSelect:"multi"};t.argTypes={rangeBlending:{control:{type:"select"},options:["mixed","exclusive"]},columnBlending:{control:{type:"select"},options:["mixed","exclusive"]},rowBlending:{control:{type:"select"},options:["mixed","exclusive"]},rangeMultiSelect:{control:{type:"select"},options:["none","cell","rect","multi-cell","multi-rect"]},columnMultiSelect:{control:{type:"select"},options:["none","single","multi"]},rowMultiSelect:{control:{type:"select"},options:["none","single","multi"]}};var l,o,r;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`p => { +import{j as n}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as s,D as a,u as p,d as m}from"./utils-MADpeXg5.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const E={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>n(d,{children:n(s,{title:"Input blending",description:n(a,{children:"Input blending can be enabled or disable between row, column, and range selections. Multi-selections can also be enabled or disabled with the same level of granularity."}),children:n(e,{})})})]},t=e=>{const{cols:i,getCellContent:c}=p(30);return n(u,{...m,rowMarkers:e.rowMultiSelect==="none"?"number":"both",keybindings:{clear:!0,copy:!0,downFill:!0,rightFill:!0,pageDown:!0,pageUp:!0,paste:!0,search:!0,selectAll:!0,selectColumn:!0,selectRow:!0},getCellsForSelection:!0,rangeSelect:e.rangeMultiSelect,columnSelect:e.columnMultiSelect,rowSelect:e.rowMultiSelect,rangeSelectionBlending:e.rangeBlending,columnSelectionBlending:e.columnBlending,rowSelectionBlending:e.rowBlending,getCellContent:c,columns:i,rows:1e4})};t.args={rangeBlending:"mixed",columnBlending:"mixed",rowBlending:"mixed",rangeMultiSelect:"rect",columnMultiSelect:"multi",rowMultiSelect:"multi"};t.argTypes={rangeBlending:{control:{type:"select"},options:["mixed","exclusive"]},columnBlending:{control:{type:"select"},options:["mixed","exclusive"]},rowBlending:{control:{type:"select"},options:["mixed","exclusive"]},rangeMultiSelect:{control:{type:"select"},options:["none","cell","rect","multi-cell","multi-rect"]},columnMultiSelect:{control:{type:"select"},options:["none","single","multi"]},rowMultiSelect:{control:{type:"select"},options:["none","single","multi"]}};var l,o,r;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/keybindings.stories-n34M31zn.js b/docs/assets/keybindings.stories-qU4VQLV1.js similarity index 92% rename from docs/assets/keybindings.stories-n34M31zn.js rename to docs/assets/keybindings.stories-qU4VQLV1.js index 88577ec86..a2e974683 100644 --- a/docs/assets/keybindings.stories-n34M31zn.js +++ b/docs/assets/keybindings.stories-qU4VQLV1.js @@ -1,4 +1,4 @@ -import{j as n,a as s}from"./marked.esm-dbrxtycE.js";import{r as h}from"./index-BMVQvedj.js";import{D as f,k as C}from"./data-editor-all-zTb9g2fv.js";import{u as x,B as K,D as v,d as w}from"./utils-qU2KzddR.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>n(D,{children:n(o,{})})]},i=()=>{const{getCellContent:o,cols:y,setCellValue:g}=x(30,!1),u={display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridColumnGap:"32px",gridRowGap:"10px",marginBottom:"10px",marginTop:"20px",font:"13px sans-serif"},m={display:"flex",justifyContent:"space-between",alignItems:"center"},{copy:S,cut:G,paste:j,pageDown:E,pageUp:T,first:B,last:M,...a}=C,[r,b]=h.useState(a),l=(e,t)=>{b(k=>({...k,[e]:t}))};return n(K,{title:"Custom Keybindings",description:s(v,{children:["This demo showcases custom keybindings. Modify the keybindings using the controls below.",n("div",{style:u,children:Object.keys(a).map(e=>s("div",{style:m,children:[s("label",{children:[e,": "]}),s("div",{children:[n("input",{type:"checkbox",checked:r[e]===!0,onChange:t=>l(e,!!t.target.checked)}),n("input",{type:"text",style:{width:"100px"},value:r[e]||"",onChange:t=>l(e,t.target.value)})]})]},e))})]}),children:n(f,{...w,getCellContent:o,onCellEdited:g,keybindings:r,columns:y,rangeSelect:"multi-rect",rows:100,rowMarkers:"both"})})};var d,p,c;i.parameters={...i.parameters,docs:{...(d=i.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{j as n,a as s}from"./marked.esm-dbrxtycE.js";import{r as h}from"./index-BMVQvedj.js";import{D as f,k as C}from"./data-editor-all-ZeeWpldS.js";import{u as x,B as K,D as v,d as w}from"./utils-MADpeXg5.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>n(D,{children:n(o,{})})]},i=()=>{const{getCellContent:o,cols:y,setCellValue:g}=x(30,!1),u={display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridColumnGap:"32px",gridRowGap:"10px",marginBottom:"10px",marginTop:"20px",font:"13px sans-serif"},m={display:"flex",justifyContent:"space-between",alignItems:"center"},{copy:S,cut:G,paste:j,pageDown:E,pageUp:T,first:B,last:M,...a}=C,[r,b]=h.useState(a),l=(e,t)=>{b(k=>({...k,[e]:t}))};return n(K,{title:"Custom Keybindings",description:s(v,{children:["This demo showcases custom keybindings. Modify the keybindings using the controls below.",n("div",{style:u,children:Object.keys(a).map(e=>s("div",{style:m,children:[s("label",{children:[e,": "]}),s("div",{children:[n("input",{type:"checkbox",checked:r[e]===!0,onChange:t=>l(e,!!t.target.checked)}),n("input",{type:"text",style:{width:"100px"},value:r[e]||"",onChange:t=>l(e,t.target.value)})]})]},e))})]}),children:n(f,{...w,getCellContent:o,onCellEdited:g,keybindings:r,columns:y,rangeSelect:"multi-rect",rows:100,rowMarkers:"both"})})};var d,p,c;i.parameters={...i.parameters,docs:{...(d=i.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const { getCellContent, cols, diff --git a/docs/assets/layout-integration.stories-oXBi69Mb.js b/docs/assets/layout-integration.stories-lu4Lde2T.js similarity index 82% rename from docs/assets/layout-integration.stories-oXBi69Mb.js rename to docs/assets/layout-integration.stories-lu4Lde2T.js index 130ffd353..3ed5739ad 100644 --- a/docs/assets/layout-integration.stories-oXBi69Mb.js +++ b/docs/assets/layout-integration.stories-lu4Lde2T.js @@ -1,4 +1,4 @@ -import{j as t,a,F as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as s}from"./data-editor-all-zTb9g2fv.js";import{b as m,D as h,u as c,d as n}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const P={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>t(u,{children:a(m,{children:[t("h1",{children:"Layout Integration"}),t(h,{children:"Trying the grid in different situations"}),t(e,{})]})})]},r=()=>{const{cols:e,getCellContent:o}=c(1e3,!0,!0);return a(d,{children:[t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both",height:200}),t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both"}),a("div",{style:{display:"flex",height:"300px"},children:[t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both"}),t("div",{style:{flexShrink:0},children:"This is some text what happens here?"})]})]})};var i,l,p;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as t,a,F as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as s}from"./data-editor-all-ZeeWpldS.js";import{b as m,D as h,u as c,d as n}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const P={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>t(u,{children:a(m,{children:[t("h1",{children:"Layout Integration"}),t(h,{children:"Trying the grid in different situations"}),t(e,{})]})})]},r=()=>{const{cols:e,getCellContent:o}=c(1e3,!0,!0);return a(d,{children:[t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both",height:200}),t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both"}),a("div",{style:{display:"flex",height:"300px"},children:[t(s,{...n,getCellContent:o,columns:e,rows:10,rowMarkers:"both"}),t("div",{style:{flexShrink:0},children:"This is some text what happens here?"})]})]})};var i,l,p;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/multi-select-columns.stories-vgNzpHed.js b/docs/assets/multi-select-columns.stories-2oeztbOf.js similarity index 77% rename from docs/assets/multi-select-columns.stories-vgNzpHed.js rename to docs/assets/multi-select-columns.stories-2oeztbOf.js index 3b57e9deb..6c71b055a 100644 --- a/docs/assets/multi-select-columns.stories-vgNzpHed.js +++ b/docs/assets/multi-select-columns.stories-2oeztbOf.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-zTb9g2fv.js";import{B as u,D as d,P as s,M as C,K as n,u as h,d as D}from"./utils-qU2KzddR.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(M,{children:e(u,{title:"Multi select columns",description:t(m,{children:[t(d,{children:["You can select multiple columns by using the ",e(s,{children:"selectedColumns"})," and"," ",e(s,{children:"onSelectedColumnsChange"})," props"]}),t(C,{children:["Here you can multi select columns by using ",e(n,{children:"Ctrl"})," (on Windows) or"," ",e(n,{children:"⌘"})," (on Mac)"]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:c}=h(100);return e(p,{...D,getCellContent:c,rowMarkers:"both",columns:r,rows:1e5})};var l,a,i;o.parameters={...o.parameters,docs:{...(l=o.parameters)==null?void 0:l.docs,source:{originalSource:`() => { +import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-ZeeWpldS.js";import{B as u,D as d,P as s,M as C,K as n,u as h,d as D}from"./utils-MADpeXg5.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(M,{children:e(u,{title:"Multi select columns",description:t(m,{children:[t(d,{children:["You can select multiple columns by using the ",e(s,{children:"selectedColumns"})," and"," ",e(s,{children:"onSelectedColumnsChange"})," props"]}),t(C,{children:["Here you can multi select columns by using ",e(n,{children:"Ctrl"})," (on Windows) or"," ",e(n,{children:"⌘"})," (on Mac)"]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:c}=h(100);return e(p,{...D,getCellContent:c,rowMarkers:"both",columns:r,rows:1e5})};var l,a,i;o.parameters={...o.parameters,docs:{...(l=o.parameters)==null?void 0:l.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/new-column-button.stories-_UjPFsep.js b/docs/assets/new-column-button.stories-KCBl3BdD.js similarity index 83% rename from docs/assets/new-column-button.stories-_UjPFsep.js rename to docs/assets/new-column-button.stories-KCBl3BdD.js index 170f33109..9dbe13b59 100644 --- a/docs/assets/new-column-button.stories-_UjPFsep.js +++ b/docs/assets/new-column-button.stories-KCBl3BdD.js @@ -1,4 +1,4 @@ -import{j as t,a as i}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as d,D as p,P as C,u as f,d as h,C as w}from"./utils-qU2KzddR.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(g,{children:t(d,{title:"New column button",description:i(p,{children:["A new column button can be created using the ",t(C,{children:"rightElement"}),"."]}),children:t(o,{})})})]},e=()=>{const{cols:o,getCellContent:a}=f(10,!0),l=c.useMemo(()=>o.map(m=>({...m,grow:1})),[o]);return t(u,{...h,getCellContent:a,columns:l,rightElement:t(w,{children:t("button",{onClick:()=>window.alert("Add a column!"),children:"+"})}),rightElementProps:{fill:!1,sticky:!1},rows:3e3,rowMarkers:"both"})};var r,n,s;e.parameters={...e.parameters,docs:{...(r=e.parameters)==null?void 0:r.docs,source:{originalSource:`() => { +import{j as t,a as i}from"./marked.esm-dbrxtycE.js";import{R as c}from"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as d,D as p,P as C,u as f,d as h,C as w}from"./utils-MADpeXg5.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(g,{children:t(d,{title:"New column button",description:i(p,{children:["A new column button can be created using the ",t(C,{children:"rightElement"}),"."]}),children:t(o,{})})})]},e=()=>{const{cols:o,getCellContent:a}=f(10,!0),l=c.useMemo(()=>o.map(m=>({...m,grow:1})),[o]);return t(u,{...h,getCellContent:a,columns:l,rightElement:t(w,{children:t("button",{onClick:()=>window.alert("Add a column!"),children:"+"})}),rightElementProps:{fill:!1,sticky:!1},rows:3e3,rowMarkers:"both"})};var r,n,s;e.parameters={...e.parameters,docs:{...(r=e.parameters)==null?void 0:r.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/obscured-grid.stories-8VUfU7HC.js b/docs/assets/obscured-grid.stories-Do_HI9sC.js similarity index 85% rename from docs/assets/obscured-grid.stories-8VUfU7HC.js rename to docs/assets/obscured-grid.stories-Do_HI9sC.js index 51daacae6..3aadd19cf 100644 --- a/docs/assets/obscured-grid.stories-8VUfU7HC.js +++ b/docs/assets/obscured-grid.stories-Do_HI9sC.js @@ -1,4 +1,4 @@ -import{j as o,a as n,F as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as C,D as m,M as p,u as g,d as x}from"./utils-qU2KzddR.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const S={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>o(h,{children:n(C,{title:"Obscured Data Grid",description:n(c,{children:[o(m,{children:"The data grid should respect being obscured by other elements"}),o(p,{children:"This is mostly a test area because its hard to test with unit tests."})]}),children:[o(r,{}),o("div",{style:{position:"absolute",top:0,left:"50%",width:"50%",height:"100%",background:"rgba(0,0,0,0.5)",zIndex:100}})]})})]},t=()=>{const{cols:r,getCellContent:i,setCellValue:d}=g(60,!1);return o(u,{...x,getCellContent:i,onItemHovered:e=>console.log("onItemHovered",e),onCellClicked:e=>console.log("onCellClicked",e),onHeaderClicked:e=>console.log("onHeaderClicked",e),onCellContextMenu:e=>console.log("onCellContextMenu",e),onHeaderContextMenu:e=>console.log("onHeaderContextMenu",e),columns:r,rowMarkers:"both",onPaste:!0,onCellEdited:d,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:1e4})};var l,s,a;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`() => { +import{j as o,a as n,F as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as C,D as m,M as p,u as g,d as x}from"./utils-MADpeXg5.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const S={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>o(h,{children:n(C,{title:"Obscured Data Grid",description:n(c,{children:[o(m,{children:"The data grid should respect being obscured by other elements"}),o(p,{children:"This is mostly a test area because its hard to test with unit tests."})]}),children:[o(r,{}),o("div",{style:{position:"absolute",top:0,left:"50%",width:"50%",height:"100%",background:"rgba(0,0,0,0.5)",zIndex:100}})]})})]},t=()=>{const{cols:r,getCellContent:i,setCellValue:d}=g(60,!1);return o(u,{...x,getCellContent:i,onItemHovered:e=>console.log("onItemHovered",e),onCellClicked:e=>console.log("onCellClicked",e),onHeaderClicked:e=>console.log("onHeaderClicked",e),onCellContextMenu:e=>console.log("onCellContextMenu",e),onHeaderContextMenu:e=>console.log("onHeaderContextMenu",e),columns:r,rowMarkers:"both",onPaste:!0,onCellEdited:d,trailingRowOptions:{sticky:!0,tint:!0,hint:"New row..."},rows:1e4})};var l,s,a;t.parameters={...t.parameters,docs:{...(l=t.parameters)==null?void 0:l.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/observe-visible-region.stories-hggE4aBc.js b/docs/assets/observe-visible-region.stories-z9Laxci_.js similarity index 84% rename from docs/assets/observe-visible-region.stories-hggE4aBc.js rename to docs/assets/observe-visible-region.stories-z9Laxci_.js index e98c55340..a38f2c5ef 100644 --- a/docs/assets/observe-visible-region.stories-hggE4aBc.js +++ b/docs/assets/observe-visible-region.stories-z9Laxci_.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as g}from"./marked.esm-dbrxtycE.js";import{R as p}from"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-zTb9g2fv.js";import{u as h,B as b,D as u,P as R,M as v,K as n,d as y}from"./utils-qU2KzddR.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(f,{children:e(r,{})})]},o=()=>{const{cols:r,getCellContent:c}=h(100),[i,m]=p.useState({x:0,y:0,width:0,height:0});return e(b,{title:"Observe Visible Region",description:t(g,{children:[t(u,{children:["The visible region can be observed using ",e(R,{children:"onVisibleRegionChanged"})]}),t(v,{children:["Then current visible region is x:",e(n,{children:i.x})," y:",e(n,{children:i.y})," width:",e(n,{children:i.width})," height:",e(n,{children:i.height})]})]}),children:e(d,{...y,getCellContent:c,columns:r,rows:1e3,onVisibleRegionChanged:m})})};var s,a,l;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`() => { +import{j as e,a as t,F as g}from"./marked.esm-dbrxtycE.js";import{R as p}from"./index-BMVQvedj.js";import{D as d}from"./data-editor-all-ZeeWpldS.js";import{u as h,B as b,D as u,P as R,M as v,K as n,d as y}from"./utils-MADpeXg5.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(f,{children:e(r,{})})]},o=()=>{const{cols:r,getCellContent:c}=h(100),[i,m]=p.useState({x:0,y:0,width:0,height:0});return e(b,{title:"Observe Visible Region",description:t(g,{children:[t(u,{children:["The visible region can be observed using ",e(R,{children:"onVisibleRegionChanged"})]}),t(v,{children:["Then current visible region is x:",e(n,{children:i.x})," y:",e(n,{children:i.y})," width:",e(n,{children:i.width})," height:",e(n,{children:i.height})]})]}),children:e(d,{...y,getCellContent:c,columns:r,rows:1e3,onVisibleRegionChanged:m})})};var s,a,l;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/one-hundred-thousand-columns.stories-dDLvE0PG.js b/docs/assets/one-hundred-thousand-columns.stories-H4KjbryM.js similarity index 77% rename from docs/assets/one-hundred-thousand-columns.stories-dDLvE0PG.js rename to docs/assets/one-hundred-thousand-columns.stories-H4KjbryM.js index 69338b9a7..0b0b12321 100644 --- a/docs/assets/one-hundred-thousand-columns.stories-dDLvE0PG.js +++ b/docs/assets/one-hundred-thousand-columns.stories-H4KjbryM.js @@ -1,4 +1,4 @@ -import{j as o}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-zTb9g2fv.js";import{B as l,D as m,u as d,d as p}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(u,{children:o(l,{title:"One Hundred Thousand Columns",description:o(m,{children:"Data grid supports way more columns than you will ever need. Also this is rendering 10 million cells but that's not important."}),children:o(t,{})})})]},r=()=>{const{cols:t,getCellContent:a}=d(1e5);return o(i,{...p,getCellContent:a,columns:t,rows:1e3})};var e,s,n;r.parameters={...r.parameters,docs:{...(e=r.parameters)==null?void 0:e.docs,source:{originalSource:`() => { +import{j as o}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-ZeeWpldS.js";import{B as l,D as m,u as d,d as p}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(u,{children:o(l,{title:"One Hundred Thousand Columns",description:o(m,{children:"Data grid supports way more columns than you will ever need. Also this is rendering 10 million cells but that's not important."}),children:o(t,{})})})]},r=()=>{const{cols:t,getCellContent:a}=d(1e5);return o(i,{...p,getCellContent:a,columns:t,rows:1e3})};var e,s,n;r.parameters={...r.parameters,docs:{...(e=r.parameters)==null?void 0:e.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/one-million-rows.stories-ztAARuLY.js b/docs/assets/one-million-rows.stories-p8UsVN67.js similarity index 77% rename from docs/assets/one-million-rows.stories-ztAARuLY.js rename to docs/assets/one-million-rows.stories-p8UsVN67.js index ab2a84bbb..5e6a8a2da 100644 --- a/docs/assets/one-million-rows.stories-ztAARuLY.js +++ b/docs/assets/one-million-rows.stories-p8UsVN67.js @@ -1,4 +1,4 @@ -import{j as o}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-zTb9g2fv.js";import{B as l,D as m,u as p,d as c}from"./utils-qU2KzddR.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const S={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(d,{children:o(l,{title:"One Million Rows",description:o(m,{children:"Data grid supports over 1 million rows. Your limit is mostly RAM."}),children:o(t,{})})})]},r=()=>{const{cols:t,getCellContent:a}=p(6);return o(n,{...c,getCellContent:a,columns:t,rowHeight:31,rows:1e6,rowMarkers:"number"})};var e,s,i;r.parameters={...r.parameters,docs:{...(e=r.parameters)==null?void 0:e.docs,source:{originalSource:`() => { +import{j as o}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-ZeeWpldS.js";import{B as l,D as m,u as p,d as c}from"./utils-MADpeXg5.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const S={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(d,{children:o(l,{title:"One Million Rows",description:o(m,{children:"Data grid supports over 1 million rows. Your limit is mostly RAM."}),children:o(t,{})})})]},r=()=>{const{cols:t,getCellContent:a}=p(6);return o(n,{...c,getCellContent:a,columns:t,rowHeight:31,rows:1e6,rowMarkers:"number"})};var e,s,i;r.parameters={...r.parameters,docs:{...(e=r.parameters)==null?void 0:e.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/overscroll.stories-hbmC9HSu.js b/docs/assets/overscroll.stories-jctFGx74.js similarity index 78% rename from docs/assets/overscroll.stories-hbmC9HSu.js rename to docs/assets/overscroll.stories-jctFGx74.js index 1fe3356a3..6d0228356 100644 --- a/docs/assets/overscroll.stories-hbmC9HSu.js +++ b/docs/assets/overscroll.stories-jctFGx74.js @@ -1,4 +1,4 @@ -import{j as r,F as m,a as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-zTb9g2fv.js";import{B as u,D as g,P as t,u as h,d as D}from"./utils-qU2KzddR.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>r(f,{children:r(u,{title:"Overscroll",description:r(m,{children:d(g,{children:["You can allocate extra space at the ends of the grid by setting the"," ",r(t,{children:"overscrollX"})," and ",r(t,{children:"overscrollY"})," props"]})}),children:r(e,{})})})]},o=e=>{const{overscrollX:c,overscrollY:n}=e,{cols:i,getCellContent:p}=h(20);return r(v,{...D,getCellContent:p,columns:i,overscrollX:c,overscrollY:n,rows:50})};o.argTypes={overscrollX:{control:{type:"range",min:0,max:600}},overscrollY:{control:{type:"range",min:0,max:600}}};o.args={overscrollX:200,overscrollY:200};var s,l,a;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`p => { +import{j as r,F as m,a as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-ZeeWpldS.js";import{B as u,D as g,P as t,u as h,d as D}from"./utils-MADpeXg5.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>r(f,{children:r(u,{title:"Overscroll",description:r(m,{children:d(g,{children:["You can allocate extra space at the ends of the grid by setting the"," ",r(t,{children:"overscrollX"})," and ",r(t,{children:"overscrollY"})," props"]})}),children:r(e,{})})})]},o=e=>{const{overscrollX:c,overscrollY:n}=e,{cols:i,getCellContent:p}=h(20);return r(v,{...D,getCellContent:p,columns:i,overscrollX:c,overscrollY:n,rows:50})};o.argTypes={overscrollX:{control:{type:"range",min:0,max:600}},overscrollY:{control:{type:"range",min:0,max:600}}};o.args={overscrollX:200,overscrollY:200};var s,l,a;o.parameters={...o.parameters,docs:{...(s=o.parameters)==null?void 0:s.docs,source:{originalSource:`p => { const { overscrollX, overscrollY diff --git a/docs/assets/padding.stories-QYa0-po6.js b/docs/assets/padding.stories-YAYw5imX.js similarity index 78% rename from docs/assets/padding.stories-QYa0-po6.js rename to docs/assets/padding.stories-YAYw5imX.js index 395289764..a3e19f0f4 100644 --- a/docs/assets/padding.stories-QYa0-po6.js +++ b/docs/assets/padding.stories-YAYw5imX.js @@ -1,4 +1,4 @@ -import{j as t,F as g,a as l}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as c}from"./data-editor-all-zTb9g2fv.js";import{B as h,D as u,P as e,u as D,d as f}from"./utils-qU2KzddR.js";import{S as x}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(x,{children:t(h,{title:"Padding",description:t(g,{children:l(u,{children:["You can add padding at the ends of the grid by setting the"," ",t(e,{children:"paddingRight"})," and ",t(e,{children:"paddingBottom"})," props"]})}),children:t(r,{})})})]},o=r=>{const{paddingRight:d,paddingBottom:s}=r,{cols:p,getCellContent:m}=D(20);return t(c,{...f,getCellContent:m,columns:p,rowMarkers:"both",experimental:{paddingRight:d,paddingBottom:s},rows:50})};o.argTypes={paddingRight:{control:{type:"range",min:0,max:600}},paddingBottom:{control:{type:"range",min:0,max:600}}};o.args={paddingRight:200,paddingBottom:200};var a,n,i;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`p => { +import{j as t,F as g,a as l}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as c}from"./data-editor-all-ZeeWpldS.js";import{B as h,D as u,P as e,u as D,d as f}from"./utils-MADpeXg5.js";import{S as x}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(x,{children:t(h,{title:"Padding",description:t(g,{children:l(u,{children:["You can add padding at the ends of the grid by setting the"," ",t(e,{children:"paddingRight"})," and ",t(e,{children:"paddingBottom"})," props"]})}),children:t(r,{})})})]},o=r=>{const{paddingRight:d,paddingBottom:s}=r,{cols:p,getCellContent:m}=D(20);return t(c,{...f,getCellContent:m,columns:p,rowMarkers:"both",experimental:{paddingRight:d,paddingBottom:s},rows:50})};o.argTypes={paddingRight:{control:{type:"range",min:0,max:600}},paddingBottom:{control:{type:"range",min:0,max:600}}};o.args={paddingRight:200,paddingBottom:200};var a,n,i;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`p => { const { paddingRight, paddingBottom diff --git a/docs/assets/paste-support.stories-RpELQuPB.js b/docs/assets/paste-support.stories--aYIJkKr.js similarity index 86% rename from docs/assets/paste-support.stories-RpELQuPB.js rename to docs/assets/paste-support.stories--aYIJkKr.js index b8a23f5c9..3961da59f 100644 --- a/docs/assets/paste-support.stories-RpELQuPB.js +++ b/docs/assets/paste-support.stories--aYIJkKr.js @@ -1,4 +1,4 @@ -import{j as e,a,F as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-zTb9g2fv.js";import{B as u,D as c,P as g,M as h,u as f,d as C}from"./utils-qU2KzddR.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(y,{children:e(u,{title:"Paste support",description:a(d,{children:[a(c,{children:["The data grid can handle paste automatically by returning true from"," ",e(g,{children:"onPaste"}),". You can also return false and handle paste yourself. If paste is undefined the DataEditor will do its best to paste to the current cell."]}),e(h,{children:"Paste supports the copy format of Google Sheets and Excel. Below is an example of data copied from excel with some escaped text."}),e("textarea",{value:`Sunday Dogs https://google.com +import{j as e,a,F as d}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ZeeWpldS.js";import{B as u,D as c,P as g,M as h,u as f,d as C}from"./utils-MADpeXg5.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(y,{children:e(u,{title:"Paste support",description:a(d,{children:[a(c,{children:["The data grid can handle paste automatically by returning true from"," ",e(g,{children:"onPaste"}),". You can also return false and handle paste yourself. If paste is undefined the DataEditor will do its best to paste to the current cell."]}),e(h,{children:"Paste supports the copy format of Google Sheets and Excel. Below is an example of data copied from excel with some escaped text."}),e("textarea",{value:`Sunday Dogs https://google.com Monday Cats https://google.com Tuesday Turtles https://google.com Wednesday Bears https://google.com diff --git a/docs/assets/prevent-diagonal-scroll.stories-M-p0URcv.js b/docs/assets/prevent-diagonal-scroll.stories-1SfpzkSI.js similarity index 74% rename from docs/assets/prevent-diagonal-scroll.stories-M-p0URcv.js rename to docs/assets/prevent-diagonal-scroll.stories-1SfpzkSI.js index 17b07f740..a04006f86 100644 --- a/docs/assets/prevent-diagonal-scroll.stories-M-p0URcv.js +++ b/docs/assets/prevent-diagonal-scroll.stories-1SfpzkSI.js @@ -1,4 +1,4 @@ -import{j as r,F as i,a as s}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-zTb9g2fv.js";import{B as c,D as m,P as d,u as g,d as D}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(u,{children:r(c,{title:"Prevent Diagonal Scroll",description:r(i,{children:s(m,{children:["Diagonal scrolling can be prevented by setting"," ",r(d,{children:"preventDiagonalScrolling"}),"."]})}),children:r(o,{})})})]},e=()=>{const{cols:o,getCellContent:l}=g(200);return r(p,{...D,getCellContent:l,columns:o,preventDiagonalScrolling:!0,rows:5e3})};var t,a,n;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`() => { +import{j as r,F as i,a as s}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-ZeeWpldS.js";import{B as c,D as m,P as d,u as g,d as D}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const F={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(u,{children:r(c,{title:"Prevent Diagonal Scroll",description:r(i,{children:s(m,{children:["Diagonal scrolling can be prevented by setting"," ",r(d,{children:"preventDiagonalScrolling"}),"."]})}),children:r(o,{})})})]},e=()=>{const{cols:o,getCellContent:l}=g(200);return r(p,{...D,getCellContent:l,columns:o,preventDiagonalScrolling:!0,rows:5e3})};var t,a,n;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/rapid-updates.stories-uoglvjgu.js b/docs/assets/rapid-updates.stories-AEZyu2Ww.js similarity index 92% rename from docs/assets/rapid-updates.stories-uoglvjgu.js rename to docs/assets/rapid-updates.stories-AEZyu2Ww.js index ec97445ce..86d67cd50 100644 --- a/docs/assets/rapid-updates.stories-uoglvjgu.js +++ b/docs/assets/rapid-updates.stories-AEZyu2Ww.js @@ -1,4 +1,4 @@ -import{j as e,a as h,F as k}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{u as U,B as M,D as b,M as E,K as I,d as G}from"./utils-qU2KzddR.js";import{G as v}from"./image-window-loader--5E_ifQX.js";import{S as A}from"./story-utils-K2EZnGjM.js";import{D as F}from"./data-editor-all-zTb9g2fv.js";import"./index-PWBWJyi_.js";import"./_baseIteratee-WTHxv43n.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./flatten-qRvRBp6y.js";import"./throttle-7EuXLZa7.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./scrolling-data-grid-rB9VuUnF.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(A,{children:e(r,{})})]};let w=1;function R(){return w=w*16807%2147483647}const a=()=>{const{cols:r,getCellContent:D,setCellValueRaw:s}=U(100),l=n.useRef(null),d=n.useRef(0),o=n.useRef(null);return n.useEffect(()=>{let i=0;const c=()=>{var p;const u=[],x=performance.now();for(let t=0;t<5e3;t++){const f=Math.max(10,R()%100),m=R()%1e4;s([f,m],{kind:v.Text,data:t.toString(),displayData:`${t}k`,themeOverride:t%5!==0?{bgCell:"#f2fff4",textDark:"#00d41c"}:{bgCell:"#fff6f6",textDark:"#d40000"},allowOverlay:!0,lastUpdated:x}),u.push({cell:[f,m]})}d.current+=5e3,o.current!==null&&(o.current.textContent=`${d.current}`),(p=l.current)==null||p.updateCells(u),i=window.requestAnimationFrame(c)};return c(),()=>{cancelAnimationFrame(i)}},[s]),e(M,{title:"Rapid updating",description:h(k,{children:[e(b,{children:"Data grid can support many thousands of updates per seconds. The data grid can easily update data faster than a human can read it, more importantly the faster the data grid can update, the more time your code can spend doing more valuable work."}),h(E,{children:["Updates processed: ",e(I,{ref:o})," We could do this faster but we wrote a really crappy data store for this demo which is actually slowing down the data grid."]})]}),children:e(F,{...G,ref:l,getCellContent:D,columns:r,rows:1e4})})};var C,g,y;a.parameters={...a.parameters,docs:{...(C=a.parameters)==null?void 0:C.docs,source:{originalSource:`() => { +import{j as e,a as h,F as k}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{u as U,B as M,D as b,M as E,K as I,d as G}from"./utils-MADpeXg5.js";import{G as v}from"./image-window-loader-ggeJlWLo.js";import{S as A}from"./story-utils-K2EZnGjM.js";import{D as F}from"./data-editor-all-ZeeWpldS.js";import"./index-PWBWJyi_.js";import"./_baseIteratee-WTHxv43n.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./flatten-qRvRBp6y.js";import"./throttle-7EuXLZa7.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./scrolling-data-grid-wnX0bxop.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(A,{children:e(r,{})})]};let w=1;function R(){return w=w*16807%2147483647}const a=()=>{const{cols:r,getCellContent:D,setCellValueRaw:s}=U(100),l=n.useRef(null),d=n.useRef(0),o=n.useRef(null);return n.useEffect(()=>{let i=0;const c=()=>{var p;const u=[],x=performance.now();for(let t=0;t<5e3;t++){const f=Math.max(10,R()%100),m=R()%1e4;s([f,m],{kind:v.Text,data:t.toString(),displayData:`${t}k`,themeOverride:t%5!==0?{bgCell:"#f2fff4",textDark:"#00d41c"}:{bgCell:"#fff6f6",textDark:"#d40000"},allowOverlay:!0,lastUpdated:x}),u.push({cell:[f,m]})}d.current+=5e3,o.current!==null&&(o.current.textContent=`${d.current}`),(p=l.current)==null||p.updateCells(u),i=window.requestAnimationFrame(c)};return c(),()=>{cancelAnimationFrame(i)}},[s]),e(M,{title:"Rapid updating",description:h(k,{children:[e(b,{children:"Data grid can support many thousands of updates per seconds. The data grid can easily update data faster than a human can read it, more importantly the faster the data grid can update, the more time your code can spend doing more valuable work."}),h(E,{children:["Updates processed: ",e(I,{ref:o})," We could do this faster but we wrote a really crappy data store for this demo which is actually slowing down the data grid."]})]}),children:e(F,{...G,ref:l,getCellContent:D,columns:r,rows:1e4})})};var C,g,y;a.parameters={...a.parameters,docs:{...(C=a.parameters)==null?void 0:C.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/rearrange-columns.stories-sF1dM7Mx.js b/docs/assets/rearrange-columns.stories-3_bNW4sh.js similarity index 88% rename from docs/assets/rearrange-columns.stories-sF1dM7Mx.js rename to docs/assets/rearrange-columns.stories-3_bNW4sh.js index 92252ceb8..5bdf8097d 100644 --- a/docs/assets/rearrange-columns.stories-sF1dM7Mx.js +++ b/docs/assets/rearrange-columns.stories-3_bNW4sh.js @@ -1,4 +1,4 @@ -import{j as t,a as x}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-zTb9g2fv.js";import{B as h,D as k,P as f,u as I,d as S}from"./utils-qU2KzddR.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>t(w,{children:t(h,{title:"Rearrange Columns",description:x(k,{children:["Columns can be rearranged by drag and dropping, as long as you respond to the"," ",t(f,{children:"onColumnMoved"})," callback."]}),children:t(e,{})})})]},s=()=>{const{cols:e,getCellContent:d}=I(60),[a,p]=l.useState(e),u=l.useCallback((r,o)=>{p(c=>{const n=[...c],[M]=n.splice(r,1);return n.splice(o,0,M),n})},[]),g=l.useCallback((r,o)=>o!==3,[]),b=l.useCallback(([r,o])=>{const c=e.findIndex(n=>n.title===a[r].title);return d([c,o])},[e,d,a]);return t(v,{...S,freezeColumns:1,rowMarkers:"both",getCellContent:b,onColumnProposeMove:g,columns:a,onColumnMoved:u,columnSelectionBlending:"mixed",rangeSelectionBlending:"mixed",rows:1e3})};var i,C,m;s.parameters={...s.parameters,docs:{...(i=s.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as t,a as x}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as v}from"./data-editor-all-ZeeWpldS.js";import{B as h,D as k,P as f,u as I,d as S}from"./utils-MADpeXg5.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>t(w,{children:t(h,{title:"Rearrange Columns",description:x(k,{children:["Columns can be rearranged by drag and dropping, as long as you respond to the"," ",t(f,{children:"onColumnMoved"})," callback."]}),children:t(e,{})})})]},s=()=>{const{cols:e,getCellContent:d}=I(60),[a,p]=l.useState(e),u=l.useCallback((r,o)=>{p(c=>{const n=[...c],[M]=n.splice(r,1);return n.splice(o,0,M),n})},[]),g=l.useCallback((r,o)=>o!==3,[]),b=l.useCallback(([r,o])=>{const c=e.findIndex(n=>n.title===a[r].title);return d([c,o])},[e,d,a]);return t(v,{...S,freezeColumns:1,rowMarkers:"both",getCellContent:b,onColumnProposeMove:g,columns:a,onColumnMoved:u,columnSelectionBlending:"mixed",rangeSelectionBlending:"mixed",rows:1e3})};var i,C,m;s.parameters={...s.parameters,docs:{...(i=s.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/reorder-rows.stories-O3M8AWLP.js b/docs/assets/reorder-rows.stories-FwicXjYY.js similarity index 87% rename from docs/assets/reorder-rows.stories-O3M8AWLP.js rename to docs/assets/reorder-rows.stories-FwicXjYY.js index 0c34315e3..85d2d79fd 100644 --- a/docs/assets/reorder-rows.stories-O3M8AWLP.js +++ b/docs/assets/reorder-rows.stories-FwicXjYY.js @@ -1,4 +1,4 @@ -import{j as o,F as C,a as D}from"./marked.esm-dbrxtycE.js";import{l as f}from"./lodash-8jIGfDyZ.js";import{R as t}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{B as b,D as g,P as v,d as k}from"./utils-qU2KzddR.js";import{G as x}from"./image-window-loader--5E_ifQX.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>o(M,{children:o(b,{title:"Reorder Rows",description:o(C,{children:D(g,{children:["Rows can be re-arranged by using the ",o(v,{children:"onRowMoved"})," callback. When set the first row can be used to drag and drop."]})}),children:o(s,{})})})]},a=()=>{const s=t.useMemo(()=>[{title:"Col A",width:150},{title:"Col B",width:150}],[]),[n,m]=t.useState(()=>f.range(0,50).map(e=>[`A: ${e}`,`B: ${e}`])),p=t.useCallback(([e,r])=>({kind:x.Text,allowOverlay:!1,data:n[r][e],displayData:n[r][e]}),[n]),w=t.useCallback((e,r)=>{m(u=>{const l=[...u],R=l.splice(e,1);return l.splice(r,0,...R),l})},[]);return o(h,{...k,rowMarkers:"both",onRowMoved:w,getCellContent:p,columns:s,rows:50})};var d,i,c;a.parameters={...a.parameters,docs:{...(d=a.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{j as o,F as C,a as D}from"./marked.esm-dbrxtycE.js";import{l as f}from"./lodash-8jIGfDyZ.js";import{R as t}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{B as b,D as g,P as v,d as k}from"./utils-MADpeXg5.js";import{G as x}from"./image-window-loader-ggeJlWLo.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[s=>o(M,{children:o(b,{title:"Reorder Rows",description:o(C,{children:D(g,{children:["Rows can be re-arranged by using the ",o(v,{children:"onRowMoved"})," callback. When set the first row can be used to drag and drop."]})}),children:o(s,{})})})]},a=()=>{const s=t.useMemo(()=>[{title:"Col A",width:150},{title:"Col B",width:150}],[]),[n,m]=t.useState(()=>f.range(0,50).map(e=>[`A: ${e}`,`B: ${e}`])),p=t.useCallback(([e,r])=>({kind:x.Text,allowOverlay:!1,data:n[r][e],displayData:n[r][e]}),[n]),w=t.useCallback((e,r)=>{m(u=>{const l=[...u],R=l.splice(e,1);return l.splice(r,0,...R),l})},[]);return o(h,{...k,rowMarkers:"both",onRowMoved:w,getCellContent:p,columns:s,rows:50})};var d,i,c;a.parameters={...a.parameters,docs:{...(d=a.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const cols = React.useMemo(() => [{ title: "Col A", width: 150 diff --git a/docs/assets/resizable-columns.stories-XXhh_SVO.js b/docs/assets/resizable-columns.stories-Dibf-Amn.js similarity index 85% rename from docs/assets/resizable-columns.stories-XXhh_SVO.js rename to docs/assets/resizable-columns.stories-Dibf-Amn.js index 773258069..adcf10513 100644 --- a/docs/assets/resizable-columns.stories-XXhh_SVO.js +++ b/docs/assets/resizable-columns.stories-Dibf-Amn.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as c}from"./marked.esm-dbrxtycE.js";import{R as u}from"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-zTb9g2fv.js";import{B as d,D as h,P as s,M as C,u as g,d as f}from"./utils-qU2KzddR.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(z,{children:e(d,{title:"Resizable columns",description:t(c,{children:[t(h,{children:["You can resize columns by dragging their edges, as long as you respond to the"," ",e(s,{children:"onColumnResize"})," prop."]}),t(C,{children:["By setting the ",e(s,{children:"overscrollX"})," property extra space can be allocated at the end of the grid to allow for easier resizing of the final column. You can highlight multiple columns to resize them all at once."]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:i,onColumnResize:m}=g(60);return e(p,{...f,getCellContent:i,columns:r,rowMarkers:"both",overscrollX:200,overscrollY:200,maxColumnAutoWidth:500,maxColumnWidth:2e3,rows:50,scaleToRem:!0,theme:u.useMemo(()=>({baseFontStyle:"0.8125rem",headerFontStyle:"600 0.8125rem",editorFontSize:"0.8125rem"}),[]),onColumnResize:m})};var a,n,l;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { +import{j as e,a as t,F as c}from"./marked.esm-dbrxtycE.js";import{R as u}from"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-ZeeWpldS.js";import{B as d,D as h,P as s,M as C,u as g,d as f}from"./utils-MADpeXg5.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const Y={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(z,{children:e(d,{title:"Resizable columns",description:t(c,{children:[t(h,{children:["You can resize columns by dragging their edges, as long as you respond to the"," ",e(s,{children:"onColumnResize"})," prop."]}),t(C,{children:["By setting the ",e(s,{children:"overscrollX"})," property extra space can be allocated at the end of the grid to allow for easier resizing of the final column. You can highlight multiple columns to resize them all at once."]})]}),children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:i,onColumnResize:m}=g(60);return e(p,{...f,getCellContent:i,columns:r,rowMarkers:"both",overscrollX:200,overscrollY:200,maxColumnAutoWidth:500,maxColumnWidth:2e3,rows:50,scaleToRem:!0,theme:u.useMemo(()=>({baseFontStyle:"0.8125rem",headerFontStyle:"600 0.8125rem",editorFontSize:"0.8125rem"}),[]),onColumnResize:m})};var a,n,l;o.parameters={...o.parameters,docs:{...(a=o.parameters)==null?void 0:a.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/right-element.stories-NA-kKa_l.js b/docs/assets/right-element.stories-m3yQrSTF.js similarity index 90% rename from docs/assets/right-element.stories-NA-kKa_l.js rename to docs/assets/right-element.stories-m3yQrSTF.js index aeae10342..2343a0d9b 100644 --- a/docs/assets/right-element.stories-NA-kKa_l.js +++ b/docs/assets/right-element.stories-m3yQrSTF.js @@ -1,4 +1,4 @@ -import{j as t,a as d}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as g}from"./data-editor-all-zTb9g2fv.js";import{B as R,D as b,P as y,u as C,d as x}from"./utils-qU2KzddR.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>t(k,{children:t(R,{title:"Right Element",description:d(b,{children:["A DOM element may be added as a trailer to the grid by using the"," ",t(y,{children:"rightElement"})," prop."]}),children:t(n,{})})})]},o=()=>{const{cols:n,getCellContent:m,setCellValue:a}=C(8,!1),u=l.useMemo(()=>n.map(s=>({...s,grow:1})),[n]),[r,w]=l.useState(300),h=l.useCallback(()=>{const s=r;w(e=>e+1);for(let e=0;e<6;e++)a([e,s],{displayData:"",data:""})},[r,a]);return t(g,{...x,getCellContent:m,columns:u,rowMarkers:"both",onCellEdited:a,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:r,onRowAppended:h,rightElementProps:{sticky:!0},rightElement:d("div",{style:{height:"100%",padding:"20px 20px 40px 20px",width:200,color:"black",whiteSpace:"pre-wrap",backgroundColor:"rgba(240, 240, 250, 0.2)",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0 0 10px rgba(0, 0, 0, 0.15)",backdropFilter:"blur(12px)"},children:["This is a real DOM element. You can put whatever you want here. You can also size it as big as you want. ",` +import{j as t,a as d}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as g}from"./data-editor-all-ZeeWpldS.js";import{B as R,D as b,P as y,u as C,d as x}from"./utils-MADpeXg5.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>t(k,{children:t(R,{title:"Right Element",description:d(b,{children:["A DOM element may be added as a trailer to the grid by using the"," ",t(y,{children:"rightElement"})," prop."]}),children:t(n,{})})})]},o=()=>{const{cols:n,getCellContent:m,setCellValue:a}=C(8,!1),u=l.useMemo(()=>n.map(s=>({...s,grow:1})),[n]),[r,w]=l.useState(300),h=l.useCallback(()=>{const s=r;w(e=>e+1);for(let e=0;e<6;e++)a([e,s],{displayData:"",data:""})},[r,a]);return t(g,{...x,getCellContent:m,columns:u,rowMarkers:"both",onCellEdited:a,trailingRowOptions:{hint:"New row...",sticky:!0,tint:!0},rows:r,onRowAppended:h,rightElementProps:{sticky:!0},rightElement:d("div",{style:{height:"100%",padding:"20px 20px 40px 20px",width:200,color:"black",whiteSpace:"pre-wrap",backgroundColor:"rgba(240, 240, 250, 0.2)",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0 0 10px rgba(0, 0, 0, 0.15)",backdropFilter:"blur(12px)"},children:["This is a real DOM element. You can put whatever you want here. You can also size it as big as you want. ",` `,"It also does not have to be sticky."]})})};var i,c,p;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { diff --git a/docs/assets/right-to-left.stories-VyfcM2n5.js b/docs/assets/right-to-left.stories-uW6E-20L.js similarity index 88% rename from docs/assets/right-to-left.stories-VyfcM2n5.js rename to docs/assets/right-to-left.stories-uW6E-20L.js index 0c6f3d7aa..41ce158ad 100644 --- a/docs/assets/right-to-left.stories-VyfcM2n5.js +++ b/docs/assets/right-to-left.stories-uW6E-20L.js @@ -1,4 +1,4 @@ -import{j as t,F as m}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-zTb9g2fv.js";import{B as g,D as E,u as f,d as h}from"./utils-qU2KzddR.js";import{G as M}from"./image-window-loader--5E_ifQX.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(k,{children:t(g,{title:"Right to Left support",description:t(m,{children:t(E,{children:"The data editor automatically detects RTL in text cells and respects it."})}),children:t(r,{})})})]},o=()=>{const{cols:r,getCellContent:u,setCellValue:i,onColumnResize:D}=f(60,!1),c=l.useMemo(()=>{const e=[...r];return e[0]={...e[0],title:"גלייד",hasMenu:!0},e},[r]),C=l.useCallback(e=>{const[d,R]=e;return d!==0?u(e):{kind:M.Text,allowOverlay:!0,data:"אני גדעון, מומחה לאפליקציות גלייד.",displayData:"אני גדעון, מומחה לאפליקציות גלייד.",allowWrapping:!0}},[u]);return t(p,{...h,getCellContent:C,columns:c,onColumnResize:D,getCellsForSelection:!0,rowMarkers:"both",onHeaderMenuClick:()=>alert("menu click"),onPaste:!0,onCellEdited:i,rows:1e3})};var n,a,s;o.parameters={...o.parameters,docs:{...(n=o.parameters)==null?void 0:n.docs,source:{originalSource:`() => { +import{j as t,F as m}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as p}from"./data-editor-all-ZeeWpldS.js";import{B as g,D as E,u as f,d as h}from"./utils-MADpeXg5.js";import{G as M}from"./image-window-loader-ggeJlWLo.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>t(k,{children:t(g,{title:"Right to Left support",description:t(m,{children:t(E,{children:"The data editor automatically detects RTL in text cells and respects it."})}),children:t(r,{})})})]},o=()=>{const{cols:r,getCellContent:u,setCellValue:i,onColumnResize:D}=f(60,!1),c=l.useMemo(()=>{const e=[...r];return e[0]={...e[0],title:"גלייד",hasMenu:!0},e},[r]),C=l.useCallback(e=>{const[d,R]=e;return d!==0?u(e):{kind:M.Text,allowOverlay:!0,data:"אני גדעון, מומחה לאפליקציות גלייד.",displayData:"אני גדעון, מומחה לאפליקציות גלייד.",allowWrapping:!0}},[u]);return t(p,{...h,getCellContent:C,columns:c,onColumnResize:D,getCellsForSelection:!0,rowMarkers:"both",onHeaderMenuClick:()=>alert("menu click"),onPaste:!0,onCellEdited:i,rows:1e3})};var n,a,s;o.parameters={...o.parameters,docs:{...(n=o.parameters)==null?void 0:n.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/row-and-header-sizes.stories-zl2epROy.js b/docs/assets/row-and-header-sizes.stories-sNSldu-6.js similarity index 78% rename from docs/assets/row-and-header-sizes.stories-zl2epROy.js rename to docs/assets/row-and-header-sizes.stories-sNSldu-6.js index 4e31ae515..e36d73e4f 100644 --- a/docs/assets/row-and-header-sizes.stories-zl2epROy.js +++ b/docs/assets/row-and-header-sizes.stories-sNSldu-6.js @@ -1,4 +1,4 @@ -import{j as e,a as o,F as h}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as c,P as a,M as g,u as w,d as H}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const R={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(u,{children:e(p,{title:"Row and Header sizes",description:o(h,{children:[o(c,{children:["The row size can be controlled with ",e(a,{children:"rowHeight"})," and the header size with ",e(a,{children:"headerHeight"}),"."]}),e(g,{children:"Use the story's controls to resize them"})]}),children:e(t,{})})})]},r=t=>{const{cols:d,getCellContent:m}=w(6);return e(l,{...H,rowHeight:t.rowHeight,headerHeight:t.headerHeight,rowMarkers:"number",getCellContent:m,columns:d,rows:1e3})};r.args={rowHeight:34,headerHeight:34};r.argTypes={rowHeight:{control:{type:"range",min:20,max:200}},headerHeight:{control:{type:"range",min:20,max:200}}};var i,s,n;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`p => { +import{j as e,a as o,F as h}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as c,P as a,M as g,u as w,d as H}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const R={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(u,{children:e(p,{title:"Row and Header sizes",description:o(h,{children:[o(c,{children:["The row size can be controlled with ",e(a,{children:"rowHeight"})," and the header size with ",e(a,{children:"headerHeight"}),"."]}),e(g,{children:"Use the story's controls to resize them"})]}),children:e(t,{})})})]},r=t=>{const{cols:d,getCellContent:m}=w(6);return e(l,{...H,rowHeight:t.rowHeight,headerHeight:t.headerHeight,rowMarkers:"number",getCellContent:m,columns:d,rows:1e3})};r.args={rowHeight:34,headerHeight:34};r.argTypes={rowHeight:{control:{type:"range",min:20,max:200}},headerHeight:{control:{type:"range",min:20,max:200}}};var i,s,n;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/row-grouping.stories-NeYCW-VK.js b/docs/assets/row-grouping.stories-ONZORBKM.js similarity index 93% rename from docs/assets/row-grouping.stories-NeYCW-VK.js rename to docs/assets/row-grouping.stories-ONZORBKM.js index 2e07577ae..f5a011a7b 100644 --- a/docs/assets/row-grouping.stories-NeYCW-VK.js +++ b/docs/assets/row-grouping.stories-ONZORBKM.js @@ -1,4 +1,4 @@ -import{j as o,a as v}from"./marked.esm-dbrxtycE.js";import{R as p}from"./index-BMVQvedj.js";import{u as x,D as O}from"./data-editor-all-zTb9g2fv.js";import{B as y,D as I,P as D,u as P,d as B}from"./utils-qU2KzddR.js";import{S}from"./story-utils-K2EZnGjM.js";import{G as m}from"./image-window-loader--5E_ifQX.js";import"./lodash-8jIGfDyZ.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const U={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>o(S,{children:o(y,{title:"Row Grouping",description:v(I,{children:["The ",o(D,{children:"rowGrouping"})," prop can be used to group and even fold rows."]}),children:o(l,{})})})]},s=l=>{const{cols:f,getCellContent:u}=P(100),d=1e3,[r,R]=p.useState(()=>({groups:[{headerIndex:0,isCollapsed:!1},{headerIndex:10,isCollapsed:!0,subGroups:[{headerIndex:15,isCollapsed:!1},{headerIndex:20,isCollapsed:!1}]},{headerIndex:30,isCollapsed:!1}],height:55,navigationBehavior:"block",selectionBehavior:"block-spanning",themeOverride:{bgCell:"rgba(0, 100, 255, 0.1)"}})),{mapper:t,getRowGroupingForPath:g,updateRowGroupingByPath:c}=x(r,d),b=p.useCallback(n=>{const{path:e,isGroupHeader:a}=t(n);if(a&&n[0]===0){const i=g(r.groups,e);R(C=>({...C,groups:c(C.groups,e,{isCollapsed:!i.isCollapsed})}))}},[g,t,r.groups,c]),k=p.useCallback(n=>{const{path:e,isGroupHeader:a,originalIndex:i}=t(n);return n[0]===0?{kind:m.Text,data:`Row ${JSON.stringify(e)}`,displayData:`Row ${JSON.stringify(e)}`,allowOverlay:!1}:a?{kind:m.Loading,allowOverlay:!1}:u(i)},[u,t]);return o(O,{...B,rowGrouping:r,height:"100%",rowMarkers:"both",freezeColumns:l.freezeColumns,getRowThemeOverride:(n,e,a)=>{if(e%2===0)return{bgCell:"rgba(0, 0, 0, 0.1)"}},onCellClicked:b,getCellContent:k,columns:f,rows:d})};var h,w,G;s.parameters={...s.parameters,docs:{...(h=s.parameters)==null?void 0:h.docs,source:{originalSource:`(p: { +import{j as o,a as v}from"./marked.esm-dbrxtycE.js";import{R as p}from"./index-BMVQvedj.js";import{u as x,D as O}from"./data-editor-all-ZeeWpldS.js";import{B as y,D as I,P as D,u as P,d as B}from"./utils-MADpeXg5.js";import{S}from"./story-utils-K2EZnGjM.js";import{G as m}from"./image-window-loader-ggeJlWLo.js";import"./lodash-8jIGfDyZ.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const U={title:"Glide-Data-Grid/DataEditor Demos",decorators:[l=>o(S,{children:o(y,{title:"Row Grouping",description:v(I,{children:["The ",o(D,{children:"rowGrouping"})," prop can be used to group and even fold rows."]}),children:o(l,{})})})]},s=l=>{const{cols:f,getCellContent:u}=P(100),d=1e3,[r,R]=p.useState(()=>({groups:[{headerIndex:0,isCollapsed:!1},{headerIndex:10,isCollapsed:!0,subGroups:[{headerIndex:15,isCollapsed:!1},{headerIndex:20,isCollapsed:!1}]},{headerIndex:30,isCollapsed:!1}],height:55,navigationBehavior:"block",selectionBehavior:"block-spanning",themeOverride:{bgCell:"rgba(0, 100, 255, 0.1)"}})),{mapper:t,getRowGroupingForPath:g,updateRowGroupingByPath:c}=x(r,d),b=p.useCallback(n=>{const{path:e,isGroupHeader:a}=t(n);if(a&&n[0]===0){const i=g(r.groups,e);R(C=>({...C,groups:c(C.groups,e,{isCollapsed:!i.isCollapsed})}))}},[g,t,r.groups,c]),k=p.useCallback(n=>{const{path:e,isGroupHeader:a,originalIndex:i}=t(n);return n[0]===0?{kind:m.Text,data:`Row ${JSON.stringify(e)}`,displayData:`Row ${JSON.stringify(e)}`,allowOverlay:!1}:a?{kind:m.Loading,allowOverlay:!1}:u(i)},[u,t]);return o(O,{...B,rowGrouping:r,height:"100%",rowMarkers:"both",freezeColumns:l.freezeColumns,getRowThemeOverride:(n,e,a)=>{if(e%2===0)return{bgCell:"rgba(0, 0, 0, 0.1)"}},onCellClicked:b,getCellContent:k,columns:f,rows:d})};var h,w,G;s.parameters={...s.parameters,docs:{...(h=s.parameters)==null?void 0:h.docs,source:{originalSource:`(p: { freezeColumns: number; }) => { const { diff --git a/docs/assets/row-hover.stories-4MjAgYiU.js b/docs/assets/row-hover.stories-nRHuwzz4.js similarity index 85% rename from docs/assets/row-hover.stories-4MjAgYiU.js rename to docs/assets/row-hover.stories-nRHuwzz4.js index 7adbb06f4..76720c791 100644 --- a/docs/assets/row-hover.stories-4MjAgYiU.js +++ b/docs/assets/row-hover.stories-nRHuwzz4.js @@ -1,4 +1,4 @@ -import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{D as w}from"./data-editor-all-zTb9g2fv.js";import{B as v,D as h,P as R,a as g,d as C}from"./utils-qU2KzddR.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(b,{children:e(v,{title:"Row Hover Effect",description:p(h,{children:["Through careful usage of the ",e(R,{children:"onItemHovered"})," callback it is possible to easily create a row hover effect."]}),children:e(t,{})})})]},r=()=>{const{cols:t,getCellContent:c}=g(),[s,d]=n.useState(void 0),m=n.useCallback(o=>{const[k,f]=o.location;d(o.kind!=="cell"?void 0:f)},[]),u=n.useCallback(o=>{if(o===s)return{bgCell:"#f7f7f7",bgCellMedium:"#f0f0f0"}},[s]);return e(w,{...C,rowMarkers:"both",onItemHovered:m,getCellContent:c,getRowThemeOverride:u,columns:t,rows:300})};var a,i,l;r.parameters={...r.parameters,docs:{...(a=r.parameters)==null?void 0:a.docs,source:{originalSource:`() => { +import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import{R as n}from"./index-BMVQvedj.js";import{D as w}from"./data-editor-all-ZeeWpldS.js";import{B as v,D as h,P as R,a as g,d as C}from"./utils-MADpeXg5.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(b,{children:e(v,{title:"Row Hover Effect",description:p(h,{children:["Through careful usage of the ",e(R,{children:"onItemHovered"})," callback it is possible to easily create a row hover effect."]}),children:e(t,{})})})]},r=()=>{const{cols:t,getCellContent:c}=g(),[s,d]=n.useState(void 0),m=n.useCallback(o=>{const[k,f]=o.location;d(o.kind!=="cell"?void 0:f)},[]),u=n.useCallback(o=>{if(o===s)return{bgCell:"#f7f7f7",bgCellMedium:"#f0f0f0"}},[s]);return e(w,{...C,rowMarkers:"both",onItemHovered:m,getCellContent:c,getRowThemeOverride:u,columns:t,rows:300})};var a,i,l;r.parameters={...r.parameters,docs:{...(a=r.parameters)==null?void 0:a.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/row-markers.stories-IsElw6i9.js b/docs/assets/row-markers.stories-wk8qKt8n.js similarity index 79% rename from docs/assets/row-markers.stories-IsElw6i9.js rename to docs/assets/row-markers.stories-wk8qKt8n.js index daa77b9da..d9f53bdee 100644 --- a/docs/assets/row-markers.stories-IsElw6i9.js +++ b/docs/assets/row-markers.stories-wk8qKt8n.js @@ -1,4 +1,4 @@ -import{j as e,F as l,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as d,P as u,u as k,d as h}from"./utils-qU2KzddR.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(b,{children:e(p,{title:"Row markers",description:e(l,{children:c(d,{children:["Row Markers can be controlled by setting the ",e(u,{children:"rowMarkers"})," prop."]})}),children:e(o,{})})})]},r=o=>{const{cols:n,getCellContent:i}=k(10,!1);return e(m,{...h,getCellContent:i,verticalBorder:!1,rowMarkers:{kind:o.markers,checkboxStyle:"square",headerAlwaysVisible:!0,headerTheme:{textMedium:"rgba(51, 51, 51, 0.50)"}},columns:n,rows:400})};r.args={markers:"both"};r.argTypes={markers:{control:{type:"select"},options:["both","checkbox","number","none","clickable-number","checkbox-visible"]}};var t,a,s;r.parameters={...r.parameters,docs:{...(t=r.parameters)==null?void 0:t.docs,source:{originalSource:`p => { +import{j as e,F as l,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as d,P as u,u as k,d as h}from"./utils-MADpeXg5.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const j={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(b,{children:e(p,{title:"Row markers",description:e(l,{children:c(d,{children:["Row Markers can be controlled by setting the ",e(u,{children:"rowMarkers"})," prop."]})}),children:e(o,{})})})]},r=o=>{const{cols:n,getCellContent:i}=k(10,!1);return e(m,{...h,getCellContent:i,verticalBorder:!1,rowMarkers:{kind:o.markers,checkboxStyle:"square",headerAlwaysVisible:!0,headerTheme:{textMedium:"rgba(51, 51, 51, 0.50)"}},columns:n,rows:400})};r.args={markers:"both"};r.argTypes={markers:{control:{type:"select"},options:["both","checkbox","number","none","clickable-number","checkbox-visible"]}};var t,a,s;r.parameters={...r.parameters,docs:{...(t=r.parameters)==null?void 0:t.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/scaled-view.stories-8zeM-CR3.js b/docs/assets/scaled-view.stories-1QjGLbTA.js similarity index 73% rename from docs/assets/scaled-view.stories-8zeM-CR3.js rename to docs/assets/scaled-view.stories-1QjGLbTA.js index 5464d7909..02ba88548 100644 --- a/docs/assets/scaled-view.stories-8zeM-CR3.js +++ b/docs/assets/scaled-view.stories-1QjGLbTA.js @@ -1,4 +1,4 @@ -import{j as e}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-zTb9g2fv.js";import{B as m,D as p,u as c,d}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(u,{children:e(m,{title:"Scaled view",description:e(p,{children:"The data editor supports being scaled."}),scale:"0.5",children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:i,onColumnResize:n}=c(60);return e(l,{...d,getCellContent:i,columns:r,rowMarkers:"both",rows:500,onColumnResize:n})};var t,s,a;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => { +import{j as e}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as l}from"./data-editor-all-ZeeWpldS.js";import{B as m,D as p,u as c,d}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const V={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(u,{children:e(m,{title:"Scaled view",description:e(p,{children:"The data editor supports being scaled."}),scale:"0.5",children:e(r,{})})})]},o=()=>{const{cols:r,getCellContent:i,onColumnResize:n}=c(60);return e(l,{...d,getCellContent:i,columns:r,rowMarkers:"both",rows:500,onColumnResize:n})};var t,s,a;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/scroll-offset.stories-Uz4w97or.js b/docs/assets/scroll-offset.stories-eyu0T1ZU.js similarity index 75% rename from docs/assets/scroll-offset.stories-Uz4w97or.js rename to docs/assets/scroll-offset.stories-eyu0T1ZU.js index 69b1c17d0..98a97acd2 100644 --- a/docs/assets/scroll-offset.stories-Uz4w97or.js +++ b/docs/assets/scroll-offset.stories-eyu0T1ZU.js @@ -1,4 +1,4 @@ -import{j as r,a as n}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as c,P as m,u as d,d as f}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./lodash-8jIGfDyZ.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(u,{children:r(p,{title:"Scroll Offset",description:n(c,{children:["The ",r(m,{children:"rowGrouping"})," prop can be used to group and even fold rows."]}),children:r(t,{})})})]},o=()=>{const{cols:t,getCellContent:l}=d(100);return r(i,{...f,height:"100%",rowMarkers:"both",scrollOffsetY:400,getCellContent:l,columns:t,rows:1e3})};var e,s,a;o.parameters={...o.parameters,docs:{...(e=o.parameters)==null?void 0:e.docs,source:{originalSource:`() => { +import{j as r,a as n}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as i}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as c,P as m,u as d,d as f}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./lodash-8jIGfDyZ.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>r(u,{children:r(p,{title:"Scroll Offset",description:n(c,{children:["The ",r(m,{children:"rowGrouping"})," prop can be used to group and even fold rows."]}),children:r(t,{})})})]},o=()=>{const{cols:t,getCellContent:l}=d(100);return r(i,{...f,height:"100%",rowMarkers:"both",scrollOffsetY:400,getCellContent:l,columns:t,rows:1e3})};var e,s,a;o.parameters={...o.parameters,docs:{...(e=o.parameters)==null?void 0:e.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/scroll-shadows.stories-jclChxEm.js b/docs/assets/scroll-shadows.stories-hVBm2cZ6.js similarity index 90% rename from docs/assets/scroll-shadows.stories-jclChxEm.js rename to docs/assets/scroll-shadows.stories-hVBm2cZ6.js index f178b1d09..b5acd4660 100644 --- a/docs/assets/scroll-shadows.stories-jclChxEm.js +++ b/docs/assets/scroll-shadows.stories-hVBm2cZ6.js @@ -1,4 +1,4 @@ -import{j as o,F as S}from"./marked.esm-dbrxtycE.js";import{R as t}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-zTb9g2fv.js";import{B as b,D as R,u as y,d as k}from"./utils-qU2KzddR.js";import{C as c}from"./image-window-loader--5E_ifQX.js";import{S as B}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const L={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>o(B,{children:o(b,{title:"Scroll Shadows",description:o(S,{children:o(R,{children:"You can enable and disable the horizontal/vertical scroll shadows."})}),children:o(a,{})})})]},n=()=>{const{cols:a,getCellContent:h}=y(6),[w,f]=t.useState({rows:c.empty(),columns:c.empty()}),p=t.useCallback(e=>{var l;let r=c.empty();e.current!==void 0&&(r=r.add([e.current.range.y,e.current.range.y+e.current.range.height]));for(const s of((l=e.current)==null?void 0:l.rangeStack)??[])r=r.add([s.y,s.y+s.height]);f({...e,rows:r})},[]),u=t.useMemo(()=>({accentLight:"#b1f6ff",horizontalBorderColor:"transparent",headerBottomBorderColor:"rgba(115, 116, 131, 0.16)"}),[]),g=t.useCallback(e=>e%2===0?void 0:{bgCell:"#f5f5f6"},[]);return o(C,{...k,rowMarkers:"number",gridSelection:w,onGridSelectionChange:p,fixedShadowX:!1,headerHeight:26,drawFocusRing:!1,rowHeight:22,fixedShadowY:!1,getRowThemeOverride:g,verticalBorder:!1,getCellContent:h,columns:a,rows:1e3,theme:u})};var i,d,m;n.parameters={...n.parameters,docs:{...(i=n.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as o,F as S}from"./marked.esm-dbrxtycE.js";import{R as t}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-ZeeWpldS.js";import{B as b,D as R,u as y,d as k}from"./utils-MADpeXg5.js";import{C as c}from"./image-window-loader-ggeJlWLo.js";import{S as B}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const L={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>o(B,{children:o(b,{title:"Scroll Shadows",description:o(S,{children:o(R,{children:"You can enable and disable the horizontal/vertical scroll shadows."})}),children:o(a,{})})})]},n=()=>{const{cols:a,getCellContent:h}=y(6),[w,f]=t.useState({rows:c.empty(),columns:c.empty()}),p=t.useCallback(e=>{var l;let r=c.empty();e.current!==void 0&&(r=r.add([e.current.range.y,e.current.range.y+e.current.range.height]));for(const s of((l=e.current)==null?void 0:l.rangeStack)??[])r=r.add([s.y,s.y+s.height]);f({...e,rows:r})},[]),u=t.useMemo(()=>({accentLight:"#b1f6ff",horizontalBorderColor:"transparent",headerBottomBorderColor:"rgba(115, 116, 131, 0.16)"}),[]),g=t.useCallback(e=>e%2===0?void 0:{bgCell:"#f5f5f6"},[]);return o(C,{...k,rowMarkers:"number",gridSelection:w,onGridSelectionChange:p,fixedShadowX:!1,headerHeight:26,drawFocusRing:!1,rowHeight:22,fixedShadowY:!1,getRowThemeOverride:g,verticalBorder:!1,getCellContent:h,columns:a,rows:1e3,theme:u})};var i,d,m;n.parameters={...n.parameters,docs:{...(i=n.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/scrolling-data-grid-rB9VuUnF.js b/docs/assets/scrolling-data-grid-wnX0bxop.js similarity index 99% rename from docs/assets/scrolling-data-grid-rB9VuUnF.js rename to docs/assets/scrolling-data-grid-wnX0bxop.js index 1d913aace..fe56d235e 100644 --- a/docs/assets/scrolling-data-grid-rB9VuUnF.js +++ b/docs/assets/scrolling-data-grid-wnX0bxop.js @@ -1 +1 @@ -import{j as U,a as he,F as me,s as Ce}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{c as Re}from"./throttle-7EuXLZa7.js";import{Q as Se,R as we,u as ve}from"./image-window-loader--5E_ifQX.js";function ae(e,f,m,o){return Re(Math.round(f-(e.growOffset??0)),Math.ceil(m),Math.floor(o))}const De=e=>{const[f,m]=t.useState(),[o,D]=t.useState(),[i,O]=t.useState(),[h,w]=t.useState(),[C,b]=t.useState(!1),[K,c]=t.useState(),[R,X]=t.useState(),[N,oe]=t.useState(),[q,ee]=t.useState(!1),[ne,re]=t.useState(),{onHeaderMenuClick:Y,onHeaderIndicatorClick:te,getCellContent:x,onColumnMoved:j,onColumnResize:S,onColumnResizeStart:$,onColumnResizeEnd:F,gridRef:_,maxColumnWidth:M,minColumnWidth:W,onRowMoved:E,lockColumns:A,onColumnProposeMove:J,onMouseDown:P,onMouseUp:Z,onItemHovered:n,onDragStart:L,canvasRef:H}=e,G=(S??F??$)!==void 0,{columns:a,selection:l}=e,s=l.columns,d=t.useCallback(r=>{const[g,y]=r.location;i!==void 0&&h!==g&&g>=A?(b(!0),w(g)):R!==void 0&&y!==void 0?(ee(!0),oe(Math.max(0,y))):o===void 0&&!C&&!q&&(n==null||n(r))},[i,R,h,n,A,o,C,q]),B=j!==void 0,V=t.useCallback(r=>{var g;if(r.button===0){const[y,v]=r.location;if(r.kind==="out-of-bounds"&&r.isEdge&&G){const T=(g=_==null?void 0:_.current)==null?void 0:g.getBounds(a.length-1,-1);T!==void 0&&(m(T.x),D(a.length-1))}else if(r.kind==="header"&&y>=A){const T=H==null?void 0:H.current;if(r.isEdge&&G&&T){m(r.bounds.x),D(y);const ue=T.getBoundingClientRect().width/T.offsetWidth,le=r.bounds.width/ue;$==null||$(a[y],le,y,le+(a[y].growOffset??0))}else r.kind==="header"&&B&&(c(r.bounds.x),O(y))}else r.kind==="cell"&&A>0&&y===0&&v!==void 0&&E!==void 0&&(re(r.bounds.y),X(v))}P==null||P(r)},[P,G,A,E,_,a,B,$,H]),Q=t.useCallback((r,g)=>{C||q||Y==null||Y(r,g)},[C,q,Y]),se=t.useCallback((r,g)=>{C||q||te==null||te(r,g)},[C,q,te]),k=t.useRef(-1),u=t.useCallback(()=>{k.current=-1,X(void 0),oe(void 0),re(void 0),ee(!1),O(void 0),w(void 0),c(void 0),b(!1),D(void 0),m(void 0)},[]),z=t.useCallback((r,g)=>{if(r.button===0){if(o!==void 0){if((s==null?void 0:s.hasIndex(o))===!0)for(const v of s){if(v===o)continue;const T=a[v],p=ae(T,k.current,W,M);S==null||S(T,p,v,p+(T.growOffset??0))}const y=ae(a[o],k.current,W,M);if(F==null||F(a[o],y,o,y+(a[o].growOffset??0)),s.hasIndex(o))for(const v of s){if(v===o)continue;const T=a[v],p=ae(T,k.current,W,M);F==null||F(T,p,v,p+(T.growOffset??0))}}u(),i!==void 0&&h!==void 0&&(j==null||j(i,h)),R!==void 0&&N!==void 0&&(E==null||E(R,N))}Z==null||Z(r,g)},[Z,o,i,h,R,N,s,F,a,W,M,S,j,E,u]),I=t.useMemo(()=>{if(!(i===void 0||h===void 0)&&i!==h&&(J==null?void 0:J(i,h))!==!1)return{src:i,dest:h}},[i,h,J]),ie=t.useCallback(r=>{const g=H==null?void 0:H.current;if(i!==void 0&&K!==void 0)Math.abs(r.clientX-K)>20&&b(!0);else if(R!==void 0&&ne!==void 0)Math.abs(r.clientY-ne)>20&&ee(!0);else if(o!==void 0&&f!==void 0&&g){const v=g.getBoundingClientRect().width/g.offsetWidth,T=(r.clientX-f)/v,p=a[o],ue=ae(p,T,W,M);if(S==null||S(p,ue,o,ue+(p.growOffset??0)),k.current=T,(s==null?void 0:s.first())===o)for(const le of s){if(le===o)continue;const fe=a[le],ge=ae(fe,k.current,W,M);S==null||S(fe,ge,le,ge+(fe.growOffset??0))}}},[i,K,R,ne,o,f,a,W,M,S,s,H]),ce=t.useCallback((r,g)=>{if(R===void 0||N===void 0)return x(r,g);let[y,v]=r;return v===N?v=R:(v>N&&(v-=1),v>=R&&(v+=1)),x([y,v],g)},[R,N,x]),de=t.useCallback(r=>{L==null||L(r),r.defaultPrevented()||u()},[u,L]);return U(Se,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:o,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:ce,isResizing:o!==void 0,onHeaderMenuClick:Q,onHeaderIndicatorClick:se,isDragging:C,onItemHovered:d,onDragStart:de,onMouseDown:V,allowResize:G,onMouseUp:z,dragAndDropState:I,onMouseMoveRaw:ie,ref:_})},be=De;function He(e){const f=t.useRef(null),[m,o]=t.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return t.useLayoutEffect(()=>{const D=O=>{for(const h of O){const{width:w,height:C}=h&&h.contentRect||{};o(b=>b.width===w&&b.height===C?b:{width:w,height:C})}},i=new window.ResizeObserver(D);return f.current&&i.observe(f.current,void 0),()=>{i.disconnect()}},[f.current]),{ref:f,...m}}const ye=(e,f,m)=>{const o=t.useRef(null),D=t.useRef(null),i=t.useRef(null),O=t.useRef(0),h=t.useRef(f);h.current=f;const w=m.current;t.useEffect(()=>{const C=()=>{var c,R;if(D.current===!1&&w!==null){const X=[w.scrollLeft,w.scrollTop];if(((c=i.current)==null?void 0:c[0])===X[0]&&((R=i.current)==null?void 0:R[1])===X[1])if(O.current>10){i.current=null,D.current=null;return}else O.current++;else O.current=0,h.current(X[0],X[1]),i.current=X;o.current=window.setTimeout(C,8.333333333333334)}},b=()=>{D.current=!0,i.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},K=c=>{c.touches.length===0&&(D.current=!1,O.current=0,o.current=window.setTimeout(C,8.333333333333334))};if(e&&w!==null){const c=w;return c.addEventListener("touchstart",b),c.addEventListener("touchend",K),()=>{c.removeEventListener("touchstart",b),c.removeEventListener("touchend",K),o.current!==null&&window.clearTimeout(o.current)}}},[e,w])},xe=ye,Me=()=>e=>e.isSafari?"scroll":"auto",ke=Ce("div")({name:"ScrollRegionStyle",class:"sj2f20c",propsAsIs:!1,vars:{"sj2f20c-0":[Me()]}});function Te(e){const[f,m]=t.useState(!1),o=typeof window>"u"?null:window,D=t.useRef(0);return ve("touchstart",t.useCallback(()=>{window.clearTimeout(D.current),m(!0)},[]),o,!0,!1),ve("touchend",t.useCallback(i=>{i.touches.length===0&&(D.current=window.setTimeout(()=>m(!1),e))},[e]),o,!0,!1),f}const Ie=e=>{var G,a;const{children:f,clientHeight:m,scrollHeight:o,scrollWidth:D,update:i,draggable:O,className:h,preventDiagonalScrolling:w=!1,paddingBottom:C=0,paddingRight:b=0,rightElement:K,rightElementProps:c,kineticScrollPerfHack:R=!1,scrollRef:X,initialSize:N}=e,oe=[],q=(c==null?void 0:c.sticky)??!1,ee=(c==null?void 0:c.fill)??!1,ne=t.useRef(0),re=t.useRef(0),Y=t.useRef(null),te=typeof window>"u"?1:window.devicePixelRatio,x=t.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),j=t.useRef(null),S=Te(200),[$,F]=t.useState(!0),_=t.useRef(0);t.useLayoutEffect(()=>{if(!$||S||x.current.lockDirection===void 0)return;const l=Y.current;if(l===null)return;const[s,d]=x.current.lockDirection;s!==void 0?l.scrollLeft=s:d!==void 0&&(l.scrollTop=d),x.current.lockDirection=void 0},[S,$]);const M=t.useCallback((l,s)=>{var de;const d=Y.current;if(d===null)return;s=s??d.scrollTop,l=l??d.scrollLeft;const B=x.current.scrollTop,V=x.current.scrollLeft,Q=l-V,se=s-B;S&&Q!==0&&se!==0&&(Math.abs(Q)>3||Math.abs(se)>3)&&w&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Q)0&&(Math.abs(ie)>2e3||I===0||I===ce)&&o>d.scrollHeight+5){const r=I/ce,g=(o-z)*r;ne.current=g-I}k!==void 0&&(window.clearTimeout(_.current),F(!1),_.current=window.setTimeout(()=>F(!0),200)),i({x:l,y:I+ne.current,width:u-b,height:z-C,paddingRight:((de=j.current)==null?void 0:de.clientWidth)??0})},[C,b,o,i,w,S]);xe(R&&we.value,M,Y);const W=t.useRef(M);W.current=M;const E=t.useRef(),A=t.useRef(!1);t.useLayoutEffect(()=>{A.current?M():A.current=!0},[M,C,b]);const J=t.useCallback(l=>{Y.current=l,X!==void 0&&(X.current=l)},[X]);let P=0,Z=0;for(oe.push(U("div",{style:{width:D,height:0}},P++));ZW.current(),0),E.current={width:L,height:H}),(L??0)===0||(H??0)===0?U("div",{ref:n}):U("div",{ref:n,children:he(ke,{isSafari:we.value,children:[U("div",{className:"dvn-underlay",children:f}),U("div",{ref:J,style:E.current,draggable:O,onDragStart:l=>{O||(l.stopPropagation(),l.preventDefault())},className:"dvn-scroller "+(h??""),onScroll:()=>M(),children:he("div",{className:"dvn-scroll-inner"+(K===void 0?" dvn-hidden":""),children:[U("div",{className:"dvn-stack",children:oe}),K!==void 0&&he(me,{children:[!ee&&U("div",{className:"dvn-spacer"}),U("div",{ref:j,style:{height:H,maxHeight:m-Math.ceil(te%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:b,flexGrow:ee?1:void 0,right:q?b??0:void 0,pointerEvents:"auto"},children:K})]})]})})]})})},Oe=e=>{const{columns:f,rows:m,rowHeight:o,headerHeight:D,groupHeaderHeight:i,enableGroups:O,freezeColumns:h,experimental:w,nonGrowWidth:C,clientSize:b,className:K,onVisibleRegionChanged:c,scrollRef:R,preventDiagonalScrolling:X,rightElement:N,rightElementProps:oe,overscrollX:q,overscrollY:ee,initialSize:ne,smoothScrollX:re=!1,smoothScrollY:Y=!1,isDraggable:te}=e,{paddingRight:x,paddingBottom:j}=w??{},[S,$]=b,F=t.useRef(),_=t.useRef(),M=t.useRef(),W=t.useRef(),E=C+Math.max(0,q??0);let A=O?D+i:D;if(typeof o=="number")A+=m*o;else for(let n=0;n{var se,k;if(J.current===void 0)return;const n={...J.current};let L=0,H=n.x<0?-n.x:0,G=0,a=0;n.x=n.x<0?0:n.x;let l=0;for(let u=0;u=z+u.width)L+=u.width,a++,G++;else if(n.x>z)L+=u.width,re?H+=z-n.x:a++,G++;else if(n.x+n.width>z)L+=u.width,G++;else break}let s=0,d=0,B=0;if(typeof o=="number")Y?(d=Math.floor(n.y/o),s=d*o-n.y):d=Math.ceil(n.y/o),B=Math.ceil(n.height/o)+d,s<0&&B++;else{let u=0;for(let z=0;z=u+I)u+=I,d++,B++;else if(n.y>ie)u+=I,Y?s+=ie-n.y:d++,B++;else if(n.y+n.height>I/2+u)u+=I,B++;else break}}const V={x:a,y:d,width:G-a,height:B-d},Q=F.current;(Q===void 0||Q.y!==V.y||Q.x!==V.x||Q.height!==V.height||Q.width!==V.width||_.current!==H||M.current!==s||n.width!==((se=W.current)==null?void 0:se[0])||n.height!==((k=W.current)==null?void 0:k[1]))&&(c==null||c({x:a,y:d,width:G-a,height:B-d},n.width,n.height,n.paddingRight??0,H,s),F.current=V,_.current=H,M.current=s,W.current=[n.width,n.height])},[f,o,m,c,h,re,Y]),Z=t.useCallback(n=>{J.current=n,P()},[P]);return t.useEffect(()=>{P()},[P]),U(Ie,{scrollRef:R,className:K,kineticScrollPerfHack:w==null?void 0:w.kineticScrollPerfHack,preventDiagonalScrolling:X,draggable:te===!0||typeof te=="string",scrollWidth:E+(x??0),scrollHeight:A+(j??0),clientHeight:$,rightElement:N,paddingBottom:j,paddingRight:x,rightElementProps:oe,update:Z,initialSize:ne,children:U(be,{eventTargetRef:R,width:S,height:$,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator})})},ze=Oe;export{ze as G}; +import{j as U,a as he,F as me,s as Ce}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{c as Re}from"./throttle-7EuXLZa7.js";import{Q as Se,R as we,u as ve}from"./image-window-loader-ggeJlWLo.js";function ae(e,f,m,o){return Re(Math.round(f-(e.growOffset??0)),Math.ceil(m),Math.floor(o))}const De=e=>{const[f,m]=t.useState(),[o,D]=t.useState(),[i,O]=t.useState(),[h,w]=t.useState(),[C,b]=t.useState(!1),[K,c]=t.useState(),[R,X]=t.useState(),[N,oe]=t.useState(),[q,ee]=t.useState(!1),[ne,re]=t.useState(),{onHeaderMenuClick:Y,onHeaderIndicatorClick:te,getCellContent:x,onColumnMoved:j,onColumnResize:S,onColumnResizeStart:$,onColumnResizeEnd:F,gridRef:_,maxColumnWidth:M,minColumnWidth:W,onRowMoved:E,lockColumns:A,onColumnProposeMove:J,onMouseDown:P,onMouseUp:Z,onItemHovered:n,onDragStart:L,canvasRef:H}=e,G=(S??F??$)!==void 0,{columns:a,selection:l}=e,s=l.columns,d=t.useCallback(r=>{const[g,y]=r.location;i!==void 0&&h!==g&&g>=A?(b(!0),w(g)):R!==void 0&&y!==void 0?(ee(!0),oe(Math.max(0,y))):o===void 0&&!C&&!q&&(n==null||n(r))},[i,R,h,n,A,o,C,q]),B=j!==void 0,V=t.useCallback(r=>{var g;if(r.button===0){const[y,v]=r.location;if(r.kind==="out-of-bounds"&&r.isEdge&&G){const T=(g=_==null?void 0:_.current)==null?void 0:g.getBounds(a.length-1,-1);T!==void 0&&(m(T.x),D(a.length-1))}else if(r.kind==="header"&&y>=A){const T=H==null?void 0:H.current;if(r.isEdge&&G&&T){m(r.bounds.x),D(y);const ue=T.getBoundingClientRect().width/T.offsetWidth,le=r.bounds.width/ue;$==null||$(a[y],le,y,le+(a[y].growOffset??0))}else r.kind==="header"&&B&&(c(r.bounds.x),O(y))}else r.kind==="cell"&&A>0&&y===0&&v!==void 0&&E!==void 0&&(re(r.bounds.y),X(v))}P==null||P(r)},[P,G,A,E,_,a,B,$,H]),Q=t.useCallback((r,g)=>{C||q||Y==null||Y(r,g)},[C,q,Y]),se=t.useCallback((r,g)=>{C||q||te==null||te(r,g)},[C,q,te]),k=t.useRef(-1),u=t.useCallback(()=>{k.current=-1,X(void 0),oe(void 0),re(void 0),ee(!1),O(void 0),w(void 0),c(void 0),b(!1),D(void 0),m(void 0)},[]),z=t.useCallback((r,g)=>{if(r.button===0){if(o!==void 0){if((s==null?void 0:s.hasIndex(o))===!0)for(const v of s){if(v===o)continue;const T=a[v],p=ae(T,k.current,W,M);S==null||S(T,p,v,p+(T.growOffset??0))}const y=ae(a[o],k.current,W,M);if(F==null||F(a[o],y,o,y+(a[o].growOffset??0)),s.hasIndex(o))for(const v of s){if(v===o)continue;const T=a[v],p=ae(T,k.current,W,M);F==null||F(T,p,v,p+(T.growOffset??0))}}u(),i!==void 0&&h!==void 0&&(j==null||j(i,h)),R!==void 0&&N!==void 0&&(E==null||E(R,N))}Z==null||Z(r,g)},[Z,o,i,h,R,N,s,F,a,W,M,S,j,E,u]),I=t.useMemo(()=>{if(!(i===void 0||h===void 0)&&i!==h&&(J==null?void 0:J(i,h))!==!1)return{src:i,dest:h}},[i,h,J]),ie=t.useCallback(r=>{const g=H==null?void 0:H.current;if(i!==void 0&&K!==void 0)Math.abs(r.clientX-K)>20&&b(!0);else if(R!==void 0&&ne!==void 0)Math.abs(r.clientY-ne)>20&&ee(!0);else if(o!==void 0&&f!==void 0&&g){const v=g.getBoundingClientRect().width/g.offsetWidth,T=(r.clientX-f)/v,p=a[o],ue=ae(p,T,W,M);if(S==null||S(p,ue,o,ue+(p.growOffset??0)),k.current=T,(s==null?void 0:s.first())===o)for(const le of s){if(le===o)continue;const fe=a[le],ge=ae(fe,k.current,W,M);S==null||S(fe,ge,le,ge+(fe.growOffset??0))}}},[i,K,R,ne,o,f,a,W,M,S,s,H]),ce=t.useCallback((r,g)=>{if(R===void 0||N===void 0)return x(r,g);let[y,v]=r;return v===N?v=R:(v>N&&(v-=1),v>=R&&(v+=1)),x([y,v],g)},[R,N,x]),de=t.useCallback(r=>{L==null||L(r),r.defaultPrevented()||u()},[u,L]);return U(Se,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:o,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:ce,isResizing:o!==void 0,onHeaderMenuClick:Q,onHeaderIndicatorClick:se,isDragging:C,onItemHovered:d,onDragStart:de,onMouseDown:V,allowResize:G,onMouseUp:z,dragAndDropState:I,onMouseMoveRaw:ie,ref:_})},be=De;function He(e){const f=t.useRef(null),[m,o]=t.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return t.useLayoutEffect(()=>{const D=O=>{for(const h of O){const{width:w,height:C}=h&&h.contentRect||{};o(b=>b.width===w&&b.height===C?b:{width:w,height:C})}},i=new window.ResizeObserver(D);return f.current&&i.observe(f.current,void 0),()=>{i.disconnect()}},[f.current]),{ref:f,...m}}const ye=(e,f,m)=>{const o=t.useRef(null),D=t.useRef(null),i=t.useRef(null),O=t.useRef(0),h=t.useRef(f);h.current=f;const w=m.current;t.useEffect(()=>{const C=()=>{var c,R;if(D.current===!1&&w!==null){const X=[w.scrollLeft,w.scrollTop];if(((c=i.current)==null?void 0:c[0])===X[0]&&((R=i.current)==null?void 0:R[1])===X[1])if(O.current>10){i.current=null,D.current=null;return}else O.current++;else O.current=0,h.current(X[0],X[1]),i.current=X;o.current=window.setTimeout(C,8.333333333333334)}},b=()=>{D.current=!0,i.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},K=c=>{c.touches.length===0&&(D.current=!1,O.current=0,o.current=window.setTimeout(C,8.333333333333334))};if(e&&w!==null){const c=w;return c.addEventListener("touchstart",b),c.addEventListener("touchend",K),()=>{c.removeEventListener("touchstart",b),c.removeEventListener("touchend",K),o.current!==null&&window.clearTimeout(o.current)}}},[e,w])},xe=ye,Me=()=>e=>e.isSafari?"scroll":"auto",ke=Ce("div")({name:"ScrollRegionStyle",class:"sj2f20c",propsAsIs:!1,vars:{"sj2f20c-0":[Me()]}});function Te(e){const[f,m]=t.useState(!1),o=typeof window>"u"?null:window,D=t.useRef(0);return ve("touchstart",t.useCallback(()=>{window.clearTimeout(D.current),m(!0)},[]),o,!0,!1),ve("touchend",t.useCallback(i=>{i.touches.length===0&&(D.current=window.setTimeout(()=>m(!1),e))},[e]),o,!0,!1),f}const Ie=e=>{var G,a;const{children:f,clientHeight:m,scrollHeight:o,scrollWidth:D,update:i,draggable:O,className:h,preventDiagonalScrolling:w=!1,paddingBottom:C=0,paddingRight:b=0,rightElement:K,rightElementProps:c,kineticScrollPerfHack:R=!1,scrollRef:X,initialSize:N}=e,oe=[],q=(c==null?void 0:c.sticky)??!1,ee=(c==null?void 0:c.fill)??!1,ne=t.useRef(0),re=t.useRef(0),Y=t.useRef(null),te=typeof window>"u"?1:window.devicePixelRatio,x=t.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),j=t.useRef(null),S=Te(200),[$,F]=t.useState(!0),_=t.useRef(0);t.useLayoutEffect(()=>{if(!$||S||x.current.lockDirection===void 0)return;const l=Y.current;if(l===null)return;const[s,d]=x.current.lockDirection;s!==void 0?l.scrollLeft=s:d!==void 0&&(l.scrollTop=d),x.current.lockDirection=void 0},[S,$]);const M=t.useCallback((l,s)=>{var de;const d=Y.current;if(d===null)return;s=s??d.scrollTop,l=l??d.scrollLeft;const B=x.current.scrollTop,V=x.current.scrollLeft,Q=l-V,se=s-B;S&&Q!==0&&se!==0&&(Math.abs(Q)>3||Math.abs(se)>3)&&w&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Q)0&&(Math.abs(ie)>2e3||I===0||I===ce)&&o>d.scrollHeight+5){const r=I/ce,g=(o-z)*r;ne.current=g-I}k!==void 0&&(window.clearTimeout(_.current),F(!1),_.current=window.setTimeout(()=>F(!0),200)),i({x:l,y:I+ne.current,width:u-b,height:z-C,paddingRight:((de=j.current)==null?void 0:de.clientWidth)??0})},[C,b,o,i,w,S]);xe(R&&we.value,M,Y);const W=t.useRef(M);W.current=M;const E=t.useRef(),A=t.useRef(!1);t.useLayoutEffect(()=>{A.current?M():A.current=!0},[M,C,b]);const J=t.useCallback(l=>{Y.current=l,X!==void 0&&(X.current=l)},[X]);let P=0,Z=0;for(oe.push(U("div",{style:{width:D,height:0}},P++));ZW.current(),0),E.current={width:L,height:H}),(L??0)===0||(H??0)===0?U("div",{ref:n}):U("div",{ref:n,children:he(ke,{isSafari:we.value,children:[U("div",{className:"dvn-underlay",children:f}),U("div",{ref:J,style:E.current,draggable:O,onDragStart:l=>{O||(l.stopPropagation(),l.preventDefault())},className:"dvn-scroller "+(h??""),onScroll:()=>M(),children:he("div",{className:"dvn-scroll-inner"+(K===void 0?" dvn-hidden":""),children:[U("div",{className:"dvn-stack",children:oe}),K!==void 0&&he(me,{children:[!ee&&U("div",{className:"dvn-spacer"}),U("div",{ref:j,style:{height:H,maxHeight:m-Math.ceil(te%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:b,flexGrow:ee?1:void 0,right:q?b??0:void 0,pointerEvents:"auto"},children:K})]})]})})]})})},Oe=e=>{const{columns:f,rows:m,rowHeight:o,headerHeight:D,groupHeaderHeight:i,enableGroups:O,freezeColumns:h,experimental:w,nonGrowWidth:C,clientSize:b,className:K,onVisibleRegionChanged:c,scrollRef:R,preventDiagonalScrolling:X,rightElement:N,rightElementProps:oe,overscrollX:q,overscrollY:ee,initialSize:ne,smoothScrollX:re=!1,smoothScrollY:Y=!1,isDraggable:te}=e,{paddingRight:x,paddingBottom:j}=w??{},[S,$]=b,F=t.useRef(),_=t.useRef(),M=t.useRef(),W=t.useRef(),E=C+Math.max(0,q??0);let A=O?D+i:D;if(typeof o=="number")A+=m*o;else for(let n=0;n{var se,k;if(J.current===void 0)return;const n={...J.current};let L=0,H=n.x<0?-n.x:0,G=0,a=0;n.x=n.x<0?0:n.x;let l=0;for(let u=0;u=z+u.width)L+=u.width,a++,G++;else if(n.x>z)L+=u.width,re?H+=z-n.x:a++,G++;else if(n.x+n.width>z)L+=u.width,G++;else break}let s=0,d=0,B=0;if(typeof o=="number")Y?(d=Math.floor(n.y/o),s=d*o-n.y):d=Math.ceil(n.y/o),B=Math.ceil(n.height/o)+d,s<0&&B++;else{let u=0;for(let z=0;z=u+I)u+=I,d++,B++;else if(n.y>ie)u+=I,Y?s+=ie-n.y:d++,B++;else if(n.y+n.height>I/2+u)u+=I,B++;else break}}const V={x:a,y:d,width:G-a,height:B-d},Q=F.current;(Q===void 0||Q.y!==V.y||Q.x!==V.x||Q.height!==V.height||Q.width!==V.width||_.current!==H||M.current!==s||n.width!==((se=W.current)==null?void 0:se[0])||n.height!==((k=W.current)==null?void 0:k[1]))&&(c==null||c({x:a,y:d,width:G-a,height:B-d},n.width,n.height,n.paddingRight??0,H,s),F.current=V,_.current=H,M.current=s,W.current=[n.width,n.height])},[f,o,m,c,h,re,Y]),Z=t.useCallback(n=>{J.current=n,P()},[P]);return t.useEffect(()=>{P()},[P]),U(Ie,{scrollRef:R,className:K,kineticScrollPerfHack:w==null?void 0:w.kineticScrollPerfHack,preventDiagonalScrolling:X,draggable:te===!0||typeof te=="string",scrollWidth:E+(x??0),scrollHeight:A+(j??0),clientHeight:$,rightElement:N,paddingBottom:j,paddingRight:x,rightElementProps:oe,update:Z,initialSize:ne,children:U(be,{eventTargetRef:R,width:S,height:$,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator})})},ze=Oe;export{ze as G}; diff --git a/docs/assets/scrolling-data-grid.stories-BLD-s3DI.js b/docs/assets/scrolling-data-grid.stories-hHj024-J.js similarity index 96% rename from docs/assets/scrolling-data-grid.stories-BLD-s3DI.js rename to docs/assets/scrolling-data-grid.stories-hHj024-J.js index e8362b1e3..31988a976 100644 --- a/docs/assets/scrolling-data-grid.stories-BLD-s3DI.js +++ b/docs/assets/scrolling-data-grid.stories-hHj024-J.js @@ -1,4 +1,4 @@ -import{j as i,s as y}from"./marked.esm-dbrxtycE.js";import{r as n}from"./index-BMVQvedj.js";import{B as x}from"./story-utils-K2EZnGjM.js";import{G as T}from"./scrolling-data-grid-rB9VuUnF.js";import{G as c,O as D,m as b,g as H,C as l,P as I}from"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";const k=y("div")({name:"InnerContainer",class:"i1iwi3t9",propsAsIs:!1}),G=o=>{if(o.kind!==c.Custom)return I.find(r=>r.kind===o.kind)},$={title:"Subcomponents/ScrollingDataGrid",decorators:[o=>i("div",{children:i(x,{width:1500,height:1e3,children:i(k,{children:i(o,{})})})})]};function d(){const[o,r]=n.useState(0),[g,m]=n.useState(0),[f,h]=n.useState(0),[v,p]=n.useState(0),C=n.useCallback((e,t,R)=>{r(e.x),m(e.y),h(t),p(R)},[]),w=n.useMemo(()=>{let e=0;return["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"].map(t=>({title:t,width:122+(e+=50)}))},[]),S=n.useCallback(([e,t])=>({kind:c.Text,displayData:`${e},${t} Testing things that are way too long`,data:`${e},${t} Testing things that are way too long`,allowOverlay:!0}),[]);return i(T,{getCellRenderer:G,onMouseMove:()=>{},rows:1e4,enableGroups:!1,clientSize:[1e3,1e3,0],resizeIndicator:"full",cellXOffset:o,cellYOffset:g,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,nonGrowWidth:1e3,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onHeaderIndicatorClick:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseUp:()=>{},canvasRef:void 0,className:void 0,drawCell:void 0,disabledRows:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new D,onHeaderMenuClick:void 0,prelightCells:void 0,drawFocusRing:!0,initialSize:void 0,overscrollX:void 0,overscrollY:void 0,preventDiagonalScrolling:void 0,rightElement:void 0,rightElementProps:void 0,scrollRef:void 0,minColumnWidth:50,isFocused:!0,theme:b(H()),isFilling:!1,maxColumnWidth:500,accessibilityHeight:50,translateX:f,translateY:v,lockColumns:0,selection:{current:void 0,rows:l.empty(),columns:l.empty()},firstColAccessible:!0,groupHeaderHeight:34,headerHeight:44,freezeTrailingRows:0,hasAppendRow:!1,rowHeight:34,onVisibleRegionChanged:C,columns:w,getCellContent:S,freezeColumns:0,verticalBorder:()=>!0,smoothScrollX:!0,smoothScrollY:!0})}var a,s,u;d.parameters={...d.parameters,docs:{...(a=d.parameters)==null?void 0:a.docs,source:{originalSource:`function Simplenotest() { +import{j as i,s as y}from"./marked.esm-dbrxtycE.js";import{r as n}from"./index-BMVQvedj.js";import{B as x}from"./story-utils-K2EZnGjM.js";import{G as T}from"./scrolling-data-grid-wnX0bxop.js";import{G as c,O as D,m as b,g as H,C as l,P as I}from"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";const k=y("div")({name:"InnerContainer",class:"i1iwi3t9",propsAsIs:!1}),G=o=>{if(o.kind!==c.Custom)return I.find(r=>r.kind===o.kind)},$={title:"Subcomponents/ScrollingDataGrid",decorators:[o=>i("div",{children:i(x,{width:1500,height:1e3,children:i(k,{children:i(o,{})})})})]};function d(){const[o,r]=n.useState(0),[g,m]=n.useState(0),[f,h]=n.useState(0),[v,p]=n.useState(0),C=n.useCallback((e,t,R)=>{r(e.x),m(e.y),h(t),p(R)},[]),w=n.useMemo(()=>{let e=0;return["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"].map(t=>({title:t,width:122+(e+=50)}))},[]),S=n.useCallback(([e,t])=>({kind:c.Text,displayData:`${e},${t} Testing things that are way too long`,data:`${e},${t} Testing things that are way too long`,allowOverlay:!0}),[]);return i(T,{getCellRenderer:G,onMouseMove:()=>{},rows:1e4,enableGroups:!1,clientSize:[1e3,1e3,0],resizeIndicator:"full",cellXOffset:o,cellYOffset:g,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,nonGrowWidth:1e3,onCanvasBlur:()=>{},onCanvasFocused:()=>{},onCellFocused:()=>{},onContextMenu:()=>{},onDragEnd:()=>{},onDragLeave:()=>{},onDragOverCell:()=>{},onDragStart:()=>{},onDrop:()=>{},onHeaderIndicatorClick:()=>{},onItemHovered:()=>{},onKeyDown:()=>{},onKeyUp:()=>{},onMouseDown:()=>{},onMouseUp:()=>{},canvasRef:void 0,className:void 0,drawCell:void 0,disabledRows:void 0,fillHandle:void 0,fixedShadowX:void 0,fixedShadowY:void 0,getGroupDetails:void 0,getRowThemeOverride:void 0,highlightRegions:void 0,imageWindowLoader:new D,onHeaderMenuClick:void 0,prelightCells:void 0,drawFocusRing:!0,initialSize:void 0,overscrollX:void 0,overscrollY:void 0,preventDiagonalScrolling:void 0,rightElement:void 0,rightElementProps:void 0,scrollRef:void 0,minColumnWidth:50,isFocused:!0,theme:b(H()),isFilling:!1,maxColumnWidth:500,accessibilityHeight:50,translateX:f,translateY:v,lockColumns:0,selection:{current:void 0,rows:l.empty(),columns:l.empty()},firstColAccessible:!0,groupHeaderHeight:34,headerHeight:44,freezeTrailingRows:0,hasAppendRow:!1,rowHeight:34,onVisibleRegionChanged:C,columns:w,getCellContent:S,freezeColumns:0,verticalBorder:()=>!0,smoothScrollX:!0,smoothScrollY:!0})}var a,s,u;d.parameters={...d.parameters,docs:{...(a=d.parameters)==null?void 0:a.docs,source:{originalSource:`function Simplenotest() { const [x, setX] = React.useState(0); const [y, setY] = React.useState(0); const [translateX, setTx] = React.useState(0); diff --git a/docs/assets/search-as-filter.stories-rGOo9giK.js b/docs/assets/search-as-filter.stories-l3udCDZ_.js similarity index 90% rename from docs/assets/search-as-filter.stories-rGOo9giK.js rename to docs/assets/search-as-filter.stories-l3udCDZ_.js index 281ee50bc..da5193e31 100644 --- a/docs/assets/search-as-filter.stories-rGOo9giK.js +++ b/docs/assets/search-as-filter.stories-l3udCDZ_.js @@ -1,4 +1,4 @@ -import{j as e,F as f}from"./marked.esm-dbrxtycE.js";import{R as o}from"./index-BMVQvedj.js";import{C as c,u as V}from"./image-window-loader--5E_ifQX.js";import{D as y}from"./data-editor-all-zTb9g2fv.js";import{B as R,D,a as F,d as v}from"./utils-qU2KzddR.js";import{S as E}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(E,{children:e(R,{title:"Filtering down to search results",description:e(f,{children:e(D,{children:"You can update your grid however you want based on search inputs."})}),children:e(a,{})})})]},s=()=>{const{cols:a,getCellContent:m,onColumnResize:p,setCellValue:S}=F(),[d,n]=o.useState(!1),[C,g]=o.useState({rows:c.empty(),columns:c.empty()});V("keydown",o.useCallback(t=>{(t.ctrlKey||t.metaKey)&&t.code==="KeyF"&&(n(w=>!w),t.stopPropagation(),t.preventDefault())},[]),window,!1,!0);const[r,l]=o.useState("");return e(y,{...v,searchResults:[],getCellContent:m,getCellsForSelection:!0,gridSelection:C,onGridSelectionChange:g,columns:a,onCellEdited:S,onColumnResize:p,searchValue:r,onSearchValueChange:l,showSearch:d,onSearchClose:()=>{n(!1),l("")},rows:r.length===0?1e4:r.length})};var i,u,h;s.parameters={...s.parameters,docs:{...(i=s.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as e,F as f}from"./marked.esm-dbrxtycE.js";import{R as o}from"./index-BMVQvedj.js";import{C as c,u as V}from"./image-window-loader-ggeJlWLo.js";import{D as y}from"./data-editor-all-ZeeWpldS.js";import{B as R,D,a as F,d as v}from"./utils-MADpeXg5.js";import{S as E}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const T={title:"Glide-Data-Grid/DataEditor Demos",decorators:[a=>e(E,{children:e(R,{title:"Filtering down to search results",description:e(f,{children:e(D,{children:"You can update your grid however you want based on search inputs."})}),children:e(a,{})})})]},s=()=>{const{cols:a,getCellContent:m,onColumnResize:p,setCellValue:S}=F(),[d,n]=o.useState(!1),[C,g]=o.useState({rows:c.empty(),columns:c.empty()});V("keydown",o.useCallback(t=>{(t.ctrlKey||t.metaKey)&&t.code==="KeyF"&&(n(w=>!w),t.stopPropagation(),t.preventDefault())},[]),window,!1,!0);const[r,l]=o.useState("");return e(y,{...v,searchResults:[],getCellContent:m,getCellsForSelection:!0,gridSelection:C,onGridSelectionChange:g,columns:a,onCellEdited:S,onColumnResize:p,searchValue:r,onSearchValueChange:l,showSearch:d,onSearchClose:()=>{n(!1),l("")},rows:r.length===0?1e4:r.length})};var i,u,h;s.parameters={...s.parameters,docs:{...(i=s.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/server-side-data.stories-d_4a-drI.js b/docs/assets/server-side-data.stories-lxb0GRUD.js similarity index 93% rename from docs/assets/server-side-data.stories-d_4a-drI.js rename to docs/assets/server-side-data.stories-lxb0GRUD.js index 15a643a41..4cd1a90cf 100644 --- a/docs/assets/server-side-data.stories-d_4a-drI.js +++ b/docs/assets/server-side-data.stories-lxb0GRUD.js @@ -1,4 +1,4 @@ -import{j as x}from"./marked.esm-dbrxtycE.js";import{g as S,R as l}from"./index-BMVQvedj.js";import{G as y,C as $}from"./image-window-loader--5E_ifQX.js";import{S as B}from"./story-utils-K2EZnGjM.js";import{D as W}from"./data-editor-all-zTb9g2fv.js";import{a as F,b as O,r as C}from"./throttle-7EuXLZa7.js";import{B as V}from"./utils-qU2KzddR.js";import{a as j}from"./doc-wrapper-m1-LpzDL.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./toConsumableArray-ppDpjNRJ.js";function K(e,t,a){var c=-1,r=e.length;t<0&&(t=-t>r?0:r+t),a=a>r?r:a,a<0&&(a+=r),r=t>a?0:a-t>>>0,t>>>=0;for(var o=Array(r);++cx(B,{children:x(e,{})})]};function te(e,t,a,c,r,o){e=Math.max(e,1);const m=l.useRef($.empty()),h=l.useRef([]),[f,G]=l.useState({x:0,y:0,width:0,height:0}),b=l.useRef(f);b.current=f;const T=l.useCallback(n=>{G(s=>n.x===s.x&&n.y===s.y&&n.width===s.width&&n.height===s.height?s:n)},[]),v=l.useCallback(n=>{const[s,d]=n,i=h.current[d];return i!==void 0?c(i,s):{kind:y.Loading,allowOverlay:!1}},[c]),k=l.useCallback(async n=>{var p;m.current=m.current.add(n);const s=n*e,d=await a([s,(n+1)*e]),i=b.current,u=[],w=h.current;for(const[R,E]of d.entries()){w[R+s]=E;for(let D=i.x;D<=i.x+i.width;D++)u.push({cell:[D,R+s]})}(p=o.current)==null||p.updateCells(u)},[a,o,e]),_=l.useCallback(n=>async()=>{const s=Math.max(0,Math.floor(n.y/e)),d=Math.floor((n.y+n.height)/e);for(const u of ee(C(s,d+1).filter(w=>!m.current.hasIndex(w)),t))await Promise.allSettled(u.map(k));const i=[];for(let u=n.y;u{const n=f,s=Math.max(0,Math.floor((n.y-e/2)/e)),d=Math.floor((n.y+n.height+e/2)/e);for(const i of C(s,d+1))m.current.hasIndex(i)||k(i)},[k,e,f]);const A=l.useCallback((n,s)=>{const[,d]=n,i=h.current[d];if(i===void 0)return;const u=r(n,s,i);u!==void 0&&(h.current[d]=u)},[r]);return{getCellContent:v,onVisibleRegionChanged:T,onCellEdited:A,getCellsForSelection:_}}const g=()=>{const e=l.useRef(null),t=l.useCallback(async r=>(await new Promise(o=>setTimeout(o,300)),C(r[0],r[1]).map(o=>[`1, ${o}`,`2, ${o}`])),[]),a=l.useMemo(()=>[{title:"A",width:150},{title:"B",width:200}],[]),c=te(50,5,t,l.useCallback((r,o)=>({kind:y.Text,data:r[o],allowOverlay:!0,displayData:r[o]}),[]),l.useCallback((r,o,m)=>{const[h]=r;if(o.kind!==y.Text)return;const f=[...m];return f[h]=o.data,f},[]),e);return x(V,{title:"Server Side Data",description:x(j,{children:"Glide data grid is fully ready to handle your server side data needs. This example condenses the implementation into a single custom hook and loads in pages of 50. We are using 300ms sleeps, but network transactions should work the same."}),children:x(W,{ref:e,...c,width:"100%",columns:a,rows:3e3,rowMarkers:"both"})})};g.parameters={options:{showPanel:!1}};var M,I,P;g.parameters={...g.parameters,docs:{...(M=g.parameters)==null?void 0:M.docs,source:{originalSource:`() => { +import{j as x}from"./marked.esm-dbrxtycE.js";import{g as S,R as l}from"./index-BMVQvedj.js";import{G as y,C as $}from"./image-window-loader-ggeJlWLo.js";import{S as B}from"./story-utils-K2EZnGjM.js";import{D as W}from"./data-editor-all-ZeeWpldS.js";import{a as F,b as O,r as C}from"./throttle-7EuXLZa7.js";import{B as V}from"./utils-MADpeXg5.js";import{a as j}from"./doc-wrapper-m1-LpzDL.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./toConsumableArray-ppDpjNRJ.js";function K(e,t,a){var c=-1,r=e.length;t<0&&(t=-t>r?0:r+t),a=a>r?r:a,a<0&&(a+=r),r=t>a?0:a-t>>>0,t>>>=0;for(var o=Array(r);++cx(B,{children:x(e,{})})]};function te(e,t,a,c,r,o){e=Math.max(e,1);const m=l.useRef($.empty()),h=l.useRef([]),[f,G]=l.useState({x:0,y:0,width:0,height:0}),b=l.useRef(f);b.current=f;const T=l.useCallback(n=>{G(s=>n.x===s.x&&n.y===s.y&&n.width===s.width&&n.height===s.height?s:n)},[]),v=l.useCallback(n=>{const[s,d]=n,i=h.current[d];return i!==void 0?c(i,s):{kind:y.Loading,allowOverlay:!1}},[c]),k=l.useCallback(async n=>{var p;m.current=m.current.add(n);const s=n*e,d=await a([s,(n+1)*e]),i=b.current,u=[],w=h.current;for(const[R,E]of d.entries()){w[R+s]=E;for(let D=i.x;D<=i.x+i.width;D++)u.push({cell:[D,R+s]})}(p=o.current)==null||p.updateCells(u)},[a,o,e]),_=l.useCallback(n=>async()=>{const s=Math.max(0,Math.floor(n.y/e)),d=Math.floor((n.y+n.height)/e);for(const u of ee(C(s,d+1).filter(w=>!m.current.hasIndex(w)),t))await Promise.allSettled(u.map(k));const i=[];for(let u=n.y;u{const n=f,s=Math.max(0,Math.floor((n.y-e/2)/e)),d=Math.floor((n.y+n.height+e/2)/e);for(const i of C(s,d+1))m.current.hasIndex(i)||k(i)},[k,e,f]);const A=l.useCallback((n,s)=>{const[,d]=n,i=h.current[d];if(i===void 0)return;const u=r(n,s,i);u!==void 0&&(h.current[d]=u)},[r]);return{getCellContent:v,onVisibleRegionChanged:T,onCellEdited:A,getCellsForSelection:_}}const g=()=>{const e=l.useRef(null),t=l.useCallback(async r=>(await new Promise(o=>setTimeout(o,300)),C(r[0],r[1]).map(o=>[`1, ${o}`,`2, ${o}`])),[]),a=l.useMemo(()=>[{title:"A",width:150},{title:"B",width:200}],[]),c=te(50,5,t,l.useCallback((r,o)=>({kind:y.Text,data:r[o],allowOverlay:!0,displayData:r[o]}),[]),l.useCallback((r,o,m)=>{const[h]=r;if(o.kind!==y.Text)return;const f=[...m];return f[h]=o.data,f},[]),e);return x(V,{title:"Server Side Data",description:x(j,{children:"Glide data grid is fully ready to handle your server side data needs. This example condenses the implementation into a single custom hook and loads in pages of 50. We are using 300ms sleeps, but network transactions should work the same."}),children:x(W,{ref:e,...c,width:"100%",columns:a,rows:3e3,rowMarkers:"both"})})};g.parameters={options:{showPanel:!1}};var M,I,P;g.parameters={...g.parameters,docs:{...(M=g.parameters)==null?void 0:M.docs,source:{originalSource:`() => { const ref = React.useRef(null); const getRowData = React.useCallback(async (r: Item) => { await new Promise(res => setTimeout(res, 300)); diff --git a/docs/assets/shadow-dom.stories-7TXZtV5D.js b/docs/assets/shadow-dom.stories-gOMw4cfa.js similarity index 82% rename from docs/assets/shadow-dom.stories-7TXZtV5D.js rename to docs/assets/shadow-dom.stories-gOMw4cfa.js index e793c9a3f..3bc7d7639 100644 --- a/docs/assets/shadow-dom.stories-7TXZtV5D.js +++ b/docs/assets/shadow-dom.stories-gOMw4cfa.js @@ -1,4 +1,4 @@ -import{j as e,a as u,F as h}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-zTb9g2fv.js";import{B as w,D,P as g,u as R,d as S}from"./utils-qU2KzddR.js";import{S as y}from"./story-utils-K2EZnGjM.js";import{R as C}from"./index-wocATsGp.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(y,{children:e(w,{title:"Shadow DOM",description:u(D,{children:["Columns in the data grid may be grouped by setting their ",e(g,{children:"group"})," ","property."]}),children:e(t,{})})})]},n=()=>{const{cols:t,getCellContent:o}=R(20,!1,!1);return e(E,{render:()=>e(f,{...S,getCellContent:o,columns:t,rows:1e3,height:"100%",rowMarkers:"both"})})},M=t=>{const o=document.createElement("style");for(const r of document.styleSheets)try{if(r.cssRules!==void 0){const s=[...r.cssRules].map(i=>i.cssText).join(` +import{j as e,a as u,F as h}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-ZeeWpldS.js";import{B as w,D,P as g,u as R,d as S}from"./utils-MADpeXg5.js";import{S as y}from"./story-utils-K2EZnGjM.js";import{R as C}from"./index-wocATsGp.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const q={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(y,{children:e(w,{title:"Shadow DOM",description:u(D,{children:["Columns in the data grid may be grouped by setting their ",e(g,{children:"group"})," ","property."]}),children:e(t,{})})})]},n=()=>{const{cols:t,getCellContent:o}=R(20,!1,!1);return e(E,{render:()=>e(f,{...S,getCellContent:o,columns:t,rows:1e3,height:"100%",rowMarkers:"both"})})},M=t=>{const o=document.createElement("style");for(const r of document.styleSheets)try{if(r.cssRules!==void 0){const s=[...r.cssRules].map(i=>i.cssText).join(` `);o.append(document.createTextNode(s))}}catch(s){console.warn("Cannot access stylesheet rules due to CORS policy",s)}t.append(o)},E=({className:t,render:o})=>{const r=l.useRef(null),s=l.useRef(!0);return l.useEffect(()=>{if(r.current===null||s.current){s.current=!1;return}const c=r.current.attachShadow({mode:"open"});window.glideShadowRoot=c,M(c);const a=document.createElement("div");return a.style.height="100%",c.append(a),C.render(e(h,{children:o()}),a),()=>{a.remove()}},[o]),e("div",{ref:r,className:t,style:{height:"100%"}})};var d,p,m;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const { cols, diff --git a/docs/assets/silly-numbers.stories-xhq3GNLr.js b/docs/assets/silly-numbers.stories-pjTTVQ6Y.js similarity index 78% rename from docs/assets/silly-numbers.stories-xhq3GNLr.js rename to docs/assets/silly-numbers.stories-pjTTVQ6Y.js index 50937dca5..358c63193 100644 --- a/docs/assets/silly-numbers.stories-xhq3GNLr.js +++ b/docs/assets/silly-numbers.stories-pjTTVQ6Y.js @@ -1,4 +1,4 @@ -import{j as r}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as a}from"./data-editor-all-zTb9g2fv.js";import{B as n,D as m,u as p,d as c}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const G={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>r(u,{children:r(n,{title:"100 Million Rows",description:r(m,{children:"100 million rows is silly. Once we cross about 33 million pixels in height we can no longer trust the browser to scroll accurately."}),children:r(e,{})})})]},o=()=>{const{cols:e,getCellContent:l}=p(6);return r(a,{...c,getCellContent:l,columns:e,rowHeight:31,rows:1e8,rowMarkers:"number"})};var t,s,i;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => { +import{j as r}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as a}from"./data-editor-all-ZeeWpldS.js";import{B as n,D as m,u as p,d as c}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const G={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>r(u,{children:r(n,{title:"100 Million Rows",description:r(m,{children:"100 million rows is silly. Once we cross about 33 million pixels in height we can no longer trust the browser to scroll accurately."}),children:r(e,{})})})]},o=()=>{const{cols:e,getCellContent:l}=p(6);return r(a,{...c,getCellContent:l,columns:e,rowHeight:31,rows:1e8,rowMarkers:"number"})};var t,s,i;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/small-editable-grid.stories-1GHfUE3O.js b/docs/assets/small-editable-grid.stories-l1Vy5okC.js similarity index 78% rename from docs/assets/small-editable-grid.stories-1GHfUE3O.js rename to docs/assets/small-editable-grid.stories-l1Vy5okC.js index 5cd12d4ab..c05a077c8 100644 --- a/docs/assets/small-editable-grid.stories-1GHfUE3O.js +++ b/docs/assets/small-editable-grid.stories-l1Vy5okC.js @@ -1,4 +1,4 @@ -import{j as e}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-zTb9g2fv.js";import{B as d,D as m,u as p,d as c}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(u,{children:e(d,{title:"Editable Grid",description:e(m,{children:"Data grid supports overlay editors for changing values. There are bespoke editors for numbers, strings, images, booleans, markdown, and uri."}),children:e(t,{})})})]},r=()=>{const{cols:t,getCellContent:l,setCellValue:i}=p(6,!1);return e(n,{...c,getCellContent:l,columns:t,rows:20,onCellEdited:i})};var o,a,s;r.parameters={...r.parameters,docs:{...(o=r.parameters)==null?void 0:o.docs,source:{originalSource:`() => { +import{j as e}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-ZeeWpldS.js";import{B as d,D as m,u as p,d as c}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>e(u,{children:e(d,{title:"Editable Grid",description:e(m,{children:"Data grid supports overlay editors for changing values. There are bespoke editors for numbers, strings, images, booleans, markdown, and uri."}),children:e(t,{})})})]},r=()=>{const{cols:t,getCellContent:l,setCellValue:i}=p(6,!1);return e(n,{...c,getCellContent:l,columns:t,rows:20,onCellEdited:i})};var o,a,s;r.parameters={...r.parameters,docs:{...(o=r.parameters)==null?void 0:o.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/smooth-scrolling-grid.stories-DSIsyYN3.js b/docs/assets/smooth-scrolling-grid.stories-4dHWEWrt.js similarity index 77% rename from docs/assets/smooth-scrolling-grid.stories-DSIsyYN3.js rename to docs/assets/smooth-scrolling-grid.stories-4dHWEWrt.js index 6206fa694..527045f7d 100644 --- a/docs/assets/smooth-scrolling-grid.stories-DSIsyYN3.js +++ b/docs/assets/smooth-scrolling-grid.stories-4dHWEWrt.js @@ -1,4 +1,4 @@ -import{j as o,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as d,P as l,u as h,d as S}from"./utils-qU2KzddR.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(u,{children:o(p,{title:"Smooth scrolling",description:c(d,{children:["You can enable smooth scrolling with the ",o(l,{children:"smoothScrollX"})," and"," ",o(l,{children:"smoothScrollY"})," props. Disabling smooth scrolling can dramatically increase performance and improve visual stability during rapid scrolling."]}),children:o(t,{})})})]},r=t=>{const{cols:i,getCellContent:m}=h(30);return o(n,{...S,smoothScrollX:t.smoothScrollX,smoothScrollY:t.smoothScrollY,getCellContent:m,columns:i,rows:1e4})};r.args={smoothScrollX:!1,smoothScrollY:!1};var s,e,a;r.parameters={...r.parameters,docs:{...(s=r.parameters)==null?void 0:s.docs,source:{originalSource:`p => { +import{j as o,a as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as d,P as l,u as h,d as S}from"./utils-MADpeXg5.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>o(u,{children:o(p,{title:"Smooth scrolling",description:c(d,{children:["You can enable smooth scrolling with the ",o(l,{children:"smoothScrollX"})," and"," ",o(l,{children:"smoothScrollY"})," props. Disabling smooth scrolling can dramatically increase performance and improve visual stability during rapid scrolling."]}),children:o(t,{})})})]},r=t=>{const{cols:i,getCellContent:m}=h(30);return o(n,{...S,smoothScrollX:t.smoothScrollX,smoothScrollY:t.smoothScrollY,getCellContent:m,columns:i,rows:1e4})};r.args={smoothScrollX:!1,smoothScrollY:!1};var s,e,a;r.parameters={...r.parameters,docs:{...(s=r.parameters)==null?void 0:s.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/span-cell.stories-tX8hzNLk.js b/docs/assets/span-cell.stories-WMdPvU3C.js similarity index 89% rename from docs/assets/span-cell.stories-tX8hzNLk.js rename to docs/assets/span-cell.stories-WMdPvU3C.js index 668061edd..55f52cf2f 100644 --- a/docs/assets/span-cell.stories-tX8hzNLk.js +++ b/docs/assets/span-cell.stories-WMdPvU3C.js @@ -1,4 +1,4 @@ -import{j as t,a as c}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-zTb9g2fv.js";import{B as w,D as S,P as C,M as x,u as G,d as v}from"./utils-qU2KzddR.js";import{G as m}from"./image-window-loader--5E_ifQX.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(D,{children:t(w,{title:"Spans",description:c(S,{children:["By setting the ",t(C,{children:"span"})," of a cell you can create spans in your grid. All cells within a span must return consistent data for defined behavior.",c(x,{children:["Spans will always be split if they span frozen and non-frozen columns. By default selections are always expanded to include a span. This can be disabled using the"," ",t(C,{children:"spanRangeBehavior"})," prop."]})]}),children:t(o,{})})})]},a=()=>{const{cols:o,getCellContent:i}=G(100,!0,!0),r=d.useCallback(e=>{const[n,l]=e;return l===6&&n>=3&&n<=4?{kind:m.Text,allowOverlay:!1,data:"Span Cell that is very long and will go past the cell limits",span:[3,4],displayData:"Span Cell that is very long and will go past the cell limits"}:l===5?{kind:m.Text,allowOverlay:!1,data:"Span Cell that is very long and will go past the cell limits",span:[0,99],displayData:"Span Cell that is very long and will go past the cell limits"}:i(e)},[i]),y=d.useCallback(e=>{const n=[];for(let l=e.y;l { +import{j as t,a as c}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{D as f}from"./data-editor-all-ZeeWpldS.js";import{B as w,D as S,P as C,M as x,u as G,d as v}from"./utils-MADpeXg5.js";import{G as m}from"./image-window-loader-ggeJlWLo.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const W={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>t(D,{children:t(w,{title:"Spans",description:c(S,{children:["By setting the ",t(C,{children:"span"})," of a cell you can create spans in your grid. All cells within a span must return consistent data for defined behavior.",c(x,{children:["Spans will always be split if they span frozen and non-frozen columns. By default selections are always expanded to include a span. This can be disabled using the"," ",t(C,{children:"spanRangeBehavior"})," prop."]})]}),children:t(o,{})})})]},a=()=>{const{cols:o,getCellContent:i}=G(100,!0,!0),r=d.useCallback(e=>{const[n,l]=e;return l===6&&n>=3&&n<=4?{kind:m.Text,allowOverlay:!1,data:"Span Cell that is very long and will go past the cell limits",span:[3,4],displayData:"Span Cell that is very long and will go past the cell limits"}:l===5?{kind:m.Text,allowOverlay:!1,data:"Span Cell that is very long and will go past the cell limits",span:[0,99],displayData:"Span Cell that is very long and will go past the cell limits"}:i(e)},[i]),y=d.useCallback(e=>{const n=[];for(let l=e.y;l { const { cols, getCellContent diff --git a/docs/assets/stretch-column-size.stories-je-gWdg3.js b/docs/assets/stretch-column-size.stories-iOY1CWt9.js similarity index 84% rename from docs/assets/stretch-column-size.stories-je-gWdg3.js rename to docs/assets/stretch-column-size.stories-iOY1CWt9.js index e0291cc20..d3c32c734 100644 --- a/docs/assets/stretch-column-size.stories-je-gWdg3.js +++ b/docs/assets/stretch-column-size.stories-iOY1CWt9.js @@ -1,4 +1,4 @@ -import{j as e,a as C}from"./marked.esm-dbrxtycE.js";import{R as a}from"./index-BMVQvedj.js";import{D as w}from"./data-editor-all-zTb9g2fv.js";import{B as z,D as R,P as S,u as f,d as g}from"./utils-qU2KzddR.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(z,{title:"Column Grow",description:C(R,{children:["Columns in the data grid may be set to grow to fill space by setting the"," ",e(S,{children:"grow"})," prop."]}),children:e(o,{})})})]},r=()=>{const{cols:o,getCellContent:l,onColumnResize:u}=f(5,!0,!0),s=a.useRef(new Set),p=a.useMemo(()=>o.map((t,n)=>({...t,grow:s.current.has(n)?void 0:(5+n)/5})),[o]);return e(w,{...g,getCellContent:l,columns:p,rows:1e3,onColumnResize:(t,n,d,h)=>{s.current.add(d),u(t,h)},rowMarkers:"both"})};var i,m,c;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{j as e,a as C}from"./marked.esm-dbrxtycE.js";import{R as a}from"./index-BMVQvedj.js";import{D as w}from"./data-editor-all-ZeeWpldS.js";import{B as z,D as R,P as S,u as f,d as g}from"./utils-MADpeXg5.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(z,{title:"Column Grow",description:C(R,{children:["Columns in the data grid may be set to grow to fill space by setting the"," ",e(S,{children:"grow"})," prop."]}),children:e(o,{})})})]},r=()=>{const{cols:o,getCellContent:l,onColumnResize:u}=f(5,!0,!0),s=a.useRef(new Set),p=a.useMemo(()=>o.map((t,n)=>({...t,grow:s.current.has(n)?void 0:(5+n)/5})),[o]);return e(w,{...g,getCellContent:l,columns:p,rows:1e3,onColumnResize:(t,n,d,h)=>{s.current.add(d),u(t,h)},rowMarkers:"both"})};var i,m,c;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/ten-million-cells.stories-1_UuWv9S.js b/docs/assets/ten-million-cells.stories-uQH2qa2w.js similarity index 76% rename from docs/assets/ten-million-cells.stories-1_UuWv9S.js rename to docs/assets/ten-million-cells.stories-uQH2qa2w.js index 534433ec9..01a6d6114 100644 --- a/docs/assets/ten-million-cells.stories-1_UuWv9S.js +++ b/docs/assets/ten-million-cells.stories-uQH2qa2w.js @@ -1,4 +1,4 @@ -import{j as r}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-zTb9g2fv.js";import{B as a,D as m,u as p,d as c}from"./utils-qU2KzddR.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const b={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(d,{children:r(a,{title:"Ten Million Cells",description:r(m,{children:"Data grid supports over 10 million cells. Go nuts with it."}),children:r(o,{})})})]},e=()=>{const{cols:o,getCellContent:l}=p(100);return r(n,{...c,rowMarkers:"number",getCellContent:l,columns:o,rows:1e5})};var t,s,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`() => { +import{j as r}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as n}from"./data-editor-all-ZeeWpldS.js";import{B as a,D as m,u as p,d as c}from"./utils-MADpeXg5.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const b={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(d,{children:r(a,{title:"Ten Million Cells",description:r(m,{children:"Data grid supports over 10 million cells. Go nuts with it."}),children:r(o,{})})})]},e=()=>{const{cols:o,getCellContent:l}=p(100);return r(n,{...c,rowMarkers:"number",getCellContent:l,columns:o,rows:1e5})};var t,s,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/theme-per-column.stories-isrD9oZt.js b/docs/assets/theme-per-column.stories-21oCUHRj.js similarity index 90% rename from docs/assets/theme-per-column.stories-isrD9oZt.js rename to docs/assets/theme-per-column.stories-21oCUHRj.js index a791d71ae..6f34632d2 100644 --- a/docs/assets/theme-per-column.stories-isrD9oZt.js +++ b/docs/assets/theme-per-column.stories-21oCUHRj.js @@ -1,4 +1,4 @@ -import{j as n,F as m}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{D as F}from"./data-editor-all-zTb9g2fv.js";import{B as p,D as A,a as g,d as u}from"./utils-qU2KzddR.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>n(h,{children:n(p,{title:"Theme per column",description:n(m,{children:n(A,{children:"Each column can provide theme overrides for rendering that column."})}),children:n(t,{})})})]},r=()=>{const{cols:t,getCellContent:l,onColumnResize:s,setCellValue:C}=g(),i=d.useMemo(()=>{const e=[...t];return e[3]={...e[3],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF",baseFontStyle:"600 13px"}},e[4]={...e[4],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF",baseFontStyle:"600 13px"}},e[9]={...e[9],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF"}},e[10]={...e[10],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF"}},e},[t]);return n(F,{...u,getCellContent:l,columns:i,onCellEdited:C,onColumnResize:s,rows:1e3})};var o,c,a;r.parameters={...r.parameters,docs:{...(o=r.parameters)==null?void 0:o.docs,source:{originalSource:`() => { +import{j as n,F as m}from"./marked.esm-dbrxtycE.js";import{R as d}from"./index-BMVQvedj.js";import{D as F}from"./data-editor-all-ZeeWpldS.js";import{B as p,D as A,a as g,d as u}from"./utils-MADpeXg5.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const z={title:"Glide-Data-Grid/DataEditor Demos",decorators:[t=>n(h,{children:n(p,{title:"Theme per column",description:n(m,{children:n(A,{children:"Each column can provide theme overrides for rendering that column."})}),children:n(t,{})})})]},r=()=>{const{cols:t,getCellContent:l,onColumnResize:s,setCellValue:C}=g(),i=d.useMemo(()=>{const e=[...t];return e[3]={...e[3],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF",baseFontStyle:"600 13px"}},e[4]={...e[4],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF",baseFontStyle:"600 13px"}},e[9]={...e[9],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF"}},e[10]={...e[10],themeOverride:{textDark:"#009CA6",bgIconHeader:"#009CA6",accentColor:"#009CA6",accentLight:"#009CA620",fgIconHeader:"#FFFFFF"}},e},[t]);return n(F,{...u,getCellContent:l,columns:i,onCellEdited:C,onColumnResize:s,rows:1e3})};var o,c,a;r.parameters={...r.parameters,docs:{...(o=r.parameters)==null?void 0:o.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/theme-per-row.stories-IBnFrFRd.js b/docs/assets/theme-per-row.stories-QYCshzOF.js similarity index 85% rename from docs/assets/theme-per-row.stories-IBnFrFRd.js rename to docs/assets/theme-per-row.stories-QYCshzOF.js index fc25ce4cc..990b17918 100644 --- a/docs/assets/theme-per-row.stories-IBnFrFRd.js +++ b/docs/assets/theme-per-row.stories-QYCshzOF.js @@ -1,4 +1,4 @@ -import{j as e,F as c,a as p}from"./marked.esm-dbrxtycE.js";import{R as u}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-zTb9g2fv.js";import{B as f,D as h,P as g,u as R,d as w}from"./utils-qU2KzddR.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const A={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(f,{title:"Theme per row",description:e(c,{children:p(h,{children:["Each row can provide theme overrides for rendering that row using the"," ",e(g,{children:"getRowThemeOverride"})," callback."]})}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:i,onColumnResize:a,setCellValue:m}=R(5),d=u.useMemo(()=>{const r=[...o];return r[3]={...r[3],themeOverride:{bgCell:"#d6fafd"}},r},[o]);return e(C,{...w,getCellContent:i,columns:d,height:"100%",getRowThemeOverride:r=>r%2===0?void 0:{bgCell:"#e0f0ff88"},onCellEdited:m,onColumnResize:a,rows:10})};var n,s,l;t.parameters={...t.parameters,docs:{...(n=t.parameters)==null?void 0:n.docs,source:{originalSource:`() => { +import{j as e,F as c,a as p}from"./marked.esm-dbrxtycE.js";import{R as u}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-ZeeWpldS.js";import{B as f,D as h,P as g,u as R,d as w}from"./utils-MADpeXg5.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const A={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(f,{title:"Theme per row",description:e(c,{children:p(h,{children:["Each row can provide theme overrides for rendering that row using the"," ",e(g,{children:"getRowThemeOverride"})," callback."]})}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:i,onColumnResize:a,setCellValue:m}=R(5),d=u.useMemo(()=>{const r=[...o];return r[3]={...r[3],themeOverride:{bgCell:"#d6fafd"}},r},[o]);return e(C,{...w,getCellContent:i,columns:d,height:"100%",getRowThemeOverride:r=>r%2===0?void 0:{bgCell:"#e0f0ff88"},onCellEdited:m,onColumnResize:a,rows:10})};var n,s,l;t.parameters={...t.parameters,docs:{...(n=t.parameters)==null?void 0:n.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/theme-support.stories-2BOQXcq1.js b/docs/assets/theme-support.stories-Tbsj0CEF.js similarity index 93% rename from docs/assets/theme-support.stories-2BOQXcq1.js rename to docs/assets/theme-support.stories-Tbsj0CEF.js index e460cbc4a..2b9cb0867 100644 --- a/docs/assets/theme-support.stories-2BOQXcq1.js +++ b/docs/assets/theme-support.stories-Tbsj0CEF.js @@ -1,4 +1,4 @@ -import{j as e,a as s,F as C}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as R}from"./data-editor-all-zTb9g2fv.js";import{a as S,B as w,D as k,P as x,M as D,d as H}from"./utils-qU2KzddR.js";import{S as F}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(F,{children:e(n,{})})]},y={accentColor:"#8c96ff",accentLight:"rgba(202, 206, 255, 0.253)",textDark:"#ffffff",textMedium:"#b8b8b8",textLight:"#a0a0a0",textBubble:"#ffffff",bgIconHeader:"#b8b8b8",fgIconHeader:"#000000",textHeader:"#a1a1a1",textHeaderSelected:"#000000",bgCell:"#16161b",bgCellMedium:"#202027",bgHeader:"#212121",bgHeaderHasFocus:"#474747",bgHeaderHovered:"#404040",bgBubble:"#212121",bgBubbleSelected:"#000000",bgSearchResult:"#423c24",borderColor:"rgba(225,225,225,0.2)",drilldownBorder:"rgba(225,225,225,0.4)",linkColor:"#4F5DFF",headerFontStyle:"bold 14px",baseFontStyle:"13px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif"},v={accentColor:"#8c96ff",accentLight:"rgba(202, 206, 255, 0.253)",textDark:"#ffffff",textMedium:"rgba(255, 255, 255, 0.9)",textLight:"rgba(255, 255, 255, 0.7)",textBubble:"#000000",bgIconHeader:"#880000",fgIconHeader:"#ff5555",textHeader:"rgba(0, 0, 0, 0.9)",textHeaderSelected:"#000000",bgCell:"#ff0000",bgCellMedium:"#ff4d4d",bgHeader:"#f3f300",bgHeaderHasFocus:"#eeee00",bgHeaderHovered:"#e0e000",bgBubble:"#ffff00",bgBubbleSelected:"#ffff00",bgSearchResult:"#423c24",borderColor:"#ffff00",drilldownBorder:"#ffff00",linkColor:"#4F5DFF",headerFontStyle:"bold 14px",baseFontStyle:"13px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",roundingRadius:6},o=()=>{const{cols:n,getCellContent:p,onColumnResize:m,setCellValue:r}=S(),[f,a]=i.useState({}),[l,b]=i.useState(1e3),h=i.useCallback(()=>{const g=l;b(t=>t+1);for(let t=0;t<6;t++)r([t,g],{displayData:"",data:""})},[l,r]);return e(w,{title:"Theme support",description:s(C,{children:[s(k,{children:["DataGrid respects the theme provided by the ",e(x,{children:"theme"})," prop."]}),s(D,{children:[e("button",{onClick:()=>a({}),children:"Light"})," or"," ",e("button",{onClick:()=>a(y),children:"Dark"})," even"," ",e("button",{onClick:()=>a(v),children:"Hotdog Stand"})]})]}),children:e(R,{...H,theme:f,getCellContent:p,columns:n,onRowAppended:h,trailingRowOptions:{tint:!0,sticky:!0},onCellEdited:r,onColumnResize:m,rows:l})})};var d,c,u;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{j as e,a as s,F as C}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as R}from"./data-editor-all-ZeeWpldS.js";import{a as S,B as w,D as k,P as x,M as D,d as H}from"./utils-MADpeXg5.js";import{S as F}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const _={title:"Glide-Data-Grid/DataEditor Demos",decorators:[n=>e(F,{children:e(n,{})})]},y={accentColor:"#8c96ff",accentLight:"rgba(202, 206, 255, 0.253)",textDark:"#ffffff",textMedium:"#b8b8b8",textLight:"#a0a0a0",textBubble:"#ffffff",bgIconHeader:"#b8b8b8",fgIconHeader:"#000000",textHeader:"#a1a1a1",textHeaderSelected:"#000000",bgCell:"#16161b",bgCellMedium:"#202027",bgHeader:"#212121",bgHeaderHasFocus:"#474747",bgHeaderHovered:"#404040",bgBubble:"#212121",bgBubbleSelected:"#000000",bgSearchResult:"#423c24",borderColor:"rgba(225,225,225,0.2)",drilldownBorder:"rgba(225,225,225,0.4)",linkColor:"#4F5DFF",headerFontStyle:"bold 14px",baseFontStyle:"13px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif"},v={accentColor:"#8c96ff",accentLight:"rgba(202, 206, 255, 0.253)",textDark:"#ffffff",textMedium:"rgba(255, 255, 255, 0.9)",textLight:"rgba(255, 255, 255, 0.7)",textBubble:"#000000",bgIconHeader:"#880000",fgIconHeader:"#ff5555",textHeader:"rgba(0, 0, 0, 0.9)",textHeaderSelected:"#000000",bgCell:"#ff0000",bgCellMedium:"#ff4d4d",bgHeader:"#f3f300",bgHeaderHasFocus:"#eeee00",bgHeaderHovered:"#e0e000",bgBubble:"#ffff00",bgBubbleSelected:"#ffff00",bgSearchResult:"#423c24",borderColor:"#ffff00",drilldownBorder:"#ffff00",linkColor:"#4F5DFF",headerFontStyle:"bold 14px",baseFontStyle:"13px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",roundingRadius:6},o=()=>{const{cols:n,getCellContent:p,onColumnResize:m,setCellValue:r}=S(),[f,a]=i.useState({}),[l,b]=i.useState(1e3),h=i.useCallback(()=>{const g=l;b(t=>t+1);for(let t=0;t<6;t++)r([t,g],{displayData:"",data:""})},[l,r]);return e(w,{title:"Theme support",description:s(C,{children:[s(k,{children:["DataGrid respects the theme provided by the ",e(x,{children:"theme"})," prop."]}),s(D,{children:[e("button",{onClick:()=>a({}),children:"Light"})," or"," ",e("button",{onClick:()=>a(y),children:"Dark"})," even"," ",e("button",{onClick:()=>a(v),children:"Hotdog Stand"})]})]}),children:e(R,{...H,theme:f,getCellContent:p,columns:n,onRowAppended:h,trailingRowOptions:{tint:!0,sticky:!0},onCellEdited:r,onColumnResize:m,rows:l})})};var d,c,u;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/tooltips.stories-JLwf15EA.js b/docs/assets/tooltips.stories-L9--bKUS.js similarity index 89% rename from docs/assets/tooltips.stories-JLwf15EA.js rename to docs/assets/tooltips.stories-L9--bKUS.js index 215b648f2..62bfff9a2 100644 --- a/docs/assets/tooltips.stories-JLwf15EA.js +++ b/docs/assets/tooltips.stories-L9--bKUS.js @@ -1,4 +1,4 @@ -import{j as t,a as m,F as b}from"./marked.esm-dbrxtycE.js";import{R as r}from"./index-BMVQvedj.js";import{u as w}from"./react-laag.esm-PpDllAFI.js";import{D as y}from"./data-editor-all-zTb9g2fv.js";import{B as T,D as v,P as R,u as x,d as C}from"./utils-qU2KzddR.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[i=>t(k,{children:t(T,{title:"Tooltips",className:"double",description:m(v,{children:["Using the ",t(R,{children:"onItemHovered"})," event makes it easy to create tooltips. This story is intentionally forced to scroll vertically so layout in scrolling documents can be confirmed."]}),children:t(i,{})})})]},D={left:0,top:0,width:0,height:0,bottom:0,right:0},s=()=>{const{cols:i,getCellContent:f}=x(6),[o,a]=r.useState(),n=r.useRef(0),g=r.useCallback(e=>{e.kind==="cell"?(window.clearTimeout(n.current),a(void 0),n.current=window.setTimeout(()=>{a({val:`Tooltip for ${e.location[0]}, ${e.location[1]}`,bounds:{left:e.bounds.x,top:e.bounds.y,width:e.bounds.width,height:e.bounds.height,right:e.bounds.x+e.bounds.width,bottom:e.bounds.y+e.bounds.height}})},1e3)):(window.clearTimeout(n.current),n.current=0,a(void 0))},[]);r.useEffect(()=>()=>window.clearTimeout(n.current),[]);const d=o!==void 0,{renderLayer:h,layerProps:l}=w({isOpen:d,triggerOffset:4,auto:!0,container:"portal",trigger:{getBounds:()=>(o==null?void 0:o.bounds)??D}});return m(b,{children:[t(y,{...C,onItemHovered:g,getCellContent:f,columns:i,rowMarkers:"both",rows:1e3}),d&&h(t("div",{...l,style:{...l.style,padding:"8px 12px",color:"white",font:"500 13px Inter",backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:9},children:o.val}))]})};var u,c,p;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{j as t,a as m,F as b}from"./marked.esm-dbrxtycE.js";import{R as r}from"./index-BMVQvedj.js";import{u as w}from"./react-laag.esm-PpDllAFI.js";import{D as y}from"./data-editor-all-ZeeWpldS.js";import{B as T,D as v,P as R,u as x,d as C}from"./utils-MADpeXg5.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const N={title:"Glide-Data-Grid/DataEditor Demos",decorators:[i=>t(k,{children:t(T,{title:"Tooltips",className:"double",description:m(v,{children:["Using the ",t(R,{children:"onItemHovered"})," event makes it easy to create tooltips. This story is intentionally forced to scroll vertically so layout in scrolling documents can be confirmed."]}),children:t(i,{})})})]},D={left:0,top:0,width:0,height:0,bottom:0,right:0},s=()=>{const{cols:i,getCellContent:f}=x(6),[o,a]=r.useState(),n=r.useRef(0),g=r.useCallback(e=>{e.kind==="cell"?(window.clearTimeout(n.current),a(void 0),n.current=window.setTimeout(()=>{a({val:`Tooltip for ${e.location[0]}, ${e.location[1]}`,bounds:{left:e.bounds.x,top:e.bounds.y,width:e.bounds.width,height:e.bounds.height,right:e.bounds.x+e.bounds.width,bottom:e.bounds.y+e.bounds.height}})},1e3)):(window.clearTimeout(n.current),n.current=0,a(void 0))},[]);r.useEffect(()=>()=>window.clearTimeout(n.current),[]);const d=o!==void 0,{renderLayer:h,layerProps:l}=w({isOpen:d,triggerOffset:4,auto:!0,container:"portal",trigger:{getBounds:()=>(o==null?void 0:o.bounds)??D}});return m(b,{children:[t(y,{...C,onItemHovered:g,getCellContent:f,columns:i,rowMarkers:"both",rows:1e3}),d&&h(t("div",{...l,style:{...l.style,padding:"8px 12px",color:"white",font:"500 13px Inter",backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:9},children:o.val}))]})};var u,c,p;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/trailing-row-options.stories-riMxTVcx.js b/docs/assets/trailing-row-options.stories-JJNnNKur.js similarity index 89% rename from docs/assets/trailing-row-options.stories-riMxTVcx.js rename to docs/assets/trailing-row-options.stories-JJNnNKur.js index 7c661fe1e..1025e4555 100644 --- a/docs/assets/trailing-row-options.stories-riMxTVcx.js +++ b/docs/assets/trailing-row-options.stories-JJNnNKur.js @@ -1,4 +1,4 @@ -import{j as n,a as O}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-zTb9g2fv.js";import{B as x,D as I,P as f,u as D,c as b,d as k}from"./utils-qU2KzddR.js";import{a}from"./image-window-loader--5E_ifQX.js";import{S as T}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>n(T,{children:n(x,{title:"Trailing row options",description:O(I,{children:["You can customize the trailing row in each column by setting a"," ",n(f,{children:"trailingRowOptions"})," in your columns."]}),children:n(o,{})})})]},A={2:"Smol text",3:"Add",5:"New"},E={2:a.HeaderArray,3:a.HeaderEmoji,5:a.HeaderNumber},S={2:0,3:0,5:0},V={3:!0},y={2:{baseFontStyle:"10px"}},s=()=>{const{cols:o,getCellContent:i,setCellValueRaw:c,setCellValue:d}=D(60,!1),[r,w]=l.useState(50),R=l.useCallback(()=>{const t=r;for(let e=0;e<6;e++){const g=i([e,t]);c([e,t],b(g))}w(e=>e+1)},[i,r,c]),C=l.useMemo(()=>o.map((t,e)=>({...t,trailingRowOptions:{hint:A[e],addIcon:E[e],targetColumn:S[e],disabled:V[e],themeOverride:y[e]}})),[o]);return n(h,{...k,getCellContent:i,columns:C,rowMarkers:"both",onCellEdited:d,trailingRowOptions:{tint:!0,sticky:!0},rows:r,onRowAppended:R})};var m,u,p;s.parameters={...s.parameters,docs:{...(m=s.parameters)==null?void 0:m.docs,source:{originalSource:`() => { +import{j as n,a as O}from"./marked.esm-dbrxtycE.js";import{R as l}from"./index-BMVQvedj.js";import{D as h}from"./data-editor-all-ZeeWpldS.js";import{B as x,D as I,P as f,u as D,c as b,d as k}from"./utils-MADpeXg5.js";import{a}from"./image-window-loader-ggeJlWLo.js";import{S as T}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>n(T,{children:n(x,{title:"Trailing row options",description:O(I,{children:["You can customize the trailing row in each column by setting a"," ",n(f,{children:"trailingRowOptions"})," in your columns."]}),children:n(o,{})})})]},A={2:"Smol text",3:"Add",5:"New"},E={2:a.HeaderArray,3:a.HeaderEmoji,5:a.HeaderNumber},S={2:0,3:0,5:0},V={3:!0},y={2:{baseFontStyle:"10px"}},s=()=>{const{cols:o,getCellContent:i,setCellValueRaw:c,setCellValue:d}=D(60,!1),[r,w]=l.useState(50),R=l.useCallback(()=>{const t=r;for(let e=0;e<6;e++){const g=i([e,t]);c([e,t],b(g))}w(e=>e+1)},[i,r,c]),C=l.useMemo(()=>o.map((t,e)=>({...t,trailingRowOptions:{hint:A[e],addIcon:E[e],targetColumn:S[e],disabled:V[e],themeOverride:y[e]}})),[o]);return n(h,{...k,getCellContent:i,columns:C,rowMarkers:"both",onCellEdited:d,trailingRowOptions:{tint:!0,sticky:!0},rows:r,onRowAppended:R})};var m,u,p;s.parameters={...s.parameters,docs:{...(m=s.parameters)==null?void 0:m.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/uneven-rows.stories-XkRXih74.js b/docs/assets/uneven-rows.stories-LG_7MDCI.js similarity index 73% rename from docs/assets/uneven-rows.stories-XkRXih74.js rename to docs/assets/uneven-rows.stories-LG_7MDCI.js index 9f43d4158..bd684409e 100644 --- a/docs/assets/uneven-rows.stories-XkRXih74.js +++ b/docs/assets/uneven-rows.stories-LG_7MDCI.js @@ -1,4 +1,4 @@ -import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-zTb9g2fv.js";import{B as l,D as c,P as d,u,d as w}from"./utils-qU2KzddR.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./image-window-loader--5E_ifQX.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const U={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(l,{title:"Uneven Rows",description:p(c,{children:["Rows can be made uneven by passing a callback to the ",e(d,{children:"rowHeight"})," prop"]}),children:e(o,{})})})]},r=()=>{const{cols:o,getCellContent:i}=u(6);return e(m,{...w,rowHeight:t=>t%3===0?30:t%2?50:60,getCellContent:i,columns:o,rows:1e3})};var s,a,n;r.parameters={...r.parameters,docs:{...(s=r.parameters)==null?void 0:s.docs,source:{originalSource:`() => { +import{j as e,a as p}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ZeeWpldS.js";import{B as l,D as c,P as d,u,d as w}from"./utils-MADpeXg5.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./image-window-loader-ggeJlWLo.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const U={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(D,{children:e(l,{title:"Uneven Rows",description:p(c,{children:["Rows can be made uneven by passing a callback to the ",e(d,{children:"rowHeight"})," prop"]}),children:e(o,{})})})]},r=()=>{const{cols:o,getCellContent:i}=u(6);return e(m,{...w,rowHeight:t=>t%3===0?30:t%2?50:60,getCellContent:i,columns:o,rows:1e3})};var s,a,n;r.parameters={...r.parameters,docs:{...(s=r.parameters)==null?void 0:s.docs,source:{originalSource:`() => { const { cols, getCellContent diff --git a/docs/assets/use-data-source.stories-ys8NwUsp.js b/docs/assets/use-data-source.stories-Fo8NpI-_.js similarity index 99% rename from docs/assets/use-data-source.stories-ys8NwUsp.js rename to docs/assets/use-data-source.stories-Fo8NpI-_.js index 33723c85c..f955eb250 100644 --- a/docs/assets/use-data-source.stories-ys8NwUsp.js +++ b/docs/assets/use-data-source.stories-Fo8NpI-_.js @@ -1,4 +1,4 @@ -var ce=Object.defineProperty;var ue=(n,e,t)=>e in n?ce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var z=(n,e,t)=>(ue(n,typeof e!="symbol"?e+"":e,t),t);import{j as w,s as T,a as $}from"./marked.esm-dbrxtycE.js";import{R,g as de,r as l}from"./index-BMVQvedj.js";import{u as pe}from"./index.esm-Ejw8GwRl.js";import{y as x}from"./index-PWBWJyi_.js";import{m as fe,k as me,x as ge,y as Ce,z as ye,A as he,e as oe,a as be,w as G}from"./_baseIteratee-WTHxv43n.js";import{G as g,e as ke,f as N,h as M,D as se}from"./data-editor-all-kM-cjKZ5.js";import{e as Se,r as I}from"./throttle-7EuXLZa7.js";import"./index-wocATsGp.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";function ve(n){const[e,t]=R.useState([]),[o,s]=R.useState(void 0),{columns:r,onGroupHeaderClicked:a,onGridSelectionChange:f,getGroupDetails:d,gridSelection:i,freezeColumns:p=0,theme:b}=n,k=i??o,c=R.useMemo(()=>{const u=[];let C=[-1,-1],S;for(let F=p;Fc.length===0?r:r.map((u,C)=>{for(const[S,F]of c)if(C>=S&&C{var F;a==null||a(u,C);const S=((F=y[u])==null?void 0:F.group)??"";S!==""&&(C.preventDefault(),t(A=>A.includes(S)?A.filter(D=>D!==S):[...A,S]))},[y,a]),v=R.useCallback(u=>{if(u.current!==void 0){const C=u.current.cell[0],S=y[C];t(F=>F.includes((S==null?void 0:S.group)??"")?F.filter(A=>A!==S.group):F)}f!==void 0?f(u):s(u)},[y,f]),h=R.useCallback(u=>({...d==null?void 0:d(u),name:u,overrideTheme:e.includes(u??"")?{bgHeader:b.bgHeaderHasFocus}:void 0}),[e,d,b.bgHeaderHasFocus]);return{columns:y,onGroupHeaderClicked:m,onGridSelectionChange:v,getGroupDetails:h,gridSelection:k}}var we=Se,Fe=fe;function xe(n,e){var t=-1,o=Fe(n)?Array(n.length):[];return we(n,function(s,r,a){o[++t]=e(s,r,a)}),o}var Ae=xe;function Re(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}var Me=Re,L=me;function He(n,e){if(n!==e){var t=n!==void 0,o=n===null,s=n===n,r=L(n),a=e!==void 0,f=e===null,d=e===e,i=L(e);if(!f&&!i&&!r&&n>e||r&&a&&d&&!f&&!i||o&&a&&d||!t&&d||!s)return 1;if(!o&&!r&&!i&&n=f)return d;var i=t[o];return d*(i=="desc"?-1:1)}}return n.index-e.index}var Be=Ee,_=ge,Ge=ye,Te=be,Ie=Ae,_e=Me,$e=he,Oe=Be,ze=Ce,Ne=oe;function Le(n,e,t){e.length?e=_(e,function(r){return Ne(r)?function(a){return Ge(a,r.length===1?r[0]:r)}:r}):e=[ze];var o=-1;e=_(e,$e(Te));var s=Ie(n,function(r,a,f){var d=_(e,function(i){return i(r)});return{criteria:d,index:++o,value:r}});return _e(s,function(r,a){return Oe(r,a,t)})}var Ke=Le,Pe=Ke,K=oe;function Ve(n,e,t,o){return n==null?[]:(K(e)||(e=e==null?[]:[e]),t=o?void 0:t,K(t)||(t=t==null?[]:[t]),Pe(n,e,t))}var We=Ve;const P=de(We);function B(n){return n.id??`${n.group??""}/${n.title}`}function V(n,e){return typeof e=="string"?B(n)===e:B(n)===B(e)}function W(n,e,t){const o=e.indexOf(n);if(o===-1)return Number.MAX_SAFE_INTEGER;const s=t.findIndex(r=>V(n,r));if(s!==-1)return s;for(let r=o;r>=0;r--){const a=t.findIndex(f=>V(e[r],f));if(a!==-1)return a+.5}return-1}function je(n){const{columns:e,getCellContent:t,onColumnMoved:o}=n,[s,r]=l.useState(()=>e.map(B)),a=l.useMemo(()=>P(e,p=>W(p,e,s)),[s,e]),f=l.useRef(o);f.current=o;const d=l.useCallback((p,b)=>{var k;r(c=>{const y=[...c],[m]=y.splice(p,1);return y.splice(b,0,m),y}),(k=f.current)==null||k.call(f,p,b)},[]);l.useEffect(()=>{r(p=>P(e,b=>W(b,e,p)).map(B))},[e]);const i=l.useCallback(p=>{const[b,k]=p,c=a[b],y=e.indexOf(c);return t([y,k])},[a,e,t]);return{columns:a,onColumnMoved:d,getCellContent:i}}function Ze(n){var e,t;switch(n.kind){case g.Number:return((e=n.data)==null?void 0:e.toString())??"";case g.Boolean:return((t=n.data)==null?void 0:t.toString())??"";case g.Markdown:case g.RowID:case g.Text:case g.Uri:return n.data??"";case g.Bubble:case g.Image:return n.data.join("");case g.Drilldown:return n.data.map(o=>o.text).join("");case g.Protected:case g.Loading:return"";case g.Custom:return n.copyData}}function j(n){if(typeof n=="number")return n;if(n.length>0){const e=Number(n);isNaN(e)||(n=e)}return n}function Ye(n,e){return n=j(n),e=j(e),typeof n=="string"&&typeof e=="string"?n.localeCompare(e):typeof n=="number"&&typeof e=="number"?n===e?0:n>e?1:-1:n==e?0:n>e?1:-1}function Xe(n,e){return n>e?1:n===e?0:-1}function qe(n){const{sort:e,rows:t,getCellContent:o}=n;let s=e===void 0?void 0:n.columns.findIndex(i=>e.column===i||i.id!==void 0&&e.column.id===i.id);s===-1&&(s=void 0);const r=(e==null?void 0:e.direction)??"asc",a=l.useMemo(()=>{if(s===void 0)return;const i=new Array(t),p=[s,0];for(let k=0;kXe(i[k],i[c])):(e==null?void 0:e.mode)==="smart"?b=I(t).sort((k,c)=>Ye(i[k],i[c])):b=I(t).sort((k,c)=>i[k].localeCompare(i[c])),r==="desc"&&b.reverse(),b},[o,t,e==null?void 0:e.mode,r,s]),f=l.useCallback(i=>a===void 0?i:a[i],[a]),d=l.useCallback(([i,p])=>a===void 0?o([i,p]):(p=a[p],o([i,p])),[o,a]);return a===void 0?{getCellContent:n.getCellContent,getOriginalIndex:f}:{getOriginalIndex:f,getCellContent:d}}const Je={undoHistory:[],redoHistory:[],canUndo:!1,canRedo:!1,isApplyingUndo:!1,isApplyingRedo:!1};function Qe(n,e){const t={...n};switch(e.type){case"undo":if(n.canUndo){t.undoHistory=[...n.undoHistory];const o=t.undoHistory.pop();return t.operation=o,t.canUndo=t.undoHistory.length>0,t.isApplyingUndo=!0,t}return n;case"redo":if(n.canRedo){t.redoHistory=[...n.redoHistory];const o=t.redoHistory.pop();return t.operation=o,t.canRedo=t.redoHistory.length>0,t.isApplyingRedo=!0,t}return n;case"operationApplied":return t.operation=void 0,t.isApplyingRedo=!1,t.isApplyingUndo=!1,t;case"edit":return!n.isApplyingRedo&&!n.isApplyingUndo&&(t.undoHistory=[...n.undoHistory,e.batch],t.redoHistory=[],t.canUndo=!0,t.canRedo=!1),n.isApplyingUndo&&(t.redoHistory=[...n.redoHistory,e.batch],t.canRedo=!0),n.isApplyingRedo&&(t.undoHistory=[...n.undoHistory,e.batch],t.canUndo=!0),t;default:throw new Error("Invalid action")}}function en(n,e,t,o){const[s,r]=l.useReducer(Qe,Je),a=l.useRef(null),f=l.useRef(null),d=l.useRef(!1),i=l.useRef(!1);l.useEffect(()=>{d.current=s.isApplyingUndo,i.current=s.isApplyingRedo},[s.isApplyingUndo,s.isApplyingRedo]);const[p,b]=l.useState(null),k=l.useRef(null),c=l.useCallback(h=>{o&&o(h),b(h),k.current=h},[o]),y=l.useCallback((h,u)=>{if(!(d.current||i.current)&&k.current){clearTimeout(f.current);const S=e(h);a.current===null&&(a.current={edits:[],selection:k.current}),a.current.edits.push({cell:h,newValue:S}),f.current=setTimeout(()=>{a.current&&(r({type:"edit",batch:a.current}),a.current=null)},0)}t(h,u)},[t,e]),m=l.useCallback(()=>{r({type:"undo"})},[r]),v=l.useCallback(()=>{r({type:"redo"})},[r]);return l.useEffect(()=>{if(s.operation&&k.current&&n.current){const h=[],u={edits:[],selection:k.current};for(const C of s.operation.edits){const S=e(C.cell);u.edits.push({cell:C.cell,newValue:S}),t(C.cell,C.newValue),h.push({cell:C.cell})}b(s.operation.selection),k.current=s.operation.selection,n.current.updateCells(h),r({type:"edit",batch:u}),r({type:"operationApplied"})}},[s.operation,n,t,b,e]),l.useEffect(()=>{const h=u=>{u.key==="z"&&(u.metaKey||u.ctrlKey)&&(u.shiftKey?v():m()),u.key==="y"&&(u.metaKey||u.ctrlKey)&&v()};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[m,v]),l.useMemo(()=>({undo:m,redo:v,canUndo:s.canUndo,canRedo:s.canRedo,onCellEdited:y,onGridSelectionChange:c,gridSelection:p}),[m,v,y,s.canUndo,s.canRedo,c,p])}x.seed(1337);function nn(n){return!!n}function tn(n,e){var o;const t=n.data;if(typeof t==typeof e.data)return{...e,data:t};switch(e.kind){case g.Uri:return G(t)?{...e,data:t[0]}:{...e,data:(t==null?void 0:t.toString())??""};case g.Boolean:return G(t)?{...e,data:t[0]!==void 0}:n.kind===g.Boolean?{...e,data:n.data}:{...e,data:!!nn(t)};case g.Image:return G(t)?{...e,data:[t[0]]}:{...e,data:[(t==null?void 0:t.toString())??""]};case g.Number:return{...e,data:0};case g.Text:case g.Markdown:return G(t)?{...e,data:t[0].toString()??""}:{...e,data:((o=n.data)==null?void 0:o.toString())??""};case g.Custom:return e}cn()}function rn(n){const{getContent:e,...t}=n;return t}function Z(n,e){const t=[{title:"First name",id:"First name",group:e?"Name":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.firstName();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Last name",id:"Last name",group:e?"Name":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.lastName();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Avatar",id:"Avatar",group:e?"Info":void 0,icon:M.HeaderImage,hasMenu:!1,getContent:()=>{const r=Math.round(Math.random()*100);return{kind:g.Image,data:[`https://picsum.photos/id/${r}/900/900`],displayData:[`https://picsum.photos/id/${r}/40/40`],allowOverlay:!0,readonly:!0}}},{title:"Email",id:"Email",group:e?"Info":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.internet.email();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Title",id:"Title",group:e?"Info":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.jobTitle();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"More Info",id:"More Info",group:e?"Info":void 0,icon:M.HeaderUri,hasMenu:!1,getContent:()=>{const r=x.internet.url();return{kind:g.Uri,displayData:r,data:r,allowOverlay:!0,readonly:!0}}}];if(non(a+t.length,e));return[...t,...s]}function on(n,e){return{title:`Column ${n}`,id:`Column ${n}`,group:e?`Group ${Math.round(n/3)}`:void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const t=x.lorem.word();return{kind:g.Text,data:t,displayData:t,allowOverlay:!0,readonly:!0}}}}class sn{constructor(){z(this,"cachedContent",new Map)}get(e,t){const o=this.cachedContent.get(e);if(o!==void 0)return o[t]}set(e,t,o){let s=this.cachedContent.get(e);s===void 0&&this.cachedContent.set(e,s=[]),s[t]=o}}function an(n,e=!0,t=!1){const o=l.useRef(new sn),[s,r]=l.useState(()=>Z(n,t));l.useEffect(()=>{r(Z(n,t))},[t,n]);const a=l.useCallback((c,y)=>{r(m=>{const v=m.findIndex(u=>u.title===c.title),h=[...m];return h.splice(v,1,{...m[v],width:y}),h})},[]),f=l.useMemo(()=>s.map(rn),[s]),d=l.useRef(s);d.current=s;const i=l.useCallback(([c,y])=>{let m=o.current.get(c,y);return m===void 0&&(m=d.current[c].getContent(),!e&&ke(m)&&(m={...m,readonly:e}),o.current.set(c,y,m)),m},[e]),p=l.useCallback(c=>{const y=[];for(let m=c.y;m{o.current.set(c,y,m)},[]),k=l.useCallback(([c,y],m)=>{let v=o.current.get(c,y);if(v===void 0&&(v=s[c].getContent()),N(m)&&N(v)){const h=tn(m,v);o.current.set(c,y,{...h,displayData:typeof h.data=="string"?h.data:h.displayData,lastUpdated:performance.now()})}},[s]);return{cols:f,getCellContent:i,onColumnResize:a,setCellValue:k,getCellsForSelection:p,setCellValueRaw:b}}function ln(n="This should not happen"){throw new Error(n)}function cn(n){return ln("Hell froze over")}x.seed(1337);const un=T("div")({name:"SimpleWrapper",class:"ss4kmn3",propsAsIs:!1}),dn=n=>w(un,{children:w("div",{className:"content",children:n.children})}),Rn={title:"Extra Packages/Source",decorators:[n=>w(dn,{children:w(n,{})})]},pn=T("div")({name:"BeautifulStyle",class:"bkh67gx",propsAsIs:!1}),ae=n=>{const{title:e,children:t,description:o}=n,{ref:s,width:r,height:a}=pe();return $(pn,{children:[w("h1",{children:e}),o,w("div",{className:"sizer",children:w("div",{className:"sizer-clip",ref:s,children:w("div",{style:{position:"relative",width:r??100,height:a??100},children:t})})})]})},ie=T("p")({name:"Description",class:"d1deot3s",propsAsIs:!1}),H=T("p")({name:"MoreInfo",class:"m1ml0sw1",propsAsIs:!1}),le={smoothScrollX:!0,smoothScrollY:!0,isDraggable:!1,rowMarkers:"none",width:"100%"},fn={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",headerIconSize:20,markerFontStyle:"13px",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",horizontalBorderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#4F5DFF",cellHorizontalPadding:8,cellVerticalPadding:3,headerFontStyle:"600 13px",baseFontStyle:"13px",editorFontSize:"13px",lineHeight:1.4,fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif"},mn=[{title:"A",width:200,group:"Group 1"},{title:"B",width:200,group:"Group 1"},{title:"C",width:200,group:"Group 2"},{title:"D",width:200,group:"Group 2"},{title:"E",width:200,group:"Group 2"}],U=()=>{const n=l.useRef({}),e=1e5,t=je({columns:mn,getCellContent:l.useCallback(([d,i])=>{if(d===0)return{kind:g.Text,allowOverlay:!0,data:`${i}`,displayData:`${i}`};const p=`${d},${i}`;n.current[p]===void 0&&(n.current[p]=x.name.firstName()+" "+x.name.lastName());const b=n.current[p];return{kind:g.Text,allowOverlay:!0,data:b,displayData:b}},[])}),[o,s]=l.useState(),r=qe({columns:t.columns,getCellContent:t.getCellContent,rows:e,sort:o===void 0?void 0:{column:t.columns[o],direction:"desc",mode:"smart"}}),a=ve({columns:t.columns,theme:fn,freezeColumns:0}),f=l.useCallback(d=>{s(d)},[]);return w(ae,{title:"Custom source extensions",description:w(ie,{children:"Fixme."}),children:w(se,{...le,...t,...r,...a,rows:e,onColumnMoved:t.onColumnMoved,onHeaderClicked:f})})};U.parameters={options:{showPanel:!1}};const E=()=>{const{cols:n,getCellContent:e,setCellValue:t}=an(6),o=l.useRef(null),{gridSelection:s,onCellEdited:r,onGridSelectionChange:a,undo:f,canRedo:d,canUndo:i,redo:p}=en(o,e,t);return w(ae,{title:"Undo / Redo Support",description:$(ie,{children:["A simple undo/redo implementation",$(H,{children:["Use keyboard shortcuts CMD+Z and CMD+SHIFT+Z / CTRL+Z and CTRL+Y. Or click these buttons:",w("button",{onClick:f,disabled:!i,style:{opacity:i?1:.4},children:"Undo"}),w("button",{onClick:p,disabled:!d,style:{opacity:d?1:.4},children:"Redo"})]}),w(H,{children:"It works by taking a snapshot of the content of a cell before it is edited and replaying any edits back."})]}),children:w(se,{...le,ref:o,onCellEdited:r,getCellContent:e,gridSelection:s??void 0,onGridSelectionChange:a,columns:n,rows:1e3})})};E.parameters={options:{showPanel:!1}};var Y,X,q;H.parameters={...H.parameters,docs:{...(Y=H.parameters)==null?void 0:Y.docs,source:{originalSource:`styled.p\` +var ce=Object.defineProperty;var ue=(n,e,t)=>e in n?ce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var z=(n,e,t)=>(ue(n,typeof e!="symbol"?e+"":e,t),t);import{j as w,s as T,a as $}from"./marked.esm-dbrxtycE.js";import{R,g as de,r as l}from"./index-BMVQvedj.js";import{u as pe}from"./index.esm-Ejw8GwRl.js";import{y as x}from"./index-PWBWJyi_.js";import{m as fe,k as me,x as ge,y as Ce,z as ye,A as he,e as oe,a as be,w as G}from"./_baseIteratee-WTHxv43n.js";import{G as g,e as ke,f as N,h as M,D as se}from"./data-editor-all-fnGrkeU4.js";import{e as Se,r as I}from"./throttle-7EuXLZa7.js";import"./index-wocATsGp.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";function ve(n){const[e,t]=R.useState([]),[o,s]=R.useState(void 0),{columns:r,onGroupHeaderClicked:a,onGridSelectionChange:f,getGroupDetails:d,gridSelection:i,freezeColumns:p=0,theme:b}=n,k=i??o,c=R.useMemo(()=>{const u=[];let C=[-1,-1],S;for(let F=p;Fc.length===0?r:r.map((u,C)=>{for(const[S,F]of c)if(C>=S&&C{var F;a==null||a(u,C);const S=((F=y[u])==null?void 0:F.group)??"";S!==""&&(C.preventDefault(),t(A=>A.includes(S)?A.filter(D=>D!==S):[...A,S]))},[y,a]),v=R.useCallback(u=>{if(u.current!==void 0){const C=u.current.cell[0],S=y[C];t(F=>F.includes((S==null?void 0:S.group)??"")?F.filter(A=>A!==S.group):F)}f!==void 0?f(u):s(u)},[y,f]),h=R.useCallback(u=>({...d==null?void 0:d(u),name:u,overrideTheme:e.includes(u??"")?{bgHeader:b.bgHeaderHasFocus}:void 0}),[e,d,b.bgHeaderHasFocus]);return{columns:y,onGroupHeaderClicked:m,onGridSelectionChange:v,getGroupDetails:h,gridSelection:k}}var we=Se,Fe=fe;function xe(n,e){var t=-1,o=Fe(n)?Array(n.length):[];return we(n,function(s,r,a){o[++t]=e(s,r,a)}),o}var Ae=xe;function Re(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}var Me=Re,L=me;function He(n,e){if(n!==e){var t=n!==void 0,o=n===null,s=n===n,r=L(n),a=e!==void 0,f=e===null,d=e===e,i=L(e);if(!f&&!i&&!r&&n>e||r&&a&&d&&!f&&!i||o&&a&&d||!t&&d||!s)return 1;if(!o&&!r&&!i&&n=f)return d;var i=t[o];return d*(i=="desc"?-1:1)}}return n.index-e.index}var Be=Ee,_=ge,Ge=ye,Te=be,Ie=Ae,_e=Me,$e=he,Oe=Be,ze=Ce,Ne=oe;function Le(n,e,t){e.length?e=_(e,function(r){return Ne(r)?function(a){return Ge(a,r.length===1?r[0]:r)}:r}):e=[ze];var o=-1;e=_(e,$e(Te));var s=Ie(n,function(r,a,f){var d=_(e,function(i){return i(r)});return{criteria:d,index:++o,value:r}});return _e(s,function(r,a){return Oe(r,a,t)})}var Ke=Le,Pe=Ke,K=oe;function Ve(n,e,t,o){return n==null?[]:(K(e)||(e=e==null?[]:[e]),t=o?void 0:t,K(t)||(t=t==null?[]:[t]),Pe(n,e,t))}var We=Ve;const P=de(We);function B(n){return n.id??`${n.group??""}/${n.title}`}function V(n,e){return typeof e=="string"?B(n)===e:B(n)===B(e)}function W(n,e,t){const o=e.indexOf(n);if(o===-1)return Number.MAX_SAFE_INTEGER;const s=t.findIndex(r=>V(n,r));if(s!==-1)return s;for(let r=o;r>=0;r--){const a=t.findIndex(f=>V(e[r],f));if(a!==-1)return a+.5}return-1}function je(n){const{columns:e,getCellContent:t,onColumnMoved:o}=n,[s,r]=l.useState(()=>e.map(B)),a=l.useMemo(()=>P(e,p=>W(p,e,s)),[s,e]),f=l.useRef(o);f.current=o;const d=l.useCallback((p,b)=>{var k;r(c=>{const y=[...c],[m]=y.splice(p,1);return y.splice(b,0,m),y}),(k=f.current)==null||k.call(f,p,b)},[]);l.useEffect(()=>{r(p=>P(e,b=>W(b,e,p)).map(B))},[e]);const i=l.useCallback(p=>{const[b,k]=p,c=a[b],y=e.indexOf(c);return t([y,k])},[a,e,t]);return{columns:a,onColumnMoved:d,getCellContent:i}}function Ze(n){var e,t;switch(n.kind){case g.Number:return((e=n.data)==null?void 0:e.toString())??"";case g.Boolean:return((t=n.data)==null?void 0:t.toString())??"";case g.Markdown:case g.RowID:case g.Text:case g.Uri:return n.data??"";case g.Bubble:case g.Image:return n.data.join("");case g.Drilldown:return n.data.map(o=>o.text).join("");case g.Protected:case g.Loading:return"";case g.Custom:return n.copyData}}function j(n){if(typeof n=="number")return n;if(n.length>0){const e=Number(n);isNaN(e)||(n=e)}return n}function Ye(n,e){return n=j(n),e=j(e),typeof n=="string"&&typeof e=="string"?n.localeCompare(e):typeof n=="number"&&typeof e=="number"?n===e?0:n>e?1:-1:n==e?0:n>e?1:-1}function Xe(n,e){return n>e?1:n===e?0:-1}function qe(n){const{sort:e,rows:t,getCellContent:o}=n;let s=e===void 0?void 0:n.columns.findIndex(i=>e.column===i||i.id!==void 0&&e.column.id===i.id);s===-1&&(s=void 0);const r=(e==null?void 0:e.direction)??"asc",a=l.useMemo(()=>{if(s===void 0)return;const i=new Array(t),p=[s,0];for(let k=0;kXe(i[k],i[c])):(e==null?void 0:e.mode)==="smart"?b=I(t).sort((k,c)=>Ye(i[k],i[c])):b=I(t).sort((k,c)=>i[k].localeCompare(i[c])),r==="desc"&&b.reverse(),b},[o,t,e==null?void 0:e.mode,r,s]),f=l.useCallback(i=>a===void 0?i:a[i],[a]),d=l.useCallback(([i,p])=>a===void 0?o([i,p]):(p=a[p],o([i,p])),[o,a]);return a===void 0?{getCellContent:n.getCellContent,getOriginalIndex:f}:{getOriginalIndex:f,getCellContent:d}}const Je={undoHistory:[],redoHistory:[],canUndo:!1,canRedo:!1,isApplyingUndo:!1,isApplyingRedo:!1};function Qe(n,e){const t={...n};switch(e.type){case"undo":if(n.canUndo){t.undoHistory=[...n.undoHistory];const o=t.undoHistory.pop();return t.operation=o,t.canUndo=t.undoHistory.length>0,t.isApplyingUndo=!0,t}return n;case"redo":if(n.canRedo){t.redoHistory=[...n.redoHistory];const o=t.redoHistory.pop();return t.operation=o,t.canRedo=t.redoHistory.length>0,t.isApplyingRedo=!0,t}return n;case"operationApplied":return t.operation=void 0,t.isApplyingRedo=!1,t.isApplyingUndo=!1,t;case"edit":return!n.isApplyingRedo&&!n.isApplyingUndo&&(t.undoHistory=[...n.undoHistory,e.batch],t.redoHistory=[],t.canUndo=!0,t.canRedo=!1),n.isApplyingUndo&&(t.redoHistory=[...n.redoHistory,e.batch],t.canRedo=!0),n.isApplyingRedo&&(t.undoHistory=[...n.undoHistory,e.batch],t.canUndo=!0),t;default:throw new Error("Invalid action")}}function en(n,e,t,o){const[s,r]=l.useReducer(Qe,Je),a=l.useRef(null),f=l.useRef(null),d=l.useRef(!1),i=l.useRef(!1);l.useEffect(()=>{d.current=s.isApplyingUndo,i.current=s.isApplyingRedo},[s.isApplyingUndo,s.isApplyingRedo]);const[p,b]=l.useState(null),k=l.useRef(null),c=l.useCallback(h=>{o&&o(h),b(h),k.current=h},[o]),y=l.useCallback((h,u)=>{if(!(d.current||i.current)&&k.current){clearTimeout(f.current);const S=e(h);a.current===null&&(a.current={edits:[],selection:k.current}),a.current.edits.push({cell:h,newValue:S}),f.current=setTimeout(()=>{a.current&&(r({type:"edit",batch:a.current}),a.current=null)},0)}t(h,u)},[t,e]),m=l.useCallback(()=>{r({type:"undo"})},[r]),v=l.useCallback(()=>{r({type:"redo"})},[r]);return l.useEffect(()=>{if(s.operation&&k.current&&n.current){const h=[],u={edits:[],selection:k.current};for(const C of s.operation.edits){const S=e(C.cell);u.edits.push({cell:C.cell,newValue:S}),t(C.cell,C.newValue),h.push({cell:C.cell})}b(s.operation.selection),k.current=s.operation.selection,n.current.updateCells(h),r({type:"edit",batch:u}),r({type:"operationApplied"})}},[s.operation,n,t,b,e]),l.useEffect(()=>{const h=u=>{u.key==="z"&&(u.metaKey||u.ctrlKey)&&(u.shiftKey?v():m()),u.key==="y"&&(u.metaKey||u.ctrlKey)&&v()};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[m,v]),l.useMemo(()=>({undo:m,redo:v,canUndo:s.canUndo,canRedo:s.canRedo,onCellEdited:y,onGridSelectionChange:c,gridSelection:p}),[m,v,y,s.canUndo,s.canRedo,c,p])}x.seed(1337);function nn(n){return!!n}function tn(n,e){var o;const t=n.data;if(typeof t==typeof e.data)return{...e,data:t};switch(e.kind){case g.Uri:return G(t)?{...e,data:t[0]}:{...e,data:(t==null?void 0:t.toString())??""};case g.Boolean:return G(t)?{...e,data:t[0]!==void 0}:n.kind===g.Boolean?{...e,data:n.data}:{...e,data:!!nn(t)};case g.Image:return G(t)?{...e,data:[t[0]]}:{...e,data:[(t==null?void 0:t.toString())??""]};case g.Number:return{...e,data:0};case g.Text:case g.Markdown:return G(t)?{...e,data:t[0].toString()??""}:{...e,data:((o=n.data)==null?void 0:o.toString())??""};case g.Custom:return e}cn()}function rn(n){const{getContent:e,...t}=n;return t}function Z(n,e){const t=[{title:"First name",id:"First name",group:e?"Name":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.firstName();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Last name",id:"Last name",group:e?"Name":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.lastName();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Avatar",id:"Avatar",group:e?"Info":void 0,icon:M.HeaderImage,hasMenu:!1,getContent:()=>{const r=Math.round(Math.random()*100);return{kind:g.Image,data:[`https://picsum.photos/id/${r}/900/900`],displayData:[`https://picsum.photos/id/${r}/40/40`],allowOverlay:!0,readonly:!0}}},{title:"Email",id:"Email",group:e?"Info":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.internet.email();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Title",id:"Title",group:e?"Info":void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const r=x.name.jobTitle();return{kind:g.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"More Info",id:"More Info",group:e?"Info":void 0,icon:M.HeaderUri,hasMenu:!1,getContent:()=>{const r=x.internet.url();return{kind:g.Uri,displayData:r,data:r,allowOverlay:!0,readonly:!0}}}];if(non(a+t.length,e));return[...t,...s]}function on(n,e){return{title:`Column ${n}`,id:`Column ${n}`,group:e?`Group ${Math.round(n/3)}`:void 0,icon:M.HeaderString,hasMenu:!1,getContent:()=>{const t=x.lorem.word();return{kind:g.Text,data:t,displayData:t,allowOverlay:!0,readonly:!0}}}}class sn{constructor(){z(this,"cachedContent",new Map)}get(e,t){const o=this.cachedContent.get(e);if(o!==void 0)return o[t]}set(e,t,o){let s=this.cachedContent.get(e);s===void 0&&this.cachedContent.set(e,s=[]),s[t]=o}}function an(n,e=!0,t=!1){const o=l.useRef(new sn),[s,r]=l.useState(()=>Z(n,t));l.useEffect(()=>{r(Z(n,t))},[t,n]);const a=l.useCallback((c,y)=>{r(m=>{const v=m.findIndex(u=>u.title===c.title),h=[...m];return h.splice(v,1,{...m[v],width:y}),h})},[]),f=l.useMemo(()=>s.map(rn),[s]),d=l.useRef(s);d.current=s;const i=l.useCallback(([c,y])=>{let m=o.current.get(c,y);return m===void 0&&(m=d.current[c].getContent(),!e&&ke(m)&&(m={...m,readonly:e}),o.current.set(c,y,m)),m},[e]),p=l.useCallback(c=>{const y=[];for(let m=c.y;m{o.current.set(c,y,m)},[]),k=l.useCallback(([c,y],m)=>{let v=o.current.get(c,y);if(v===void 0&&(v=s[c].getContent()),N(m)&&N(v)){const h=tn(m,v);o.current.set(c,y,{...h,displayData:typeof h.data=="string"?h.data:h.displayData,lastUpdated:performance.now()})}},[s]);return{cols:f,getCellContent:i,onColumnResize:a,setCellValue:k,getCellsForSelection:p,setCellValueRaw:b}}function ln(n="This should not happen"){throw new Error(n)}function cn(n){return ln("Hell froze over")}x.seed(1337);const un=T("div")({name:"SimpleWrapper",class:"ss4kmn3",propsAsIs:!1}),dn=n=>w(un,{children:w("div",{className:"content",children:n.children})}),Rn={title:"Extra Packages/Source",decorators:[n=>w(dn,{children:w(n,{})})]},pn=T("div")({name:"BeautifulStyle",class:"bkh67gx",propsAsIs:!1}),ae=n=>{const{title:e,children:t,description:o}=n,{ref:s,width:r,height:a}=pe();return $(pn,{children:[w("h1",{children:e}),o,w("div",{className:"sizer",children:w("div",{className:"sizer-clip",ref:s,children:w("div",{style:{position:"relative",width:r??100,height:a??100},children:t})})})]})},ie=T("p")({name:"Description",class:"d1deot3s",propsAsIs:!1}),H=T("p")({name:"MoreInfo",class:"m1ml0sw1",propsAsIs:!1}),le={smoothScrollX:!0,smoothScrollY:!0,isDraggable:!1,rowMarkers:"none",width:"100%"},fn={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",headerIconSize:20,markerFontStyle:"13px",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",horizontalBorderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#4F5DFF",cellHorizontalPadding:8,cellVerticalPadding:3,headerFontStyle:"600 13px",baseFontStyle:"13px",editorFontSize:"13px",lineHeight:1.4,fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif"},mn=[{title:"A",width:200,group:"Group 1"},{title:"B",width:200,group:"Group 1"},{title:"C",width:200,group:"Group 2"},{title:"D",width:200,group:"Group 2"},{title:"E",width:200,group:"Group 2"}],U=()=>{const n=l.useRef({}),e=1e5,t=je({columns:mn,getCellContent:l.useCallback(([d,i])=>{if(d===0)return{kind:g.Text,allowOverlay:!0,data:`${i}`,displayData:`${i}`};const p=`${d},${i}`;n.current[p]===void 0&&(n.current[p]=x.name.firstName()+" "+x.name.lastName());const b=n.current[p];return{kind:g.Text,allowOverlay:!0,data:b,displayData:b}},[])}),[o,s]=l.useState(),r=qe({columns:t.columns,getCellContent:t.getCellContent,rows:e,sort:o===void 0?void 0:{column:t.columns[o],direction:"desc",mode:"smart"}}),a=ve({columns:t.columns,theme:fn,freezeColumns:0}),f=l.useCallback(d=>{s(d)},[]);return w(ae,{title:"Custom source extensions",description:w(ie,{children:"Fixme."}),children:w(se,{...le,...t,...r,...a,rows:e,onColumnMoved:t.onColumnMoved,onHeaderClicked:f})})};U.parameters={options:{showPanel:!1}};const E=()=>{const{cols:n,getCellContent:e,setCellValue:t}=an(6),o=l.useRef(null),{gridSelection:s,onCellEdited:r,onGridSelectionChange:a,undo:f,canRedo:d,canUndo:i,redo:p}=en(o,e,t);return w(ae,{title:"Undo / Redo Support",description:$(ie,{children:["A simple undo/redo implementation",$(H,{children:["Use keyboard shortcuts CMD+Z and CMD+SHIFT+Z / CTRL+Z and CTRL+Y. Or click these buttons:",w("button",{onClick:f,disabled:!i,style:{opacity:i?1:.4},children:"Undo"}),w("button",{onClick:p,disabled:!d,style:{opacity:d?1:.4},children:"Redo"})]}),w(H,{children:"It works by taking a snapshot of the content of a cell before it is edited and replaying any edits back."})]}),children:w(se,{...le,ref:o,onCellEdited:r,getCellContent:e,gridSelection:s??void 0,onGridSelectionChange:a,columns:n,rows:1e3})})};E.parameters={options:{showPanel:!1}};var Y,X,q;H.parameters={...H.parameters,docs:{...(Y=H.parameters)==null?void 0:Y.docs,source:{originalSource:`styled.p\` font-size: 14px; flex-shrink: 0; margin: 0 0 20px 0; diff --git a/docs/assets/utils-qU2KzddR.js b/docs/assets/utils-MADpeXg5.js similarity index 99% rename from docs/assets/utils-qU2KzddR.js rename to docs/assets/utils-MADpeXg5.js index 12967aa5b..db0be1441 100644 --- a/docs/assets/utils-qU2KzddR.js +++ b/docs/assets/utils-MADpeXg5.js @@ -1,4 +1,4 @@ -var H=Object.defineProperty;var T=(e,t,a)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var x=(e,t,a)=>(T(e,typeof t!="symbol"?t+"":t,a),a);import{s as k,a as B,j as M}from"./marked.esm-dbrxtycE.js";import{r as c}from"./index-BMVQvedj.js";import{S as $,U as R,E as I,G as n,D as U,a as l}from"./image-window-loader--5E_ifQX.js";import{y as s}from"./index-PWBWJyi_.js";import{w as b}from"./_baseIteratee-WTHxv43n.js";import{u as G}from"./index.esm-Ejw8GwRl.js";import{n as E}from"./flatten-qRvRBp6y.js";s.seed(1337);function z(e){return!!e}function O(e,t){var i;const a=e.data;if(typeof a==typeof t.data)return{...t,data:a};switch(t.kind){case n.Uri:return b(a)?{...t,data:a[0]}:{...t,data:(a==null?void 0:a.toString())??""};case n.Boolean:return b(a)?{...t,data:a[0]!==void 0}:e.kind===n.Boolean?{...t,data:e.data}:{...t,data:!!z(a)};case n.Image:return b(a)?{...t,data:[a[0]]}:{...t,data:[(a==null?void 0:a.toString())??""]};case n.Number:return{...t,data:0};case n.Text:case n.Markdown:return b(a)?{...t,data:a[0].toString()??""}:{...t,data:((i=e.data)==null?void 0:i.toString())??""};case n.Custom:return t}U()}function S(e){const{getContent:t,...a}=e;return a}const J=k("div")({name:"ColumnAddButton",class:"c4uqbye",propsAsIs:!1}),j=k("div")({name:"BeautifulStyle",class:"b1bsqg7n",propsAsIs:!1}),Q=k("span")({name:"PropName",class:"piiq54i",propsAsIs:!1}),Z=k("p")({name:"Description",class:"d1k3yj19",propsAsIs:!1}),ee=k("p")({name:"MoreInfo",class:"m1j0dy02",propsAsIs:!1}),te=e=>{const{title:t,children:a,description:i,className:d,scale:r}=e,{ref:C,width:v,height:g}=G();return B(j,{className:d+($.value?" firefox":""),children:[M("h1",{children:t}),i,M("div",{style:{scale:r},className:"sizer",children:M("div",{className:"sizer-clip",ref:C,children:M("div",{style:{position:"relative",width:v??100,height:g??100},children:a})})})]})};function P(e,t){return{title:`Column ${e}`,id:`Column ${e}`,group:t?`Group ${Math.round(e/3)}`:void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const a=s.lorem.word();return{kind:n.Text,data:a,displayData:a,allowOverlay:!0,readonly:!0}}}}function N(e,t){const a=[{title:"First name",id:"First name",group:t?"Name":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.firstName();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Last name",id:"Last name",group:t?"Name":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.lastName();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Avatar",id:"Avatar",group:t?"Info":void 0,icon:l.HeaderImage,hasMenu:!1,getContent:()=>{const r=Math.round(Math.random()*100);return{kind:n.Image,data:[`https://picsum.photos/id/${r}/900/900`],displayData:[`https://picsum.photos/id/${r}/40/40`],allowOverlay:!0,readonly:!0}}},{title:"Email",id:"Email",group:t?"Info":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.internet.email();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Title",id:"Title",group:t?"Info":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.jobTitle();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"More Info",id:"More Info",group:t?"Info":void 0,icon:l.HeaderUri,hasMenu:!1,getContent:()=>{const r=s.internet.url();return{kind:n.Uri,displayData:r,data:r,hoverEffect:!0,allowOverlay:!0,readonly:!0,onClickUri:C=>{window.open(r,"_blank"),C.preventDefault()}}}}];if(eP(C+a.length,t));return[...a,...d]}class A{constructor(){x(this,"cachedContent",new Map)}get(t,a){const i=this.cachedContent.get(t);if(i!==void 0)return i[a]}set(t,a,i){let d=this.cachedContent.get(t);d===void 0&&this.cachedContent.set(t,d=[]),d[a]=i}}function ae(e,t=!0,a=!1){const i=c.useRef(new A),[d,r]=c.useState(()=>N(e,a));c.useEffect(()=>{r(N(e,a))},[a,e]);const C=c.useCallback((u,m)=>{r(o=>{const h=o.findIndex(D=>D.title===u.title),y=[...o];return y.splice(h,1,{...o[h],width:m}),y})},[]),v=c.useMemo(()=>d.map(S),[d]),g=c.useRef(d);g.current=d;const p=c.useCallback(([u,m])=>{let o=i.current.get(u,m);return o===void 0&&(o=g.current[u].getContent(),!t&&R(o)&&(o={...o,readonly:t}),i.current.set(u,m,o)),o},[t]),w=c.useCallback(([u,m],o)=>{i.current.set(u,m,o)},[]),f=c.useCallback(([u,m],o)=>{let h=i.current.get(u,m);if(h===void 0&&(h=d[u].getContent()),I(o)&&I(h)){const y=O(o,h);i.current.set(u,m,{...y,displayData:typeof y.data=="string"?y.data:y.displayData,lastUpdated:performance.now()})}},[d]);return{cols:v,getCellContent:p,onColumnResize:C,setCellValue:f,setCellValueRaw:w}}const ne=k("kbd")({name:"KeyName",class:"kcvwzr4",propsAsIs:!1}),re={smoothScrollX:!0,smoothScrollY:!0,getCellsForSelection:!0,width:"100%"};function se(e){switch(e.kind){case n.Boolean:return{...e,data:!1};case n.Image:return{...e,data:[],displayData:[]};case n.Drilldown:case n.Bubble:return{...e,data:[]};case n.Uri:case n.Markdown:return{...e,data:""};case n.Text:return{...e,data:"",displayData:""};case n.Number:return{...e,data:0,displayData:""}}return e}function V(){return[{title:"Row ID",width:120,icon:l.HeaderRowID,hasMenu:!1,getContent:()=>({kind:n.RowID,data:s.datatype.uuid(),allowOverlay:!0})},{title:"Protected",width:120,icon:l.HeaderCode,hasMenu:!1,getContent:()=>({kind:n.Protected,data:s.finance.bitcoinAddress(),allowOverlay:!1})},{title:"Loading",width:120,icon:l.HeaderString,hasMenu:!1,getContent:()=>({kind:n.Loading,allowOverlay:!1,skeletonWidth:70,skeletonWidthVariability:25})},{title:"Text",width:120,icon:l.HeaderCode,hasMenu:!1,getContent:()=>{const e=s.name.firstName();return{kind:n.Text,data:e,displayData:e,allowOverlay:!0}}},{title:"Number",width:120,icon:l.HeaderNumber,hasMenu:!1,getContent:()=>{const e=s.datatype.number(100);return{kind:n.Number,data:e,displayData:`${e}`,allowOverlay:!0}}},{title:"Boolean",width:120,icon:l.HeaderBoolean,hasMenu:!1,getContent:()=>{const e=Math.random(),t=e<.1?void 0:e<.2?null:e<.6;return{kind:n.Boolean,data:t,allowOverlay:!1,readonly:!1}}},{title:"Image",width:120,icon:l.HeaderImage,hasMenu:!1,getContent:()=>({kind:n.Image,data:[`${s.image.animals(40,40)}?random=${s.datatype.number(1e5)}`],allowOverlay:!0,readonly:!0})},{title:"Uri",width:120,icon:l.HeaderUri,hasMenu:!1,getContent:()=>{const e=s.internet.url();return{kind:n.Uri,data:e,allowOverlay:!0}}},{title:"Markdown",width:120,icon:l.HeaderMarkdown,hasMenu:!1,getContent:()=>{const e=`# Title +var H=Object.defineProperty;var T=(e,t,a)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var x=(e,t,a)=>(T(e,typeof t!="symbol"?t+"":t,a),a);import{s as k,a as B,j as M}from"./marked.esm-dbrxtycE.js";import{r as c}from"./index-BMVQvedj.js";import{S as $,U as R,E as I,G as n,D as U,a as l}from"./image-window-loader-ggeJlWLo.js";import{y as s}from"./index-PWBWJyi_.js";import{w as b}from"./_baseIteratee-WTHxv43n.js";import{u as G}from"./index.esm-Ejw8GwRl.js";import{n as E}from"./flatten-qRvRBp6y.js";s.seed(1337);function z(e){return!!e}function O(e,t){var i;const a=e.data;if(typeof a==typeof t.data)return{...t,data:a};switch(t.kind){case n.Uri:return b(a)?{...t,data:a[0]}:{...t,data:(a==null?void 0:a.toString())??""};case n.Boolean:return b(a)?{...t,data:a[0]!==void 0}:e.kind===n.Boolean?{...t,data:e.data}:{...t,data:!!z(a)};case n.Image:return b(a)?{...t,data:[a[0]]}:{...t,data:[(a==null?void 0:a.toString())??""]};case n.Number:return{...t,data:0};case n.Text:case n.Markdown:return b(a)?{...t,data:a[0].toString()??""}:{...t,data:((i=e.data)==null?void 0:i.toString())??""};case n.Custom:return t}U()}function S(e){const{getContent:t,...a}=e;return a}const J=k("div")({name:"ColumnAddButton",class:"c4uqbye",propsAsIs:!1}),j=k("div")({name:"BeautifulStyle",class:"b1bsqg7n",propsAsIs:!1}),Q=k("span")({name:"PropName",class:"piiq54i",propsAsIs:!1}),Z=k("p")({name:"Description",class:"d1k3yj19",propsAsIs:!1}),ee=k("p")({name:"MoreInfo",class:"m1j0dy02",propsAsIs:!1}),te=e=>{const{title:t,children:a,description:i,className:d,scale:r}=e,{ref:C,width:v,height:g}=G();return B(j,{className:d+($.value?" firefox":""),children:[M("h1",{children:t}),i,M("div",{style:{scale:r},className:"sizer",children:M("div",{className:"sizer-clip",ref:C,children:M("div",{style:{position:"relative",width:v??100,height:g??100},children:a})})})]})};function P(e,t){return{title:`Column ${e}`,id:`Column ${e}`,group:t?`Group ${Math.round(e/3)}`:void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const a=s.lorem.word();return{kind:n.Text,data:a,displayData:a,allowOverlay:!0,readonly:!0}}}}function N(e,t){const a=[{title:"First name",id:"First name",group:t?"Name":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.firstName();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Last name",id:"Last name",group:t?"Name":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.lastName();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Avatar",id:"Avatar",group:t?"Info":void 0,icon:l.HeaderImage,hasMenu:!1,getContent:()=>{const r=Math.round(Math.random()*100);return{kind:n.Image,data:[`https://picsum.photos/id/${r}/900/900`],displayData:[`https://picsum.photos/id/${r}/40/40`],allowOverlay:!0,readonly:!0}}},{title:"Email",id:"Email",group:t?"Info":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.internet.email();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"Title",id:"Title",group:t?"Info":void 0,icon:l.HeaderString,hasMenu:!1,getContent:()=>{const r=s.name.jobTitle();return{kind:n.Text,displayData:r,data:r,allowOverlay:!0,readonly:!0}}},{title:"More Info",id:"More Info",group:t?"Info":void 0,icon:l.HeaderUri,hasMenu:!1,getContent:()=>{const r=s.internet.url();return{kind:n.Uri,displayData:r,data:r,hoverEffect:!0,allowOverlay:!0,readonly:!0,onClickUri:C=>{window.open(r,"_blank"),C.preventDefault()}}}}];if(eP(C+a.length,t));return[...a,...d]}class A{constructor(){x(this,"cachedContent",new Map)}get(t,a){const i=this.cachedContent.get(t);if(i!==void 0)return i[a]}set(t,a,i){let d=this.cachedContent.get(t);d===void 0&&this.cachedContent.set(t,d=[]),d[a]=i}}function ae(e,t=!0,a=!1){const i=c.useRef(new A),[d,r]=c.useState(()=>N(e,a));c.useEffect(()=>{r(N(e,a))},[a,e]);const C=c.useCallback((u,m)=>{r(o=>{const h=o.findIndex(D=>D.title===u.title),y=[...o];return y.splice(h,1,{...o[h],width:m}),y})},[]),v=c.useMemo(()=>d.map(S),[d]),g=c.useRef(d);g.current=d;const p=c.useCallback(([u,m])=>{let o=i.current.get(u,m);return o===void 0&&(o=g.current[u].getContent(),!t&&R(o)&&(o={...o,readonly:t}),i.current.set(u,m,o)),o},[t]),w=c.useCallback(([u,m],o)=>{i.current.set(u,m,o)},[]),f=c.useCallback(([u,m],o)=>{let h=i.current.get(u,m);if(h===void 0&&(h=d[u].getContent()),I(o)&&I(h)){const y=O(o,h);i.current.set(u,m,{...y,displayData:typeof y.data=="string"?y.data:y.displayData,lastUpdated:performance.now()})}},[d]);return{cols:v,getCellContent:p,onColumnResize:C,setCellValue:f,setCellValueRaw:w}}const ne=k("kbd")({name:"KeyName",class:"kcvwzr4",propsAsIs:!1}),re={smoothScrollX:!0,smoothScrollY:!0,getCellsForSelection:!0,width:"100%"};function se(e){switch(e.kind){case n.Boolean:return{...e,data:!1};case n.Image:return{...e,data:[],displayData:[]};case n.Drilldown:case n.Bubble:return{...e,data:[]};case n.Uri:case n.Markdown:return{...e,data:""};case n.Text:return{...e,data:"",displayData:""};case n.Number:return{...e,data:0,displayData:""}}return e}function V(){return[{title:"Row ID",width:120,icon:l.HeaderRowID,hasMenu:!1,getContent:()=>({kind:n.RowID,data:s.datatype.uuid(),allowOverlay:!0})},{title:"Protected",width:120,icon:l.HeaderCode,hasMenu:!1,getContent:()=>({kind:n.Protected,data:s.finance.bitcoinAddress(),allowOverlay:!1})},{title:"Loading",width:120,icon:l.HeaderString,hasMenu:!1,getContent:()=>({kind:n.Loading,allowOverlay:!1,skeletonWidth:70,skeletonWidthVariability:25})},{title:"Text",width:120,icon:l.HeaderCode,hasMenu:!1,getContent:()=>{const e=s.name.firstName();return{kind:n.Text,data:e,displayData:e,allowOverlay:!0}}},{title:"Number",width:120,icon:l.HeaderNumber,hasMenu:!1,getContent:()=>{const e=s.datatype.number(100);return{kind:n.Number,data:e,displayData:`${e}`,allowOverlay:!0}}},{title:"Boolean",width:120,icon:l.HeaderBoolean,hasMenu:!1,getContent:()=>{const e=Math.random(),t=e<.1?void 0:e<.2?null:e<.6;return{kind:n.Boolean,data:t,allowOverlay:!1,readonly:!1}}},{title:"Image",width:120,icon:l.HeaderImage,hasMenu:!1,getContent:()=>({kind:n.Image,data:[`${s.image.animals(40,40)}?random=${s.datatype.number(1e5)}`],allowOverlay:!0,readonly:!0})},{title:"Uri",width:120,icon:l.HeaderUri,hasMenu:!1,getContent:()=>{const e=s.internet.url();return{kind:n.Uri,data:e,allowOverlay:!0}}},{title:"Markdown",width:120,icon:l.HeaderMarkdown,hasMenu:!1,getContent:()=>{const e=`# Title Hello my name is *${s.name.firstName()}* ## TODO: diff --git a/docs/assets/validate-data.stories-E60M8lNF.js b/docs/assets/validate-data.stories-AR2BMamQ.js similarity index 81% rename from docs/assets/validate-data.stories-E60M8lNF.js rename to docs/assets/validate-data.stories-AR2BMamQ.js index 984888bf4..4036f38c2 100644 --- a/docs/assets/validate-data.stories-E60M8lNF.js +++ b/docs/assets/validate-data.stories-AR2BMamQ.js @@ -1,4 +1,4 @@ -import{j as e,a as l,F as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-zTb9g2fv.js";import{B as m,D as p,P as f,M as C,u as D,d as V}from"./utils-qU2KzddR.js";import{G as h}from"./image-window-loader--5E_ifQX.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const L={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(w,{children:e(m,{title:"Validate data",description:l(c,{children:[l(p,{children:["Data can be validated using the ",e(f,{children:"validateCell"})," callback"]}),e(C,{children:'This example only allows the word "Valid" inside text cells.'})]}),children:e(r,{})})})]},a=()=>{const{cols:r,getCellContent:s,setCellValue:d}=D(60,!1);return e(u,{...V,getCellContent:s,columns:r,rowMarkers:"both",onPaste:!0,onCellEdited:d,rows:100,validateCell:(g,t)=>t.kind!==h.Text||t.data==="Valid"?!0:t.data.toLowerCase()==="valid"?{...t,data:"Valid",selectionRange:[0,3]}:!1})};var o,n,i;a.parameters={...a.parameters,docs:{...(o=a.parameters)==null?void 0:o.docs,source:{originalSource:`() => { +import{j as e,a as l,F as c}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as u}from"./data-editor-all-ZeeWpldS.js";import{B as m,D as p,P as f,M as C,u as D,d as V}from"./utils-MADpeXg5.js";import{G as h}from"./image-window-loader-ggeJlWLo.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const L={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>e(w,{children:e(m,{title:"Validate data",description:l(c,{children:[l(p,{children:["Data can be validated using the ",e(f,{children:"validateCell"})," callback"]}),e(C,{children:'This example only allows the word "Valid" inside text cells.'})]}),children:e(r,{})})})]},a=()=>{const{cols:r,getCellContent:s,setCellValue:d}=D(60,!1);return e(u,{...V,getCellContent:s,columns:r,rowMarkers:"both",onPaste:!0,onCellEdited:d,rows:100,validateCell:(g,t)=>t.kind!==h.Text||t.data==="Valid"?!0:t.data.toLowerCase()==="valid"?{...t,data:"Valid",selectionRange:[0,3]}:!1})};var o,n,i;a.parameters={...a.parameters,docs:{...(o=a.parameters)==null?void 0:o.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/wrapping-text.stories-5GtqZrPS.js b/docs/assets/wrapping-text.stories-A-X6NF7r.js similarity index 88% rename from docs/assets/wrapping-text.stories-5GtqZrPS.js rename to docs/assets/wrapping-text.stories-A-X6NF7r.js index 827707c1c..fee22e346 100644 --- a/docs/assets/wrapping-text.stories-5GtqZrPS.js +++ b/docs/assets/wrapping-text.stories-A-X6NF7r.js @@ -1,4 +1,4 @@ -import{j as n,a as f}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-zTb9g2fv.js";import{B as h,D as x,P as w,u as y,d as W}from"./utils-qU2KzddR.js";import{G as D}from"./image-window-loader--5E_ifQX.js";import{S as G}from"./story-utils-K2EZnGjM.js";import{r as T}from"./throttle-7EuXLZa7.js";import{y as R}from"./index-PWBWJyi_.js";import"./iframe-0-Di66Z3.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-rB9VuUnF.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>n(G,{children:n(h,{title:"Wrapping Text",description:f(x,{children:["Text cells can have wrapping text by setting the ",n(w,{children:"allowWrapping"})," prop to true."]}),children:n(e,{})})})]},t=e=>{const{cols:c,getCellContent:a,onColumnResize:g}=y(6),r=i.useMemo(()=>T(0,100).map(()=>R.lorem.sentence(e.length)),[e.length]),u=i.useCallback(l=>{const[d,o]=l;return d===0?{kind:D.Text,allowOverlay:!0,displayData:`${o}, +import{j as n,a as f}from"./marked.esm-dbrxtycE.js";import{R as i}from"./index-BMVQvedj.js";import{D as C}from"./data-editor-all-ZeeWpldS.js";import{B as h,D as x,P as w,u as y,d as W}from"./utils-MADpeXg5.js";import{G as D}from"./image-window-loader-ggeJlWLo.js";import{S as G}from"./story-utils-K2EZnGjM.js";import{r as T}from"./throttle-7EuXLZa7.js";import{y as R}from"./index-PWBWJyi_.js";import"./iframe-alOpk4ZG.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-wnX0bxop.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const K={title:"Glide-Data-Grid/DataEditor Demos",decorators:[e=>n(G,{children:n(h,{title:"Wrapping Text",description:f(x,{children:["Text cells can have wrapping text by setting the ",n(w,{children:"allowWrapping"})," prop to true."]}),children:n(e,{})})})]},t=e=>{const{cols:c,getCellContent:a,onColumnResize:g}=y(6),r=i.useMemo(()=>T(0,100).map(()=>R.lorem.sentence(e.length)),[e.length]),u=i.useCallback(l=>{const[d,o]=l;return d===0?{kind:D.Text,allowOverlay:!0,displayData:`${o}, ${r[o%r.length]}`,data:`${o}, ${r}`,allowWrapping:!0,contentAlign:e.alignment}:a(l)},[a,e.alignment,r]);return n(C,{...W,rowHeight:80,getCellContent:u,columns:c,rows:1e3,onColumnResize:g,experimental:{hyperWrapping:e.hyperWrapping}})};t.args={alignment:"left",length:20,hyperWrapping:!1};t.argTypes={alignment:{control:{type:"select"},options:["left","center","right"]},length:{control:{type:"range",min:2,max:200}}};var s,p,m;t.parameters={...t.parameters,docs:{...(s=t.parameters)==null?void 0:s.docs,source:{originalSource:`p => { const { diff --git a/docs/iframe.html b/docs/iframe.html index 7fb582436..bbca1f750 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -382,7 +382,7 @@ } - + diff --git a/docs/project.json b/docs/project.json index 26a404ff2..f4c657e73 100644 --- a/docs/project.json +++ b/docs/project.json @@ -1 +1 @@ -{"generatedAt":1709842659302,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"monorepo":"Workspaces","packageManager":{"type":"npm","version":"10.2.3"},"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.12","storybookVersionSpecifier":"^7.6.12","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"7.6.12"},"@storybook/addon-controls":{"version":"7.6.12"},"@storybook/addon-links":{"version":"7.6.12"},"@storybook/addon-storysource":{"version":"7.6.12"},"@storybook/addons":{"version":"7.6.12"},"@storybook/react":{"version":"7.6.12"},"@storybook/react-vite":{"version":"7.6.12"},"@storybook/react-webpack5":{"version":"7.6.12"},"storybook":{"version":"7.6.12"}},"addons":{"$SNIP/node_modules/@storybook/addon-storysource":{"version":null},"$SNIP/node_modules/@storybook/addon-controls":{"version":null}}} +{"generatedAt":1710354806672,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"monorepo":"Workspaces","packageManager":{"type":"npm","version":"10.2.3"},"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.12","storybookVersionSpecifier":"^7.6.12","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"7.6.12"},"@storybook/addon-controls":{"version":"7.6.12"},"@storybook/addon-links":{"version":"7.6.12"},"@storybook/addon-storysource":{"version":"7.6.12"},"@storybook/addons":{"version":"7.6.12"},"@storybook/react":{"version":"7.6.12"},"@storybook/react-vite":{"version":"7.6.12"},"@storybook/react-webpack5":{"version":"7.6.12"},"storybook":{"version":"7.6.12"}},"addons":{"$SNIP/node_modules/@storybook/addon-storysource":{"version":null},"$SNIP/node_modules/@storybook/addon-controls":{"version":null}}}