From 6a452ed515e696e0ecaac349ca48ddaff050767b Mon Sep 17 00:00:00 2001 From: jassmith Date: Sat, 3 Feb 2024 01:46:49 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20cb71d?= =?UTF-8?q?b27d0f6184b0c6dc9bfc174f65253506647=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.nojekyll | 0 ...Ag4SHQ4N.js => 00-faq.stories-CKUMiTc-.js} | 2 +- ...=> 01-getting-started.stories-n3kS0Li9.js} | 2 +- ...js => 02-editing-data.stories-zA_ZEgqL.js} | 2 +- ....js => 03-grid-column.stories-Cjz8ZlZW.js} | 2 +- ... => 04-streaming-data.stories-lzFPAAhl.js} | 2 +- ...8KDYQ.js => 06-search.stories-5m-2j_0I.js} | 2 +- ...=> 07-column-grouping.stories-OZi1IFDi.js} | 2 +- ...1A-i.js => 08-theming.stories-9_LsU-jk.js} | 2 +- ...bCCOhb.js => 09-menus.stories-7SWafrI_.js} | 2 +- ...uYXs.js => add-column.stories-zdyCIgd0.js} | 2 +- ...=> add-data-to-middle.stories-u1pPUmjW.js} | 2 +- ...js => add-data-to-top.stories-j70HTiom.js} | 2 +- ...EG5iIa.js => add-data.stories-dkRmLm5K.js} | 2 +- ....js => all-cell-kinds.stories-fKxfnZWA.js} | 2 +- ... => append-row-handle.stories-kssBUpmm.js} | 2 +- ...automatic-row-markers.stories-jx_758La.js} | 2 +- ...js => built-in-search.stories-RdRs9hWj.js} | 2 +- ... cell-activated-event.stories-kZ0Yhfoj.js} | 2 +- ...s-GoH1iMdu.js => cell.stories-Vtu6m6MQ.js} | 2 +- ...column-group-collapse.stories-xdLhv7k4.js} | 2 +- ...R.js => column-groups.stories-bndOvtUp.js} | 2 +- ... => content-alignment.stories-a9SFZLiG.js} | 2 +- ... => controlled-search.stories-k2kx3JIg.js} | 2 +- ... controlled-selection.stories-sCVCvvyD.js} | 2 +- ...y5.js => copy-support.stories-LzebiMzB.js} | 2 +- ...> custom-header-icons.stories-sneBwz65.js} | 2 +- ...g.js => custom-header.stories-DXCIQAWC.js} | 2 +- docs/assets/data-editor-all-85iGweFr.js | 135 ++++++++++++++++++ docs/assets/data-editor-all-ATY7qU3b.js | 124 ---------------- docs/assets/data-editor-all-Orvb2jqb.js | 124 ++++++++++++++++ docs/assets/data-editor-all-ligl_Vjz.js | 135 ------------------ ...=> data-editor-repros.stories-IduWsXDK.js} | 2 +- ...wGP.js => data-editor.stories-qEwXLFDq.js} | 2 +- ...s => data-grid-overlay-editor-XTO4-8W8.js} | 2 +- ...s => data-grid-overlay-editor-Z83AvWlM.js} | 2 +- ...CbotC.js => data-grid.stories-7ldlZ5Fw.js} | 10 +- ...moG.js => drag-source.stories-FO027sy9.js} | 2 +- ...NN4.js => drop-events.stories-OLQy2H3_.js} | 2 +- ...BxJ.js => fill-handle.stories-R8Mb-UAF.js} | 2 +- .../assets/freeze-columns.stories-6fXtjWtB.js | 9 -- .../assets/freeze-columns.stories-B7dXYLEM.js | 9 ++ ...tsm.js => freeze-rows.stories-YpVq2nt-.js} | 2 +- ...y_.js => header-menus.stories-IZNw2k3y.js} | 2 +- ...js => highlight-cells.stories-d6Ld1nM7.js} | 2 +- ...{iframe-ni8xiI1Q.js => iframe-t8ayfGqb.js} | 4 +- docs/assets/image-window-loader-h6lJQmfV.js | 18 +++ docs/assets/image-window-loader-hgJATaim.js | 18 --- ... => imperative-scroll.stories-RcWZSjf2.js} | 2 +- ....js => input-blending.stories-VM6JAg9H.js} | 2 +- ...nnF.js => keybindings.stories-oPqd4IqH.js} | 2 +- ...=> layout-integration.stories-SOrBfORV.js} | 2 +- ... multi-select-columns.stories-WLnxbntf.js} | 2 +- ... => new-column-button.stories-ZGQpxfuS.js} | 2 +- ...Q.js => obscured-grid.stories-P6IlOXMw.js} | 2 +- ...bserve-visible-region.stories-Z_0v27cG.js} | 2 +- ...dred-thousand-columns.stories-bRcFhkz9.js} | 2 +- ...s => one-million-rows.stories-nru7-UGq.js} | 2 +- ...Np1O.js => overscroll.stories-A_Lx3RKM.js} | 2 +- ...WMs_gRb.js => padding.stories-ehBQ4sav.js} | 2 +- ...i.js => paste-support.stories-sdcUdsuJ.js} | 2 +- ...event-diagonal-scroll.stories-0Ai_tt-9.js} | 2 +- ...D.js => rapid-updates.stories-q80YNc9k.js} | 2 +- ... => rearrange-columns.stories-bv75-Qfg.js} | 2 +- ...Cy.js => reorder-rows.stories-nxlJdvfv.js} | 2 +- ... => resizable-columns.stories-FVujiygH.js} | 2 +- ..._.js => right-element.stories-kBZv1_Df.js} | 2 +- ...i.js => right-to-left.stories-qUoBnm3m.js} | 2 +- ... row-and-header-sizes.stories-mfzrzOgV.js} | 2 +- ...ySNqU.js => row-hover.stories-sPMoBQT6.js} | 2 +- ...inX.js => row-markers.stories-ljeoW-nD.js} | 2 +- ...giF.js => scaled-view.stories-530Lb6MO.js} | 2 +- ....js => scroll-shadows.stories-Lwuq98B7.js} | 2 +- ...PbC.js => scrolling-data-grid-6lFEHS8-.js} | 2 +- ...> scrolling-data-grid.stories-6ZtRyRmb.js} | 4 +- ...s => search-as-filter.stories-JRWC8o2i.js} | 2 +- ...s => server-side-data.stories-JnB-tDZS.js} | 2 +- ...r.js => silly-numbers.stories-BedUiNwX.js} | 2 +- ...> small-editable-grid.stories-hBZTigSy.js} | 2 +- ...smooth-scrolling-grid.stories-GTJV63Gq.js} | 2 +- ...KBE_I.js => span-cell.stories-tw6A_N3Y.js} | 2 +- ...> stretch-column-size.stories-SdVFbo4t.js} | 2 +- ... => ten-million-cells.stories-oIkgW9SM.js} | 2 +- ...s => theme-per-column.stories-BlFcD3Pv.js} | 2 +- ...j.js => theme-per-row.stories-b7zGO_y8.js} | 2 +- ...P.js => theme-support.stories-kFZtcTg3.js} | 2 +- ...UlaFji.js => tooltips.stories-9P9czPXw.js} | 2 +- ... trailing-row-options.stories-cy84CW2d.js} | 2 +- ...wce.js => uneven-rows.stories-y9dbdZUZ.js} | 2 +- ...js => use-data-source.stories-bY2Du4Dr.js} | 2 +- .../{utils-wFAOo4Dx.js => utils-H5nRE5Sr.js} | 2 +- ...v.js => validate-data.stories-pN9rQiyK.js} | 2 +- ...L.js => wrapping-text.stories-JUaoMIWD.js} | 2 +- docs/iframe.html | 2 +- docs/project.json | 2 +- 95 files changed, 378 insertions(+), 378 deletions(-) create mode 100644 docs/.nojekyll rename docs/assets/{00-faq.stories-Ag4SHQ4N.js => 00-faq.stories-CKUMiTc-.js} (93%) rename docs/assets/{01-getting-started.stories-sZPVGmNg.js => 01-getting-started.stories-n3kS0Li9.js} (98%) rename docs/assets/{02-editing-data.stories-_YRJ7oxT.js => 02-editing-data.stories-zA_ZEgqL.js} (98%) rename docs/assets/{03-grid-column.stories-BadlQizl.js => 03-grid-column.stories-Cjz8ZlZW.js} (96%) rename docs/assets/{04-streaming-data.stories-Btx91Jtk.js => 04-streaming-data.stories-lzFPAAhl.js} (98%) rename docs/assets/{06-search.stories-sbm8KDYQ.js => 06-search.stories-5m-2j_0I.js} (97%) rename docs/assets/{07-column-grouping.stories-uX8Serp5.js => 07-column-grouping.stories-OZi1IFDi.js} (96%) rename docs/assets/{08-theming.stories-UB7A1A-i.js => 08-theming.stories-9_LsU-jk.js} (98%) rename docs/assets/{09-menus.stories-T2bCCOhb.js => 09-menus.stories-7SWafrI_.js} (98%) rename docs/assets/{add-column.stories-aYOYuYXs.js => add-column.stories-zdyCIgd0.js} (80%) rename docs/assets/{add-data-to-middle.stories-MJZiF0H5.js => add-data-to-middle.stories-u1pPUmjW.js} (86%) rename docs/assets/{add-data-to-top.stories-n1-kzW3w.js => add-data-to-top.stories-j70HTiom.js} (87%) rename docs/assets/{add-data.stories-T-EG5iIa.js => add-data.stories-dkRmLm5K.js} (88%) rename docs/assets/{all-cell-kinds.stories-5zTW479G.js => all-cell-kinds.stories-fKxfnZWA.js} (82%) rename docs/assets/{append-row-handle.stories-F2P_Hxxx.js => append-row-handle.stories-kssBUpmm.js} (88%) rename docs/assets/{automatic-row-markers.stories-zCbLcasW.js => automatic-row-markers.stories-jx_758La.js} (86%) rename docs/assets/{built-in-search.stories-VN36jONF.js => built-in-search.stories-RdRs9hWj.js} (88%) rename docs/assets/{cell-activated-event.stories-rXX4glfM.js => cell-activated-event.stories-kZ0Yhfoj.js} (89%) rename docs/assets/{cell.stories-GoH1iMdu.js => cell.stories-Vtu6m6MQ.js} (99%) rename docs/assets/{column-group-collapse.stories-syi2U-B0.js => column-group-collapse.stories-xdLhv7k4.js} (85%) rename docs/assets/{column-groups.stories-s0PuuzYR.js => column-groups.stories-bndOvtUp.js} (78%) rename docs/assets/{content-alignment.stories-ZjvtzRN2.js => content-alignment.stories-a9SFZLiG.js} (85%) rename docs/assets/{controlled-search.stories-GuhX1Jrr.js => controlled-search.stories-k2kx3JIg.js} (89%) rename docs/assets/{controlled-selection.stories-6gciZswV.js => controlled-selection.stories-sCVCvvyD.js} (93%) rename docs/assets/{copy-support.stories-sP_45gy5.js => copy-support.stories-LzebiMzB.js} (82%) rename docs/assets/{custom-header-icons.stories-vbWU8h8P.js => custom-header-icons.stories-sneBwz65.js} (95%) rename docs/assets/{custom-header.stories-RObg15Lg.js => custom-header.stories-DXCIQAWC.js} (88%) create mode 100644 docs/assets/data-editor-all-85iGweFr.js delete mode 100644 docs/assets/data-editor-all-ATY7qU3b.js create mode 100644 docs/assets/data-editor-all-Orvb2jqb.js delete mode 100644 docs/assets/data-editor-all-ligl_Vjz.js rename docs/assets/{data-editor-repros.stories-7gn6IQHd.js => data-editor-repros.stories-IduWsXDK.js} (90%) rename docs/assets/{data-editor.stories-2CxcBwGP.js => data-editor.stories-qEwXLFDq.js} (99%) rename docs/assets/{data-grid-overlay-editor-hmiBYkvZ.js => data-grid-overlay-editor-XTO4-8W8.js} (93%) rename docs/assets/{data-grid-overlay-editor-6WKZfUKe.js => data-grid-overlay-editor-Z83AvWlM.js} (96%) rename docs/assets/{data-grid.stories-eVyCbotC.js => data-grid.stories-7ldlZ5Fw.js} (61%) rename docs/assets/{drag-source.stories-y9Kk4moG.js => drag-source.stories-FO027sy9.js} (84%) rename docs/assets/{drop-events.stories-1V8ATNN4.js => drop-events.stories-OLQy2H3_.js} (93%) rename docs/assets/{fill-handle.stories-kTdp_BxJ.js => fill-handle.stories-R8Mb-UAF.js} (88%) delete mode 100644 docs/assets/freeze-columns.stories-6fXtjWtB.js create mode 100644 docs/assets/freeze-columns.stories-B7dXYLEM.js rename docs/assets/{freeze-rows.stories-k8ddUtsm.js => freeze-rows.stories-YpVq2nt-.js} (88%) rename docs/assets/{header-menus.stories-wJpRKly_.js => header-menus.stories-IZNw2k3y.js} (93%) rename docs/assets/{highlight-cells.stories-EM1DcUH0.js => highlight-cells.stories-d6Ld1nM7.js} (87%) rename docs/assets/{iframe-ni8xiI1Q.js => iframe-t8ayfGqb.js} (59%) create mode 100644 docs/assets/image-window-loader-h6lJQmfV.js delete mode 100644 docs/assets/image-window-loader-hgJATaim.js rename docs/assets/{imperative-scroll.stories-4UxtfACG.js => imperative-scroll.stories-RcWZSjf2.js} (88%) rename docs/assets/{input-blending.stories-gLOd2BMK.js => input-blending.stories-VM6JAg9H.js} (89%) rename docs/assets/{keybindings.stories-SyQJcnnF.js => keybindings.stories-oPqd4IqH.js} (92%) rename docs/assets/{layout-integration.stories-Xjwr_MCa.js => layout-integration.stories-SOrBfORV.js} (82%) rename docs/assets/{multi-select-columns.stories-rHIKy8Yw.js => multi-select-columns.stories-WLnxbntf.js} (80%) rename docs/assets/{new-column-button.stories-4Wrkki96.js => new-column-button.stories-ZGQpxfuS.js} (83%) rename docs/assets/{obscured-grid.stories-1HAYybuQ.js => obscured-grid.stories-P6IlOXMw.js} (85%) rename docs/assets/{observe-visible-region.stories-wDflXFhy.js => observe-visible-region.stories-Z_0v27cG.js} (84%) rename docs/assets/{one-hundred-thousand-columns.stories-ASfLg6lj.js => one-hundred-thousand-columns.stories-bRcFhkz9.js} (73%) rename docs/assets/{one-million-rows.stories-mYnEUUjW.js => one-million-rows.stories-nru7-UGq.js} (72%) rename docs/assets/{overscroll.stories-BiJONp1O.js => overscroll.stories-A_Lx3RKM.js} (78%) rename docs/assets/{padding.stories-ZWMs_gRb.js => padding.stories-ehBQ4sav.js} (78%) rename docs/assets/{paste-support.stories-6x2XV--i.js => paste-support.stories-sdcUdsuJ.js} (80%) rename docs/assets/{prevent-diagonal-scroll.stories--t2MrJGI.js => prevent-diagonal-scroll.stories-0Ai_tt-9.js} (74%) rename docs/assets/{rapid-updates.stories-hYfzbE0D.js => rapid-updates.stories-q80YNc9k.js} (92%) rename docs/assets/{rearrange-columns.stories-SZIK2AoM.js => rearrange-columns.stories-bv75-Qfg.js} (88%) rename docs/assets/{reorder-rows.stories-wH0mtACy.js => reorder-rows.stories-nxlJdvfv.js} (99%) rename docs/assets/{resizable-columns.stories-Sc3HX8f2.js => resizable-columns.stories-FVujiygH.js} (85%) rename docs/assets/{right-element.stories-UmAM6Ze_.js => right-element.stories-kBZv1_Df.js} (90%) rename docs/assets/{right-to-left.stories-B21b_QWi.js => right-to-left.stories-qUoBnm3m.js} (86%) rename docs/assets/{row-and-header-sizes.stories-QFH73U1l.js => row-and-header-sizes.stories-mfzrzOgV.js} (78%) rename docs/assets/{row-hover.stories-g_7ySNqU.js => row-hover.stories-sPMoBQT6.js} (85%) rename docs/assets/{row-markers.stories-lU0WninX.js => row-markers.stories-ljeoW-nD.js} (77%) rename docs/assets/{scaled-view.stories-c07hXgiF.js => scaled-view.stories-530Lb6MO.js} (68%) rename docs/assets/{scroll-shadows.stories-NAs8aeEG.js => scroll-shadows.stories-Lwuq98B7.js} (90%) rename docs/assets/{scrolling-data-grid-ta-GKPbC.js => scrolling-data-grid-6lFEHS8-.js} (99%) rename docs/assets/{scrolling-data-grid.stories-DAbjeSkr.js => scrolling-data-grid.stories-6ZtRyRmb.js} (76%) rename docs/assets/{search-as-filter.stories-KSmou1ov.js => search-as-filter.stories-JRWC8o2i.js} (90%) rename docs/assets/{server-side-data.stories-gWjcAL7N.js => server-side-data.stories-JnB-tDZS.js} (93%) rename docs/assets/{silly-numbers.stories-gW0ovL7r.js => silly-numbers.stories-BedUiNwX.js} (78%) rename docs/assets/{small-editable-grid.stories-0uP-BdOp.js => small-editable-grid.stories-hBZTigSy.js} (78%) rename docs/assets/{smooth-scrolling-grid.stories-5ANjQwqi.js => smooth-scrolling-grid.stories-GTJV63Gq.js} (77%) rename docs/assets/{span-cell.stories-VjvKBE_I.js => span-cell.stories-tw6A_N3Y.js} (89%) rename docs/assets/{stretch-column-size.stories-vls6kYIF.js => stretch-column-size.stories-SdVFbo4t.js} (84%) rename docs/assets/{ten-million-cells.stories-h9i75Mql.js => ten-million-cells.stories-oIkgW9SM.js} (76%) rename docs/assets/{theme-per-column.stories-FcjCnzB-.js => theme-per-column.stories-BlFcD3Pv.js} (90%) rename docs/assets/{theme-per-row.stories-Eu3WtEBj.js => theme-per-row.stories-b7zGO_y8.js} (85%) rename docs/assets/{theme-support.stories-4NM0iysP.js => theme-support.stories-kFZtcTg3.js} (93%) rename docs/assets/{tooltips.stories-xsUlaFji.js => tooltips.stories-9P9czPXw.js} (89%) rename docs/assets/{trailing-row-options.stories-4OthilPr.js => trailing-row-options.stories-cy84CW2d.js} (89%) rename docs/assets/{uneven-rows.stories-zKUKvwce.js => uneven-rows.stories-y9dbdZUZ.js} (73%) rename docs/assets/{use-data-source.stories-hjg5vgA3.js => use-data-source.stories-bY2Du4Dr.js} (99%) rename docs/assets/{utils-wFAOo4Dx.js => utils-H5nRE5Sr.js} (99%) rename docs/assets/{validate-data.stories-ejj5JmRv.js => validate-data.stories-pN9rQiyK.js} (81%) rename docs/assets/{wrapping-text.stories-M9abOMjL.js => wrapping-text.stories-JUaoMIWD.js} (88%) diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/docs/assets/00-faq.stories-Ag4SHQ4N.js b/docs/assets/00-faq.stories-CKUMiTc-.js similarity index 93% rename from docs/assets/00-faq.stories-Ag4SHQ4N.js rename to docs/assets/00-faq.stories-CKUMiTc-.js index 920aee028..ef8b45e75 100644 --- a/docs/assets/00-faq.stories-Ag4SHQ4N.js +++ b/docs/assets/00-faq.stories-CKUMiTc-.js @@ -1,4 +1,4 @@ -import{j as t}from"./marked.esm-dbrxtycE.js";import{S as n}from"./story-utils-K2EZnGjM.js";import{D as i,M as d}from"./doc-wrapper-eGylnU1T.js";import"./index-BMVQvedj.js";import"./toConsumableArray-2oaFSNyq.js";const m={title:"Glide-Data-Grid/Docs",decorators:[s=>t(n,{children:t(s,{})})]},e=()=>t(i,{children:t(d,{children:` +import{j as t}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{S as n}from"./story-utils-K2EZnGjM.js";import{D as i,M as d}from"./doc-wrapper-eGylnU1T.js";import"./toConsumableArray-2oaFSNyq.js";const m={title:"Glide-Data-Grid/Docs",decorators:[s=>t(n,{children:t(s,{})})]},e=()=>t(i,{children:t(d,{children:` # FAQ ### Nothing shows up? It crashes when I edit a cell? diff --git a/docs/assets/01-getting-started.stories-sZPVGmNg.js b/docs/assets/01-getting-started.stories-n3kS0Li9.js similarity index 98% rename from docs/assets/01-getting-started.stories-sZPVGmNg.js rename to docs/assets/01-getting-started.stories-n3kS0Li9.js index f2a3878dc..9e7728cbc 100644 --- a/docs/assets/01-getting-started.stories-sZPVGmNg.js +++ b/docs/assets/01-getting-started.stories-n3kS0Li9.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-hgJATaim.js";import{D as u}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as u}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-_YRJ7oxT.js b/docs/assets/02-editing-data.stories-zA_ZEgqL.js similarity index 98% rename from docs/assets/02-editing-data.stories-_YRJ7oxT.js rename to docs/assets/02-editing-data.stories-zA_ZEgqL.js index 4f44bf261..93eaf1b6a 100644 --- a/docs/assets/02-editing-data.stories-_YRJ7oxT.js +++ b/docs/assets/02-editing-data.stories-zA_ZEgqL.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-hgJATaim.js";import{D as h}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as h}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-BadlQizl.js b/docs/assets/03-grid-column.stories-Cjz8ZlZW.js similarity index 96% rename from docs/assets/03-grid-column.stories-BadlQizl.js rename to docs/assets/03-grid-column.stories-Cjz8ZlZW.js index 8e575202b..ca0172396 100644 --- a/docs/assets/03-grid-column.stories-BadlQizl.js +++ b/docs/assets/03-grid-column.stories-Cjz8ZlZW.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-hgJATaim.js";import{D as r}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as r}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-Btx91Jtk.js b/docs/assets/04-streaming-data.stories-lzFPAAhl.js similarity index 98% rename from docs/assets/04-streaming-data.stories-Btx91Jtk.js rename to docs/assets/04-streaming-data.stories-lzFPAAhl.js index a77eb30ed..b702c7c1d 100644 --- a/docs/assets/04-streaming-data.stories-Btx91Jtk.js +++ b/docs/assets/04-streaming-data.stories-lzFPAAhl.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-hgJATaim.js";import{D as g}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as g}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-sbm8KDYQ.js b/docs/assets/06-search.stories-5m-2j_0I.js similarity index 97% rename from docs/assets/06-search.stories-sbm8KDYQ.js rename to docs/assets/06-search.stories-5m-2j_0I.js index fbe50cf96..31e472541 100644 --- a/docs/assets/06-search.stories-sbm8KDYQ.js +++ b/docs/assets/06-search.stories-5m-2j_0I.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-hgJATaim.js";import{D as i}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as i}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-uX8Serp5.js b/docs/assets/07-column-grouping.stories-OZi1IFDi.js similarity index 96% rename from docs/assets/07-column-grouping.stories-uX8Serp5.js rename to docs/assets/07-column-grouping.stories-OZi1IFDi.js index 3b6f38643..a47df0d1b 100644 --- a/docs/assets/07-column-grouping.stories-uX8Serp5.js +++ b/docs/assets/07-column-grouping.stories-OZi1IFDi.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-hgJATaim.js";import{D as y}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as y}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-UB7A1A-i.js b/docs/assets/08-theming.stories-9_LsU-jk.js similarity index 98% rename from docs/assets/08-theming.stories-UB7A1A-i.js rename to docs/assets/08-theming.stories-9_LsU-jk.js index 3f805520a..85c03da9d 100644 --- a/docs/assets/08-theming.stories-UB7A1A-i.js +++ b/docs/assets/08-theming.stories-9_LsU-jk.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-hgJATaim.js";import{D as h}from"./data-editor-all-ATY7qU3b.js";import{S as k}from"./story-utils-K2EZnGjM.js";import{D,M as g,H as s,W as c}from"./doc-wrapper-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as h}from"./data-editor-all-Orvb2jqb.js";import{S as k}from"./story-utils-K2EZnGjM.js";import{D,M as g,H as s,W as c}from"./doc-wrapper-eGylnU1T.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-T2bCCOhb.js b/docs/assets/09-menus.stories-7SWafrI_.js similarity index 98% rename from docs/assets/09-menus.stories-T2bCCOhb.js rename to docs/assets/09-menus.stories-7SWafrI_.js index 354b77c3a..502f508bc 100644 --- a/docs/assets/09-menus.stories-T2bCCOhb.js +++ b/docs/assets/09-menus.stories-7SWafrI_.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-hgJATaim.js";import{D as h}from"./data-editor-all-ATY7qU3b.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-eGylnU1T.js";import{u as E}from"./react-laag.esm-PpDllAFI.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{D as h}from"./data-editor-all-Orvb2jqb.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-eGylnU1T.js";import{u as E}from"./react-laag.esm-PpDllAFI.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./toConsumableArray-2oaFSNyq.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-aYOYuYXs.js b/docs/assets/add-column.stories-zdyCIgd0.js similarity index 80% rename from docs/assets/add-column.stories-aYOYuYXs.js rename to docs/assets/add-column.stories-zdyCIgd0.js index f3b99892d..6802f59e2 100644 --- a/docs/assets/add-column.stories-aYOYuYXs.js +++ b/docs/assets/add-column.stories-zdyCIgd0.js @@ -1,4 +1,4 @@ -import{j as r,a as l,F as i}from"./marked.esm-dbrxtycE.js";import{D as c}from"./data-editor-all-ATY7qU3b.js";import{B as p,D as u,M as d,u as C,d as f}from"./utils-wFAOo4Dx.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as c}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as u,M as d,u as C,d as f}from"./utils-H5nRE5Sr.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-MJZiF0H5.js b/docs/assets/add-data-to-middle.stories-u1pPUmjW.js similarity index 86% rename from docs/assets/add-data-to-middle.stories-MJZiF0H5.js rename to docs/assets/add-data-to-middle.stories-u1pPUmjW.js index fdb10d676..dd90c99d0 100644 --- a/docs/assets/add-data-to-middle.stories-MJZiF0H5.js +++ b/docs/assets/add-data-to-middle.stories-u1pPUmjW.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-ATY7qU3b.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-wFAOo4Dx.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.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-H5nRE5Sr.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-n1-kzW3w.js b/docs/assets/add-data-to-top.stories-j70HTiom.js similarity index 87% rename from docs/assets/add-data-to-top.stories-n1-kzW3w.js rename to docs/assets/add-data-to-top.stories-j70HTiom.js index 8c4f382d5..71767d441 100644 --- a/docs/assets/add-data-to-top.stories-n1-kzW3w.js +++ b/docs/assets/add-data-to-top.stories-j70HTiom.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-ATY7qU3b.js";import{B as f,D as h,u as D,c as g,d as x}from"./utils-wFAOo4Dx.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as f,D as h,u as D,c as g,d as x}from"./utils-H5nRE5Sr.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-T-EG5iIa.js b/docs/assets/add-data.stories-dkRmLm5K.js similarity index 88% rename from docs/assets/add-data.stories-T-EG5iIa.js rename to docs/assets/add-data.stories-dkRmLm5K.js index f765d23ce..fa931a388 100644 --- a/docs/assets/add-data.stories-T-EG5iIa.js +++ b/docs/assets/add-data.stories-dkRmLm5K.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-ATY7qU3b.js";import{B as f,D,M as k,K as A,u as E,c as b,d as V}from"./utils-wFAOo4Dx.js";import{S as j}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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 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-Orvb2jqb.js";import{B as f,D,M as k,K as A,u as E,c as b,d as V}from"./utils-H5nRE5Sr.js";import{S as j}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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:`() => { const { cols, getCellContent, diff --git a/docs/assets/all-cell-kinds.stories-5zTW479G.js b/docs/assets/all-cell-kinds.stories-fKxfnZWA.js similarity index 82% rename from docs/assets/all-cell-kinds.stories-5zTW479G.js rename to docs/assets/all-cell-kinds.stories-fKxfnZWA.js index 4e4daf5ca..c0ba56f6e 100644 --- a/docs/assets/all-cell-kinds.stories-5zTW479G.js +++ b/docs/assets/all-cell-kinds.stories-fKxfnZWA.js @@ -1,4 +1,4 @@ -import{j as e,a as d}from"./marked.esm-dbrxtycE.js";import{D as m}from"./data-editor-all-ATY7qU3b.js";import{B as p,D as c,P as u,a as C,d as h}from"./utils-wFAOo4Dx.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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:`() => { +import{j as e,a as d}from"./marked.esm-dbrxtycE.js";import{D as m}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as c,P as u,a as C,d as h}from"./utils-H5nRE5Sr.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-F2P_Hxxx.js b/docs/assets/append-row-handle.stories-kssBUpmm.js similarity index 88% rename from docs/assets/append-row-handle.stories-F2P_Hxxx.js rename to docs/assets/append-row-handle.stories-kssBUpmm.js index 46d1a77fa..276442ae0 100644 --- a/docs/assets/append-row-handle.stories-F2P_Hxxx.js +++ b/docs/assets/append-row-handle.stories-kssBUpmm.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-ATY7qU3b.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-wFAOo4Dx.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.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-H5nRE5Sr.js";import{S as V}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-zCbLcasW.js b/docs/assets/automatic-row-markers.stories-jx_758La.js similarity index 86% rename from docs/assets/automatic-row-markers.stories-zCbLcasW.js rename to docs/assets/automatic-row-markers.stories-jx_758La.js index bc60f279c..54559d94c 100644 --- a/docs/assets/automatic-row-markers.stories-zCbLcasW.js +++ b/docs/assets/automatic-row-markers.stories-jx_758La.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import{D as p}from"./data-editor-all-ATY7qU3b.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-wFAOo4Dx.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as p}from"./data-editor-all-Orvb2jqb.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-H5nRE5Sr.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-VN36jONF.js b/docs/assets/built-in-search.stories-RdRs9hWj.js similarity index 88% rename from docs/assets/built-in-search.stories-VN36jONF.js rename to docs/assets/built-in-search.stories-RdRs9hWj.js index 8cb44a8d0..9248ab4b8 100644 --- a/docs/assets/built-in-search.stories-VN36jONF.js +++ b/docs/assets/built-in-search.stories-RdRs9hWj.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-hgJATaim.js";import{D}from"./data-editor-all-ATY7qU3b.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-wFAOo4Dx.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-h6lJQmfV.js";import{D}from"./data-editor-all-Orvb2jqb.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-H5nRE5Sr.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-rXX4glfM.js b/docs/assets/cell-activated-event.stories-kZ0Yhfoj.js similarity index 89% rename from docs/assets/cell-activated-event.stories-rXX4glfM.js rename to docs/assets/cell-activated-event.stories-kZ0Yhfoj.js index 19725eb81..30e4fb131 100644 --- a/docs/assets/cell-activated-event.stories-rXX4glfM.js +++ b/docs/assets/cell-activated-event.stories-kZ0Yhfoj.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-ATY7qU3b.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-wFAOo4Dx.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.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-H5nRE5Sr.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-GoH1iMdu.js b/docs/assets/cell.stories-Vtu6m6MQ.js similarity index 99% rename from docs/assets/cell.stories-GoH1iMdu.js rename to docs/assets/cell.stories-Vtu6m6MQ.js index 2fec35f8d..f970dc331 100644 --- a/docs/assets/cell.stories-GoH1iMdu.js +++ b/docs/assets/cell.stories-Vtu6m6MQ.js @@ -1,4 +1,4 @@ -import{j as D,s as te,a as Pe,m as qr}from"./marked.esm-dbrxtycE.js";import{r as y}from"./index-BMVQvedj.js";import{G as E,p as Zr,m as Ce,g as ue,a as Bt,u as Kn,d as Jr,b as Qr,i as ea,r as ta,c as Lt,D as Yn}from"./data-editor-all-ligl_Vjz.js";import{_ as Te,a as na,b as ce,c as V,d as ke}from"./toConsumableArray-2oaFSNyq.js";import{r as ra}from"./index-wocATsGp.js";import{_ as aa}from"./iframe-ni8xiI1Q.js";import{r as St}from"./throttle-7EuXLZa7.js";import{u as oa}from"./flatten-qRvRBp6y.js";import{u as ia}from"./index.esm-Ejw8GwRl.js";import"../sb-preview/runtime.js";import"./_baseIteratee-WTHxv43n.js";const la=[[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 sa(t,e,n){let a=!1;for(const r of la){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 ua=()=>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"})}),ca=te("div")({name:"EditorWrap",class:"e8nv6xj",propsAsIs:!1}),da={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(ca,{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(ua,{})},e))}),onPaste:(t,e)=>{const n=Number.parseInt(t);return{...e,rating:Number.isNaN(n)?0:n}}},fa=da,pa={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[v,g]=i;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-v)/(g-v))));const f=a.cellHorizontalPadding,p=f+r.x,m=r.y+3,C=r.height-6,S=r.width-f*2,O=g-v,k=g<=0?m:v>=0?m+C:m+C*(g/O);if(!h&&v<=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=m+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:m+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},ha=pa;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,ma=()=>t=>t.tagHeight/2,va=()=>t=>t.tagHeight,ga=()=>t=>t.innerPad,ba=te("div")({name:"EditorWrap",class:"e14vzbfa",propsAsIs:!1,vars:{"e14vzbfa-0":[ma(),"px"],"e14vzbfa-1":[va(),"px"],"e14vzbfa-2":[ga(),"px"]}}),ya={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 v of l){const g=((h=o.find(C=>C.tag===v))==null?void 0:h.color)??a.bgBubble;n.font=`12px ${a.fontFamily}`;const p=Ce(v,n).width+Oe*2,m=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(ba,{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))})},Ca=ya,wa={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,v=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+v,a.y+a.height/2,v,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+v-p.width/2,a.y+a.height/2+ue(n,`600 16px ${r.fontFamily}`)),f!==void 0&&(n.save(),n.beginPath(),n.arc(g+v,a.y+a.height/2,v,0,Math.PI*2),n.clip(),n.drawImage(f,g,a.y+a.height/2-v,v*2,v*2),n.restore()),u!==void 0&&(n.font=r.baseFontFull,n.fillStyle=r.textDark,n.fillText(u,g+v*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(Bt,{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})},Sa=wa;function un(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"})}),ca=te("div")({name:"EditorWrap",class:"e8nv6xj",propsAsIs:!1}),da={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(ca,{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(ua,{})},e))}),onPaste:(t,e)=>{const n=Number.parseInt(t);return{...e,rating:Number.isNaN(n)?0:n}}},fa=da,pa={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[v,g]=i;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-v)/(g-v))));const f=a.cellHorizontalPadding,p=f+r.x,m=r.y+3,C=r.height-6,S=r.width-f*2,O=g-v,k=g<=0?m:v>=0?m+C:m+C*(g/O);if(!h&&v<=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=m+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:m+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},ha=pa;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,ma=()=>t=>t.tagHeight/2,va=()=>t=>t.tagHeight,ga=()=>t=>t.innerPad,ba=te("div")({name:"EditorWrap",class:"e14vzbfa",propsAsIs:!1,vars:{"e14vzbfa-0":[ma(),"px"],"e14vzbfa-1":[va(),"px"],"e14vzbfa-2":[ga(),"px"]}}),ya={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 v of l){const g=((h=o.find(C=>C.tag===v))==null?void 0:h.color)??a.bgBubble;n.font=`12px ${a.fontFamily}`;const p=Ce(v,n).width+Oe*2,m=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(ba,{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))})},Ca=ya,wa={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,v=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+v,a.y+a.height/2,v,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+v-p.width/2,a.y+a.height/2+ue(n,`600 16px ${r.fontFamily}`)),f!==void 0&&(n.save(),n.beginPath(),n.arc(g+v,a.y+a.height/2,v,0,Math.PI*2),n.clip(),n.drawImage(f,g,a.y+a.height/2-v,v*2,v*2),n.restore()),u!==void 0&&(n.font=r.baseFontFull,n.fillStyle=r.textDark,n.fillText(u,g+v*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(Bt,{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})},Sa=wa;function un(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;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qe(t){"@babel/helpers - typeof";return Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qe(t)}function Ea(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ta(t,e){if(e&&(Qe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ea(t)}function Ra(t){var e=Va();return function(){var a=Je(t),r;if(e){var o=Je(this).constructor;r=Reflect.construct(a,arguments,o)}else r=a.apply(this,arguments);return Ta(this,r)}}function La(t){if(t.sheet)return t.sheet;for(var e=0;e0?K(De,--Y):0,Ie--,z===10&&(Ie=1,ut--),z}function Z(){return z=Y2||He(z)>3?"":" "}function ja(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 At(t){for(;Z();)switch(z){case t:return Y;case 34:case 39:t!==34&&t!==39&&At(z);break;case 40:t===41&&At(t);break;case 92:Z();break}return Y}function Ka(t,e){for(;Z()&&t+z!==57;)if(t+z===84&&se()===47)break;return"/*"+_e(e,Y-1)+"*"+st(t===47?t:Z())}function Ya(t){for(;!He(se());)Z();return _e(t,Y)}function Xa(t){return tr(Xe("",null,null,null,[""],t=er(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,v=0,g=0,f=1,p=1,m=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){$t(b+=R(Ye(C),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:b+=Ye(C);break;case 9:case 10:case 13:case 32:b+=Ga(g);break;case 92:b+=ja(Ke()-1,7);continue;case 47:switch(se()){case 42:case 47:We(qa(Ka(Z(),Ke()),e,n),i);break;default:b+="/"}break;case 123*f:s[u++]=ie(b)*m;case 125*f:case 59:case 0:switch(C){case 0:case 125:p=0;case 59+c:v>0&&ie(b)-d&&We(v>32?fn(b+";",a,n,d-1):fn(R(b," ","")+";",a,n,d-2),i);break;case 59:b+=";";default:if(We(x=dn(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(dn(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=v=0,f=m=1,S=b="",d=l;break;case 58:d=1+ie(b),v=g;default:if(f<1){if(C==123)--f;else if(C==125&&f++==0&&Ua()==125)continue}switch(b+=st(C),C*f){case 38:m=c>0?1:(b+="\f",-1);break;case 44:s[u++]=(ie(b)-1)*m,m=1;break;case 64:se()===45&&(b+=Ye(Z())),h=se(),c=d=ie(S=b+=Ya(Ke())),C++;break;case 45:g===45&&ie(b)==2&&(f=0)}}return o}function dn(t,e,n,a,r,o,l,s,i,u,c){for(var d=r-1,h=r===0?o:[""],v=Gt(h),g=0,f=0,p=0;g0?h[m]+" "+C:R(C,/&\f/g,h[m])))&&(i[p++]=S);return ct(t,e,n,r===0?Wt:s,i,u,c)}function qa(t,e,n){return ct(t,e,n,qn,st(Wa()),Ae(t,2,-2),0)}function fn(t,e,n,a){return ct(t,e,n,Ut,Ae(t,0,a),Ae(t,a+1,-1),a)}function nr(t,e){switch(_a(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+et+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"+et+(K(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~$t(t,"stretch")?nr(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-(~$t(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=Gt(t),r=0;r-1&&!t.return)switch(t.type){case Ut:t.return=nr(t.value,t.length);break;case Zn:return Me([Ve(t,{value:R(t.value,"@","@"+T)})],a);case Wt:if(t.length)return Ba(t.props,function(r){switch(za(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Me([Ve(t,{props:[R(r,/:(read-\w+)/,":"+et+"$1")]})],a);case"::placeholder":return Me([Ve(t,{props:[R(r,/:(plac\w+)/,":"+T+"input-$1")]}),Ve(t,{props:[R(r,/:(plac\w+)/,":"+et+"$1")]}),Ve(t,{props:[R(r,/:(plac\w+)/,G+"input-$1")]})],a)}return""})}}var to=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)},no=function(e,n){var a=-1,r=44;do switch(He(r)){case 0:r===38&&se()===12&&(n[a]=1),e[a]+=to(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]+=st(r)}while(r=Z());return e},ro=function(e,n){return tr(no(er(e),n))},pn=new WeakMap,ao=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&&!pn.get(a))&&!r){pn.set(e,!0);for(var o=[],l=ro(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-Orvb2jqb.js";import{B as M,D as b,P as k,M as S,u as w,d as v}from"./utils-H5nRE5Sr.js";import{C as x}from"./image-window-loader-h6lJQmfV.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-s0PuuzYR.js b/docs/assets/column-groups.stories-bndOvtUp.js similarity index 78% rename from docs/assets/column-groups.stories-s0PuuzYR.js rename to docs/assets/column-groups.stories-bndOvtUp.js index 3b7847fb7..d2e7cd55f 100644 --- a/docs/assets/column-groups.stories-s0PuuzYR.js +++ b/docs/assets/column-groups.stories-bndOvtUp.js @@ -1,4 +1,4 @@ -import{j as r,a as p}from"./marked.esm-dbrxtycE.js";import{D as l}from"./data-editor-all-ATY7qU3b.js";import{B as u,D as d,P as c,u as g,d as C}from"./utils-wFAOo4Dx.js";import{a as G}from"./image-window-loader-hgJATaim.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as l}from"./data-editor-all-Orvb2jqb.js";import{B as u,D as d,P as c,u as g,d as C}from"./utils-H5nRE5Sr.js";import{a as G}from"./image-window-loader-h6lJQmfV.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-ZjvtzRN2.js b/docs/assets/content-alignment.stories-a9SFZLiG.js similarity index 85% rename from docs/assets/content-alignment.stories-ZjvtzRN2.js rename to docs/assets/content-alignment.stories-a9SFZLiG.js index ad3006131..868fbed1d 100644 --- a/docs/assets/content-alignment.stories-ZjvtzRN2.js +++ b/docs/assets/content-alignment.stories-a9SFZLiG.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-ATY7qU3b.js";import{B as g,D as u,P as o,a as f,d as A}from"./utils-wFAOo4Dx.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as g,D as u,P as o,a as f,d as A}from"./utils-H5nRE5Sr.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-GuhX1Jrr.js b/docs/assets/controlled-search.stories-k2kx3JIg.js similarity index 89% rename from docs/assets/controlled-search.stories-GuhX1Jrr.js rename to docs/assets/controlled-search.stories-k2kx3JIg.js index f84f06435..9c8301d36 100644 --- a/docs/assets/controlled-search.stories-GuhX1Jrr.js +++ b/docs/assets/controlled-search.stories-k2kx3JIg.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-hgJATaim.js";import{D as v}from"./data-editor-all-ATY7qU3b.js";import{B as D,D as E,P as K,a as k,d as F}from"./utils-wFAOo4Dx.js";import{S as P}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-h6lJQmfV.js";import{D as v}from"./data-editor-all-Orvb2jqb.js";import{B as D,D as E,P as K,a as k,d as F}from"./utils-H5nRE5Sr.js";import{S as P}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-6gciZswV.js b/docs/assets/controlled-selection.stories-sCVCvvyD.js similarity index 93% rename from docs/assets/controlled-selection.stories-6gciZswV.js rename to docs/assets/controlled-selection.stories-sCVCvvyD.js index 02d4b5288..c43f3ea13 100644 --- a/docs/assets/controlled-selection.stories-6gciZswV.js +++ b/docs/assets/controlled-selection.stories-sCVCvvyD.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-ATY7qU3b.js";import{u as x,B as y,D,P as p,d as G}from"./utils-wFAOo4Dx.js";import{C as d}from"./image-window-loader-hgJATaim.js";import{S as N}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{u as x,B as y,D,P as p,d as G}from"./utils-H5nRE5Sr.js";import{C as d}from"./image-window-loader-h6lJQmfV.js";import{S as N}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-sP_45gy5.js b/docs/assets/copy-support.stories-LzebiMzB.js similarity index 82% rename from docs/assets/copy-support.stories-sP_45gy5.js rename to docs/assets/copy-support.stories-LzebiMzB.js index 99f4a7092..02a615b7d 100644 --- a/docs/assets/copy-support.stories-sP_45gy5.js +++ b/docs/assets/copy-support.stories-LzebiMzB.js @@ -1,4 +1,4 @@ -import{j as e,a as r,F as m}from"./marked.esm-dbrxtycE.js";import{D as d}from"./data-editor-all-ATY7qU3b.js";import{B as c,D as u,P as C,M as h,u as g,d as f}from"./utils-wFAOo4Dx.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as d}from"./data-editor-all-Orvb2jqb.js";import{B as c,D as u,P as C,M as h,u as g,d as f}from"./utils-H5nRE5Sr.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-vbWU8h8P.js b/docs/assets/custom-header-icons.stories-sneBwz65.js similarity index 95% rename from docs/assets/custom-header-icons.stories-vbWU8h8P.js rename to docs/assets/custom-header-icons.stories-sneBwz65.js index a5e9a8005..dacb796b4 100644 --- a/docs/assets/custom-header-icons.stories-vbWU8h8P.js +++ b/docs/assets/custom-header-icons.stories-sneBwz65.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-ATY7qU3b.js";import{B as h,D as g,P as v,a as M,d as H}from"./utils-wFAOo4Dx.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as h,D as g,P as v,a as M,d as H}from"./utils-H5nRE5Sr.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-RObg15Lg.js b/docs/assets/custom-header.stories-DXCIQAWC.js similarity index 88% rename from docs/assets/custom-header.stories-RObg15Lg.js rename to docs/assets/custom-header.stories-DXCIQAWC.js index c599667a5..2b8ddfde5 100644 --- a/docs/assets/custom-header.stories-RObg15Lg.js +++ b/docs/assets/custom-header.stories-DXCIQAWC.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-ATY7qU3b.js";import{B as f,D as x,u as g,d as C}from"./utils-wFAOo4Dx.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as f,D as x,u as g,d as C}from"./utils-H5nRE5Sr.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-85iGweFr.js b/docs/assets/data-editor-all-85iGweFr.js new file mode 100644 index 000000000..9865d170a --- /dev/null +++ b/docs/assets/data-editor-all-85iGweFr.js @@ -0,0 +1,135 @@ +var ps=Object.defineProperty;var vs=(e,t,n)=>t in e?ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Oe=(e,t,n)=>(vs(e,typeof t!="symbol"?t+"":t,n),n);import{r as l,R as Bt}from"./index-BMVQvedj.js";import{_ as fl}from"./iframe-t8ayfGqb.js";import{h as Cs,d as hl,j as xs,v as ks,_ as Ss,g as Ms,c as mn,r as Zn,t as Rs}from"./throttle-7EuXLZa7.js";import{u as Es,f as Bi}from"./flatten-qRvRBp6y.js";import{s as Qt,b as Ds}from"./marked.esm-dbrxtycE.js";function gl(e="This should not happen"){throw new Error(e)}function Zt(e,t="Assertion failed"){if(!e)return gl(t)}function Uo(e,t){return gl(t??"Hell froze over")}function Is(e,t){try{return e()}catch{return t}}const Oi=Object.prototype.hasOwnProperty;function ko(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--&&ko(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Oi.call(e,n)&&++o&&!Oi.call(t,n)||!(n in t)||!ko(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const xr=null,fi=void 0;var Z;(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"})(Z||(Z={}));var Wi;(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"})(Wi||(Wi={}));var kr;(function(e){e.Triangle="triangle",e.Dots="dots"})(kr||(kr={}));function yr(e){return"width"in e&&typeof e.width=="number"}async function $i(e){return typeof e=="object"?e:await e()}function vo(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function nu(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown||e.kind===Z.Boolean||e.kind===Z.Image||e.kind===Z.Custom)}function Co(e){return e.kind===ln.Marker||e.kind===ln.NewRow}function No(e){if(!vo(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;Uo(e,"A cell was passed with an invalid kind")}function Fs(e){return Cs(e,"editor")}function li(e){return!(e.readonly??!1)}var ln;(function(e){e.NewRow="new-row",e.Marker="marker"})(ln||(ln={}));function Hs(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 Fn(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=Hs([...this.items,n]);return new Fn(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,a]of n.entries()){const[s,d]=a;if(s<=r&&o<=d){const f=[];s=o&&tNi??(Ni=new Fn([]))),Oe(Fn,"fromSingleSelection",t=>Fn.empty().add(t));let nt=Fn;const Ts=Qt("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});function At(e,t,n,o,r=!1){const i=l.useRef();i.current=t,l.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=d=>{var f;(f=i.current)==null||f.call(a,d)};return a.addEventListener(e,s,{passive:o,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,o,r])}function bo(e,t){return e===void 0?void 0:t}const As=Math.PI;function Xi(e){return e*As/180}const ml=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),wl=(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}},yl=(e,t,n)=>Math.min(e,t-n*2),bl=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,hi=e=>{const t=e.fgColor??"currentColor";return l.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"}),l.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"}))},Ls=e=>{const t=e.fgColor??"currentColor";return l.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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]=l.useState(e),i=l.useRef(!0);l.useEffect(()=>()=>{i.current=!1},[]);const a=l.useRef(hl(s=>{i.current&&r(s)},n));return l.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),o}const Ps="֑-߿יִ-﷽ﹰ-ﻼ",Bs="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Os=new RegExp("^[^"+Bs+"]*["+Ps+"]");function gi(e){return Os.test(e)?"rtl":"not-rtl"}let br;function si(){if(typeof document>"u")return 0;if(br!==void 0)return br;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(),br=n-o,br}const jn=Symbol();function Ws(e){const t=l.useRef([jn,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=l.useState(e),[,r]=l.useState(),i=l.useCallback(s=>{const d=t.current[0];d!==jn&&(s=typeof s=="function"?s(d):s,s===d)||(d!==jn&&r({}),o(f=>typeof s=="function"?s(d===jn?f:d):s),t.current[0]=jn)},[]),a=l.useCallback(()=>{t.current[0]=jn,r({})},[]);return[t.current[0]===jn?n:t.current[0],i,a]}function pl(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 $s(e){const t=l.useRef(e);return ko(e,t.current)||(t.current=e),t.current}const Ns=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:r}=e,i=t.filter(s=>s!=="");if(i.length===0)return null;const a=i.length>1;return l.createElement(Ts,{"data-testid":"GDG-default-image-overlay-editor"},l.createElement(xs.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(s=>{const d=(r==null?void 0:r(s))??l.createElement("img",{draggable:!1,src:s});return l.createElement("div",{className:"gdg-centering-container",key:s},d)})),n&&o&&l.createElement("button",{className:"gdg-edit-icon",onClick:o},l.createElement(hi,null)))},Xs=Qt("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Ys extends Bt.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,a=Ds(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let d=i==null?void 0:i(a);if(d===void 0){const u=document.createElement("template");u.innerHTML=a,d=u.content}n.append(d);const f=n.getElementsByTagName("a");for(const u of f)u.target="_blank",u.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),Bt.createElement(Xs,{ref:this.containerRefHook})}}const Ks=Qt("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Us=Qt("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),_s=Qt("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Yi=0;const Dr=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:r,altNewline:i,validatedSelection:a,...s}=e,{onChange:d,className:f}=s,u=l.useRef(null),w=n??"";Zt(d!==void 0,"GrowingEntry must be a controlled input area");const[m]=l.useState(()=>"input-box-"+(Yi=(Yi+1)%1e7));l.useEffect(()=>{const h=u.current;if(h===null||h.disabled)return;const y=w.toString().length;h.focus(),h.setSelectionRange(r?0:y,y)},[]),l.useLayoutEffect(()=>{var h;if(a!==void 0){const y=typeof a=="number"?[a,null]:a;(h=u.current)==null||h.setSelectionRange(y[0],y[1])}},[a]);const g=l.useCallback(h=>{h.key==="Enter"&&h.shiftKey&&i===!0||o==null||o(h)},[i,o]);return l.createElement(_s,{className:"gdg-growing-entry"},l.createElement(Us,{className:f},w+` +`),l.createElement(Ks,{...s,className:(f??"")+" gdg-input",id:m,ref:u,onKeyDown:g,value:w,placeholder:t,dir:"auto"}))},Jr={};let On=null;function Vs(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function So(e){const t=e.toLowerCase().trim();if(Jr[t]!==void 0)return Jr[t];On=On||Vs(),On.style.color="#000",On.style.color=t;const n=getComputedStyle(On).color;On.style.color="#fff",On.style.color=t;const o=getComputedStyle(On).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),Jr[t]=r,r}function Jn(e,t){const[n,o,r]=So(e);return`rgba(${n}, ${o}, ${r}, ${t})`}const Ki=new Map;function Ui(e,t){const n=`${e}-${t}`,o=Ki.get(n);if(o!==void 0)return o;const r=Jt(e,t);return Ki.set(n,r),r}function Jt(e,t){if(t===void 0)return e;const[n,o,r,i]=So(e);if(i===1)return e;const[a,s,d,f]=So(t),u=i+f*(1-i),w=(i*n+f*a*(1-i))/u,m=(i*o+f*s*(1-i))/u,g=(i*r+f*d*(1-i))/u;return`rgba(${w}, ${m}, ${g}, ${u})`}function ou(e,t,n){if(n<=0)return e;if(n>=1)return t;const o=[...So(e)];o[0]=o[0]*o[3],o[1]=o[1]*o[3],o[2]=o[2]*o[3];const r=[...So(t)];r[0]=r[0]*r[3],r[1]=r[1]*r[3],r[2]=r[2]*r[3];const i=n,a=1-n,s=o[3]*a+r[3]*i,d=Math.floor((o[0]*a+r[0]*i)/s),f=Math.floor((o[1]*a+r[1]*i)/s),u=Math.floor((o[2]*a+r[2]*i)/s);return`rgba(${d}, ${f}, ${u}, ${s})`}function ru(e){if(e==="transparent")return 0;function t(i){const a=i/255;return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}const[n,o,r]=So(e);return .2126*t(n)+.7152*t(o)+.0722*t(r)}function Gs(e,t){return Bt.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 vl(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&oa)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 Zs(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)&&_i(e,t,i)&&r++;for(const a of n.current.rangeStack)_i(e,t,a)&&r++;return r}function xl(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,a)=>({...i,sticky:e[a].sticky})),n=o}return n}function Mo(e,t){let n=0;const o=xl(e,t);for(let r=0;r0)for(const f of a)n-=f.width;let s=t,d=r??0;for(;d<=n&&s=w)return y}const m=i-f,g=e-(d??0);if(typeof a=="number"){const h=Math.floor((g-u)/a)+s;return h>=m?void 0:h}else{let h=u;for(let y=s;y"u";async function ta(){var e;ea||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,Cr=0,Yo={},ks())}ta();function kl(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Vo(e,t,n,o="middle"){const r=kl(e,t,o,n);let i=Yo[r];return i===void 0&&(i=t.measureText(e),Yo[r]=i,Cr++),Cr>1e4&&(Yo={},Cr=0),i}function na(e,t){const n=kl(e,void 0,"middle",t);return Yo[n]}function Xn(e,t){return typeof t!="string"&&(t=t.baseFontFull),oa(e,t)}function Vi(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const Gi=[];function oa(e,t){for(const i of Gi)if(i.key===t)return i.val;const n=Vi(e,"alphabetic"),r=-(Vi(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Gi.push({key:t,val:r}),r}function ra(e,t,n,o,r,i){const{ctx:a,rect:s,theme:d}=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 la(e,t,n,o,r,i,a,s,d,f){const u=s.baseFontFull,w=Ss(e,t,u,r-s.cellHorizontalPadding*2,f??!1),m=Ml(e,u),g=s.lineHeight*m,h=m+g*(w.length-1),y=h+s.cellVerticalPadding>i;y&&(e.save(),e.rect(n,o,r,i),e.clip());const x=o+i/2-h/2;let R=Math.max(o+s.cellVerticalPadding,x);for(const C of w)if(Sl(e,C,n,R,r,m,a,s,d),R+=g,R>o+i)break;y&&e.restore()}function xn(e,t,n,o,r){const{ctx:i,rect:a,theme:s}=e,{x:d,y:f,width:u,height:w}=a;o=o??!1,o||(t=ia(t,u));const m=Xn(i,s),g=gi(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?la(i,t,d,f,u,w,m,s,n,r):Sl(i,t,d,f,u,w,m,s,n),h&&(i.textAlign="start"),g&&(i.direction="inherit")}}function kn(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 sa(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 aa(e,t,n){const o=function(s,d){const f=d.x-s.x,u=d.y-s.y,w=Math.sqrt(f*f+u*u),m=f/w,g=u/w;return{x:f,y:d.y-s.y,len:w,nx:m,ny:g,ang:Math.atan2(g,m)}};let r;const i=t.length;let a=t[i-1];for(let s=0;s1?1:m),y=1,x=!1;g<0?h<0?h=Math.PI+h:(h=Math.PI-h,y=-1,x=!0):h>0&&(y=-1,x=!0),r=d.radius!==void 0?d.radius:n;const R=h/2;let C=Math.abs(Math.cos(R)*r/Math.sin(R)),v;C>Math.min(u.len/2,w.len/2)?(C=Math.min(u.len/2,w.len/2),v=Math.abs(C*Math.sin(R)/Math.cos(R))):v=r;let z=d.x+w.nx*C,P=d.y+w.ny*C;z+=-w.ny*v*y,P+=w.nx*v*y,e.arc(z,P,v,u.ang+Math.PI/2*y,w.ang-Math.PI/2*y,x),a=d,d=f}e.closePath()}function ci(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h){const y={x:0,y:i+f,width:0,height:0};if(e>=g.length||t>=u||t<-2||e<0)return y;const x=i-r;if(e>=w){const R=a>e?-1:1,C=Mo(g);y.x+=C+d;for(let v=a;v!==e;v+=R)y.x+=g[R===1?v:v-1].width*R}else for(let R=0;R0&&_o(g[R-1].group,C)&&g[R-1].sticky===v;){const P=g[R-1];y.x-=P.width,y.width+=P.width,R--}let z=e;for(;z+1n&&(y.width=n-y.x)}}else if(t>=u-m){let R=u-t;for(y.y=o;R>0;){const C=t+R-1;y.height=typeof h=="number"?h:h(C),y.y-=y.height,R--}y.height+=1}else{const R=s>t?-1:1;if(typeof h=="number"){const C=t-s;y.y+=C*h}else for(let C=s;C!==t;C+=R)y.y+=h(C)*R;y.height=(typeof h=="number"?h:h(t))+1}return y}const mi=1<<21;function wn(e,t){return(t+2)*mi+e}function Rl(e){return e%mi}function wi(e){return Math.floor(e/mi)-2}function yi(e){const t=Rl(e),n=wi(e);return[t,n]}class El{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=Rl(t),o=wi(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&&a})}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&&ko(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class ca extends El{constructor(){super(...arguments);Oe(this,"cache",new Map);Oe(this,"setValue",(n,o)=>{this.cache.set(wn(n[0],n[1]),o)});Oe(this,"getValue",n=>this.cache.get(wn(n[0],n[1])));Oe(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class Ko{constructor(t=[]){Oe(this,"cells");this.cells=new Set(t.map(n=>wn(n[0],n[1])))}add(t){this.cells.add(wn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(wn(t[0],t[1]))}remove(t){this.cells.delete(wn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(wi(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{const g=ua(e,m[o],t,d);return f=Math.max(f,g),g});if(u.length>5&&s){f=0;let m=0;for(const h of u)m+=h;const g=m/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+16+(n.icon===void 0?0:28));const w=Math.max(Math.ceil(i),Math.min(Math.floor(a),Math.ceil(f)));return{...n,width:w}}function fa(e,t,n,o,r,i,a,s,d){const f=l.useRef(t),u=l.useRef(n),w=l.useRef(a);f.current=t,u.current=n,w.current=a;const[m,g]=l.useMemo(()=>{if(typeof window>"u")return[null,null];const C=document.createElement("canvas");return C.style.display="none",C.style.opacity="0",C.style.position="fixed",[C,C.getContext("2d",{alpha:!1})]},[]);l.useLayoutEffect(()=>(m&&document.documentElement.append(m),()=>{m==null||m.remove()}),[m]);const h=l.useRef({}),y=l.useRef(),[x,R]=l.useState();return l.useLayoutEffect(()=>{const C=u.current;if(C===void 0||e.every(yr))return;let v=Math.max(1,10-Math.floor(e.length/1e4)),z=0;v1&&(v--,z=1);const P={x:0,y:0,width:e.length,height:Math.min(f.current,v)},O={x:0,y:f.current-1,width:e.length,height:1};(async()=>{const X=C(P,d.signal),E=z>0?C(O,d.signal):void 0;let $;typeof X=="object"?$=X:$=await $i(X),E!==void 0&&(typeof E=="object"?$=[...$,...E]:$=[...$,...await $i(E)]),y.current=e,R($)})()},[d.signal,e]),l.useMemo(()=>{let v=e.every(yr)?e:g===null?e.map(H=>yr(H)?H:{...H,width:di}):(g.font=w.current.baseFontFull,e.map((H,X)=>{if(yr(H))return H;if(h.current[H.id]!==void 0)return{...H,width:h.current[H.id]};if(x===void 0||y.current!==e||H.id===void 0)return{...H,width:di};const E=Hl(g,a,H,X,x,r,i,!0,s);return h.current[H.id]=E.width,E})),z=0,P=0;const O=[];for(const[H,X]of v.entries())z+=X.width,X.grow!==void 0&&X.grow>0&&(P+=X.grow,O.push(H));if(z0){const H=[...v],X=o-z;let E=X;for(let $=0;${const t=e.fgColor,n=e.bgColor;return` + ${st}`},ga=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st}`},ma=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + `},wa=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},ya=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Tl=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + + + `},ba=e=>{const t=e.bgColor;return`${st} + + + + +`},pa=Tl,va=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Ca=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + + + + + + `},xa=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + +`},ka=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},Sa=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},Ma=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Ra=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + + `},Ea=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + +`},Da=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + + `},Ia=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Fa=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},Ha=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},Ta=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Aa=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + + + +`},La=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},za=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Pa=e=>{const t=e.fgColor,n=e.bgColor;return` + ${st} + + + `},Ba=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + + +`},Oa=e=>{const t=e.fgColor,n=e.bgColor;return`${st} + + +`},Wa=e=>{const t=e.fgColor;return` + + + `},$a=e=>{const t=e.fgColor;return` + + + +`},Na={headerRowID:ha,headerNumber:ma,headerCode:ga,headerString:wa,headerBoolean:ya,headerAudioUri:pa,headerVideoUri:va,headerEmoji:Ca,headerImage:xa,headerUri:Tl,headerPhone:ka,headerMarkdown:Sa,headerDate:Ma,headerTime:Ra,headerEmail:Ea,headerReference:Da,headerIfThenElse:Ia,headerSingleValue:Fa,headerLookup:Ha,headerTextTemplate:Ta,headerMath:Aa,headerRollup:La,headerJoinStrings:za,headerSplitString:Pa,headerGeoDistance:Ba,headerArray:Oa,rowOwnerOverlay:Wa,protectedColumnOverlay:$a,renameIcon:ba};function Xa(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Ya{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,a,s,d=1){const[f,u]=Xa(n,s),w=a*Math.ceil(window.devicePixelRatio),m=`${f}_${u}_${w}_${t}`;let g=this.spriteMap.get(m);if(g===void 0){const h=this.headerIcons[t];if(h===void 0)return;g=document.createElement("canvas");const y=g.getContext("2d");if(y===null)return;const x=new Image;x.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h({fgColor:u,bgColor:f}))}`,this.spriteMap.set(m,g);const R=x.decode();if(R===void 0)return;this.inFlight++,R.then(()=>{y.drawImage(x,0,0,w,w)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else d<1&&(o.globalAlpha=d),o.drawImage(g,0,0,w,w,r,i,a,a),d<1&&(o.globalAlpha=1)}}function Al(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Ir(e,t,n,o,r,i,a,s,d){s=s??t;let f=t,u=e;const w=o-i;let m=!1;for(;fs&&d(f,u,g,!1,a&&u===o-1)===!0){m=!0;break}f+=g,u++}if(!m){f=n;for(let g=0;g!g.sticky))==null?void 0:m.sourceIndex)??0;if(d>w){const g=Math.max(s,w);let h=t,y=o;for(let x=i.sourceIndex-1;x>=g;x--)h-=a[x].width,y+=a[x].width;for(let x=i.sourceIndex+1;x<=d;x++)y+=a[x].width;u={x:h,y:n,width:y,height:r}}if(w>s){const g=Math.min(d,w-1);let h=t,y=o;for(let x=i.sourceIndex-1;x>=s;x--)h-=a[x].width,y+=a[x].width;for(let x=i.sourceIndex+1;x<=g;x++)y+=a[x].width;f={x:h,y:n,width:y,height:r}}return[f,u]}function Ka(e,t,n,o){if(o==="any")return Pl(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),vl([t,n],e))return;const r=t-e.x,i=e.x+e.width-t,a=n-e.y+1,s=e.y+e.height-n,d=Math.min(o==="vertical"?Number.MAX_SAFE_INTEGER:r,o==="vertical"?Number.MAX_SAFE_INTEGER:i,o==="horizontal"?Number.MAX_SAFE_INTEGER:a,o==="horizontal"?Number.MAX_SAFE_INTEGER:s);return d===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:d===a?{x:e.x,y:n,width:e.width,height:e.y-n}:d===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 Sr(e,t,n,o,r,i,a,s){return e<=r+a&&r<=e+n&&t<=i+s&&i<=t+o}function Fr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Pl(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 Ua(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 _a(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,a=t+4,s=n+4,d=r-e.x,f=e.x+e.width-a,u=i-e.y,w=e.y+e.height-s,m=d>0?e.x+Math.floor(d/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,y=w>0?e.y+e.height-Math.floor(w/o)*o:e.y+e.height;return{x:m,y:h,width:g-m,height:y-h}}function Va(e,t,n,o,r){const[i,a,s,d]=t,[f,u,w,m]=r,{x:g,y:h,width:y,height:x}=e,R=[];if(y<=0||x<=0)return R;const C=g+y,v=h+x,z=gs,H=h+x>d,X=g>=i&&gi&&C<=s||gs,E=h>=a&&ha&&v<=d||hd;if(X&&E){const B=Math.max(g,i),D=Math.max(h,a),M=Math.min(C,s),S=Math.min(v,d);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:f,y:u,width:w-f+1,height:m-u+1}})}if(z&&P){const B=g,D=h,M=Math.min(C,i),S=Math.min(v,a);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:0,y:0,width:f+1,height:u+1}})}if(P&&X){const B=Math.max(g,i),D=h,M=Math.min(C,s),S=Math.min(v,a);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:f,y:0,width:w-f+1,height:u+1}})}if(P&&O){const B=Math.max(g,s),D=h,M=C,S=Math.min(v,a);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:w,y:0,width:n-w+1,height:u+1}})}if(z&&E){const B=g,D=Math.max(h,a),M=Math.min(C,i),S=Math.min(v,d);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:0,y:u,width:f+1,height:m-u+1}})}if(O&&E){const B=Math.max(g,s),D=Math.max(h,a),M=C,S=Math.min(v,d);R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:w,y:u,width:n-w+1,height:m-u+1}})}if(z&&H){const B=g,D=Math.max(h,d),M=Math.min(C,i),S=v;R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:0,y:m,width:f+1,height:o-m+1}})}if(H&&X){const B=Math.max(g,i),D=Math.max(h,d),M=Math.min(C,s),S=v;R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:f,y:m,width:w-f+1,height:o-m+1}})}if(O&&H){const B=Math.max(g,s),D=Math.max(h,d),M=C,S=v;R.push({rect:{x:B,y:D,width:M-B,height:S-D},clip:{x:w,y:m,width:n-w+1,height:o-m+1}})}return R}const Ga={kind:Z.Loading,allowOverlay:!1};function qi(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R,C,v,z,P,O,H,X,E,$,B,D,M,S,de,te,re,ge){let Re=(v==null?void 0:v.size)??Number.MAX_SAFE_INTEGER;const ie=performance.now();let V=M.baseFontFull;e.font=V;const le={ctx:e},ce=[0,0],We=x>0?Qn(d,x,f):0;let U,Se;const De=Al(C);return Yn(t,s,i,a,r,(be,Ye,Je,it,at)=>{const He=Math.max(0,it-Ye),Pe=Ye+He,Te=r+1,wt=be.width-He,ue=o-r-1;if(C.length>0){let Ue=!1;for(let _e=0;_e{e.save(),e.beginPath(),e.rect(Pe,Te,wt,ue),e.clip()},xe=z.columns.hasIndex(be.sourceIndex),Me=w(be.group??"").overrideTheme,Ie=be.themeOverride===void 0&&Me===void 0?M:Nn(M,Me,be.themeOverride),pe=Ie.baseFontFull;pe!==V&&(V=pe,e.font=pe),se();let et;return Ir(at,Je,o,d,f,x,R,De,(Ue,_e,j,Fe,Be)=>{var bt,It,sn;if(_e<0||(ce[0]=be.sourceIndex,ce[1]=_e,v!==void 0&&!v.has(ce)))return;if(C.length>0){let Ke=!1;for(let ft=0;ftVe.span!==void 0&&Ke>=Ve.span[0]&&Ke<=Ve.span[1]);Ot&&!h&&y?Wt=0:Ot&&y&&(Wt=Math.max(Wt,1)),Sn&&Wt++,Ot||(ke&&Wt++,xe&&!Be&&Wt++);const Mn=Ve.kind===Z.Protected?ut.bgCellMedium:ut.bgCell;let ct;if((Fe||Mn!==M.bgCell)&&(ct=Jt(Mn,ct)),Wt>0||St){St&&(ct=Jt(ut.bgHeader,ct));for(let Ke=0;Kege&&!Mt){const Ke=ut.baseFontFull;Ke!==V&&(e.font=Ke,V=Ke),et=Bl(e,Ve,be.sourceIndex,_e,qe,Ft,$e,Ue,Ge,j,Wt>0,ut,ct??ut.bgCell,H,X,(Ht==null?void 0:Ht.hoverAmount)??0,$,D,ie,B,et,S,de,te,re)}return Ne&&e.restore(),Ve.style==="faded"&&(e.globalAlpha=1),Re--,yt&&(e.restore(),(sn=et==null?void 0:et.deprep)==null||sn.call(et,le),et=void 0,se(),V=pe,e.font=pe),Re<=0}),e.restore(),Re<=0}),U}const Oo=[0,0],Wo={x:0,y:0,width:0,height:0},Qr=[void 0,()=>{}];let ui=!1;function qa(){ui=!0}function Bl(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R,C,v,z,P,O,H,X){var de,te;let E,$;x!==void 0&&x[0][0]===n&&x[0][1]===o&&(E=x[1][0],$=x[1][1]);let B;Oo[0]=n,Oo[1]=o,Wo.x=a,Wo.y=s,Wo.width=d,Wo.height=f,Qr[0]=O.getValue(Oo),Qr[1]=re=>O.setValue(Oo,re),ui=!1;const D={ctx:e,theme:w,col:n,row:o,cell:t,rect:Wo,highlighted:u,cellFillColor:m,hoverAmount:y,frameTime:C,hoverX:E,drawState:Qr,hoverY:$,imageLoader:g,spriteManager:h,hyperWrapping:R,overrideCursor:E!==void 0?X:void 0,requestAnimationFrame:qa},M=ra(D,t.lastUpdated,C,z,r,i),S=H(t);if(S!==void 0){(z==null?void 0:z.renderer)!==S&&((de=z==null?void 0:z.deprep)==null||de.call(z,D),z=void 0);const re=(te=S.drawPrep)==null?void 0:te.call(S,D,z);v!==void 0&&!Co(D.cell)?v(D,()=>S.draw(D,t)):S.draw(D,t),B=re===void 0?void 0:{deprep:re==null?void 0:re.deprep,fillStyle:re==null?void 0:re.fillStyle,font:re==null?void 0:re.font,renderer:S}}return(M||ui)&&(P==null||P(Oo)),B}function bi(e,t,n,o,r,i,a,s,d=-20,f=-20,u=32,w="center",m="square"){const g=Math.floor(r+a/2),h=m==="circle"?1e4:t.roundingRadius??4;let y=yl(u,a,t.cellVerticalPadding),x=y/2;const R=wl(w,o,i,t.cellHorizontalPadding,y),C=ml(R,g,y),v=bl(o+d,r+f,C);switch(n){case!0:{e.beginPath(),kn(e,R-y/2,g-y/2,y,y,h),m==="circle"&&(x*=.8,y*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(R-x+y/4.23,g-x+y/1.97),e.lineTo(R-x+y/2.42,g-x+y/1.44),e.lineTo(R-x+y/1.29,g-x+y/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case xr:case!1:{e.beginPath(),kn(e,R-y/2+.5,g-y/2+.5,y-1,y-1,h),e.lineWidth=1,e.strokeStyle=v?t.textDark:t.textMedium,e.stroke();break}case fi:{e.beginPath(),kn(e,R-y/2,g-y/2,y,y,h),e.fillStyle=v?t.textMedium:t.textLight,e.fill(),m==="circle"&&(x*=.8,y*=.8),e.beginPath(),e.moveTo(R-y/3,g),e.lineTo(R+y/3,g),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Uo()}}function ja(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R,C){const v=a+s;if(v<=0)return;e.fillStyle=w.bgHeader,e.fillRect(0,0,r,v);const[z,P]=(o==null?void 0:o[0])??[],O=w.headerFontFull;e.font=O,Yn(t,0,i,0,v,(H,X,E,$)=>{var le;if(x!==void 0&&!x.has([H.sourceIndex,-1]))return;const B=Math.max(0,$-X);e.save(),e.beginPath(),e.rect(X+B,s,H.width-B,a),e.clip();const D=y(H.group??"").overrideTheme,M=H.themeOverride===void 0&&D===void 0?w:Nn(w,D,H.themeOverride);M.bgHeader!==w.bgHeader&&(e.fillStyle=M.bgHeader,e.fill()),M!==w&&(e.font=M.baseFontFull);const S=u.columns.hasIndex(H.sourceIndex),de=d!==void 0||f,te=!de&&P===-1&&z===H.sourceIndex,re=de?0:((le=g.find(ce=>ce.item[0]===H.sourceIndex&&ce.item[1]===-1))==null?void 0:le.hoverAmount)??0,ge=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===H.sourceIndex,Re=S?M.accentColor:ge?M.bgHeaderHasFocus:M.bgHeader,ie=n?s:0,V=H.sourceIndex===0?0:1;S?(e.fillStyle=Re,e.fillRect(X+V,ie,H.width-V,a)):(ge||re>0)&&(e.beginPath(),e.rect(X+V,ie,H.width-V,a),ge&&(e.fillStyle=M.bgHeaderHasFocus,e.fill()),re>0&&(e.globalAlpha=re,e.fillStyle=M.bgHeaderHovered,e.fill(),e.globalAlpha=1)),$l(e,X,ie,H.width,a,H,S,M,te,ge,re,m,R,C),e.restore()}),n&&Za(e,t,r,i,s,o,w,m,g,h,y,x)}function Za(e,t,n,o,r,i,a,s,d,f,u,w){const[g,h]=(i==null?void 0:i[0])??[];let y=0;Ll(t,n,o,r,(x,R,C,v,z,P)=>{if(w!==void 0&&!w.hasItemInRectangle({x:x[0],y:-2,width:x[1]-x[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(C,v,z,P),e.clip();const O=u(R),H=(O==null?void 0:O.overrideTheme)===void 0?a:Nn(a,O.overrideTheme),X=h===-2&&g!==void 0&&g>=x[0]&&g<=x[1],E=X?H.bgHeaderHovered:H.bgHeader;if(E!==a.bgHeader&&(e.fillStyle=E,e.fill()),e.fillStyle=H.textGroupHeader??H.textHeader,O!==void 0){let $=C;if(O.icon!==void 0&&(s.drawSprite(O.icon,"normal",e,$+8,(r-20)/2,20,H),$+=26),e.fillText(O.name,$+8,r/2+Xn(e,a.headerFontFull)),O.actions!==void 0&&X){const B=Wl({x:C,y:v,width:z,height:P},O.actions);e.beginPath();const D=B[0].x-10,M=C+z-D;e.rect(D,0,M,r);const S=e.createLinearGradient(D,0,D+M,0),de=Jn(E,0);S.addColorStop(0,de),S.addColorStop(10/M,E),S.addColorStop(1,E),e.fillStyle=S,e.fill(),e.globalAlpha=.6;const[te,re]=(i==null?void 0:i[1])??[-1,-1];for(let ge=0;ge35){const z=m?35:o-35,P=m?35*.7:o-35*.7,O=z/o,H=P/o,X=e.createLinearGradient(t,0,t+o,0),E=Jn(y,0);X.addColorStop(m?1:0,y),X.addColorStop(O,y),X.addColorStop(H,E),X.addColorStop(m?0:1,E),e.fillStyle=X}else e.fillStyle=y;if(m&&(e.textAlign="right"),e.fillText(i.title,C,n+r/2+Xn(e,s.headerFontFull)),m&&(e.textAlign="left"),x&&i.hasMenu===!0)if(i.menuIcon===void 0||i.menuIcon===kr.Triangle){e.beginPath();const v=g.x+g.width/2-5.5,z=g.y+g.height/2-3;aa(e,[{x:v,y:z},{x:v+11,y:z},{x:v+5.5,y:z+6}],1),e.fillStyle=y,e.fill()}else if(i.menuIcon===kr.Dots){e.beginPath();const v=g.x+g.width/2,z=g.y+g.height/2;sa(e,v,z),e.fillStyle=y,e.fill()}else{const v=g.x+(g.width-s.headerIconSize)/2,z=g.y+(g.height-s.headerIconSize)/2;u.drawSprite(i.menuIcon,"normal",e,v,z,s.headerIconSize,s)}}function $l(e,t,n,o,r,i,a,s,d,f,u,w,m,g){const h=gi(i.title)==="rtl",y=Ol(t,n,o,r,h);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:r},column:i,columnIndex:i.sourceIndex,isSelected:a,hoverAmount:u,isHovered:d,hasSelectedCell:f,spriteManager:w,menuBounds:y},()=>ji(e,t,n,o,r,i,a,s,d,u,w,g,h,y)):ji(e,t,n,o,r,i,a,s,d,u,w,g,h,y)}function Ja(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R,C){if(R!==void 0||t[t.length-1]!==n[t.length-1])return;const v=Al(x);Yn(t,d,a,s,i,(z,P,O,H,X)=>{if(z!==t[t.length-1])return;P+=z.width;const E=Math.max(P,H);E>o||(e.save(),e.beginPath(),e.rect(E,i+1,1e4,r-i-1),e.clip(),Ir(X,O,r,f,u,h,y,v,($,B,D,M)=>{if(!M&&x.length>0&&!x.some(ge=>Sr(P,$,1e4,D,ge.x,ge.y,ge.width,ge.height)))return;const S=m.hasIndex(B),de=g.hasIndex(B);e.beginPath();const te=w==null?void 0:w(B),re=te===void 0?C:Nn(C,te);re.bgCell!==C.bgCell&&(e.fillStyle=re.bgCell,e.fillRect(P,$,1e4,D)),de&&(e.fillStyle=re.bgHeader,e.fillRect(P,$,1e4,D)),S&&(e.fillStyle=re.accentLight,e.fillRect(P,$,1e4,D))}),e.restore())})}function Qa(e,t,n,o,r,i,a,s,d){let f=!1;for(const h of t)if(!h.sticky){f=a(h.sourceIndex);break}const u=d.horizontalBorderColor??d.borderColor,w=d.borderColor,m=f?Mo(t):0;let g;if(m!==0&&(g=Ui(w,d.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=g,e.stroke()),r>0){const h=w===u&&g!==void 0?g:Ui(u,d.bgCell),y=Qn(i,r,s);e.beginPath(),e.moveTo(0,o-y+.5),e.lineTo(n,o-y+.5),e.strokeStyle=h,e.stroke()}}const Nl=(e,t,n)=>{let o=0,r=t,i=0,a=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=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),a=Math.max(a,s.y+s.height+1)}return{minX:o,maxX:r,minY:i,maxY:a}};function ec(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h){var D;const y=h.bgCell,{minX:x,maxX:R,minY:C,maxY:v}=Nl(s,i,a),z=[],P=a-Qn(g,m,f);let O=d,H=n,X=0;for(;O+r=C&&M<=v-1){const de=u==null?void 0:u(H),te=de==null?void 0:de.bgCell;te!==void 0&&te!==y&&H>=g-m&&z.push({x,y:M,w:R-x,h:S,color:te})}O+=S,H0)for(let M=0;M=x&&de<=R&&w(M+1)&&z.push({x:de,y:X,w:S.width,h:$,color:te}),E+=S.width}if(z.length===0)return;let B;e.beginPath();for(let M=z.length-1;M>=0;M--){const S=z[M];B===void 0?B=S.color:S.color!==B&&(e.fillStyle=B,e.fill(),e.beginPath(),B=S.color),e.rect(S.x,S.y,S.w,S.h)}B!==void 0&&(e.fillStyle=B,e.fill()),e.beginPath()}function Zi(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R=!1){if(d!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,a);for(const D of d)e.rect(D.x+1,D.y+1,D.width-1,D.height-1);e.clip("evenodd")}const C=x.horizontalBorderColor??x.borderColor,v=x.borderColor,{minX:z,maxX:P,minY:O,maxY:H}=Nl(s,i,a),X=[];e.beginPath();let E=.5;for(let D=0;D=z&&S<=P&&g(D+1)&&X.push({x1:S,y1:Math.max(f,O),x2:S,y2:Math.min(a,H),color:v})}let $=a+.5;for(let D=y-h;D=O&&de<=H-1){const te=m==null?void 0:m(M);X.push({x1:z,y1:de,x2:P,y2:de,color:(te==null?void 0:te.horizontalBorderColor)??(te==null?void 0:te.borderColor)??C})}D+=w(M),M++}}const B=Ms(X,D=>D.color);for(const D of Object.keys(B)){e.strokeStyle=D;for(const M of B[D])e.moveTo(M.x1,M.y1),e.lineTo(M.x2,M.y2);e.stroke(),e.beginPath()}d!==void 0&&e.restore()}function tc(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x,R,C){const v=[];e.imageSmoothingEnabled=!1;const z=Math.min(r.cellYOffset,a),P=Math.max(r.cellYOffset,a);let O=0;if(typeof R=="number")O+=(P-z)*R;else for(let S=z;Sr.cellYOffset&&(O=-O),O+=d-r.translateY;const H=Math.min(r.cellXOffset,i),X=Math.max(r.cellXOffset,i);let E=0;for(let S=H;Sr.cellXOffset&&(E=-E),E+=s-r.translateX;const $=Mo(x);if(E!==0&&O!==0)return{regions:[]};const B=f>0?Qn(m,f,R):0,D=u-$-Math.abs(E),M=w-g-B-Math.abs(O)-1;if(D>150&&M>150){const S={sx:0,sy:0,sw:u*h,sh:w*h,dx:0,dy:0,dw:u*h,dh:w*h};if(O>0?(S.sy=(g+1)*h,S.sh=M*h,S.dy=(O+g+1)*h,S.dh=M*h,v.push({x:0,y:g,width:u,height:O+1})):O<0&&(S.sy=(-O+g+1)*h,S.sh=M*h,S.dy=(g+1)*h,S.dh=M*h,v.push({x:0,y:w+O-B,width:u,height:-O+B})),E>0?(S.sx=$*h,S.sw=D*h,S.dx=(E+$)*h,S.dw=D*h,v.push({x:$-1,y:0,width:E+2,height:w})):E<0&&(S.sx=($-E)*h,S.sw=D*h,S.dx=$*h,S.dw=D*h,v.push({x:u+E,y:0,width:-E,height:w})),e.setTransform(1,0,0,1,0,0),C){if($>0&&E!==0&&O===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const de=$*h,te=w*h;e.drawImage(t,0,0,de,te,0,0,de,te)}if(B>0&&E===0&&O!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const de=(w-B)*h,te=u*h,re=B*h;e.drawImage(t,0,de,te,re,0,de,te,re)}}e.drawImage(t,S.sx,S.sy,S.sw,S.sh,S.dx,S.dy,S.dw,S.dh),e.scale(h,h)}return e.imageSmoothingEnabled=!0,{regions:v}}function nc(e,t,n,o,r,i,a,s,d,f){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||r!==e.translateY||Yn(d,n,o,r,s,(w,m,g,h)=>{if(w.sourceIndex===f){const y=Math.max(m,h)+1;return u.push({x:y,y:0,width:i-y,height:a}),!0}}),u}function oc(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;oH.style!=="no-outline");if(x===void 0||x.length===0)return;const R=Mo(s),C=Qn(g,m,w),v=[d,0,s.length,g-m],z=[R,0,t,n-C],P=x.map(H=>{const X=H.range,E=H.style??"dashed";return Va(X,v,t,n,z).map($=>{const B=$.rect,D=ci(B.x,B.y,t,n,u,f+u,o,r,i,a,g,d,m,s,w),M=B.width===1&&B.height===1?D:ci(B.x+B.width-1,B.y+B.height-1,t,n,u,f+u,o,r,i,a,g,d,m,s,w);return B.x+B.width>=s.length&&(M.width-=1),B.y+B.height>=g&&(M.height-=1),{color:H.color,style:E,clip:$.clip,rect:_a({x:D.x,y:D.y,width:M.x+M.width-D.x,height:M.y+M.height-D.y},t,n,8)}})}),O=()=>{e.lineWidth=1;let H=!1;for(const X of P)for(const E of X)if((E==null?void 0:E.rect)!==void 0&&Sr(0,0,t,n,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){const $=H,B=!Ua(E.clip,E.rect);B&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!H?(e.setLineDash([5,3]),H=!0):(E.style==="solid"||E.style==="solid-outline")&&H&&(e.setLineDash([]),H=!1),e.strokeStyle=E.style==="solid-outline"?Jt(Jt(E.color,y.borderColor),y.bgCell):Jn(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),B&&(e.restore(),H=$)}H&&e.setLineDash([])};return O(),O}function Qi(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 ei(e,t,n,o,r,i,a,s,d,f,u,w,m,g,h,y,x){if(u.current===void 0)return;const R=u.current.range,C=u.current.cell,v=[R.x+R.width-1,R.y+R.height-1];if(C[1]>=x&&v[1]>=x||!a.some(S=>S.sourceIndex===C[0]||S.sourceIndex===v[0]))return;const[P,O]=u.current.cell,H=m(u.current.cell),X=H.span??[P,P],E=O>=x-g,$=g>0&&!E?Qn(x,g,w)-1:0,B=v[1];let D;if(Yn(a,o,r,i,f,(S,de,te,re,ge)=>{if(S.sticky&&P>S.sourceIndex)return;const Re=S.sourceIndexX[1],V=S.sourceIndex===v[0];if(!(!V&&(Re||ie)))return Ir(ge,te,n,x,w,g,h,void 0,(le,ce,We)=>{if(ce!==O&&ce!==B)return;let U=de,Se=S.width;if(H.span!==void 0){const be=zl(H.span,de,le,S.width,We,S,s),Ye=S.sticky?be[0]:be[1];Ye!==void 0&&(U=Ye.x,Se=Ye.width)}return ce===B&&V&&y&&(D=()=>{var be;re>U&&!S.sticky&&(e.beginPath(),e.rect(re,0,t-re,n),e.clip()),e.beginPath(),e.rect(U+Se-4,le+We-4,4,4),e.fillStyle=((be=S.themeOverride)==null?void 0:be.accentColor)??d.accentColor,e.fill()}),D!==void 0}),D!==void 0}),D===void 0)return;const M=()=>{e.save(),e.beginPath(),e.rect(0,f,t,n-f-$),e.clip(),D==null||D(),e.restore()};return M(),M}function rc(e,t,n,o,r,i,a,s,d){d===void 0||d.size===0||(e.beginPath(),Ll(t,n,i,o,(f,u,w,m,g,h)=>{d.hasItemInRectangle({x:f[0],y:-2,width:f[1]-f[0]+1,height:1})&&e.rect(w,m,g,h)}),Yn(t,s,i,a,r,(f,u,w,m)=>{const g=Math.max(0,m-u),h=u+g+1,y=f.width-g-1;d.has([f.sourceIndex,-1])&&e.rect(h,o,y,r-o)}),e.clip())}function ic(e,t,n,o,r,i,a,s,d,f){let u=0;return Yn(e,i,o,r,n,(w,m,g,h,y)=>(Ir(y,g,t,a,s,d,f,void 0,(x,R,C,v)=>{v||(u=Math.max(R,u))}),!0)),u}function el(e,t){var Ne;const{canvasCtx:n,headerCanvasCtx:o,width:r,height:i,cellXOffset:a,cellYOffset:s,translateX:d,translateY:f,mappedColumns:u,enableGroups:w,freezeColumns:m,dragAndDropState:g,theme:h,drawFocus:y,headerHeight:x,groupHeaderHeight:R,disabledRows:C,rowHeight:v,verticalBorder:z,overrideCursor:P,isResizing:O,selection:H,fillHandle:X,freezeTrailingRows:E,rows:$,getCellContent:B,getGroupDetails:D,getRowThemeOverride:M,isFocused:S,drawHeaderCallback:de,prelightCells:te,drawCellCallback:re,highlightRegions:ge,resizeCol:Re,imageLoader:ie,lastBlitData:V,hoverValues:le,hyperWrapping:ce,hoverInfo:We,spriteManager:U,maxScaleFactor:Se,hasAppendRow:De,touchMode:be,enqueue:Ye,renderStateProvider:Je,getCellRenderer:it,renderStrategy:at,bufferACtx:He,bufferBCtx:Pe,damage:Te,minimumCellWidth:wt}=e;if(r===0||i===0)return;const ue=at==="double-buffer",se=Math.min(Se,Math.ceil(window.devicePixelRatio??1)),xe=at!=="direct"&&oc(e,t),Me=n.canvas;(Me.width!==r*se||Me.height!==i*se)&&(Me.width=r*se,Me.height=i*se,Me.style.width=r+"px",Me.style.height=i+"px");const Ie=o.canvas,pe=w?R+x:x,et=pe+1;(Ie.width!==r*se||Ie.height!==et*se)&&(Ie.width=r*se,Ie.height=et*se,Ie.style.width=r+"px",Ie.style.height=et+"px");const Ue=He.canvas,_e=Pe.canvas;ue&&(Ue.width!==r*se||Ue.height!==i*se)&&(Ue.width=r*se,Ue.height=i*se,V.current!==void 0&&(V.current.aBufferScroll=void 0)),ue&&(_e.width!==r*se||_e.height!==i*se)&&(_e.width=r*se,_e.height=i*se,V.current!==void 0&&(V.current.bBufferScroll=void 0));const j=V.current;if(xe===!0&&a===(j==null?void 0:j.cellXOffset)&&s===(j==null?void 0:j.cellYOffset)&&d===(j==null?void 0:j.translateX)&&f===(j==null?void 0:j.translateY))return;let Fe=null;ue&&(Fe=n);const Be=o;let ke;ue?Te!==void 0?ke=(j==null?void 0:j.lastBuffer)==="b"?Pe:He:ke=(j==null?void 0:j.lastBuffer)==="b"?He:Pe:ke=n;const St=ke.canvas,Ve=ue?St===Ue?_e:Ue:Me,$e=typeof v=="number"?()=>v:v;Be.save(),ke.save(),Be.beginPath(),ke.beginPath(),Be.textBaseline="middle",ke.textBaseline="middle",se!==1&&(Be.scale(se,se),ke.scale(se,se));const Ge=ai(u,a,r,g,d);let yt=[];const Mt=y&&((Ne=H.current)==null?void 0:Ne.cell[1])===s&&f===0;let en=!1;if(ge!==void 0){for(const qe of ge)if(qe.style!=="no-outline"&&qe.range.y===s&&f===0){en=!0;break}}const Kt=()=>{ja(Be,Ge,w,We,r,d,x,R,g,O,H,h,U,le,z,D,Te,de,be),Zi(Be,Ge,s,d,f,r,i,void 0,void 0,R,pe,$e,M,z,E,$,h,!0),Be.beginPath(),Be.moveTo(0,et-.5),Be.lineTo(r,et-.5),Be.strokeStyle=Jt(h.headerBottomBorderColor??h.horizontalBorderColor??h.borderColor,h.bgHeader),Be.stroke(),en&&Ji(Be,r,i,a,s,d,f,u,m,x,R,v,E,$,ge,h),Mt&&ei(Be,r,i,s,d,f,Ge,u,h,pe,H,$e,B,E,De,X,$)};if(Te!==void 0){const qe=Ge[Ge.length-1].sourceIndex+1,Ft=Te.hasItemInRegion([{x:a,y:-2,width:qe,height:2},{x:a,y:s,width:qe,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:a,y:$-E,width:qe,height:E,when:E>0}]),Ht=bt=>{qi(bt,Ge,u,i,pe,d,f,s,$,$e,B,D,M,C,S,y,E,De,yt,Te,H,te,ge,ie,U,le,We,re,ce,h,Ye,Je,it,P,wt);const It=H.current;X&&y&&It!==void 0&&Te.has(Cl(It.range))&&ei(bt,r,i,s,d,f,Ge,u,h,pe,H,$e,B,E,De,X,$)};Ft&&(Ht(ke),Fe!==null&&(Fe.save(),Fe.scale(se,se),Fe.textBaseline="middle",Ht(Fe),Fe.restore()),Te.hasHeader()&&(rc(Be,Ge,r,R,pe,d,f,s,Te),Kt())),ke.restore(),Be.restore();return}if((xe!==!0||a!==(j==null?void 0:j.cellXOffset)||d!==(j==null?void 0:j.translateX)||Mt!==(j==null?void 0:j.mustDrawFocusOnHeader)||en!==(j==null?void 0:j.mustDrawHighlightRingsOnHeader))&&Kt(),xe===!0){Zt(Ve!==void 0&&j!==void 0);const{regions:qe}=tc(ke,Ve,Ve===Ue?j.aBufferScroll:j.bBufferScroll,Ve===Ue?j.bBufferScroll:j.aBufferScroll,j,a,s,d,f,E,r,i,$,pe,se,u,Ge,v,ue);yt=qe}else xe!==!1&&(Zt(j!==void 0),yt=nc(j,a,s,d,f,r,i,pe,Ge,xe));Qa(ke,Ge,r,i,E,$,z,$e,h);const ut=Ji(ke,r,i,a,s,d,f,u,m,x,R,v,E,$,ge,h),Ot=y?ei(ke,r,i,s,d,f,Ge,u,h,pe,H,$e,B,E,De,X,$):void 0;if(ke.fillStyle=h.bgCell,yt.length>0){ke.beginPath();for(const qe of yt)ke.rect(qe.x,qe.y,qe.width,qe.height);ke.clip(),ke.fill(),ke.beginPath()}else ke.fillRect(0,0,r,i);const Wt=qi(ke,Ge,u,i,pe,d,f,s,$,$e,B,D,M,C,S,y,E,De,yt,Te,H,te,ge,ie,U,le,We,re,ce,h,Ye,Je,it,P,wt);Ja(ke,Ge,u,r,i,pe,d,f,s,$,$e,M,H.rows,C,E,De,yt,Te,h),ec(ke,Ge,s,d,f,r,i,yt,pe,$e,M,z,E,$,h),Zi(ke,Ge,s,d,f,r,i,yt,Wt,R,pe,$e,M,z,E,$,h),ut==null||ut(),Ot==null||Ot(),O&&Yn(Ge,0,d,0,pe,(qe,Ft)=>qe.sourceIndex===Re?(Qi(Be,Ft+qe.width,0,pe+1,Jt(h.resizeIndicatorColor??h.accentLight,h.bgHeader)),Qi(ke,Ft+qe.width,pe,i,Jt(h.resizeIndicatorColor??h.accentLight,h.bgCell)),!0):!1),Fe!==null&&(Fe.fillStyle=h.bgCell,Fe.fillRect(0,0,r,i),Fe.drawImage(ke.canvas,0,0));const Sn=ic(Ge,i,pe,d,f,s,$,$e,E,De);ie==null||ie.setWindow({x:a,y:s,width:Ge.length,height:Sn-s},m,Array.from({length:E},(qe,Ft)=>$-1-Ft));const Mn=j!==void 0&&(a!==j.cellXOffset||d!==j.translateX),ct=j!==void 0&&(s!==j.cellYOffset||f!==j.translateY);V.current={cellXOffset:a,cellYOffset:s,translateX:d,translateY:f,mustDrawFocusOnHeader:Mt,mustDrawHighlightRingsOnHeader:en,lastBuffer:ue?St===Ue?"a":"b":void 0,aBufferScroll:St===Ue?[Mn,ct]:j==null?void 0:j.aBufferScroll,bBufferScroll:St===_e?[Mn,ct]:j==null?void 0:j.bBufferScroll},ke.restore(),Be.restore()}const lc=80;function sc(e){const t=e-1;return t*t*t+1}class ac{constructor(t){Oe(this,"callback");Oe(this,"currentHoveredItem");Oe(this,"leavingItems",[]);Oe(this,"lastAnimationTime");Oe(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>Xo(o.item,t.item))||this.leavingItems.push(t)});Oe(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>Xo(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:sc(t.hoverAmount)})));Oe(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/lc;for(const i of this.leavingItems)i.hoverAmount=mn(i.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=mn(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(!Xo((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 cc{constructor(t){Oe(this,"fn");Oe(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function pi(e){return new cc(e)}const dc=pi(()=>window.navigator.userAgent.includes("Firefox")),Mr=pi(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),Rr=pi(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function uc(e){const t=l.useRef([]),n=l.useRef(0),o=l.useRef(e);o.current=e;const r=l.useCallback(()=>{const i=()=>window.requestAnimationFrame(a),a=()=>{const s=t.current.map(yi);t.current=[],o.current(new Ko(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:a)},[]);return l.useCallback(i=>{t.current.length===0&&r();const a=wn(i[0],i[1]);t.current.includes(a)||t.current.push(a)},[r])}const $n="header",jt="group-header",Er="out-of-bounds";var xo;(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"})(xo||(xo={}));function Xl(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 tl=6,fc=(e,t)=>{if(e.kind===Z.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},hc=(e,t)=>{const{width:n,height:o,accessibilityHeight:r,columns:i,cellXOffset:a,cellYOffset:s,headerHeight:d,fillHandle:f=!1,groupHeaderHeight:u,rowHeight:w,rows:m,getCellContent:g,getRowThemeOverride:h,onHeaderMenuClick:y,enableGroups:x,isFilling:R,onCanvasFocused:C,onCanvasBlur:v,isFocused:z,selection:P,freezeColumns:O,onContextMenu:H,freezeTrailingRows:X,fixedShadowX:E=!0,fixedShadowY:$=!0,drawFocusRing:B,onMouseDown:D,onMouseUp:M,onMouseMoveRaw:S,onMouseMove:de,onItemHovered:te,dragAndDropState:re,firstColAccessible:ge,onKeyDown:Re,onKeyUp:ie,highlightRegions:V,canvasRef:le,onDragStart:ce,onDragEnd:We,eventTargetRef:U,isResizing:Se,resizeColumn:De,isDragging:be,isDraggable:Ye=!1,allowResize:Je,disabledRows:it,hasAppendRow:at,getGroupDetails:He,theme:Pe,prelightCells:Te,headerIcons:wt,verticalBorder:ue,drawCell:se,drawHeader:xe,onCellFocused:Me,onDragOverCell:Ie,onDrop:pe,onDragLeave:et,imageWindowLoader:Ue,smoothScrollX:_e=!1,smoothScrollY:j=!1,experimental:Fe,getCellRenderer:Be}=e,ke=e.translateX??0,St=e.translateY??0,Ve=Math.max(O,Math.min(i.length-1,a)),$e=l.useRef(null),Ge=Ue,yt=l.useRef(),[Mt,en]=l.useState(!1),Kt=l.useRef([]),ut=l.useRef(),[Ot,Wt]=l.useState(),[Sn,Mn]=l.useState(),ct=l.useRef(null),[Ne,qe]=l.useState(),[Ft,Ht]=l.useState(!1),bt=l.useRef(Ft);bt.current=Ft;const It=l.useMemo(()=>new Ya(wt,()=>{yn.current=void 0,Kn.current()}),[wt]),sn=x?u+d:d,Ke=l.useRef(-1),ft=((Fe==null?void 0:Fe.enableFirefoxRescaling)??!1)&&dc.value,ot=((Fe==null?void 0:Fe.enableSafariRescaling)??!1)&&Mr.value;l.useLayoutEffect(()=>{window.devicePixelRatio===1||!ft&&!ot||(Ke.current!==-1&&en(!0),window.clearTimeout(Ke.current),Ke.current=window.setTimeout(()=>{en(!1),Ke.current=-1},200))},[s,Ve,ke,St,ft,ot]);const rt=Gs(i,O),Tt=E?Mo(rt,re):0,dt=l.useCallback((k,K,J)=>{const q=k.getBoundingClientRect();if(K>=rt.length||J>=m)return;const G=q.width/n,oe=ci(K,J,n,o,u,sn,Ve,s,ke,St,m,O,X,rt,w);return G!==1&&(oe.x*=G,oe.y*=G,oe.width*=G,oe.height*=G),oe.x+=q.x,oe.y+=q.y,oe},[n,o,u,sn,Ve,s,ke,St,m,O,X,rt,w]),Dt=l.useCallback((k,K,J,q)=>{const G=k.getBoundingClientRect(),oe=G.width/n,ve=(K-G.left)/oe,Ce=(J-G.top)/oe,ne=5,Qe=ai(rt,Ve,n,void 0,ke);let fe=0,tt=0;q instanceof MouseEvent&&(fe=q.button,tt=q.buttons);const Ee=Js(ve,Qe,ke),Xe=Qs(Ce,o,x,d,u,m,w,s,St,X),vt=(q==null?void 0:q.shiftKey)===!0,Ae=(q==null?void 0:q.ctrlKey)===!0,pt=(q==null?void 0:q.metaKey)===!0,nn=q!==void 0&&!(q instanceof MouseEvent)||(q==null?void 0:q.pointerType)==="touch",mt=[ve<0?-1:nn||Ce>o){const Ze=ve>n?1:ve<0?-1:0,Ct=Ce>o?1:Ce<0?-1:0;let Gt=Ze*2,bn=Ct*2;Ze===0&&(Gt=Ee===-1?xo.EndPadding:xo.Center),Ct===0&&(bn=Xe===void 0?xo.EndPadding:xo.Center);let un=!1;if(Ee===-1&&Xe===-1){const _n=dt(k,rt.length-1,-1);Zt(_n!==void 0),un=K<_n.x+_n.width+ne}const uo=ve>n&&veo&&Ce=0?(Ct=!0,Ze=dt(k,Gt,Xe),Zt(Ze!==void 0),Vt={kind:x&&Xe===-2?jt:$n,location:[Gt,Xe],bounds:Ze,group:rt[Gt].group??"",isEdge:Ct,shiftKey:vt,ctrlKey:Ae,metaKey:pt,isTouch:nn,localEventX:K-Ze.x,localEventY:J-Ze.y,button:fe,buttons:tt,scrollEdge:mt}):Vt={kind:x&&Xe===-2?jt:$n,group:rt[Ee].group??"",location:[Ee,Xe],bounds:Ze,isEdge:Ct,shiftKey:vt,ctrlKey:Ae,metaKey:pt,isTouch:nn,localEventX:K-Ze.x,localEventY:J-Ze.y,button:fe,buttons:tt,scrollEdge:mt}}else{const Ze=dt(k,Ee,Xe);Zt(Ze!==void 0);const Ct=Ze!==void 0&&Ze.x+Ze.width-K{}),Hn=l.useRef(Ot);Hn.current=Ot;const[Rn,En]=l.useMemo(()=>{const k=document.createElement("canvas"),K=document.createElement("canvas");return k.style.display="none",k.style.opacity="0",k.style.position="fixed",K.style.display="none",K.style.opacity="0",K.style.position="fixed",[k.getContext("2d",{alpha:!1}),K.getContext("2d",{alpha:!1})]},[]);l.useLayoutEffect(()=>{if(!(Rn===null||En===null))return document.documentElement.append(Rn.canvas),document.documentElement.append(En.canvas),()=>{Rn.canvas.remove(),En.canvas.remove()}},[Rn,En]);const eo=l.useMemo(()=>new ca,[]),jo=ft&&Mt?1:ot&&Mt?2:5,Zo=(Fe==null?void 0:Fe.disableMinimumCellWidth)===!0?1:10,yn=l.useRef(),to=l.useRef(null),no=l.useRef(null),oo=l.useCallback(()=>{var ve;const k=$e.current,K=ct.current;if(k===null||K===null||(to.current===null&&(to.current=k.getContext("2d",{alpha:!1}),k.width=0,k.height=0),no.current===null&&(no.current=K.getContext("2d",{alpha:!1}),K.width=0,K.height=0),to.current===null||no.current===null||Rn===null||En===null))return;let J=!1;const q=Ce=>{J=!0,qe(Ce)},G=yn.current,oe={headerCanvasCtx:no.current,canvasCtx:to.current,bufferACtx:Rn,bufferBCtx:En,width:n,height:o,cellXOffset:Ve,cellYOffset:s,translateX:Math.round(ke),translateY:Math.round(St),mappedColumns:rt,enableGroups:x,freezeColumns:O,dragAndDropState:re,theme:Pe,headerHeight:d,groupHeaderHeight:u,disabledRows:it??nt.empty(),rowHeight:w,verticalBorder:ue,isResizing:Se,resizeCol:De,isFocused:z,selection:P,fillHandle:f,drawCellCallback:se,hasAppendRow:at,overrideCursor:q,maxScaleFactor:jo,freezeTrailingRows:X,rows:m,drawFocus:B,getCellContent:g,getGroupDetails:He??(Ce=>({name:Ce})),getRowThemeOverride:h,drawHeaderCallback:xe,prelightCells:Te,highlightRegions:V,imageLoader:Ge,lastBlitData:ut,damage:yt.current,hoverValues:Kt.current,hoverInfo:Hn.current,spriteManager:It,scrolling:Mt,hyperWrapping:(Fe==null?void 0:Fe.hyperWrapping)??!1,touchMode:Ft,enqueue:qo.current,renderStateProvider:eo,renderStrategy:(Fe==null?void 0:Fe.renderStrategy)??(Mr.value?"double-buffer":"single-buffer"),getCellRenderer:Be,minimumCellWidth:Zo};oe.damage===void 0?(yn.current=oe,el(oe,G)):el(oe,void 0),!J&&(oe.damage===void 0||oe.damage.has((ve=Hn==null?void 0:Hn.current)==null?void 0:ve[0]))&&qe(void 0)},[Rn,En,n,o,Ve,s,ke,St,rt,x,O,re,Pe,d,u,it,w,ue,Se,at,De,z,P,f,X,m,B,jo,g,He,h,se,xe,Te,V,Ge,It,Mt,Fe==null?void 0:Fe.hyperWrapping,Fe==null?void 0:Fe.renderStrategy,Ft,eo,Be,Zo]),Kn=l.useRef(oo);l.useLayoutEffect(()=>{oo(),Kn.current=oo},[oo]),l.useLayoutEffect(()=>{(async()=>{var K;((K=document==null?void 0:document.fonts)==null?void 0:K.ready)!==void 0&&(await document.fonts.ready,yn.current=void 0,Kn.current())})()},[]);const Tn=l.useCallback(k=>{yt.current=k,Kn.current(),yt.current=void 0},[]),Jo=uc(Tn);qo.current=Jo;const Qo=l.useCallback(k=>{Tn(new Ko(k.map(K=>K.cell)))},[Tn]);Ge.setCallback(Tn);const[Hr,Tr]=l.useState(!1),[ro,Dn]=ht??[],Ar=ro!==void 0&&Dn===-1,Lr=ro!==void 0&&Dn===-2;let er=!1,io=!1,Rt=Ne;if(Rt===void 0&&ro!==void 0&&Dn!==void 0&&Dn>-1&&Dn({contain:"strict",display:"block",cursor:tr}),[tr]),Ro=l.useRef("default"),An=U==null?void 0:U.current;An!=null&&Ro.current!==lo.cursor&&(An.style.cursor=Ro.current=lo.cursor);const Ut=l.useCallback((k,K,J,q)=>{if(He===void 0)return;const G=He(k);if(G.actions!==void 0){const oe=Wl(K,G.actions);for(const[ve,Ce]of oe.entries())if(Fr(Ce,J+K.x,q+Ce.y))return G.actions[ve]}},[He]),an=l.useCallback((k,K,J,q)=>{const G=i[K];if(!be&&!Se&&G.hasMenu===!0&&!(Sn??!1)){const oe=dt(k,K,-1);Zt(oe!==void 0);const ve=Ol(oe.x,oe.y,oe.width,oe.height,gi(G.title)==="rtl");if(J>ve.x&&Jve.y&&q{const K=$e.current,J=U==null?void 0:U.current;if(K===null||k.target!==K&&k.target!==J)return;Do.current=!0;let q,G;if(k instanceof MouseEvent?(q=k.clientX,G=k.clientY):(q=k.touches[0].clientX,G=k.touches[0].clientY),k.target===J&&J!==null){const ve=J.getBoundingClientRect();if(q>ve.right||G>ve.bottom)return}const oe=Dt(K,q,G,k);Ln.current=oe.location,oe.isTouch&&(Eo.current=Date.now()),bt.current!==oe.isTouch&&Ht(oe.isTouch),!(oe.kind===$n&&an(K,oe.location[0],q,G)!==void 0)&&(oe.kind===jt&&Ut(oe.group,oe.bounds,oe.localEventX,oe.localEventY)!==void 0||(D==null||D(oe),!oe.isTouch&&Ye!==!0&&Ye!==oe.kind&&oe.button<3&&oe.button!==1&&k.preventDefault()))},[U,Ye,Dt,Ut,an,D]);At("touchstart",$t,window,!1),At("mousedown",$t,window,!1);const so=l.useRef(0),Io=l.useCallback(k=>{var tt,Ee;const K=so.current;so.current=Date.now();const J=$e.current;if(Do.current=!1,M===void 0||J===null)return;const q=U==null?void 0:U.current,G=k.target!==J&&k.target!==q;let oe,ve,Ce=!0;if(k instanceof MouseEvent){if(oe=k.clientX,ve=k.clientY,Ce=k.button<3,k.pointerType==="touch")return}else oe=k.changedTouches[0].clientX,ve=k.changedTouches[0].clientY;let ne=Dt(J,oe,ve,k);ne.isTouch&&Eo.current!==0&&Date.now()-Eo.current>500&&(ne={...ne,isLongTouch:!0}),K!==0&&Date.now()-K<(ne.isTouch?1e3:500)&&(ne={...ne,isDoubleClick:!0}),bt.current!==ne.isTouch&&Ht(ne.isTouch),!G&&k.cancelable&&Ce&&k.preventDefault();const[Qe]=ne.location,fe=an(J,Qe,oe,ve);if(ne.kind===$n&&fe!==void 0){(ne.button!==0||((tt=Ln.current)==null?void 0:tt[0])!==Qe||((Ee=Ln.current)==null?void 0:Ee[1])!==-1)&&M(ne,!0);return}else if(ne.kind===jt){const Xe=Ut(ne.group,ne.bounds,ne.localEventX,ne.localEventY);if(Xe!==void 0){ne.button===0&&Xe.onClick(ne);return}}M(ne,G)},[M,U,Dt,an,Ut]);At("mouseup",Io,window,!1),At("touchend",Io,window,!1);const nr=l.useCallback(k=>{var fe,tt;const K=$e.current;if(K===null)return;const J=U==null?void 0:U.current,q=k.target!==K&&k.target!==J;let G,oe,ve=!0;k instanceof MouseEvent?(G=k.clientX,oe=k.clientY,ve=k.button<3):(G=k.changedTouches[0].clientX,oe=k.changedTouches[0].clientY);const Ce=Dt(K,G,oe,k);bt.current!==Ce.isTouch&&Ht(Ce.isTouch),!q&&k.cancelable&&ve&&k.preventDefault();const[ne]=Ce.location,Qe=an(K,ne,G,oe);if(Ce.kind===$n&&Qe!==void 0)Ce.button===0&&((fe=Ln.current)==null?void 0:fe[0])===ne&&((tt=Ln.current)==null?void 0:tt[1])===-1&&(y==null||y(ne,Qe));else if(Ce.kind===jt){const Ee=Ut(Ce.group,Ce.bounds,Ce.localEventX,Ce.localEventY);Ee!==void 0&&Ce.button===0&&Ee.onClick(Ce)}},[U,Dt,an,y,Ut]);At("click",nr,window,!1);const zr=l.useCallback(k=>{const K=$e.current,J=U==null?void 0:U.current;if(K===null||k.target!==K&&k.target!==J||H===void 0)return;const q=Dt(K,k.clientX,k.clientY,k);H(q,()=>{k.cancelable&&k.preventDefault()})},[U,Dt,H]);At("contextmenu",zr,(U==null?void 0:U.current)??null,!1);const or=l.useCallback(k=>{yt.current=new Ko(k.map(K=>K.item)),Kt.current=k,Kn.current(),yt.current=void 0},[]),cn=l.useMemo(()=>new ac(or),[or]),In=l.useRef(cn);In.current=cn,l.useLayoutEffect(()=>{const k=In.current;if(ht===void 0||ht[1]<0){k.setHovered(ht);return}const K=g(ht,!0),J=Be(K),q=J===void 0&&K.kind===Z.Custom||(J==null?void 0:J.needsHover)!==void 0&&(typeof J.needsHover=="boolean"?J.needsHover:J.needsHover(K));k.setHovered(q?ht:void 0)},[g,Be,ht]);const _t=l.useRef(),T=l.useCallback(k=>{var Ce;const K=$e.current;if(K===null)return;const J=U==null?void 0:U.current,q=k.target!==K&&k.target!==J,G=Dt(K,k.clientX,k.clientY,k);if(G.kind!=="out-of-bounds"&&q&&!Do.current&&!G.isTouch)return;const oe=(ne,Qe)=>{Wt(fe=>fe===ne||(fe==null?void 0:fe[0][0])===(ne==null?void 0:ne[0][0])&&(fe==null?void 0:fe[0][1])===(ne==null?void 0:ne[0][1])&&((fe==null?void 0:fe[1][0])===(ne==null?void 0:ne[1][0])&&(fe==null?void 0:fe[1][1])===(ne==null?void 0:ne[1][1])||!Qe)?fe:ne)};if(!Xl(G,_t.current))qe(void 0),te==null||te(G),oe(G.kind===Er?void 0:[G.location,[G.localEventX,G.localEventY]],!0),_t.current=G;else if(G.kind==="cell"||G.kind===$n||G.kind===jt){let ne=!1,Qe=!0;if(G.kind==="cell"){const tt=g(G.location);Qe=((Ce=Be(tt))==null?void 0:Ce.needsHoverPosition)??tt.kind===Z.Custom,ne=Qe}else G.kind===jt&&(ne=!0);const fe=[G.location,[G.localEventX,G.localEventY]];oe(fe,Qe),Hn.current=fe,ne&&Tn(new Ko([G.location]))}const ve=G.location[0]>=(ge?0:1);Mn(G.kind===$n&&G.isEdge&&ve&&Je===!0),Tr(G.kind==="cell"&&G.isFillHandle),S==null||S(k),de(G)},[U,Dt,ge,Je,S,de,te,g,Be,Tn]);At("mousemove",T,window,!0);const gt=l.useCallback(k=>{const K=$e.current;if(K===null)return;let J,q;P.current!==void 0&&(J=dt(K,P.current.cell[0],P.current.cell[1]),q=P.current.cell),Re==null||Re({bounds:J,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:q})},[Re,P,dt]),Un=l.useCallback(k=>{const K=$e.current;if(K===null)return;let J,q;P.current!==void 0&&(J=dt(K,P.current.cell[0],P.current.cell[1]),q=P.current.cell),ie==null||ie({bounds:J,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:q})},[ie,P,dt]),Pr=l.useCallback(k=>{$e.current=k,le!==void 0&&(le.current=k)},[le]),rr=l.useCallback(k=>{const K=$e.current;if(K===null||Ye===!1||Se){k.preventDefault();return}let J,q;const G=Dt(K,k.clientX,k.clientY);if(Ye!==!0&&G.kind!==Ye){k.preventDefault();return}const oe=(tt,Ee)=>{J=tt,q=Ee};let ve,Ce,ne;const Qe=(tt,Ee,Xe)=>{ve=tt,Ce=Ee,ne=Xe};let fe=!1;if(ce==null||ce({...G,setData:oe,setDragImage:Qe,preventDefault:()=>fe=!0,defaultPrevented:()=>fe}),!fe&&J!==void 0&&q!==void 0&&k.dataTransfer!==null)if(k.dataTransfer.setData(J,q),k.dataTransfer.effectAllowed="copyLink",ve!==void 0&&Ce!==void 0&&ne!==void 0)k.dataTransfer.setDragImage(ve,Ce,ne);else{const[tt,Ee]=G.location;if(Ee!==void 0){const Xe=document.createElement("canvas"),vt=dt(K,tt,Ee);Zt(vt!==void 0);const Ae=Math.ceil(window.devicePixelRatio??1);Xe.width=vt.width*Ae,Xe.height=vt.height*Ae;const pt=Xe.getContext("2d");pt!==null&&(pt.scale(Ae,Ae),pt.textBaseline="middle",Ee===-1?(pt.font=Pe.headerFontFull,pt.fillStyle=Pe.bgHeader,pt.fillRect(0,0,Xe.width,Xe.height),$l(pt,0,0,vt.width,vt.height,rt[tt],!1,Pe,!1,!1,0,It,xe,!1)):(pt.font=Pe.baseFontFull,pt.fillStyle=Pe.bgCell,pt.fillRect(0,0,Xe.width,Xe.height),Bl(pt,g([tt,Ee]),0,Ee,!1,!1,0,0,vt.width,vt.height,!1,Pe,Pe.bgCell,Ge,It,1,void 0,!1,0,void 0,void 0,void 0,eo,Be,()=>{}))),Xe.style.left="-100%",Xe.style.position="absolute",Xe.style.width=`${vt.width}px`,Xe.style.height=`${vt.height}px`,document.body.append(Xe),k.dataTransfer.setDragImage(Xe,vt.width/2,vt.height/2),window.setTimeout(()=>{Xe.remove()},0)}}else k.preventDefault()},[Ye,Se,Dt,ce,dt,Pe,rt,It,xe,g,Ge,eo,Be]);At("dragstart",rr,(U==null?void 0:U.current)??null,!1,!1);const Fo=l.useRef(),Br=l.useCallback(k=>{const K=$e.current;if(pe!==void 0&&k.preventDefault(),K===null||Ie===void 0)return;const J=Dt(K,k.clientX,k.clientY),[q,G]=J.location,oe=q-(ge?0:1),[ve,Ce]=Fo.current??[];(ve!==oe||Ce!==G)&&(Fo.current=[oe,G],Ie([oe,G],k.dataTransfer))},[ge,Dt,Ie,pe]);At("dragover",Br,(U==null?void 0:U.current)??null,!1,!1);const vi=l.useCallback(()=>{Fo.current=void 0,We==null||We()},[We]);At("dragend",vi,(U==null?void 0:U.current)??null,!1,!1);const L=l.useCallback(k=>{const K=$e.current;if(K===null||pe===void 0)return;k.preventDefault();const J=Dt(K,k.clientX,k.clientY),[q,G]=J.location,oe=q-(ge?0:1);pe([oe,G],k.dataTransfer)},[ge,Dt,pe]);At("drop",L,(U==null?void 0:U.current)??null,!1,!1);const Lt=l.useCallback(()=>{et==null||et()},[et]);At("dragleave",Lt,(U==null?void 0:U.current)??null,!1,!1);const Et=l.useRef(P);Et.current=P;const ao=l.useRef(null),Ho=l.useCallback(k=>{var K;$e.current===null||!$e.current.contains(document.activeElement)||(k===null&&Et.current.current!==void 0?(K=le==null?void 0:le.current)==null||K.focus({preventScroll:!0}):k!==null&&k.focus({preventScroll:!0}),ao.current=k)},[le]);l.useImperativeHandle(t,()=>({focus:()=>{var K;const k=ao.current;k===null||!document.contains(k)?(K=le==null?void 0:le.current)==null||K.focus({preventScroll:!0}):k.focus({preventScroll:!0})},getBounds:(k,K)=>{if(!(le===void 0||le.current===null))return dt(le.current,k??0,K??-1)},damage:Qo}),[le,Qo,dt]);const zn=l.useRef(),Xt=zs(()=>{var Ce,ne,Qe;if(n<50||(Fe==null?void 0:Fe.disableAccessibilityTree)===!0)return null;let k=ai(rt,Ve,n,re,ke);const K=ge?0:-1;!ge&&((Ce=k[0])==null?void 0:Ce.sourceIndex)===0&&(k=k.slice(1));const[J,q]=((ne=P.current)==null?void 0:ne.cell)??[],G=(Qe=P.current)==null?void 0:Qe.range,oe=k.map(fe=>fe.sourceIndex),ve=Zn(s,Math.min(m,s+r));return J!==void 0&&q!==void 0&&!(oe.includes(J)&&ve.includes(q))&&Ho(null),l.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":rt.length+K},l.createElement("thead",{role:"rowgroup"},l.createElement("tr",{role:"row","aria-rowindex":1},k.map(fe=>l.createElement("th",{role:"columnheader","aria-selected":P.columns.hasIndex(fe.sourceIndex),"aria-colindex":fe.sourceIndex+1+K,tabIndex:-1,onFocus:tt=>{if(tt.target!==ao.current)return Me==null?void 0:Me([fe.sourceIndex,-1])},key:fe.sourceIndex},fe.title)))),l.createElement("tbody",{role:"rowgroup"},ve.map(fe=>l.createElement("tr",{role:"row","aria-selected":P.rows.hasIndex(fe),key:fe,"aria-rowindex":fe+2},k.map(tt=>{const Ee=tt.sourceIndex,Xe=wn(Ee,fe),vt=J===Ee&&q===fe,Ae=G!==void 0&&Ee>=G.x&&Ee=G.y&&fe{const Vt=le==null?void 0:le.current;if(Vt!=null)return Re==null?void 0:Re({bounds:dt(Vt,Ee,fe),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:nn})},onFocusCapture:Vt=>{var Ze,Ct;if(!(Vt.target===ao.current||((Ze=zn.current)==null?void 0:Ze[0])===Ee&&((Ct=zn.current)==null?void 0:Ct[1])===fe))return zn.current=nn,Me==null?void 0:Me(nn)},ref:vt?Ho:void 0,tabIndex:-1},fc(mt,Be))})))))},[n,rt,Ve,re,ke,m,s,r,P,Ho,g,le,Re,dt,Me],200),dn=O===0||!E?0:Ve>O?1:mn(-ke/100,0,1),Or=-s*32+St,co=$?mn(-Or/100,0,1):0,Wr=l.useMemo(()=>{if(!dn&&!co)return null;const k={position:"absolute",top:0,left:Tt,width:n-Tt,height:o,opacity:dn,pointerEvents:"none",transition:_e?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},K={position:"absolute",top:sn,left:0,width:n,height:o,opacity:co,pointerEvents:"none",transition:j?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return l.createElement(l.Fragment,null,dn>0&&l.createElement("div",{id:"shadow-x",style:k}),co>0&&l.createElement("div",{id:"shadow-y",style:K}))},[dn,co,Tt,n,_e,sn,o,j]),$r=l.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return l.createElement(l.Fragment,null,l.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:gt,onKeyUp:Un,onFocus:C,onBlur:v,ref:Pr,style:lo},Xt),l.createElement("canvas",{ref:ct,style:$r}),Wr)},gc=l.memo(l.forwardRef(hc));function $o(e,t,n,o){return mn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(o))}const mc=e=>{const[t,n]=l.useState(),[o,r]=l.useState(),[i,a]=l.useState(),[s,d]=l.useState(),[f,u]=l.useState(!1),[w,m]=l.useState(),[g,h]=l.useState(),[y,x]=l.useState(),[R,C]=l.useState(!1),[v,z]=l.useState(),{onHeaderMenuClick:P,getCellContent:O,onColumnMoved:H,onColumnResize:X,onColumnResizeStart:E,onColumnResizeEnd:$,gridRef:B,maxColumnWidth:D,minColumnWidth:M,onRowMoved:S,lockColumns:de,onColumnProposeMove:te,onMouseDown:re,onMouseUp:ge,onItemHovered:Re,onDragStart:ie,canvasRef:V}=e,le=(X??$??E)!==void 0,{columns:ce,selection:We}=e,U=We.columns,Se=l.useCallback(ue=>{const[se,xe]=ue.location;i!==void 0&&s!==se&&se>=de?(u(!0),d(se)):g!==void 0&&xe!==void 0?(C(!0),x(Math.max(0,xe))):o===void 0&&!f&&!R&&(Re==null||Re(ue))},[i,g,s,Re,de,o,f,R]),De=H!==void 0,be=l.useCallback(ue=>{var se;if(ue.button===0){const[xe,Me]=ue.location;if(ue.kind==="out-of-bounds"&&ue.isEdge&&le){const Ie=(se=B==null?void 0:B.current)==null?void 0:se.getBounds(ce.length-1,-1);Ie!==void 0&&(n(Ie.x),r(ce.length-1))}else if(ue.kind==="header"&&xe>=de){const Ie=V==null?void 0:V.current;if(ue.isEdge&&le&&Ie){n(ue.bounds.x),r(xe);const et=Ie.getBoundingClientRect().width/Ie.offsetWidth,Ue=ue.bounds.width/et;E==null||E(ce[xe],Ue,xe,Ue+(ce[xe].growOffset??0))}else ue.kind==="header"&&De&&(m(ue.bounds.x),a(xe))}else ue.kind==="cell"&&de>0&&xe===0&&Me!==void 0&&S!==void 0&&(z(ue.bounds.y),h(Me))}re==null||re(ue)},[re,le,de,S,B,ce,De,E,V]),Ye=l.useCallback((ue,se)=>{f||R||P==null||P(ue,se)},[f,R,P]),Je=l.useRef(-1),it=l.useCallback(()=>{Je.current=-1,h(void 0),x(void 0),z(void 0),C(!1),a(void 0),d(void 0),m(void 0),u(!1),r(void 0),n(void 0)},[]),at=l.useCallback((ue,se)=>{if(ue.button===0){if(o!==void 0){if((U==null?void 0:U.hasIndex(o))===!0)for(const Me of U){if(Me===o)continue;const Ie=ce[Me],pe=$o(Ie,Je.current,M,D);X==null||X(Ie,pe,Me,pe+(Ie.growOffset??0))}const xe=$o(ce[o],Je.current,M,D);if($==null||$(ce[o],xe,o,xe+(ce[o].growOffset??0)),U.hasIndex(o))for(const Me of U){if(Me===o)continue;const Ie=ce[Me],pe=$o(Ie,Je.current,M,D);$==null||$(Ie,pe,Me,pe+(Ie.growOffset??0))}}it(),i!==void 0&&s!==void 0&&(H==null||H(i,s)),g!==void 0&&y!==void 0&&(S==null||S(g,y))}ge==null||ge(ue,se)},[ge,o,i,s,g,y,U,$,ce,M,D,X,H,S,it]),He=l.useMemo(()=>{if(!(i===void 0||s===void 0)&&i!==s&&(te==null?void 0:te(i,s))!==!1)return{src:i,dest:s}},[i,s,te]),Pe=l.useCallback(ue=>{const se=V==null?void 0:V.current;if(i!==void 0&&w!==void 0)Math.abs(ue.clientX-w)>20&&u(!0);else if(g!==void 0&&v!==void 0)Math.abs(ue.clientY-v)>20&&C(!0);else if(o!==void 0&&t!==void 0&&se){const Me=se.getBoundingClientRect().width/se.offsetWidth,Ie=(ue.clientX-t)/Me,pe=ce[o],et=$o(pe,Ie,M,D);if(X==null||X(pe,et,o,et+(pe.growOffset??0)),Je.current=Ie,(U==null?void 0:U.first())===o)for(const Ue of U){if(Ue===o)continue;const _e=ce[Ue],j=$o(_e,Je.current,M,D);X==null||X(_e,j,Ue,j+(_e.growOffset??0))}}},[i,w,g,v,o,t,ce,M,D,X,U,V]),Te=l.useCallback((ue,se)=>{if(g===void 0||y===void 0)return O(ue,se);let[xe,Me]=ue;return Me===y?Me=g:(Me>y&&(Me-=1),Me>=g&&(Me+=1)),O([xe,Me],se)},[g,y,O]),wt=l.useCallback(ue=>{ie==null||ie(ue),ue.defaultPrevented()||it()},[it,ie]);return l.createElement(gc,{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,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Te,isResizing:o!==void 0,onHeaderMenuClick:Ye,isDragging:f,onItemHovered:Se,onDragStart:wt,onMouseDown:be,allowResize:le,onMouseUp:at,dragAndDropState:He,onMouseMoveRaw:Pe,ref:B})},wc=mc;function yc(e){const t=l.useRef(null),[n,o]=l.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return l.useLayoutEffect(()=>{const r=a=>{for(const s of a){const{width:d,height:f}=s&&s.contentRect||{};o(u=>u.width===d&&u.height===f?u:{width:d,height:f})}},i=new window.ResizeObserver(r);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const bc=(e,t,n)=>{const o=l.useRef(null),r=l.useRef(null),i=l.useRef(null),a=l.useRef(0),s=l.useRef(t);s.current=t;const d=n.current;l.useEffect(()=>{const f=()=>{var m,g;if(r.current===!1&&d!==null){const h=[d.scrollLeft,d.scrollTop];if(((m=i.current)==null?void 0:m[0])===h[0]&&((g=i.current)==null?void 0:g[1])===h[1])if(a.current>10){i.current=null,r.current=null;return}else a.current++;else a.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)},w=m=>{m.touches.length===0&&(r.current=!1,a.current=0,o.current=window.setTimeout(f,8.333333333333334))};if(e&&d!==null){const m=d;return m.addEventListener("touchstart",u),m.addEventListener("touchend",w),()=>{m.removeEventListener("touchstart",u),m.removeEventListener("touchend",w),o.current!==null&&window.clearTimeout(o.current)}}},[e,d])},pc=bc,vc=()=>e=>e.isSafari?"scroll":"auto",Cc=Qt("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[vc()]}});function xc(e){const[t,n]=l.useState(!1),o=typeof window>"u"?null:window,r=l.useRef(0);return At("touchstart",l.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),o,!0,!1),At("touchend",l.useCallback(i=>{i.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),o,!0,!1),t}const kc=e=>{var ce,We;const{children:t,clientHeight:n,scrollHeight:o,scrollWidth:r,update:i,draggable:a,className:s,preventDiagonalScrolling:d=!1,paddingBottom:f=0,paddingRight:u=0,rightElement:w,rightElementProps:m,kineticScrollPerfHack:g=!1,scrollRef:h,initialSize:y}=e,x=[],R=(m==null?void 0:m.sticky)??!1,C=(m==null?void 0:m.fill)??!1,v=l.useRef(0),z=l.useRef(0),P=l.useRef(null),O=typeof window>"u"?1:window.devicePixelRatio,H=l.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),X=l.useRef(null),E=xc(200),[$,B]=l.useState(!0),D=l.useRef(0);l.useLayoutEffect(()=>{if(!$||E||H.current.lockDirection===void 0)return;const U=P.current;if(U===null)return;const[Se,De]=H.current.lockDirection;Se!==void 0?U.scrollLeft=Se:De!==void 0&&(U.scrollTop=De),H.current.lockDirection=void 0},[E,$]);const M=l.useCallback((U,Se)=>{var se;const De=P.current;if(De===null)return;Se=Se??De.scrollTop,U=U??De.scrollLeft;const be=H.current.scrollTop,Ye=H.current.scrollLeft,Je=U-Ye,it=Se-be;E&&Je!==0&&it!==0&&(Math.abs(Je)>3||Math.abs(it)>3)&&d&&H.current.lockDirection===void 0&&(H.current.lockDirection=Math.abs(Je)0&&(Math.abs(wt)>2e3||Te===0||Te===ue)&&o>De.scrollHeight+5){const xe=Te/ue,Me=(o-Pe)*xe;v.current=Me-Te}at!==void 0&&(window.clearTimeout(D.current),B(!1),D.current=window.setTimeout(()=>B(!0),200)),i({x:U,y:Te+v.current,width:He-u,height:Pe-f,paddingRight:((se=X.current)==null?void 0:se.clientWidth)??0})},[f,u,o,i,d,E]);pc(g&&Mr.value,M,P);const S=l.useRef(M);S.current=M;const de=l.useRef(),te=l.useRef(!1);l.useLayoutEffect(()=>{te.current?M():te.current=!0},[M,f,u]);const re=l.useCallback(U=>{P.current=U,h!==void 0&&(h.current=U)},[h]);let ge=0,Re=0;for(x.push(l.createElement("div",{key:ge++,style:{width:r,height:0}}));ReS.current(),0),de.current={width:V,height:le}),(V??0)===0||(le??0)===0?l.createElement("div",{ref:ie}):l.createElement("div",{ref:ie},l.createElement(Cc,{isSafari:Mr.value},l.createElement("div",{className:"dvn-underlay"},t),l.createElement("div",{ref:re,style:de.current,draggable:a,onDragStart:U=>{a||(U.stopPropagation(),U.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>M()},l.createElement("div",{className:"dvn-scroll-inner"+(w===void 0?" dvn-hidden":"")},l.createElement("div",{className:"dvn-stack"},x),w!==void 0&&l.createElement(l.Fragment,null,!C&&l.createElement("div",{className:"dvn-spacer"}),l.createElement("div",{ref:X,style:{height:le,maxHeight:n-Math.ceil(O%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:C?1:void 0,right:R?u??0:void 0,pointerEvents:"auto"}},w))))))},Sc=e=>{const{columns:t,rows:n,rowHeight:o,headerHeight:r,groupHeaderHeight:i,enableGroups:a,freezeColumns:s,experimental:d,nonGrowWidth:f,clientSize:u,className:w,onVisibleRegionChanged:m,scrollRef:g,preventDiagonalScrolling:h,rightElement:y,rightElementProps:x,overscrollX:R,overscrollY:C,initialSize:v,smoothScrollX:z=!1,smoothScrollY:P=!1,isDraggable:O}=e,{paddingRight:H,paddingBottom:X}=d??{},[E,$]=u,B=l.useRef(),D=l.useRef(),M=l.useRef(),S=l.useRef(),de=f+Math.max(0,R??0);let te=a?r+i:r;if(typeof o=="number")te+=n*o;else for(let ie=0;ie{var it,at;if(re.current===void 0)return;const ie={...re.current};let V=0,le=ie.x<0?-ie.x:0,ce=0,We=0;ie.x=ie.x<0?0:ie.x;let U=0;for(let He=0;He=Pe+He.width)V+=He.width,We++,ce++;else if(ie.x>Pe)V+=He.width,z?le+=Pe-ie.x:We++,ce++;else if(ie.x+ie.width>Pe)V+=He.width,ce++;else break}let Se=0,De=0,be=0;if(typeof o=="number")P?(De=Math.floor(ie.y/o),Se=De*o-ie.y):De=Math.ceil(ie.y/o),be=Math.ceil(ie.height/o)+De,Se<0&&be++;else{let He=0;for(let Pe=0;Pe=He+Te)He+=Te,De++,be++;else if(ie.y>wt)He+=Te,P?Se+=wt-ie.y:De++,be++;else if(ie.y+ie.height>Te/2+He)He+=Te,be++;else break}}const Ye={x:We,y:De,width:ce-We,height:be-De},Je=B.current;(Je===void 0||Je.y!==Ye.y||Je.x!==Ye.x||Je.height!==Ye.height||Je.width!==Ye.width||D.current!==le||M.current!==Se||ie.width!==((it=S.current)==null?void 0:it[0])||ie.height!==((at=S.current)==null?void 0:at[1]))&&(m==null||m({x:We,y:De,width:ce-We,height:be-De},ie.width,ie.height,ie.paddingRight??0,le,Se),B.current=Ye,D.current=le,M.current=Se,S.current=[ie.width,ie.height])},[t,o,n,m,s,z,P]),Re=l.useCallback(ie=>{re.current=ie,ge()},[ge]);return l.useEffect(()=>{ge()},[ge]),l.createElement(kc,{scrollRef:g,className:w,kineticScrollPerfHack:d==null?void 0:d.kineticScrollPerfHack,preventDiagonalScrolling:h,draggable:O===!0||typeof O=="string",scrollWidth:de+(H??0),scrollHeight:te+(X??0),clientHeight:$,rightElement:y,paddingBottom:X,paddingRight:H,rightElementProps:x,update:Re,initialSize:v},l.createElement(wc,{eventTargetRef:g,width:E,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,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}))},Mc=Sc,Rc=Qt("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),Ec=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Dc=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),Ic=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),Fc=10,Hc=e=>{const{canvasRef:t,cellYOffset:n,rows:o,columns:r,searchInputRef:i,searchValue:a,searchResults:s,onSearchValueChange:d,getCellsForSelection:f,onSearchResultsChanged:u,showSearch:w=!1,onSearchClose:m}=e,[g]=l.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[h,y]=l.useState(""),x=a??h,R=l.useCallback(V=>{y(V),d==null||d(V)},[d]),[C,v]=l.useState(),z=l.useRef(C);z.current=C,l.useEffect(()=>{s!==void 0&&(s.length>0?v(V=>({rowsSearched:o,results:s.length,selectedIndex:(V==null?void 0:V.selectedIndex)??-1})):v(void 0))},[o,s]);const P=l.useRef();P.current===void 0&&(P.current=new AbortController);const O=l.useRef(),[H,X]=l.useState([]),E=s??H,$=l.useCallback(()=>{O.current!==void 0&&(window.cancelAnimationFrame(O.current),O.current=void 0,P.current.abort())},[]),B=l.useRef(n);B.current=n;const D=l.useCallback(V=>{const le=new RegExp(V.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ce=B.current,We=Math.min(10,o),U=0;v(void 0),X([]);const Se=[],De=async()=>{var ue;if(f===void 0)return;const be=performance.now(),Ye=o-U;let Je=f({x:0,y:ce,width:r.length,height:Math.min(We,Ye,o-ce)},P.current.signal);typeof Je=="function"&&(Je=await Je());let it=!1;for(const[se,xe]of Je.entries())for(const[Me,Ie]of xe.entries()){let pe;switch(Ie.kind){case Z.Text:case Z.Number:pe=Ie.displayData;break;case Z.Uri:case Z.Markdown:pe=Ie.data;break;case Z.Boolean:pe=typeof Ie.data=="boolean"?Ie.data.toString():void 0;break;case Z.Image:case Z.Bubble:pe=Ie.data.join("🐳");break;case Z.Custom:pe=Ie.copyData;break}pe!==void 0&&le.test(pe)&&(Se.push([Me,se+ce]),it=!0)}const at=performance.now();it&&X([...Se]),U+=Je.length,Zt(U<=o);const He=((ue=z.current)==null?void 0:ue.selectedIndex)??-1;v({results:Se.length,rowsSearched:U,selectedIndex:He}),u==null||u(Se,He),ce+We>=o?ce=0:ce+=We;const Pe=at-be,Te=Math.max(Pe,1),wt=Fc/Te;We=Math.ceil(We*wt),U{var V;m==null||m(),v(void 0),X([]),u==null||u([],-1),$(),(V=t==null?void 0:t.current)==null||V.focus()},[$,t,m,u]),S=l.useCallback(V=>{R(V.target.value),s===void 0&&(V.target.value===""?(v(void 0),X([]),$()):D(V.target.value))},[D,$,R,s]);l.useEffect(()=>{w&&i.current!==null&&(R(""),i.current.focus({preventScroll:!0}))},[w,i,R]);const de=l.useCallback(V=>{var ce;if((ce=V==null?void 0:V.stopPropagation)==null||ce.call(V),C===void 0)return;const le=(C.selectedIndex+1)%C.results;v({...C,selectedIndex:le}),u==null||u(E,le)},[C,u,E]),te=l.useCallback(V=>{var ce;if((ce=V==null?void 0:V.stopPropagation)==null||ce.call(V),C===void 0)return;let le=(C.selectedIndex-1)%C.results;le<0&&(le+=C.results),v({...C,selectedIndex:le}),u==null||u(E,le)},[u,E,C]),re=l.useCallback(V=>{(V.ctrlKey||V.metaKey)&&V.nativeEvent.code==="KeyF"||V.key==="Escape"?(M(),V.stopPropagation(),V.preventDefault()):V.key==="Enter"&&(V.shiftKey?te():de())},[M,de,te]);l.useEffect(()=>()=>{$()},[$]);const[ge,Re]=l.useState(!1);l.useEffect(()=>{if(w)Re(!0);else{const V=setTimeout(()=>Re(!1),150);return()=>clearTimeout(V)}},[w]);const ie=l.useMemo(()=>{if(!w&&!ge)return null;let V;C!==void 0&&(V=C.results>=1e3?"over 1000":`${C.results} result${C.results!==1?"s":""}`,C.selectedIndex>=0&&(V=`${C.selectedIndex+1} of ${V}`));const le=U=>{U.stopPropagation()},We={width:`${Math.floor(((C==null?void 0:C.rowsSearched)??0)/o*100)}%`};return l.createElement(Rc,{className:w?"":"out",onMouseDown:le,onMouseMove:le,onMouseUp:le,onClick:le},l.createElement("div",{className:"gdg-search-bar-inner"},l.createElement("input",{id:g,"aria-hidden":!w,"data-testid":"search-input",ref:i,onChange:S,value:x,tabIndex:w?void 0:-1,onKeyDownCapture:re}),l.createElement("button",{"aria-label":"Previous Result","aria-hidden":!w,tabIndex:w?void 0:-1,onClick:te,disabled:((C==null?void 0:C.results)??0)===0},Ec),l.createElement("button",{"aria-label":"Next Result","aria-hidden":!w,tabIndex:w?void 0:-1,onClick:de,disabled:((C==null?void 0:C.results)??0)===0},Dc),m!==void 0&&l.createElement("button",{"aria-label":"Close Search","aria-hidden":!w,"data-testid":"search-close-button",tabIndex:w?void 0:-1,onClick:M},Ic)),C!==void 0?l.createElement(l.Fragment,null,l.createElement("div",{className:"gdg-search-status"},l.createElement("div",{"data-testid":"search-result-area"},V)),l.createElement("div",{className:"gdg-search-progress",style:We})):l.createElement("div",{className:"gdg-search-status"},l.createElement("label",{htmlFor:g},"Type to search")))},[w,ge,C,o,g,i,S,x,re,te,de,m,M]);return l.createElement(l.Fragment,null,l.createElement(Mc,{prelightCells:E,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,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}),ie)},Tc=Hc;class Ac extends l.PureComponent{constructor(){super(...arguments);Oe(this,"wrapperRef",l.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 l.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const Lc=()=>e=>Math.max(16,e.targetHeight-10),zc=Qt("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[Lc(),"px"]}}),Pc=e=>{const{bounds:t,group:n,onClose:o,canvasBounds:r,onFinish:i}=e,[a,s]=Bt.useState(n);return Bt.createElement(Ac,{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},Bt.createElement(zc,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:o,onFocus:d=>d.target.setSelectionRange(0,a.length),onChange:d=>s(d.target.value),onKeyDown:d=>{d.key==="Enter"?i(a):d.key==="Escape"&&o()},autoFocus:!0}))};function Bc(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 Le(e,t,n){const o=Yl(e,t);return o&&(n.didMatch=!0),o}function Yl(e,t){if(e.length===0)return!1;if(e.includes("|")){const d=e.split("|");for(const f of d)if(Yl(f,t))return!0;return!1}let n=!1,o=!1,r=!1,i=!1;const a=e.split("+"),s=a.pop();if(!Bc(s,t))return!1;if(a[0]==="any")return!0;for(const d of a)switch(d){case"ctrl":n=!0;break;case"shift":o=!0;break;case"alt":r=!0;break;case"meta":i=!0;break;case"primary":Rr.value?i=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===o&&t.metaKey===i}function Oc(e,t,n,o,r,i){const a=Bt.useCallback((f,u,w,m)=>{var C;(i==="cell"||i==="multi-cell")&&f!==void 0&&(f={...f,range:{x:f.cell[0],y:f.cell[1],width:1,height:1}});const g=n==="mixed"&&(w||m==="drag"),h=o==="mixed"&&g,y=r==="mixed"&&g;let x={current:f===void 0?void 0:{...f,rangeStack:m==="drag"?((C=e.current)==null?void 0:C.rangeStack)??[]:[]},columns:h?e.columns:nt.empty(),rows:y?e.rows:nt.empty()};w&&(i==="multi-rect"||i==="multi-cell")&&x.current!==void 0&&e.current!==void 0&&(x={...x,current:{...x.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(x,u)},[o,e,n,i,r,t]),s=Bt.useCallback((f,u,w)=>{f=f??e.rows,u!==void 0&&(f=f.add(u));let m;if(r==="exclusive"&&f.length>0)m={current:void 0,columns:nt.empty(),rows:f};else{const g=w&&n==="mixed",h=w&&o==="mixed";m={current:g?e.current:void 0,columns:h?e.columns:nt.empty(),rows:f}}t(m,!1)},[o,e,n,r,t]),d=Bt.useCallback((f,u,w)=>{f=f??e.columns,u!==void 0&&(f=f.add(u));let m;if(o==="exclusive"&&f.length>0)m={current:void 0,rows:nt.empty(),columns:f};else{const g=w&&n==="mixed",h=w&&r==="mixed";m={current:g?e.current:void 0,rows:h?e.rows:nt.empty(),columns:f}}t(m,!1)},[o,e,n,r,t]);return[a,s,d]}function Wc(e,t,n,o,r){const i=l.useCallback(f=>{if(e===!0){const u=[];for(let w=f.y;w=r?m.push({kind:Z.Loading,allowOverlay:!1}):m.push(t([g,w]));u.push(m)}return u}return(e==null?void 0:e(f,o.signal))??[]},[o.signal,t,e,r]),a=e!==void 0?i:void 0,s=l.useCallback(f=>{if(a===void 0)return[];const u={...f,x:f.x-n};if(u.x<0){u.x=0,u.width--;const w=a(u,o.signal);return typeof w=="function"?async()=>(await w()).map(m=>[{kind:Z.Loading,allowOverlay:!1},...m]):w.map(m=>[{kind:Z.Loading,allowOverlay:!1},...m])}return a(u,o.signal)},[o.signal,a,n]);return[e!==void 0?s:void 0,a]}function $c(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===fi?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:Uo()}}function Nc(e,t){return e.map((o,r)=>{const i=t[r];return o.map(a=>a.span!==void 0&&a.span[0]!==i?{formatted:"",rawValue:"",format:"string"}:$c(a))})}function nl(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Xc(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(a=>nl(a,!0)).join(",")):r.push(nl(i.formatted,!1));t.push(r.join(" "))}return t.join(` +`)}function ti(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function ol(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function Yc(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Kc(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("
${ti(r.formatted)}
    ${r.formatted.map((a,s)=>`
  1. `+ti(a)+"
  2. ").join("")}
${ti(r.formatted)}
"),t.join("")}function Uc(e,t){const n=Nc(e,t),o=Xc(n),r=Kc(n);return{textPlain:o,textHtml:r}}function rl(e){var a;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 d=s.cloneNode(!0),u=d.children.length===1&&d.children[0].nodeName==="P"?d.children[0]:null,w=(u==null?void 0:u.children.length)===1&&u.children[0].nodeName==="FONT",m=d.querySelectorAll("br");for(const y of m)y.replaceWith(` +`);const g=d.getAttribute("gdg-raw-value"),h=d.getAttribute("gdg-format")??"string";if(d.querySelector("a")!==null)i==null||i.push({rawValue:((a=d.querySelector("a"))==null?void 0:a.getAttribute("href"))??"",formatted:d.textContent??"",format:h});else if(d.querySelector("ol")!==null){const y=d.querySelectorAll("li");i==null||i.push({rawValue:[...y].map(x=>x.getAttribute("gdg-raw-value")??""),formatted:[...y].map(x=>x.textContent??""),format:"string-array"})}else if(g!==null)i==null||i.push({rawValue:Yc(g),formatted:d.textContent??"",format:h});else{let y=d.textContent??"";w&&(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 _c(e,t,n,o,r){var s;const i=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if((e==null?void 0:e.current)===void 0)break;const d=(s=e.current)==null?void 0:s.range,f=[];if(d.width>2){const m=t({x:d.x,y:d.y,width:1,height:d.height},r.signal);if(typeof m=="function")return i;f.push(...m);const g=t({x:d.x+d.width-1,y:d.y,width:1,height:d.height},r.signal);if(typeof g=="function")return i;f.push(...g)}else{const m=t({x:d.x,y:d.y,width:d.width,height:d.height},r.signal);if(typeof m=="function")return i;f.push(...m)}let u=d.x-n,w=d.x+d.width-1-n;for(const m of f)for(const g of m)g.span!==void 0&&(u=Math.min(g.span[0],u),w=Math.max(g.span[1],w));u===d.x-n&&w===d.x+d.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:d.y,width:w-u+1,height:d.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function il(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Vc(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 a=0;for(const s of e){switch(i){case t.None:s===" "||s===` +`?(o.push(e.slice(r,a)),r=a+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(il(e.slice(r,a))),r=a+1,s===` +`&&(n.push(o),o=[])),i=t.None);break}a++}return rs.map(d=>({rawValue:d,formatted:d,format:"string"})))}function ll(e,t,n){var s;const o=Uc(e,t),r=d=>{var f;(f=window.navigator.clipboard)==null||f.writeText(d)},i=(d,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([d],{type:"text/plain"}),"text/html":new Blob([f],{type:"text/html"})})]),!0)},a=(d,f)=>{var u,w;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",d),(w=n==null?void 0:n.clipboardData)==null||w.setData("text/html",f)}catch{i(d,f)||r(d)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(o.textPlain,o.textHtml):r(o.textPlain),n==null||n.preventDefault()}function Kl(e){return e!==!0}function sl(e){return typeof e=="string"?e:`${e}px`}const Gc=()=>e=>e.innerWidth,qc=()=>e=>e.innerHeight,jc=Qt("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Gc()],"wmyidgi-1":[qc()]}}),Zc=e=>{const{inWidth:t,inHeight:n,children:o,...r}=e;return l.createElement(jc,{innerHeight:sl(n),innerWidth:sl(t),...r},o)},Jc=2,Qc=1300;function ed(e,t,n){const o=Bt.useRef(0),[r,i]=e??[0,0];Bt.useEffect(()=>{if(r===0&&i===0){o.current=0;return}let a=!1,s=0;const d=f=>{var u;if(!a){if(s===0)s=f;else{const w=f-s;o.current=Math.min(1,o.current+w/Qc);const m=o.current**1.618*w*Jc;(u=t.current)==null||u.scrollBy(r*m,i*m),s=f,n==null||n()}window.requestAnimationFrame(d)}};return window.requestAnimationFrame(d),()=>{a=!0}},[t,r,i,n])}function td({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:o,overscrollX:r,overscrollY:i,scaleToRem:a,remSize:s}){const[d,f,u,w,m,g]=Bt.useMemo(()=>{if(!a||s===16)return[e,t,n,o,r,i];const h=s/16,y=e,x=Il();return[typeof y=="number"?y*h:R=>Math.ceil(y(R)*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,a,o]);return{rowHeight:d,headerHeight:f,groupHeaderHeight:u,theme:w,overscrollX:m,overscrollY:g}}const Wn={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 ze(e,t){return e===!0?t:e===!1?"":e}function al(e){const t=Rr.value;return{activateCell:ze(e.activateCell," |Enter|shift+Enter"),clear:ze(e.clear,"any+Escape"),closeOverlay:ze(e.closeOverlay,"any+Escape"),acceptOverlayDown:ze(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ze(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ze(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ze(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ze(e.delete,t?"Backspace|Delete":"Delete"),downFill:ze(e.downFill,"primary+_68"),scrollToSelectedCell:ze(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ze(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ze(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ze(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ze(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ze(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ze(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ze(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ze(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ze(e.goToFirstCell,"primary+Home"),goToFirstColumn:ze(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ze(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ze(e.goToLastCell,"primary+End"),goToLastColumn:ze(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ze(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ze(e.goToNextPage,"PageDown"),goToPreviousPage:ze(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ze(e.rightFill,"primary+_82"),search:ze(e.search,"primary+f"),selectAll:ze(e.selectAll,"primary+a"),selectColumn:ze(e.selectColumn,"ctrl+ "),selectGrowDown:ze(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ze(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ze(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ze(e.selectGrowUp,"shift+ArrowUp"),selectRow:ze(e.selectRow,"shift+ "),selectToFirstCell:ze(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ze(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ze(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ze(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ze(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ze(e.selectToLastRow,"primary+shift+ArrowDown")}}function nd(e){const t=$s(e);return Bt.useMemo(()=>{if(t===void 0)return al(Wn);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Wn.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Wn.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Wn.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Wn.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Wn.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Wn.selectToLastCell};return al({...Wn,...n})},[t])}const od=l.lazy(async()=>await fl(()=>import("./data-grid-overlay-editor-Z83AvWlM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));let rd=0;function id(e){return Es(Bi(Bi(e).filter(t=>t.span!==void 0).map(t=>{var n,o;return Zn((((n=t.span)==null?void 0:n[0])??0)+1,(((o=t.span)==null?void 0:o[1])??0)+1)})))}function pr(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 ni={kind:Z.Loading,allowOverlay:!1},vr={columns:nt.empty(),rows:nt.empty(),current:void 0},ld=(e,t)=>{var Li,zi,Pi;const[n,o]=l.useState(vr),[r,i]=l.useState(),a=l.useRef(null),s=l.useRef(null),[d,f]=l.useState(),u=l.useRef(null),w=l.useRef(),m=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:y,width:x,height:R,columns:C,rows:v,getCellContent:z,onCellClicked:P,onCellActivated:O,onFillPattern:H,onFinishedEditing:X,coercePasteValue:E,drawHeader:$,drawCell:B,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:S,spanRangeBehavior:de="default",onGroupHeaderClicked:te,onCellContextMenu:re,className:ge,onHeaderContextMenu:Re,getCellsForSelection:ie,onGroupHeaderContextMenu:V,onGroupHeaderRenamed:le,onCellEdited:ce,onCellsEdited:We,onSearchResultsChanged:U,searchResults:Se,onSearchValueChange:De,searchValue:be,onKeyDown:Ye,onKeyUp:Je,keybindings:it,editOnType:at=!0,onRowAppended:He,onColumnMoved:Pe,validateCell:Te,highlightRegions:wt,rangeSelect:ue="rect",columnSelect:se="multi",rowSelect:xe="multi",rangeSelectionBlending:Me="exclusive",columnSelectionBlending:Ie="exclusive",rowSelectionBlending:pe="exclusive",onDelete:et,onDragStart:Ue,onMouseMove:_e,onPaste:j,copyHeaders:Fe=!1,freezeColumns:Be=0,cellActivationBehavior:ke="second-click",rowSelectionMode:St="auto",onHeaderMenuClick:Ve,getGroupDetails:$e,onSearchClose:Ge,onItemHovered:yt,onSelectionCleared:Mt,showSearch:en,onVisibleRegionChanged:Kt,gridSelection:ut,onGridSelectionChange:Ot,minColumnWidth:Wt=50,maxColumnWidth:Sn=500,maxColumnAutoWidth:Mn,provideEditor:ct,trailingRowOptions:Ne,freezeTrailingRows:qe=0,allowedFillDirections:Ft="orthogonal",scrollOffsetX:Ht,scrollOffsetY:bt,verticalBorder:It,onDragOverCell:sn,onDrop:Ke,onColumnResize:ft,onColumnResizeEnd:ot,onColumnResizeStart:rt,customRenderers:Tt,fillHandle:dt,drawFocusRing:Dt=!0,experimental:ht,fixedShadowX:qo,fixedShadowY:Hn,headerIcons:Rn,imageWindowLoader:En,initialSize:eo,isDraggable:jo,onDragLeave:Zo,onRowMoved:yn,overscrollX:to,overscrollY:no,preventDiagonalScrolling:oo,rightElement:Kn,rightElementProps:Tn,trapFocus:Jo=!1,smoothScrollX:Qo,smoothScrollY:Hr,scaleToRem:Tr=!1,rowHeight:ro=34,headerHeight:Dn=36,groupHeaderHeight:Ar=Dn,theme:Lr,isOutsideClick:er,renderers:io}=e,Rt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,tn=(Rt==null?void 0:Rt.kind)??e.rowMarkers??"none",tr=(Rt==null?void 0:Rt.width)??e.rowMarkerWidth,lo=(Rt==null?void 0:Rt.startIndex)??e.rowMarkerStartIndex??1,Ro=(Rt==null?void 0:Rt.theme)??e.rowMarkerTheme,An=(Rt==null?void 0:Rt.checkboxStyle)??"square",Ut=Math.max(Wt,20),an=Math.max(Sn,Ut),Eo=Math.max(Mn??an,Ut),Ln=l.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),Do=l.useMemo(()=>Number.parseFloat(Ln.fontSize),[Ln]),{rowHeight:$t,headerHeight:so,groupHeaderHeight:Io,theme:nr,overscrollX:zr,overscrollY:or}=td({groupHeaderHeight:Ar,headerHeight:Dn,overscrollX:to,overscrollY:no,remSize:Do,rowHeight:ro,scaleToRem:Tr,theme:Lr}),cn=nd(it),In=tr??(v>1e4?48:v>1e3?44:v>100?36:32),_t=tn!=="none",T=_t?1:0,gt=He!==void 0,Un=(Ne==null?void 0:Ne.sticky)===!0,[Pr,rr]=l.useState(!1),Fo=en??Pr,Br=l.useCallback(()=>{Ge!==void 0?Ge():rr(!1)},[Ge]),L=l.useMemo(()=>ut===void 0?void 0:pr(ut,T),[ut,T])??n,Lt=l.useRef();Lt.current===void 0&&(Lt.current=new AbortController),l.useEffect(()=>()=>Lt==null?void 0:Lt.current.abort(),[]);const[Et,ao]=Wc(ie,z,T,Lt.current,v),Ho=l.useCallback((c,p,b)=>{if(Te===void 0)return!0;const I=[c[0]-T,c[1]];return Te==null?void 0:Te(I,p,b)},[T,Te]),zn=l.useRef(ut),Xt=l.useCallback((c,p)=>{p&&(c=_c(c,Et,T,de,Lt.current)),Ot!==void 0?(zn.current=pr(c,-T),Ot(zn.current)):o(c)},[Ot,Et,T,de]),dn=bo(ft,l.useCallback((c,p,b,I)=>{ft==null||ft(C[b-T],p,b-T,I)},[ft,T,C])),Or=bo(ot,l.useCallback((c,p,b,I)=>{ot==null||ot(C[b-T],p,b-T,I)},[ot,T,C])),co=bo(rt,l.useCallback((c,p,b,I)=>{rt==null||rt(C[b-T],p,b-T,I)},[rt,T,C])),Wr=bo($,l.useCallback((c,p)=>($==null?void 0:$({...c,columnIndex:c.columnIndex-T},p))??!1,[$,T])),$r=bo(B,l.useCallback((c,p)=>(B==null?void 0:B({...c,col:c.col-T},p))??!1,[B,T])),k=l.useCallback(c=>{if(et!==void 0){const p=et(pr(c,-T));return typeof p=="boolean"?p:pr(p,T)}return!0},[et,T]),[K,J,q]=Oc(L,Xt,Me,Ie,pe,ue),G=l.useMemo(()=>Nn(Il(),nr),[nr]),[oe,ve]=l.useState([0,0,0]),Ce=l.useMemo(()=>{if(io===void 0)return{};const c={};for(const p of io)c[p.kind]=p;return c},[io]),ne=l.useCallback(c=>c.kind!==Z.Custom?Ce[c.kind]:Tt==null?void 0:Tt.find(p=>p.isMatch(c)),[Tt,Ce]);let{sizedColumns:Qe,nonGrowWidth:fe}=fa(C,v,ao,oe[0]-(T===0?0:In)-oe[2],Ut,Eo,G,ne,Lt.current);tn!=="none"&&(fe+=In);const tt=l.useMemo(()=>Qe.some(c=>c.group!==void 0),[Qe]),Ee=tt?so+Io:so,Xe=L.rows.length,vt=tn==="none"?void 0:Xe===0?!1:Xe===v?!0:void 0,Ae=l.useMemo(()=>tn==="none"?Qe:[{title:"",width:In,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Ro,rowMarker:An,rowMarkerChecked:vt},...Qe],[tn,Qe,In,Ro,An,vt]),[pt,nn]=l.useMemo(()=>[bt!==void 0&&typeof $t=="number"?Math.floor(bt/$t):0,bt!==void 0&&typeof $t=="number"?-(bt%$t):0],[bt,$t]),mt=l.useRef({height:1,width:1,x:0,y:0}),Vt=l.useMemo(()=>({x:mt.current.x,y:pt,width:mt.current.width??1,height:mt.current.height??1,ty:nn}),[nn,pt]),Ze=l.useRef(!1),[Ct,Gt,bn]=Ws(Vt);mt.current=Ct;const un=(Ct.height??1)>1;l.useLayoutEffect(()=>{if(bt!==void 0&&u.current!==null&&un){if(u.current.scrollTop===bt)return;u.current.scrollTop=bt,u.current.scrollTop!==bt&&bn(),Ze.current=!0}},[bt,un,bn]);const uo=(Ct.width??1)>1;l.useLayoutEffect(()=>{if(Ht!==void 0&&u.current!==null&&uo){if(u.current.scrollLeft===Ht)return;u.current.scrollLeft=Ht,u.current.scrollLeft!==Ht&&bn(),Ze.current=!0}},[Ht,uo,bn]);const _n=Ct.x+T,ir=Ct.y,Yt=l.useRef(null),Nt=l.useCallback(c=>{var p;c===!0?(p=Yt.current)==null||p.focus():window.requestAnimationFrame(()=>{var b;(b=Yt.current)==null||b.focus()})},[]),zt=gt?v+1:v,on=l.useCallback(c=>{const p=T===0?c:c.map(I=>({...I,location:[I.location[0]-T,I.location[1]]})),b=We==null?void 0:We(p);if(b!==!0)for(const I of p)ce==null||ce(I.location,I.value);return b},[ce,We,T]),[Vn,Nr]=l.useState(),lr=L.current!==void 0&&L.current.range.width*L.current.range.height>1?L.current.range:void 0,fo=Dt?(Li=L.current)==null?void 0:Li.cell:void 0,sr=fo==null?void 0:fo[0],ar=fo==null?void 0:fo[1],Ul=l.useMemo(()=>{if((wt===void 0||wt.length===0)&&(lr??sr??ar??Vn)===void 0)return;const c=[];if(wt!==void 0)for(const p of wt){const b=Ae.length-p.range.x-T;b>0&&c.push({color:p.color,range:{...p.range,x:p.range.x+T,width:Math.min(b,p.range.width)},style:p.style})}return Vn!==void 0&&c.push({color:Jn(G.accentColor,0),range:Vn,style:"dashed"}),lr!==void 0&&c.push({color:Jn(G.accentColor,.5),range:lr,style:"solid-outline"}),sr!==void 0&&ar!==void 0&&c.push({color:G.accentColor,range:{x:sr,y:ar,width:1,height:1},style:"solid-outline"}),c.length>0?c:void 0},[Vn,lr,sr,ar,wt,Ae.length,G.accentColor,T]),Ci=l.useRef(Ae);Ci.current=Ae;const qt=l.useCallback(([c,p],b=!1)=>{var N,A,W,_,Y,ee,ae;const I=gt&&p===zt-1;if(c===0&&_t)return I?ni:{kind:ln.Marker,allowOverlay:!1,checkboxStyle:An,checked:(L==null?void 0:L.rows.hasIndex(p))===!0,markerKind:tn==="clickable-number"?"number":tn,row:lo+p,drawHandle:yn!==void 0,cursor:tn==="clickable-number"?"pointer":void 0};if(I){const me=c===T?(Ne==null?void 0:Ne.hint)??"":"",we=Ci.current[c];if(((N=we==null?void 0:we.trailingRowOptions)==null?void 0:N.disabled)===!0)return ni;{const je=((A=we==null?void 0:we.trailingRowOptions)==null?void 0:A.hint)??me,ye=((W=we==null?void 0:we.trailingRowOptions)==null?void 0:W.addIcon)??(Ne==null?void 0:Ne.addIcon);return{kind:ln.NewRow,hint:je,allowOverlay:!1,icon:ye}}}else{const Q=c-T;if(b||(ht==null?void 0:ht.strict)===!0){const we=mt.current,je=we.x>Q||Q>we.x+we.width||we.y>p||p>we.y+we.height||p>=Yr.current,ye=Q===((Y=(_=we.extras)==null?void 0:_.selected)==null?void 0:Y[0])&&p===((ee=we.extras)==null?void 0:ee.selected[1]);let he=!1;if(((ae=we.extras)==null?void 0:ae.freezeRegions)!==void 0){for(const lt of we.extras.freezeRegions)if(Fr(lt,Q,p)){he=!0;break}}if(je&&!ye&&!he)return ni}let me=z([Q,p]);return T!==0&&me.span!==void 0&&(me={...me,span:[me.span[0]+T,me.span[1]+T]}),me}},[gt,zt,_t,An,L==null?void 0:L.rows,tn,lo,yn,T,Ne==null?void 0:Ne.hint,Ne==null?void 0:Ne.addIcon,ht==null?void 0:ht.strict,z]),Xr=l.useCallback(c=>{let p=($e==null?void 0:$e(c))??{name:c};return le!==void 0&&c!==""&&(p={icon:p.icon,name:p.name,overrideTheme:p.overrideTheme,actions:[...p.actions??[],{title:"Rename",icon:"renameIcon",onClick:b=>Ur({group:p.name,bounds:b.bounds})}]}),p},[$e,le]),cr=l.useCallback(c=>{var W;const[p,b]=c.cell,I=Ae[p],F=(I==null?void 0:I.group)!==void 0?(W=Xr(I.group))==null?void 0:W.overrideTheme:void 0,N=I==null?void 0:I.themeOverride,A=h==null?void 0:h(b);i({...c,theme:Nn(G,F,N,A,c.content.themeOverride)})},[h,Ae,Xr,G]),ho=l.useCallback((c,p,b)=>{var A;if(L.current===void 0)return;const[I,F]=L.current.cell,N=qt([I,F]);if(N.kind!==Z.Boolean&&N.allowOverlay){let W=N;if(b!==void 0)switch(W.kind){case Z.Number:{const _=Is(()=>b==="-"?-0:Number.parseFloat(b),0);W={...W,data:Number.isNaN(_)?0:_};break}case Z.Text:case Z.Markdown:case Z.Uri:W={...W,data:b};break}cr({target:c,content:W,initialValue:b,cell:[I,F],highlight:b===void 0,forceEditMode:b!==void 0})}else N.kind===Z.Boolean&&p&&N.readonly!==!0&&(on([{location:L.current.cell,value:{...N,data:Kl(N.data)}}]),(A=Yt.current)==null||A.damage([{cell:L.current.cell}]))},[qt,L,on,cr]),xi=l.useCallback((c,p)=>{var F;const b=(F=Yt.current)==null?void 0:F.getBounds(c,p);if(b===void 0||u.current===null)return;const I=qt([c,p]);I.allowOverlay&&cr({target:b,content:I,initialValue:void 0,highlight:!0,cell:[c,p],forceEditMode:!0})},[qt,cr]),xt=l.useCallback((c,p,b="both",I=0,F=0,N=void 0)=>{if(u.current!==null){const A=Yt.current,W=s.current,_=typeof c!="number"?c.unit==="cell"?c.amount:void 0:c,Y=typeof p!="number"?p.unit==="cell"?p.amount:void 0:p,ee=typeof c!="number"&&c.unit==="px"?c.amount:void 0,ae=typeof p!="number"&&p.unit==="px"?p.amount:void 0;if(A!==null&&W!==null){let Q={x:0,y:0,width:0,height:0},me=0,we=0;if((_!==void 0||Y!==void 0)&&(Q=A.getBounds((_??0)+T,Y??0)??Q,Q.width===0||Q.height===0))return;const je=W.getBoundingClientRect(),ye=je.width/W.offsetWidth;if(ee!==void 0&&(Q={...Q,x:ee-je.left-u.current.scrollLeft,width:1}),ae!==void 0&&(Q={...Q,y:ae+je.top-u.current.scrollTop,height:1}),Q!==void 0){const he={x:Q.x-I,y:Q.y-F,width:Q.width+2*I,height:Q.height+2*F};let lt=0;for(let Zr=0;Zr0&&(Pt=Qn(zt,kt,$t));let hn=lt*ye+je.left+T*In*ye,vn=je.right,gn=je.top+Ee*ye,Cn=je.bottom-Pt*ye;const mr=Q.width+I*2;switch(N==null?void 0:N.hAlign){case"start":vn=hn+mr;break;case"end":hn=vn-mr;break;case"center":hn=Math.floor((hn+vn)/2)-mr/2,vn=hn+mr;break}const wr=Q.height+F*2;switch(N==null?void 0:N.vAlign){case"start":Cn=gn+wr;break;case"end":gn=Cn-wr;break;case"center":gn=Math.floor((gn+Cn)/2)-wr/2,Cn=gn+wr;break}hn>he.x?me=he.x-hn:vnhe.y?we=he.y-gn:Cn=zt-kt)&&(we=0),(me!==0||we!==0)&&(ye!==1&&(me/=ye,we/=ye),u.current.scrollTo(me+u.current.scrollLeft,we+u.current.scrollTop))}}}},[T,qe,In,Ee,Be,Qe,zt,Un,$t]),ki=l.useRef(xi),Si=l.useRef(z),Yr=l.useRef(v);ki.current=xi,Si.current=z,Yr.current=v;const go=l.useCallback(async(c,p=!0)=>{var _;const b=Ae[c];if(((_=b==null?void 0:b.trailingRowOptions)==null?void 0:_.disabled)===!0)return;const I=He==null?void 0:He();let F,N=!0;I!==void 0&&(F=await I,F==="top"&&(N=!1),typeof F=="number"&&(N=!1));let A=0;const W=()=>{if(Yr.current<=v){A<500&&window.setTimeout(W,A),A=50+A*2;return}const Y=typeof F=="number"?F:N?v:0;gr.current(c-T,Y),K({cell:[c,Y],range:{x:c,y:Y,width:1,height:1}},!1,!1,"edit");const ee=Si.current([c-T,Y]);ee.allowOverlay&&No(ee)&&ee.readonly!==!0&&p&&window.setTimeout(()=>{ki.current(c,Y)},0)};W()},[Ae,He,T,v,K]),dr=l.useCallback(c=>{var b,I;const p=((I=(b=Qe[c])==null?void 0:b.trailingRowOptions)==null?void 0:I.targetColumn)??(Ne==null?void 0:Ne.targetColumn);if(typeof p=="number")return p+(_t?1:0);if(typeof p=="object"){const F=C.indexOf(p);if(F>=0)return F+(_t?1:0)}},[Qe,C,_t,Ne==null?void 0:Ne.targetColumn]),Pn=l.useRef(),mo=l.useRef(),To=l.useCallback((c,p)=>{var F;const[b,I]=p;return Nn(G,(F=Ae[b])==null?void 0:F.themeOverride,h==null?void 0:h(I),c.themeOverride)},[h,Ae,G]),Ao=l.useCallback(c=>{var ee,ae,Q;const p=Rr.value?c.metaKey:c.ctrlKey,b=p&&xe==="multi",I=p&&se==="multi",[F,N]=c.location,A=L.columns,W=L.rows,[_,Y]=((ee=L.current)==null?void 0:ee.cell)??[];if(c.kind==="cell"){if(mo.current=void 0,Gn.current=[F,N],F===0&&_t){if(gt===!0&&N===v||tn==="number"||xe==="none")return;const me=qt(c.location);if(me.kind!==ln.Marker)return;if(yn!==void 0){const ye=ne(me);Zt((ye==null?void 0:ye.kind)===ln.Marker);const he=(ae=ye==null?void 0:ye.onClick)==null?void 0:ae.call(ye,{...c,cell:me,posX:c.localEventX,posY:c.localEventY,bounds:c.bounds,theme:To(me,c.location),preventDefault:()=>{}});if(he===void 0||he.checked===me.checked)return}i(void 0),Nt();const we=W.hasIndex(N),je=Pn.current;if(xe==="multi"&&(c.shiftKey||c.isLongTouch===!0)&&je!==void 0&&W.hasIndex(je)){const ye=[Math.min(je,N),Math.max(je,N)+1];b||St==="multi"?J(void 0,ye,!0):J(nt.fromSingleSelection(ye),void 0,b)}else b||c.isTouch||St==="multi"?we?J(W.remove(N),void 0,!0):(J(void 0,N,!0),Pn.current=N):we&&W.length===1?J(nt.empty(),void 0,p):(J(nt.fromSingleSelection(N),void 0,p),Pn.current=N)}else if(F>=T&>&&N===v){const me=dr(F);go(me??F)}else if(_!==F||Y!==N){const me=qt(c.location),we=ne(me);if((we==null?void 0:we.onSelect)!==void 0){let he=!1;if(we.onSelect({...c,cell:me,posX:c.localEventX,posY:c.localEventY,bounds:c.bounds,preventDefault:()=>he=!0,theme:To(me,c.location)}),he)return}const je=Un&&N===v,ye=Un&&L!==void 0&&((Q=L.current)==null?void 0:Q.cell[1])===v;if((c.shiftKey||c.isLongTouch===!0)&&_!==void 0&&Y!==void 0&&L.current!==void 0&&!ye){if(je)return;const he=Math.min(F,_),lt=Math.max(F,_),Pt=Math.min(N,Y),kt=Math.max(N,Y);K({...L.current,range:{x:he,y:Pt,width:lt-he+1,height:kt-Pt+1}},!0,p,"click"),Pn.current=void 0,Nt()}else K({cell:[F,N],range:{x:F,y:N,width:1,height:1}},!0,p,"click"),Pn.current=void 0,i(void 0),Nt()}}else if(c.kind==="header")if(Gn.current=[F,N],i(void 0),_t&&F===0)Pn.current=void 0,mo.current=void 0,xe==="multi"&&(W.length!==v?J(nt.fromSingleSelection([0,v]),void 0,p):J(nt.empty(),void 0,p),Nt());else{const me=mo.current;if(se==="multi"&&(c.shiftKey||c.isLongTouch===!0)&&me!==void 0&&A.hasIndex(me)){const we=[Math.min(me,F),Math.max(me,F)+1];I?q(void 0,we,p):q(nt.fromSingleSelection(we),void 0,p)}else I?(A.hasIndex(F)?q(A.remove(F),void 0,p):q(void 0,F,p),mo.current=F):se!=="none"&&(q(nt.fromSingleSelection(F),void 0,p),mo.current=F);Pn.current=void 0,Nt()}else c.kind===jt?Gn.current=[F,N]:c.kind===Er&&!c.isMaybeScrollbar&&(Xt(vr,!1),i(void 0),Nt(),Mt==null||Mt(),Pn.current=void 0,mo.current=void 0)},[go,se,Nt,ne,dr,qt,L,_t,Un,Mt,yn,T,tn,xe,St,v,K,Xt,q,J,gt,To]),Lo=l.useRef(!1),Gn=l.useRef(),Mi=l.useRef(Ct),rn=l.useRef(),_l=l.useCallback(c=>{if(wo.current=!1,Mi.current=mt.current,c.button!==0&&c.button!==1){rn.current=void 0;return}const p=performance.now();rn.current={button:c.button,time:p,location:c.location},(c==null?void 0:c.kind)==="header"&&(Lo.current=!0);const b=c.kind==="cell"&&c.isFillHandle;!b&&c.kind!=="cell"&&c.isEdge||(f({previousSelection:L,fillHandle:b}),Gn.current=void 0,!c.isTouch&&c.button===0&&!b?Ao(c):!c.isTouch&&c.button===1&&(Gn.current=c.location))},[L,Ao]),[Kr,Ur]=l.useState(),Ri=l.useCallback(c=>{if(c.kind!==jt||se!=="multi")return;const p=Rr.value?c.metaKey:c.ctrlKey,[b]=c.location,I=L.columns;if(b=T&&_o(F.group,Ae[W].group);W--)N--;for(let W=b+1;W{if(Et!==void 0&&dn!==void 0){const p=mt.current.y,b=mt.current.height;let I=Et({x:c,y:p,width:1,height:Math.min(b,v-p)},Lt.current.signal);typeof I!="object"&&(I=await I());const F=Qe[c-T],A=document.createElement("canvas").getContext("2d",{alpha:!1});if(A!==null){A.font=G.baseFontFull;const W=Hl(A,G,F,0,I,Ut,an,!1,ne);dn==null||dn(F,W.width,c,W.width)}}},[Qe,Et,an,G,Ut,dn,T,v,ne]),[Vl,_r]=l.useState(),yo=l.useCallback(async(c,p)=>{var W,_;const b=(W=c.current)==null?void 0:W.range;if(b===void 0||Et===void 0||p.current===void 0)return;const I=p.current.range;if(H!==void 0){let Y=!1;if(H({fillDestination:{...I,x:I.x-T},patternSource:{...b,x:b.x-T},preventDefault:()=>Y=!0}),Y)return}let F=Et(b,Lt.current.signal);typeof F!="object"&&(F=await F());const N=F,A=[];for(let Y=0;Y({cell:Y.location})))},[Et,on,H,T]),Ei=l.useCallback(()=>{if(L.current===void 0||L.current.range.width<=1)return;const c={...L,current:{...L.current,range:{...L.current.range,width:1}}};yo(c,L)},[yo,L]),Di=l.useCallback(()=>{if(L.current===void 0||L.current.range.height<=1)return;const c={...L,current:{...L.current,range:{...L.current.range,height:1}}};yo(c,L)},[yo,L]),Gl=l.useCallback((c,p)=>{var ee,ae;const b=d;if(f(void 0),Nr(void 0),_r(void 0),Lo.current=!1,p)return;if((b==null?void 0:b.fillHandle)===!0&&L.current!==void 0&&((ee=b.previousSelection)==null?void 0:ee.current)!==void 0){if(Vn===void 0)return;const Q={...L,current:{...L.current,range:Pl(b.previousSelection.current.range,Vn)}};yo(b.previousSelection,Q),Xt(Q,!0);return}const[I,F]=c.location,[N,A]=Gn.current??[],W=()=>{wo.current=!0},_=Q=>{var we,je,ye;const me=Q.isTouch||N===I&&A===F;if(me&&(P==null||P([I-T,F],{...Q,preventDefault:W})),Q.button===1)return!wo.current;if(!wo.current){const he=qt(c.location),lt=ne(he);if(lt!==void 0&<.onClick!==void 0&&me){const kt=lt.onClick({...Q,cell:he,posX:Q.localEventX,posY:Q.localEventY,bounds:Q.bounds,theme:To(he,c.location),preventDefault:W});kt!==void 0&&!Co(kt)&&vo(kt)&&(on([{location:Q.location,value:kt}]),(we=Yt.current)==null||we.damage([{cell:Q.location}]))}if(wo.current||L.current===void 0)return!1;let Pt=!1;switch(he.activationBehaviorOverride??ke){case"double-click":case"second-click":{if(((ye=(je=b==null?void 0:b.previousSelection)==null?void 0:je.current)==null?void 0:ye.cell)===void 0)break;const[kt,hn]=L.current.cell,[vn,gn]=b.previousSelection.current.cell;Pt=I===kt&&I===vn&&F===hn&&F===gn&&(Q.isDoubleClick===!0||ke==="second-click");break}case"single-click":{Pt=!0;break}}if(Pt)return O==null||O([I-T,F]),ho(Q.bounds,!1),!0}return!1},Y=c.location[0]-T;if(c.isTouch){const Q=mt.current,me=Mi.current;if(Q.x!==me.x||Q.y!==me.y)return;if(c.isLongTouch===!0){if(c.kind==="cell"&&Xo((ae=L.current)==null?void 0:ae.cell,c.location)){re==null||re([Y,c.location[1]],{...c,preventDefault:W});return}else if(c.kind==="header"&&L.columns.hasIndex(I)){Re==null||Re(Y,{...c,preventDefault:W});return}else if(c.kind===jt){if(Y<0)return;V==null||V(Y,{...c,preventDefault:W});return}}c.kind==="cell"?_(c)||Ao(c):c.kind===jt?te==null||te(Y,{...c,preventDefault:W}):(c.kind===$n&&(M==null||M(Y,{...c,preventDefault:W})),Ao(c));return}if(c.kind==="header"){if(Y<0)return;c.isEdge?c.isDoubleClick===!0&&ur(I):c.button===0&&I===N&&F===A&&(M==null||M(Y,{...c,preventDefault:W}))}if(c.kind===jt){if(Y<0)return;c.button===0&&I===N&&F===A&&(te==null||te(Y,{...c,preventDefault:W}),wo.current||Ri(c))}c.kind==="cell"&&(c.button===0||c.button===1)&&_(c),Gn.current=void 0},[d,L,T,Vn,yo,Xt,P,qt,ne,ke,To,on,O,ho,re,Re,V,Ao,te,M,ur,Ri]),ql=l.useCallback(c=>{const p={...c,location:[c.location[0]-T,c.location[1]]};_e==null||_e(p),d!==void 0&&c.buttons===0&&(f(void 0),Nr(void 0),_r(void 0),Lo.current=!1),_r(b=>{var I;return Lo.current?[c.scrollEdge[0],0]:c.scrollEdge[0]===(b==null?void 0:b[0])&&c.scrollEdge[1]===b[1]?b:d===void 0||(((I=rn.current)==null?void 0:I.location[0])??0){Ve==null||Ve(c-T,p)},[Ve,T]),pn=(zi=L==null?void 0:L.current)==null?void 0:zi.cell,Zl=l.useCallback((c,p,b,I,F,N)=>{Ze.current=!1;let A=pn;A!==void 0&&(A=[A[0]-T,A[1]]);const W=Be===0?void 0:{x:0,y:c.y,width:Be,height:c.height},_=[];W!==void 0&&_.push(W),qe>0&&(_.push({x:c.x-T,y:v-qe,width:c.width,height:qe}),Be>0&&_.push({x:0,y:v-qe,width:Be,height:qe}));const Y={x:c.x-T,y:c.y,width:c.width,height:gt&&c.y+c.height>=v?c.height-1:c.height,tx:F,ty:N,extras:{selected:A,freezeRegion:W,freezeRegions:_}};mt.current=Y,Gt(Y),ve([p,b,I]),Kt==null||Kt(Y,Y.tx,Y.ty,Y.extras)},[pn,T,gt,v,Be,qe,Gt,Kt]),Jl=bo(Pe,l.useCallback((c,p)=>{Pe==null||Pe(c-T,p-T),se!=="none"&&q(nt.fromSingleSelection(p),void 0,!0)},[se,Pe,T,q])),Vr=l.useRef(!1),Ql=l.useCallback(c=>{if(c.location[0]===0&&T>0){c.preventDefault();return}Ue==null||Ue({...c,location:[c.location[0]-T,c.location[1]]}),c.defaultPrevented()||(Vr.current=!0),f(void 0)},[Ue,T]),es=l.useCallback(()=>{Vr.current=!1},[]),Gr=l.useRef(),qr=l.useCallback(c=>{var p,b,I;if(!Xl(c,Gr.current)&&(Gr.current=c,!(((p=rn==null?void 0:rn.current)==null?void 0:p.button)!==void 0&&rn.current.button>=1))){if(c.buttons!==0&&d!==void 0&&((b=rn.current)==null?void 0:b.location[0])===0&&c.location[0]===0&&T===1&&xe==="multi"&&d.previousSelection&&!d.previousSelection.rows.hasIndex(rn.current.location[1])&&L.rows.hasIndex(rn.current.location[1])){const F=Math.min(rn.current.location[1],c.location[1]),N=Math.max(rn.current.location[1],c.location[1])+1;J(nt.fromSingleSelection([F,N]),void 0,!1)}if(c.buttons!==0&&d!==void 0&&L.current!==void 0&&!Vr.current&&!Lo.current&&(ue==="rect"||ue==="multi-rect")){const[F,N]=L.current.cell;let[A,W]=c.location;if(W<0&&(W=mt.current.y),d.fillHandle===!0&&((I=d.previousSelection)==null?void 0:I.current)!==void 0){const _=d.previousSelection.current.range;W=Math.min(W,gt?v-1:v);const Y=Ka(_,A,W,Ft);Nr(Y)}else{if(gt&&N===v)return;if(gt&&W===v)if(c.kind===Er)W--;else return;A=Math.max(A,T);const ee=A-F,ae=W-N,Q={x:ee>=0?F:A,y:ae>=0?N:W,width:Math.abs(ee)+1,height:Math.abs(ae)+1};K({...L.current,range:Q},!0,!1,"drag")}}yt==null||yt({...c,location:[c.location[0]-T,c.location[1]]})}},[Ft,d,T,xe,L,ue,yt,J,gt,v,K]),ts=l.useCallback(()=>{var A,W;const c=Gr.current;if(c===void 0)return;const[p,b]=c.scrollEdge;let[I,F]=c.location;const N=mt.current;p===-1?I=((W=(A=N.extras)==null?void 0:A.freezeRegion)==null?void 0:W.x)??N.x:p===1&&(I=N.x+N.width),b===-1?F=Math.max(0,N.y):b===1&&(F=Math.min(v-1,N.y+N.height)),I=mn(I,0,Ae.length-1),F=mn(F,0,v-1),qr({...c,location:[I,F]})},[Ae.length,qr,v]);ed(Vl,u,ts);const fn=l.useCallback(c=>{if(L.current===void 0)return;const[p,b]=c,[I,F]=L.current.cell,N=L.current.range;let A=N.x,W=N.x+N.width,_=N.y,Y=N.y+N.height;if(b!==0)switch(b){case 2:{Y=v,_=F,xt(0,Y,"vertical");break}case-2:{_=0,Y=F+1,xt(0,_,"vertical");break}case 1:{_F+1?(Y--,xt(0,Y,"vertical")):(_=Math.max(0,_-1),xt(0,_,"vertical"));break}default:Uo()}if(p!==0)if(p===2)W=Ae.length,A=I,xt(W-1-T,0,"horizontal");else if(p===-2)A=T,W=I+1,xt(A-T,0,"horizontal");else{let ee=[];if(Et!==void 0){const ae=Et({x:A,y:_,width:W-A-T,height:Y-_},Lt.current.signal);typeof ae=="object"&&(ee=id(ae))}if(p===1){let ae=!1;if(A0){const Q=Zn(A+1,I+1).find(me=>!ee.includes(me-T));Q!==void 0&&(A=Q,ae=!0)}else A++,ae=!0;ae&&xt(A,0,"horizontal")}ae||(W=Math.min(Ae.length,W+1),xt(W-1-T,0,"horizontal"))}else if(p===-1){let ae=!1;if(W>I+1){if(ee.length>0){const Q=Zn(W-1,I,-1).find(me=>!ee.includes(me-T));Q!==void 0&&(W=Q,ae=!0)}else W--,ae=!0;ae&&xt(W-T,0,"horizontal")}ae||(A=Math.max(T,A-1),xt(A-T,0,"horizontal"))}else Uo()}K({cell:L.current.cell,range:{x:A,y:_,width:W-A,height:Y-_}},!0,!1,"keyboard-select")},[Et,L,Ae.length,T,v,xt,K]),Bn=l.useCallback((c,p,b,I)=>{const F=zt-(b?0:1);if(c=mn(c,T,Qe.length-1+T),p=mn(p,0,F),c===(pn==null?void 0:pn[0])&&p===(pn==null?void 0:pn[1]))return!1;if(I&&L.current!==void 0){const N=[...L.current.rangeStack];(L.current.range.width>1||L.current.range.height>1)&&N.push(L.current.range),Xt({...L,current:{cell:[c,p],range:{x:c,y:p,width:1,height:1},rangeStack:N}},!0)}else K({cell:[c,p],range:{x:c,y:p,width:1,height:1}},!0,!1,"keyboard-nav");return w.current!==void 0&&w.current[0]===c&&w.current[1]===p&&(w.current=void 0),xt(c-T,p),!0},[zt,T,Qe.length,pn,L,xt,Xt,K]),ns=l.useCallback((c,p)=>{(r==null?void 0:r.cell)!==void 0&&c!==void 0&&vo(c)&&(on([{location:r.cell,value:c}]),window.requestAnimationFrame(()=>{var F;(F=Yt.current)==null||F.damage([{cell:r.cell}])})),Nt(!0),i(void 0);const[b,I]=p;if(L.current!==void 0&&(b!==0||I!==0)){const F=L.current.cell[1]===zt-1&&c!==void 0;Bn(mn(L.current.cell[0]+b,0,Ae.length-1),mn(L.current.cell[1]+I,0,zt-1),F,!1)}X==null||X(c,p)},[r==null?void 0:r.cell,Nt,L,X,on,zt,Bn,Ae.length]),os=l.useMemo(()=>`gdg-overlay-${rd++}`,[]),qn=l.useCallback(c=>{var b,I,F,N;Nt();const p=[];for(let A=c.x;A({cell:A.location})))},[Nt,z,ne,on,T]),zo=r!==void 0,Ii=l.useCallback(c=>{var me,we;const p=()=>{c.stopPropagation(),c.preventDefault()},b={didMatch:!1},{bounds:I}=c,F=L.columns,N=L.rows,A=cn;if(!zo&&Le(A.clear,c,b))Xt(vr,!1),Mt==null||Mt();else if(!zo&&Le(A.selectAll,c,b))Xt({columns:nt.empty(),rows:nt.empty(),current:{cell:((me=L.current)==null?void 0:me.cell)??[T,0],range:{x:T,y:0,width:C.length,height:v},rangeStack:[]}},!1);else if(Le(A.search,c,b))(we=a==null?void 0:a.current)==null||we.focus({preventScroll:!0}),rr(!0);else if(Le(A.delete,c,b)){const je=(k==null?void 0:k(L))??!0;if(je!==!1){const ye=je===!0?L:je;if(ye.current!==void 0){qn(ye.current.range);for(const he of ye.current.rangeStack)qn(he)}for(const he of ye.rows)qn({x:T,y:he,width:C.length,height:1});for(const he of ye.columns)qn({x:he,y:0,width:1,height:v})}}if(b.didMatch)return p(),!0;if(L.current===void 0)return!1;let[W,_]=L.current.cell,Y=!1,ee=!1;Le(A.scrollToSelectedCell,c,b)?gr.current(W-T,_):se!=="none"&&Le(A.selectColumn,c,b)?F.hasIndex(W)?q(F.remove(W),void 0,!0):se==="single"?q(nt.fromSingleSelection(W),void 0,!0):q(void 0,W,!0):xe!=="none"&&Le(A.selectRow,c,b)?N.hasIndex(_)?J(N.remove(_),void 0,!0):xe==="single"?J(nt.fromSingleSelection(_),void 0,!0):J(void 0,_,!0):!zo&&I!==void 0&&Le(A.activateCell,c,b)?_===v&>?window.setTimeout(()=>{const je=dr(W);go(je??W)},0):(O==null||O([W-T,_]),ho(I,!0)):L.current.range.height>1&&Le(A.downFill,c,b)?Di():L.current.range.width>1&&Le(A.rightFill,c,b)?Ei():Le(A.goToNextPage,c,b)?_+=Math.max(1,mt.current.height-4):Le(A.goToPreviousPage,c,b)?_-=Math.max(1,mt.current.height-4):Le(A.goToFirstCell,c,b)?(i(void 0),_=0,W=0):Le(A.goToLastCell,c,b)?(i(void 0),_=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):Le(A.selectToFirstCell,c,b)?(i(void 0),fn([-2,-2])):Le(A.selectToLastCell,c,b)?(i(void 0),fn([2,2])):zo?(Le(A.closeOverlay,c,b)&&i(void 0),Le(A.acceptOverlayDown,c,b)&&(i(void 0),_++),Le(A.acceptOverlayUp,c,b)&&(i(void 0),_--),Le(A.acceptOverlayLeft,c,b)&&(i(void 0),W--),Le(A.acceptOverlayRight,c,b)&&(i(void 0),W++)):(Le(A.goDownCell,c,b)?_+=1:Le(A.goUpCell,c,b)?_-=1:Le(A.goRightCell,c,b)?W+=1:Le(A.goLeftCell,c,b)?W-=1:Le(A.goDownCellRetainSelection,c,b)?(_+=1,Y=!0):Le(A.goUpCellRetainSelection,c,b)?(_-=1,Y=!0):Le(A.goRightCellRetainSelection,c,b)?(W+=1,Y=!0):Le(A.goLeftCellRetainSelection,c,b)?(W-=1,Y=!0):Le(A.goToLastRow,c,b)?_=v-1:Le(A.goToFirstRow,c,b)?_=Number.MIN_SAFE_INTEGER:Le(A.goToLastColumn,c,b)?W=Number.MAX_SAFE_INTEGER:Le(A.goToFirstColumn,c,b)?W=Number.MIN_SAFE_INTEGER:(ue==="rect"||ue==="multi-rect")&&(Le(A.selectGrowDown,c,b)?fn([0,1]):Le(A.selectGrowUp,c,b)?fn([0,-1]):Le(A.selectGrowRight,c,b)?fn([1,0]):Le(A.selectGrowLeft,c,b)?fn([-1,0]):Le(A.selectToLastRow,c,b)?fn([0,2]):Le(A.selectToFirstRow,c,b)?fn([0,-2]):Le(A.selectToLastColumn,c,b)?fn([2,0]):Le(A.selectToFirstColumn,c,b)&&fn([-2,0])),ee=b.didMatch);const ae=Bn(W,_,!1,Y),Q=b.didMatch;return Q&&(ae||!ee||Jo)&&p(),Q},[zo,L,cn,se,xe,ue,T,v,Bn,Xt,Mt,C.length,k,Jo,qn,q,J,gt,dr,go,O,ho,Di,Ei,fn]),Po=l.useCallback(c=>{let p=!1;if(Ye!==void 0&&Ye({...c,cancel:()=>{p=!0}}),p||Ii(c)||L.current===void 0)return;const[b,I]=L.current.cell,F=mt.current;if(at&&!c.metaKey&&!c.ctrlKey&&L.current!==void 0&&c.key.length===1&&/[ -~]/g.test(c.key)&&c.bounds!==void 0&&No(z([b-T,Math.max(0,Math.min(I,v-1))]))){if((!gt||I!==v)&&(F.y>I||I>F.y+F.height||F.x>b||b>F.x+F.width))return;ho(c.bounds,!0,c.key),c.stopPropagation(),c.preventDefault()}},[at,Ye,Ii,L,z,T,v,gt,ho]),rs=l.useCallback((c,p)=>{const b=c.location[0]-T;if(c.kind==="header"&&(Re==null||Re(b,{...c,preventDefault:p})),c.kind===jt){if(b<0)return;V==null||V(b,{...c,preventDefault:p})}if(c.kind==="cell"){const[I,F]=c.location;re==null||re([b,F],{...c,preventDefault:p}),qs(L,c.location)||Bn(I,F,!1,!1)}},[L,re,V,Re,T,Bn]),jr=l.useCallback(async c=>{var A,W,_;if(!cn.paste)return;function p(Y,ee,ae,Q){var we,je;const me=typeof ae=="object"?(ae==null?void 0:ae.join(` +`))??"":(ae==null?void 0:ae.toString())??"";if(!Co(Y)&&No(Y)&&Y.readonly!==!0){const ye=E==null?void 0:E(me,Y);if(ye!==void 0&&vo(ye))return{location:ee,value:ye};const he=ne(Y);if(he===void 0)return;if(he.kind===Z.Custom){Zt(Y.kind===Z.Custom);const lt=(we=he.onPaste)==null?void 0:we.call(he,me,Y.data);return lt===void 0?void 0:{location:ee,value:{...Y,data:lt}}}else{const lt=(je=he.onPaste)==null?void 0:je.call(he,me,Y,{formatted:Q,formattedString:typeof Q=="string"?Q:Q==null?void 0:Q.join(` +`),rawValue:ae});return lt===void 0?void 0:(Zt(lt.kind===Y.kind),{location:ee,value:lt})}}}const b=L.columns,I=L.rows,F=((A=u.current)==null?void 0:A.contains(document.activeElement))===!0||((W=s.current)==null?void 0:W.contains(document.activeElement))===!0;let N;if(L.current!==void 0?N=[L.current.range.x,L.current.range.y]:b.length===1?N=[b.first()??0,0]:I.length===1&&(N=[T,I.first()??0]),F&&N!==void 0){let Y,ee;const ae="text/plain",Q="text/html";if(navigator.clipboard.read!==void 0){const ye=await navigator.clipboard.read();for(const he of ye){if(he.types.includes(Q)){const Pt=await(await he.getType(Q)).text(),kt=rl(Pt);if(kt!==void 0){Y=kt;break}}he.types.includes(ae)&&(ee=await(await he.getType(ae)).text())}}else if(navigator.clipboard.readText!==void 0)ee=await navigator.clipboard.readText();else if(c!==void 0&&(c==null?void 0:c.clipboardData)!==null){if(c.clipboardData.types.includes(Q)){const ye=c.clipboardData.getData(Q);Y=rl(ye)}Y===void 0&&c.clipboardData.types.includes(ae)&&(ee=c.clipboardData.getData(ae))}else return;const[me,we]=N,je=[];do{if(j===void 0){const ye=qt(N),he=ee??(Y==null?void 0:Y.map(Pt=>Pt.map(kt=>kt.rawValue).join(" ")).join(" "))??"",lt=p(ye,N,he,void 0);lt!==void 0&&je.push(lt);break}if(Y===void 0){if(ee===void 0)return;Y=Vc(ee)}if(j===!1||typeof j=="function"&&(j==null?void 0:j([N[0]-T,N[1]],Y.map(ye=>ye.map(he=>{var lt;return((lt=he.rawValue)==null?void 0:lt.toString())??""}))))!==!0)return;for(const[ye,he]of Y.entries()){if(ye+we>=v)break;for(const[lt,Pt]of he.entries()){const kt=[lt+me,ye+we],[hn,vn]=kt;if(hn>=Ae.length||vn>=zt)continue;const gn=qt(kt),Cn=p(gn,kt,Pt.rawValue,Pt.formatted);Cn!==void 0&&je.push(Cn)}}}while(!1);on(je),(_=Yt.current)==null||_.damage(je.map(ye=>({cell:ye.location})))}},[E,ne,qt,L,cn.paste,Ae.length,on,zt,j,T,v]);At("paste",jr,m,!1,!0);const Bo=l.useCallback(async(c,p)=>{var A,W;if(!cn.copy)return;const b=p===!0||((A=u.current)==null?void 0:A.contains(document.activeElement))===!0||((W=s.current)==null?void 0:W.contains(document.activeElement))===!0,I=L.columns,F=L.rows,N=(_,Y)=>{if(!Fe)ll(_,Y,c);else{const ee=Y.map(ae=>({kind:Z.Text,data:C[ae].title,displayData:C[ae].title,allowOverlay:!1}));ll([ee,..._],Y,c)}};if(b&&Et!==void 0){if(L.current!==void 0){let _=Et(L.current.range,Lt.current.signal);typeof _!="object"&&(_=await _()),N(_,Zn(L.current.range.x-T,L.current.range.x+L.current.range.width-T))}else if(F!==void 0&&F.length>0){const Y=[...F].map(ee=>{const ae=Et({x:T,y:ee,width:C.length,height:1},Lt.current.signal);return typeof ae=="object"?ae[0]:ae().then(Q=>Q[0])});if(Y.some(ee=>ee instanceof Promise)){const ee=await Promise.all(Y);N(ee,Zn(C.length))}else N(Y,Zn(C.length))}else if(I.length>0){const _=[],Y=[];for(const ee of I){let ae=Et({x:ee,y:0,width:1,height:v},Lt.current.signal);typeof ae!="object"&&(ae=await ae()),_.push(ae),Y.push(ee-T)}if(_.length===1)N(_[0],Y);else{const ee=_.reduce((ae,Q)=>ae.map((me,we)=>[...me,...Q[we]]));N(ee,Y)}}}},[C,Et,L,cn.copy,T,v,Fe]);At("copy",Bo,m,!1,!1);const is=l.useCallback(async c=>{var b,I;if(!(!cn.cut||!(((b=u.current)==null?void 0:b.contains(document.activeElement))===!0||((I=s.current)==null?void 0:I.contains(document.activeElement))===!0))&&(await Bo(c),L.current!==void 0)){let F={current:{cell:L.current.cell,range:L.current.range,rangeStack:[]},rows:nt.empty(),columns:nt.empty()};const N=k==null?void 0:k(F);if(N===!1||(F=N===!0?F:N,F.current===void 0))return;qn(F.current.range)}},[qn,L,cn.cut,Bo,k]);At("cut",is,m,!1,!1);const ls=l.useCallback((c,p)=>{if(U!==void 0){T!==0&&(c=c.map(F=>[F[0]-T,F[1]])),U(c,p);return}if(c.length===0||p===-1)return;const[b,I]=c[p];w.current!==void 0&&w.current[0]===b&&w.current[1]===I||(w.current=[b,I],Bn(b,I,!1,!1))},[U,T,Bn]),[fr,hr]=((Pi=ut==null?void 0:ut.current)==null?void 0:Pi.cell)??[],gr=l.useRef(xt);gr.current=xt,l.useLayoutEffect(()=>{var c,p,b,I;!Ze.current&&fr!==void 0&&hr!==void 0&&(fr!==((p=(c=zn.current)==null?void 0:c.current)==null?void 0:p.cell[0])||hr!==((I=(b=zn.current)==null?void 0:b.current)==null?void 0:I.cell[1]))&&gr.current(fr,hr),Ze.current=!1},[fr,hr]);const Fi=L.current!==void 0&&(L.current.cell[0]>=Ae.length||L.current.cell[1]>=zt);l.useLayoutEffect(()=>{Fi&&Xt(vr,!1)},[Fi,Xt]);const ss=l.useMemo(()=>gt===!0&&(Ne==null?void 0:Ne.tint)===!0?nt.fromSingleSelection(zt-1):nt.empty(),[zt,gt,Ne==null?void 0:Ne.tint]),as=l.useCallback(c=>typeof It=="boolean"?It:(It==null?void 0:It(c-T))??!0,[T,It]),cs=l.useMemo(()=>{if(Kr===void 0||s.current===null)return null;const{bounds:c,group:p}=Kr,b=s.current.getBoundingClientRect();return l.createElement(Pc,{bounds:c,group:p,canvasBounds:b,onClose:()=>Ur(void 0),onFinish:I=>{Ur(void 0),le==null||le(p,I)}})},[le,Kr]),ds=Math.min(Ae.length,Be+(_t?1:0));l.useImperativeHandle(t,()=>({appendRow:(c,p)=>go(c+T,p),updateCells:c=>{var p;return T!==0&&(c=c.map(b=>({cell:[b.cell[0]+T,b.cell[1]]}))),(p=Yt.current)==null?void 0:p.damage(c)},getBounds:(c,p)=>{var b;if(!((s==null?void 0:s.current)===null||(u==null?void 0:u.current)===null)){if(c===void 0&&p===void 0){const I=s.current.getBoundingClientRect(),F=I.width/u.current.clientWidth;return{x:I.x-u.current.scrollLeft*F,y:I.y-u.current.scrollTop*F,width:u.current.scrollWidth*F,height:u.current.scrollHeight*F}}return(b=Yt.current)==null?void 0:b.getBounds((c??0)+T,p)}},focus:()=>{var c;return(c=Yt.current)==null?void 0:c.focus()},emit:async c=>{switch(c){case"delete":Po({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":Po({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":Po({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 Bo(void 0,!0);break;case"paste":await jr();break}},scrollTo:xt,remeasureColumns:c=>{for(const p of c)ur(p+T)}}),[go,ur,Bo,Po,jr,T,xt]);const[Hi,Ti]=pn??[],us=l.useCallback(c=>{const[p,b]=c;if(b===-1){se!=="none"&&(q(nt.fromSingleSelection(p),void 0,!1),Nt());return}Hi===p&&Ti===b||(K({cell:c,range:{x:p,y:b,width:1,height:1}},!0,!1,"keyboard-nav"),xt(p,b))},[se,Nt,xt,Hi,Ti,K,q]),[fs,hs]=l.useState(!1),Ai=l.useRef(hl(c=>{hs(c)},5)),gs=l.useCallback(()=>{Ai.current(!0),L.current===void 0&&L.columns.length===0&&L.rows.length===0&&d===void 0&&K({cell:[T,ir],range:{x:T,y:ir,width:1,height:1}},!0,!1,"keyboard-select")},[ir,L,d,T,K]),ms=l.useCallback(()=>{Ai.current(!1)},[]),[ws,ys]=l.useMemo(()=>{let c;const p=(ht==null?void 0:ht.scrollbarWidthOverride)??si(),b=v+(gt?1:0);if(typeof $t=="number")c=Ee+b*$t;else{let F=0;const N=Math.min(b,10);for(let A=0;AN.width+F,0)+p;return[`${Math.min(1e5,I)}px`,`${Math.min(1e5,c)}px`]},[Ae,ht==null?void 0:ht.scrollbarWidthOverride,$t,v,gt,Ee]),bs=l.useMemo(()=>da(G),[G]);return l.createElement(Fl.Provider,{value:G},l.createElement(Zc,{style:bs,className:ge,inWidth:x??ws,inHeight:R??ys},l.createElement(Tc,{fillHandle:dt,drawFocusRing:Dt,experimental:ht,fixedShadowX:qo,fixedShadowY:Hn,getRowThemeOverride:h,headerIcons:Rn,imageWindowLoader:En,initialSize:eo,isDraggable:jo,onDragLeave:Zo,onRowMoved:yn,overscrollX:zr,overscrollY:or,preventDiagonalScrolling:oo,rightElement:Kn,rightElementProps:Tn,smoothScrollX:Qo,smoothScrollY:Hr,className:ge,enableGroups:tt,onCanvasFocused:gs,onCanvasBlur:ms,canvasRef:s,onContextMenu:rs,theme:G,cellXOffset:_n,cellYOffset:ir,accessibilityHeight:Ct.height,onDragEnd:es,columns:Ae,nonGrowWidth:fe,drawHeader:Wr,onColumnProposeMove:S,drawCell:$r,disabledRows:ss,freezeColumns:ds,lockColumns:T,firstColAccessible:T===0,getCellContent:qt,minColumnWidth:Ut,maxColumnWidth:an,searchInputRef:a,showSearch:Fo,onSearchClose:Br,highlightRegions:Ul,getCellsForSelection:Et,getGroupDetails:Xr,headerHeight:so,isFocused:fs,groupHeaderHeight:tt?Io:0,freezeTrailingRows:qe+(gt&&(Ne==null?void 0:Ne.sticky)===!0?1:0),hasAppendRow:gt,onColumnResize:dn,onColumnResizeEnd:Or,onColumnResizeStart:co,onCellFocused:us,onColumnMoved:Jl,onDragStart:Ql,onHeaderMenuClick:jl,onItemHovered:qr,isFilling:(d==null?void 0:d.fillHandle)===!0,onMouseMove:ql,onKeyDown:Po,onKeyUp:Je,onMouseDown:_l,onMouseUp:Gl,onDragOverCell:sn,onDrop:Ke,onSearchResultsChanged:ls,onVisibleRegionChanged:Zl,clientSize:oe,rowHeight:$t,searchResults:Se,searchValue:be,onSearchValueChange:De,rows:zt,scrollRef:u,selection:L,translateX:Ct.tx,translateY:Ct.ty,verticalBorder:as,gridRef:Yt,getCellRenderer:ne}),cs,r!==void 0&&l.createElement(l.Suspense,{fallback:null},l.createElement(od,{...r,validateCell:Ho,bloom:D,id:os,getCellRenderer:ne,className:(ht==null?void 0:ht.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:ct,imageEditorOverride:g,onFinishEditing:ns,markdownDivCreateNode:y,isOutsideClick:er}))))},sd=l.forwardRef(ld),cl=20,ad={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>cd(e,e.cell.data,li(e.cell),e.cell.maxSize??cl),onDelete:e=>({...e,data:!1}),onClick:e=>{const{cell:t,posX:n,posY:o,bounds:r,theme:i}=e,{width:a,height:s,x:d,y:f}=r,u=t.maxSize??cl,w=Math.floor(r.y+s/2),m=yl(u,s,i.cellVerticalPadding),g=wl(t.contentAlign??"center",d,a,i.cellHorizontalPadding,m),h=ml(g,w,m),y=bl(d+n,f+o,h);if(li(t)&&y)return{...t,data:Kl(t.data)}},onPaste:(e,t)=>{let n=xr;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=fi),n===t.data?void 0:{...t,data:n}}};function cd(e,t,n,o){if(!n&&t===xr)return;const{ctx:r,hoverAmount:i,theme:a,rect:s,highlighted:d,hoverX:f,hoverY:u,cell:{contentAlign:w}}=e,{x:m,y:g,width:h,height:y}=s,x=.35;let R=n?1-x+x*i:.4;t===xr&&(R*=i),R!==0&&(r.globalAlpha=R,bi(r,a,t,m,g,h,y,d,f,u,o,w),r.globalAlpha=1)}const dd=Qt("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),ud=e=>{const{bubbles:t}=e;return l.createElement(dd,null,t.map((n,o)=>l.createElement("div",{key:o,className:"boe-bubble"},n)),l.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},fd=ud,hd={getAccessibilityString:e=>pl(e.data),kind:Z.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=>md(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return l.createElement(fd,{bubbles:t.data})},onPaste:()=>{}},gd=4;function md(e,t){const{rect:n,theme:o,ctx:r,highlighted:i}=e,{x:a,y:s,width:d,height:f}=n,u=20,w=8,m=gd;let g=a+o.cellHorizontalPadding;const h=[];for(const y of t){if(g>a+d)break;const x=Vo(y,r,o.baseFontFull).width;h.push({x:g,width:x}),g+=x+w*2+m}r.beginPath();for(const y of h)kn(r,y.x,s+(f-u)/2,y.width+w*2,u,o.roundingRadius??u/2);r.fillStyle=i?o.bgBubbleSelected:o.bgBubble,r.fill();for(const[y,x]of h.entries())r.beginPath(),r.fillStyle=o.textBubble,r.fillText(t[y],x.x+w,s+f/2+Xn(r,o))}const wd=Qt("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),yd=e=>{const{drilldowns:t}=e;return l.createElement(wd,null,t.map((n,o)=>l.createElement("div",{key:o,className:"doe-bubble"},n.img!==void 0&&l.createElement("img",{src:n.img}),l.createElement("div",null,n.text))))},bd=yd,pd={getAccessibilityString:e=>pl(e.data.map(t=>t.text)),kind:Z.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=>xd(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return l.createElement(bd,{drilldowns:t.data})},onPaste:()=>{}},vd=4,oi={};function Cd(e,t,n,o){const r=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,s=4,d=n*r,f=o+i,u=o*3,w=(u+i*2)*r,m=`${e},${t},${r},${n}`;if(oi[m]!==void 0)return{el:oi[m],height:d,width:w,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=w,g.height=d,h.scale(r,r),oi[m]=g,h.beginPath(),kn(h,i,i,u,a,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(),kn(h,i+.5,i+.5,u,a,o),h.strokeStyle=t,h.lineWidth=1,h.stroke(),{el:g,height:d,width:w,sideWidth:f*r,middleWidth:o*r,padding:i*r,dpr:r})}function xd(e,t){const{rect:n,theme:o,ctx:r,imageLoader:i,col:a,row:s}=e,{x:d,width:f}=n,u=o.baseFontFull,w=Ml(r,u),m=Math.min(n.height,Math.max(16,Math.ceil(w*o.lineHeight)*2)),g=Math.floor(n.y+(n.height-m)/2),h=m-10,y=8,x=vd;let R=d+o.cellHorizontalPadding;const C=o.roundingRadius??6,v=Cd(o.bgCell,o.drilldownBorder,m,C),z=[];for(const P of t){if(R>d+f)break;const H=Vo(P.text,r,u).width;let X=0;P.img!==void 0&&i.loadOrGetImage(P.img,a,s)!==void 0&&(X=h-8+4);const E=H+X+y*2;z.push({x:R,width:E}),R+=E+x}if(v!==null){const{el:P,height:O,middleWidth:H,sideWidth:X,width:E,dpr:$,padding:B}=v,D=X/$,M=B/$;for(const S of z){const de=Math.floor(S.x),te=Math.floor(S.width),re=te-(D-M)*2;r.imageSmoothingEnabled=!1,r.drawImage(P,0,0,X,O,de-M,g,D,m),re>0&&r.drawImage(P,X,0,H,O,de+(D-M),g,re,m),r.drawImage(P,E-X,0,X,O,de+te-(D-M),g,D,m),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[P,O]of z.entries()){const H=t[P];let X=O.x+y;if(H.img!==void 0){const E=i.loadOrGetImage(H.img,a,s);if(E!==void 0){const $=h-8;let B=0,D=0,M=E.width,S=E.height;M>S?(B+=(M-S)/2,M=S):S>M&&(D+=(S-M)/2,S=M),r.beginPath(),kn(r,X,g+m/2-$/2,$,$,o.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,B,D,M,S,X,g+m/2-$/2,$,$),r.restore(),X+=$+4}}r.beginPath(),r.fillStyle=o.textBubble,r.fillText(H.text,X,g+m/2+Xn(r,o))}}const kd={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sd(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??Ns;return l.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}}},ri=4;function Sd(e,t,n,o){const{rect:r,col:i,row:a,theme:s,ctx:d,imageLoader:f}=e,{x:u,y:w,height:m,width:g}=r,h=m-s.cellVerticalPadding*2,y=[];let x=0;for(let C=0;C0&&(d.beginPath(),kn(d,R,w+s.cellVerticalPadding,v,h,n),d.save(),d.clip()),d.drawImage(C,R,w+s.cellVerticalPadding,v,h),n>0&&d.restore(),R+=v+ri}}function Md(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Rd={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:o,ctx:r,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Md(n,o)*t.skeletonWidthVariability));const d=a.cellHorizontalPadding,f=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);kn(r,i.x+d,i.y+(i.height-f)/2,s,f,a.roundingRadius??3),r.fillStyle=Jn(a.textDark,.1),r.fill()},onPaste:()=>{}},Ed=()=>e=>e.targetWidth,dl=Qt("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Ed(),"px"]}}),Dd=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:r,targetRect:i,onFinish:a,validatedSelection:s}=e,d=t.data,f=t.readonly===!0,[u,w]=l.useState(d===""||o),m=l.useCallback(()=>{w(h=>!h)},[]),g=d?"gdg-ml-6":"";return u?l.createElement(dl,{targetWidth:i.width-20},l.createElement(Dr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:d,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},onChange:n}),l.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>a(t)},l.createElement(Ls,null))):l.createElement(dl,{targetWidth:i.width},l.createElement(Ys,{contents:d,createNode:r}),!f&&l.createElement(l.Fragment,null,l.createElement("div",{className:"spacer"}),l.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:m},l.createElement(hi,null))),l.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Id={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Go,measure:(e,t,n)=>{const o=t.data.split(` +`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>xn(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:a,validatedSelection:s}=e;return l.createElement(Dd,{onFinish:r,targetRect:o,value:n,validatedSelection:s,onChange:d=>t({...n,data:d.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Fd={getAccessibilityString:e=>e.row.toString(),kind:ln.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Hd,measure:()=>44,draw:e=>Ad(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:a}=t,s=n.drawHandle?7+(i-7)/2:i/2,d=a/2;if(Math.abs(o-s)<=10&&Math.abs(r-d)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Hd(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=Td,n.textAlign="center",i}function Td(e){const{ctx:t}=e;t.textAlign="start"}function Ad(e,t,n,o,r,i){const{ctx:a,rect:s,hoverAmount:d,theme:f}=e,{x:u,y:w,width:m,height:g}=s,h=n?1:o==="checkbox-visible"?.6+.4*d:d;if(o!=="number"&&h>0){a.globalAlpha=h;const y=7*(n?d:1);if(bi(a,f,n,r?u+y:u,w,r?m-y:m,g,!0,void 0,void 0,18,"center",i),r){a.globalAlpha=d,a.beginPath();for(const x of[3,6])for(const R of[-5,-1,3])a.rect(u+x,w+g/2+R,2,2);a.fillStyle=f.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!n){const y=t.toString(),x=f.markerFontFull,R=u+m/2;o==="both"&&d!==0&&(a.globalAlpha=1-d),a.fillStyle=f.textLight,a.font=x,a.fillText(y,R,w+g/2+Xn(a,x)),d!==0&&(a.globalAlpha=1)}}const Ld={getAccessibilityString:()=>"",kind:ln.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>zd(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function zd(e,t,n){const{ctx:o,rect:r,hoverAmount:i,theme:a,spriteManager:s}=e,{x:d,y:f,width:u,height:w}=r;o.beginPath(),o.globalAlpha=i,o.rect(d+1,f+1,u,w-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let g=0;if(n!==void 0){const y=w-8,x=d+8/2,R=f+8/2;s.drawSprite(n,"normal",o,x,R,y,a,m?1:i),g=y}else{g=24;const h=12,y=m?h:i*h,x=m?0:(1-i)*h*.5,R=a.cellHorizontalPadding+4;y>0&&(o.moveTo(d+R+x,f+w/2),o.lineTo(d+R+x+y,f+w/2),o.moveTo(d+R+x+y*.5,f+w/2-y*.5),o.lineTo(d+R+x+y*.5,f+w/2+y*.5),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(t,g+d+a.cellHorizontalPadding+.5,f+w/2+Xn(o,a)),o.beginPath()}const Pd=l.lazy(async()=>await fl(()=>import("./number-overlay-editor-3ljU3NGx.js"),__vite__mapDeps([8,1,3,9]),import.meta.url)),Bd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:Go,draw:e=>xn(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 l.createElement(l.Suspense,{fallback:null},l.createElement(Pd,{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}}},Od={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Wd,onPaste:()=>{}};function Wd(e){const{ctx:t,theme:n,rect:o}=e,{x:r,y:i,height:a}=o;t.beginPath();const s=2.5;let d=r+n.cellHorizontalPadding+s;const f=i+a/2,u=Math.cos(Xi(30))*s,w=Math.sin(Xi(30))*s;for(let m=0;m<12;m++)t.moveTo(d,f-s),t.lineTo(d,f+s),t.moveTo(d+u,f-w),t.lineTo(d-u,f+w),t.moveTo(d-u,f-w),t.lineTo(d+u,f+w),d+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const $d={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Go(e,t,e.theme.textLight),draw:e=>xn(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 Bt.createElement(Dr,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:r,onChange:i=>n({...o,data:i.target.value})})},onPaste:()=>{}},Nd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Go,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:r,rect:i,theme:a,overrideCursor:s}=e,{displayData:d,contentAlign:f,hoverEffect:u,allowWrapping:w}=t;if(u===!0&&n>0){r.textBaseline="alphabetic";const m=a.cellHorizontalPadding,g=a.cellVerticalPadding,h=Vo(d,r,a.baseFontFull,"alphabetic"),y=i.height-g,x=Math.min(y,h.actualBoundingBoxAscent*2.5);r.beginPath(),kn(r,i.x+m/2,i.y+(i.height-x)/2+1,h.width+m*3,x-1,a.roundingRadius??4),r.globalAlpha=n,r.fillStyle=Jn(a.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=a.textDark,r.textBaseline="middle",s==null||s("text")}xn(e,d,f,w,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 l.createElement(Dr,{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:a=>o({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Xd=Qt("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Yd=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:r,validatedSelection:i,preview:a}=e,[s,d]=l.useState(!r&&(t===""||o)),f=l.useCallback(()=>{d(!0)},[]);return s?l.createElement(Dr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):l.createElement(Xd,null,l.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&l.createElement("div",{className:"gdg-edit-icon",onClick:f},l.createElement(hi,null)),l.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Kd=Yd;function ul(e,t,n,o){let r=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return o==="right"?r=t.width-a-n.cellHorizontalPadding:o==="center"&&(r=t.width/2-a/2),{x:r,y:i,width:a,height:s}}const Ud={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Go,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:r,hoverY:i,rect:a,ctx:s}=e,d=t.displayData??t.data,f=t.hoverEffect===!0;if(o!==void 0&&f&&r!==void 0&&i!==void 0){const u=Vo(d,s,n.baseFontFull),w=ul(u,a,n,t.contentAlign),{x:m,y:g,width:h,height:y}=w;if(r>=m-4&&r<=m-4+h+8&&i>=g-4&&i<=g-4+y+8){const x=Xn(s,n.baseFontFull);o("pointer");const R=5,C=g-x;s.beginPath(),s.moveTo(a.x+m,Math.floor(a.y+C+y+R)+.5),s.lineTo(a.x+m+h,Math.floor(a.y+C+y+R)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,xn({...e,rect:{...a,x:a.x-1}},d,t.contentAlign),xn({...e,rect:{...a,x:a.x-2}},d,t.contentAlign),xn({...e,rect:{...a,x:a.x+1}},d,t.contentAlign),xn({...e,rect:{...a,x:a.x+2}},d,t.contentAlign),s.restore()}}s.fillStyle=f?n.linkColor:n.textDark,xn(e,d,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:r,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=na(a,i.baseFontFull);if(s===void 0)return;const d=ul(s,n,i,t.contentAlign);Fr({x:d.x-4,y:d.y-4,width:d.width+8,height:d.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 l.createElement(Kd,{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:a=>n({...o,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},_d=[Fd,Ld,ad,hd,pd,kd,Rd,Id,Bd,Od,$d,Nd,Ud],ii=[];class Vd extends El{constructor(){super(...arguments);Oe(this,"imageLoaded",()=>{});Oe(this,"loadedLocations",[]);Oe(this,"cache",{});Oe(this,"sendLoaded",Rs(()=>{this.imageLoaded(new Ko(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 a=0;a{d||(d=!0,ii.length<12?ii.unshift(s):a||(s.src=""))}},u=new Promise(w=>s.addEventListener("load",()=>w(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,await s.decode();const w=this.cache[i];if(w!==void 0&&!d){w.img=s;for(const m of w.cells)this.loadedLocations.push(yi(m));a=!0,this.sendLoaded()}}catch{f.cancel()}}),this.cache[i]=f}loadOrGetImage(n,o,r){const i=n,a=this.cache[i];if(a!==void 0){const s=wn(o,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,o,r,i)}}const Gd=Vd,qd=(e,t)=>{const n=l.useMemo(()=>({...Na,...e.headerIcons}),[e.headerIcons]),o=l.useMemo(()=>e.imageWindowLoader??new Gd,[e.imageWindowLoader]);return l.createElement(sd,{...e,renderers:_d,headerIcons:n,ref:t,imageWindowLoader:o})},su=l.forwardRef(qd);export{Ac as C,su as D,Z as G,Fl as T,Dr as a,Jt as b,ru as c,iu as d,nu as e,vo as f,Xn as g,Wi as h,ou as i,Co as j,Fs as k,da as l,Vo as m,So as p,kn as r,lu as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-Z83AvWlM.js","./index-BMVQvedj.js","./index-wocATsGp.js","./marked.esm-dbrxtycE.js","./iframe-t8ayfGqb.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-ATY7qU3b.js b/docs/assets/data-editor-all-ATY7qU3b.js deleted file mode 100644 index 715f16833..000000000 --- a/docs/assets/data-editor-all-ATY7qU3b.js +++ /dev/null @@ -1,124 +0,0 @@ -var br=Object.defineProperty;var yr=(t,n,d)=>n in t?br(t,n,{enumerable:!0,configurable:!0,writable:!0,value:d}):t[n]=d;var Qo=(t,n,d)=>(yr(t,typeof n!="symbol"?n+"":n,d),d);import{s as nl,a as jt,j as X,F as Kl}from"./marked.esm-dbrxtycE.js";import{r,R as it}from"./index-BMVQvedj.js";import{_ as Mr}from"./iframe-ni8xiI1Q.js";import{G as j,b as zo,i as Mo,r as Wl,c as Lo,C as V,g as ql,d as xr,e as Rr,w as zt,m as el,f as kr,h as Nl,I as xo,p as Sr,j as Tr,t as zr,k as Lr,l as Lt,o as Gl,n as Ul,q as Hr,s as Ro,v as ko,x as Dr,y as Er,z as $r,A as Fr,B as Ar,D as Vl,E as _t,F as Ir,H as Or,J as Bl,K as Pr,u as tl,L as Kr,M as Wr,T as Nr,N as Xl,O as Gr,P as Ur}from"./image-window-loader-hgJATaim.js";import{c as Ht,r as Dt,d as Vr}from"./throttle-7EuXLZa7.js";import{u as Br,f as Yl}from"./flatten-qRvRBp6y.js";import{G as Xr}from"./scrolling-data-grid-ta-GKPbC.js";const Y='',Yr=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y}`},_r=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y}`},jr=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - `},qr=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},Zr=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},Zl=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - - - `},Jr=t=>{const n=t.bgColor;return`${Y} - - - - -`},Qr=Zl,ei=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},ti=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - - - - - - `},oi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - -`},li=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},ni=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},ri=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},ii=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - - `},ci=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - -`},si=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - - `},ai=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},ui=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},di=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},fi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},hi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - - - -`},gi=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},mi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},vi=t=>{const n=t.fgColor,d=t.bgColor;return` - ${Y} - - - `},Ci=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - - -`},wi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} - - -`},pi=t=>{const n=t.fgColor;return` - - - `},bi=t=>{const n=t.fgColor;return` - - - -`},yi={headerRowID:Yr,headerNumber:jr,headerCode:_r,headerString:qr,headerBoolean:Zr,headerAudioUri:Qr,headerVideoUri:ei,headerEmoji:ti,headerImage:oi,headerUri:Zl,headerPhone:li,headerMarkdown:ni,headerDate:ri,headerTime:ii,headerEmail:ci,headerReference:si,headerIfThenElse:ai,headerSingleValue:ui,headerLookup:di,headerTextTemplate:fi,headerMath:hi,headerRollup:gi,headerJoinStrings:mi,headerSplitString:vi,headerGeoDistance:Ci,headerArray:wi,rowOwnerOverlay:pi,protectedColumnOverlay:bi,renameIcon:Jr},Mi=nl("div")({name:"SearchWrapper",class:"slyseh9",propsAsIs:!1}),xi=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})}),Ri=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})}),ki=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}),Si=10,Ti=t=>{const{canvasRef:n,cellYOffset:d,rows:C,columns:k,searchInputRef:H,searchValue:P,searchResults:F,onSearchValueChange:E,getCellsForSelection:M,onSearchResultsChanged:v,showSearch:T=!1,onSearchClose:$}=t,[N]=r.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[O,be]=r.useState(""),ne=P??O,Fe=r.useCallback(z=>{be(z),E==null||E(z)},[E]),[x,p]=r.useState(),le=r.useRef(x);le.current=x,r.useEffect(()=>{F!==void 0&&(F.length>0?p(z=>({rowsSearched:C,results:F.length,selectedIndex:(z==null?void 0:z.selectedIndex)??-1})):p(void 0))},[C,F]);const ye=r.useRef();ye.current===void 0&&(ye.current=new AbortController);const Z=r.useRef(),[_,q]=r.useState([]),J=F??_,U=r.useCallback(()=>{Z.current!==void 0&&(window.cancelAnimationFrame(Z.current),Z.current=void 0,ye.current.abort())},[]),Re=r.useRef(d);Re.current=d;const wt=r.useCallback(z=>{const ee=new RegExp(z.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let re=Re.current,ze=Math.min(10,C),Oe=0;p(void 0),q([]);const st=[],Zt=async()=>{var Ge;if(M===void 0)return;const Do=performance.now(),$t=C-Oe;let at=M({x:0,y:re,width:k.length,height:Math.min(ze,$t,C-re)},ye.current.signal);typeof at=="function"&&(at=await at());let Jt=!1;for(const[fe,Le]of at.entries())for(const[Eo,_e]of Le.entries()){let je;switch(_e.kind){case j.Text:case j.Number:je=_e.displayData;break;case j.Uri:case j.Markdown:je=_e.data;break;case j.Boolean:je=typeof _e.data=="boolean"?_e.data.toString():void 0;break;case j.Image:case j.Bubble:je=_e.data.join("🐳");break;case j.Custom:je=_e.copyData;break}je!==void 0&&ee.test(je)&&(st.push([Eo,fe+re]),Jt=!0)}const Qt=performance.now();Jt&&q([...st]),Oe+=at.length,zo(Oe<=C);const Qe=((Ge=le.current)==null?void 0:Ge.selectedIndex)??-1;p({results:st.length,rowsSearched:Oe,selectedIndex:Qe}),v==null||v(st,Qe),re+ze>=C?re=0:re+=ze;const ut=Qt-Do,dt=Math.max(ut,1),ft=Si/dt;ze=Math.ceil(ze*ft),Oe{var z;$==null||$(),p(void 0),q([]),v==null||v([],-1),U(),(z=n==null?void 0:n.current)==null||z.focus()},[U,n,$,v]),qt=r.useCallback(z=>{Fe(z.target.value),F===void 0&&(z.target.value===""?(p(void 0),q([]),U()):wt(z.target.value))},[wt,U,Fe,F]);r.useEffect(()=>{T&&H.current!==null&&(Fe(""),H.current.focus({preventScroll:!0}))},[T,H,Fe]);const ct=r.useCallback(z=>{var re;if((re=z==null?void 0:z.stopPropagation)==null||re.call(z),x===void 0)return;const ee=(x.selectedIndex+1)%x.results;p({...x,selectedIndex:ee}),v==null||v(J,ee)},[x,v,J]),Te=r.useCallback(z=>{var re;if((re=z==null?void 0:z.stopPropagation)==null||re.call(z),x===void 0)return;let ee=(x.selectedIndex-1)%x.results;ee<0&&(ee+=x.results),p({...x,selectedIndex:ee}),v==null||v(J,ee)},[v,J,x]),Ae=r.useCallback(z=>{(z.ctrlKey||z.metaKey)&&z.nativeEvent.code==="KeyF"||z.key==="Escape"?(se(),z.stopPropagation(),z.preventDefault()):z.key==="Enter"&&(z.shiftKey?Te():ct())},[se,ct,Te]);r.useEffect(()=>()=>{U()},[U]);const[Et,Ie]=r.useState(!1);r.useEffect(()=>{if(T)Ie(!0);else{const z=setTimeout(()=>Ie(!1),150);return()=>clearTimeout(z)}},[T]);const Ho=r.useMemo(()=>{if(!T&&!Et)return null;let z;x!==void 0&&(z=x.results>=1e3?"over 1000":`${x.results} result${x.results!==1?"s":""}`,x.selectedIndex>=0&&(z=`${x.selectedIndex+1} of ${z}`));const ee=Oe=>{Oe.stopPropagation()},ze={width:`${Math.floor(((x==null?void 0:x.rowsSearched)??0)/C*100)}%`};return jt(Mi,{className:T?"":"out",onMouseDown:ee,onMouseMove:ee,onMouseUp:ee,onClick:ee,children:[jt("div",{className:"gdg-search-bar-inner",children:[X("input",{id:N,"aria-hidden":!T,"data-testid":"search-input",ref:H,onChange:qt,value:ne,tabIndex:T?void 0:-1,onKeyDownCapture:Ae}),X("button",{"aria-label":"Previous Result","aria-hidden":!T,tabIndex:T?void 0:-1,onClick:Te,disabled:((x==null?void 0:x.results)??0)===0,children:xi}),X("button",{"aria-label":"Next Result","aria-hidden":!T,tabIndex:T?void 0:-1,onClick:ct,disabled:((x==null?void 0:x.results)??0)===0,children:Ri}),$!==void 0&&X("button",{"aria-label":"Close Search","aria-hidden":!T,"data-testid":"search-close-button",tabIndex:T?void 0:-1,onClick:se,children:ki})]}),x!==void 0?jt(Kl,{children:[X("div",{className:"gdg-search-status",children:X("div",{"data-testid":"search-result-area",children:z})}),X("div",{className:"gdg-search-progress",style:ze})]}):X("div",{className:"gdg-search-status",children:X("label",{htmlFor:N,children:"Type to search"})})]})},[T,Et,x,C,N,H,qt,ne,Ae,Te,ct,$,se]);return jt(Kl,{children:[X(Xr,{prelightCells:J,accessibilityHeight:t.accessibilityHeight,canvasRef:t.canvasRef,cellXOffset:t.cellXOffset,cellYOffset:t.cellYOffset,className:t.className,clientSize:t.clientSize,columns:t.columns,disabledRows:t.disabledRows,enableGroups:t.enableGroups,fillHandle:t.fillHandle,firstColAccessible:t.firstColAccessible,nonGrowWidth:t.nonGrowWidth,fixedShadowX:t.fixedShadowX,fixedShadowY:t.fixedShadowY,freezeColumns:t.freezeColumns,getCellContent:t.getCellContent,getCellRenderer:t.getCellRenderer,getGroupDetails:t.getGroupDetails,getRowThemeOverride:t.getRowThemeOverride,groupHeaderHeight:t.groupHeaderHeight,headerHeight:t.headerHeight,highlightRegions:t.highlightRegions,imageWindowLoader:t.imageWindowLoader,initialSize:t.initialSize,isFilling:t.isFilling,isFocused:t.isFocused,lockColumns:t.lockColumns,maxColumnWidth:t.maxColumnWidth,minColumnWidth:t.minColumnWidth,onHeaderMenuClick:t.onHeaderMenuClick,onMouseMove:t.onMouseMove,onVisibleRegionChanged:t.onVisibleRegionChanged,overscrollX:t.overscrollX,overscrollY:t.overscrollY,preventDiagonalScrolling:t.preventDiagonalScrolling,rightElement:t.rightElement,rightElementProps:t.rightElementProps,rowHeight:t.rowHeight,rows:t.rows,scrollRef:t.scrollRef,selection:t.selection,theme:t.theme,freezeTrailingRows:t.freezeTrailingRows,hasAppendRow:t.hasAppendRow,translateX:t.translateX,translateY:t.translateY,verticalBorder:t.verticalBorder,onColumnProposeMove:t.onColumnProposeMove,drawFocusRing:t.drawFocusRing,drawCell:t.drawCell,drawHeader:t.drawHeader,experimental:t.experimental,gridRef:t.gridRef,headerIcons:t.headerIcons,isDraggable:t.isDraggable,onCanvasBlur:t.onCanvasBlur,onCanvasFocused:t.onCanvasFocused,onCellFocused:t.onCellFocused,onColumnMoved:t.onColumnMoved,onColumnResize:t.onColumnResize,onColumnResizeEnd:t.onColumnResizeEnd,onColumnResizeStart:t.onColumnResizeStart,onContextMenu:t.onContextMenu,onDragEnd:t.onDragEnd,onDragLeave:t.onDragLeave,onDragOverCell:t.onDragOverCell,onDragStart:t.onDragStart,onDrop:t.onDrop,onItemHovered:t.onItemHovered,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,onMouseDown:t.onMouseDown,onMouseUp:t.onMouseUp,onRowMoved:t.onRowMoved,smoothScrollX:t.smoothScrollX,smoothScrollY:t.smoothScrollY}),Ho]})},zi=Ti;class Li extends r.PureComponent{constructor(){super(...arguments);Qo(this,"wrapperRef",r.createRef());Qo(this,"clickOutside",d=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(d))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(d.target)){let C=d.target;for(;C!==null;){if(C.classList.contains("click-outside-ignore"))return;C=C.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:d,isOutsideClick:C,...k}=this.props;return X("div",{...k,ref:this.wrapperRef,children:this.props.children})}}const Hi=()=>t=>Math.max(16,t.targetHeight-10),Di=nl("input")({name:"RenameInput",class:"r1fzhvm4",propsAsIs:!1,vars:{"r1fzhvm4-0":[Hi(),"px"]}}),Ei=t=>{const{bounds:n,group:d,onClose:C,canvasBounds:k,onFinish:H}=t,[P,F]=it.useState(d);return X(Li,{style:{position:"absolute",left:n.x-k.left+1,top:n.y-k.top,width:n.width-2,height:n.height},className:"c181oggi",onClickOutside:C,children:X(Di,{targetHeight:n.height,"data-testid":"group-rename-input",value:P,onBlur:C,onFocus:E=>E.target.setSelectionRange(0,P.length),onChange:E=>F(E.target.value),onKeyDown:E=>{E.key==="Enter"?H(P):E.key==="Escape"&&C()},autoFocus:!0})})},ll=150;function $i(t,n,d,C){var H;const k=C(n);return((H=k==null?void 0:k.measure)==null?void 0:H.call(k,t,n,d))??ll}function Jl(t,n,d,C,k,H,P,F,E){let M=0;const v=k===void 0?[]:k.map($=>{const N=$i(t,$[C],n,E);return M=Math.max(M,N),N});if(v.length>5&&F){M=0;let $=0;for(const O of v)$+=O;const N=$/v.length;for(let O=0;O=N*2?v[O]=0:M=Math.max(M,v[O])}M=Math.max(M,t.measureText(d.title).width+16+(d.icon===void 0?0:28));const T=Math.max(Math.ceil(H),Math.min(Math.floor(P),Math.ceil(M)));return{...d,width:T}}function Fi(t,n,d,C,k,H,P,F,E){const M=r.useRef(n),v=r.useRef(d),T=r.useRef(P);M.current=n,v.current=d,T.current=P;const[$,N]=r.useMemo(()=>{if(typeof window>"u")return[null,null];const x=document.createElement("canvas");return x.style.display="none",x.style.opacity="0",x.style.position="fixed",[x,x.getContext("2d",{alpha:!1})]},[]);r.useLayoutEffect(()=>($&&document.documentElement.append($),()=>{$==null||$.remove()}),[$]);const O=r.useRef({}),be=r.useRef(),[ne,Fe]=r.useState();return r.useLayoutEffect(()=>{const x=v.current;if(x===void 0||t.every(Mo))return;let p=Math.max(1,10-Math.floor(t.length/1e4)),le=0;p1&&(p--,le=1);const ye={x:0,y:0,width:t.length,height:Math.min(M.current,p)},Z={x:0,y:M.current-1,width:t.length,height:1};(async()=>{const q=x(ye,E.signal),J=le>0?x(Z,E.signal):void 0;let U;typeof q=="object"?U=q:U=await Wl(q),J!==void 0&&(typeof J=="object"?U=[...U,...J]:U=[...U,...await Wl(J)]),be.current=t,Fe(U)})()},[E.signal,t]),r.useMemo(()=>{let p=t.every(Mo)?t:N===null?t.map(_=>Mo(_)?_:{..._,width:ll}):(N.font=T.current.baseFontFull,t.map((_,q)=>{if(Mo(_))return _;if(O.current[_.id]!==void 0)return{..._,width:O.current[_.id]};if(ne===void 0||be.current!==t||_.id===void 0)return{..._,width:ll};const J=Jl(N,P,_,q,ne,k,H,!0,F);return O.current[_.id]=J.width,J})),le=0,ye=0;const Z=[];for(const[_,q]of p.entries())le+=q.width,q.grow!==void 0&&q.grow>0&&(ye+=q.grow,Z.push(_));if(le0){const _=[...p],q=C-le;let J=q;for(let U=0;U1&&t.startsWith("_")?Number.parseInt(t.slice(1))===n.keyCode:t.length===1&&t>="a"&&t<="z"?t.toUpperCase().codePointAt(0)===n.keyCode:t===n.key}function A(t,n,d){const C=Ql(t,n);return C&&(d.didMatch=!0),C}function Ql(t,n){if(t.length===0)return!1;if(t.includes("|")){const E=t.split("|");for(const M of E)if(Ql(M,n))return!0;return!1}let d=!1,C=!1,k=!1,H=!1;const P=t.split("+"),F=P.pop();if(!Ai(F,n))return!1;if(P[0]==="any")return!0;for(const E of P)switch(E){case"ctrl":d=!0;break;case"shift":C=!0;break;case"alt":k=!0;break;case"meta":H=!0;break;case"primary":Lo.value?H=!0:d=!0;break}return n.altKey===k&&n.ctrlKey===d&&n.shiftKey===C&&n.metaKey===H}function Ii(t,n,d,C,k,H){const P=it.useCallback((M,v,T,$)=>{var x;(H==="cell"||H==="multi-cell")&&M!==void 0&&(M={...M,range:{x:M.cell[0],y:M.cell[1],width:1,height:1}});const N=d==="mixed"&&(T||$==="drag"),O=C==="mixed"&&N,be=k==="mixed"&&N;let ne={current:M===void 0?void 0:{...M,rangeStack:$==="drag"?((x=t.current)==null?void 0:x.rangeStack)??[]:[]},columns:O?t.columns:V.empty(),rows:be?t.rows:V.empty()};T&&(H==="multi-rect"||H==="multi-cell")&&ne.current!==void 0&&t.current!==void 0&&(ne={...ne,current:{...ne.current,rangeStack:[...t.current.rangeStack,t.current.range]}}),n(ne,v)},[C,t,d,H,k,n]),F=it.useCallback((M,v,T)=>{M=M??t.rows,v!==void 0&&(M=M.add(v));let $;if(k==="exclusive"&&M.length>0)$={current:void 0,columns:V.empty(),rows:M};else{const N=T&&d==="mixed",O=T&&C==="mixed";$={current:N?t.current:void 0,columns:O?t.columns:V.empty(),rows:M}}n($,!1)},[C,t,d,k,n]),E=it.useCallback((M,v,T)=>{M=M??t.columns,v!==void 0&&(M=M.add(v));let $;if(C==="exclusive"&&M.length>0)$={current:void 0,rows:V.empty(),columns:M};else{const N=T&&d==="mixed",O=T&&k==="mixed";$={current:N?t.current:void 0,rows:O?t.rows:V.empty(),columns:M}}n($,!1)},[C,t,d,k,n]);return[P,F,E]}function Oi(t,n,d,C,k){const H=r.useCallback(M=>{if(t===!0){const v=[];for(let T=M.y;T=k?$.push({kind:j.Loading,allowOverlay:!1}):$.push(n([N,T]));v.push($)}return v}return(t==null?void 0:t(M,C.signal))??[]},[C.signal,n,t,k]),P=t!==void 0?H:void 0,F=r.useCallback(M=>{if(P===void 0)return[];const v={...M,x:M.x-d};if(v.x<0){v.x=0,v.width--;const T=P(v,C.signal);return typeof T=="function"?async()=>(await T()).map($=>[{kind:j.Loading,allowOverlay:!1},...$]):T.map($=>[{kind:j.Loading,allowOverlay:!1},...$])}return P(v,C.signal)},[C.signal,P,d]);return[t!==void 0?F:void 0,P]}function _l(t){return typeof t=="string"?t:`${t}px`}const Pi=()=>t=>t.innerWidth,Ki=()=>t=>t.innerHeight,Wi=nl("div")({name:"Wrapper",class:"w2q57ts",propsAsIs:!1,vars:{"w2q57ts-0":[Pi()],"w2q57ts-1":[Ki()]}}),Ni=t=>{const{inWidth:n,inHeight:d,children:C,...k}=t;return X(Wi,{innerHeight:_l(d),innerWidth:_l(n),...k,children:C})},Gi=2,Ui=1300;function Vi(t,n,d){const C=it.useRef(0),[k,H]=t??[0,0];it.useEffect(()=>{if(k===0&&H===0){C.current=0;return}let P=!1,F=0;const E=M=>{var v;if(!P){if(F===0)F=M;else{const T=M-F;C.current=Math.min(1,C.current+T/Ui);const $=C.current**1.618*T*Gi;(v=n.current)==null||v.scrollBy(k*$,H*$),F=M,d==null||d()}window.requestAnimationFrame(E)}};return window.requestAnimationFrame(E),()=>{P=!0}},[n,k,H,d])}function Bi({rowHeight:t,headerHeight:n,groupHeaderHeight:d,theme:C,overscrollX:k,overscrollY:H,scaleToRem:P,remSize:F}){const[E,M,v,T,$,N]=it.useMemo(()=>{if(!P||F===16)return[t,n,d,C,k,H];const O=F/16,be=t,ne=ql();return[typeof be=="number"?be*O:Fe=>Math.ceil(be(Fe)*O),Math.ceil(n*O),Math.ceil(d*O),{...C,headerIconSize:((C==null?void 0:C.headerIconSize)??ne.headerIconSize)*O,cellHorizontalPadding:((C==null?void 0:C.cellHorizontalPadding)??ne.cellHorizontalPadding)*O,cellVerticalPadding:((C==null?void 0:C.cellVerticalPadding)??ne.cellVerticalPadding)*O},Math.ceil((k??0)*O),Math.ceil((H??0)*O)]},[d,n,k,H,F,t,P,C]);return{rowHeight:E,headerHeight:M,groupHeaderHeight:v,theme:T,overscrollX:$,overscrollY:N}}const rt={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 I(t,n){return t===!0?n:t===!1?"":t}function jl(t){const n=Lo.value;return{activateCell:I(t.activateCell," |Enter|shift+Enter"),clear:I(t.clear,"any+Escape"),closeOverlay:I(t.closeOverlay,"any+Escape"),acceptOverlayDown:I(t.acceptOverlayDown,"Enter"),acceptOverlayUp:I(t.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:I(t.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:I(t.acceptOverlayRight,"Tab"),copy:t.copy,cut:t.cut,delete:I(t.delete,n?"Backspace|Delete":"Delete"),downFill:I(t.downFill,"primary+_68"),scrollToSelectedCell:I(t.scrollToSelectedCell,"primary+Enter"),goDownCell:I(t.goDownCell,"ArrowDown"),goDownCellRetainSelection:I(t.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:I(t.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:I(t.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:I(t.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:I(t.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:I(t.goUpCell,"ArrowUp"),goUpCellRetainSelection:I(t.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:I(t.goToFirstCell,"primary+Home"),goToFirstColumn:I(t.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:I(t.goToFirstRow,"primary+ArrowUp"),goToLastCell:I(t.goToLastCell,"primary+End"),goToLastColumn:I(t.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:I(t.goToLastRow,"primary+ArrowDown"),goToNextPage:I(t.goToNextPage,"PageDown"),goToPreviousPage:I(t.goToPreviousPage,"PageUp"),paste:t.paste,rightFill:I(t.rightFill,"primary+_82"),search:I(t.search,"primary+f"),selectAll:I(t.selectAll,"primary+a"),selectColumn:I(t.selectColumn,"ctrl+ "),selectGrowDown:I(t.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:I(t.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:I(t.selectGrowRight,"shift+ArrowRight"),selectGrowUp:I(t.selectGrowUp,"shift+ArrowUp"),selectRow:I(t.selectRow,"shift+ "),selectToFirstCell:I(t.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:I(t.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:I(t.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:I(t.selectToLastCell,"primary+shift+End"),selectToLastColumn:I(t.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:I(t.selectToLastRow,"primary+shift+ArrowDown")}}function Xi(t){const n=xr(t);return it.useMemo(()=>{if(n===void 0)return jl(rt);const d={...n,goToNextPage:(n==null?void 0:n.goToNextPage)??(n==null?void 0:n.pageDown)??rt.goToNextPage,goToPreviousPage:(n==null?void 0:n.goToPreviousPage)??(n==null?void 0:n.pageUp)??rt.goToPreviousPage,goToFirstCell:(n==null?void 0:n.goToFirstCell)??(n==null?void 0:n.first)??rt.goToFirstCell,goToLastCell:(n==null?void 0:n.goToLastCell)??(n==null?void 0:n.last)??rt.goToLastCell,selectToFirstCell:(n==null?void 0:n.selectToFirstCell)??(n==null?void 0:n.first)??rt.selectToFirstCell,selectToLastCell:(n==null?void 0:n.selectToLastCell)??(n==null?void 0:n.last)??rt.selectToLastCell};return jl({...rt,...d})},[n])}const Yi=r.lazy(async()=>await Mr(()=>import("./data-grid-overlay-editor-hmiBYkvZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let _i=0;function ji(t){return Br(Yl(Yl(t).filter(n=>n.span!==void 0).map(n=>{var d,C;return Dt((((d=n.span)==null?void 0:d[0])??0)+1,(((C=n.span)==null?void 0:C[1])??0)+1)})))}function So(t,n){return t===void 0||n===0||t.columns.length===0&&t.current===void 0?t:{current:t.current===void 0?void 0:{cell:[t.current.cell[0]+n,t.current.cell[1]],range:{...t.current.range,x:t.current.range.x+n},rangeStack:t.current.rangeStack.map(d=>({...d,x:d.x+n}))},rows:t.rows,columns:t.columns.offset(n)}}const ol={kind:j.Loading,allowOverlay:!1},To={columns:V.empty(),rows:V.empty(),current:void 0},qi=(t,n)=>{var Ol,Pl;const[d,C]=r.useState(To),[k,H]=r.useState(),P=r.useRef(null),F=r.useRef(null),[E,M]=r.useState(),v=r.useRef(null),T=r.useRef(),$=typeof window>"u"?null:window,{imageEditorOverride:N,getRowThemeOverride:O,markdownDivCreateNode:be,width:ne,height:Fe,columns:x,rows:p,getCellContent:le,onCellClicked:ye,onCellActivated:Z,onFillPattern:_,onFinishedEditing:q,coercePasteValue:J,drawHeader:U,drawCell:Re,editorBloom:wt,onHeaderClicked:se,onColumnProposeMove:qt,spanRangeBehavior:ct="default",onGroupHeaderClicked:Te,onCellContextMenu:Ae,className:Et,onHeaderContextMenu:Ie,getCellsForSelection:Ho,onGroupHeaderContextMenu:z,onGroupHeaderRenamed:ee,onCellEdited:re,onCellsEdited:ze,onSearchResultsChanged:Oe,searchResults:st,onSearchValueChange:Zt,searchValue:Do,onKeyDown:$t,onKeyUp:at,keybindings:Jt,editOnType:Qt=!0,onRowAppended:Qe,onColumnMoved:ut,validateCell:dt,highlightRegions:ft,rangeSelect:Ge="rect",columnSelect:fe="multi",rowSelect:Le="multi",rangeSelectionBlending:Eo="exclusive",columnSelectionBlending:_e="exclusive",rowSelectionBlending:je="exclusive",onDelete:$o,onDragStart:eo,onMouseMove:to,onPaste:ht,copyHeaders:rl=!1,freezeColumns:qe=0,cellActivationBehavior:Fo="second-click",rowSelectionMode:Ao="auto",onHeaderMenuClick:oo,getGroupDetails:lo,onSearchClose:Io,onItemHovered:no,onSelectionCleared:et,showSearch:en,onVisibleRegionChanged:ro,gridSelection:gt,onGridSelectionChange:Oo,minColumnWidth:tn=50,maxColumnWidth:on=500,maxColumnAutoWidth:ln,provideEditor:nn,trailingRowOptions:W,freezeTrailingRows:Ze=0,allowedFillDirections:il="orthogonal",scrollOffsetX:Ft,scrollOffsetY:Ue,verticalBorder:pt,onDragOverCell:rn,onDrop:cn,onColumnResize:At,onColumnResizeEnd:It,onColumnResizeStart:Ot,customRenderers:io,fillHandle:sn,drawFocusRing:an,experimental:ae,fixedShadowX:un,fixedShadowY:dn,headerIcons:fn,imageWindowLoader:hn,initialSize:gn,isDraggable:mn,onDragLeave:vn,onRowMoved:Pt,overscrollX:Cn,overscrollY:wn,preventDiagonalScrolling:pn,rightElement:bn,rightElementProps:yn,trapFocus:cl=!1,smoothScrollX:Mn,smoothScrollY:xn,scaleToRem:Rn=!1,rowHeight:kn=34,headerHeight:sl=36,groupHeaderHeight:Sn=sl,theme:Tn,isOutsideClick:zn,renderers:Po}=t,he=typeof t.rowMarkers=="string"?void 0:t.rowMarkers,Pe=(he==null?void 0:he.kind)??t.rowMarkers??"none",Ln=(he==null?void 0:he.width)??t.rowMarkerWidth,al=(he==null?void 0:he.startIndex)??t.rowMarkerStartIndex??1,ul=(he==null?void 0:he.theme)??t.rowMarkerTheme,co=(he==null?void 0:he.checkboxStyle)??"square",bt=Math.max(tn,20),so=Math.max(on,bt),Hn=Math.max(ln??so,bt),dl=r.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),Dn=r.useMemo(()=>Number.parseFloat(dl.fontSize),[dl]),{rowHeight:He,headerHeight:Ko,groupHeaderHeight:fl,theme:hl,overscrollX:En,overscrollY:$n}=Bi({groupHeaderHeight:Sn,headerHeight:sl,overscrollX:Cn,overscrollY:wn,remSize:Dn,rowHeight:kn,scaleToRem:Rn,theme:Tn}),tt=Xi(Jt),yt=Ln??(p>1e4?48:p>1e3?44:p>100?36:32),Ve=Pe!=="none",s=Ve?1:0,Q=Qe!==void 0,Kt=(W==null?void 0:W.sticky)===!0,[Fn,gl]=r.useState(!1),An=en??Fn,In=r.useCallback(()=>{Io!==void 0?Io():gl(!1)},[Io]),u=r.useMemo(()=>gt===void 0?void 0:So(gt,s),[gt,s])??d,Me=r.useRef();Me.current===void 0&&(Me.current=new AbortController),r.useEffect(()=>()=>Me==null?void 0:Me.current.abort(),[]);const[ce,On]=Oi(Ho,le,s,Me.current,p),Pn=r.useCallback((e,l,o)=>{if(dt===void 0)return!0;const i=[e[0]-s,e[1]];return dt==null?void 0:dt(i,l,o)},[s,dt]),ao=r.useRef(gt),De=r.useCallback((e,l)=>{l&&(e=Rr(e,ce,s,ct,Me.current)),Oo!==void 0?(ao.current=So(e,-s),Oo(ao.current)):C(e)},[Oo,ce,s,ct]),Mt=zt(At,r.useCallback((e,l,o,i)=>{At==null||At(x[o-s],l,o-s,i)},[At,s,x])),Kn=zt(It,r.useCallback((e,l,o,i)=>{It==null||It(x[o-s],l,o-s,i)},[It,s,x])),Wn=zt(Ot,r.useCallback((e,l,o,i)=>{Ot==null||Ot(x[o-s],l,o-s,i)},[Ot,s,x])),Nn=zt(U,r.useCallback((e,l)=>(U==null?void 0:U({...e,columnIndex:e.columnIndex-s},l))??!1,[U,s])),Gn=zt(Re,r.useCallback((e,l)=>(Re==null?void 0:Re({...e,col:e.col-s},l))??!1,[Re,s])),ot=r.useCallback(e=>{if($o!==void 0){const l=$o(So(e,-s));return typeof l=="boolean"?l:So(l,s)}return!0},[$o,s]),[ge,me,ie]=Ii(u,De,Eo,_e,je,Ge),ve=r.useMemo(()=>el(ql(),hl),[hl]),[Wo,Un]=r.useState([0,0,0]),ml=r.useMemo(()=>{if(Po===void 0)return{};const e={};for(const l of Po)e[l.kind]=l;return e},[Po]),Ce=r.useCallback(e=>e.kind!==j.Custom?ml[e.kind]:io==null?void 0:io.find(l=>l.isMatch(e)),[io,ml]);let{sizedColumns:ke,nonGrowWidth:vl}=Fi(x,p,On,Wo[0]-(s===0?0:yt)-Wo[2],bt,Hn,ve,Ce,Me.current);Pe!=="none"&&(vl+=yt);const No=r.useMemo(()=>ke.some(e=>e.group!==void 0),[ke]),Wt=No?Ko+fl:Ko,Cl=u.rows.length,wl=Pe==="none"?void 0:Cl===0?!1:Cl===p?!0:void 0,G=r.useMemo(()=>Pe==="none"?ke:[{title:"",width:yt,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ul,rowMarker:co,rowMarkerChecked:wl},...ke],[Pe,ke,yt,ul,co,wl]),[pl,bl]=r.useMemo(()=>[Ue!==void 0&&typeof He=="number"?Math.floor(Ue/He):0,Ue!==void 0&&typeof He=="number"?-(Ue%He):0],[Ue,He]),we=r.useRef({height:1,width:1,x:0,y:0}),Vn=r.useMemo(()=>({x:we.current.x,y:pl,width:we.current.width??1,height:we.current.height??1,ty:bl}),[bl,pl]),Nt=r.useRef(!1),[Je,yl,uo]=kr(Vn);we.current=Je;const Ml=(Je.height??1)>1;r.useLayoutEffect(()=>{if(Ue!==void 0&&v.current!==null&&Ml){if(v.current.scrollTop===Ue)return;v.current.scrollTop=Ue,v.current.scrollTop!==Ue&&uo(),Nt.current=!0}},[Ue,Ml,uo]);const xl=(Je.width??1)>1;r.useLayoutEffect(()=>{if(Ft!==void 0&&v.current!==null&&xl){if(v.current.scrollLeft===Ft)return;v.current.scrollLeft=Ft,v.current.scrollLeft!==Ft&&uo(),Nt.current=!0}},[Ft,xl,uo]);const Bn=Je.x+s,fo=Je.y,xe=r.useRef(null),pe=r.useCallback(e=>{var l;e===!0?(l=xe.current)==null||l.focus():window.requestAnimationFrame(()=>{var o;(o=xe.current)==null||o.focus()})},[]),ue=Q?p+1:p,Ee=r.useCallback(e=>{const l=s===0?e:e.map(i=>({...i,location:[i.location[0]-s,i.location[1]]})),o=ze==null?void 0:ze(l);if(o!==!0)for(const i of l)re==null||re(i.location,i.value);return o},[re,ze,s]),[mt,Go]=r.useState(),ho=u.current!==void 0&&u.current.range.width*u.current.range.height>1?u.current.range:void 0,Xn=r.useMemo(()=>{if((ft===void 0||ft.length===0)&&ho===void 0&&mt===void 0)return;const e=[];if(ft!==void 0)for(const l of ft){const o=G.length-l.range.x-s;o>0&&e.push({color:l.color,range:{...l.range,x:l.range.x+s,width:Math.min(o,l.range.width)},style:l.style})}return mt!==void 0&&e.push({color:Nl(ve.accentColor,0),range:mt,style:"dashed"}),ho!==void 0&&e.push({color:Nl(ve.accentColor,.5),range:ho,style:"solid-outline"}),e.length>0?e:void 0},[mt,ho,ft,G.length,ve.accentColor,s]),Rl=r.useRef(G);Rl.current=G;const Se=r.useCallback(([e,l],o=!1)=>{var h,a,f,m,g,b,y;const i=Q&&l===ue-1;if(e===0&&Ve)return i?ol:{kind:xo.Marker,allowOverlay:!1,checkboxStyle:co,checked:(u==null?void 0:u.rows.hasIndex(l))===!0,markerKind:Pe==="clickable-number"?"number":Pe,row:al+l,drawHandle:Pt!==void 0,cursor:Pe==="clickable-number"?"pointer":void 0};if(i){const S=e===s?(W==null?void 0:W.hint)??"":"",L=Rl.current[e];if(((h=L==null?void 0:L.trailingRowOptions)==null?void 0:h.disabled)===!0)return ol;{const K=((a=L==null?void 0:L.trailingRowOptions)==null?void 0:a.hint)??S,D=((f=L==null?void 0:L.trailingRowOptions)==null?void 0:f.addIcon)??(W==null?void 0:W.addIcon);return{kind:xo.NewRow,hint:K,allowOverlay:!1,icon:D}}}else{const w=e-s;if(o||(ae==null?void 0:ae.strict)===!0){const L=we.current,K=L.x>w||w>L.x+L.width||L.y>l||l>L.y+L.height||l>=Vo.current,D=w===((g=(m=L.extras)==null?void 0:m.selected)==null?void 0:g[0])&&l===((b=L.extras)==null?void 0:b.selected[1]);let R=!1;if(((y=L.extras)==null?void 0:y.freezeRegions)!==void 0){for(const B of L.extras.freezeRegions)if(Sr(B,w,l)){R=!0;break}}if(K&&!D&&!R)return ol}let S=le([w,l]);return s!==0&&S.span!==void 0&&(S={...S,span:[S.span[0]+s,S.span[1]+s]}),S}},[Q,ue,Ve,co,u==null?void 0:u.rows,Pe,al,Pt,s,W==null?void 0:W.hint,W==null?void 0:W.addIcon,ae==null?void 0:ae.strict,le]),Uo=r.useCallback(e=>{let l=(lo==null?void 0:lo(e))??{name:e};return ee!==void 0&&e!==""&&(l={icon:l.icon,name:l.name,overrideTheme:l.overrideTheme,actions:[...l.actions??[],{title:"Rename",icon:"renameIcon",onClick:o=>Xo({group:l.name,bounds:o.bounds})}]}),l},[lo,ee]),go=r.useCallback(e=>{var f;const[l,o]=e.cell,i=G[l],c=(i==null?void 0:i.group)!==void 0?(f=Uo(i.group))==null?void 0:f.overrideTheme:void 0,h=i==null?void 0:i.themeOverride,a=O==null?void 0:O(o);H({...e,theme:el(ve,c,h,a,e.content.themeOverride)})},[O,G,Uo,ve]),xt=r.useCallback((e,l,o)=>{var a;if(u.current===void 0)return;const[i,c]=u.current.cell,h=Se([i,c]);if(h.kind!==j.Boolean&&h.allowOverlay){let f=h;if(o!==void 0)switch(f.kind){case j.Number:{const m=Tr(()=>o==="-"?-0:Number.parseFloat(o),0);f={...f,data:Number.isNaN(m)?0:m};break}case j.Text:case j.Markdown:case j.Uri:f={...f,data:o};break}go({target:e,content:f,initialValue:o,cell:[i,c],highlight:o===void 0,forceEditMode:o!==void 0})}else h.kind===j.Boolean&&l&&h.readonly!==!0&&(Ee([{location:u.current.cell,value:{...h,data:zr(h.data)}}]),(a=xe.current)==null||a.damage([{cell:u.current.cell}]))},[Se,u,Ee,go]),kl=r.useCallback((e,l)=>{var c;const o=(c=xe.current)==null?void 0:c.getBounds(e,l);if(o===void 0||v.current===null)return;const i=Se([e,l]);i.allowOverlay&&go({target:o,content:i,initialValue:void 0,highlight:!0,cell:[e,l],forceEditMode:!0})},[Se,go]),te=r.useCallback((e,l,o="both",i=0,c=0,h=void 0)=>{if(v.current!==null){const a=xe.current,f=F.current,m=typeof e!="number"?e.unit==="cell"?e.amount:void 0:e,g=typeof l!="number"?l.unit==="cell"?l.amount:void 0:l,b=typeof e!="number"&&e.unit==="px"?e.amount:void 0,y=typeof l!="number"&&l.unit==="px"?l.amount:void 0;if(a!==null&&f!==null){let w={x:0,y:0,width:0,height:0},S=0,L=0;if((m!==void 0||g!==void 0)&&(w=a.getBounds((m??0)+s,g??0)??w,w.width===0||w.height===0))return;const K=f.getBoundingClientRect(),D=K.width/f.offsetWidth;if(b!==void 0&&(w={...w,x:b-K.left-v.current.scrollLeft,width:1}),y!==void 0&&(w={...w,y:y+K.top-v.current.scrollTop,height:1}),w!==void 0){const R={x:w.x-i,y:w.y-c,width:w.width+2*i,height:w.height+2*c};let B=0;for(let Jo=0;Jo0&&(de=Lr(ue,oe,He));let We=B*D+K.left+s*yt*D,Xe=K.right,Ne=K.top+Wt*D,Ye=K.bottom-de*D;const bo=w.width+i*2;switch(h==null?void 0:h.hAlign){case"start":Xe=We+bo;break;case"end":We=Xe-bo;break;case"center":We=Math.floor((We+Xe)/2)-bo/2,Xe=We+bo;break}const yo=w.height+c*2;switch(h==null?void 0:h.vAlign){case"start":Ye=Ne+yo;break;case"end":Ne=Ye-yo;break;case"center":Ne=Math.floor((Ne+Ye)/2)-yo/2,Ye=Ne+yo;break}We>R.x?S=R.x-We:XeR.y?L=R.y-Ne:Ye=ue-oe)&&(L=0),(S!==0||L!==0)&&(D!==1&&(S/=D,L/=D),v.current.scrollTo(S+v.current.scrollLeft,L+v.current.scrollTop))}}}},[s,Ze,yt,Wt,qe,ke,ue,Kt,He]),Sl=r.useRef(kl),Tl=r.useRef(le),Vo=r.useRef(p);Sl.current=kl,Tl.current=le,Vo.current=p;const Rt=r.useCallback(async(e,l=!0)=>{var m;const o=G[e];if(((m=o==null?void 0:o.trailingRowOptions)==null?void 0:m.disabled)===!0)return;const i=Qe==null?void 0:Qe();let c,h=!0;i!==void 0&&(c=await i,c==="top"&&(h=!1),typeof c=="number"&&(h=!1));let a=0;const f=()=>{if(Vo.current<=p){a<500&&window.setTimeout(f,a),a=50+a*2;return}const g=typeof c=="number"?c:h?p:0;po.current(e-s,g),ge({cell:[e,g],range:{x:e,y:g,width:1,height:1}},!1,!1,"edit");const b=Tl.current([e-s,g]);b.allowOverlay&&ko(b)&&b.readonly!==!0&&l&&window.setTimeout(()=>{Sl.current(e,g)},0)};f()},[G,Qe,s,p,ge]),mo=r.useCallback(e=>{var o,i;const l=((i=(o=ke[e])==null?void 0:o.trailingRowOptions)==null?void 0:i.targetColumn)??(W==null?void 0:W.targetColumn);if(typeof l=="number")return l+(Ve?1:0);if(typeof l=="object"){const c=x.indexOf(l);if(c>=0)return c+(Ve?1:0)}},[ke,x,Ve,W==null?void 0:W.targetColumn]),lt=r.useRef(),kt=r.useRef(),Gt=r.useCallback((e,l)=>{var c;const[o,i]=l;return el(ve,(c=G[o])==null?void 0:c.themeOverride,O==null?void 0:O(i),e.themeOverride)},[O,G,ve]),Ut=r.useCallback(e=>{var b,y,w;const l=Lo.value?e.metaKey:e.ctrlKey,o=l&&Le==="multi",i=l&&fe==="multi",[c,h]=e.location,a=u.columns,f=u.rows,[m,g]=((b=u.current)==null?void 0:b.cell)??[];if(e.kind==="cell"){if(kt.current=void 0,vt.current=[c,h],c===0&&Ve){if(Q===!0&&h===p||Pe==="number"||Le==="none")return;const S=Se(e.location);if(S.kind!==xo.Marker)return;if(Pt!==void 0){const D=Ce(S);zo((D==null?void 0:D.kind)===xo.Marker);const R=(y=D==null?void 0:D.onClick)==null?void 0:y.call(D,{...e,cell:S,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:Gt(S,e.location),preventDefault:()=>{}});if(R===void 0||R.checked===S.checked)return}H(void 0),pe();const L=f.hasIndex(h),K=lt.current;if(Le==="multi"&&(e.shiftKey||e.isLongTouch===!0)&&K!==void 0&&f.hasIndex(K)){const D=[Math.min(K,h),Math.max(K,h)+1];o||Ao==="multi"?me(void 0,D,!0):me(V.fromSingleSelection(D),void 0,o)}else o||e.isTouch||Ao==="multi"?L?me(f.remove(h),void 0,!0):(me(void 0,h,!0),lt.current=h):L&&f.length===1?me(V.empty(),void 0,l):(me(V.fromSingleSelection(h),void 0,l),lt.current=h)}else if(c>=s&&Q&&h===p){const S=mo(c);Rt(S??c)}else if(m!==c||g!==h){const S=Se(e.location),L=Ce(S);if((L==null?void 0:L.onSelect)!==void 0){let R=!1;if(L.onSelect({...e,cell:S,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>R=!0,theme:Gt(S,e.location)}),R)return}const K=Kt&&h===p,D=Kt&&u!==void 0&&((w=u.current)==null?void 0:w.cell[1])===p;if((e.shiftKey||e.isLongTouch===!0)&&m!==void 0&&g!==void 0&&u.current!==void 0&&!D){if(K)return;const R=Math.min(c,m),B=Math.max(c,m),de=Math.min(h,g),oe=Math.max(h,g);ge({...u.current,range:{x:R,y:de,width:B-R+1,height:oe-de+1}},!0,l,"click"),lt.current=void 0,pe()}else ge({cell:[c,h],range:{x:c,y:h,width:1,height:1}},!0,l,"click"),lt.current=void 0,H(void 0),pe()}}else if(e.kind==="header")if(vt.current=[c,h],H(void 0),Ve&&c===0)lt.current=void 0,kt.current=void 0,Le==="multi"&&(f.length!==p?me(V.fromSingleSelection([0,p]),void 0,l):me(V.empty(),void 0,l),pe());else{const S=kt.current;if(fe==="multi"&&(e.shiftKey||e.isLongTouch===!0)&&S!==void 0&&a.hasIndex(S)){const L=[Math.min(S,c),Math.max(S,c)+1];i?ie(void 0,L,l):ie(V.fromSingleSelection(L),void 0,l)}else i?(a.hasIndex(c)?ie(a.remove(c),void 0,l):ie(void 0,c,l),kt.current=c):fe!=="none"&&(ie(V.fromSingleSelection(c),void 0,l),kt.current=c);lt.current=void 0,pe()}else e.kind===Lt?vt.current=[c,h]:e.kind===Gl&&!e.isMaybeScrollbar&&(De(To,!1),H(void 0),pe(),et==null||et(),lt.current=void 0,kt.current=void 0)},[Rt,fe,pe,Ce,mo,Se,u,Ve,Kt,et,Pt,s,Pe,Le,Ao,p,ge,De,ie,me,Q,Gt]),Vt=r.useRef(!1),vt=r.useRef(),zl=r.useRef(Je),$e=r.useRef(),Yn=r.useCallback(e=>{if(St.current=!1,zl.current=we.current,e.button!==0&&e.button!==1){$e.current=void 0;return}const l=performance.now();$e.current={button:e.button,time:l,location:e.location},(e==null?void 0:e.kind)==="header"&&(Vt.current=!0);const o=e.kind==="cell"&&e.isFillHandle;!o&&e.kind!=="cell"&&e.isEdge||(M({previousSelection:u,fillHandle:o}),vt.current=void 0,!e.isTouch&&e.button===0&&!o?Ut(e):!e.isTouch&&e.button===1&&(vt.current=e.location))},[u,Ut]),[Bo,Xo]=r.useState(),Ll=r.useCallback(e=>{if(e.kind!==Lt||fe!=="multi")return;const l=Lo.value?e.metaKey:e.ctrlKey,[o]=e.location,i=u.columns;if(o=s&&Ul(c.group,G[f].group);f--)h--;for(let f=o+1;f{if(ce!==void 0&&Mt!==void 0){const l=we.current.y,o=we.current.height;let i=ce({x:e,y:l,width:1,height:Math.min(o,p-l)},Me.current.signal);typeof i!="object"&&(i=await i());const c=ke[e-s],a=document.createElement("canvas").getContext("2d",{alpha:!1});if(a!==null){a.font=ve.baseFontFull;const f=Jl(a,ve,c,0,i,bt,so,!1,Ce);Mt==null||Mt(c,f.width,e,f.width)}}},[ke,ce,so,ve,bt,Mt,s,p,Ce]),[_n,Yo]=r.useState(),Tt=r.useCallback(async(e,l)=>{var f,m;const o=(f=e.current)==null?void 0:f.range;if(o===void 0||ce===void 0||l.current===void 0)return;const i=l.current.range;if(_!==void 0){let g=!1;if(_({fillDestination:{...i,x:i.x-s},patternSource:{...o,x:o.x-s},preventDefault:()=>g=!0}),g)return}let c=ce(o,Me.current.signal);typeof c!="object"&&(c=await c());const h=c,a=[];for(let g=0;g({cell:g.location})))},[ce,Ee,_,s]),Hl=r.useCallback(()=>{if(u.current===void 0||u.current.range.width<=1)return;const e={...u,current:{...u.current,range:{...u.current.range,width:1}}};Tt(e,u)},[Tt,u]),Dl=r.useCallback(()=>{if(u.current===void 0||u.current.range.height<=1)return;const e={...u,current:{...u.current,range:{...u.current.range,height:1}}};Tt(e,u)},[Tt,u]),jn=r.useCallback((e,l)=>{var b,y;const o=E;if(M(void 0),Go(void 0),Yo(void 0),Vt.current=!1,l)return;if((o==null?void 0:o.fillHandle)===!0&&u.current!==void 0&&((b=o.previousSelection)==null?void 0:b.current)!==void 0){if(mt===void 0)return;const w={...u,current:{...u.current,range:Dr(o.previousSelection.current.range,mt)}};Tt(o.previousSelection,w),De(w,!0);return}const[i,c]=e.location,[h,a]=vt.current??[],f=()=>{St.current=!0},m=w=>{var L,K,D;const S=w.isTouch||h===i&&a===c;if(S&&(ye==null||ye([i-s,c],{...w,preventDefault:f})),w.button===1)return!St.current;if(!St.current){const R=Se(e.location),B=Ce(R);if(B!==void 0&&B.onClick!==void 0&&S){const oe=B.onClick({...w,cell:R,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Gt(R,e.location),preventDefault:f});oe!==void 0&&!Ro(oe)&&_t(oe)&&(Ee([{location:w.location,value:oe}]),(L=xe.current)==null||L.damage([{cell:w.location}]))}if(St.current||u.current===void 0)return!1;let de=!1;switch(R.activationBehaviorOverride??Fo){case"double-click":case"second-click":{if(((D=(K=o==null?void 0:o.previousSelection)==null?void 0:K.current)==null?void 0:D.cell)===void 0)break;const[oe,We]=u.current.cell,[Xe,Ne]=o.previousSelection.current.cell;de=i===oe&&i===Xe&&c===We&&c===Ne&&(w.isDoubleClick===!0||Fo==="second-click");break}case"single-click":{de=!0;break}}if(de)return Z==null||Z([i-s,c]),xt(w.bounds,!1),!0}return!1},g=e.location[0]-s;if(e.isTouch){const w=we.current,S=zl.current;if(w.x!==S.x||w.y!==S.y)return;if(e.isLongTouch===!0){if(e.kind==="cell"&&Er((y=u.current)==null?void 0:y.cell,e.location)){Ae==null||Ae([g,e.location[1]],{...e,preventDefault:f});return}else if(e.kind==="header"&&u.columns.hasIndex(i)){Ie==null||Ie(g,{...e,preventDefault:f});return}else if(e.kind===Lt){if(g<0)return;z==null||z(g,{...e,preventDefault:f});return}}e.kind==="cell"?m(e)||Ut(e):e.kind===Lt?Te==null||Te(g,{...e,preventDefault:f}):(e.kind===$r&&(se==null||se(g,{...e,preventDefault:f})),Ut(e));return}if(e.kind==="header"){if(g<0)return;e.isEdge?e.isDoubleClick===!0&&vo(i):e.button===0&&i===h&&c===a&&(se==null||se(g,{...e,preventDefault:f}))}if(e.kind===Lt){if(g<0)return;e.button===0&&i===h&&c===a&&(Te==null||Te(g,{...e,preventDefault:f}),St.current||Ll(e))}e.kind==="cell"&&(e.button===0||e.button===1)&&m(e),vt.current=void 0},[E,u,s,mt,Tt,De,ye,Se,Ce,Fo,Gt,Ee,Z,xt,Ae,Ie,z,Ut,Te,se,vo,Ll]),qn=r.useCallback(e=>{const l={...e,location:[e.location[0]-s,e.location[1]]};to==null||to(l),E!==void 0&&e.buttons===0&&(M(void 0),Go(void 0),Yo(void 0),Vt.current=!1),Yo(o=>{var i;return Vt.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===(o==null?void 0:o[0])&&e.scrollEdge[1]===o[1]?o:E===void 0||(((i=$e.current)==null?void 0:i.location[0])??0){oo==null||oo(e-s,l)},[oo,s]),Be=(Ol=u==null?void 0:u.current)==null?void 0:Ol.cell,Jn=r.useCallback((e,l,o,i,c,h)=>{Nt.current=!1;let a=Be;a!==void 0&&(a=[a[0]-s,a[1]]);const f=qe===0?void 0:{x:0,y:e.y,width:qe,height:e.height},m=[];f!==void 0&&m.push(f),Ze>0&&(m.push({x:e.x-s,y:p-Ze,width:e.width,height:Ze}),qe>0&&m.push({x:0,y:p-Ze,width:qe,height:Ze}));const g={x:e.x-s,y:e.y,width:e.width,height:Q&&e.y+e.height>=p?e.height-1:e.height,tx:c,ty:h,extras:{selected:a,freezeRegion:f,freezeRegions:m}};we.current=g,yl(g),Un([l,o,i]),ro==null||ro(g,g.tx,g.ty,g.extras)},[Be,s,Q,p,qe,Ze,yl,ro]),Qn=zt(ut,r.useCallback((e,l)=>{ut==null||ut(e-s,l-s),fe!=="none"&&ie(V.fromSingleSelection(l),void 0,!0)},[fe,ut,s,ie])),_o=r.useRef(!1),er=r.useCallback(e=>{if(e.location[0]===0&&s>0){e.preventDefault();return}eo==null||eo({...e,location:[e.location[0]-s,e.location[1]]}),e.defaultPrevented()||(_o.current=!0),M(void 0)},[eo,s]),tr=r.useCallback(()=>{_o.current=!1},[]),jo=r.useRef(),qo=r.useCallback(e=>{var l,o,i;if(!Fr(e,jo.current)&&(jo.current=e,!(((l=$e==null?void 0:$e.current)==null?void 0:l.button)!==void 0&&$e.current.button>=1))){if(e.buttons!==0&&E!==void 0&&((o=$e.current)==null?void 0:o.location[0])===0&&e.location[0]===0&&s===1&&Le==="multi"&&E.previousSelection&&!E.previousSelection.rows.hasIndex($e.current.location[1])&&u.rows.hasIndex($e.current.location[1])){const c=Math.min($e.current.location[1],e.location[1]),h=Math.max($e.current.location[1],e.location[1])+1;me(V.fromSingleSelection([c,h]),void 0,!1)}if(e.buttons!==0&&E!==void 0&&u.current!==void 0&&!_o.current&&!Vt.current&&(Ge==="rect"||Ge==="multi-rect")){const[c,h]=u.current.cell;let[a,f]=e.location;if(f<0&&(f=we.current.y),E.fillHandle===!0&&((i=E.previousSelection)==null?void 0:i.current)!==void 0){const m=E.previousSelection.current.range;f=Math.min(f,Q?p-1:p);const g=Ar(m,a,f,il);Go(g)}else{if(Q&&h===p)return;if(Q&&f===p)if(e.kind===Gl)f--;else return;a=Math.max(a,s);const b=a-c,y=f-h,w={x:b>=0?c:a,y:y>=0?h:f,width:Math.abs(b)+1,height:Math.abs(y)+1};ge({...u.current,range:w},!0,!1,"drag")}}no==null||no({...e,location:[e.location[0]-s,e.location[1]]})}},[il,E,s,Le,u,Ge,no,me,Q,p,ge]),or=r.useCallback(()=>{var a,f;const e=jo.current;if(e===void 0)return;const[l,o]=e.scrollEdge;let[i,c]=e.location;const h=we.current;l===-1?i=((f=(a=h.extras)==null?void 0:a.freezeRegion)==null?void 0:f.x)??h.x:l===1&&(i=h.x+h.width),o===-1?c=Math.max(0,h.y):o===1&&(c=Math.min(p-1,h.y+h.height)),i=Ht(i,0,G.length-1),c=Ht(c,0,p-1),qo({...e,location:[i,c]})},[G.length,qo,p]);Vi(_n,v,or);const Ke=r.useCallback(e=>{if(u.current===void 0)return;const[l,o]=e,[i,c]=u.current.cell,h=u.current.range;let a=h.x,f=h.x+h.width,m=h.y,g=h.y+h.height;if(o!==0)switch(o){case 2:{g=p,m=c,te(0,g,"vertical");break}case-2:{m=0,g=c+1,te(0,m,"vertical");break}case 1:{mc+1?(g--,te(0,g,"vertical")):(m=Math.max(0,m-1),te(0,m,"vertical"));break}default:Vl()}if(l!==0)if(l===2)f=G.length,a=i,te(f-1-s,0,"horizontal");else if(l===-2)a=s,f=i+1,te(a-s,0,"horizontal");else{let b=[];if(ce!==void 0){const y=ce({x:a,y:m,width:f-a-s,height:g-m},Me.current.signal);typeof y=="object"&&(b=ji(y))}if(l===1){let y=!1;if(a0){const w=Dt(a+1,i+1).find(S=>!b.includes(S-s));w!==void 0&&(a=w,y=!0)}else a++,y=!0;y&&te(a,0,"horizontal")}y||(f=Math.min(G.length,f+1),te(f-1-s,0,"horizontal"))}else if(l===-1){let y=!1;if(f>i+1){if(b.length>0){const w=Dt(f-1,i,-1).find(S=>!b.includes(S-s));w!==void 0&&(f=w,y=!0)}else f--,y=!0;y&&te(f-s,0,"horizontal")}y||(a=Math.max(s,a-1),te(a-s,0,"horizontal"))}else Vl()}ge({cell:u.current.cell,range:{x:a,y:m,width:f-a,height:g-m}},!0,!1,"keyboard-select")},[ce,u,G.length,s,p,te,ge]),nt=r.useCallback((e,l,o,i)=>{const c=ue-(o?0:1);if(e=Ht(e,s,ke.length-1+s),l=Ht(l,0,c),e===(Be==null?void 0:Be[0])&&l===(Be==null?void 0:Be[1]))return!1;if(i&&u.current!==void 0){const h=[...u.current.rangeStack];(u.current.range.width>1||u.current.range.height>1)&&h.push(u.current.range),De({...u,current:{cell:[e,l],range:{x:e,y:l,width:1,height:1},rangeStack:h}},!0)}else ge({cell:[e,l],range:{x:e,y:l,width:1,height:1}},!0,!1,"keyboard-nav");return T.current!==void 0&&T.current[0]===e&&T.current[1]===l&&(T.current=void 0),te(e-s,l),!0},[ue,s,ke.length,Be,u,te,De,ge]),lr=r.useCallback((e,l)=>{(k==null?void 0:k.cell)!==void 0&&e!==void 0&&_t(e)&&(Ee([{location:k.cell,value:e}]),window.requestAnimationFrame(()=>{var c;(c=xe.current)==null||c.damage([{cell:k.cell}])})),pe(!0),H(void 0);const[o,i]=l;if(u.current!==void 0&&(o!==0||i!==0)){const c=u.current.cell[1]===ue-1&&e!==void 0;nt(Ht(u.current.cell[0]+o,0,G.length-1),Ht(u.current.cell[1]+i,0,ue-1),c,!1)}q==null||q(e,l)},[k==null?void 0:k.cell,pe,u,q,Ee,ue,nt,G.length]),nr=r.useMemo(()=>`gdg-overlay-${_i++}`,[]),Ct=r.useCallback(e=>{var o,i,c,h;pe();const l=[];for(let a=e.x;a({cell:a.location})))},[pe,le,Ce,Ee,s]),Bt=k!==void 0,El=r.useCallback(e=>{var S,L;const l=()=>{e.stopPropagation(),e.preventDefault()},o={didMatch:!1},{bounds:i}=e,c=u.columns,h=u.rows,a=tt;if(!Bt&&A(a.clear,e,o))De(To,!1),et==null||et();else if(!Bt&&A(a.selectAll,e,o))De({columns:V.empty(),rows:V.empty(),current:{cell:((S=u.current)==null?void 0:S.cell)??[s,0],range:{x:s,y:0,width:x.length,height:p},rangeStack:[]}},!1);else if(A(a.search,e,o))(L=P==null?void 0:P.current)==null||L.focus({preventScroll:!0}),gl(!0);else if(A(a.delete,e,o)){const K=(ot==null?void 0:ot(u))??!0;if(K!==!1){const D=K===!0?u:K;if(D.current!==void 0){Ct(D.current.range);for(const R of D.current.rangeStack)Ct(R)}for(const R of D.rows)Ct({x:s,y:R,width:x.length,height:1});for(const R of D.columns)Ct({x:R,y:0,width:1,height:p})}}if(o.didMatch)return l(),!0;if(u.current===void 0)return!1;let[f,m]=u.current.cell,g=!1,b=!1;A(a.scrollToSelectedCell,e,o)?po.current(f-s,m):fe!=="none"&&A(a.selectColumn,e,o)?c.hasIndex(f)?ie(c.remove(f),void 0,!0):fe==="single"?ie(V.fromSingleSelection(f),void 0,!0):ie(void 0,f,!0):Le!=="none"&&A(a.selectRow,e,o)?h.hasIndex(m)?me(h.remove(m),void 0,!0):Le==="single"?me(V.fromSingleSelection(m),void 0,!0):me(void 0,m,!0):!Bt&&i!==void 0&&A(a.activateCell,e,o)?m===p&&Q?window.setTimeout(()=>{const K=mo(f);Rt(K??f)},0):(Z==null||Z([f-s,m]),xt(i,!0)):u.current.range.height>1&&A(a.downFill,e,o)?Dl():u.current.range.width>1&&A(a.rightFill,e,o)?Hl():A(a.goToNextPage,e,o)?m+=Math.max(1,we.current.height-4):A(a.goToPreviousPage,e,o)?m-=Math.max(1,we.current.height-4):A(a.goToFirstCell,e,o)?(H(void 0),m=0,f=0):A(a.goToLastCell,e,o)?(H(void 0),m=Number.MAX_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER):A(a.selectToFirstCell,e,o)?(H(void 0),Ke([-2,-2])):A(a.selectToLastCell,e,o)?(H(void 0),Ke([2,2])):Bt?(A(a.closeOverlay,e,o)&&H(void 0),A(a.acceptOverlayDown,e,o)&&(H(void 0),m++),A(a.acceptOverlayUp,e,o)&&(H(void 0),m--),A(a.acceptOverlayLeft,e,o)&&(H(void 0),f--),A(a.acceptOverlayRight,e,o)&&(H(void 0),f++)):(A(a.goDownCell,e,o)?m+=1:A(a.goUpCell,e,o)?m-=1:A(a.goRightCell,e,o)?f+=1:A(a.goLeftCell,e,o)?f-=1:A(a.goDownCellRetainSelection,e,o)?(m+=1,g=!0):A(a.goUpCellRetainSelection,e,o)?(m-=1,g=!0):A(a.goRightCellRetainSelection,e,o)?(f+=1,g=!0):A(a.goLeftCellRetainSelection,e,o)?(f-=1,g=!0):A(a.goToLastRow,e,o)?m=p-1:A(a.goToFirstRow,e,o)?m=Number.MIN_SAFE_INTEGER:A(a.goToLastColumn,e,o)?f=Number.MAX_SAFE_INTEGER:A(a.goToFirstColumn,e,o)?f=Number.MIN_SAFE_INTEGER:(Ge==="rect"||Ge==="multi-rect")&&(A(a.selectGrowDown,e,o)?Ke([0,1]):A(a.selectGrowUp,e,o)?Ke([0,-1]):A(a.selectGrowRight,e,o)?Ke([1,0]):A(a.selectGrowLeft,e,o)?Ke([-1,0]):A(a.selectToLastRow,e,o)?Ke([0,2]):A(a.selectToFirstRow,e,o)?Ke([0,-2]):A(a.selectToLastColumn,e,o)?Ke([2,0]):A(a.selectToFirstColumn,e,o)&&Ke([-2,0])),b=o.didMatch);const y=nt(f,m,!1,g),w=o.didMatch;return w&&(y||!b||cl)&&l(),w},[Bt,u,tt,fe,Le,Ge,s,p,nt,De,et,x.length,ot,cl,Ct,ie,me,Q,mo,Rt,Z,xt,Dl,Hl,Ke]),Xt=r.useCallback(e=>{let l=!1;if($t!==void 0&&$t({...e,cancel:()=>{l=!0}}),l||El(e)||u.current===void 0)return;const[o,i]=u.current.cell,c=we.current;if(Qt&&!e.metaKey&&!e.ctrlKey&&u.current!==void 0&&e.key.length===1&&/[ -~]/g.test(e.key)&&e.bounds!==void 0&&ko(le([o-s,Math.max(0,Math.min(i,p-1))]))){if((!Q||i!==p)&&(c.y>i||i>c.y+c.height||c.x>o||o>c.x+c.width))return;xt(e.bounds,!0,e.key),e.stopPropagation(),e.preventDefault()}},[Qt,$t,El,u,le,s,p,Q,xt]),rr=r.useCallback((e,l)=>{const o=e.location[0]-s;if(e.kind==="header"&&(Ie==null||Ie(o,{...e,preventDefault:l})),e.kind===Lt){if(o<0)return;z==null||z(o,{...e,preventDefault:l})}if(e.kind==="cell"){const[i,c]=e.location;Ae==null||Ae([o,c],{...e,preventDefault:l}),Or(u,e.location)||nt(i,c,!1,!1)}},[u,Ae,z,Ie,s,nt]),Zo=r.useCallback(async e=>{var a,f,m;if(!tt.paste)return;function l(g,b,y,w){var L,K;const S=typeof y=="object"?(y==null?void 0:y.join(` -`))??"":(y==null?void 0:y.toString())??"";if(!Ro(g)&&ko(g)&&g.readonly!==!0){const D=J==null?void 0:J(S,g);if(D!==void 0&&_t(D))return{location:b,value:D};const R=Ce(g);if(R===void 0)return;if(R.kind===j.Custom){zo(g.kind===j.Custom);const B=(L=R.onPaste)==null?void 0:L.call(R,S,g.data);return B===void 0?void 0:{location:b,value:{...g,data:B}}}else{const B=(K=R.onPaste)==null?void 0:K.call(R,S,g,{formatted:w,formattedString:typeof w=="string"?w:w==null?void 0:w.join(` -`),rawValue:y});return B===void 0?void 0:(zo(B.kind===g.kind),{location:b,value:B})}}}const o=u.columns,i=u.rows,c=((a=v.current)==null?void 0:a.contains(document.activeElement))===!0||((f=F.current)==null?void 0:f.contains(document.activeElement))===!0;let h;if(u.current!==void 0?h=[u.current.range.x,u.current.range.y]:o.length===1?h=[o.first()??0,0]:i.length===1&&(h=[s,i.first()??0]),c&&h!==void 0){let g,b;const y="text/plain",w="text/html";if(navigator.clipboard.read!==void 0){const D=await navigator.clipboard.read();for(const R of D){if(R.types.includes(w)){const de=await(await R.getType(w)).text(),oe=Bl(de);if(oe!==void 0){g=oe;break}}R.types.includes(y)&&(b=await(await R.getType(y)).text())}}else if(navigator.clipboard.readText!==void 0)b=await navigator.clipboard.readText();else if(e!==void 0&&(e==null?void 0:e.clipboardData)!==null){if(e.clipboardData.types.includes(w)){const D=e.clipboardData.getData(w);g=Bl(D)}g===void 0&&e.clipboardData.types.includes(y)&&(b=e.clipboardData.getData(y))}else return;const[S,L]=h,K=[];do{if(ht===void 0){const D=Se(h),R=b??(g==null?void 0:g.map(de=>de.map(oe=>oe.rawValue).join(" ")).join(" "))??"",B=l(D,h,R,void 0);B!==void 0&&K.push(B);break}if(g===void 0){if(b===void 0)return;g=Pr(b)}if(ht===!1||typeof ht=="function"&&(ht==null?void 0:ht([h[0]-s,h[1]],g.map(D=>D.map(R=>{var B;return((B=R.rawValue)==null?void 0:B.toString())??""}))))!==!0)return;for(const[D,R]of g.entries()){if(D+L>=p)break;for(const[B,de]of R.entries()){const oe=[B+S,D+L],[We,Xe]=oe;if(We>=G.length||Xe>=ue)continue;const Ne=Se(oe),Ye=l(Ne,oe,de.rawValue,de.formatted);Ye!==void 0&&K.push(Ye)}}}while(!1);Ee(K),(m=xe.current)==null||m.damage(K.map(D=>({cell:D.location})))}},[J,Ce,Se,u,tt.paste,G.length,Ee,ue,ht,s,p]);tl("paste",Zo,$,!1,!0);const Yt=r.useCallback(async(e,l)=>{var a,f;if(!tt.copy)return;const o=l===!0||((a=v.current)==null?void 0:a.contains(document.activeElement))===!0||((f=F.current)==null?void 0:f.contains(document.activeElement))===!0,i=u.columns,c=u.rows,h=(m,g)=>{if(!rl)Xl(m,g,e);else{const b=g.map(y=>({kind:j.Text,data:x[y].title,displayData:x[y].title,allowOverlay:!1}));Xl([b,...m],g,e)}};if(o&&ce!==void 0){if(u.current!==void 0){let m=ce(u.current.range,Me.current.signal);typeof m!="object"&&(m=await m()),h(m,Dt(u.current.range.x-s,u.current.range.x+u.current.range.width-s))}else if(c!==void 0&&c.length>0){const g=[...c].map(b=>{const y=ce({x:s,y:b,width:x.length,height:1},Me.current.signal);return typeof y=="object"?y[0]:y().then(w=>w[0])});if(g.some(b=>b instanceof Promise)){const b=await Promise.all(g);h(b,Dt(x.length))}else h(g,Dt(x.length))}else if(i.length>0){const m=[],g=[];for(const b of i){let y=ce({x:b,y:0,width:1,height:p},Me.current.signal);typeof y!="object"&&(y=await y()),m.push(y),g.push(b-s)}if(m.length===1)h(m[0],g);else{const b=m.reduce((y,w)=>y.map((S,L)=>[...S,...w[L]]));h(b,g)}}}},[x,ce,u,tt.copy,s,p,rl]);tl("copy",Yt,$,!1,!1);const ir=r.useCallback(async e=>{var o,i;if(!(!tt.cut||!(((o=v.current)==null?void 0:o.contains(document.activeElement))===!0||((i=F.current)==null?void 0:i.contains(document.activeElement))===!0))&&(await Yt(e),u.current!==void 0)){let c={current:{cell:u.current.cell,range:u.current.range,rangeStack:[]},rows:V.empty(),columns:V.empty()};const h=ot==null?void 0:ot(c);if(h===!1||(c=h===!0?c:h,c.current===void 0))return;Ct(c.current.range)}},[Ct,u,tt.cut,Yt,ot]);tl("cut",ir,$,!1,!1);const cr=r.useCallback((e,l)=>{if(Oe!==void 0){s!==0&&(e=e.map(c=>[c[0]-s,c[1]])),Oe(e,l);return}if(e.length===0||l===-1)return;const[o,i]=e[l];T.current!==void 0&&T.current[0]===o&&T.current[1]===i||(T.current=[o,i],nt(o,i,!1,!1))},[Oe,s,nt]),[Co,wo]=((Pl=gt==null?void 0:gt.current)==null?void 0:Pl.cell)??[],po=r.useRef(te);po.current=te,r.useLayoutEffect(()=>{var e,l,o,i;!Nt.current&&Co!==void 0&&wo!==void 0&&(Co!==((l=(e=ao.current)==null?void 0:e.current)==null?void 0:l.cell[0])||wo!==((i=(o=ao.current)==null?void 0:o.current)==null?void 0:i.cell[1]))&&po.current(Co,wo),Nt.current=!1},[Co,wo]);const $l=u.current!==void 0&&(u.current.cell[0]>=G.length||u.current.cell[1]>=ue);r.useLayoutEffect(()=>{$l&&De(To,!1)},[$l,De]);const sr=r.useMemo(()=>Q===!0&&(W==null?void 0:W.tint)===!0?V.fromSingleSelection(ue-1):V.empty(),[ue,Q,W==null?void 0:W.tint]),ar=r.useCallback(e=>typeof pt=="boolean"?pt:(pt==null?void 0:pt(e-s))??!0,[s,pt]),ur=r.useMemo(()=>{if(Bo===void 0||F.current===null)return null;const{bounds:e,group:l}=Bo,o=F.current.getBoundingClientRect();return X(Ei,{bounds:e,group:l,canvasBounds:o,onClose:()=>Xo(void 0),onFinish:i=>{Xo(void 0),ee==null||ee(l,i)}})},[ee,Bo]),dr=Math.min(G.length,qe+(Ve?1:0));r.useImperativeHandle(n,()=>({appendRow:(e,l)=>Rt(e+s,l),updateCells:e=>{var l;return s!==0&&(e=e.map(o=>({cell:[o.cell[0]+s,o.cell[1]]}))),(l=xe.current)==null?void 0:l.damage(e)},getBounds:(e,l)=>{var o;if(!((F==null?void 0:F.current)===null||(v==null?void 0:v.current)===null)){if(e===void 0&&l===void 0){const i=F.current.getBoundingClientRect(),c=i.width/v.current.clientWidth;return{x:i.x-v.current.scrollLeft*c,y:i.y-v.current.scrollTop*c,width:v.current.scrollWidth*c,height:v.current.scrollHeight*c}}return(o=xe.current)==null?void 0:o.getBounds((e??0)+s,l)}},focus:()=>{var e;return(e=xe.current)==null?void 0:e.focus()},emit:async e=>{switch(e){case"delete":Xt({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":Xt({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":Xt({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 Yt(void 0,!0);break;case"paste":await Zo();break}},scrollTo:te,remeasureColumns:e=>{for(const l of e)vo(l+s)}}),[Rt,vo,Yt,Xt,Zo,s,te]);const[Fl,Al]=Be??[],fr=r.useCallback(e=>{const[l,o]=e;if(o===-1){fe!=="none"&&(ie(V.fromSingleSelection(l),void 0,!1),pe());return}Fl===l&&Al===o||(ge({cell:e,range:{x:l,y:o,width:1,height:1}},!0,!1,"keyboard-nav"),te(l,o))},[fe,pe,te,Fl,Al,ge,ie]),[hr,gr]=r.useState(!1),Il=r.useRef(Vr(e=>{gr(e)},5)),mr=r.useCallback(()=>{Il.current(!0),u.current===void 0&&u.columns.length===0&&u.rows.length===0&&E===void 0&&ge({cell:[s,fo],range:{x:s,y:fo,width:1,height:1}},!0,!1,"keyboard-select")},[fo,u,E,s,ge]),vr=r.useCallback(()=>{Il.current(!1)},[]),[Cr,wr]=r.useMemo(()=>{let e;const l=(ae==null?void 0:ae.scrollbarWidthOverride)??Kr(),o=p+(Q?1:0);if(typeof He=="number")e=Wt+o*He;else{let c=0;const h=Math.min(o,10);for(let a=0;ah.width+c,0)+l;return[`${Math.min(1e5,i)}px`,`${Math.min(1e5,e)}px`]},[G,ae==null?void 0:ae.scrollbarWidthOverride,He,p,Q,Wt]),pr=r.useMemo(()=>Wr(ve),[ve]);return X(Nr.Provider,{value:ve,children:jt(Ni,{style:pr,className:Et,inWidth:ne??Cr,inHeight:Fe??wr,children:[X(zi,{fillHandle:sn,drawFocusRing:an,experimental:ae,fixedShadowX:un,fixedShadowY:dn,getRowThemeOverride:O,headerIcons:fn,imageWindowLoader:hn,initialSize:gn,isDraggable:mn,onDragLeave:vn,onRowMoved:Pt,overscrollX:En,overscrollY:$n,preventDiagonalScrolling:pn,rightElement:bn,rightElementProps:yn,smoothScrollX:Mn,smoothScrollY:xn,className:Et,enableGroups:No,onCanvasFocused:mr,onCanvasBlur:vr,canvasRef:F,onContextMenu:rr,theme:ve,cellXOffset:Bn,cellYOffset:fo,accessibilityHeight:Je.height,onDragEnd:tr,columns:G,nonGrowWidth:vl,drawHeader:Nn,onColumnProposeMove:qt,drawCell:Gn,disabledRows:sr,freezeColumns:dr,lockColumns:s,firstColAccessible:s===0,getCellContent:Se,minColumnWidth:bt,maxColumnWidth:so,searchInputRef:P,showSearch:An,onSearchClose:In,highlightRegions:Xn,getCellsForSelection:ce,getGroupDetails:Uo,headerHeight:Ko,isFocused:hr,groupHeaderHeight:No?fl:0,freezeTrailingRows:Ze+(Q&&(W==null?void 0:W.sticky)===!0?1:0),hasAppendRow:Q,onColumnResize:Mt,onColumnResizeEnd:Kn,onColumnResizeStart:Wn,onCellFocused:fr,onColumnMoved:Qn,onDragStart:er,onHeaderMenuClick:Zn,onItemHovered:qo,isFilling:(E==null?void 0:E.fillHandle)===!0,onMouseMove:qn,onKeyDown:Xt,onKeyUp:at,onMouseDown:Yn,onMouseUp:jn,onDragOverCell:rn,onDrop:cn,onSearchResultsChanged:cr,onVisibleRegionChanged:Jn,clientSize:Wo,rowHeight:He,searchResults:st,searchValue:Do,onSearchValueChange:Zt,rows:ue,scrollRef:v,selection:u,translateX:Je.tx,translateY:Je.ty,verticalBorder:ar,gridRef:xe,getCellRenderer:Ce}),ur,k!==void 0&&X(r.Suspense,{fallback:null,children:X(Yi,{...k,validateCell:Pn,bloom:wt,id:nr,getCellRenderer:Ce,className:(ae==null?void 0:ae.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:nn,imageEditorOverride:N,onFinishEditing:lr,markdownDivCreateNode:be,isOutsideClick:zn})})]})})},Zi=r.forwardRef(qi),Ji=(t,n)=>{const d=r.useMemo(()=>({...yi,...t.headerIcons}),[t.headerIcons]),C=r.useMemo(()=>t.imageWindowLoader??new Gr,[t.imageWindowLoader]);return X(Zi,{...t,renderers:Ur,headerIcons:d,ref:n,imageWindowLoader:C})},sc=r.forwardRef(Ji);export{Li as C,sc as D,rt as k}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-hmiBYkvZ.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./index-wocATsGp.js","./image-window-loader-hgJATaim.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./iframe-ni8xiI1Q.js","./image-window-loader-1jHxuE_X.css","./flatten-qRvRBp6y.js","./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js b/docs/assets/data-editor-all-Orvb2jqb.js new file mode 100644 index 000000000..756a1008e --- /dev/null +++ b/docs/assets/data-editor-all-Orvb2jqb.js @@ -0,0 +1,124 @@ +var Rr=Object.defineProperty;var kr=(t,n,d)=>n in t?Rr(t,n,{enumerable:!0,configurable:!0,writable:!0,value:d}):t[n]=d;var ol=(t,n,d)=>(kr(t,typeof n!="symbol"?n+"":n,d),d);import{s as cl,a as qt,j as X,F as Vl}from"./marked.esm-dbrxtycE.js";import{r,R as it}from"./index-BMVQvedj.js";import{_ as Sr}from"./iframe-t8ayfGqb.js";import{G as j,b as Do,i as ko,r as Bl,c as Eo,C as V,g as tn,d as Tr,e as zr,w as Lt,m as ll,f as Lr,h as Xl,I as So,p as Hr,j as Dr,t as Er,k as $r,l as Ht,o as Yl,n as _l,q as Fr,s as To,v as zo,x as Ar,y as Ir,z as Or,A as Pr,B as Kr,D as jl,E as jt,F as Wr,H as Nr,J as ql,K as Gr,u as nl,L as Ur,M as Vr,T as Br,N as Zl,O as Xr,P as Yr}from"./image-window-loader-h6lJQmfV.js";import{c as Dt,r as Et,d as _r}from"./throttle-7EuXLZa7.js";import{u as jr,f as Jl}from"./flatten-qRvRBp6y.js";import{G as qr}from"./scrolling-data-grid-6lFEHS8-.js";const Y='',Zr=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y}`},Jr=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y}`},Qr=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + `},ei=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},ti=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},on=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + + + `},oi=t=>{const n=t.bgColor;return`${Y} + + + + +`},li=on,ni=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},ri=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + + + + + + `},ii=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + +`},ci=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},si=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},ai=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},ui=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + + `},di=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + +`},fi=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + + `},hi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},gi=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},vi=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},mi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},Ci=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + + + +`},wi=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},pi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},bi=t=>{const n=t.fgColor,d=t.bgColor;return` + ${Y} + + + `},yi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + + +`},Mi=t=>{const n=t.fgColor,d=t.bgColor;return`${Y} + + +`},xi=t=>{const n=t.fgColor;return` + + + `},Ri=t=>{const n=t.fgColor;return` + + + +`},ki={headerRowID:Zr,headerNumber:Qr,headerCode:Jr,headerString:ei,headerBoolean:ti,headerAudioUri:li,headerVideoUri:ni,headerEmoji:ri,headerImage:ii,headerUri:on,headerPhone:ci,headerMarkdown:si,headerDate:ai,headerTime:ui,headerEmail:di,headerReference:fi,headerIfThenElse:hi,headerSingleValue:gi,headerLookup:vi,headerTextTemplate:mi,headerMath:Ci,headerRollup:wi,headerJoinStrings:pi,headerSplitString:bi,headerGeoDistance:yi,headerArray:Mi,rowOwnerOverlay:xi,protectedColumnOverlay:Ri,renameIcon:oi},Si=cl("div")({name:"SearchWrapper",class:"slyseh9",propsAsIs:!1}),Ti=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})}),zi=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})}),Li=X("svg",{className:"button-icon",viewBox:"0 0 512 512",children:X("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}),Hi=10,Di=t=>{const{canvasRef:n,cellYOffset:d,rows:C,columns:k,searchInputRef:H,searchValue:P,searchResults:F,onSearchValueChange:E,getCellsForSelection:M,onSearchResultsChanged:m,showSearch:T=!1,onSearchClose:$}=t,[N]=r.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[O,be]=r.useState(""),ne=P??O,Fe=r.useCallback(z=>{be(z),E==null||E(z)},[E]),[x,p]=r.useState(),le=r.useRef(x);le.current=x,r.useEffect(()=>{F!==void 0&&(F.length>0?p(z=>({rowsSearched:C,results:F.length,selectedIndex:(z==null?void 0:z.selectedIndex)??-1})):p(void 0))},[C,F]);const ye=r.useRef();ye.current===void 0&&(ye.current=new AbortController);const Z=r.useRef(),[_,q]=r.useState([]),J=F??_,U=r.useCallback(()=>{Z.current!==void 0&&(window.cancelAnimationFrame(Z.current),Z.current=void 0,ye.current.abort())},[]),Re=r.useRef(d);Re.current=d;const wt=r.useCallback(z=>{const ee=new RegExp(z.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let re=Re.current,ze=Math.min(10,C),Oe=0;p(void 0),q([]);const st=[],Jt=async()=>{var Ge;if(M===void 0)return;const Fo=performance.now(),Ft=C-Oe;let at=M({x:0,y:re,width:k.length,height:Math.min(ze,Ft,C-re)},ye.current.signal);typeof at=="function"&&(at=await at());let Qt=!1;for(const[he,Le]of at.entries())for(const[Ao,_e]of Le.entries()){let je;switch(_e.kind){case j.Text:case j.Number:je=_e.displayData;break;case j.Uri:case j.Markdown:je=_e.data;break;case j.Boolean:je=typeof _e.data=="boolean"?_e.data.toString():void 0;break;case j.Image:case j.Bubble:je=_e.data.join("🐳");break;case j.Custom:je=_e.copyData;break}je!==void 0&&ee.test(je)&&(st.push([Ao,he+re]),Qt=!0)}const eo=performance.now();Qt&&q([...st]),Oe+=at.length,Do(Oe<=C);const Qe=((Ge=le.current)==null?void 0:Ge.selectedIndex)??-1;p({results:st.length,rowsSearched:Oe,selectedIndex:Qe}),m==null||m(st,Qe),re+ze>=C?re=0:re+=ze;const ut=eo-Fo,dt=Math.max(ut,1),ft=Hi/dt;ze=Math.ceil(ze*ft),Oe{var z;$==null||$(),p(void 0),q([]),m==null||m([],-1),U(),(z=n==null?void 0:n.current)==null||z.focus()},[U,n,$,m]),Zt=r.useCallback(z=>{Fe(z.target.value),F===void 0&&(z.target.value===""?(p(void 0),q([]),U()):wt(z.target.value))},[wt,U,Fe,F]);r.useEffect(()=>{T&&H.current!==null&&(Fe(""),H.current.focus({preventScroll:!0}))},[T,H,Fe]);const ct=r.useCallback(z=>{var re;if((re=z==null?void 0:z.stopPropagation)==null||re.call(z),x===void 0)return;const ee=(x.selectedIndex+1)%x.results;p({...x,selectedIndex:ee}),m==null||m(J,ee)},[x,m,J]),Te=r.useCallback(z=>{var re;if((re=z==null?void 0:z.stopPropagation)==null||re.call(z),x===void 0)return;let ee=(x.selectedIndex-1)%x.results;ee<0&&(ee+=x.results),p({...x,selectedIndex:ee}),m==null||m(J,ee)},[m,J,x]),Ae=r.useCallback(z=>{(z.ctrlKey||z.metaKey)&&z.nativeEvent.code==="KeyF"||z.key==="Escape"?(se(),z.stopPropagation(),z.preventDefault()):z.key==="Enter"&&(z.shiftKey?Te():ct())},[se,ct,Te]);r.useEffect(()=>()=>{U()},[U]);const[$t,Ie]=r.useState(!1);r.useEffect(()=>{if(T)Ie(!0);else{const z=setTimeout(()=>Ie(!1),150);return()=>clearTimeout(z)}},[T]);const $o=r.useMemo(()=>{if(!T&&!$t)return null;let z;x!==void 0&&(z=x.results>=1e3?"over 1000":`${x.results} result${x.results!==1?"s":""}`,x.selectedIndex>=0&&(z=`${x.selectedIndex+1} of ${z}`));const ee=Oe=>{Oe.stopPropagation()},ze={width:`${Math.floor(((x==null?void 0:x.rowsSearched)??0)/C*100)}%`};return qt(Si,{className:T?"":"out",onMouseDown:ee,onMouseMove:ee,onMouseUp:ee,onClick:ee,children:[qt("div",{className:"gdg-search-bar-inner",children:[X("input",{id:N,"aria-hidden":!T,"data-testid":"search-input",ref:H,onChange:Zt,value:ne,tabIndex:T?void 0:-1,onKeyDownCapture:Ae}),X("button",{"aria-label":"Previous Result","aria-hidden":!T,tabIndex:T?void 0:-1,onClick:Te,disabled:((x==null?void 0:x.results)??0)===0,children:Ti}),X("button",{"aria-label":"Next Result","aria-hidden":!T,tabIndex:T?void 0:-1,onClick:ct,disabled:((x==null?void 0:x.results)??0)===0,children:zi}),$!==void 0&&X("button",{"aria-label":"Close Search","aria-hidden":!T,"data-testid":"search-close-button",tabIndex:T?void 0:-1,onClick:se,children:Li})]}),x!==void 0?qt(Vl,{children:[X("div",{className:"gdg-search-status",children:X("div",{"data-testid":"search-result-area",children:z})}),X("div",{className:"gdg-search-progress",style:ze})]}):X("div",{className:"gdg-search-status",children:X("label",{htmlFor:N,children:"Type to search"})})]})},[T,$t,x,C,N,H,Zt,ne,Ae,Te,ct,$,se]);return qt(Vl,{children:[X(qr,{prelightCells:J,accessibilityHeight:t.accessibilityHeight,canvasRef:t.canvasRef,cellXOffset:t.cellXOffset,cellYOffset:t.cellYOffset,className:t.className,clientSize:t.clientSize,columns:t.columns,disabledRows:t.disabledRows,enableGroups:t.enableGroups,fillHandle:t.fillHandle,firstColAccessible:t.firstColAccessible,nonGrowWidth:t.nonGrowWidth,fixedShadowX:t.fixedShadowX,fixedShadowY:t.fixedShadowY,freezeColumns:t.freezeColumns,getCellContent:t.getCellContent,getCellRenderer:t.getCellRenderer,getGroupDetails:t.getGroupDetails,getRowThemeOverride:t.getRowThemeOverride,groupHeaderHeight:t.groupHeaderHeight,headerHeight:t.headerHeight,highlightRegions:t.highlightRegions,imageWindowLoader:t.imageWindowLoader,initialSize:t.initialSize,isFilling:t.isFilling,isFocused:t.isFocused,lockColumns:t.lockColumns,maxColumnWidth:t.maxColumnWidth,minColumnWidth:t.minColumnWidth,onHeaderMenuClick:t.onHeaderMenuClick,onMouseMove:t.onMouseMove,onVisibleRegionChanged:t.onVisibleRegionChanged,overscrollX:t.overscrollX,overscrollY:t.overscrollY,preventDiagonalScrolling:t.preventDiagonalScrolling,rightElement:t.rightElement,rightElementProps:t.rightElementProps,rowHeight:t.rowHeight,rows:t.rows,scrollRef:t.scrollRef,selection:t.selection,theme:t.theme,freezeTrailingRows:t.freezeTrailingRows,hasAppendRow:t.hasAppendRow,translateX:t.translateX,translateY:t.translateY,verticalBorder:t.verticalBorder,onColumnProposeMove:t.onColumnProposeMove,drawFocusRing:t.drawFocusRing,drawCell:t.drawCell,drawHeader:t.drawHeader,experimental:t.experimental,gridRef:t.gridRef,headerIcons:t.headerIcons,isDraggable:t.isDraggable,onCanvasBlur:t.onCanvasBlur,onCanvasFocused:t.onCanvasFocused,onCellFocused:t.onCellFocused,onColumnMoved:t.onColumnMoved,onColumnResize:t.onColumnResize,onColumnResizeEnd:t.onColumnResizeEnd,onColumnResizeStart:t.onColumnResizeStart,onContextMenu:t.onContextMenu,onDragEnd:t.onDragEnd,onDragLeave:t.onDragLeave,onDragOverCell:t.onDragOverCell,onDragStart:t.onDragStart,onDrop:t.onDrop,onItemHovered:t.onItemHovered,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,onMouseDown:t.onMouseDown,onMouseUp:t.onMouseUp,onRowMoved:t.onRowMoved,smoothScrollX:t.smoothScrollX,smoothScrollY:t.smoothScrollY}),$o]})},Ei=Di;class $i extends r.PureComponent{constructor(){super(...arguments);ol(this,"wrapperRef",r.createRef());ol(this,"clickOutside",d=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(d))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(d.target)){let C=d.target;for(;C!==null;){if(C.classList.contains("click-outside-ignore"))return;C=C.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:d,isOutsideClick:C,...k}=this.props;return X("div",{...k,ref:this.wrapperRef,children:this.props.children})}}const Fi=()=>t=>Math.max(16,t.targetHeight-10),Ai=cl("input")({name:"RenameInput",class:"r1fzhvm4",propsAsIs:!1,vars:{"r1fzhvm4-0":[Fi(),"px"]}}),Ii=t=>{const{bounds:n,group:d,onClose:C,canvasBounds:k,onFinish:H}=t,[P,F]=it.useState(d);return X($i,{style:{position:"absolute",left:n.x-k.left+1,top:n.y-k.top,width:n.width-2,height:n.height},className:"c181oggi",onClickOutside:C,children:X(Ai,{targetHeight:n.height,"data-testid":"group-rename-input",value:P,onBlur:C,onFocus:E=>E.target.setSelectionRange(0,P.length),onChange:E=>F(E.target.value),onKeyDown:E=>{E.key==="Enter"?H(P):E.key==="Escape"&&C()},autoFocus:!0})})},il=150;function Oi(t,n,d,C){var H;const k=C(n);return((H=k==null?void 0:k.measure)==null?void 0:H.call(k,t,n,d))??il}function ln(t,n,d,C,k,H,P,F,E){let M=0;const m=k===void 0?[]:k.map($=>{const N=Oi(t,$[C],n,E);return M=Math.max(M,N),N});if(m.length>5&&F){M=0;let $=0;for(const O of m)$+=O;const N=$/m.length;for(let O=0;O=N*2?m[O]=0:M=Math.max(M,m[O])}M=Math.max(M,t.measureText(d.title).width+16+(d.icon===void 0?0:28));const T=Math.max(Math.ceil(H),Math.min(Math.floor(P),Math.ceil(M)));return{...d,width:T}}function Pi(t,n,d,C,k,H,P,F,E){const M=r.useRef(n),m=r.useRef(d),T=r.useRef(P);M.current=n,m.current=d,T.current=P;const[$,N]=r.useMemo(()=>{if(typeof window>"u")return[null,null];const x=document.createElement("canvas");return x.style.display="none",x.style.opacity="0",x.style.position="fixed",[x,x.getContext("2d",{alpha:!1})]},[]);r.useLayoutEffect(()=>($&&document.documentElement.append($),()=>{$==null||$.remove()}),[$]);const O=r.useRef({}),be=r.useRef(),[ne,Fe]=r.useState();return r.useLayoutEffect(()=>{const x=m.current;if(x===void 0||t.every(ko))return;let p=Math.max(1,10-Math.floor(t.length/1e4)),le=0;p1&&(p--,le=1);const ye={x:0,y:0,width:t.length,height:Math.min(M.current,p)},Z={x:0,y:M.current-1,width:t.length,height:1};(async()=>{const q=x(ye,E.signal),J=le>0?x(Z,E.signal):void 0;let U;typeof q=="object"?U=q:U=await Bl(q),J!==void 0&&(typeof J=="object"?U=[...U,...J]:U=[...U,...await Bl(J)]),be.current=t,Fe(U)})()},[E.signal,t]),r.useMemo(()=>{let p=t.every(ko)?t:N===null?t.map(_=>ko(_)?_:{..._,width:il}):(N.font=T.current.baseFontFull,t.map((_,q)=>{if(ko(_))return _;if(O.current[_.id]!==void 0)return{..._,width:O.current[_.id]};if(ne===void 0||be.current!==t||_.id===void 0)return{..._,width:il};const J=ln(N,P,_,q,ne,k,H,!0,F);return O.current[_.id]=J.width,J})),le=0,ye=0;const Z=[];for(const[_,q]of p.entries())le+=q.width,q.grow!==void 0&&q.grow>0&&(ye+=q.grow,Z.push(_));if(le0){const _=[...p],q=C-le;let J=q;for(let U=0;U1&&t.startsWith("_")?Number.parseInt(t.slice(1))===n.keyCode:t.length===1&&t>="a"&&t<="z"?t.toUpperCase().codePointAt(0)===n.keyCode:t===n.key}function A(t,n,d){const C=nn(t,n);return C&&(d.didMatch=!0),C}function nn(t,n){if(t.length===0)return!1;if(t.includes("|")){const E=t.split("|");for(const M of E)if(nn(M,n))return!0;return!1}let d=!1,C=!1,k=!1,H=!1;const P=t.split("+"),F=P.pop();if(!Ki(F,n))return!1;if(P[0]==="any")return!0;for(const E of P)switch(E){case"ctrl":d=!0;break;case"shift":C=!0;break;case"alt":k=!0;break;case"meta":H=!0;break;case"primary":Eo.value?H=!0:d=!0;break}return n.altKey===k&&n.ctrlKey===d&&n.shiftKey===C&&n.metaKey===H}function Wi(t,n,d,C,k,H){const P=it.useCallback((M,m,T,$)=>{var x;(H==="cell"||H==="multi-cell")&&M!==void 0&&(M={...M,range:{x:M.cell[0],y:M.cell[1],width:1,height:1}});const N=d==="mixed"&&(T||$==="drag"),O=C==="mixed"&&N,be=k==="mixed"&&N;let ne={current:M===void 0?void 0:{...M,rangeStack:$==="drag"?((x=t.current)==null?void 0:x.rangeStack)??[]:[]},columns:O?t.columns:V.empty(),rows:be?t.rows:V.empty()};T&&(H==="multi-rect"||H==="multi-cell")&&ne.current!==void 0&&t.current!==void 0&&(ne={...ne,current:{...ne.current,rangeStack:[...t.current.rangeStack,t.current.range]}}),n(ne,m)},[C,t,d,H,k,n]),F=it.useCallback((M,m,T)=>{M=M??t.rows,m!==void 0&&(M=M.add(m));let $;if(k==="exclusive"&&M.length>0)$={current:void 0,columns:V.empty(),rows:M};else{const N=T&&d==="mixed",O=T&&C==="mixed";$={current:N?t.current:void 0,columns:O?t.columns:V.empty(),rows:M}}n($,!1)},[C,t,d,k,n]),E=it.useCallback((M,m,T)=>{M=M??t.columns,m!==void 0&&(M=M.add(m));let $;if(C==="exclusive"&&M.length>0)$={current:void 0,rows:V.empty(),columns:M};else{const N=T&&d==="mixed",O=T&&k==="mixed";$={current:N?t.current:void 0,rows:O?t.rows:V.empty(),columns:M}}n($,!1)},[C,t,d,k,n]);return[P,F,E]}function Ni(t,n,d,C,k){const H=r.useCallback(M=>{if(t===!0){const m=[];for(let T=M.y;T=k?$.push({kind:j.Loading,allowOverlay:!1}):$.push(n([N,T]));m.push($)}return m}return(t==null?void 0:t(M,C.signal))??[]},[C.signal,n,t,k]),P=t!==void 0?H:void 0,F=r.useCallback(M=>{if(P===void 0)return[];const m={...M,x:M.x-d};if(m.x<0){m.x=0,m.width--;const T=P(m,C.signal);return typeof T=="function"?async()=>(await T()).map($=>[{kind:j.Loading,allowOverlay:!1},...$]):T.map($=>[{kind:j.Loading,allowOverlay:!1},...$])}return P(m,C.signal)},[C.signal,P,d]);return[t!==void 0?F:void 0,P]}function Ql(t){return typeof t=="string"?t:`${t}px`}const Gi=()=>t=>t.innerWidth,Ui=()=>t=>t.innerHeight,Vi=cl("div")({name:"Wrapper",class:"w2q57ts",propsAsIs:!1,vars:{"w2q57ts-0":[Gi()],"w2q57ts-1":[Ui()]}}),Bi=t=>{const{inWidth:n,inHeight:d,children:C,...k}=t;return X(Vi,{innerHeight:Ql(d),innerWidth:Ql(n),...k,children:C})},Xi=2,Yi=1300;function _i(t,n,d){const C=it.useRef(0),[k,H]=t??[0,0];it.useEffect(()=>{if(k===0&&H===0){C.current=0;return}let P=!1,F=0;const E=M=>{var m;if(!P){if(F===0)F=M;else{const T=M-F;C.current=Math.min(1,C.current+T/Yi);const $=C.current**1.618*T*Xi;(m=n.current)==null||m.scrollBy(k*$,H*$),F=M,d==null||d()}window.requestAnimationFrame(E)}};return window.requestAnimationFrame(E),()=>{P=!0}},[n,k,H,d])}function ji({rowHeight:t,headerHeight:n,groupHeaderHeight:d,theme:C,overscrollX:k,overscrollY:H,scaleToRem:P,remSize:F}){const[E,M,m,T,$,N]=it.useMemo(()=>{if(!P||F===16)return[t,n,d,C,k,H];const O=F/16,be=t,ne=tn();return[typeof be=="number"?be*O:Fe=>Math.ceil(be(Fe)*O),Math.ceil(n*O),Math.ceil(d*O),{...C,headerIconSize:((C==null?void 0:C.headerIconSize)??ne.headerIconSize)*O,cellHorizontalPadding:((C==null?void 0:C.cellHorizontalPadding)??ne.cellHorizontalPadding)*O,cellVerticalPadding:((C==null?void 0:C.cellVerticalPadding)??ne.cellVerticalPadding)*O},Math.ceil((k??0)*O),Math.ceil((H??0)*O)]},[d,n,k,H,F,t,P,C]);return{rowHeight:E,headerHeight:M,groupHeaderHeight:m,theme:T,overscrollX:$,overscrollY:N}}const rt={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 I(t,n){return t===!0?n:t===!1?"":t}function en(t){const n=Eo.value;return{activateCell:I(t.activateCell," |Enter|shift+Enter"),clear:I(t.clear,"any+Escape"),closeOverlay:I(t.closeOverlay,"any+Escape"),acceptOverlayDown:I(t.acceptOverlayDown,"Enter"),acceptOverlayUp:I(t.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:I(t.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:I(t.acceptOverlayRight,"Tab"),copy:t.copy,cut:t.cut,delete:I(t.delete,n?"Backspace|Delete":"Delete"),downFill:I(t.downFill,"primary+_68"),scrollToSelectedCell:I(t.scrollToSelectedCell,"primary+Enter"),goDownCell:I(t.goDownCell,"ArrowDown"),goDownCellRetainSelection:I(t.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:I(t.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:I(t.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:I(t.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:I(t.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:I(t.goUpCell,"ArrowUp"),goUpCellRetainSelection:I(t.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:I(t.goToFirstCell,"primary+Home"),goToFirstColumn:I(t.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:I(t.goToFirstRow,"primary+ArrowUp"),goToLastCell:I(t.goToLastCell,"primary+End"),goToLastColumn:I(t.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:I(t.goToLastRow,"primary+ArrowDown"),goToNextPage:I(t.goToNextPage,"PageDown"),goToPreviousPage:I(t.goToPreviousPage,"PageUp"),paste:t.paste,rightFill:I(t.rightFill,"primary+_82"),search:I(t.search,"primary+f"),selectAll:I(t.selectAll,"primary+a"),selectColumn:I(t.selectColumn,"ctrl+ "),selectGrowDown:I(t.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:I(t.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:I(t.selectGrowRight,"shift+ArrowRight"),selectGrowUp:I(t.selectGrowUp,"shift+ArrowUp"),selectRow:I(t.selectRow,"shift+ "),selectToFirstCell:I(t.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:I(t.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:I(t.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:I(t.selectToLastCell,"primary+shift+End"),selectToLastColumn:I(t.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:I(t.selectToLastRow,"primary+shift+ArrowDown")}}function qi(t){const n=Tr(t);return it.useMemo(()=>{if(n===void 0)return en(rt);const d={...n,goToNextPage:(n==null?void 0:n.goToNextPage)??(n==null?void 0:n.pageDown)??rt.goToNextPage,goToPreviousPage:(n==null?void 0:n.goToPreviousPage)??(n==null?void 0:n.pageUp)??rt.goToPreviousPage,goToFirstCell:(n==null?void 0:n.goToFirstCell)??(n==null?void 0:n.first)??rt.goToFirstCell,goToLastCell:(n==null?void 0:n.goToLastCell)??(n==null?void 0:n.last)??rt.goToLastCell,selectToFirstCell:(n==null?void 0:n.selectToFirstCell)??(n==null?void 0:n.first)??rt.selectToFirstCell,selectToLastCell:(n==null?void 0:n.selectToLastCell)??(n==null?void 0:n.last)??rt.selectToLastCell};return en({...rt,...d})},[n])}const Zi=r.lazy(async()=>await Sr(()=>import("./data-grid-overlay-editor-XTO4-8W8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Ji=0;function Qi(t){return jr(Jl(Jl(t).filter(n=>n.span!==void 0).map(n=>{var d,C;return Et((((d=n.span)==null?void 0:d[0])??0)+1,(((C=n.span)==null?void 0:C[1])??0)+1)})))}function Lo(t,n){return t===void 0||n===0||t.columns.length===0&&t.current===void 0?t:{current:t.current===void 0?void 0:{cell:[t.current.cell[0]+n,t.current.cell[1]],range:{...t.current.range,x:t.current.range.x+n},rangeStack:t.current.rangeStack.map(d=>({...d,x:d.x+n}))},rows:t.rows,columns:t.columns.offset(n)}}const rl={kind:j.Loading,allowOverlay:!1},Ho={columns:V.empty(),rows:V.empty(),current:void 0},ec=(t,n)=>{var Nl,Gl,Ul;const[d,C]=r.useState(Ho),[k,H]=r.useState(),P=r.useRef(null),F=r.useRef(null),[E,M]=r.useState(),m=r.useRef(null),T=r.useRef(),$=typeof window>"u"?null:window,{imageEditorOverride:N,getRowThemeOverride:O,markdownDivCreateNode:be,width:ne,height:Fe,columns:x,rows:p,getCellContent:le,onCellClicked:ye,onCellActivated:Z,onFillPattern:_,onFinishedEditing:q,coercePasteValue:J,drawHeader:U,drawCell:Re,editorBloom:wt,onHeaderClicked:se,onColumnProposeMove:Zt,spanRangeBehavior:ct="default",onGroupHeaderClicked:Te,onCellContextMenu:Ae,className:$t,onHeaderContextMenu:Ie,getCellsForSelection:$o,onGroupHeaderContextMenu:z,onGroupHeaderRenamed:ee,onCellEdited:re,onCellsEdited:ze,onSearchResultsChanged:Oe,searchResults:st,onSearchValueChange:Jt,searchValue:Fo,onKeyDown:Ft,onKeyUp:at,keybindings:Qt,editOnType:eo=!0,onRowAppended:Qe,onColumnMoved:ut,validateCell:dt,highlightRegions:ft,rangeSelect:Ge="rect",columnSelect:he="multi",rowSelect:Le="multi",rangeSelectionBlending:Ao="exclusive",columnSelectionBlending:_e="exclusive",rowSelectionBlending:je="exclusive",onDelete:Io,onDragStart:to,onMouseMove:oo,onPaste:ht,copyHeaders:sl=!1,freezeColumns:qe=0,cellActivationBehavior:Oo="second-click",rowSelectionMode:Po="auto",onHeaderMenuClick:lo,getGroupDetails:no,onSearchClose:Ko,onItemHovered:ro,onSelectionCleared:et,showSearch:rn,onVisibleRegionChanged:io,gridSelection:gt,onGridSelectionChange:Wo,minColumnWidth:cn=50,maxColumnWidth:sn=500,maxColumnAutoWidth:an,provideEditor:un,trailingRowOptions:W,freezeTrailingRows:Ze=0,allowedFillDirections:al="orthogonal",scrollOffsetX:At,scrollOffsetY:Ue,verticalBorder:pt,onDragOverCell:dn,onDrop:fn,onColumnResize:It,onColumnResizeEnd:Ot,onColumnResizeStart:Pt,customRenderers:co,fillHandle:hn,drawFocusRing:ul=!0,experimental:ae,fixedShadowX:gn,fixedShadowY:vn,headerIcons:mn,imageWindowLoader:Cn,initialSize:wn,isDraggable:pn,onDragLeave:bn,onRowMoved:Kt,overscrollX:yn,overscrollY:Mn,preventDiagonalScrolling:xn,rightElement:Rn,rightElementProps:kn,trapFocus:dl=!1,smoothScrollX:Sn,smoothScrollY:Tn,scaleToRem:zn=!1,rowHeight:Ln=34,headerHeight:fl=36,groupHeaderHeight:Hn=fl,theme:Dn,isOutsideClick:En,renderers:No}=t,ge=typeof t.rowMarkers=="string"?void 0:t.rowMarkers,Pe=(ge==null?void 0:ge.kind)??t.rowMarkers??"none",$n=(ge==null?void 0:ge.width)??t.rowMarkerWidth,hl=(ge==null?void 0:ge.startIndex)??t.rowMarkerStartIndex??1,gl=(ge==null?void 0:ge.theme)??t.rowMarkerTheme,so=(ge==null?void 0:ge.checkboxStyle)??"square",bt=Math.max(cn,20),ao=Math.max(sn,bt),Fn=Math.max(an??ao,bt),vl=r.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),An=r.useMemo(()=>Number.parseFloat(vl.fontSize),[vl]),{rowHeight:He,headerHeight:Go,groupHeaderHeight:ml,theme:Cl,overscrollX:In,overscrollY:On}=ji({groupHeaderHeight:Hn,headerHeight:fl,overscrollX:yn,overscrollY:Mn,remSize:An,rowHeight:Ln,scaleToRem:zn,theme:Dn}),tt=qi(Qt),yt=$n??(p>1e4?48:p>1e3?44:p>100?36:32),Ve=Pe!=="none",s=Ve?1:0,Q=Qe!==void 0,Wt=(W==null?void 0:W.sticky)===!0,[Pn,wl]=r.useState(!1),Kn=rn??Pn,Wn=r.useCallback(()=>{Ko!==void 0?Ko():wl(!1)},[Ko]),u=r.useMemo(()=>gt===void 0?void 0:Lo(gt,s),[gt,s])??d,Me=r.useRef();Me.current===void 0&&(Me.current=new AbortController),r.useEffect(()=>()=>Me==null?void 0:Me.current.abort(),[]);const[ce,Nn]=Ni($o,le,s,Me.current,p),Gn=r.useCallback((e,l,o)=>{if(dt===void 0)return!0;const i=[e[0]-s,e[1]];return dt==null?void 0:dt(i,l,o)},[s,dt]),uo=r.useRef(gt),De=r.useCallback((e,l)=>{l&&(e=zr(e,ce,s,ct,Me.current)),Wo!==void 0?(uo.current=Lo(e,-s),Wo(uo.current)):C(e)},[Wo,ce,s,ct]),Mt=Lt(It,r.useCallback((e,l,o,i)=>{It==null||It(x[o-s],l,o-s,i)},[It,s,x])),Un=Lt(Ot,r.useCallback((e,l,o,i)=>{Ot==null||Ot(x[o-s],l,o-s,i)},[Ot,s,x])),Vn=Lt(Pt,r.useCallback((e,l,o,i)=>{Pt==null||Pt(x[o-s],l,o-s,i)},[Pt,s,x])),Bn=Lt(U,r.useCallback((e,l)=>(U==null?void 0:U({...e,columnIndex:e.columnIndex-s},l))??!1,[U,s])),Xn=Lt(Re,r.useCallback((e,l)=>(Re==null?void 0:Re({...e,col:e.col-s},l))??!1,[Re,s])),ot=r.useCallback(e=>{if(Io!==void 0){const l=Io(Lo(e,-s));return typeof l=="boolean"?l:Lo(l,s)}return!0},[Io,s]),[ve,me,ie]=Wi(u,De,Ao,_e,je,Ge),ue=r.useMemo(()=>ll(tn(),Cl),[Cl]),[Uo,Yn]=r.useState([0,0,0]),pl=r.useMemo(()=>{if(No===void 0)return{};const e={};for(const l of No)e[l.kind]=l;return e},[No]),Ce=r.useCallback(e=>e.kind!==j.Custom?pl[e.kind]:co==null?void 0:co.find(l=>l.isMatch(e)),[co,pl]);let{sizedColumns:ke,nonGrowWidth:bl}=Pi(x,p,Nn,Uo[0]-(s===0?0:yt)-Uo[2],bt,Fn,ue,Ce,Me.current);Pe!=="none"&&(bl+=yt);const Vo=r.useMemo(()=>ke.some(e=>e.group!==void 0),[ke]),Nt=Vo?Go+ml:Go,yl=u.rows.length,Ml=Pe==="none"?void 0:yl===0?!1:yl===p?!0:void 0,G=r.useMemo(()=>Pe==="none"?ke:[{title:"",width:yt,icon:void 0,hasMenu:!1,style:"normal",themeOverride:gl,rowMarker:so,rowMarkerChecked:Ml},...ke],[Pe,ke,yt,gl,so,Ml]),[xl,Rl]=r.useMemo(()=>[Ue!==void 0&&typeof He=="number"?Math.floor(Ue/He):0,Ue!==void 0&&typeof He=="number"?-(Ue%He):0],[Ue,He]),we=r.useRef({height:1,width:1,x:0,y:0}),_n=r.useMemo(()=>({x:we.current.x,y:xl,width:we.current.width??1,height:we.current.height??1,ty:Rl}),[Rl,xl]),Gt=r.useRef(!1),[Je,kl,fo]=Lr(_n);we.current=Je;const Sl=(Je.height??1)>1;r.useLayoutEffect(()=>{if(Ue!==void 0&&m.current!==null&&Sl){if(m.current.scrollTop===Ue)return;m.current.scrollTop=Ue,m.current.scrollTop!==Ue&&fo(),Gt.current=!0}},[Ue,Sl,fo]);const Tl=(Je.width??1)>1;r.useLayoutEffect(()=>{if(At!==void 0&&m.current!==null&&Tl){if(m.current.scrollLeft===At)return;m.current.scrollLeft=At,m.current.scrollLeft!==At&&fo(),Gt.current=!0}},[At,Tl,fo]);const jn=Je.x+s,ho=Je.y,xe=r.useRef(null),pe=r.useCallback(e=>{var l;e===!0?(l=xe.current)==null||l.focus():window.requestAnimationFrame(()=>{var o;(o=xe.current)==null||o.focus()})},[]),de=Q?p+1:p,Ee=r.useCallback(e=>{const l=s===0?e:e.map(i=>({...i,location:[i.location[0]-s,i.location[1]]})),o=ze==null?void 0:ze(l);if(o!==!0)for(const i of l)re==null||re(i.location,i.value);return o},[re,ze,s]),[vt,Bo]=r.useState(),go=u.current!==void 0&&u.current.range.width*u.current.range.height>1?u.current.range:void 0,xt=ul?(Nl=u.current)==null?void 0:Nl.cell:void 0,vo=xt==null?void 0:xt[0],mo=xt==null?void 0:xt[1],qn=r.useMemo(()=>{if((ft===void 0||ft.length===0)&&(go??vo??mo??vt)===void 0)return;const e=[];if(ft!==void 0)for(const l of ft){const o=G.length-l.range.x-s;o>0&&e.push({color:l.color,range:{...l.range,x:l.range.x+s,width:Math.min(o,l.range.width)},style:l.style})}return vt!==void 0&&e.push({color:Xl(ue.accentColor,0),range:vt,style:"dashed"}),go!==void 0&&e.push({color:Xl(ue.accentColor,.5),range:go,style:"solid-outline"}),vo!==void 0&&mo!==void 0&&e.push({color:ue.accentColor,range:{x:vo,y:mo,width:1,height:1},style:"solid-outline"}),e.length>0?e:void 0},[vt,go,vo,mo,ft,G.length,ue.accentColor,s]),zl=r.useRef(G);zl.current=G;const Se=r.useCallback(([e,l],o=!1)=>{var h,a,f,v,g,b,y;const i=Q&&l===de-1;if(e===0&&Ve)return i?rl:{kind:So.Marker,allowOverlay:!1,checkboxStyle:so,checked:(u==null?void 0:u.rows.hasIndex(l))===!0,markerKind:Pe==="clickable-number"?"number":Pe,row:hl+l,drawHandle:Kt!==void 0,cursor:Pe==="clickable-number"?"pointer":void 0};if(i){const S=e===s?(W==null?void 0:W.hint)??"":"",L=zl.current[e];if(((h=L==null?void 0:L.trailingRowOptions)==null?void 0:h.disabled)===!0)return rl;{const K=((a=L==null?void 0:L.trailingRowOptions)==null?void 0:a.hint)??S,D=((f=L==null?void 0:L.trailingRowOptions)==null?void 0:f.addIcon)??(W==null?void 0:W.addIcon);return{kind:So.NewRow,hint:K,allowOverlay:!1,icon:D}}}else{const w=e-s;if(o||(ae==null?void 0:ae.strict)===!0){const L=we.current,K=L.x>w||w>L.x+L.width||L.y>l||l>L.y+L.height||l>=Yo.current,D=w===((g=(v=L.extras)==null?void 0:v.selected)==null?void 0:g[0])&&l===((b=L.extras)==null?void 0:b.selected[1]);let R=!1;if(((y=L.extras)==null?void 0:y.freezeRegions)!==void 0){for(const B of L.extras.freezeRegions)if(Hr(B,w,l)){R=!0;break}}if(K&&!D&&!R)return rl}let S=le([w,l]);return s!==0&&S.span!==void 0&&(S={...S,span:[S.span[0]+s,S.span[1]+s]}),S}},[Q,de,Ve,so,u==null?void 0:u.rows,Pe,hl,Kt,s,W==null?void 0:W.hint,W==null?void 0:W.addIcon,ae==null?void 0:ae.strict,le]),Xo=r.useCallback(e=>{let l=(no==null?void 0:no(e))??{name:e};return ee!==void 0&&e!==""&&(l={icon:l.icon,name:l.name,overrideTheme:l.overrideTheme,actions:[...l.actions??[],{title:"Rename",icon:"renameIcon",onClick:o=>jo({group:l.name,bounds:o.bounds})}]}),l},[no,ee]),Co=r.useCallback(e=>{var f;const[l,o]=e.cell,i=G[l],c=(i==null?void 0:i.group)!==void 0?(f=Xo(i.group))==null?void 0:f.overrideTheme:void 0,h=i==null?void 0:i.themeOverride,a=O==null?void 0:O(o);H({...e,theme:ll(ue,c,h,a,e.content.themeOverride)})},[O,G,Xo,ue]),Rt=r.useCallback((e,l,o)=>{var a;if(u.current===void 0)return;const[i,c]=u.current.cell,h=Se([i,c]);if(h.kind!==j.Boolean&&h.allowOverlay){let f=h;if(o!==void 0)switch(f.kind){case j.Number:{const v=Dr(()=>o==="-"?-0:Number.parseFloat(o),0);f={...f,data:Number.isNaN(v)?0:v};break}case j.Text:case j.Markdown:case j.Uri:f={...f,data:o};break}Co({target:e,content:f,initialValue:o,cell:[i,c],highlight:o===void 0,forceEditMode:o!==void 0})}else h.kind===j.Boolean&&l&&h.readonly!==!0&&(Ee([{location:u.current.cell,value:{...h,data:Er(h.data)}}]),(a=xe.current)==null||a.damage([{cell:u.current.cell}]))},[Se,u,Ee,Co]),Ll=r.useCallback((e,l)=>{var c;const o=(c=xe.current)==null?void 0:c.getBounds(e,l);if(o===void 0||m.current===null)return;const i=Se([e,l]);i.allowOverlay&&Co({target:o,content:i,initialValue:void 0,highlight:!0,cell:[e,l],forceEditMode:!0})},[Se,Co]),te=r.useCallback((e,l,o="both",i=0,c=0,h=void 0)=>{if(m.current!==null){const a=xe.current,f=F.current,v=typeof e!="number"?e.unit==="cell"?e.amount:void 0:e,g=typeof l!="number"?l.unit==="cell"?l.amount:void 0:l,b=typeof e!="number"&&e.unit==="px"?e.amount:void 0,y=typeof l!="number"&&l.unit==="px"?l.amount:void 0;if(a!==null&&f!==null){let w={x:0,y:0,width:0,height:0},S=0,L=0;if((v!==void 0||g!==void 0)&&(w=a.getBounds((v??0)+s,g??0)??w,w.width===0||w.height===0))return;const K=f.getBoundingClientRect(),D=K.width/f.offsetWidth;if(b!==void 0&&(w={...w,x:b-K.left-m.current.scrollLeft,width:1}),y!==void 0&&(w={...w,y:y+K.top-m.current.scrollTop,height:1}),w!==void 0){const R={x:w.x-i,y:w.y-c,width:w.width+2*i,height:w.height+2*c};let B=0;for(let tl=0;tl0&&(fe=$r(de,oe,He));let We=B*D+K.left+s*yt*D,Xe=K.right,Ne=K.top+Nt*D,Ye=K.bottom-fe*D;const xo=w.width+i*2;switch(h==null?void 0:h.hAlign){case"start":Xe=We+xo;break;case"end":We=Xe-xo;break;case"center":We=Math.floor((We+Xe)/2)-xo/2,Xe=We+xo;break}const Ro=w.height+c*2;switch(h==null?void 0:h.vAlign){case"start":Ye=Ne+Ro;break;case"end":Ne=Ye-Ro;break;case"center":Ne=Math.floor((Ne+Ye)/2)-Ro/2,Ye=Ne+Ro;break}We>R.x?S=R.x-We:XeR.y?L=R.y-Ne:Ye=de-oe)&&(L=0),(S!==0||L!==0)&&(D!==1&&(S/=D,L/=D),m.current.scrollTo(S+m.current.scrollLeft,L+m.current.scrollTop))}}}},[s,Ze,yt,Nt,qe,ke,de,Wt,He]),Hl=r.useRef(Ll),Dl=r.useRef(le),Yo=r.useRef(p);Hl.current=Ll,Dl.current=le,Yo.current=p;const kt=r.useCallback(async(e,l=!0)=>{var v;const o=G[e];if(((v=o==null?void 0:o.trailingRowOptions)==null?void 0:v.disabled)===!0)return;const i=Qe==null?void 0:Qe();let c,h=!0;i!==void 0&&(c=await i,c==="top"&&(h=!1),typeof c=="number"&&(h=!1));let a=0;const f=()=>{if(Yo.current<=p){a<500&&window.setTimeout(f,a),a=50+a*2;return}const g=typeof c=="number"?c:h?p:0;Mo.current(e-s,g),ve({cell:[e,g],range:{x:e,y:g,width:1,height:1}},!1,!1,"edit");const b=Dl.current([e-s,g]);b.allowOverlay&&zo(b)&&b.readonly!==!0&&l&&window.setTimeout(()=>{Hl.current(e,g)},0)};f()},[G,Qe,s,p,ve]),wo=r.useCallback(e=>{var o,i;const l=((i=(o=ke[e])==null?void 0:o.trailingRowOptions)==null?void 0:i.targetColumn)??(W==null?void 0:W.targetColumn);if(typeof l=="number")return l+(Ve?1:0);if(typeof l=="object"){const c=x.indexOf(l);if(c>=0)return c+(Ve?1:0)}},[ke,x,Ve,W==null?void 0:W.targetColumn]),lt=r.useRef(),St=r.useRef(),Ut=r.useCallback((e,l)=>{var c;const[o,i]=l;return ll(ue,(c=G[o])==null?void 0:c.themeOverride,O==null?void 0:O(i),e.themeOverride)},[O,G,ue]),Vt=r.useCallback(e=>{var b,y,w;const l=Eo.value?e.metaKey:e.ctrlKey,o=l&&Le==="multi",i=l&&he==="multi",[c,h]=e.location,a=u.columns,f=u.rows,[v,g]=((b=u.current)==null?void 0:b.cell)??[];if(e.kind==="cell"){if(St.current=void 0,mt.current=[c,h],c===0&&Ve){if(Q===!0&&h===p||Pe==="number"||Le==="none")return;const S=Se(e.location);if(S.kind!==So.Marker)return;if(Kt!==void 0){const D=Ce(S);Do((D==null?void 0:D.kind)===So.Marker);const R=(y=D==null?void 0:D.onClick)==null?void 0:y.call(D,{...e,cell:S,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,theme:Ut(S,e.location),preventDefault:()=>{}});if(R===void 0||R.checked===S.checked)return}H(void 0),pe();const L=f.hasIndex(h),K=lt.current;if(Le==="multi"&&(e.shiftKey||e.isLongTouch===!0)&&K!==void 0&&f.hasIndex(K)){const D=[Math.min(K,h),Math.max(K,h)+1];o||Po==="multi"?me(void 0,D,!0):me(V.fromSingleSelection(D),void 0,o)}else o||e.isTouch||Po==="multi"?L?me(f.remove(h),void 0,!0):(me(void 0,h,!0),lt.current=h):L&&f.length===1?me(V.empty(),void 0,l):(me(V.fromSingleSelection(h),void 0,l),lt.current=h)}else if(c>=s&&Q&&h===p){const S=wo(c);kt(S??c)}else if(v!==c||g!==h){const S=Se(e.location),L=Ce(S);if((L==null?void 0:L.onSelect)!==void 0){let R=!1;if(L.onSelect({...e,cell:S,posX:e.localEventX,posY:e.localEventY,bounds:e.bounds,preventDefault:()=>R=!0,theme:Ut(S,e.location)}),R)return}const K=Wt&&h===p,D=Wt&&u!==void 0&&((w=u.current)==null?void 0:w.cell[1])===p;if((e.shiftKey||e.isLongTouch===!0)&&v!==void 0&&g!==void 0&&u.current!==void 0&&!D){if(K)return;const R=Math.min(c,v),B=Math.max(c,v),fe=Math.min(h,g),oe=Math.max(h,g);ve({...u.current,range:{x:R,y:fe,width:B-R+1,height:oe-fe+1}},!0,l,"click"),lt.current=void 0,pe()}else ve({cell:[c,h],range:{x:c,y:h,width:1,height:1}},!0,l,"click"),lt.current=void 0,H(void 0),pe()}}else if(e.kind==="header")if(mt.current=[c,h],H(void 0),Ve&&c===0)lt.current=void 0,St.current=void 0,Le==="multi"&&(f.length!==p?me(V.fromSingleSelection([0,p]),void 0,l):me(V.empty(),void 0,l),pe());else{const S=St.current;if(he==="multi"&&(e.shiftKey||e.isLongTouch===!0)&&S!==void 0&&a.hasIndex(S)){const L=[Math.min(S,c),Math.max(S,c)+1];i?ie(void 0,L,l):ie(V.fromSingleSelection(L),void 0,l)}else i?(a.hasIndex(c)?ie(a.remove(c),void 0,l):ie(void 0,c,l),St.current=c):he!=="none"&&(ie(V.fromSingleSelection(c),void 0,l),St.current=c);lt.current=void 0,pe()}else e.kind===Ht?mt.current=[c,h]:e.kind===Yl&&!e.isMaybeScrollbar&&(De(Ho,!1),H(void 0),pe(),et==null||et(),lt.current=void 0,St.current=void 0)},[kt,he,pe,Ce,wo,Se,u,Ve,Wt,et,Kt,s,Pe,Le,Po,p,ve,De,ie,me,Q,Ut]),Bt=r.useRef(!1),mt=r.useRef(),El=r.useRef(Je),$e=r.useRef(),Zn=r.useCallback(e=>{if(Tt.current=!1,El.current=we.current,e.button!==0&&e.button!==1){$e.current=void 0;return}const l=performance.now();$e.current={button:e.button,time:l,location:e.location},(e==null?void 0:e.kind)==="header"&&(Bt.current=!0);const o=e.kind==="cell"&&e.isFillHandle;!o&&e.kind!=="cell"&&e.isEdge||(M({previousSelection:u,fillHandle:o}),mt.current=void 0,!e.isTouch&&e.button===0&&!o?Vt(e):!e.isTouch&&e.button===1&&(mt.current=e.location))},[u,Vt]),[_o,jo]=r.useState(),$l=r.useCallback(e=>{if(e.kind!==Ht||he!=="multi")return;const l=Eo.value?e.metaKey:e.ctrlKey,[o]=e.location,i=u.columns;if(o=s&&_l(c.group,G[f].group);f--)h--;for(let f=o+1;f{if(ce!==void 0&&Mt!==void 0){const l=we.current.y,o=we.current.height;let i=ce({x:e,y:l,width:1,height:Math.min(o,p-l)},Me.current.signal);typeof i!="object"&&(i=await i());const c=ke[e-s],a=document.createElement("canvas").getContext("2d",{alpha:!1});if(a!==null){a.font=ue.baseFontFull;const f=ln(a,ue,c,0,i,bt,ao,!1,Ce);Mt==null||Mt(c,f.width,e,f.width)}}},[ke,ce,ao,ue,bt,Mt,s,p,Ce]),[Jn,qo]=r.useState(),zt=r.useCallback(async(e,l)=>{var f,v;const o=(f=e.current)==null?void 0:f.range;if(o===void 0||ce===void 0||l.current===void 0)return;const i=l.current.range;if(_!==void 0){let g=!1;if(_({fillDestination:{...i,x:i.x-s},patternSource:{...o,x:o.x-s},preventDefault:()=>g=!0}),g)return}let c=ce(o,Me.current.signal);typeof c!="object"&&(c=await c());const h=c,a=[];for(let g=0;g({cell:g.location})))},[ce,Ee,_,s]),Fl=r.useCallback(()=>{if(u.current===void 0||u.current.range.width<=1)return;const e={...u,current:{...u.current,range:{...u.current.range,width:1}}};zt(e,u)},[zt,u]),Al=r.useCallback(()=>{if(u.current===void 0||u.current.range.height<=1)return;const e={...u,current:{...u.current,range:{...u.current.range,height:1}}};zt(e,u)},[zt,u]),Qn=r.useCallback((e,l)=>{var b,y;const o=E;if(M(void 0),Bo(void 0),qo(void 0),Bt.current=!1,l)return;if((o==null?void 0:o.fillHandle)===!0&&u.current!==void 0&&((b=o.previousSelection)==null?void 0:b.current)!==void 0){if(vt===void 0)return;const w={...u,current:{...u.current,range:Ar(o.previousSelection.current.range,vt)}};zt(o.previousSelection,w),De(w,!0);return}const[i,c]=e.location,[h,a]=mt.current??[],f=()=>{Tt.current=!0},v=w=>{var L,K,D;const S=w.isTouch||h===i&&a===c;if(S&&(ye==null||ye([i-s,c],{...w,preventDefault:f})),w.button===1)return!Tt.current;if(!Tt.current){const R=Se(e.location),B=Ce(R);if(B!==void 0&&B.onClick!==void 0&&S){const oe=B.onClick({...w,cell:R,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ut(R,e.location),preventDefault:f});oe!==void 0&&!To(oe)&&jt(oe)&&(Ee([{location:w.location,value:oe}]),(L=xe.current)==null||L.damage([{cell:w.location}]))}if(Tt.current||u.current===void 0)return!1;let fe=!1;switch(R.activationBehaviorOverride??Oo){case"double-click":case"second-click":{if(((D=(K=o==null?void 0:o.previousSelection)==null?void 0:K.current)==null?void 0:D.cell)===void 0)break;const[oe,We]=u.current.cell,[Xe,Ne]=o.previousSelection.current.cell;fe=i===oe&&i===Xe&&c===We&&c===Ne&&(w.isDoubleClick===!0||Oo==="second-click");break}case"single-click":{fe=!0;break}}if(fe)return Z==null||Z([i-s,c]),Rt(w.bounds,!1),!0}return!1},g=e.location[0]-s;if(e.isTouch){const w=we.current,S=El.current;if(w.x!==S.x||w.y!==S.y)return;if(e.isLongTouch===!0){if(e.kind==="cell"&&Ir((y=u.current)==null?void 0:y.cell,e.location)){Ae==null||Ae([g,e.location[1]],{...e,preventDefault:f});return}else if(e.kind==="header"&&u.columns.hasIndex(i)){Ie==null||Ie(g,{...e,preventDefault:f});return}else if(e.kind===Ht){if(g<0)return;z==null||z(g,{...e,preventDefault:f});return}}e.kind==="cell"?v(e)||Vt(e):e.kind===Ht?Te==null||Te(g,{...e,preventDefault:f}):(e.kind===Or&&(se==null||se(g,{...e,preventDefault:f})),Vt(e));return}if(e.kind==="header"){if(g<0)return;e.isEdge?e.isDoubleClick===!0&&po(i):e.button===0&&i===h&&c===a&&(se==null||se(g,{...e,preventDefault:f}))}if(e.kind===Ht){if(g<0)return;e.button===0&&i===h&&c===a&&(Te==null||Te(g,{...e,preventDefault:f}),Tt.current||$l(e))}e.kind==="cell"&&(e.button===0||e.button===1)&&v(e),mt.current=void 0},[E,u,s,vt,zt,De,ye,Se,Ce,Oo,Ut,Ee,Z,Rt,Ae,Ie,z,Vt,Te,se,po,$l]),er=r.useCallback(e=>{const l={...e,location:[e.location[0]-s,e.location[1]]};oo==null||oo(l),E!==void 0&&e.buttons===0&&(M(void 0),Bo(void 0),qo(void 0),Bt.current=!1),qo(o=>{var i;return Bt.current?[e.scrollEdge[0],0]:e.scrollEdge[0]===(o==null?void 0:o[0])&&e.scrollEdge[1]===o[1]?o:E===void 0||(((i=$e.current)==null?void 0:i.location[0])??0){lo==null||lo(e-s,l)},[lo,s]),Be=(Gl=u==null?void 0:u.current)==null?void 0:Gl.cell,or=r.useCallback((e,l,o,i,c,h)=>{Gt.current=!1;let a=Be;a!==void 0&&(a=[a[0]-s,a[1]]);const f=qe===0?void 0:{x:0,y:e.y,width:qe,height:e.height},v=[];f!==void 0&&v.push(f),Ze>0&&(v.push({x:e.x-s,y:p-Ze,width:e.width,height:Ze}),qe>0&&v.push({x:0,y:p-Ze,width:qe,height:Ze}));const g={x:e.x-s,y:e.y,width:e.width,height:Q&&e.y+e.height>=p?e.height-1:e.height,tx:c,ty:h,extras:{selected:a,freezeRegion:f,freezeRegions:v}};we.current=g,kl(g),Yn([l,o,i]),io==null||io(g,g.tx,g.ty,g.extras)},[Be,s,Q,p,qe,Ze,kl,io]),lr=Lt(ut,r.useCallback((e,l)=>{ut==null||ut(e-s,l-s),he!=="none"&&ie(V.fromSingleSelection(l),void 0,!0)},[he,ut,s,ie])),Zo=r.useRef(!1),nr=r.useCallback(e=>{if(e.location[0]===0&&s>0){e.preventDefault();return}to==null||to({...e,location:[e.location[0]-s,e.location[1]]}),e.defaultPrevented()||(Zo.current=!0),M(void 0)},[to,s]),rr=r.useCallback(()=>{Zo.current=!1},[]),Jo=r.useRef(),Qo=r.useCallback(e=>{var l,o,i;if(!Pr(e,Jo.current)&&(Jo.current=e,!(((l=$e==null?void 0:$e.current)==null?void 0:l.button)!==void 0&&$e.current.button>=1))){if(e.buttons!==0&&E!==void 0&&((o=$e.current)==null?void 0:o.location[0])===0&&e.location[0]===0&&s===1&&Le==="multi"&&E.previousSelection&&!E.previousSelection.rows.hasIndex($e.current.location[1])&&u.rows.hasIndex($e.current.location[1])){const c=Math.min($e.current.location[1],e.location[1]),h=Math.max($e.current.location[1],e.location[1])+1;me(V.fromSingleSelection([c,h]),void 0,!1)}if(e.buttons!==0&&E!==void 0&&u.current!==void 0&&!Zo.current&&!Bt.current&&(Ge==="rect"||Ge==="multi-rect")){const[c,h]=u.current.cell;let[a,f]=e.location;if(f<0&&(f=we.current.y),E.fillHandle===!0&&((i=E.previousSelection)==null?void 0:i.current)!==void 0){const v=E.previousSelection.current.range;f=Math.min(f,Q?p-1:p);const g=Kr(v,a,f,al);Bo(g)}else{if(Q&&h===p)return;if(Q&&f===p)if(e.kind===Yl)f--;else return;a=Math.max(a,s);const b=a-c,y=f-h,w={x:b>=0?c:a,y:y>=0?h:f,width:Math.abs(b)+1,height:Math.abs(y)+1};ve({...u.current,range:w},!0,!1,"drag")}}ro==null||ro({...e,location:[e.location[0]-s,e.location[1]]})}},[al,E,s,Le,u,Ge,ro,me,Q,p,ve]),ir=r.useCallback(()=>{var a,f;const e=Jo.current;if(e===void 0)return;const[l,o]=e.scrollEdge;let[i,c]=e.location;const h=we.current;l===-1?i=((f=(a=h.extras)==null?void 0:a.freezeRegion)==null?void 0:f.x)??h.x:l===1&&(i=h.x+h.width),o===-1?c=Math.max(0,h.y):o===1&&(c=Math.min(p-1,h.y+h.height)),i=Dt(i,0,G.length-1),c=Dt(c,0,p-1),Qo({...e,location:[i,c]})},[G.length,Qo,p]);_i(Jn,m,ir);const Ke=r.useCallback(e=>{if(u.current===void 0)return;const[l,o]=e,[i,c]=u.current.cell,h=u.current.range;let a=h.x,f=h.x+h.width,v=h.y,g=h.y+h.height;if(o!==0)switch(o){case 2:{g=p,v=c,te(0,g,"vertical");break}case-2:{v=0,g=c+1,te(0,v,"vertical");break}case 1:{vc+1?(g--,te(0,g,"vertical")):(v=Math.max(0,v-1),te(0,v,"vertical"));break}default:jl()}if(l!==0)if(l===2)f=G.length,a=i,te(f-1-s,0,"horizontal");else if(l===-2)a=s,f=i+1,te(a-s,0,"horizontal");else{let b=[];if(ce!==void 0){const y=ce({x:a,y:v,width:f-a-s,height:g-v},Me.current.signal);typeof y=="object"&&(b=Qi(y))}if(l===1){let y=!1;if(a0){const w=Et(a+1,i+1).find(S=>!b.includes(S-s));w!==void 0&&(a=w,y=!0)}else a++,y=!0;y&&te(a,0,"horizontal")}y||(f=Math.min(G.length,f+1),te(f-1-s,0,"horizontal"))}else if(l===-1){let y=!1;if(f>i+1){if(b.length>0){const w=Et(f-1,i,-1).find(S=>!b.includes(S-s));w!==void 0&&(f=w,y=!0)}else f--,y=!0;y&&te(f-s,0,"horizontal")}y||(a=Math.max(s,a-1),te(a-s,0,"horizontal"))}else jl()}ve({cell:u.current.cell,range:{x:a,y:v,width:f-a,height:g-v}},!0,!1,"keyboard-select")},[ce,u,G.length,s,p,te,ve]),nt=r.useCallback((e,l,o,i)=>{const c=de-(o?0:1);if(e=Dt(e,s,ke.length-1+s),l=Dt(l,0,c),e===(Be==null?void 0:Be[0])&&l===(Be==null?void 0:Be[1]))return!1;if(i&&u.current!==void 0){const h=[...u.current.rangeStack];(u.current.range.width>1||u.current.range.height>1)&&h.push(u.current.range),De({...u,current:{cell:[e,l],range:{x:e,y:l,width:1,height:1},rangeStack:h}},!0)}else ve({cell:[e,l],range:{x:e,y:l,width:1,height:1}},!0,!1,"keyboard-nav");return T.current!==void 0&&T.current[0]===e&&T.current[1]===l&&(T.current=void 0),te(e-s,l),!0},[de,s,ke.length,Be,u,te,De,ve]),cr=r.useCallback((e,l)=>{(k==null?void 0:k.cell)!==void 0&&e!==void 0&&jt(e)&&(Ee([{location:k.cell,value:e}]),window.requestAnimationFrame(()=>{var c;(c=xe.current)==null||c.damage([{cell:k.cell}])})),pe(!0),H(void 0);const[o,i]=l;if(u.current!==void 0&&(o!==0||i!==0)){const c=u.current.cell[1]===de-1&&e!==void 0;nt(Dt(u.current.cell[0]+o,0,G.length-1),Dt(u.current.cell[1]+i,0,de-1),c,!1)}q==null||q(e,l)},[k==null?void 0:k.cell,pe,u,q,Ee,de,nt,G.length]),sr=r.useMemo(()=>`gdg-overlay-${Ji++}`,[]),Ct=r.useCallback(e=>{var o,i,c,h;pe();const l=[];for(let a=e.x;a({cell:a.location})))},[pe,le,Ce,Ee,s]),Xt=k!==void 0,Il=r.useCallback(e=>{var S,L;const l=()=>{e.stopPropagation(),e.preventDefault()},o={didMatch:!1},{bounds:i}=e,c=u.columns,h=u.rows,a=tt;if(!Xt&&A(a.clear,e,o))De(Ho,!1),et==null||et();else if(!Xt&&A(a.selectAll,e,o))De({columns:V.empty(),rows:V.empty(),current:{cell:((S=u.current)==null?void 0:S.cell)??[s,0],range:{x:s,y:0,width:x.length,height:p},rangeStack:[]}},!1);else if(A(a.search,e,o))(L=P==null?void 0:P.current)==null||L.focus({preventScroll:!0}),wl(!0);else if(A(a.delete,e,o)){const K=(ot==null?void 0:ot(u))??!0;if(K!==!1){const D=K===!0?u:K;if(D.current!==void 0){Ct(D.current.range);for(const R of D.current.rangeStack)Ct(R)}for(const R of D.rows)Ct({x:s,y:R,width:x.length,height:1});for(const R of D.columns)Ct({x:R,y:0,width:1,height:p})}}if(o.didMatch)return l(),!0;if(u.current===void 0)return!1;let[f,v]=u.current.cell,g=!1,b=!1;A(a.scrollToSelectedCell,e,o)?Mo.current(f-s,v):he!=="none"&&A(a.selectColumn,e,o)?c.hasIndex(f)?ie(c.remove(f),void 0,!0):he==="single"?ie(V.fromSingleSelection(f),void 0,!0):ie(void 0,f,!0):Le!=="none"&&A(a.selectRow,e,o)?h.hasIndex(v)?me(h.remove(v),void 0,!0):Le==="single"?me(V.fromSingleSelection(v),void 0,!0):me(void 0,v,!0):!Xt&&i!==void 0&&A(a.activateCell,e,o)?v===p&&Q?window.setTimeout(()=>{const K=wo(f);kt(K??f)},0):(Z==null||Z([f-s,v]),Rt(i,!0)):u.current.range.height>1&&A(a.downFill,e,o)?Al():u.current.range.width>1&&A(a.rightFill,e,o)?Fl():A(a.goToNextPage,e,o)?v+=Math.max(1,we.current.height-4):A(a.goToPreviousPage,e,o)?v-=Math.max(1,we.current.height-4):A(a.goToFirstCell,e,o)?(H(void 0),v=0,f=0):A(a.goToLastCell,e,o)?(H(void 0),v=Number.MAX_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER):A(a.selectToFirstCell,e,o)?(H(void 0),Ke([-2,-2])):A(a.selectToLastCell,e,o)?(H(void 0),Ke([2,2])):Xt?(A(a.closeOverlay,e,o)&&H(void 0),A(a.acceptOverlayDown,e,o)&&(H(void 0),v++),A(a.acceptOverlayUp,e,o)&&(H(void 0),v--),A(a.acceptOverlayLeft,e,o)&&(H(void 0),f--),A(a.acceptOverlayRight,e,o)&&(H(void 0),f++)):(A(a.goDownCell,e,o)?v+=1:A(a.goUpCell,e,o)?v-=1:A(a.goRightCell,e,o)?f+=1:A(a.goLeftCell,e,o)?f-=1:A(a.goDownCellRetainSelection,e,o)?(v+=1,g=!0):A(a.goUpCellRetainSelection,e,o)?(v-=1,g=!0):A(a.goRightCellRetainSelection,e,o)?(f+=1,g=!0):A(a.goLeftCellRetainSelection,e,o)?(f-=1,g=!0):A(a.goToLastRow,e,o)?v=p-1:A(a.goToFirstRow,e,o)?v=Number.MIN_SAFE_INTEGER:A(a.goToLastColumn,e,o)?f=Number.MAX_SAFE_INTEGER:A(a.goToFirstColumn,e,o)?f=Number.MIN_SAFE_INTEGER:(Ge==="rect"||Ge==="multi-rect")&&(A(a.selectGrowDown,e,o)?Ke([0,1]):A(a.selectGrowUp,e,o)?Ke([0,-1]):A(a.selectGrowRight,e,o)?Ke([1,0]):A(a.selectGrowLeft,e,o)?Ke([-1,0]):A(a.selectToLastRow,e,o)?Ke([0,2]):A(a.selectToFirstRow,e,o)?Ke([0,-2]):A(a.selectToLastColumn,e,o)?Ke([2,0]):A(a.selectToFirstColumn,e,o)&&Ke([-2,0])),b=o.didMatch);const y=nt(f,v,!1,g),w=o.didMatch;return w&&(y||!b||dl)&&l(),w},[Xt,u,tt,he,Le,Ge,s,p,nt,De,et,x.length,ot,dl,Ct,ie,me,Q,wo,kt,Z,Rt,Al,Fl,Ke]),Yt=r.useCallback(e=>{let l=!1;if(Ft!==void 0&&Ft({...e,cancel:()=>{l=!0}}),l||Il(e)||u.current===void 0)return;const[o,i]=u.current.cell,c=we.current;if(eo&&!e.metaKey&&!e.ctrlKey&&u.current!==void 0&&e.key.length===1&&/[ -~]/g.test(e.key)&&e.bounds!==void 0&&zo(le([o-s,Math.max(0,Math.min(i,p-1))]))){if((!Q||i!==p)&&(c.y>i||i>c.y+c.height||c.x>o||o>c.x+c.width))return;Rt(e.bounds,!0,e.key),e.stopPropagation(),e.preventDefault()}},[eo,Ft,Il,u,le,s,p,Q,Rt]),ar=r.useCallback((e,l)=>{const o=e.location[0]-s;if(e.kind==="header"&&(Ie==null||Ie(o,{...e,preventDefault:l})),e.kind===Ht){if(o<0)return;z==null||z(o,{...e,preventDefault:l})}if(e.kind==="cell"){const[i,c]=e.location;Ae==null||Ae([o,c],{...e,preventDefault:l}),Nr(u,e.location)||nt(i,c,!1,!1)}},[u,Ae,z,Ie,s,nt]),el=r.useCallback(async e=>{var a,f,v;if(!tt.paste)return;function l(g,b,y,w){var L,K;const S=typeof y=="object"?(y==null?void 0:y.join(` +`))??"":(y==null?void 0:y.toString())??"";if(!To(g)&&zo(g)&&g.readonly!==!0){const D=J==null?void 0:J(S,g);if(D!==void 0&&jt(D))return{location:b,value:D};const R=Ce(g);if(R===void 0)return;if(R.kind===j.Custom){Do(g.kind===j.Custom);const B=(L=R.onPaste)==null?void 0:L.call(R,S,g.data);return B===void 0?void 0:{location:b,value:{...g,data:B}}}else{const B=(K=R.onPaste)==null?void 0:K.call(R,S,g,{formatted:w,formattedString:typeof w=="string"?w:w==null?void 0:w.join(` +`),rawValue:y});return B===void 0?void 0:(Do(B.kind===g.kind),{location:b,value:B})}}}const o=u.columns,i=u.rows,c=((a=m.current)==null?void 0:a.contains(document.activeElement))===!0||((f=F.current)==null?void 0:f.contains(document.activeElement))===!0;let h;if(u.current!==void 0?h=[u.current.range.x,u.current.range.y]:o.length===1?h=[o.first()??0,0]:i.length===1&&(h=[s,i.first()??0]),c&&h!==void 0){let g,b;const y="text/plain",w="text/html";if(navigator.clipboard.read!==void 0){const D=await navigator.clipboard.read();for(const R of D){if(R.types.includes(w)){const fe=await(await R.getType(w)).text(),oe=ql(fe);if(oe!==void 0){g=oe;break}}R.types.includes(y)&&(b=await(await R.getType(y)).text())}}else if(navigator.clipboard.readText!==void 0)b=await navigator.clipboard.readText();else if(e!==void 0&&(e==null?void 0:e.clipboardData)!==null){if(e.clipboardData.types.includes(w)){const D=e.clipboardData.getData(w);g=ql(D)}g===void 0&&e.clipboardData.types.includes(y)&&(b=e.clipboardData.getData(y))}else return;const[S,L]=h,K=[];do{if(ht===void 0){const D=Se(h),R=b??(g==null?void 0:g.map(fe=>fe.map(oe=>oe.rawValue).join(" ")).join(" "))??"",B=l(D,h,R,void 0);B!==void 0&&K.push(B);break}if(g===void 0){if(b===void 0)return;g=Gr(b)}if(ht===!1||typeof ht=="function"&&(ht==null?void 0:ht([h[0]-s,h[1]],g.map(D=>D.map(R=>{var B;return((B=R.rawValue)==null?void 0:B.toString())??""}))))!==!0)return;for(const[D,R]of g.entries()){if(D+L>=p)break;for(const[B,fe]of R.entries()){const oe=[B+S,D+L],[We,Xe]=oe;if(We>=G.length||Xe>=de)continue;const Ne=Se(oe),Ye=l(Ne,oe,fe.rawValue,fe.formatted);Ye!==void 0&&K.push(Ye)}}}while(!1);Ee(K),(v=xe.current)==null||v.damage(K.map(D=>({cell:D.location})))}},[J,Ce,Se,u,tt.paste,G.length,Ee,de,ht,s,p]);nl("paste",el,$,!1,!0);const _t=r.useCallback(async(e,l)=>{var a,f;if(!tt.copy)return;const o=l===!0||((a=m.current)==null?void 0:a.contains(document.activeElement))===!0||((f=F.current)==null?void 0:f.contains(document.activeElement))===!0,i=u.columns,c=u.rows,h=(v,g)=>{if(!sl)Zl(v,g,e);else{const b=g.map(y=>({kind:j.Text,data:x[y].title,displayData:x[y].title,allowOverlay:!1}));Zl([b,...v],g,e)}};if(o&&ce!==void 0){if(u.current!==void 0){let v=ce(u.current.range,Me.current.signal);typeof v!="object"&&(v=await v()),h(v,Et(u.current.range.x-s,u.current.range.x+u.current.range.width-s))}else if(c!==void 0&&c.length>0){const g=[...c].map(b=>{const y=ce({x:s,y:b,width:x.length,height:1},Me.current.signal);return typeof y=="object"?y[0]:y().then(w=>w[0])});if(g.some(b=>b instanceof Promise)){const b=await Promise.all(g);h(b,Et(x.length))}else h(g,Et(x.length))}else if(i.length>0){const v=[],g=[];for(const b of i){let y=ce({x:b,y:0,width:1,height:p},Me.current.signal);typeof y!="object"&&(y=await y()),v.push(y),g.push(b-s)}if(v.length===1)h(v[0],g);else{const b=v.reduce((y,w)=>y.map((S,L)=>[...S,...w[L]]));h(b,g)}}}},[x,ce,u,tt.copy,s,p,sl]);nl("copy",_t,$,!1,!1);const ur=r.useCallback(async e=>{var o,i;if(!(!tt.cut||!(((o=m.current)==null?void 0:o.contains(document.activeElement))===!0||((i=F.current)==null?void 0:i.contains(document.activeElement))===!0))&&(await _t(e),u.current!==void 0)){let c={current:{cell:u.current.cell,range:u.current.range,rangeStack:[]},rows:V.empty(),columns:V.empty()};const h=ot==null?void 0:ot(c);if(h===!1||(c=h===!0?c:h,c.current===void 0))return;Ct(c.current.range)}},[Ct,u,tt.cut,_t,ot]);nl("cut",ur,$,!1,!1);const dr=r.useCallback((e,l)=>{if(Oe!==void 0){s!==0&&(e=e.map(c=>[c[0]-s,c[1]])),Oe(e,l);return}if(e.length===0||l===-1)return;const[o,i]=e[l];T.current!==void 0&&T.current[0]===o&&T.current[1]===i||(T.current=[o,i],nt(o,i,!1,!1))},[Oe,s,nt]),[bo,yo]=((Ul=gt==null?void 0:gt.current)==null?void 0:Ul.cell)??[],Mo=r.useRef(te);Mo.current=te,r.useLayoutEffect(()=>{var e,l,o,i;!Gt.current&&bo!==void 0&&yo!==void 0&&(bo!==((l=(e=uo.current)==null?void 0:e.current)==null?void 0:l.cell[0])||yo!==((i=(o=uo.current)==null?void 0:o.current)==null?void 0:i.cell[1]))&&Mo.current(bo,yo),Gt.current=!1},[bo,yo]);const Ol=u.current!==void 0&&(u.current.cell[0]>=G.length||u.current.cell[1]>=de);r.useLayoutEffect(()=>{Ol&&De(Ho,!1)},[Ol,De]);const fr=r.useMemo(()=>Q===!0&&(W==null?void 0:W.tint)===!0?V.fromSingleSelection(de-1):V.empty(),[de,Q,W==null?void 0:W.tint]),hr=r.useCallback(e=>typeof pt=="boolean"?pt:(pt==null?void 0:pt(e-s))??!0,[s,pt]),gr=r.useMemo(()=>{if(_o===void 0||F.current===null)return null;const{bounds:e,group:l}=_o,o=F.current.getBoundingClientRect();return X(Ii,{bounds:e,group:l,canvasBounds:o,onClose:()=>jo(void 0),onFinish:i=>{jo(void 0),ee==null||ee(l,i)}})},[ee,_o]),vr=Math.min(G.length,qe+(Ve?1:0));r.useImperativeHandle(n,()=>({appendRow:(e,l)=>kt(e+s,l),updateCells:e=>{var l;return s!==0&&(e=e.map(o=>({cell:[o.cell[0]+s,o.cell[1]]}))),(l=xe.current)==null?void 0:l.damage(e)},getBounds:(e,l)=>{var o;if(!((F==null?void 0:F.current)===null||(m==null?void 0:m.current)===null)){if(e===void 0&&l===void 0){const i=F.current.getBoundingClientRect(),c=i.width/m.current.clientWidth;return{x:i.x-m.current.scrollLeft*c,y:i.y-m.current.scrollTop*c,width:m.current.scrollWidth*c,height:m.current.scrollHeight*c}}return(o=xe.current)==null?void 0:o.getBounds((e??0)+s,l)}},focus:()=>{var e;return(e=xe.current)==null?void 0:e.focus()},emit:async e=>{switch(e){case"delete":Yt({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":Yt({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":Yt({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 _t(void 0,!0);break;case"paste":await el();break}},scrollTo:te,remeasureColumns:e=>{for(const l of e)po(l+s)}}),[kt,po,_t,Yt,el,s,te]);const[Pl,Kl]=Be??[],mr=r.useCallback(e=>{const[l,o]=e;if(o===-1){he!=="none"&&(ie(V.fromSingleSelection(l),void 0,!1),pe());return}Pl===l&&Kl===o||(ve({cell:e,range:{x:l,y:o,width:1,height:1}},!0,!1,"keyboard-nav"),te(l,o))},[he,pe,te,Pl,Kl,ve,ie]),[Cr,wr]=r.useState(!1),Wl=r.useRef(_r(e=>{wr(e)},5)),pr=r.useCallback(()=>{Wl.current(!0),u.current===void 0&&u.columns.length===0&&u.rows.length===0&&E===void 0&&ve({cell:[s,ho],range:{x:s,y:ho,width:1,height:1}},!0,!1,"keyboard-select")},[ho,u,E,s,ve]),br=r.useCallback(()=>{Wl.current(!1)},[]),[yr,Mr]=r.useMemo(()=>{let e;const l=(ae==null?void 0:ae.scrollbarWidthOverride)??Ur(),o=p+(Q?1:0);if(typeof He=="number")e=Nt+o*He;else{let c=0;const h=Math.min(o,10);for(let a=0;ah.width+c,0)+l;return[`${Math.min(1e5,i)}px`,`${Math.min(1e5,e)}px`]},[G,ae==null?void 0:ae.scrollbarWidthOverride,He,p,Q,Nt]),xr=r.useMemo(()=>Vr(ue),[ue]);return X(Br.Provider,{value:ue,children:qt(Bi,{style:xr,className:$t,inWidth:ne??yr,inHeight:Fe??Mr,children:[X(Ei,{fillHandle:hn,drawFocusRing:ul,experimental:ae,fixedShadowX:gn,fixedShadowY:vn,getRowThemeOverride:O,headerIcons:mn,imageWindowLoader:Cn,initialSize:wn,isDraggable:pn,onDragLeave:bn,onRowMoved:Kt,overscrollX:In,overscrollY:On,preventDiagonalScrolling:xn,rightElement:Rn,rightElementProps:kn,smoothScrollX:Sn,smoothScrollY:Tn,className:$t,enableGroups:Vo,onCanvasFocused:pr,onCanvasBlur:br,canvasRef:F,onContextMenu:ar,theme:ue,cellXOffset:jn,cellYOffset:ho,accessibilityHeight:Je.height,onDragEnd:rr,columns:G,nonGrowWidth:bl,drawHeader:Bn,onColumnProposeMove:Zt,drawCell:Xn,disabledRows:fr,freezeColumns:vr,lockColumns:s,firstColAccessible:s===0,getCellContent:Se,minColumnWidth:bt,maxColumnWidth:ao,searchInputRef:P,showSearch:Kn,onSearchClose:Wn,highlightRegions:qn,getCellsForSelection:ce,getGroupDetails:Xo,headerHeight:Go,isFocused:Cr,groupHeaderHeight:Vo?ml:0,freezeTrailingRows:Ze+(Q&&(W==null?void 0:W.sticky)===!0?1:0),hasAppendRow:Q,onColumnResize:Mt,onColumnResizeEnd:Un,onColumnResizeStart:Vn,onCellFocused:mr,onColumnMoved:lr,onDragStart:nr,onHeaderMenuClick:tr,onItemHovered:Qo,isFilling:(E==null?void 0:E.fillHandle)===!0,onMouseMove:er,onKeyDown:Yt,onKeyUp:at,onMouseDown:Zn,onMouseUp:Qn,onDragOverCell:dn,onDrop:fn,onSearchResultsChanged:dr,onVisibleRegionChanged:or,clientSize:Uo,rowHeight:He,searchResults:st,searchValue:Fo,onSearchValueChange:Jt,rows:de,scrollRef:m,selection:u,translateX:Je.tx,translateY:Je.ty,verticalBorder:hr,gridRef:xe,getCellRenderer:Ce}),gr,k!==void 0&&X(r.Suspense,{fallback:null,children:X(Zi,{...k,validateCell:Gn,bloom:wt,id:sr,getCellRenderer:Ce,className:(ae==null?void 0:ae.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:un,imageEditorOverride:N,onFinishEditing:cr,markdownDivCreateNode:be,isOutsideClick:En})})]})})},tc=r.forwardRef(ec),oc=(t,n)=>{const d=r.useMemo(()=>({...ki,...t.headerIcons}),[t.headerIcons]),C=r.useMemo(()=>t.imageWindowLoader??new Xr,[t.imageWindowLoader]);return X(tc,{...t,renderers:Yr,headerIcons:d,ref:n,imageWindowLoader:C})},fc=r.forwardRef(oc);export{$i as C,fc as D,rt as k}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-XTO4-8W8.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./index-wocATsGp.js","./image-window-loader-h6lJQmfV.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./iframe-t8ayfGqb.js","./image-window-loader-1jHxuE_X.css","./flatten-qRvRBp6y.js","./scrolling-data-grid-6lFEHS8-.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-ligl_Vjz.js b/docs/assets/data-editor-all-ligl_Vjz.js deleted file mode 100644 index 809f5a2b6..000000000 --- a/docs/assets/data-editor-all-ligl_Vjz.js +++ /dev/null @@ -1,135 +0,0 @@ -var ms=Object.defineProperty;var ws=(e,t,n)=>t in e?ms(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var We=(e,t,n)=>(ws(e,typeof t!="symbol"?t+"":t,n),n);import{r as l,R as Bt}from"./index-BMVQvedj.js";import{_ as al}from"./iframe-ni8xiI1Q.js";import{h as ys,d as cl,j as bs,v as ps,_ as vs,g as Cs,c as mn,r as Zn,t as ks}from"./throttle-7EuXLZa7.js";import{u as xs,f as Li}from"./flatten-qRvRBp6y.js";import{s as Qt,b as Ss}from"./marked.esm-dbrxtycE.js";function dl(e="This should not happen"){throw new Error(e)}function Zt(e,t="Assertion failed"){if(!e)return dl(t)}function Ko(e,t){return dl(t??"Hell froze over")}function Ms(e,t){try{return e()}catch{return t}}const Ai=Object.prototype.hasOwnProperty;function ko(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--&&ko(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(Ai.call(e,n)&&++o&&!Ai.call(t,n)||!(n in t)||!ko(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const pr=null,ci=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 vr;(function(e){e.Triangle="triangle",e.Dots="dots"})(vr||(vr={}));function gr(e){return"width"in e&&typeof e.width=="number"}async function Pi(e){return typeof e=="object"?e:await e()}function po(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function Jd(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 vo(e){return e.kind===ln.Marker||e.kind===ln.NewRow}function $o(e){if(!po(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;Ko(e,"A cell was passed with an invalid kind")}function Rs(e){return ys(e,"editor")}function oi(e){return!(e.readonly??!1)}var ln;(function(e){e.NewRow="new-row",e.Marker="marker"})(ln||(ln={}));function Es(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 Fn(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=Es([...this.items,n]);return new Fn(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,a]of n.entries()){const[s,c]=a;if(s<=r&&o<=c){const f=[];s=o&&tBi??(Bi=new Fn([]))),We(Fn,"fromSingleSelection",t=>Fn.empty().add(t));let ot=Fn;const Ds=Qt("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});function Lt(e,t,n,o,r=!1){const i=l.useRef();i.current=t,l.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=c=>{var f;(f=i.current)==null||f.call(a,c)};return a.addEventListener(e,s,{passive:o,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,o,r])}function yo(e,t){return e===void 0?void 0:t}const Is=Math.PI;function Oi(e){return e*Is/180}const ul=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),fl=(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}},hl=(e,t,n)=>Math.min(e,t-n*2),gl=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,di=e=>{const t=e.fgColor??"currentColor";return l.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"}),l.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"}))},Fs=e=>{const t=e.fgColor??"currentColor";return l.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Ts(e,t,n){const[o,r]=l.useState(e),i=l.useRef(!0);l.useEffect(()=>()=>{i.current=!1},[]);const a=l.useRef(cl(s=>{i.current&&r(s)},n));return l.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),o}const Hs="֑-߿יִ-﷽ﹰ-ﻼ",Ls="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",As=new RegExp("^[^"+Ls+"]*["+Hs+"]");function ui(e){return As.test(e)?"rtl":"not-rtl"}let mr;function ri(){if(typeof document>"u")return 0;if(mr!==void 0)return mr;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(),mr=n-o,mr}const jn=Symbol();function zs(e){const t=l.useRef([jn,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=l.useState(e),[,r]=l.useState(),i=l.useCallback(s=>{const c=t.current[0];c!==jn&&(s=typeof s=="function"?s(c):s,s===c)||(c!==jn&&r({}),o(f=>typeof s=="function"?s(c===jn?f:c):s),t.current[0]=jn)},[]),a=l.useCallback(()=>{t.current[0]=jn,r({})},[]);return[t.current[0]===jn?n:t.current[0],i,a]}function ml(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 Ps(e){const t=l.useRef(e);return ko(e,t.current)||(t.current=e),t.current}const Bs=e=>{const{urls:t,canWrite:n,onEditClick:o,renderImage:r}=e,i=t.filter(s=>s!=="");if(i.length===0)return null;const a=i.length>1;return l.createElement(Ds,{"data-testid":"GDG-default-image-overlay-editor"},l.createElement(bs.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(s=>{const c=(r==null?void 0:r(s))??l.createElement("img",{draggable:!1,src:s});return l.createElement("div",{className:"gdg-centering-container",key:s},c)})),n&&o&&l.createElement("button",{className:"gdg-edit-icon",onClick:o},l.createElement(di,null)))},Os=Qt("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Ws extends Bt.PureComponent{constructor(){super(...arguments);We(this,"targetElement",null);We(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,a=Ss(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let c=i==null?void 0:i(a);if(c===void 0){const u=document.createElement("template");u.innerHTML=a,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(),Bt.createElement(Os,{ref:this.containerRefHook})}}const $s=Qt("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Ns=Qt("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Xs=Qt("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Wi=0;const Mr=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:r,altNewline:i,validatedSelection:a,...s}=e,{onChange:c,className:f}=s,u=l.useRef(null),w=n??"";Zt(c!==void 0,"GrowingEntry must be a controlled input area");const[m]=l.useState(()=>"input-box-"+(Wi=(Wi+1)%1e7));l.useEffect(()=>{const h=u.current;if(h===null||h.disabled)return;const y=w.toString().length;h.focus(),h.setSelectionRange(r?0:y,y)},[]),l.useLayoutEffect(()=>{var h;if(a!==void 0){const y=typeof a=="number"?[a,null]:a;(h=u.current)==null||h.setSelectionRange(y[0],y[1])}},[a]);const g=l.useCallback(h=>{h.key==="Enter"&&h.shiftKey&&i===!0||o==null||o(h)},[i,o]);return l.createElement(Xs,{className:"gdg-growing-entry"},l.createElement(Ns,{className:f},w+` -`),l.createElement($s,{...s,className:(f??"")+" gdg-input",id:m,ref:u,onKeyDown:g,value:w,placeholder:t,dir:"auto"}))},qr={};let On=null;function Ys(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function xo(e){const t=e.toLowerCase().trim();if(qr[t]!==void 0)return qr[t];On=On||Ys(),On.style.color="#000",On.style.color=t;const n=getComputedStyle(On).color;On.style.color="#fff",On.style.color=t;const o=getComputedStyle(On).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),qr[t]=r,r}function Jn(e,t){const[n,o,r]=xo(e);return`rgba(${n}, ${o}, ${r}, ${t})`}const $i=new Map;function Ni(e,t){const n=`${e}-${t}`,o=$i.get(n);if(o!==void 0)return o;const r=Jt(e,t);return $i.set(n,r),r}function Jt(e,t){if(t===void 0)return e;const[n,o,r,i]=xo(e);if(i===1)return e;const[a,s,c,f]=xo(t),u=i+f*(1-i),w=(i*n+f*a*(1-i))/u,m=(i*o+f*s*(1-i))/u,g=(i*r+f*c*(1-i))/u;return`rgba(${w}, ${m}, ${g}, ${u})`}function Qd(e,t,n){if(n<=0)return e;if(n>=1)return t;const o=[...xo(e)];o[0]=o[0]*o[3],o[1]=o[1]*o[3],o[2]=o[2]*o[3];const r=[...xo(t)];r[0]=r[0]*r[3],r[1]=r[1]*r[3],r[2]=r[2]*r[3];const i=n,a=1-n,s=o[3]*a+r[3]*i,c=Math.floor((o[0]*a+r[0]*i)/s),f=Math.floor((o[1]*a+r[1]*i)/s),u=Math.floor((o[2]*a+r[2]*i)/s);return`rgba(${c}, ${f}, ${u}, ${s})`}function eu(e){if(e==="transparent")return 0;function t(i){const a=i/255;return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}const[n,o,r]=xo(e);return .2126*t(n)+.7152*t(o)+.0722*t(r)}function Ks(e,t){return Bt.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 wl(e,t){const[n,o]=e;return n>=t.x&&n=t.y&&oa)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 Vs(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)&&Xi(e,t,i)&&r++;for(const a of n.current.rangeStack)Xi(e,t,a)&&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,a)=>({...i,sticky:e[a].sticky})),n=o}return n}function So(e,t){let n=0;const o=bl(e,t);for(let r=0;r0)for(const f of a)n-=f.width;let s=t,c=r??0;for(;c<=n&&s=w)return y}const m=i-f,g=e-(c??0);if(typeof a=="number"){const h=Math.floor((g-u)/a)+s;return h>=m?void 0:h}else{let h=u;for(let y=s;y"u";async function Zs(){var e;js||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,br=0,Xo={},ps())}Zs();function pl(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function _o(e,t,n,o="middle"){const r=pl(e,t,o,n);let i=Xo[r];return i===void 0&&(i=t.measureText(e),Xo[r]=i,br++),br>1e4&&(Xo={},br=0),i}function Js(e,t){const n=pl(e,void 0,"middle",t);return Xo[n]}function Xn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Qs(e,t)}function Yi(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const Ki=[];function Qs(e,t){for(const i of Ki)if(i.key===t)return i.val;const n=Yi(e,"alphabetic"),r=-(Yi(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Ki.push({key:t,val:r}),r}function ea(e,t,n,o,r,i){const{ctx:a,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 na(e,t,n,o,r,i,a,s,c,f){const u=s.baseFontFull,w=vs(e,t,u,r-s.cellHorizontalPadding*2,f??!1),m=Cl(e,u),g=s.lineHeight*m,h=m+g*(w.length-1),y=h+s.cellVerticalPadding>i;y&&(e.save(),e.rect(n,o,r,i),e.clip());const k=o+i/2-h/2;let M=Math.max(o+s.cellVerticalPadding,k);for(const C of w)if(vl(e,C,n,M,r,m,a,s,c),M+=g,M>o+i)break;y&&e.restore()}function kn(e,t,n,o,r){const{ctx:i,rect:a,theme:s}=e,{x:c,y:f,width:u,height:w}=a;o=o??!1,o||(t=ta(t,u));const m=Xn(i,s),g=ui(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?na(i,t,c,f,u,w,m,s,n,r):vl(i,t,c,f,u,w,m,s,n),h&&(i.textAlign="start"),g&&(i.direction="inherit")}}function xn(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 oa(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,w=Math.sqrt(f*f+u*u),m=f/w,g=u/w;return{x:f,y:c.y-s.y,len:w,nx:m,ny:g,ang:Math.atan2(g,m)}};let r;const i=t.length;let a=t[i-1];for(let s=0;s1?1:m),y=1,k=!1;g<0?h<0?h=Math.PI+h:(h=Math.PI-h,y=-1,k=!0):h>0&&(y=-1,k=!0),r=c.radius!==void 0?c.radius:n;const M=h/2;let C=Math.abs(Math.cos(M)*r/Math.sin(M)),v;C>Math.min(u.len/2,w.len/2)?(C=Math.min(u.len/2,w.len/2),v=Math.abs(C*Math.sin(M)/Math.cos(M))):v=r;let A=c.x+w.nx*C,P=c.y+w.ny*C;A+=-w.ny*v*y,P+=w.nx*v*y,e.arc(A,P,v,u.ang+Math.PI/2*y,w.ang-Math.PI/2*y,k),a=c,c=f}e.closePath()}function li(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h){const y={x:0,y:i+f,width:0,height:0};if(e>=g.length||t>=u||t<-2||e<0)return y;const k=i-r;if(e>=w){const M=a>e?-1:1,C=So(g);y.x+=C+c;for(let v=a;v!==e;v+=M)y.x+=g[M===1?v:v-1].width*M}else for(let M=0;M0&&Uo(g[M-1].group,C)&&g[M-1].sticky===v;){const P=g[M-1];y.x-=P.width,y.width+=P.width,M--}let A=e;for(;A+1n&&(y.width=n-y.x)}}else if(t>=u-m){let M=u-t;for(y.y=o;M>0;){const C=t+M-1;y.height=typeof h=="number"?h:h(C),y.y-=y.height,M--}y.height+=1}else{const M=s>t?-1:1;if(typeof h=="number"){const C=t-s;y.y+=C*h}else for(let C=s;C!==t;C+=M)y.y+=h(C)*M;y.height=(typeof h=="number"?h:h(t))+1}return y}const fi=1<<21;function wn(e,t){return(t+2)*fi+e}function kl(e){return e%fi}function hi(e){return Math.floor(e/fi)-2}function gi(e){const t=kl(e),n=hi(e);return[t,n]}class xl{constructor(){We(this,"visibleWindow",{x:0,y:0,width:0,height:0});We(this,"freezeCols",0);We(this,"freezeRows",[]);We(this,"isInWindow",t=>{const n=kl(t),o=hi(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&&a})}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&&ko(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class ia extends xl{constructor(){super(...arguments);We(this,"cache",new Map);We(this,"setValue",(n,o)=>{this.cache.set(wn(n[0],n[1]),o)});We(this,"getValue",n=>this.cache.get(wn(n[0],n[1])));We(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class Yo{constructor(t=[]){We(this,"cells");this.cells=new Set(t.map(n=>wn(n[0],n[1])))}add(t){this.cells.add(wn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(wn(t[0],t[1]))}remove(t){this.cells.delete(wn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(hi(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{const g=sa(e,m[o],t,c);return f=Math.max(f,g),g});if(u.length>5&&s){f=0;let m=0;for(const h of u)m+=h;const g=m/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+16+(n.icon===void 0?0:28));const w=Math.max(Math.ceil(i),Math.min(Math.floor(a),Math.ceil(f)));return{...n,width:w}}function aa(e,t,n,o,r,i,a,s,c){const f=l.useRef(t),u=l.useRef(n),w=l.useRef(a);f.current=t,u.current=n,w.current=a;const[m,g]=l.useMemo(()=>{if(typeof window>"u")return[null,null];const C=document.createElement("canvas");return C.style.display="none",C.style.opacity="0",C.style.position="fixed",[C,C.getContext("2d",{alpha:!1})]},[]);l.useLayoutEffect(()=>(m&&document.documentElement.append(m),()=>{m==null||m.remove()}),[m]);const h=l.useRef({}),y=l.useRef(),[k,M]=l.useState();return l.useLayoutEffect(()=>{const C=u.current;if(C===void 0||e.every(gr))return;let v=Math.max(1,10-Math.floor(e.length/1e4)),A=0;v1&&(v--,A=1);const P={x:0,y:0,width:e.length,height:Math.min(f.current,v)},O={x:0,y:f.current-1,width:e.length,height:1};(async()=>{const X=C(P,c.signal),R=A>0?C(O,c.signal):void 0;let W;typeof X=="object"?W=X:W=await Pi(X),R!==void 0&&(typeof R=="object"?W=[...W,...R]:W=[...W,...await Pi(R)]),y.current=e,M(W)})()},[c.signal,e]),l.useMemo(()=>{let v=e.every(gr)?e:g===null?e.map(T=>gr(T)?T:{...T,width:si}):(g.font=w.current.baseFontFull,e.map((T,X)=>{if(gr(T))return T;if(h.current[T.id]!==void 0)return{...T,width:h.current[T.id]};if(k===void 0||y.current!==e||T.id===void 0)return{...T,width:si};const R=El(g,a,T,X,k,r,i,!0,s);return h.current[T.id]=R.width,R})),A=0,P=0;const O=[];for(const[T,X]of v.entries())A+=X.width,X.grow!==void 0&&X.grow>0&&(P+=X.grow,O.push(T));if(A0){const T=[...v],X=o-A;let R=X;for(let W=0;W{const t=e.fgColor,n=e.bgColor;return` - ${at}`},da=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at}`},ua=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - `},fa=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},ha=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},Dl=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - - - `},ga=e=>{const t=e.bgColor;return`${at} - - - - -`},ma=Dl,wa=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},ya=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - - - - - - `},ba=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - -`},pa=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},va=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},Ca=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},ka=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - - `},xa=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - -`},Sa=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - - `},Ma=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},Ra=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},Ea=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},Da=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},Ia=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - - - -`},Fa=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},Ta=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},Ha=e=>{const t=e.fgColor,n=e.bgColor;return` - ${at} - - - `},La=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - - -`},Aa=e=>{const t=e.fgColor,n=e.bgColor;return`${at} - - -`},za=e=>{const t=e.fgColor;return` - - - `},Pa=e=>{const t=e.fgColor;return` - - - -`},Ba={headerRowID:ca,headerNumber:ua,headerCode:da,headerString:fa,headerBoolean:ha,headerAudioUri:ma,headerVideoUri:wa,headerEmoji:ya,headerImage:ba,headerUri:Dl,headerPhone:pa,headerMarkdown:va,headerDate:Ca,headerTime:ka,headerEmail:xa,headerReference:Sa,headerIfThenElse:Ma,headerSingleValue:Ra,headerLookup:Ea,headerTextTemplate:Da,headerMath:Ia,headerRollup:Fa,headerJoinStrings:Ta,headerSplitString:Ha,headerGeoDistance:La,headerArray:Aa,rowOwnerOverlay:za,protectedColumnOverlay:Pa,renameIcon:ga};function Oa(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Wa{constructor(t,n){We(this,"onSettled");We(this,"spriteMap",new Map);We(this,"headerIcons");We(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,o,r,i,a,s,c=1){const[f,u]=Oa(n,s),w=a*Math.ceil(window.devicePixelRatio),m=`${f}_${u}_${w}_${t}`;let g=this.spriteMap.get(m);if(g===void 0){const h=this.headerIcons[t];if(h===void 0)return;g=document.createElement("canvas");const y=g.getContext("2d");if(y===null)return;const k=new Image;k.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h({fgColor:u,bgColor:f}))}`,this.spriteMap.set(m,g);const M=k.decode();if(M===void 0)return;this.inFlight++,M.then(()=>{y.drawImage(k,0,0,w,w)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else c<1&&(o.globalAlpha=c),o.drawImage(g,0,0,w,w,r,i,a,a),c<1&&(o.globalAlpha=1)}}function Il(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Rr(e,t,n,o,r,i,a,s,c){s=s??t;let f=t,u=e;const w=o-i;let m=!1;for(;fs&&c(f,u,g,!1,a&&u===o-1)===!0){m=!0;break}f+=g,u++}if(!m){f=n;for(let g=0;g!g.sticky))==null?void 0:m.sourceIndex)??0;if(c>w){const g=Math.max(s,w);let h=t,y=o;for(let k=i.sourceIndex-1;k>=g;k--)h-=a[k].width,y+=a[k].width;for(let k=i.sourceIndex+1;k<=c;k++)y+=a[k].width;u={x:h,y:n,width:y,height:r}}if(w>s){const g=Math.min(c,w-1);let h=t,y=o;for(let k=i.sourceIndex-1;k>=s;k--)h-=a[k].width,y+=a[k].width;for(let k=i.sourceIndex+1;k<=g;k++)y+=a[k].width;f={x:h,y:n,width:y,height:r}}return[f,u]}function $a(e,t,n,o){if(o==="any")return Hl(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),wl([t,n],e))return;const r=t-e.x,i=e.x+e.width-t,a=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:a,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===a?{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 Cr(e,t,n,o,r,i,a,s){return e<=r+a&&r<=e+n&&t<=i+s&&i<=t+o}function Er(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Hl(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 Na(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 Xa(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,a=t+4,s=n+4,c=r-e.x,f=e.x+e.width-a,u=i-e.y,w=e.y+e.height-s,m=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,y=w>0?e.y+e.height-Math.floor(w/o)*o:e.y+e.height;return{x:m,y:h,width:g-m,height:y-h}}function Ya(e,t,n,o,r){const[i,a,s,c]=t,[f,u,w,m]=r,{x:g,y:h,width:y,height:k}=e,M=[];if(y<=0||k<=0)return M;const C=g+y,v=h+k,A=gs,T=h+k>c,X=g>=i&&gi&&C<=s||gs,R=h>=a&&ha&&v<=c||hc;if(X&&R){const B=Math.max(g,i),D=Math.max(h,a),S=Math.min(C,s),E=Math.min(v,c);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:f,y:u,width:w-f+1,height:m-u+1}})}if(A&&P){const B=g,D=h,S=Math.min(C,i),E=Math.min(v,a);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:0,y:0,width:f+1,height:u+1}})}if(P&&X){const B=Math.max(g,i),D=h,S=Math.min(C,s),E=Math.min(v,a);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:f,y:0,width:w-f+1,height:u+1}})}if(P&&O){const B=Math.max(g,s),D=h,S=C,E=Math.min(v,a);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:w,y:0,width:n-w+1,height:u+1}})}if(A&&R){const B=g,D=Math.max(h,a),S=Math.min(C,i),E=Math.min(v,c);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:0,y:u,width:f+1,height:m-u+1}})}if(O&&R){const B=Math.max(g,s),D=Math.max(h,a),S=C,E=Math.min(v,c);M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:w,y:u,width:n-w+1,height:m-u+1}})}if(A&&T){const B=g,D=Math.max(h,c),S=Math.min(C,i),E=v;M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:0,y:m,width:f+1,height:o-m+1}})}if(T&&X){const B=Math.max(g,i),D=Math.max(h,c),S=Math.min(C,s),E=v;M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:f,y:m,width:w-f+1,height:o-m+1}})}if(O&&T){const B=Math.max(g,s),D=Math.max(h,c),S=C,E=v;M.push({rect:{x:B,y:D,width:S-B,height:E-D},clip:{x:w,y:m,width:n-w+1,height:o-m+1}})}return M}const Ka={kind:J.Loading,allowOverlay:!1};function Ui(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M,C,v,A,P,O,T,X,R,W,B,D,S,E,Z,te,le,fe){let De=(v==null?void 0:v.size)??Number.MAX_SAFE_INTEGER;const re=performance.now();let V=S.baseFontFull;e.font=V;const se={ctx:e},de=[0,0],He=k>0?Qn(c,k,f):0;let U,pe;const ke=Il(C);return Yn(t,s,i,a,r,(xe,qe,Ze,rt,Je)=>{const Re=Math.max(0,rt-qe),Be=qe+Re,Le=r+1,wt=xe.width-Re,ue=o-r-1;if(C.length>0){let Ke=!1;for(let Ue=0;Ue{e.save(),e.beginPath(),e.rect(Be,Le,wt,ue),e.clip()},Se=A.columns.hasIndex(xe.sourceIndex),Ee=w(xe.group??"").overrideTheme,Fe=xe.themeOverride===void 0&&Ee===void 0?S:Nn(S,Ee,xe.themeOverride),be=Fe.baseFontFull;be!==V&&(V=be,e.font=be),ae();let tt;return Rr(Je,Ze,o,c,f,k,M,ke,(Ke,Ue,j,Te,Oe)=>{var bt,Dt,sn;if(Ue<0||(de[0]=xe.sourceIndex,de[1]=Ue,v!==void 0&&!v.has(de)))return;if(C.length>0){let Ye=!1;for(let ft=0;ft_e.span!==void 0&&Ye>=_e.span[0]&&Ye<=_e.span[1]);Ot&&!h&&y?Wt=0:Ot&&y&&(Wt=Math.max(Wt,1)),Sn&&Wt++,Ot||(Me&&Wt++,Se&&!Oe&&Wt++);const Mn=_e.kind===J.Protected?ut.bgCellMedium:ut.bgCell;let ct;if((Te||Mn!==S.bgCell)&&(ct=Jt(Mn,ct)),Wt>0||St){St&&(ct=Jt(ut.bgHeader,ct));for(let Ye=0;Yefe&&!Mt){const Ye=ut.baseFontFull;Ye!==V&&(e.font=Ye,V=Ye),tt=Ll(e,_e,xe.sourceIndex,Ue,Ge,Ft,$e,Ke,Ve,j,Wt>0,ut,ct??ut.bgCell,T,X,(Tt==null?void 0:Tt.hoverAmount)??0,W,D,re,B,tt,E,Z,te,le)}return Ne&&e.restore(),_e.style==="faded"&&(e.globalAlpha=1),De--,yt&&(e.restore(),(sn=tt==null?void 0:tt.deprep)==null||sn.call(tt,se),tt=void 0,ae(),V=be,e.font=be),De<=0}),e.restore(),De<=0}),U}const Bo=[0,0],Oo={x:0,y:0,width:0,height:0},jr=[void 0,()=>{}];let ai=!1;function Ua(){ai=!0}function Ll(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M,C,v,A,P,O,T,X){var Z,te;let R,W;k!==void 0&&k[0][0]===n&&k[0][1]===o&&(R=k[1][0],W=k[1][1]);let B;Bo[0]=n,Bo[1]=o,Oo.x=a,Oo.y=s,Oo.width=c,Oo.height=f,jr[0]=O.getValue(Bo),jr[1]=le=>O.setValue(Bo,le),ai=!1;const D={ctx:e,theme:w,col:n,row:o,cell:t,rect:Oo,highlighted:u,cellFillColor:m,hoverAmount:y,frameTime:C,hoverX:R,drawState:jr,hoverY:W,imageLoader:g,spriteManager:h,hyperWrapping:M,overrideCursor:R!==void 0?X:void 0,requestAnimationFrame:Ua},S=ea(D,t.lastUpdated,C,A,r,i),E=T(t);if(E!==void 0){(A==null?void 0:A.renderer)!==E&&((Z=A==null?void 0:A.deprep)==null||Z.call(A,D),A=void 0);const le=(te=E.drawPrep)==null?void 0:te.call(E,D,A);v!==void 0&&!vo(D.cell)?v(D,()=>E.draw(D,t)):E.draw(D,t),B=le===void 0?void 0:{deprep:le==null?void 0:le.deprep,fillStyle:le==null?void 0:le.fillStyle,font:le==null?void 0:le.font,renderer:E}}return(S||ai)&&(P==null||P(Bo)),B}function mi(e,t,n,o,r,i,a,s,c=-20,f=-20,u=32,w="center",m="square"){const g=Math.floor(r+a/2),h=m==="circle"?1e4:t.roundingRadius??4;let y=hl(u,a,t.cellVerticalPadding),k=y/2;const M=fl(w,o,i,t.cellHorizontalPadding,y),C=ul(M,g,y),v=gl(o+c,r+f,C);switch(n){case!0:{e.beginPath(),xn(e,M-y/2,g-y/2,y,y,h),m==="circle"&&(k*=.8,y*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(M-k+y/4.23,g-k+y/1.97),e.lineTo(M-k+y/2.42,g-k+y/1.44),e.lineTo(M-k+y/1.29,g-k+y/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case pr:case!1:{e.beginPath(),xn(e,M-y/2+.5,g-y/2+.5,y-1,y-1,h),e.lineWidth=1,e.strokeStyle=v?t.textDark:t.textMedium,e.stroke();break}case ci:{e.beginPath(),xn(e,M-y/2,g-y/2,y,y,h),e.fillStyle=v?t.textMedium:t.textLight,e.fill(),m==="circle"&&(k*=.8,y*=.8),e.beginPath(),e.moveTo(M-y/3,g),e.lineTo(M+y/3,g),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Ko()}}function _a(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M,C){const v=a+s;if(v<=0)return;e.fillStyle=w.bgHeader,e.fillRect(0,0,r,v);const[A,P]=(o==null?void 0:o[0])??[],O=w.headerFontFull;e.font=O,Yn(t,0,i,0,v,(T,X,R,W)=>{var se;if(k!==void 0&&!k.has([T.sourceIndex,-1]))return;const B=Math.max(0,W-X);e.save(),e.beginPath(),e.rect(X+B,s,T.width-B,a),e.clip();const D=y(T.group??"").overrideTheme,S=T.themeOverride===void 0&&D===void 0?w:Nn(w,D,T.themeOverride);S.bgHeader!==w.bgHeader&&(e.fillStyle=S.bgHeader,e.fill()),S!==w&&(e.font=S.baseFontFull);const E=u.columns.hasIndex(T.sourceIndex),Z=c!==void 0||f,te=!Z&&P===-1&&A===T.sourceIndex,le=Z?0:((se=g.find(de=>de.item[0]===T.sourceIndex&&de.item[1]===-1))==null?void 0:se.hoverAmount)??0,fe=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===T.sourceIndex,De=E?S.accentColor:fe?S.bgHeaderHasFocus:S.bgHeader,re=n?s:0,V=T.sourceIndex===0?0:1;E?(e.fillStyle=De,e.fillRect(X+V,re,T.width-V,a)):(fe||le>0)&&(e.beginPath(),e.rect(X+V,re,T.width-V,a),fe&&(e.fillStyle=S.bgHeaderHasFocus,e.fill()),le>0&&(e.globalAlpha=le,e.fillStyle=S.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Pl(e,X,re,T.width,a,T,E,S,te,fe,le,m,M,C),e.restore()}),n&&Va(e,t,r,i,s,o,w,m,g,h,y,k)}function Va(e,t,n,o,r,i,a,s,c,f,u,w){const[g,h]=(i==null?void 0:i[0])??[];let y=0;Fl(t,n,o,r,(k,M,C,v,A,P)=>{if(w!==void 0&&!w.hasItemInRectangle({x:k[0],y:-2,width:k[1]-k[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(C,v,A,P),e.clip();const O=u(M),T=(O==null?void 0:O.overrideTheme)===void 0?a:Nn(a,O.overrideTheme),X=h===-2&&g!==void 0&&g>=k[0]&&g<=k[1],R=X?T.bgHeaderHovered:T.bgHeader;if(R!==a.bgHeader&&(e.fillStyle=R,e.fill()),e.fillStyle=T.textGroupHeader??T.textHeader,O!==void 0){let W=C;if(O.icon!==void 0&&(s.drawSprite(O.icon,"normal",e,W+8,(r-20)/2,20,T),W+=26),e.fillText(O.name,W+8,r/2+Xn(e,a.headerFontFull)),O.actions!==void 0&&X){const B=zl({x:C,y:v,width:A,height:P},O.actions);e.beginPath();const D=B[0].x-10,S=C+A-D;e.rect(D,0,S,r);const E=e.createLinearGradient(D,0,D+S,0),Z=Jn(R,0);E.addColorStop(0,Z),E.addColorStop(10/S,R),E.addColorStop(1,R),e.fillStyle=E,e.fill(),e.globalAlpha=.6;const[te,le]=(i==null?void 0:i[1])??[-1,-1];for(let fe=0;fe35){const A=m?35:o-35,P=m?35*.7:o-35*.7,O=A/o,T=P/o,X=e.createLinearGradient(t,0,t+o,0),R=Jn(y,0);X.addColorStop(m?1:0,y),X.addColorStop(O,y),X.addColorStop(T,R),X.addColorStop(m?0:1,R),e.fillStyle=X}else e.fillStyle=y;if(m&&(e.textAlign="right"),e.fillText(i.title,C,n+r/2+Xn(e,s.headerFontFull)),m&&(e.textAlign="left"),k&&i.hasMenu===!0)if(i.menuIcon===void 0||i.menuIcon===vr.Triangle){e.beginPath();const v=g.x+g.width/2-5.5,A=g.y+g.height/2-3;ra(e,[{x:v,y:A},{x:v+11,y:A},{x:v+5.5,y:A+6}],1),e.fillStyle=y,e.fill()}else if(i.menuIcon===vr.Dots){e.beginPath();const v=g.x+g.width/2,A=g.y+g.height/2;oa(e,v,A),e.fillStyle=y,e.fill()}else{const v=g.x+(g.width-s.headerIconSize)/2,A=g.y+(g.height-s.headerIconSize)/2;u.drawSprite(i.menuIcon,"normal",e,v,A,s.headerIconSize,s)}}function Pl(e,t,n,o,r,i,a,s,c,f,u,w,m,g){const h=ui(i.title)==="rtl",y=Al(t,n,o,r,h);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:r},column:i,columnIndex:i.sourceIndex,isSelected:a,hoverAmount:u,isHovered:c,hasSelectedCell:f,spriteManager:w,menuBounds:y},()=>_i(e,t,n,o,r,i,a,s,c,u,w,g,h,y)):_i(e,t,n,o,r,i,a,s,c,u,w,g,h,y)}function Ga(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M,C){if(M!==void 0||t[t.length-1]!==n[t.length-1])return;const v=Il(k);Yn(t,c,a,s,i,(A,P,O,T,X)=>{if(A!==t[t.length-1])return;P+=A.width;const R=Math.max(P,T);R>o||(e.save(),e.beginPath(),e.rect(R,i+1,1e4,r-i-1),e.clip(),Rr(X,O,r,f,u,h,y,v,(W,B,D,S)=>{if(!S&&k.length>0&&!k.some(fe=>Cr(P,W,1e4,D,fe.x,fe.y,fe.width,fe.height)))return;const E=m.hasIndex(B),Z=g.hasIndex(B);e.beginPath();const te=w==null?void 0:w(B),le=te===void 0?C:Nn(C,te);le.bgCell!==C.bgCell&&(e.fillStyle=le.bgCell,e.fillRect(P,W,1e4,D)),Z&&(e.fillStyle=le.bgHeader,e.fillRect(P,W,1e4,D)),E&&(e.fillStyle=le.accentLight,e.fillRect(P,W,1e4,D))}),e.restore())})}function qa(e,t,n,o,r,i,a,s,c){let f=!1;for(const h of t)if(!h.sticky){f=a(h.sourceIndex);break}const u=c.horizontalBorderColor??c.borderColor,w=c.borderColor,m=f?So(t):0;let g;if(m!==0&&(g=Ni(w,c.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=g,e.stroke()),r>0){const h=w===u&&g!==void 0?g:Ni(u,c.bgCell),y=Qn(i,r,s);e.beginPath(),e.moveTo(0,o-y+.5),e.lineTo(n,o-y+.5),e.strokeStyle=h,e.stroke()}}const Bl=(e,t,n)=>{let o=0,r=t,i=0,a=n;if(e!==void 0&&e.length>0){o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=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),a=Math.max(a,s.y+s.height+1)}return{minX:o,maxX:r,minY:i,maxY:a}};function ja(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h){var D;const y=h.bgCell,{minX:k,maxX:M,minY:C,maxY:v}=Bl(s,i,a),A=[],P=a-Qn(g,m,f);let O=c,T=n,X=0;for(;O+r=C&&S<=v-1){const Z=u==null?void 0:u(T),te=Z==null?void 0:Z.bgCell;te!==void 0&&te!==y&&T>=g-m&&A.push({x:k,y:S,w:M-k,h:E,color:te})}O+=E,T0)for(let S=0;S=k&&Z<=M&&w(S+1)&&A.push({x:Z,y:X,w:E.width,h:W,color:te}),R+=E.width}if(A.length===0)return;let B;e.beginPath();for(let S=A.length-1;S>=0;S--){const E=A[S];B===void 0?B=E.color:E.color!==B&&(e.fillStyle=B,e.fill(),e.beginPath(),B=E.color),e.rect(E.x,E.y,E.w,E.h)}B!==void 0&&(e.fillStyle=B,e.fill()),e.beginPath()}function Vi(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M=!1){if(c!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,a);for(const D of c)e.rect(D.x+1,D.y+1,D.width-1,D.height-1);e.clip("evenodd")}const C=k.horizontalBorderColor??k.borderColor,v=k.borderColor,{minX:A,maxX:P,minY:O,maxY:T}=Bl(s,i,a),X=[];e.beginPath();let R=.5;for(let D=0;D=A&&E<=P&&g(D+1)&&X.push({x1:E,y1:Math.max(f,O),x2:E,y2:Math.min(a,T),color:v})}let W=a+.5;for(let D=y-h;D=O&&Z<=T-1){const te=m==null?void 0:m(S);X.push({x1:A,y1:Z,x2:P,y2:Z,color:(te==null?void 0:te.horizontalBorderColor)??(te==null?void 0:te.borderColor)??C})}D+=w(S),S++}}const B=Cs(X,D=>D.color);for(const D of Object.keys(B)){e.strokeStyle=D;for(const S of B[D])e.moveTo(S.x1,S.y1),e.lineTo(S.x2,S.y2);e.stroke(),e.beginPath()}c!==void 0&&e.restore()}function Za(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k,M,C){const v=[];e.imageSmoothingEnabled=!1;const A=Math.min(r.cellYOffset,a),P=Math.max(r.cellYOffset,a);let O=0;if(typeof M=="number")O+=(P-A)*M;else for(let E=A;Er.cellYOffset&&(O=-O),O+=c-r.translateY;const T=Math.min(r.cellXOffset,i),X=Math.max(r.cellXOffset,i);let R=0;for(let E=T;Er.cellXOffset&&(R=-R),R+=s-r.translateX;let W=So(k);if(W>0&&W++,R!==0&&O!==0)return{regions:[]};const B=f>0?Qn(m,f,M):0,D=u-W-Math.abs(R),S=w-g-B-Math.abs(O)-1;if(D>150&&S>150){const E={sx:0,sy:0,sw:u*h,sh:w*h,dx:0,dy:0,dw:u*h,dh:w*h};if(O>0?(E.sy=(g+1)*h,E.sh=S*h,E.dy=(O+g+1)*h,E.dh=S*h,v.push({x:0,y:g,width:u,height:O+1})):O<0&&(E.sy=(-O+g+1)*h,E.sh=S*h,E.dy=(g+1)*h,E.dh=S*h,v.push({x:0,y:w+O-B,width:u,height:-O+B})),R>0?(E.sx=W*h,E.sw=D*h,E.dx=(R+W)*h,E.dw=D*h,v.push({x:W-1,y:0,width:R+2,height:w})):R<0&&(E.sx=(W-R)*h,E.sw=D*h,E.dx=W*h,E.dw=D*h,v.push({x:u+R,y:0,width:-R,height:w})),e.setTransform(1,0,0,1,0,0),C){if(W>0&&R!==0&&O===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const Z=W*h,te=w*h;e.drawImage(t,0,0,Z,te,0,0,Z,te)}if(B>0&&R===0&&O!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const Z=(w-B)*h,te=u*h,le=B*h;e.drawImage(t,0,Z,te,le,0,Z,te,le)}}e.drawImage(t,E.sx,E.sy,E.sw,E.sh,E.dx,E.dy,E.dw,E.dh),e.scale(h,h)}return e.imageSmoothingEnabled=!0,{regions:v}}function Ja(e,t,n,o,r,i,a,s,c,f){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||r!==e.translateY||Yn(c,n,o,r,s,(w,m,g,h)=>{if(w.sourceIndex===f){const y=Math.max(m,h)+1;return u.push({x:y,y:0,width:i-y,height:a}),!0}}),u}function Qa(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;oT.style!=="no-outline");if(k===void 0||k.length===0)return;const M=So(s),C=Qn(g,m,w),v=[c,0,s.length,g-m],A=[M,0,t,n-C],P=k.map(T=>{const X=T.range,R=T.style??"dashed";return Ya(X,v,t,n,A).map(W=>{const B=W.rect,D=li(B.x,B.y,t,n,u,f+u,o,r,i,a,g,c,m,s,w),S=B.width===1&&B.height===1?D:li(B.x+B.width-1,B.y+B.height-1,t,n,u,f+u,o,r,i,a,g,c,m,s,w);return B.x+B.width>=s.length&&(S.width-=1),B.y+B.height>=g&&(S.height-=1),{color:T.color,style:R,clip:W.clip,rect:Xa({x:D.x,y:D.y,width:S.x+S.width-D.x,height:S.y+S.height-D.y},t,n,8)}})}),O=()=>{e.lineWidth=1;let T=!1;for(const X of P)for(const R of X)if((R==null?void 0:R.rect)!==void 0&&Cr(0,0,t,n,R.rect.x,R.rect.y,R.rect.width,R.rect.height)){const W=T,B=!Na(R.clip,R.rect);B&&(e.save(),e.rect(R.clip.x,R.clip.y,R.clip.width,R.clip.height),e.clip()),R.style==="dashed"&&!T?(e.setLineDash([5,3]),T=!0):(R.style==="solid"||R.style==="solid-outline")&&T&&(e.setLineDash([]),T=!1),e.strokeStyle=R.style==="solid-outline"?Jt(Jt(R.color,y.borderColor),y.bgCell):Jn(R.color,1),e.strokeRect(R.rect.x+.5,R.rect.y+.5,R.rect.width-1,R.rect.height-1),B&&(e.restore(),T=W)}T&&e.setLineDash([])};return O(),O}function qi(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 Zr(e,t,n,o,r,i,a,s,c,f,u,w,m,g,h,y,k){if(u.current===void 0)return;const M=u.current.range,C=u.current.cell,v=[M.x+M.width-1,M.y+M.height-1];if(C[1]>=k&&v[1]>=k||!a.some(Z=>Z.sourceIndex===C[0]||Z.sourceIndex===v[0]))return;const[P,O]=u.current.cell,T=m(u.current.cell),X=T.span??[P,P],R=O>=k-g,W=g>0&&!R?Qn(k,g,w)-1:0,B=v[1];let D,S;if(Yn(a,o,r,i,f,(Z,te,le,fe,De)=>{if(fe-=1,Z.sticky&&P>Z.sourceIndex)return;const re=Z.sourceIndexX[1],se=Z.sourceIndex===v[0];if(!(!se&&(re||V)))return Rr(De,le,n,k,w,g,h,void 0,(de,He,U)=>{if(He!==O&&He!==B)return;let pe=te,ke=Z.width;const xe=Z.sourceIndex===s.length-1,qe=He===k-1;if(T.span!==void 0){const Je=Tl(T.span,te,de,Z.width,U,Z,s),Re=Z.sticky?Je[0]:Je[1];Re!==void 0&&(pe=Re.x,ke=Re.width)}const Ze=He===B&&se&&y,rt=He===O&&!re&&!V&&D===void 0;return Ze&&(S=()=>{var Je;fe>pe&&!Z.sticky&&!rt&&(e.beginPath(),e.rect(fe,0,t-fe,n),e.clip()),e.beginPath(),e.rect(pe+ke-4,de+U-4,4,4),e.fillStyle=((Je=Z.themeOverride)==null?void 0:Je.accentColor)??c.accentColor,e.fill()}),rt&&(D=()=>{var Je;fe>pe&&!Z.sticky&&(e.beginPath(),e.rect(fe,0,t-fe,n),e.clip()),e.beginPath(),e.rect(pe+.5,de+.5,ke-(xe?1:0),U-(qe?1:0)),e.strokeStyle=((Je=Z.themeOverride)==null?void 0:Je.accentColor)??c.accentColor,e.lineWidth=1,e.stroke()}),D!==void 0&&(y?S!==void 0:!0)}),D!==void 0&&(y?S!==void 0:!0)}),D===void 0&&S===void 0)return;const E=()=>{e.save(),e.beginPath(),e.rect(0,f,t,n-f-W),e.clip(),D==null||D(),S==null||S(),e.restore()};return E(),E}function ec(e,t,n,o,r,i,a,s,c){c===void 0||c.size===0||(e.beginPath(),Fl(t,n,i,o,(f,u,w,m,g,h)=>{c.hasItemInRectangle({x:f[0],y:-2,width:f[1]-f[0]+1,height:1})&&e.rect(w,m,g,h)}),Yn(t,s,i,a,r,(f,u,w,m)=>{const g=Math.max(0,m-u),h=u+g+1,y=f.width-g-1;c.has([f.sourceIndex,-1])&&e.rect(h,o,y,r-o)}),e.clip())}function tc(e,t,n,o,r,i,a,s,c,f){let u=0;return Yn(e,i,o,r,n,(w,m,g,h,y)=>(Rr(y,g,t,a,s,c,f,void 0,(k,M,C,v)=>{v||(u=Math.max(M,u))}),!0)),u}function ji(e,t){var Ne;const{canvasCtx:n,headerCanvasCtx:o,width:r,height:i,cellXOffset:a,cellYOffset:s,translateX:c,translateY:f,mappedColumns:u,enableGroups:w,freezeColumns:m,dragAndDropState:g,theme:h,drawFocus:y,headerHeight:k,groupHeaderHeight:M,disabledRows:C,rowHeight:v,verticalBorder:A,overrideCursor:P,isResizing:O,selection:T,fillHandle:X,freezeTrailingRows:R,rows:W,getCellContent:B,getGroupDetails:D,getRowThemeOverride:S,isFocused:E,drawHeaderCallback:Z,prelightCells:te,drawCellCallback:le,highlightRegions:fe,resizeCol:De,imageLoader:re,lastBlitData:V,hoverValues:se,hyperWrapping:de,hoverInfo:He,spriteManager:U,maxScaleFactor:pe,hasAppendRow:ke,touchMode:xe,enqueue:qe,renderStateProvider:Ze,getCellRenderer:rt,renderStrategy:Je,bufferACtx:Re,bufferBCtx:Be,damage:Le,minimumCellWidth:wt}=e;if(r===0||i===0)return;const ue=Je==="double-buffer",ae=Math.min(pe,Math.ceil(window.devicePixelRatio??1)),Se=Je!=="direct"&&Qa(e,t),Ee=n.canvas;(Ee.width!==r*ae||Ee.height!==i*ae)&&(Ee.width=r*ae,Ee.height=i*ae,Ee.style.width=r+"px",Ee.style.height=i+"px");const Fe=o.canvas,be=w?M+k:k,tt=be+1;(Fe.width!==r*ae||Fe.height!==tt*ae)&&(Fe.width=r*ae,Fe.height=tt*ae,Fe.style.width=r+"px",Fe.style.height=tt+"px");const Ke=Re.canvas,Ue=Be.canvas;ue&&(Ke.width!==r*ae||Ke.height!==i*ae)&&(Ke.width=r*ae,Ke.height=i*ae,V.current!==void 0&&(V.current.aBufferScroll=void 0)),ue&&(Ue.width!==r*ae||Ue.height!==i*ae)&&(Ue.width=r*ae,Ue.height=i*ae,V.current!==void 0&&(V.current.bBufferScroll=void 0));const j=V.current;if(Se===!0&&a===(j==null?void 0:j.cellXOffset)&&s===(j==null?void 0:j.cellYOffset)&&c===(j==null?void 0:j.translateX)&&f===(j==null?void 0:j.translateY))return;let Te=null;ue&&(Te=n);const Oe=o;let Me;ue?Le!==void 0?Me=(j==null?void 0:j.lastBuffer)==="b"?Be:Re:Me=(j==null?void 0:j.lastBuffer)==="b"?Re:Be:Me=n;const St=Me.canvas,_e=ue?St===Ke?Ue:Ke:Ee,$e=typeof v=="number"?()=>v:v;Oe.save(),Me.save(),Oe.beginPath(),Me.beginPath(),Oe.textBaseline="middle",Me.textBaseline="middle",ae!==1&&(Oe.scale(ae,ae),Me.scale(ae,ae));const Ve=ii(u,a,r,g,c);let yt=[];const Mt=y&&((Ne=T.current)==null?void 0:Ne.cell[1])===s&&f===0;let en=!1;if(fe!==void 0){for(const Ge of fe)if(Ge.style!=="no-outline"&&Ge.range.y===s&&f===0){en=!0;break}}const Kt=()=>{_a(Oe,Ve,w,He,r,c,k,M,g,O,T,h,U,se,A,D,Le,Z,xe),Vi(Oe,Ve,s,c,f,r,i,void 0,void 0,M,be,$e,S,A,R,W,h,!0),Oe.beginPath(),Oe.moveTo(0,tt-.5),Oe.lineTo(r,tt-.5),Oe.strokeStyle=Jt(h.headerBottomBorderColor??h.horizontalBorderColor??h.borderColor,h.bgHeader),Oe.stroke(),en&&Gi(Oe,r,i,a,s,c,f,u,m,k,M,v,R,W,fe,h),Mt&&Zr(Oe,r,i,s,c,f,Ve,u,h,be,T,$e,B,R,ke,X,W)};if(Le!==void 0){const Ge=Ve[Ve.length-1].sourceIndex+1,Ft=Le.hasItemInRegion([{x:a,y:-2,width:Ge,height:2},{x:a,y:s,width:Ge,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:a,y:W-R,width:Ge,height:R,when:R>0}]),Tt=bt=>{Ui(bt,Ve,u,i,be,c,f,s,W,$e,B,D,S,C,E,y,R,ke,yt,Le,T,te,fe,re,U,se,He,le,de,h,qe,Ze,rt,P,wt);const Dt=T.current;X&&y&&Dt!==void 0&&Le.has(yl(Dt.range))&&Zr(bt,r,i,s,c,f,Ve,u,h,be,T,$e,B,R,ke,X,W)};Ft&&(Tt(Me),Te!==null&&(Te.save(),Te.scale(ae,ae),Te.textBaseline="middle",Tt(Te),Te.restore()),Le.hasHeader()&&(ec(Oe,Ve,r,M,be,c,f,s,Le),Kt())),Me.restore(),Oe.restore();return}if((Se!==!0||a!==(j==null?void 0:j.cellXOffset)||c!==(j==null?void 0:j.translateX)||Mt!==(j==null?void 0:j.mustDrawFocusOnHeader)||en!==(j==null?void 0:j.mustDrawHighlightRingsOnHeader))&&Kt(),Se===!0){Zt(_e!==void 0&&j!==void 0);const{regions:Ge}=Za(Me,_e,_e===Ke?j.aBufferScroll:j.bBufferScroll,_e===Ke?j.bBufferScroll:j.aBufferScroll,j,a,s,c,f,R,r,i,W,be,ae,u,Ve,v,ue);yt=Ge}else Se!==!1&&(Zt(j!==void 0),yt=Ja(j,a,s,c,f,r,i,be,Ve,Se));qa(Me,Ve,r,i,R,W,A,$e,h);const ut=Gi(Me,r,i,a,s,c,f,u,m,k,M,v,R,W,fe,h),Ot=y?Zr(Me,r,i,s,c,f,Ve,u,h,be,T,$e,B,R,ke,X,W):void 0;if(Me.fillStyle=h.bgCell,yt.length>0){Me.beginPath();for(const Ge of yt)Me.rect(Ge.x,Ge.y,Ge.width,Ge.height);Me.clip(),Me.fill(),Me.beginPath()}else Me.fillRect(0,0,r,i);const Wt=Ui(Me,Ve,u,i,be,c,f,s,W,$e,B,D,S,C,E,y,R,ke,yt,Le,T,te,fe,re,U,se,He,le,de,h,qe,Ze,rt,P,wt);Ga(Me,Ve,u,r,i,be,c,f,s,W,$e,S,T.rows,C,R,ke,yt,Le,h),ja(Me,Ve,s,c,f,r,i,yt,be,$e,S,A,R,W,h),Vi(Me,Ve,s,c,f,r,i,yt,Wt,M,be,$e,S,A,R,W,h),ut==null||ut(),Ot==null||Ot(),O&&Yn(Ve,0,c,0,be,(Ge,Ft)=>Ge.sourceIndex===De?(qi(Oe,Ft+Ge.width,0,be+1,Jt(h.resizeIndicatorColor??h.accentLight,h.bgHeader)),qi(Me,Ft+Ge.width,be,i,Jt(h.resizeIndicatorColor??h.accentLight,h.bgCell)),!0):!1),Te!==null&&(Te.fillStyle=h.bgCell,Te.fillRect(0,0,r,i),Te.drawImage(Me.canvas,0,0));const Sn=tc(Ve,i,be,c,f,s,W,$e,R,ke);re==null||re.setWindow({x:a,y:s,width:Ve.length,height:Sn-s},m,Array.from({length:R},(Ge,Ft)=>W-1-Ft));const Mn=j!==void 0&&(a!==j.cellXOffset||c!==j.translateX),ct=j!==void 0&&(s!==j.cellYOffset||f!==j.translateY);V.current={cellXOffset:a,cellYOffset:s,translateX:c,translateY:f,mustDrawFocusOnHeader:Mt,mustDrawHighlightRingsOnHeader:en,lastBuffer:ue?St===Ke?"a":"b":void 0,aBufferScroll:St===Ke?[Mn,ct]:j==null?void 0:j.aBufferScroll,bBufferScroll:St===Ue?[Mn,ct]:j==null?void 0:j.bBufferScroll},Me.restore(),Oe.restore()}const nc=80;function oc(e){const t=e-1;return t*t*t+1}class rc{constructor(t){We(this,"callback");We(this,"currentHoveredItem");We(this,"leavingItems",[]);We(this,"lastAnimationTime");We(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>No(o.item,t.item))||this.leavingItems.push(t)});We(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>No(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});We(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});We(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});We(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:oc(t.hoverAmount)})));We(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/nc;for(const i of this.leavingItems)i.hoverAmount=mn(i.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=mn(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});We(this,"setHovered",t=>{var n;if(!No((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){We(this,"fn");We(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function wi(e){return new ic(e)}const lc=wi(()=>window.navigator.userAgent.includes("Firefox")),kr=wi(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),xr=wi(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function sc(e){const t=l.useRef([]),n=l.useRef(0),o=l.useRef(e);o.current=e;const r=l.useCallback(()=>{const i=()=>window.requestAnimationFrame(a),a=()=>{const s=t.current.map(gi);t.current=[],o.current(new Yo(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:a)},[]);return l.useCallback(i=>{t.current.length===0&&r();const a=wn(i[0],i[1]);t.current.includes(a)||t.current.push(a)},[r])}const $n="header",jt="group-header",Sr="out-of-bounds";var Co;(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"})(Co||(Co={}));function Ol(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 Zi=6,ac=(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))??""},cc=(e,t)=>{const{width:n,height:o,accessibilityHeight:r,columns:i,cellXOffset:a,cellYOffset:s,headerHeight:c,fillHandle:f=!1,groupHeaderHeight:u,rowHeight:w,rows:m,getCellContent:g,getRowThemeOverride:h,onHeaderMenuClick:y,enableGroups:k,isFilling:M,onCanvasFocused:C,onCanvasBlur:v,isFocused:A,selection:P,freezeColumns:O,onContextMenu:T,freezeTrailingRows:X,fixedShadowX:R=!0,fixedShadowY:W=!0,drawFocusRing:B=!0,onMouseDown:D,onMouseUp:S,onMouseMoveRaw:E,onMouseMove:Z,onItemHovered:te,dragAndDropState:le,firstColAccessible:fe,onKeyDown:De,onKeyUp:re,highlightRegions:V,canvasRef:se,onDragStart:de,onDragEnd:He,eventTargetRef:U,isResizing:pe,resizeColumn:ke,isDragging:xe,isDraggable:qe=!1,allowResize:Ze,disabledRows:rt,hasAppendRow:Je,getGroupDetails:Re,theme:Be,prelightCells:Le,headerIcons:wt,verticalBorder:ue,drawCell:ae,drawHeader:Se,onCellFocused:Ee,onDragOverCell:Fe,onDrop:be,onDragLeave:tt,imageWindowLoader:Ke,smoothScrollX:Ue=!1,smoothScrollY:j=!1,experimental:Te,getCellRenderer:Oe}=e,Me=e.translateX??0,St=e.translateY??0,_e=Math.max(O,Math.min(i.length-1,a)),$e=l.useRef(null),Ve=Ke,yt=l.useRef(),[Mt,en]=l.useState(!1),Kt=l.useRef([]),ut=l.useRef(),[Ot,Wt]=l.useState(),[Sn,Mn]=l.useState(),ct=l.useRef(null),[Ne,Ge]=l.useState(),[Ft,Tt]=l.useState(!1),bt=l.useRef(Ft);bt.current=Ft;const Dt=l.useMemo(()=>new Wa(wt,()=>{yn.current=void 0,Kn.current()}),[wt]),sn=k?u+c:c,Ye=l.useRef(-1),ft=((Te==null?void 0:Te.enableFirefoxRescaling)??!1)&&lc.value,it=((Te==null?void 0:Te.enableSafariRescaling)??!1)&&kr.value;l.useLayoutEffect(()=>{window.devicePixelRatio===1||!ft&&!it||(Ye.current!==-1&&en(!0),window.clearTimeout(Ye.current),Ye.current=window.setTimeout(()=>{en(!1),Ye.current=-1},200))},[s,_e,Me,St,ft,it]);const lt=Ks(i,O),Ht=R?So(lt,le):0,dt=l.useCallback((x,K,Q)=>{const q=x.getBoundingClientRect();if(K>=lt.length||Q>=m)return;const G=q.width/n,ie=li(K,Q,n,o,u,sn,_e,s,Me,St,m,O,X,lt,w);return G!==1&&(ie.x*=G,ie.y*=G,ie.width*=G,ie.height*=G),ie.x+=q.x,ie.y+=q.y,ie},[n,o,u,sn,_e,s,Me,St,m,O,X,lt,w]),It=l.useCallback((x,K,Q,q)=>{const G=x.getBoundingClientRect(),ie=G.width/n,ve=(K-G.left)/ie,Ce=(Q-G.top)/ie,oe=5,et=ii(lt,_e,n,void 0,Me);let he=0,nt=0;q instanceof MouseEvent&&(he=q.button,nt=q.buttons);const Ie=Gs(ve,et,Me),Xe=qs(Ce,o,k,c,u,m,w,s,St,X),vt=(q==null?void 0:q.shiftKey)===!0,Ae=(q==null?void 0:q.ctrlKey)===!0,pt=(q==null?void 0:q.metaKey)===!0,nn=q!==void 0&&!(q instanceof MouseEvent)||(q==null?void 0:q.pointerType)==="touch",mt=[ve<0?-1:nn||Ce>o){const Qe=ve>n?1:ve<0?-1:0,Ct=Ce>o?1:Ce<0?-1:0;let Gt=Qe*2,bn=Ct*2;Qe===0&&(Gt=Ie===-1?Co.EndPadding:Co.Center),Ct===0&&(bn=Xe===void 0?Co.EndPadding:Co.Center);let un=!1;if(Ie===-1&&Xe===-1){const _n=dt(x,lt.length-1,-1);Zt(_n!==void 0),un=K<_n.x+_n.width+oe}const uo=ve>n&&veo&&Ce=0?(Ct=!0,Qe=dt(x,Gt,Xe),Zt(Qe!==void 0),Vt={kind:k&&Xe===-2?jt:$n,location:[Gt,Xe],bounds:Qe,group:lt[Gt].group??"",isEdge:Ct,shiftKey:vt,ctrlKey:Ae,metaKey:pt,isTouch:nn,localEventX:K-Qe.x,localEventY:Q-Qe.y,button:he,buttons:nt,scrollEdge:mt}):Vt={kind:k&&Xe===-2?jt:$n,group:lt[Ie].group??"",location:[Ie,Xe],bounds:Qe,isEdge:Ct,shiftKey:vt,ctrlKey:Ae,metaKey:pt,isTouch:nn,localEventX:K-Qe.x,localEventY:Q-Qe.y,button:he,buttons:nt,scrollEdge:mt}}else{const Qe=dt(x,Ie,Xe);Zt(Qe!==void 0);const Ct=Qe!==void 0&&Qe.x+Qe.width-K{}),Tn=l.useRef(Ot);Tn.current=Ot;const[Rn,En]=l.useMemo(()=>{const x=document.createElement("canvas"),K=document.createElement("canvas");return x.style.display="none",x.style.opacity="0",x.style.position="fixed",K.style.display="none",K.style.opacity="0",K.style.position="fixed",[x.getContext("2d",{alpha:!1}),K.getContext("2d",{alpha:!1})]},[]);l.useLayoutEffect(()=>{if(!(Rn===null||En===null))return document.documentElement.append(Rn.canvas),document.documentElement.append(En.canvas),()=>{Rn.canvas.remove(),En.canvas.remove()}},[Rn,En]);const eo=l.useMemo(()=>new ia,[]),qo=ft&&Mt?1:it&&Mt?2:5,jo=(Te==null?void 0:Te.disableMinimumCellWidth)===!0?1:10,yn=l.useRef(),to=l.useRef(null),no=l.useRef(null),oo=l.useCallback(()=>{var ve;const x=$e.current,K=ct.current;if(x===null||K===null||(to.current===null&&(to.current=x.getContext("2d",{alpha:!1}),x.width=0,x.height=0),no.current===null&&(no.current=K.getContext("2d",{alpha:!1}),K.width=0,K.height=0),to.current===null||no.current===null||Rn===null||En===null))return;let Q=!1;const q=Ce=>{Q=!0,Ge(Ce)},G=yn.current,ie={headerCanvasCtx:no.current,canvasCtx:to.current,bufferACtx:Rn,bufferBCtx:En,width:n,height:o,cellXOffset:_e,cellYOffset:s,translateX:Math.round(Me),translateY:Math.round(St),mappedColumns:lt,enableGroups:k,freezeColumns:O,dragAndDropState:le,theme:Be,headerHeight:c,groupHeaderHeight:u,disabledRows:rt??ot.empty(),rowHeight:w,verticalBorder:ue,isResizing:pe,resizeCol:ke,isFocused:A,selection:P,fillHandle:f,drawCellCallback:ae,hasAppendRow:Je,overrideCursor:q,maxScaleFactor:qo,freezeTrailingRows:X,rows:m,drawFocus:B,getCellContent:g,getGroupDetails:Re??(Ce=>({name:Ce})),getRowThemeOverride:h,drawHeaderCallback:Se,prelightCells:Le,highlightRegions:V,imageLoader:Ve,lastBlitData:ut,damage:yt.current,hoverValues:Kt.current,hoverInfo:Tn.current,spriteManager:Dt,scrolling:Mt,hyperWrapping:(Te==null?void 0:Te.hyperWrapping)??!1,touchMode:Ft,enqueue:Go.current,renderStateProvider:eo,renderStrategy:(Te==null?void 0:Te.renderStrategy)??(kr.value?"double-buffer":"single-buffer"),getCellRenderer:Oe,minimumCellWidth:jo};ie.damage===void 0?(yn.current=ie,ji(ie,G)):ji(ie,void 0),!Q&&(ie.damage===void 0||ie.damage.has((ve=Tn==null?void 0:Tn.current)==null?void 0:ve[0]))&&Ge(void 0)},[Rn,En,n,o,_e,s,Me,St,lt,k,O,le,Be,c,u,rt,w,ue,pe,Je,ke,A,P,f,X,m,B,qo,g,Re,h,ae,Se,Le,V,Ve,Dt,Mt,Te==null?void 0:Te.hyperWrapping,Te==null?void 0:Te.renderStrategy,Ft,eo,Oe,jo]),Kn=l.useRef(oo);l.useLayoutEffect(()=>{oo(),Kn.current=oo},[oo]),l.useLayoutEffect(()=>{(async()=>{var K;((K=document==null?void 0:document.fonts)==null?void 0:K.ready)!==void 0&&(await document.fonts.ready,yn.current=void 0,Kn.current())})()},[]);const Hn=l.useCallback(x=>{yt.current=x,Kn.current(),yt.current=void 0},[]),Zo=sc(Hn);Go.current=Zo;const Jo=l.useCallback(x=>{Hn(new Yo(x.map(K=>K.cell)))},[Hn]);Ve.setCallback(Hn);const[Dr,Ir]=l.useState(!1),[ro,Dn]=ht??[],Fr=ro!==void 0&&Dn===-1,Tr=ro!==void 0&&Dn===-2;let Qo=!1,io=!1,Rt=Ne;if(Rt===void 0&&ro!==void 0&&Dn!==void 0&&Dn>-1&&Dn({contain:"strict",display:"block",cursor:er}),[er]),Mo=l.useRef("default"),Ln=U==null?void 0:U.current;Ln!=null&&Mo.current!==lo.cursor&&(Ln.style.cursor=Mo.current=lo.cursor);const Ut=l.useCallback((x,K,Q,q)=>{if(Re===void 0)return;const G=Re(x);if(G.actions!==void 0){const ie=zl(K,G.actions);for(const[ve,Ce]of ie.entries())if(Er(Ce,Q+K.x,q+Ce.y))return G.actions[ve]}},[Re]),an=l.useCallback((x,K,Q,q)=>{const G=i[K];if(!xe&&!pe&&G.hasMenu===!0&&!(Sn??!1)){const ie=dt(x,K,-1);Zt(ie!==void 0);const ve=Al(ie.x,ie.y,ie.width,ie.height,ui(G.title)==="rtl");if(Q>ve.x&&Qve.y&&q{const K=$e.current,Q=U==null?void 0:U.current;if(K===null||x.target!==K&&x.target!==Q)return;Eo.current=!0;let q,G;if(x instanceof MouseEvent?(q=x.clientX,G=x.clientY):(q=x.touches[0].clientX,G=x.touches[0].clientY),x.target===Q&&Q!==null){const ve=Q.getBoundingClientRect();if(q>ve.right||G>ve.bottom)return}const ie=It(K,q,G,x);An.current=ie.location,ie.isTouch&&(Ro.current=Date.now()),bt.current!==ie.isTouch&&Tt(ie.isTouch),!(ie.kind===$n&&an(K,ie.location[0],q,G)!==void 0)&&(ie.kind===jt&&Ut(ie.group,ie.bounds,ie.localEventX,ie.localEventY)!==void 0||(D==null||D(ie),!ie.isTouch&&qe!==!0&&qe!==ie.kind&&ie.button<3&&ie.button!==1&&x.preventDefault()))},[U,qe,It,Ut,an,D]);Lt("touchstart",$t,window,!1),Lt("mousedown",$t,window,!1);const so=l.useRef(0),Do=l.useCallback(x=>{var nt,Ie;const K=so.current;so.current=Date.now();const Q=$e.current;if(Eo.current=!1,S===void 0||Q===null)return;const q=U==null?void 0:U.current,G=x.target!==Q&&x.target!==q;let ie,ve,Ce=!0;if(x instanceof MouseEvent){if(ie=x.clientX,ve=x.clientY,Ce=x.button<3,x.pointerType==="touch")return}else ie=x.changedTouches[0].clientX,ve=x.changedTouches[0].clientY;let oe=It(Q,ie,ve,x);oe.isTouch&&Ro.current!==0&&Date.now()-Ro.current>500&&(oe={...oe,isLongTouch:!0}),K!==0&&Date.now()-K<(oe.isTouch?1e3:500)&&(oe={...oe,isDoubleClick:!0}),bt.current!==oe.isTouch&&Tt(oe.isTouch),!G&&x.cancelable&&Ce&&x.preventDefault();const[et]=oe.location,he=an(Q,et,ie,ve);if(oe.kind===$n&&he!==void 0){(oe.button!==0||((nt=An.current)==null?void 0:nt[0])!==et||((Ie=An.current)==null?void 0:Ie[1])!==-1)&&S(oe,!0);return}else if(oe.kind===jt){const Xe=Ut(oe.group,oe.bounds,oe.localEventX,oe.localEventY);if(Xe!==void 0){oe.button===0&&Xe.onClick(oe);return}}S(oe,G)},[S,U,It,an,Ut]);Lt("mouseup",Do,window,!1),Lt("touchend",Do,window,!1);const tr=l.useCallback(x=>{var he,nt;const K=$e.current;if(K===null)return;const Q=U==null?void 0:U.current,q=x.target!==K&&x.target!==Q;let G,ie,ve=!0;x instanceof MouseEvent?(G=x.clientX,ie=x.clientY,ve=x.button<3):(G=x.changedTouches[0].clientX,ie=x.changedTouches[0].clientY);const Ce=It(K,G,ie,x);bt.current!==Ce.isTouch&&Tt(Ce.isTouch),!q&&x.cancelable&&ve&&x.preventDefault();const[oe]=Ce.location,et=an(K,oe,G,ie);if(Ce.kind===$n&&et!==void 0)Ce.button===0&&((he=An.current)==null?void 0:he[0])===oe&&((nt=An.current)==null?void 0:nt[1])===-1&&(y==null||y(oe,et));else if(Ce.kind===jt){const Ie=Ut(Ce.group,Ce.bounds,Ce.localEventX,Ce.localEventY);Ie!==void 0&&Ce.button===0&&Ie.onClick(Ce)}},[U,It,an,y,Ut]);Lt("click",tr,window,!1);const Hr=l.useCallback(x=>{const K=$e.current,Q=U==null?void 0:U.current;if(K===null||x.target!==K&&x.target!==Q||T===void 0)return;const q=It(K,x.clientX,x.clientY,x);T(q,()=>{x.cancelable&&x.preventDefault()})},[U,It,T]);Lt("contextmenu",Hr,(U==null?void 0:U.current)??null,!1);const nr=l.useCallback(x=>{yt.current=new Yo(x.map(K=>K.item)),Kt.current=x,Kn.current(),yt.current=void 0},[]),cn=l.useMemo(()=>new rc(nr),[nr]),In=l.useRef(cn);In.current=cn,l.useLayoutEffect(()=>{const x=In.current;if(ht===void 0||ht[1]<0){x.setHovered(ht);return}const K=g(ht,!0),Q=Oe(K),q=Q===void 0&&K.kind===J.Custom||(Q==null?void 0:Q.needsHover)!==void 0&&(typeof Q.needsHover=="boolean"?Q.needsHover:Q.needsHover(K));x.setHovered(q?ht:void 0)},[g,Oe,ht]);const _t=l.useRef(),H=l.useCallback(x=>{var Ce;const K=$e.current;if(K===null)return;const Q=U==null?void 0:U.current,q=x.target!==K&&x.target!==Q,G=It(K,x.clientX,x.clientY,x);if(G.kind!=="out-of-bounds"&&q&&!Eo.current&&!G.isTouch)return;const ie=(oe,et)=>{Wt(he=>he===oe||(he==null?void 0:he[0][0])===(oe==null?void 0:oe[0][0])&&(he==null?void 0:he[0][1])===(oe==null?void 0:oe[0][1])&&((he==null?void 0:he[1][0])===(oe==null?void 0:oe[1][0])&&(he==null?void 0:he[1][1])===(oe==null?void 0:oe[1][1])||!et)?he:oe)};if(!Ol(G,_t.current))Ge(void 0),te==null||te(G),ie(G.kind===Sr?void 0:[G.location,[G.localEventX,G.localEventY]],!0),_t.current=G;else if(G.kind==="cell"||G.kind===$n||G.kind===jt){let oe=!1,et=!0;if(G.kind==="cell"){const nt=g(G.location);et=((Ce=Oe(nt))==null?void 0:Ce.needsHoverPosition)??nt.kind===J.Custom,oe=et}else G.kind===jt&&(oe=!0);const he=[G.location,[G.localEventX,G.localEventY]];ie(he,et),Tn.current=he,oe&&Hn(new Yo([G.location]))}const ve=G.location[0]>=(fe?0:1);Mn(G.kind===$n&&G.isEdge&&ve&&Ze===!0),Ir(G.kind==="cell"&&G.isFillHandle),E==null||E(x),Z(G)},[U,It,fe,Ze,E,Z,te,g,Oe,Hn]);Lt("mousemove",H,window,!0);const gt=l.useCallback(x=>{const K=$e.current;if(K===null)return;let Q,q;P.current!==void 0&&(Q=dt(K,P.current.cell[0],P.current.cell[1]),q=P.current.cell),De==null||De({bounds:Q,stopPropagation:()=>x.stopPropagation(),preventDefault:()=>x.preventDefault(),cancel:()=>{},ctrlKey:x.ctrlKey,metaKey:x.metaKey,shiftKey:x.shiftKey,altKey:x.altKey,key:x.key,keyCode:x.keyCode,rawEvent:x,location:q})},[De,P,dt]),Un=l.useCallback(x=>{const K=$e.current;if(K===null)return;let Q,q;P.current!==void 0&&(Q=dt(K,P.current.cell[0],P.current.cell[1]),q=P.current.cell),re==null||re({bounds:Q,stopPropagation:()=>x.stopPropagation(),preventDefault:()=>x.preventDefault(),cancel:()=>{},ctrlKey:x.ctrlKey,metaKey:x.metaKey,shiftKey:x.shiftKey,altKey:x.altKey,key:x.key,keyCode:x.keyCode,rawEvent:x,location:q})},[re,P,dt]),Lr=l.useCallback(x=>{$e.current=x,se!==void 0&&(se.current=x)},[se]),or=l.useCallback(x=>{const K=$e.current;if(K===null||qe===!1||pe){x.preventDefault();return}let Q,q;const G=It(K,x.clientX,x.clientY);if(qe!==!0&&G.kind!==qe){x.preventDefault();return}const ie=(nt,Ie)=>{Q=nt,q=Ie};let ve,Ce,oe;const et=(nt,Ie,Xe)=>{ve=nt,Ce=Ie,oe=Xe};let he=!1;if(de==null||de({...G,setData:ie,setDragImage:et,preventDefault:()=>he=!0,defaultPrevented:()=>he}),!he&&Q!==void 0&&q!==void 0&&x.dataTransfer!==null)if(x.dataTransfer.setData(Q,q),x.dataTransfer.effectAllowed="copyLink",ve!==void 0&&Ce!==void 0&&oe!==void 0)x.dataTransfer.setDragImage(ve,Ce,oe);else{const[nt,Ie]=G.location;if(Ie!==void 0){const Xe=document.createElement("canvas"),vt=dt(K,nt,Ie);Zt(vt!==void 0);const Ae=Math.ceil(window.devicePixelRatio??1);Xe.width=vt.width*Ae,Xe.height=vt.height*Ae;const pt=Xe.getContext("2d");pt!==null&&(pt.scale(Ae,Ae),pt.textBaseline="middle",Ie===-1?(pt.font=Be.headerFontFull,pt.fillStyle=Be.bgHeader,pt.fillRect(0,0,Xe.width,Xe.height),Pl(pt,0,0,vt.width,vt.height,lt[nt],!1,Be,!1,!1,0,Dt,Se,!1)):(pt.font=Be.baseFontFull,pt.fillStyle=Be.bgCell,pt.fillRect(0,0,Xe.width,Xe.height),Ll(pt,g([nt,Ie]),0,Ie,!1,!1,0,0,vt.width,vt.height,!1,Be,Be.bgCell,Ve,Dt,1,void 0,!1,0,void 0,void 0,void 0,eo,Oe,()=>{}))),Xe.style.left="-100%",Xe.style.position="absolute",Xe.style.width=`${vt.width}px`,Xe.style.height=`${vt.height}px`,document.body.append(Xe),x.dataTransfer.setDragImage(Xe,vt.width/2,vt.height/2),window.setTimeout(()=>{Xe.remove()},0)}}else x.preventDefault()},[qe,pe,It,de,dt,Be,lt,Dt,Se,g,Ve,eo,Oe]);Lt("dragstart",or,(U==null?void 0:U.current)??null,!1,!1);const Io=l.useRef(),Ar=l.useCallback(x=>{const K=$e.current;if(be!==void 0&&x.preventDefault(),K===null||Fe===void 0)return;const Q=It(K,x.clientX,x.clientY),[q,G]=Q.location,ie=q-(fe?0:1),[ve,Ce]=Io.current??[];(ve!==ie||Ce!==G)&&(Io.current=[ie,G],Fe([ie,G],x.dataTransfer))},[fe,It,Fe,be]);Lt("dragover",Ar,(U==null?void 0:U.current)??null,!1,!1);const yi=l.useCallback(()=>{Io.current=void 0,He==null||He()},[He]);Lt("dragend",yi,(U==null?void 0:U.current)??null,!1,!1);const z=l.useCallback(x=>{const K=$e.current;if(K===null||be===void 0)return;x.preventDefault();const Q=It(K,x.clientX,x.clientY),[q,G]=Q.location,ie=q-(fe?0:1);be([ie,G],x.dataTransfer)},[fe,It,be]);Lt("drop",z,(U==null?void 0:U.current)??null,!1,!1);const At=l.useCallback(()=>{tt==null||tt()},[tt]);Lt("dragleave",At,(U==null?void 0:U.current)??null,!1,!1);const Et=l.useRef(P);Et.current=P;const ao=l.useRef(null),Fo=l.useCallback(x=>{var K;$e.current===null||!$e.current.contains(document.activeElement)||(x===null&&Et.current.current!==void 0?(K=se==null?void 0:se.current)==null||K.focus({preventScroll:!0}):x!==null&&x.focus({preventScroll:!0}),ao.current=x)},[se]);l.useImperativeHandle(t,()=>({focus:()=>{var K;const x=ao.current;x===null||!document.contains(x)?(K=se==null?void 0:se.current)==null||K.focus({preventScroll:!0}):x.focus({preventScroll:!0})},getBounds:(x,K)=>{if(!(se===void 0||se.current===null))return dt(se.current,x??0,K??-1)},damage:Jo}),[se,Jo,dt]);const zn=l.useRef(),Xt=Ts(()=>{var Ce,oe,et;if(n<50||(Te==null?void 0:Te.disableAccessibilityTree)===!0)return null;let x=ii(lt,_e,n,le,Me);const K=fe?0:-1;!fe&&((Ce=x[0])==null?void 0:Ce.sourceIndex)===0&&(x=x.slice(1));const[Q,q]=((oe=P.current)==null?void 0:oe.cell)??[],G=(et=P.current)==null?void 0:et.range,ie=x.map(he=>he.sourceIndex),ve=Zn(s,Math.min(m,s+r));return Q!==void 0&&q!==void 0&&!(ie.includes(Q)&&ve.includes(q))&&Fo(null),l.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":lt.length+K},l.createElement("thead",{role:"rowgroup"},l.createElement("tr",{role:"row","aria-rowindex":1},x.map(he=>l.createElement("th",{role:"columnheader","aria-selected":P.columns.hasIndex(he.sourceIndex),"aria-colindex":he.sourceIndex+1+K,tabIndex:-1,onFocus:nt=>{if(nt.target!==ao.current)return Ee==null?void 0:Ee([he.sourceIndex,-1])},key:he.sourceIndex},he.title)))),l.createElement("tbody",{role:"rowgroup"},ve.map(he=>l.createElement("tr",{role:"row","aria-selected":P.rows.hasIndex(he),key:he,"aria-rowindex":he+2},x.map(nt=>{const Ie=nt.sourceIndex,Xe=wn(Ie,he),vt=Q===Ie&&q===he,Ae=G!==void 0&&Ie>=G.x&&Ie=G.y&&he{const Vt=se==null?void 0:se.current;if(Vt!=null)return De==null?void 0:De({bounds:dt(Vt,Ie,he),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:nn})},onFocusCapture:Vt=>{var Qe,Ct;if(!(Vt.target===ao.current||((Qe=zn.current)==null?void 0:Qe[0])===Ie&&((Ct=zn.current)==null?void 0:Ct[1])===he))return zn.current=nn,Ee==null?void 0:Ee(nn)},ref:vt?Fo:void 0,tabIndex:-1},ac(mt,Oe))})))))},[n,lt,_e,le,Me,m,s,r,P,Fo,g,se,De,dt,Ee],200),dn=O===0||!R?0:_e>O?1:mn(-Me/100,0,1),zr=-s*32+St,co=W?mn(-zr/100,0,1):0,Pr=l.useMemo(()=>{if(!dn&&!co)return null;const x={position:"absolute",top:0,left:Ht,width:n-Ht,height:o,opacity:dn,pointerEvents:"none",transition:Ue?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},K={position:"absolute",top:sn,left:0,width:n,height:o,opacity:co,pointerEvents:"none",transition:j?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return l.createElement(l.Fragment,null,dn>0&&l.createElement("div",{id:"shadow-x",style:x}),co>0&&l.createElement("div",{id:"shadow-y",style:K}))},[dn,co,Ht,n,Ue,sn,o,j]),Br=l.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return l.createElement(l.Fragment,null,l.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:gt,onKeyUp:Un,onFocus:C,onBlur:v,ref:Lr,style:lo},Xt),l.createElement("canvas",{ref:ct,style:Br}),Pr)},dc=l.memo(l.forwardRef(cc));function Wo(e,t,n,o){return mn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(o))}const uc=e=>{const[t,n]=l.useState(),[o,r]=l.useState(),[i,a]=l.useState(),[s,c]=l.useState(),[f,u]=l.useState(!1),[w,m]=l.useState(),[g,h]=l.useState(),[y,k]=l.useState(),[M,C]=l.useState(!1),[v,A]=l.useState(),{onHeaderMenuClick:P,getCellContent:O,onColumnMoved:T,onColumnResize:X,onColumnResizeStart:R,onColumnResizeEnd:W,gridRef:B,maxColumnWidth:D,minColumnWidth:S,onRowMoved:E,lockColumns:Z,onColumnProposeMove:te,onMouseDown:le,onMouseUp:fe,onItemHovered:De,onDragStart:re,canvasRef:V}=e,se=(X??W??R)!==void 0,{columns:de,selection:He}=e,U=He.columns,pe=l.useCallback(ue=>{const[ae,Se]=ue.location;i!==void 0&&s!==ae&&ae>=Z?(u(!0),c(ae)):g!==void 0&&Se!==void 0?(C(!0),k(Math.max(0,Se))):o===void 0&&!f&&!M&&(De==null||De(ue))},[i,g,s,De,Z,o,f,M]),ke=T!==void 0,xe=l.useCallback(ue=>{var ae;if(ue.button===0){const[Se,Ee]=ue.location;if(ue.kind==="out-of-bounds"&&ue.isEdge&&se){const Fe=(ae=B==null?void 0:B.current)==null?void 0:ae.getBounds(de.length-1,-1);Fe!==void 0&&(n(Fe.x),r(de.length-1))}else if(ue.kind==="header"&&Se>=Z){const Fe=V==null?void 0:V.current;if(ue.isEdge&&se&&Fe){n(ue.bounds.x),r(Se);const tt=Fe.getBoundingClientRect().width/Fe.offsetWidth,Ke=ue.bounds.width/tt;R==null||R(de[Se],Ke,Se,Ke+(de[Se].growOffset??0))}else ue.kind==="header"&&ke&&(m(ue.bounds.x),a(Se))}else ue.kind==="cell"&&Z>0&&Se===0&&Ee!==void 0&&E!==void 0&&(A(ue.bounds.y),h(Ee))}le==null||le(ue)},[le,se,Z,E,B,de,ke,R,V]),qe=l.useCallback((ue,ae)=>{f||M||P==null||P(ue,ae)},[f,M,P]),Ze=l.useRef(-1),rt=l.useCallback(()=>{Ze.current=-1,h(void 0),k(void 0),A(void 0),C(!1),a(void 0),c(void 0),m(void 0),u(!1),r(void 0),n(void 0)},[]),Je=l.useCallback((ue,ae)=>{if(ue.button===0){if(o!==void 0){if((U==null?void 0:U.hasIndex(o))===!0)for(const Ee of U){if(Ee===o)continue;const Fe=de[Ee],be=Wo(Fe,Ze.current,S,D);X==null||X(Fe,be,Ee,be+(Fe.growOffset??0))}const Se=Wo(de[o],Ze.current,S,D);if(W==null||W(de[o],Se,o,Se+(de[o].growOffset??0)),U.hasIndex(o))for(const Ee of U){if(Ee===o)continue;const Fe=de[Ee],be=Wo(Fe,Ze.current,S,D);W==null||W(Fe,be,Ee,be+(Fe.growOffset??0))}}rt(),i!==void 0&&s!==void 0&&(T==null||T(i,s)),g!==void 0&&y!==void 0&&(E==null||E(g,y))}fe==null||fe(ue,ae)},[fe,o,i,s,g,y,U,W,de,S,D,X,T,E,rt]),Re=l.useMemo(()=>{if(!(i===void 0||s===void 0)&&i!==s&&(te==null?void 0:te(i,s))!==!1)return{src:i,dest:s}},[i,s,te]),Be=l.useCallback(ue=>{const ae=V==null?void 0:V.current;if(i!==void 0&&w!==void 0)Math.abs(ue.clientX-w)>20&&u(!0);else if(g!==void 0&&v!==void 0)Math.abs(ue.clientY-v)>20&&C(!0);else if(o!==void 0&&t!==void 0&&ae){const Ee=ae.getBoundingClientRect().width/ae.offsetWidth,Fe=(ue.clientX-t)/Ee,be=de[o],tt=Wo(be,Fe,S,D);if(X==null||X(be,tt,o,tt+(be.growOffset??0)),Ze.current=Fe,(U==null?void 0:U.first())===o)for(const Ke of U){if(Ke===o)continue;const Ue=de[Ke],j=Wo(Ue,Ze.current,S,D);X==null||X(Ue,j,Ke,j+(Ue.growOffset??0))}}},[i,w,g,v,o,t,de,S,D,X,U,V]),Le=l.useCallback((ue,ae)=>{if(g===void 0||y===void 0)return O(ue,ae);let[Se,Ee]=ue;return Ee===y?Ee=g:(Ee>y&&(Ee-=1),Ee>=g&&(Ee+=1)),O([Se,Ee],ae)},[g,y,O]),wt=l.useCallback(ue=>{re==null||re(ue),ue.defaultPrevented()||rt()},[rt,re]);return l.createElement(dc,{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,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Le,isResizing:o!==void 0,onHeaderMenuClick:qe,isDragging:f,onItemHovered:pe,onDragStart:wt,onMouseDown:xe,allowResize:se,onMouseUp:Je,dragAndDropState:Re,onMouseMoveRaw:Be,ref:B})},fc=uc;function hc(e){const t=l.useRef(null),[n,o]=l.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return l.useLayoutEffect(()=>{const r=a=>{for(const s of a){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 gc=(e,t,n)=>{const o=l.useRef(null),r=l.useRef(null),i=l.useRef(null),a=l.useRef(0),s=l.useRef(t);s.current=t;const c=n.current;l.useEffect(()=>{const f=()=>{var m,g;if(r.current===!1&&c!==null){const h=[c.scrollLeft,c.scrollTop];if(((m=i.current)==null?void 0:m[0])===h[0]&&((g=i.current)==null?void 0:g[1])===h[1])if(a.current>10){i.current=null,r.current=null;return}else a.current++;else a.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)},w=m=>{m.touches.length===0&&(r.current=!1,a.current=0,o.current=window.setTimeout(f,8.333333333333334))};if(e&&c!==null){const m=c;return m.addEventListener("touchstart",u),m.addEventListener("touchend",w),()=>{m.removeEventListener("touchstart",u),m.removeEventListener("touchend",w),o.current!==null&&window.clearTimeout(o.current)}}},[e,c])},mc=gc,wc=()=>e=>e.isSafari?"scroll":"auto",yc=Qt("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[wc()]}});function bc(e){const[t,n]=l.useState(!1),o=typeof window>"u"?null:window,r=l.useRef(0);return Lt("touchstart",l.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),o,!0,!1),Lt("touchend",l.useCallback(i=>{i.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),o,!0,!1),t}const pc=e=>{var de,He;const{children:t,clientHeight:n,scrollHeight:o,scrollWidth:r,update:i,draggable:a,className:s,preventDiagonalScrolling:c=!1,paddingBottom:f=0,paddingRight:u=0,rightElement:w,rightElementProps:m,kineticScrollPerfHack:g=!1,scrollRef:h,initialSize:y}=e,k=[],M=(m==null?void 0:m.sticky)??!1,C=(m==null?void 0:m.fill)??!1,v=l.useRef(0),A=l.useRef(0),P=l.useRef(null),O=typeof window>"u"?1:window.devicePixelRatio,T=l.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),X=l.useRef(null),R=bc(200),[W,B]=l.useState(!0),D=l.useRef(0);l.useLayoutEffect(()=>{if(!W||R||T.current.lockDirection===void 0)return;const U=P.current;if(U===null)return;const[pe,ke]=T.current.lockDirection;pe!==void 0?U.scrollLeft=pe:ke!==void 0&&(U.scrollTop=ke),T.current.lockDirection=void 0},[R,W]);const S=l.useCallback((U,pe)=>{var ae;const ke=P.current;if(ke===null)return;pe=pe??ke.scrollTop,U=U??ke.scrollLeft;const xe=T.current.scrollTop,qe=T.current.scrollLeft,Ze=U-qe,rt=pe-xe;R&&Ze!==0&&rt!==0&&(Math.abs(Ze)>3||Math.abs(rt)>3)&&c&&T.current.lockDirection===void 0&&(T.current.lockDirection=Math.abs(Ze)0&&(Math.abs(wt)>2e3||Le===0||Le===ue)&&o>ke.scrollHeight+5){const Se=Le/ue,Ee=(o-Be)*Se;v.current=Ee-Le}Je!==void 0&&(window.clearTimeout(D.current),B(!1),D.current=window.setTimeout(()=>B(!0),200)),i({x:U,y:Le+v.current,width:Re-u,height:Be-f,paddingRight:((ae=X.current)==null?void 0:ae.clientWidth)??0})},[f,u,o,i,c,R]);mc(g&&kr.value,S,P);const E=l.useRef(S);E.current=S;const Z=l.useRef(),te=l.useRef(!1);l.useLayoutEffect(()=>{te.current?S():te.current=!0},[S,f,u]);const le=l.useCallback(U=>{P.current=U,h!==void 0&&(h.current=U)},[h]);let fe=0,De=0;for(k.push(l.createElement("div",{key:fe++,style:{width:r,height:0}}));DeE.current(),0),Z.current={width:V,height:se}),(V??0)===0||(se??0)===0?l.createElement("div",{ref:re}):l.createElement("div",{ref:re},l.createElement(yc,{isSafari:kr.value},l.createElement("div",{className:"dvn-underlay"},t),l.createElement("div",{ref:le,style:Z.current,draggable:a,onDragStart:U=>{a||(U.stopPropagation(),U.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>S()},l.createElement("div",{className:"dvn-scroll-inner"+(w===void 0?" dvn-hidden":"")},l.createElement("div",{className:"dvn-stack"},k),w!==void 0&&l.createElement(l.Fragment,null,!C&&l.createElement("div",{className:"dvn-spacer"}),l.createElement("div",{ref:X,style:{height:se,maxHeight:n-Math.ceil(O%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:C?1:void 0,right:M?u??0:void 0,pointerEvents:"auto"}},w))))))},vc=e=>{const{columns:t,rows:n,rowHeight:o,headerHeight:r,groupHeaderHeight:i,enableGroups:a,freezeColumns:s,experimental:c,nonGrowWidth:f,clientSize:u,className:w,onVisibleRegionChanged:m,scrollRef:g,preventDiagonalScrolling:h,rightElement:y,rightElementProps:k,overscrollX:M,overscrollY:C,initialSize:v,smoothScrollX:A=!1,smoothScrollY:P=!1,isDraggable:O}=e,{paddingRight:T,paddingBottom:X}=c??{},[R,W]=u,B=l.useRef(),D=l.useRef(),S=l.useRef(),E=l.useRef(),Z=f+Math.max(0,M??0);let te=a?r+i:r;if(typeof o=="number")te+=n*o;else for(let re=0;re{var rt,Je;if(le.current===void 0)return;const re={...le.current};let V=0,se=re.x<0?-re.x:0,de=0,He=0;re.x=re.x<0?0:re.x;let U=0;for(let Re=0;Re=Be+Re.width)V+=Re.width,He++,de++;else if(re.x>Be)V+=Re.width,A?se+=Be-re.x:He++,de++;else if(re.x+re.width>Be)V+=Re.width,de++;else break}let pe=0,ke=0,xe=0;if(typeof o=="number")P?(ke=Math.floor(re.y/o),pe=ke*o-re.y):ke=Math.ceil(re.y/o),xe=Math.ceil(re.height/o)+ke,pe<0&&xe++;else{let Re=0;for(let Be=0;Be=Re+Le)Re+=Le,ke++,xe++;else if(re.y>wt)Re+=Le,P?pe+=wt-re.y:ke++,xe++;else if(re.y+re.height>Le/2+Re)Re+=Le,xe++;else break}}const qe={x:He,y:ke,width:de-He,height:xe-ke},Ze=B.current;(Ze===void 0||Ze.y!==qe.y||Ze.x!==qe.x||Ze.height!==qe.height||Ze.width!==qe.width||D.current!==se||S.current!==pe||re.width!==((rt=E.current)==null?void 0:rt[0])||re.height!==((Je=E.current)==null?void 0:Je[1]))&&(m==null||m({x:He,y:ke,width:de-He,height:xe-ke},re.width,re.height,re.paddingRight??0,se,pe),B.current=qe,D.current=se,S.current=pe,E.current=[re.width,re.height])},[t,o,n,m,s,A,P]),De=l.useCallback(re=>{le.current=re,fe()},[fe]);return l.useEffect(()=>{fe()},[fe]),l.createElement(pc,{scrollRef:g,className:w,kineticScrollPerfHack:c==null?void 0:c.kineticScrollPerfHack,preventDiagonalScrolling:h,draggable:O===!0||typeof O=="string",scrollWidth:Z+(T??0),scrollHeight:te+(X??0),clientHeight:W,rightElement:y,paddingBottom:X,paddingRight:T,rightElementProps:k,update:De,initialSize:v},l.createElement(fc,{eventTargetRef:g,width:R,height:W,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,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}))},Cc=vc,kc=Qt("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),xc=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),Sc=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),Mc=l.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},l.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),Rc=10,Ec=e=>{const{canvasRef:t,cellYOffset:n,rows:o,columns:r,searchInputRef:i,searchValue:a,searchResults:s,onSearchValueChange:c,getCellsForSelection:f,onSearchResultsChanged:u,showSearch:w=!1,onSearchClose:m}=e,[g]=l.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[h,y]=l.useState(""),k=a??h,M=l.useCallback(V=>{y(V),c==null||c(V)},[c]),[C,v]=l.useState(),A=l.useRef(C);A.current=C,l.useEffect(()=>{s!==void 0&&(s.length>0?v(V=>({rowsSearched:o,results:s.length,selectedIndex:(V==null?void 0:V.selectedIndex)??-1})):v(void 0))},[o,s]);const P=l.useRef();P.current===void 0&&(P.current=new AbortController);const O=l.useRef(),[T,X]=l.useState([]),R=s??T,W=l.useCallback(()=>{O.current!==void 0&&(window.cancelAnimationFrame(O.current),O.current=void 0,P.current.abort())},[]),B=l.useRef(n);B.current=n;const D=l.useCallback(V=>{const se=new RegExp(V.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let de=B.current,He=Math.min(10,o),U=0;v(void 0),X([]);const pe=[],ke=async()=>{var ue;if(f===void 0)return;const xe=performance.now(),qe=o-U;let Ze=f({x:0,y:de,width:r.length,height:Math.min(He,qe,o-de)},P.current.signal);typeof Ze=="function"&&(Ze=await Ze());let rt=!1;for(const[ae,Se]of Ze.entries())for(const[Ee,Fe]of Se.entries()){let be;switch(Fe.kind){case J.Text:case J.Number:be=Fe.displayData;break;case J.Uri:case J.Markdown:be=Fe.data;break;case J.Boolean:be=typeof Fe.data=="boolean"?Fe.data.toString():void 0;break;case J.Image:case J.Bubble:be=Fe.data.join("🐳");break;case J.Custom:be=Fe.copyData;break}be!==void 0&&se.test(be)&&(pe.push([Ee,ae+de]),rt=!0)}const Je=performance.now();rt&&X([...pe]),U+=Ze.length,Zt(U<=o);const Re=((ue=A.current)==null?void 0:ue.selectedIndex)??-1;v({results:pe.length,rowsSearched:U,selectedIndex:Re}),u==null||u(pe,Re),de+He>=o?de=0:de+=He;const Be=Je-xe,Le=Math.max(Be,1),wt=Rc/Le;He=Math.ceil(He*wt),U{var V;m==null||m(),v(void 0),X([]),u==null||u([],-1),W(),(V=t==null?void 0:t.current)==null||V.focus()},[W,t,m,u]),E=l.useCallback(V=>{M(V.target.value),s===void 0&&(V.target.value===""?(v(void 0),X([]),W()):D(V.target.value))},[D,W,M,s]);l.useEffect(()=>{w&&i.current!==null&&(M(""),i.current.focus({preventScroll:!0}))},[w,i,M]);const Z=l.useCallback(V=>{var de;if((de=V==null?void 0:V.stopPropagation)==null||de.call(V),C===void 0)return;const se=(C.selectedIndex+1)%C.results;v({...C,selectedIndex:se}),u==null||u(R,se)},[C,u,R]),te=l.useCallback(V=>{var de;if((de=V==null?void 0:V.stopPropagation)==null||de.call(V),C===void 0)return;let se=(C.selectedIndex-1)%C.results;se<0&&(se+=C.results),v({...C,selectedIndex:se}),u==null||u(R,se)},[u,R,C]),le=l.useCallback(V=>{(V.ctrlKey||V.metaKey)&&V.nativeEvent.code==="KeyF"||V.key==="Escape"?(S(),V.stopPropagation(),V.preventDefault()):V.key==="Enter"&&(V.shiftKey?te():Z())},[S,Z,te]);l.useEffect(()=>()=>{W()},[W]);const[fe,De]=l.useState(!1);l.useEffect(()=>{if(w)De(!0);else{const V=setTimeout(()=>De(!1),150);return()=>clearTimeout(V)}},[w]);const re=l.useMemo(()=>{if(!w&&!fe)return null;let V;C!==void 0&&(V=C.results>=1e3?"over 1000":`${C.results} result${C.results!==1?"s":""}`,C.selectedIndex>=0&&(V=`${C.selectedIndex+1} of ${V}`));const se=U=>{U.stopPropagation()},He={width:`${Math.floor(((C==null?void 0:C.rowsSearched)??0)/o*100)}%`};return l.createElement(kc,{className:w?"":"out",onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},l.createElement("div",{className:"gdg-search-bar-inner"},l.createElement("input",{id:g,"aria-hidden":!w,"data-testid":"search-input",ref:i,onChange:E,value:k,tabIndex:w?void 0:-1,onKeyDownCapture:le}),l.createElement("button",{"aria-label":"Previous Result","aria-hidden":!w,tabIndex:w?void 0:-1,onClick:te,disabled:((C==null?void 0:C.results)??0)===0},xc),l.createElement("button",{"aria-label":"Next Result","aria-hidden":!w,tabIndex:w?void 0:-1,onClick:Z,disabled:((C==null?void 0:C.results)??0)===0},Sc),m!==void 0&&l.createElement("button",{"aria-label":"Close Search","aria-hidden":!w,"data-testid":"search-close-button",tabIndex:w?void 0:-1,onClick:S},Mc)),C!==void 0?l.createElement(l.Fragment,null,l.createElement("div",{className:"gdg-search-status"},l.createElement("div",{"data-testid":"search-result-area"},V)),l.createElement("div",{className:"gdg-search-progress",style:He})):l.createElement("div",{className:"gdg-search-status"},l.createElement("label",{htmlFor:g},"Type to search")))},[w,fe,C,o,g,i,E,k,le,te,Z,m,S]);return l.createElement(l.Fragment,null,l.createElement(Cc,{prelightCells:R,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,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}),re)},Dc=Ec;class Ic extends l.PureComponent{constructor(){super(...arguments);We(this,"wrapperRef",l.createRef());We(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 l.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const Fc=()=>e=>Math.max(16,e.targetHeight-10),Tc=Qt("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[Fc(),"px"]}}),Hc=e=>{const{bounds:t,group:n,onClose:o,canvasBounds:r,onFinish:i}=e,[a,s]=Bt.useState(n);return Bt.createElement(Ic,{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},Bt.createElement(Tc,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:o,onFocus:c=>c.target.setSelectionRange(0,a.length),onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"?i(a):c.key==="Escape"&&o()},autoFocus:!0}))};function Lc(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 ze(e,t,n){const o=Wl(e,t);return o&&(n.didMatch=!0),o}function Wl(e,t){if(e.length===0)return!1;if(e.includes("|")){const c=e.split("|");for(const f of c)if(Wl(f,t))return!0;return!1}let n=!1,o=!1,r=!1,i=!1;const a=e.split("+"),s=a.pop();if(!Lc(s,t))return!1;if(a[0]==="any")return!0;for(const c of a)switch(c){case"ctrl":n=!0;break;case"shift":o=!0;break;case"alt":r=!0;break;case"meta":i=!0;break;case"primary":xr.value?i=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===o&&t.metaKey===i}function Ac(e,t,n,o,r,i){const a=Bt.useCallback((f,u,w,m)=>{var C;(i==="cell"||i==="multi-cell")&&f!==void 0&&(f={...f,range:{x:f.cell[0],y:f.cell[1],width:1,height:1}});const g=n==="mixed"&&(w||m==="drag"),h=o==="mixed"&&g,y=r==="mixed"&&g;let k={current:f===void 0?void 0:{...f,rangeStack:m==="drag"?((C=e.current)==null?void 0:C.rangeStack)??[]:[]},columns:h?e.columns:ot.empty(),rows:y?e.rows:ot.empty()};w&&(i==="multi-rect"||i==="multi-cell")&&k.current!==void 0&&e.current!==void 0&&(k={...k,current:{...k.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(k,u)},[o,e,n,i,r,t]),s=Bt.useCallback((f,u,w)=>{f=f??e.rows,u!==void 0&&(f=f.add(u));let m;if(r==="exclusive"&&f.length>0)m={current:void 0,columns:ot.empty(),rows:f};else{const g=w&&n==="mixed",h=w&&o==="mixed";m={current:g?e.current:void 0,columns:h?e.columns:ot.empty(),rows:f}}t(m,!1)},[o,e,n,r,t]),c=Bt.useCallback((f,u,w)=>{f=f??e.columns,u!==void 0&&(f=f.add(u));let m;if(o==="exclusive"&&f.length>0)m={current:void 0,rows:ot.empty(),columns:f};else{const g=w&&n==="mixed",h=w&&r==="mixed";m={current:g?e.current:void 0,rows:h?e.rows:ot.empty(),columns:f}}t(m,!1)},[o,e,n,r,t]);return[a,s,c]}function zc(e,t,n,o,r){const i=l.useCallback(f=>{if(e===!0){const u=[];for(let w=f.y;w=r?m.push({kind:J.Loading,allowOverlay:!1}):m.push(t([g,w]));u.push(m)}return u}return(e==null?void 0:e(f,o.signal))??[]},[o.signal,t,e,r]),a=e!==void 0?i:void 0,s=l.useCallback(f=>{if(a===void 0)return[];const u={...f,x:f.x-n};if(u.x<0){u.x=0,u.width--;const w=a(u,o.signal);return typeof w=="function"?async()=>(await w()).map(m=>[{kind:J.Loading,allowOverlay:!1},...m]):w.map(m=>[{kind:J.Loading,allowOverlay:!1},...m])}return a(u,o.signal)},[o.signal,a,n]);return[e!==void 0?s:void 0,a]}function Pc(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===ci?"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:Ko()}}function Bc(e,t){return e.map((o,r)=>{const i=t[r];return o.map(a=>a.span!==void 0&&a.span[0]!==i?{formatted:"",rawValue:"",format:"string"}:Pc(a))})}function Ji(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Oc(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(a=>Ji(a,!0)).join(",")):r.push(Ji(i.formatted,!1));t.push(r.join(" "))}return t.join(` -`)}function Jr(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function Qi(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function Wc(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function $c(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("
${Jr(r.formatted)}
    ${r.formatted.map((a,s)=>`
  1. `+Jr(a)+"
  2. ").join("")}
${Jr(r.formatted)}
"),t.join("")}function Nc(e,t){const n=Bc(e,t),o=Oc(n),r=$c(n);return{textPlain:o,textHtml:r}}function el(e){var a;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,w=(u==null?void 0:u.children.length)===1&&u.children[0].nodeName==="FONT",m=c.querySelectorAll("br");for(const y of m)y.replaceWith(` -`);const g=c.getAttribute("gdg-raw-value"),h=c.getAttribute("gdg-format")??"string";if(c.querySelector("a")!==null)i==null||i.push({rawValue:((a=c.querySelector("a"))==null?void 0:a.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(k=>k.getAttribute("gdg-raw-value")??""),formatted:[...y].map(k=>k.textContent??""),format:"string-array"})}else if(g!==null)i==null||i.push({rawValue:Wc(g),formatted:c.textContent??"",format:h});else{let y=c.textContent??"";w&&(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 Xc(e,t,n,o,r){var s;const i=e;if(o==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!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 m=t({x:c.x,y:c.y,width:1,height:c.height},r.signal);if(typeof m=="function")return i;f.push(...m);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 m=t({x:c.x,y:c.y,width:c.width,height:c.height},r.signal);if(typeof m=="function")return i;f.push(...m)}let u=c.x-n,w=c.x+c.width-1-n;for(const m of f)for(const g of m)g.span!==void 0&&(u=Math.min(g.span[0],u),w=Math.max(g.span[1],w));u===c.x-n&&w===c.x+c.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:c.y,width:w-u+1,height:c.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function tl(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Yc(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 a=0;for(const s of e){switch(i){case t.None:s===" "||s===` -`?(o.push(e.slice(r,a)),r=a+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(tl(e.slice(r,a))),r=a+1,s===` -`&&(n.push(o),o=[])),i=t.None);break}a++}return rs.map(c=>({rawValue:c,formatted:c,format:"string"})))}function nl(e,t,n){var s;const o=Nc(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)},a=(c,f)=>{var u,w;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),(w=n==null?void 0:n.clipboardData)==null||w.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?a(o.textPlain,o.textHtml):r(o.textPlain),n==null||n.preventDefault()}function $l(e){return e!==!0}function ol(e){return typeof e=="string"?e:`${e}px`}const Kc=()=>e=>e.innerWidth,Uc=()=>e=>e.innerHeight,_c=Qt("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Kc()],"wmyidgi-1":[Uc()]}}),Vc=e=>{const{inWidth:t,inHeight:n,children:o,...r}=e;return l.createElement(_c,{innerHeight:ol(n),innerWidth:ol(t),...r},o)},Gc=2,qc=1300;function jc(e,t,n){const o=Bt.useRef(0),[r,i]=e??[0,0];Bt.useEffect(()=>{if(r===0&&i===0){o.current=0;return}let a=!1,s=0;const c=f=>{var u;if(!a){if(s===0)s=f;else{const w=f-s;o.current=Math.min(1,o.current+w/qc);const m=o.current**1.618*w*Gc;(u=t.current)==null||u.scrollBy(r*m,i*m),s=f,n==null||n()}window.requestAnimationFrame(c)}};return window.requestAnimationFrame(c),()=>{a=!0}},[t,r,i,n])}function Zc({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:o,overscrollX:r,overscrollY:i,scaleToRem:a,remSize:s}){const[c,f,u,w,m,g]=Bt.useMemo(()=>{if(!a||s===16)return[e,t,n,o,r,i];const h=s/16,y=e,k=Ml();return[typeof y=="number"?y*h:M=>Math.ceil(y(M)*h),Math.ceil(t*h),Math.ceil(n*h),{...o,headerIconSize:((o==null?void 0:o.headerIconSize)??k.headerIconSize)*h,cellHorizontalPadding:((o==null?void 0:o.cellHorizontalPadding)??k.cellHorizontalPadding)*h,cellVerticalPadding:((o==null?void 0:o.cellVerticalPadding)??k.cellVerticalPadding)*h},Math.ceil((r??0)*h),Math.ceil((i??0)*h)]},[n,t,r,i,s,e,a,o]);return{rowHeight:c,headerHeight:f,groupHeaderHeight:u,theme:w,overscrollX:m,overscrollY:g}}const Wn={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 Pe(e,t){return e===!0?t:e===!1?"":e}function rl(e){const t=xr.value;return{activateCell:Pe(e.activateCell," |Enter|shift+Enter"),clear:Pe(e.clear,"any+Escape"),closeOverlay:Pe(e.closeOverlay,"any+Escape"),acceptOverlayDown:Pe(e.acceptOverlayDown,"Enter"),acceptOverlayUp:Pe(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:Pe(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:Pe(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:Pe(e.delete,t?"Backspace|Delete":"Delete"),downFill:Pe(e.downFill,"primary+_68"),scrollToSelectedCell:Pe(e.scrollToSelectedCell,"primary+Enter"),goDownCell:Pe(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:Pe(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:Pe(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:Pe(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:Pe(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:Pe(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:Pe(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:Pe(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:Pe(e.goToFirstCell,"primary+Home"),goToFirstColumn:Pe(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:Pe(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:Pe(e.goToLastCell,"primary+End"),goToLastColumn:Pe(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:Pe(e.goToLastRow,"primary+ArrowDown"),goToNextPage:Pe(e.goToNextPage,"PageDown"),goToPreviousPage:Pe(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:Pe(e.rightFill,"primary+_82"),search:Pe(e.search,"primary+f"),selectAll:Pe(e.selectAll,"primary+a"),selectColumn:Pe(e.selectColumn,"ctrl+ "),selectGrowDown:Pe(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:Pe(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:Pe(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:Pe(e.selectGrowUp,"shift+ArrowUp"),selectRow:Pe(e.selectRow,"shift+ "),selectToFirstCell:Pe(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:Pe(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:Pe(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:Pe(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:Pe(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:Pe(e.selectToLastRow,"primary+shift+ArrowDown")}}function Jc(e){const t=Ps(e);return Bt.useMemo(()=>{if(t===void 0)return rl(Wn);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Wn.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Wn.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Wn.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Wn.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Wn.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Wn.selectToLastCell};return rl({...Wn,...n})},[t])}const Qc=l.lazy(async()=>await al(()=>import("./data-grid-overlay-editor-6WKZfUKe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));let ed=0;function td(e){return xs(Li(Li(e).filter(t=>t.span!==void 0).map(t=>{var n,o;return Zn((((n=t.span)==null?void 0:n[0])??0)+1,(((o=t.span)==null?void 0:o[1])??0)+1)})))}function wr(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 Qr={kind:J.Loading,allowOverlay:!1},yr={columns:ot.empty(),rows:ot.empty(),current:void 0},nd=(e,t)=>{var Ti,Hi;const[n,o]=l.useState(yr),[r,i]=l.useState(),a=l.useRef(null),s=l.useRef(null),[c,f]=l.useState(),u=l.useRef(null),w=l.useRef(),m=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:y,width:k,height:M,columns:C,rows:v,getCellContent:A,onCellClicked:P,onCellActivated:O,onFillPattern:T,onFinishedEditing:X,coercePasteValue:R,drawHeader:W,drawCell:B,editorBloom:D,onHeaderClicked:S,onColumnProposeMove:E,spanRangeBehavior:Z="default",onGroupHeaderClicked:te,onCellContextMenu:le,className:fe,onHeaderContextMenu:De,getCellsForSelection:re,onGroupHeaderContextMenu:V,onGroupHeaderRenamed:se,onCellEdited:de,onCellsEdited:He,onSearchResultsChanged:U,searchResults:pe,onSearchValueChange:ke,searchValue:xe,onKeyDown:qe,onKeyUp:Ze,keybindings:rt,editOnType:Je=!0,onRowAppended:Re,onColumnMoved:Be,validateCell:Le,highlightRegions:wt,rangeSelect:ue="rect",columnSelect:ae="multi",rowSelect:Se="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:Fe="exclusive",rowSelectionBlending:be="exclusive",onDelete:tt,onDragStart:Ke,onMouseMove:Ue,onPaste:j,copyHeaders:Te=!1,freezeColumns:Oe=0,cellActivationBehavior:Me="second-click",rowSelectionMode:St="auto",onHeaderMenuClick:_e,getGroupDetails:$e,onSearchClose:Ve,onItemHovered:yt,onSelectionCleared:Mt,showSearch:en,onVisibleRegionChanged:Kt,gridSelection:ut,onGridSelectionChange:Ot,minColumnWidth:Wt=50,maxColumnWidth:Sn=500,maxColumnAutoWidth:Mn,provideEditor:ct,trailingRowOptions:Ne,freezeTrailingRows:Ge=0,allowedFillDirections:Ft="orthogonal",scrollOffsetX:Tt,scrollOffsetY:bt,verticalBorder:Dt,onDragOverCell:sn,onDrop:Ye,onColumnResize:ft,onColumnResizeEnd:it,onColumnResizeStart:lt,customRenderers:Ht,fillHandle:dt,drawFocusRing:It,experimental:ht,fixedShadowX:Go,fixedShadowY:Tn,headerIcons:Rn,imageWindowLoader:En,initialSize:eo,isDraggable:qo,onDragLeave:jo,onRowMoved:yn,overscrollX:to,overscrollY:no,preventDiagonalScrolling:oo,rightElement:Kn,rightElementProps:Hn,trapFocus:Zo=!1,smoothScrollX:Jo,smoothScrollY:Dr,scaleToRem:Ir=!1,rowHeight:ro=34,headerHeight:Dn=36,groupHeaderHeight:Fr=Dn,theme:Tr,isOutsideClick:Qo,renderers:io}=e,Rt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,tn=(Rt==null?void 0:Rt.kind)??e.rowMarkers??"none",er=(Rt==null?void 0:Rt.width)??e.rowMarkerWidth,lo=(Rt==null?void 0:Rt.startIndex)??e.rowMarkerStartIndex??1,Mo=(Rt==null?void 0:Rt.theme)??e.rowMarkerTheme,Ln=(Rt==null?void 0:Rt.checkboxStyle)??"square",Ut=Math.max(Wt,20),an=Math.max(Sn,Ut),Ro=Math.max(Mn??an,Ut),An=l.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),Eo=l.useMemo(()=>Number.parseFloat(An.fontSize),[An]),{rowHeight:$t,headerHeight:so,groupHeaderHeight:Do,theme:tr,overscrollX:Hr,overscrollY:nr}=Zc({groupHeaderHeight:Fr,headerHeight:Dn,overscrollX:to,overscrollY:no,remSize:Eo,rowHeight:ro,scaleToRem:Ir,theme:Tr}),cn=Jc(rt),In=er??(v>1e4?48:v>1e3?44:v>100?36:32),_t=tn!=="none",H=_t?1:0,gt=Re!==void 0,Un=(Ne==null?void 0:Ne.sticky)===!0,[Lr,or]=l.useState(!1),Io=en??Lr,Ar=l.useCallback(()=>{Ve!==void 0?Ve():or(!1)},[Ve]),z=l.useMemo(()=>ut===void 0?void 0:wr(ut,H),[ut,H])??n,At=l.useRef();At.current===void 0&&(At.current=new AbortController),l.useEffect(()=>()=>At==null?void 0:At.current.abort(),[]);const[Et,ao]=zc(re,A,H,At.current,v),Fo=l.useCallback((d,p,b)=>{if(Le===void 0)return!0;const I=[d[0]-H,d[1]];return Le==null?void 0:Le(I,p,b)},[H,Le]),zn=l.useRef(ut),Xt=l.useCallback((d,p)=>{p&&(d=Xc(d,Et,H,Z,At.current)),Ot!==void 0?(zn.current=wr(d,-H),Ot(zn.current)):o(d)},[Ot,Et,H,Z]),dn=yo(ft,l.useCallback((d,p,b,I)=>{ft==null||ft(C[b-H],p,b-H,I)},[ft,H,C])),zr=yo(it,l.useCallback((d,p,b,I)=>{it==null||it(C[b-H],p,b-H,I)},[it,H,C])),co=yo(lt,l.useCallback((d,p,b,I)=>{lt==null||lt(C[b-H],p,b-H,I)},[lt,H,C])),Pr=yo(W,l.useCallback((d,p)=>(W==null?void 0:W({...d,columnIndex:d.columnIndex-H},p))??!1,[W,H])),Br=yo(B,l.useCallback((d,p)=>(B==null?void 0:B({...d,col:d.col-H},p))??!1,[B,H])),x=l.useCallback(d=>{if(tt!==void 0){const p=tt(wr(d,-H));return typeof p=="boolean"?p:wr(p,H)}return!0},[tt,H]),[K,Q,q]=Ac(z,Xt,Ee,Fe,be,ue),G=l.useMemo(()=>Nn(Ml(),tr),[tr]),[ie,ve]=l.useState([0,0,0]),Ce=l.useMemo(()=>{if(io===void 0)return{};const d={};for(const p of io)d[p.kind]=p;return d},[io]),oe=l.useCallback(d=>d.kind!==J.Custom?Ce[d.kind]:Ht==null?void 0:Ht.find(p=>p.isMatch(d)),[Ht,Ce]);let{sizedColumns:et,nonGrowWidth:he}=aa(C,v,ao,ie[0]-(H===0?0:In)-ie[2],Ut,Ro,G,oe,At.current);tn!=="none"&&(he+=In);const nt=l.useMemo(()=>et.some(d=>d.group!==void 0),[et]),Ie=nt?so+Do:so,Xe=z.rows.length,vt=tn==="none"?void 0:Xe===0?!1:Xe===v?!0:void 0,Ae=l.useMemo(()=>tn==="none"?et:[{title:"",width:In,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Mo,rowMarker:Ln,rowMarkerChecked:vt},...et],[tn,et,In,Mo,Ln,vt]),[pt,nn]=l.useMemo(()=>[bt!==void 0&&typeof $t=="number"?Math.floor(bt/$t):0,bt!==void 0&&typeof $t=="number"?-(bt%$t):0],[bt,$t]),mt=l.useRef({height:1,width:1,x:0,y:0}),Vt=l.useMemo(()=>({x:mt.current.x,y:pt,width:mt.current.width??1,height:mt.current.height??1,ty:nn}),[nn,pt]),Qe=l.useRef(!1),[Ct,Gt,bn]=zs(Vt);mt.current=Ct;const un=(Ct.height??1)>1;l.useLayoutEffect(()=>{if(bt!==void 0&&u.current!==null&&un){if(u.current.scrollTop===bt)return;u.current.scrollTop=bt,u.current.scrollTop!==bt&&bn(),Qe.current=!0}},[bt,un,bn]);const uo=(Ct.width??1)>1;l.useLayoutEffect(()=>{if(Tt!==void 0&&u.current!==null&&uo){if(u.current.scrollLeft===Tt)return;u.current.scrollLeft=Tt,u.current.scrollLeft!==Tt&&bn(),Qe.current=!0}},[Tt,uo,bn]);const _n=Ct.x+H,rr=Ct.y,Yt=l.useRef(null),Nt=l.useCallback(d=>{var p;d===!0?(p=Yt.current)==null||p.focus():window.requestAnimationFrame(()=>{var b;(b=Yt.current)==null||b.focus()})},[]),zt=gt?v+1:v,on=l.useCallback(d=>{const p=H===0?d:d.map(I=>({...I,location:[I.location[0]-H,I.location[1]]})),b=He==null?void 0:He(p);if(b!==!0)for(const I of p)de==null||de(I.location,I.value);return b},[de,He,H]),[Vn,Or]=l.useState(),ir=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Nl=l.useMemo(()=>{if((wt===void 0||wt.length===0)&&ir===void 0&&Vn===void 0)return;const d=[];if(wt!==void 0)for(const p of wt){const b=Ae.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 Vn!==void 0&&d.push({color:Jn(G.accentColor,0),range:Vn,style:"dashed"}),ir!==void 0&&d.push({color:Jn(G.accentColor,.5),range:ir,style:"solid-outline"}),d.length>0?d:void 0},[Vn,ir,wt,Ae.length,G.accentColor,H]),bi=l.useRef(Ae);bi.current=Ae;const qt=l.useCallback(([d,p],b=!1)=>{var N,L,$,_,Y,ne,ce;const I=gt&&p===zt-1;if(d===0&&_t)return I?Qr:{kind:ln.Marker,allowOverlay:!1,checkboxStyle:Ln,checked:(z==null?void 0:z.rows.hasIndex(p))===!0,markerKind:tn==="clickable-number"?"number":tn,row:lo+p,drawHandle:yn!==void 0,cursor:tn==="clickable-number"?"pointer":void 0};if(I){const me=d===H?(Ne==null?void 0:Ne.hint)??"":"",we=bi.current[d];if(((N=we==null?void 0:we.trailingRowOptions)==null?void 0:N.disabled)===!0)return Qr;{const je=((L=we==null?void 0:we.trailingRowOptions)==null?void 0:L.hint)??me,ye=(($=we==null?void 0:we.trailingRowOptions)==null?void 0:$.addIcon)??(Ne==null?void 0:Ne.addIcon);return{kind:ln.NewRow,hint:je,allowOverlay:!1,icon:ye}}}else{const ee=d-H;if(b||(ht==null?void 0:ht.strict)===!0){const we=mt.current,je=we.x>ee||ee>we.x+we.width||we.y>p||p>we.y+we.height||p>=$r.current,ye=ee===((Y=(_=we.extras)==null?void 0:_.selected)==null?void 0:Y[0])&&p===((ne=we.extras)==null?void 0:ne.selected[1]);let ge=!1;if(((ce=we.extras)==null?void 0:ce.freezeRegions)!==void 0){for(const st of we.extras.freezeRegions)if(Er(st,ee,p)){ge=!0;break}}if(je&&!ye&&!ge)return Qr}let me=A([ee,p]);return H!==0&&me.span!==void 0&&(me={...me,span:[me.span[0]+H,me.span[1]+H]}),me}},[gt,zt,_t,Ln,z==null?void 0:z.rows,tn,lo,yn,H,Ne==null?void 0:Ne.hint,Ne==null?void 0:Ne.addIcon,ht==null?void 0:ht.strict,A]),Wr=l.useCallback(d=>{let p=($e==null?void 0:$e(d))??{name:d};return se!==void 0&&d!==""&&(p={icon:p.icon,name:p.name,overrideTheme:p.overrideTheme,actions:[...p.actions??[],{title:"Rename",icon:"renameIcon",onClick:b=>Xr({group:p.name,bounds:b.bounds})}]}),p},[$e,se]),lr=l.useCallback(d=>{var $;const[p,b]=d.cell,I=Ae[p],F=(I==null?void 0:I.group)!==void 0?($=Wr(I.group))==null?void 0:$.overrideTheme:void 0,N=I==null?void 0:I.themeOverride,L=h==null?void 0:h(b);i({...d,theme:Nn(G,F,N,L,d.content.themeOverride)})},[h,Ae,Wr,G]),fo=l.useCallback((d,p,b)=>{var L;if(z.current===void 0)return;const[I,F]=z.current.cell,N=qt([I,F]);if(N.kind!==J.Boolean&&N.allowOverlay){let $=N;if(b!==void 0)switch($.kind){case J.Number:{const _=Ms(()=>b==="-"?-0:Number.parseFloat(b),0);$={...$,data:Number.isNaN(_)?0:_};break}case J.Text:case J.Markdown:case J.Uri:$={...$,data:b};break}lr({target:d,content:$,initialValue:b,cell:[I,F],highlight:b===void 0,forceEditMode:b!==void 0})}else N.kind===J.Boolean&&p&&N.readonly!==!0&&(on([{location:z.current.cell,value:{...N,data:$l(N.data)}}]),(L=Yt.current)==null||L.damage([{cell:z.current.cell}]))},[qt,z,on,lr]),pi=l.useCallback((d,p)=>{var F;const b=(F=Yt.current)==null?void 0:F.getBounds(d,p);if(b===void 0||u.current===null)return;const I=qt([d,p]);I.allowOverlay&&lr({target:b,content:I,initialValue:void 0,highlight:!0,cell:[d,p],forceEditMode:!0})},[qt,lr]),kt=l.useCallback((d,p,b="both",I=0,F=0,N=void 0)=>{if(u.current!==null){const L=Yt.current,$=s.current,_=typeof d!="number"?d.unit==="cell"?d.amount:void 0:d,Y=typeof p!="number"?p.unit==="cell"?p.amount:void 0:p,ne=typeof d!="number"&&d.unit==="px"?d.amount:void 0,ce=typeof p!="number"&&p.unit==="px"?p.amount:void 0;if(L!==null&&$!==null){let ee={x:0,y:0,width:0,height:0},me=0,we=0;if((_!==void 0||Y!==void 0)&&(ee=L.getBounds((_??0)+H,Y??0)??ee,ee.width===0||ee.height===0))return;const je=$.getBoundingClientRect(),ye=je.width/$.offsetWidth;if(ne!==void 0&&(ee={...ee,x:ne-je.left-u.current.scrollLeft,width:1}),ce!==void 0&&(ee={...ee,y:ce+je.top-u.current.scrollTop,height:1}),ee!==void 0){const ge={x:ee.x-I,y:ee.y-F,width:ee.width+2*I,height:ee.height+2*F};let st=0;for(let Gr=0;Gr0&&(Pt=Qn(zt,xt,$t));let hn=st*ye+je.left+H*In*ye,vn=je.right,gn=je.top+Ie*ye,Cn=je.bottom-Pt*ye;const fr=ee.width+I*2;switch(N==null?void 0:N.hAlign){case"start":vn=hn+fr;break;case"end":hn=vn-fr;break;case"center":hn=Math.floor((hn+vn)/2)-fr/2,vn=hn+fr;break}const hr=ee.height+F*2;switch(N==null?void 0:N.vAlign){case"start":Cn=gn+hr;break;case"end":gn=Cn-hr;break;case"center":gn=Math.floor((gn+Cn)/2)-hr/2,Cn=gn+hr;break}hn>ge.x?me=ge.x-hn:vnge.y?we=ge.y-gn:Cn=zt-xt)&&(we=0),(me!==0||we!==0)&&(ye!==1&&(me/=ye,we/=ye),u.current.scrollTo(me+u.current.scrollLeft,we+u.current.scrollTop))}}}},[H,Ge,In,Ie,Oe,et,zt,Un,$t]),vi=l.useRef(pi),Ci=l.useRef(A),$r=l.useRef(v);vi.current=pi,Ci.current=A,$r.current=v;const ho=l.useCallback(async(d,p=!0)=>{var _;const b=Ae[d];if(((_=b==null?void 0:b.trailingRowOptions)==null?void 0:_.disabled)===!0)return;const I=Re==null?void 0:Re();let F,N=!0;I!==void 0&&(F=await I,F==="top"&&(N=!1),typeof F=="number"&&(N=!1));let L=0;const $=()=>{if($r.current<=v){L<500&&window.setTimeout($,L),L=50+L*2;return}const Y=typeof F=="number"?F:N?v:0;ur.current(d-H,Y),K({cell:[d,Y],range:{x:d,y:Y,width:1,height:1}},!1,!1,"edit");const ne=Ci.current([d-H,Y]);ne.allowOverlay&&$o(ne)&&ne.readonly!==!0&&p&&window.setTimeout(()=>{vi.current(d,Y)},0)};$()},[Ae,Re,H,v,K]),sr=l.useCallback(d=>{var b,I;const p=((I=(b=et[d])==null?void 0:b.trailingRowOptions)==null?void 0:I.targetColumn)??(Ne==null?void 0:Ne.targetColumn);if(typeof p=="number")return p+(_t?1:0);if(typeof p=="object"){const F=C.indexOf(p);if(F>=0)return F+(_t?1:0)}},[et,C,_t,Ne==null?void 0:Ne.targetColumn]),Pn=l.useRef(),go=l.useRef(),To=l.useCallback((d,p)=>{var F;const[b,I]=p;return Nn(G,(F=Ae[b])==null?void 0:F.themeOverride,h==null?void 0:h(I),d.themeOverride)},[h,Ae,G]),Ho=l.useCallback(d=>{var ne,ce,ee;const p=xr.value?d.metaKey:d.ctrlKey,b=p&&Se==="multi",I=p&&ae==="multi",[F,N]=d.location,L=z.columns,$=z.rows,[_,Y]=((ne=z.current)==null?void 0:ne.cell)??[];if(d.kind==="cell"){if(go.current=void 0,Gn.current=[F,N],F===0&&_t){if(gt===!0&&N===v||tn==="number"||Se==="none")return;const me=qt(d.location);if(me.kind!==ln.Marker)return;if(yn!==void 0){const ye=oe(me);Zt((ye==null?void 0:ye.kind)===ln.Marker);const ge=(ce=ye==null?void 0:ye.onClick)==null?void 0:ce.call(ye,{...d,cell:me,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,theme:To(me,d.location),preventDefault:()=>{}});if(ge===void 0||ge.checked===me.checked)return}i(void 0),Nt();const we=$.hasIndex(N),je=Pn.current;if(Se==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&je!==void 0&&$.hasIndex(je)){const ye=[Math.min(je,N),Math.max(je,N)+1];b||St==="multi"?Q(void 0,ye,!0):Q(ot.fromSingleSelection(ye),void 0,b)}else b||d.isTouch||St==="multi"?we?Q($.remove(N),void 0,!0):(Q(void 0,N,!0),Pn.current=N):we&&$.length===1?Q(ot.empty(),void 0,p):(Q(ot.fromSingleSelection(N),void 0,p),Pn.current=N)}else if(F>=H&>&&N===v){const me=sr(F);ho(me??F)}else if(_!==F||Y!==N){const me=qt(d.location),we=oe(me);if((we==null?void 0:we.onSelect)!==void 0){let ge=!1;if(we.onSelect({...d,cell:me,posX:d.localEventX,posY:d.localEventY,bounds:d.bounds,preventDefault:()=>ge=!0,theme:To(me,d.location)}),ge)return}const je=Un&&N===v,ye=Un&&z!==void 0&&((ee=z.current)==null?void 0:ee.cell[1])===v;if((d.shiftKey||d.isLongTouch===!0)&&_!==void 0&&Y!==void 0&&z.current!==void 0&&!ye){if(je)return;const ge=Math.min(F,_),st=Math.max(F,_),Pt=Math.min(N,Y),xt=Math.max(N,Y);K({...z.current,range:{x:ge,y:Pt,width:st-ge+1,height:xt-Pt+1}},!0,p,"click"),Pn.current=void 0,Nt()}else K({cell:[F,N],range:{x:F,y:N,width:1,height:1}},!0,p,"click"),Pn.current=void 0,i(void 0),Nt()}}else if(d.kind==="header")if(Gn.current=[F,N],i(void 0),_t&&F===0)Pn.current=void 0,go.current=void 0,Se==="multi"&&($.length!==v?Q(ot.fromSingleSelection([0,v]),void 0,p):Q(ot.empty(),void 0,p),Nt());else{const me=go.current;if(ae==="multi"&&(d.shiftKey||d.isLongTouch===!0)&&me!==void 0&&L.hasIndex(me)){const we=[Math.min(me,F),Math.max(me,F)+1];I?q(void 0,we,p):q(ot.fromSingleSelection(we),void 0,p)}else I?(L.hasIndex(F)?q(L.remove(F),void 0,p):q(void 0,F,p),go.current=F):ae!=="none"&&(q(ot.fromSingleSelection(F),void 0,p),go.current=F);Pn.current=void 0,Nt()}else d.kind===jt?Gn.current=[F,N]:d.kind===Sr&&!d.isMaybeScrollbar&&(Xt(yr,!1),i(void 0),Nt(),Mt==null||Mt(),Pn.current=void 0,go.current=void 0)},[ho,ae,Nt,oe,sr,qt,z,_t,Un,Mt,yn,H,tn,Se,St,v,K,Xt,q,Q,gt,To]),Lo=l.useRef(!1),Gn=l.useRef(),ki=l.useRef(Ct),rn=l.useRef(),Xl=l.useCallback(d=>{if(mo.current=!1,ki.current=mt.current,d.button!==0&&d.button!==1){rn.current=void 0;return}const p=performance.now();rn.current={button:d.button,time:p,location:d.location},(d==null?void 0:d.kind)==="header"&&(Lo.current=!0);const b=d.kind==="cell"&&d.isFillHandle;!b&&d.kind!=="cell"&&d.isEdge||(f({previousSelection:z,fillHandle:b}),Gn.current=void 0,!d.isTouch&&d.button===0&&!b?Ho(d):!d.isTouch&&d.button===1&&(Gn.current=d.location))},[z,Ho]),[Nr,Xr]=l.useState(),xi=l.useCallback(d=>{if(d.kind!==jt||ae!=="multi")return;const p=xr.value?d.metaKey:d.ctrlKey,[b]=d.location,I=z.columns;if(b=H&&Uo(F.group,Ae[$].group);$--)N--;for(let $=b+1;${if(Et!==void 0&&dn!==void 0){const p=mt.current.y,b=mt.current.height;let I=Et({x:d,y:p,width:1,height:Math.min(b,v-p)},At.current.signal);typeof I!="object"&&(I=await I());const F=et[d-H],L=document.createElement("canvas").getContext("2d",{alpha:!1});if(L!==null){L.font=G.baseFontFull;const $=El(L,G,F,0,I,Ut,an,!1,oe);dn==null||dn(F,$.width,d,$.width)}}},[et,Et,an,G,Ut,dn,H,v,oe]),[Yl,Yr]=l.useState(),wo=l.useCallback(async(d,p)=>{var $,_;const b=($=d.current)==null?void 0:$.range;if(b===void 0||Et===void 0||p.current===void 0)return;const I=p.current.range;if(T!==void 0){let Y=!1;if(T({fillDestination:{...I,x:I.x-H},patternSource:{...b,x:b.x-H},preventDefault:()=>Y=!0}),Y)return}let F=Et(b,At.current.signal);typeof F!="object"&&(F=await F());const N=F,L=[];for(let Y=0;Y({cell:Y.location})))},[Et,on,T,H]),Si=l.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const d={...z,current:{...z.current,range:{...z.current.range,width:1}}};wo(d,z)},[wo,z]),Mi=l.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const d={...z,current:{...z.current,range:{...z.current.range,height:1}}};wo(d,z)},[wo,z]),Kl=l.useCallback((d,p)=>{var ne,ce;const b=c;if(f(void 0),Or(void 0),Yr(void 0),Lo.current=!1,p)return;if((b==null?void 0:b.fillHandle)===!0&&z.current!==void 0&&((ne=b.previousSelection)==null?void 0:ne.current)!==void 0){if(Vn===void 0)return;const ee={...z,current:{...z.current,range:Hl(b.previousSelection.current.range,Vn)}};wo(b.previousSelection,ee),Xt(ee,!0);return}const[I,F]=d.location,[N,L]=Gn.current??[],$=()=>{mo.current=!0},_=ee=>{var we,je,ye;const me=ee.isTouch||N===I&&L===F;if(me&&(P==null||P([I-H,F],{...ee,preventDefault:$})),ee.button===1)return!mo.current;if(!mo.current){const ge=qt(d.location),st=oe(ge);if(st!==void 0&&st.onClick!==void 0&&me){const xt=st.onClick({...ee,cell:ge,posX:ee.localEventX,posY:ee.localEventY,bounds:ee.bounds,theme:To(ge,d.location),preventDefault:$});xt!==void 0&&!vo(xt)&&po(xt)&&(on([{location:ee.location,value:xt}]),(we=Yt.current)==null||we.damage([{cell:ee.location}]))}if(mo.current||z.current===void 0)return!1;let Pt=!1;switch(ge.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(((ye=(je=b==null?void 0:b.previousSelection)==null?void 0:je.current)==null?void 0:ye.cell)===void 0)break;const[xt,hn]=z.current.cell,[vn,gn]=b.previousSelection.current.cell;Pt=I===xt&&I===vn&&F===hn&&F===gn&&(ee.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Pt=!0;break}}if(Pt)return O==null||O([I-H,F]),fo(ee.bounds,!1),!0}return!1},Y=d.location[0]-H;if(d.isTouch){const ee=mt.current,me=ki.current;if(ee.x!==me.x||ee.y!==me.y)return;if(d.isLongTouch===!0){if(d.kind==="cell"&&No((ce=z.current)==null?void 0:ce.cell,d.location)){le==null||le([Y,d.location[1]],{...d,preventDefault:$});return}else if(d.kind==="header"&&z.columns.hasIndex(I)){De==null||De(Y,{...d,preventDefault:$});return}else if(d.kind===jt){if(Y<0)return;V==null||V(Y,{...d,preventDefault:$});return}}d.kind==="cell"?_(d)||Ho(d):d.kind===jt?te==null||te(Y,{...d,preventDefault:$}):(d.kind===$n&&(S==null||S(Y,{...d,preventDefault:$})),Ho(d));return}if(d.kind==="header"){if(Y<0)return;d.isEdge?d.isDoubleClick===!0&&ar(I):d.button===0&&I===N&&F===L&&(S==null||S(Y,{...d,preventDefault:$}))}if(d.kind===jt){if(Y<0)return;d.button===0&&I===N&&F===L&&(te==null||te(Y,{...d,preventDefault:$}),mo.current||xi(d))}d.kind==="cell"&&(d.button===0||d.button===1)&&_(d),Gn.current=void 0},[c,z,H,Vn,wo,Xt,P,qt,oe,Me,To,on,O,fo,le,De,V,Ho,te,S,ar,xi]),Ul=l.useCallback(d=>{const p={...d,location:[d.location[0]-H,d.location[1]]};Ue==null||Ue(p),c!==void 0&&d.buttons===0&&(f(void 0),Or(void 0),Yr(void 0),Lo.current=!1),Yr(b=>{var I;return Lo.current?[d.scrollEdge[0],0]:d.scrollEdge[0]===(b==null?void 0:b[0])&&d.scrollEdge[1]===b[1]?b:c===void 0||(((I=rn.current)==null?void 0:I.location[0])??0){_e==null||_e(d-H,p)},[_e,H]),pn=(Ti=z==null?void 0:z.current)==null?void 0:Ti.cell,Vl=l.useCallback((d,p,b,I,F,N)=>{Qe.current=!1;let L=pn;L!==void 0&&(L=[L[0]-H,L[1]]);const $=Oe===0?void 0:{x:0,y:d.y,width:Oe,height:d.height},_=[];$!==void 0&&_.push($),Ge>0&&(_.push({x:d.x-H,y:v-Ge,width:d.width,height:Ge}),Oe>0&&_.push({x:0,y:v-Ge,width:Oe,height:Ge}));const Y={x:d.x-H,y:d.y,width:d.width,height:gt&&d.y+d.height>=v?d.height-1:d.height,tx:F,ty:N,extras:{selected:L,freezeRegion:$,freezeRegions:_}};mt.current=Y,Gt(Y),ve([p,b,I]),Kt==null||Kt(Y,Y.tx,Y.ty,Y.extras)},[pn,H,gt,v,Oe,Ge,Gt,Kt]),Gl=yo(Be,l.useCallback((d,p)=>{Be==null||Be(d-H,p-H),ae!=="none"&&q(ot.fromSingleSelection(p),void 0,!0)},[ae,Be,H,q])),Kr=l.useRef(!1),ql=l.useCallback(d=>{if(d.location[0]===0&&H>0){d.preventDefault();return}Ke==null||Ke({...d,location:[d.location[0]-H,d.location[1]]}),d.defaultPrevented()||(Kr.current=!0),f(void 0)},[Ke,H]),jl=l.useCallback(()=>{Kr.current=!1},[]),Ur=l.useRef(),_r=l.useCallback(d=>{var p,b,I;if(!Ol(d,Ur.current)&&(Ur.current=d,!(((p=rn==null?void 0:rn.current)==null?void 0:p.button)!==void 0&&rn.current.button>=1))){if(d.buttons!==0&&c!==void 0&&((b=rn.current)==null?void 0:b.location[0])===0&&d.location[0]===0&&H===1&&Se==="multi"&&c.previousSelection&&!c.previousSelection.rows.hasIndex(rn.current.location[1])&&z.rows.hasIndex(rn.current.location[1])){const F=Math.min(rn.current.location[1],d.location[1]),N=Math.max(rn.current.location[1],d.location[1])+1;Q(ot.fromSingleSelection([F,N]),void 0,!1)}if(d.buttons!==0&&c!==void 0&&z.current!==void 0&&!Kr.current&&!Lo.current&&(ue==="rect"||ue==="multi-rect")){const[F,N]=z.current.cell;let[L,$]=d.location;if($<0&&($=mt.current.y),c.fillHandle===!0&&((I=c.previousSelection)==null?void 0:I.current)!==void 0){const _=c.previousSelection.current.range;$=Math.min($,gt?v-1:v);const Y=$a(_,L,$,Ft);Or(Y)}else{if(gt&&N===v)return;if(gt&&$===v)if(d.kind===Sr)$--;else return;L=Math.max(L,H);const ne=L-F,ce=$-N,ee={x:ne>=0?F:L,y:ce>=0?N:$,width:Math.abs(ne)+1,height:Math.abs(ce)+1};K({...z.current,range:ee},!0,!1,"drag")}}yt==null||yt({...d,location:[d.location[0]-H,d.location[1]]})}},[Ft,c,H,Se,z,ue,yt,Q,gt,v,K]),Zl=l.useCallback(()=>{var L,$;const d=Ur.current;if(d===void 0)return;const[p,b]=d.scrollEdge;let[I,F]=d.location;const N=mt.current;p===-1?I=(($=(L=N.extras)==null?void 0:L.freezeRegion)==null?void 0:$.x)??N.x:p===1&&(I=N.x+N.width),b===-1?F=Math.max(0,N.y):b===1&&(F=Math.min(v-1,N.y+N.height)),I=mn(I,0,Ae.length-1),F=mn(F,0,v-1),_r({...d,location:[I,F]})},[Ae.length,_r,v]);jc(Yl,u,Zl);const fn=l.useCallback(d=>{if(z.current===void 0)return;const[p,b]=d,[I,F]=z.current.cell,N=z.current.range;let L=N.x,$=N.x+N.width,_=N.y,Y=N.y+N.height;if(b!==0)switch(b){case 2:{Y=v,_=F,kt(0,Y,"vertical");break}case-2:{_=0,Y=F+1,kt(0,_,"vertical");break}case 1:{_F+1?(Y--,kt(0,Y,"vertical")):(_=Math.max(0,_-1),kt(0,_,"vertical"));break}default:Ko()}if(p!==0)if(p===2)$=Ae.length,L=I,kt($-1-H,0,"horizontal");else if(p===-2)L=H,$=I+1,kt(L-H,0,"horizontal");else{let ne=[];if(Et!==void 0){const ce=Et({x:L,y:_,width:$-L-H,height:Y-_},At.current.signal);typeof ce=="object"&&(ne=td(ce))}if(p===1){let ce=!1;if(L0){const ee=Zn(L+1,I+1).find(me=>!ne.includes(me-H));ee!==void 0&&(L=ee,ce=!0)}else L++,ce=!0;ce&&kt(L,0,"horizontal")}ce||($=Math.min(Ae.length,$+1),kt($-1-H,0,"horizontal"))}else if(p===-1){let ce=!1;if($>I+1){if(ne.length>0){const ee=Zn($-1,I,-1).find(me=>!ne.includes(me-H));ee!==void 0&&($=ee,ce=!0)}else $--,ce=!0;ce&&kt($-H,0,"horizontal")}ce||(L=Math.max(H,L-1),kt(L-H,0,"horizontal"))}else Ko()}K({cell:z.current.cell,range:{x:L,y:_,width:$-L,height:Y-_}},!0,!1,"keyboard-select")},[Et,z,Ae.length,H,v,kt,K]),Bn=l.useCallback((d,p,b,I)=>{const F=zt-(b?0:1);if(d=mn(d,H,et.length-1+H),p=mn(p,0,F),d===(pn==null?void 0:pn[0])&&p===(pn==null?void 0:pn[1]))return!1;if(I&&z.current!==void 0){const N=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&N.push(z.current.range),Xt({...z,current:{cell:[d,p],range:{x:d,y:p,width:1,height:1},rangeStack:N}},!0)}else K({cell:[d,p],range:{x:d,y:p,width:1,height:1}},!0,!1,"keyboard-nav");return w.current!==void 0&&w.current[0]===d&&w.current[1]===p&&(w.current=void 0),kt(d-H,p),!0},[zt,H,et.length,pn,z,kt,Xt,K]),Jl=l.useCallback((d,p)=>{(r==null?void 0:r.cell)!==void 0&&d!==void 0&&po(d)&&(on([{location:r.cell,value:d}]),window.requestAnimationFrame(()=>{var F;(F=Yt.current)==null||F.damage([{cell:r.cell}])})),Nt(!0),i(void 0);const[b,I]=p;if(z.current!==void 0&&(b!==0||I!==0)){const F=z.current.cell[1]===zt-1&&d!==void 0;Bn(mn(z.current.cell[0]+b,0,Ae.length-1),mn(z.current.cell[1]+I,0,zt-1),F,!1)}X==null||X(d,p)},[r==null?void 0:r.cell,Nt,z,X,on,zt,Bn,Ae.length]),Ql=l.useMemo(()=>`gdg-overlay-${ed++}`,[]),qn=l.useCallback(d=>{var b,I,F,N;Nt();const p=[];for(let L=d.x;L({cell:L.location})))},[Nt,A,oe,on,H]),Ao=r!==void 0,Ri=l.useCallback(d=>{var me,we;const p=()=>{d.stopPropagation(),d.preventDefault()},b={didMatch:!1},{bounds:I}=d,F=z.columns,N=z.rows,L=cn;if(!Ao&&ze(L.clear,d,b))Xt(yr,!1),Mt==null||Mt();else if(!Ao&&ze(L.selectAll,d,b))Xt({columns:ot.empty(),rows:ot.empty(),current:{cell:((me=z.current)==null?void 0:me.cell)??[H,0],range:{x:H,y:0,width:C.length,height:v},rangeStack:[]}},!1);else if(ze(L.search,d,b))(we=a==null?void 0:a.current)==null||we.focus({preventScroll:!0}),or(!0);else if(ze(L.delete,d,b)){const je=(x==null?void 0:x(z))??!0;if(je!==!1){const ye=je===!0?z:je;if(ye.current!==void 0){qn(ye.current.range);for(const ge of ye.current.rangeStack)qn(ge)}for(const ge of ye.rows)qn({x:H,y:ge,width:C.length,height:1});for(const ge of ye.columns)qn({x:ge,y:0,width:1,height:v})}}if(b.didMatch)return p(),!0;if(z.current===void 0)return!1;let[$,_]=z.current.cell,Y=!1,ne=!1;ze(L.scrollToSelectedCell,d,b)?ur.current($-H,_):ae!=="none"&&ze(L.selectColumn,d,b)?F.hasIndex($)?q(F.remove($),void 0,!0):ae==="single"?q(ot.fromSingleSelection($),void 0,!0):q(void 0,$,!0):Se!=="none"&&ze(L.selectRow,d,b)?N.hasIndex(_)?Q(N.remove(_),void 0,!0):Se==="single"?Q(ot.fromSingleSelection(_),void 0,!0):Q(void 0,_,!0):!Ao&&I!==void 0&&ze(L.activateCell,d,b)?_===v&>?window.setTimeout(()=>{const je=sr($);ho(je??$)},0):(O==null||O([$-H,_]),fo(I,!0)):z.current.range.height>1&&ze(L.downFill,d,b)?Mi():z.current.range.width>1&&ze(L.rightFill,d,b)?Si():ze(L.goToNextPage,d,b)?_+=Math.max(1,mt.current.height-4):ze(L.goToPreviousPage,d,b)?_-=Math.max(1,mt.current.height-4):ze(L.goToFirstCell,d,b)?(i(void 0),_=0,$=0):ze(L.goToLastCell,d,b)?(i(void 0),_=Number.MAX_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER):ze(L.selectToFirstCell,d,b)?(i(void 0),fn([-2,-2])):ze(L.selectToLastCell,d,b)?(i(void 0),fn([2,2])):Ao?(ze(L.closeOverlay,d,b)&&i(void 0),ze(L.acceptOverlayDown,d,b)&&(i(void 0),_++),ze(L.acceptOverlayUp,d,b)&&(i(void 0),_--),ze(L.acceptOverlayLeft,d,b)&&(i(void 0),$--),ze(L.acceptOverlayRight,d,b)&&(i(void 0),$++)):(ze(L.goDownCell,d,b)?_+=1:ze(L.goUpCell,d,b)?_-=1:ze(L.goRightCell,d,b)?$+=1:ze(L.goLeftCell,d,b)?$-=1:ze(L.goDownCellRetainSelection,d,b)?(_+=1,Y=!0):ze(L.goUpCellRetainSelection,d,b)?(_-=1,Y=!0):ze(L.goRightCellRetainSelection,d,b)?($+=1,Y=!0):ze(L.goLeftCellRetainSelection,d,b)?($-=1,Y=!0):ze(L.goToLastRow,d,b)?_=v-1:ze(L.goToFirstRow,d,b)?_=Number.MIN_SAFE_INTEGER:ze(L.goToLastColumn,d,b)?$=Number.MAX_SAFE_INTEGER:ze(L.goToFirstColumn,d,b)?$=Number.MIN_SAFE_INTEGER:(ue==="rect"||ue==="multi-rect")&&(ze(L.selectGrowDown,d,b)?fn([0,1]):ze(L.selectGrowUp,d,b)?fn([0,-1]):ze(L.selectGrowRight,d,b)?fn([1,0]):ze(L.selectGrowLeft,d,b)?fn([-1,0]):ze(L.selectToLastRow,d,b)?fn([0,2]):ze(L.selectToFirstRow,d,b)?fn([0,-2]):ze(L.selectToLastColumn,d,b)?fn([2,0]):ze(L.selectToFirstColumn,d,b)&&fn([-2,0])),ne=b.didMatch);const ce=Bn($,_,!1,Y),ee=b.didMatch;return ee&&(ce||!ne||Zo)&&p(),ee},[Ao,z,cn,ae,Se,ue,H,v,Bn,Xt,Mt,C.length,x,Zo,qn,q,Q,gt,sr,ho,O,fo,Mi,Si,fn]),zo=l.useCallback(d=>{let p=!1;if(qe!==void 0&&qe({...d,cancel:()=>{p=!0}}),p||Ri(d)||z.current===void 0)return;const[b,I]=z.current.cell,F=mt.current;if(Je&&!d.metaKey&&!d.ctrlKey&&z.current!==void 0&&d.key.length===1&&/[ -~]/g.test(d.key)&&d.bounds!==void 0&&$o(A([b-H,Math.max(0,Math.min(I,v-1))]))){if((!gt||I!==v)&&(F.y>I||I>F.y+F.height||F.x>b||b>F.x+F.width))return;fo(d.bounds,!0,d.key),d.stopPropagation(),d.preventDefault()}},[Je,qe,Ri,z,A,H,v,gt,fo]),es=l.useCallback((d,p)=>{const b=d.location[0]-H;if(d.kind==="header"&&(De==null||De(b,{...d,preventDefault:p})),d.kind===jt){if(b<0)return;V==null||V(b,{...d,preventDefault:p})}if(d.kind==="cell"){const[I,F]=d.location;le==null||le([b,F],{...d,preventDefault:p}),Us(z,d.location)||Bn(I,F,!1,!1)}},[z,le,V,De,H,Bn]),Vr=l.useCallback(async d=>{var L,$,_;if(!cn.paste)return;function p(Y,ne,ce,ee){var we,je;const me=typeof ce=="object"?(ce==null?void 0:ce.join(` -`))??"":(ce==null?void 0:ce.toString())??"";if(!vo(Y)&&$o(Y)&&Y.readonly!==!0){const ye=R==null?void 0:R(me,Y);if(ye!==void 0&&po(ye))return{location:ne,value:ye};const ge=oe(Y);if(ge===void 0)return;if(ge.kind===J.Custom){Zt(Y.kind===J.Custom);const st=(we=ge.onPaste)==null?void 0:we.call(ge,me,Y.data);return st===void 0?void 0:{location:ne,value:{...Y,data:st}}}else{const st=(je=ge.onPaste)==null?void 0:je.call(ge,me,Y,{formatted:ee,formattedString:typeof ee=="string"?ee:ee==null?void 0:ee.join(` -`),rawValue:ce});return st===void 0?void 0:(Zt(st.kind===Y.kind),{location:ne,value:st})}}}const b=z.columns,I=z.rows,F=((L=u.current)==null?void 0:L.contains(document.activeElement))===!0||(($=s.current)==null?void 0:$.contains(document.activeElement))===!0;let N;if(z.current!==void 0?N=[z.current.range.x,z.current.range.y]:b.length===1?N=[b.first()??0,0]:I.length===1&&(N=[H,I.first()??0]),F&&N!==void 0){let Y,ne;const ce="text/plain",ee="text/html";if(navigator.clipboard.read!==void 0){const ye=await navigator.clipboard.read();for(const ge of ye){if(ge.types.includes(ee)){const Pt=await(await ge.getType(ee)).text(),xt=el(Pt);if(xt!==void 0){Y=xt;break}}ge.types.includes(ce)&&(ne=await(await ge.getType(ce)).text())}}else if(navigator.clipboard.readText!==void 0)ne=await navigator.clipboard.readText();else if(d!==void 0&&(d==null?void 0:d.clipboardData)!==null){if(d.clipboardData.types.includes(ee)){const ye=d.clipboardData.getData(ee);Y=el(ye)}Y===void 0&&d.clipboardData.types.includes(ce)&&(ne=d.clipboardData.getData(ce))}else return;const[me,we]=N,je=[];do{if(j===void 0){const ye=qt(N),ge=ne??(Y==null?void 0:Y.map(Pt=>Pt.map(xt=>xt.rawValue).join(" ")).join(" "))??"",st=p(ye,N,ge,void 0);st!==void 0&&je.push(st);break}if(Y===void 0){if(ne===void 0)return;Y=Yc(ne)}if(j===!1||typeof j=="function"&&(j==null?void 0:j([N[0]-H,N[1]],Y.map(ye=>ye.map(ge=>{var st;return((st=ge.rawValue)==null?void 0:st.toString())??""}))))!==!0)return;for(const[ye,ge]of Y.entries()){if(ye+we>=v)break;for(const[st,Pt]of ge.entries()){const xt=[st+me,ye+we],[hn,vn]=xt;if(hn>=Ae.length||vn>=zt)continue;const gn=qt(xt),Cn=p(gn,xt,Pt.rawValue,Pt.formatted);Cn!==void 0&&je.push(Cn)}}}while(!1);on(je),(_=Yt.current)==null||_.damage(je.map(ye=>({cell:ye.location})))}},[R,oe,qt,z,cn.paste,Ae.length,on,zt,j,H,v]);Lt("paste",Vr,m,!1,!0);const Po=l.useCallback(async(d,p)=>{var L,$;if(!cn.copy)return;const b=p===!0||((L=u.current)==null?void 0:L.contains(document.activeElement))===!0||(($=s.current)==null?void 0:$.contains(document.activeElement))===!0,I=z.columns,F=z.rows,N=(_,Y)=>{if(!Te)nl(_,Y,d);else{const ne=Y.map(ce=>({kind:J.Text,data:C[ce].title,displayData:C[ce].title,allowOverlay:!1}));nl([ne,..._],Y,d)}};if(b&&Et!==void 0){if(z.current!==void 0){let _=Et(z.current.range,At.current.signal);typeof _!="object"&&(_=await _()),N(_,Zn(z.current.range.x-H,z.current.range.x+z.current.range.width-H))}else if(F!==void 0&&F.length>0){const Y=[...F].map(ne=>{const ce=Et({x:H,y:ne,width:C.length,height:1},At.current.signal);return typeof ce=="object"?ce[0]:ce().then(ee=>ee[0])});if(Y.some(ne=>ne instanceof Promise)){const ne=await Promise.all(Y);N(ne,Zn(C.length))}else N(Y,Zn(C.length))}else if(I.length>0){const _=[],Y=[];for(const ne of I){let ce=Et({x:ne,y:0,width:1,height:v},At.current.signal);typeof ce!="object"&&(ce=await ce()),_.push(ce),Y.push(ne-H)}if(_.length===1)N(_[0],Y);else{const ne=_.reduce((ce,ee)=>ce.map((me,we)=>[...me,...ee[we]]));N(ne,Y)}}}},[C,Et,z,cn.copy,H,v,Te]);Lt("copy",Po,m,!1,!1);const ts=l.useCallback(async d=>{var b,I;if(!(!cn.cut||!(((b=u.current)==null?void 0:b.contains(document.activeElement))===!0||((I=s.current)==null?void 0:I.contains(document.activeElement))===!0))&&(await Po(d),z.current!==void 0)){let F={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:ot.empty(),columns:ot.empty()};const N=x==null?void 0:x(F);if(N===!1||(F=N===!0?F:N,F.current===void 0))return;qn(F.current.range)}},[qn,z,cn.cut,Po,x]);Lt("cut",ts,m,!1,!1);const ns=l.useCallback((d,p)=>{if(U!==void 0){H!==0&&(d=d.map(F=>[F[0]-H,F[1]])),U(d,p);return}if(d.length===0||p===-1)return;const[b,I]=d[p];w.current!==void 0&&w.current[0]===b&&w.current[1]===I||(w.current=[b,I],Bn(b,I,!1,!1))},[U,H,Bn]),[cr,dr]=((Hi=ut==null?void 0:ut.current)==null?void 0:Hi.cell)??[],ur=l.useRef(kt);ur.current=kt,l.useLayoutEffect(()=>{var d,p,b,I;!Qe.current&&cr!==void 0&&dr!==void 0&&(cr!==((p=(d=zn.current)==null?void 0:d.current)==null?void 0:p.cell[0])||dr!==((I=(b=zn.current)==null?void 0:b.current)==null?void 0:I.cell[1]))&&ur.current(cr,dr),Qe.current=!1},[cr,dr]);const Ei=z.current!==void 0&&(z.current.cell[0]>=Ae.length||z.current.cell[1]>=zt);l.useLayoutEffect(()=>{Ei&&Xt(yr,!1)},[Ei,Xt]);const os=l.useMemo(()=>gt===!0&&(Ne==null?void 0:Ne.tint)===!0?ot.fromSingleSelection(zt-1):ot.empty(),[zt,gt,Ne==null?void 0:Ne.tint]),rs=l.useCallback(d=>typeof Dt=="boolean"?Dt:(Dt==null?void 0:Dt(d-H))??!0,[H,Dt]),is=l.useMemo(()=>{if(Nr===void 0||s.current===null)return null;const{bounds:d,group:p}=Nr,b=s.current.getBoundingClientRect();return l.createElement(Hc,{bounds:d,group:p,canvasBounds:b,onClose:()=>Xr(void 0),onFinish:I=>{Xr(void 0),se==null||se(p,I)}})},[se,Nr]),ls=Math.min(Ae.length,Oe+(_t?1:0));l.useImperativeHandle(t,()=>({appendRow:(d,p)=>ho(d+H,p),updateCells:d=>{var p;return H!==0&&(d=d.map(b=>({cell:[b.cell[0]+H,b.cell[1]]}))),(p=Yt.current)==null?void 0:p.damage(d)},getBounds:(d,p)=>{var b;if(!((s==null?void 0:s.current)===null||(u==null?void 0:u.current)===null)){if(d===void 0&&p===void 0){const I=s.current.getBoundingClientRect(),F=I.width/u.current.clientWidth;return{x:I.x-u.current.scrollLeft*F,y:I.y-u.current.scrollTop*F,width:u.current.scrollWidth*F,height:u.current.scrollHeight*F}}return(b=Yt.current)==null?void 0:b.getBounds((d??0)+H,p)}},focus:()=>{var d;return(d=Yt.current)==null?void 0:d.focus()},emit:async d=>{switch(d){case"delete":zo({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":zo({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":zo({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 Po(void 0,!0);break;case"paste":await Vr();break}},scrollTo:kt,remeasureColumns:d=>{for(const p of d)ar(p+H)}}),[ho,ar,Po,zo,Vr,H,kt]);const[Di,Ii]=pn??[],ss=l.useCallback(d=>{const[p,b]=d;if(b===-1){ae!=="none"&&(q(ot.fromSingleSelection(p),void 0,!1),Nt());return}Di===p&&Ii===b||(K({cell:d,range:{x:p,y:b,width:1,height:1}},!0,!1,"keyboard-nav"),kt(p,b))},[ae,Nt,kt,Di,Ii,K,q]),[as,cs]=l.useState(!1),Fi=l.useRef(cl(d=>{cs(d)},5)),ds=l.useCallback(()=>{Fi.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&c===void 0&&K({cell:[H,rr],range:{x:H,y:rr,width:1,height:1}},!0,!1,"keyboard-select")},[rr,z,c,H,K]),us=l.useCallback(()=>{Fi.current(!1)},[]),[fs,hs]=l.useMemo(()=>{let d;const p=(ht==null?void 0:ht.scrollbarWidthOverride)??ri(),b=v+(gt?1:0);if(typeof $t=="number")d=Ie+b*$t;else{let F=0;const N=Math.min(b,10);for(let L=0;LN.width+F,0)+p;return[`${Math.min(1e5,I)}px`,`${Math.min(1e5,d)}px`]},[Ae,ht==null?void 0:ht.scrollbarWidthOverride,$t,v,gt,Ie]),gs=l.useMemo(()=>la(G),[G]);return l.createElement(Rl.Provider,{value:G},l.createElement(Vc,{style:gs,className:fe,inWidth:k??fs,inHeight:M??hs},l.createElement(Dc,{fillHandle:dt,drawFocusRing:It,experimental:ht,fixedShadowX:Go,fixedShadowY:Tn,getRowThemeOverride:h,headerIcons:Rn,imageWindowLoader:En,initialSize:eo,isDraggable:qo,onDragLeave:jo,onRowMoved:yn,overscrollX:Hr,overscrollY:nr,preventDiagonalScrolling:oo,rightElement:Kn,rightElementProps:Hn,smoothScrollX:Jo,smoothScrollY:Dr,className:fe,enableGroups:nt,onCanvasFocused:ds,onCanvasBlur:us,canvasRef:s,onContextMenu:es,theme:G,cellXOffset:_n,cellYOffset:rr,accessibilityHeight:Ct.height,onDragEnd:jl,columns:Ae,nonGrowWidth:he,drawHeader:Pr,onColumnProposeMove:E,drawCell:Br,disabledRows:os,freezeColumns:ls,lockColumns:H,firstColAccessible:H===0,getCellContent:qt,minColumnWidth:Ut,maxColumnWidth:an,searchInputRef:a,showSearch:Io,onSearchClose:Ar,highlightRegions:Nl,getCellsForSelection:Et,getGroupDetails:Wr,headerHeight:so,isFocused:as,groupHeaderHeight:nt?Do:0,freezeTrailingRows:Ge+(gt&&(Ne==null?void 0:Ne.sticky)===!0?1:0),hasAppendRow:gt,onColumnResize:dn,onColumnResizeEnd:zr,onColumnResizeStart:co,onCellFocused:ss,onColumnMoved:Gl,onDragStart:ql,onHeaderMenuClick:_l,onItemHovered:_r,isFilling:(c==null?void 0:c.fillHandle)===!0,onMouseMove:Ul,onKeyDown:zo,onKeyUp:Ze,onMouseDown:Xl,onMouseUp:Kl,onDragOverCell:sn,onDrop:Ye,onSearchResultsChanged:ns,onVisibleRegionChanged:Vl,clientSize:ie,rowHeight:$t,searchResults:pe,searchValue:xe,onSearchValueChange:ke,rows:zt,scrollRef:u,selection:z,translateX:Ct.tx,translateY:Ct.ty,verticalBorder:rs,gridRef:Yt,getCellRenderer:oe}),is,r!==void 0&&l.createElement(l.Suspense,{fallback:null},l.createElement(Qc,{...r,validateCell:Fo,bloom:D,id:Ql,getCellRenderer:oe,className:(ht==null?void 0:ht.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:ct,imageEditorOverride:g,onFinishEditing:Jl,markdownDivCreateNode:y,isOutsideClick:Qo}))))},od=l.forwardRef(nd),il=20,rd={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=>id(e,e.cell.data,oi(e.cell),e.cell.maxSize??il),onDelete:e=>({...e,data:!1}),onClick:e=>{const{cell:t,posX:n,posY:o,bounds:r,theme:i}=e,{width:a,height:s,x:c,y:f}=r,u=t.maxSize??il,w=Math.floor(r.y+s/2),m=hl(u,s,i.cellVerticalPadding),g=fl(t.contentAlign??"center",c,a,i.cellHorizontalPadding,m),h=ul(g,w,m),y=gl(c+n,f+o,h);if(oi(t)&&y)return{...t,data:$l(t.data)}},onPaste:(e,t)=>{let n=pr;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=ci),n===t.data?void 0:{...t,data:n}}};function id(e,t,n,o){if(!n&&t===pr)return;const{ctx:r,hoverAmount:i,theme:a,rect:s,highlighted:c,hoverX:f,hoverY:u,cell:{contentAlign:w}}=e,{x:m,y:g,width:h,height:y}=s,k=.35;let M=n?1-k+k*i:.4;t===pr&&(M*=i),M!==0&&(r.globalAlpha=M,mi(r,a,t,m,g,h,y,c,f,u,o,w),r.globalAlpha=1)}const ld=Qt("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),sd=e=>{const{bubbles:t}=e;return l.createElement(ld,null,t.map((n,o)=>l.createElement("div",{key:o,className:"boe-bubble"},n)),l.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ad=sd,cd={getAccessibilityString:e=>ml(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=>ud(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return l.createElement(ad,{bubbles:t.data})},onPaste:()=>{}},dd=4;function ud(e,t){const{rect:n,theme:o,ctx:r,highlighted:i}=e,{x:a,y:s,width:c,height:f}=n,u=20,w=8,m=dd;let g=a+o.cellHorizontalPadding;const h=[];for(const y of t){if(g>a+c)break;const k=_o(y,r,o.baseFontFull).width;h.push({x:g,width:k}),g+=k+w*2+m}r.beginPath();for(const y of h)xn(r,y.x,s+(f-u)/2,y.width+w*2,u,o.roundingRadius??u/2);r.fillStyle=i?o.bgBubbleSelected:o.bgBubble,r.fill();for(const[y,k]of h.entries())r.beginPath(),r.fillStyle=o.textBubble,r.fillText(t[y],k.x+w,s+f/2+Xn(r,o))}const fd=Qt("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),hd=e=>{const{drilldowns:t}=e;return l.createElement(fd,null,t.map((n,o)=>l.createElement("div",{key:o,className:"doe-bubble"},n.img!==void 0&&l.createElement("img",{src:n.img}),l.createElement("div",null,n.text))))},gd=hd,md={getAccessibilityString:e=>ml(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=>bd(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return l.createElement(gd,{drilldowns:t.data})},onPaste:()=>{}},wd=4,ei={};function yd(e,t,n,o){const r=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,s=4,c=n*r,f=o+i,u=o*3,w=(u+i*2)*r,m=`${e},${t},${r},${n}`;if(ei[m]!==void 0)return{el:ei[m],height:c,width:w,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=w,g.height=c,h.scale(r,r),ei[m]=g,h.beginPath(),xn(h,i,i,u,a,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(),xn(h,i+.5,i+.5,u,a,o),h.strokeStyle=t,h.lineWidth=1,h.stroke(),{el:g,height:c,width:w,sideWidth:f*r,middleWidth:o*r,padding:i*r,dpr:r})}function bd(e,t){const{rect:n,theme:o,ctx:r,imageLoader:i,col:a,row:s}=e,{x:c,width:f}=n,u=o.baseFontFull,w=Cl(r,u),m=Math.min(n.height,Math.max(16,Math.ceil(w*o.lineHeight)*2)),g=Math.floor(n.y+(n.height-m)/2),h=m-10,y=8,k=wd;let M=c+o.cellHorizontalPadding;const C=o.roundingRadius??6,v=yd(o.bgCell,o.drilldownBorder,m,C),A=[];for(const P of t){if(M>c+f)break;const T=_o(P.text,r,u).width;let X=0;P.img!==void 0&&i.loadOrGetImage(P.img,a,s)!==void 0&&(X=h-8+4);const R=T+X+y*2;A.push({x:M,width:R}),M+=R+k}if(v!==null){const{el:P,height:O,middleWidth:T,sideWidth:X,width:R,dpr:W,padding:B}=v,D=X/W,S=B/W;for(const E of A){const Z=Math.floor(E.x),te=Math.floor(E.width),le=te-(D-S)*2;r.imageSmoothingEnabled=!1,r.drawImage(P,0,0,X,O,Z-S,g,D,m),le>0&&r.drawImage(P,X,0,T,O,Z+(D-S),g,le,m),r.drawImage(P,R-X,0,X,O,Z+te-(D-S),g,D,m),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[P,O]of A.entries()){const T=t[P];let X=O.x+y;if(T.img!==void 0){const R=i.loadOrGetImage(T.img,a,s);if(R!==void 0){const W=h-8;let B=0,D=0,S=R.width,E=R.height;S>E?(B+=(S-E)/2,S=E):E>S&&(D+=(E-S)/2,E=S),r.beginPath(),xn(r,X,g+m/2-W/2,W,W,o.roundingRadius??3),r.save(),r.clip(),r.drawImage(R,B,D,S,E,X,g+m/2-W/2,W,W),r.restore(),X+=W+4}}r.beginPath(),r.fillStyle=o.textBubble,r.fillText(T.text,X,g+m/2+Xn(r,o))}}const pd={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>vd(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??Bs;return l.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}}},ti=4;function vd(e,t,n,o){const{rect:r,col:i,row:a,theme:s,ctx:c,imageLoader:f}=e,{x:u,y:w,height:m,width:g}=r,h=m-s.cellVerticalPadding*2,y=[];let k=0;for(let C=0;C0&&(c.beginPath(),xn(c,M,w+s.cellVerticalPadding,v,h,n),c.save(),c.clip()),c.drawImage(C,M,w+s.cellVerticalPadding,v,h),n>0&&c.restore(),M+=v+ti}}function Cd(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kd={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:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Cd(n,o)*t.skeletonWidthVariability));const c=a.cellHorizontalPadding,f=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);xn(r,i.x+c,i.y+(i.height-f)/2,s,f,a.roundingRadius??3),r.fillStyle=Jn(a.textDark,.1),r.fill()},onPaste:()=>{}},xd=()=>e=>e.targetWidth,ll=Qt("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[xd(),"px"]}}),Sd=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:r,targetRect:i,onFinish:a,validatedSelection:s}=e,c=t.data,f=t.readonly===!0,[u,w]=l.useState(c===""||o),m=l.useCallback(()=>{w(h=>!h)},[]),g=c?"gdg-ml-6":"";return u?l.createElement(ll,{targetWidth:i.width-20},l.createElement(Mr,{autoFocus:!0,highlight:!1,validatedSelection:s,value:c,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},onChange:n}),l.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>a(t)},l.createElement(Fs,null))):l.createElement(ll,{targetWidth:i.width},l.createElement(Ws,{contents:c,createNode:r}),!f&&l.createElement(l.Fragment,null,l.createElement("div",{className:"spacer"}),l.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:m},l.createElement(di,null))),l.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Md={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Vo,measure:(e,t,n)=>{const o=t.data.split(` -`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>kn(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:a,validatedSelection:s}=e;return l.createElement(Sd,{onFinish:r,targetRect:o,value:n,validatedSelection:s,onChange:c=>t({...n,data:c.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Rd={getAccessibilityString:e=>e.row.toString(),kind:ln.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Ed,measure:()=>44,draw:e=>Id(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:a}=t,s=n.drawHandle?7+(i-7)/2:i/2,c=a/2;if(Math.abs(o-s)<=10&&Math.abs(r-c)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Ed(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=Dd,n.textAlign="center",i}function Dd(e){const{ctx:t}=e;t.textAlign="start"}function Id(e,t,n,o,r,i){const{ctx:a,rect:s,hoverAmount:c,theme:f}=e,{x:u,y:w,width:m,height:g}=s,h=n?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&h>0){a.globalAlpha=h;const y=7*(n?c:1);if(mi(a,f,n,r?u+y:u,w,r?m-y:m,g,!0,void 0,void 0,18,"center",i),r){a.globalAlpha=c,a.beginPath();for(const k of[3,6])for(const M of[-5,-1,3])a.rect(u+k,w+g/2+M,2,2);a.fillStyle=f.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!n){const y=t.toString(),k=f.markerFontFull,M=u+m/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=f.textLight,a.font=k,a.fillText(y,M,w+g/2+Xn(a,k)),c!==0&&(a.globalAlpha=1)}}const Fd={getAccessibilityString:()=>"",kind:ln.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Td(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Td(e,t,n){const{ctx:o,rect:r,hoverAmount:i,theme:a,spriteManager:s}=e,{x:c,y:f,width:u,height:w}=r;o.beginPath(),o.globalAlpha=i,o.rect(c+1,f+1,u,w-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let g=0;if(n!==void 0){const y=w-8,k=c+8/2,M=f+8/2;s.drawSprite(n,"normal",o,k,M,y,a,m?1:i),g=y}else{g=24;const h=12,y=m?h:i*h,k=m?0:(1-i)*h*.5,M=a.cellHorizontalPadding+4;y>0&&(o.moveTo(c+M+k,f+w/2),o.lineTo(c+M+k+y,f+w/2),o.moveTo(c+M+k+y*.5,f+w/2-y*.5),o.lineTo(c+M+k+y*.5,f+w/2+y*.5),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(t,g+c+a.cellHorizontalPadding+.5,f+w/2+Xn(o,a)),o.beginPath()}const Hd=l.lazy(async()=>await al(()=>import("./number-overlay-editor-3ljU3NGx.js"),__vite__mapDeps([8,1,3,9]),import.meta.url)),Ld={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:J.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:Vo,draw:e=>kn(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 l.createElement(l.Suspense,{fallback:null},l.createElement(Hd,{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}}},Ad={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:zd,onPaste:()=>{}};function zd(e){const{ctx:t,theme:n,rect:o}=e,{x:r,y:i,height:a}=o;t.beginPath();const s=2.5;let c=r+n.cellHorizontalPadding+s;const f=i+a/2,u=Math.cos(Oi(30))*s,w=Math.sin(Oi(30))*s;for(let m=0;m<12;m++)t.moveTo(c,f-s),t.lineTo(c,f+s),t.moveTo(c+u,f-w),t.lineTo(c-u,f+w),t.moveTo(c-u,f-w),t.lineTo(c+u,f+w),c+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Pd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Vo(e,t,e.theme.textLight),draw:e=>kn(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 Bt.createElement(Mr,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:r,onChange:i=>n({...o,data:i.target.value})})},onPaste:()=>{}},Bd={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Vo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:o,ctx:r,rect:i,theme:a,overrideCursor:s}=e,{displayData:c,contentAlign:f,hoverEffect:u,allowWrapping:w}=t;if(u===!0&&n>0){r.textBaseline="alphabetic";const m=a.cellHorizontalPadding,g=a.cellVerticalPadding,h=_o(c,r,a.baseFontFull,"alphabetic"),y=i.height-g,k=Math.min(y,h.actualBoundingBoxAscent*2.5);r.beginPath(),xn(r,i.x+m/2,i.y+(i.height-k)/2+1,h.width+m*3,k-1,a.roundingRadius??4),r.globalAlpha=n,r.fillStyle=Jn(a.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=a.textDark,r.textBaseline="middle",s==null||s("text")}kn(e,c,f,w,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 l.createElement(Mr,{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:a=>o({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Od=Qt("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Wd=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:r,validatedSelection:i,preview:a}=e,[s,c]=l.useState(!r&&(t===""||o)),f=l.useCallback(()=>{c(!0)},[]);return s?l.createElement(Mr,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):l.createElement(Od,null,l.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&l.createElement("div",{className:"gdg-edit-icon",onClick:f},l.createElement(di,null)),l.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},$d=Wd;function sl(e,t,n,o){let r=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return o==="right"?r=t.width-a-n.cellHorizontalPadding:o==="center"&&(r=t.width/2-a/2),{x:r,y:i,width:a,height:s}}const Nd={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:Vo,draw:e=>{const{cell:t,theme:n,overrideCursor:o,hoverX:r,hoverY:i,rect:a,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=_o(c,s,n.baseFontFull),w=sl(u,a,n,t.contentAlign),{x:m,y:g,width:h,height:y}=w;if(r>=m-4&&r<=m-4+h+8&&i>=g-4&&i<=g-4+y+8){const k=Xn(s,n.baseFontFull);o("pointer");const M=5,C=g-k;s.beginPath(),s.moveTo(a.x+m,Math.floor(a.y+C+y+M)+.5),s.lineTo(a.x+m+h,Math.floor(a.y+C+y+M)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,kn({...e,rect:{...a,x:a.x-1}},c,t.contentAlign),kn({...e,rect:{...a,x:a.x-2}},c,t.contentAlign),kn({...e,rect:{...a,x:a.x+1}},c,t.contentAlign),kn({...e,rect:{...a,x:a.x+2}},c,t.contentAlign),s.restore()}}s.fillStyle=f?n.linkColor:n.textDark,kn(e,c,t.contentAlign)},onClick:e=>{const{cell:t,bounds:n,posX:o,posY:r,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;const s=Js(a,i.baseFontFull);if(s===void 0)return;const c=sl(s,n,i,t.contentAlign);Er({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 l.createElement($d,{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:a=>n({...o,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Xd=[Rd,Fd,rd,cd,md,pd,kd,Md,Ld,Ad,Pd,Bd,Nd],ni=[];class Yd extends xl{constructor(){super(...arguments);We(this,"imageLoaded",()=>{});We(this,"loadedLocations",[]);We(this,"cache",{});We(this,"sendLoaded",ks(()=>{this.imageLoaded(new Yo(this.loadedLocations)),this.loadedLocations=[]},20));We(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const o of n){const r=this.cache[o];let i=!1;for(let a=0;a{c||(c=!0,ni.length<12?ni.unshift(s):a||(s.src=""))}},u=new Promise(w=>s.addEventListener("load",()=>w(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,await s.decode();const w=this.cache[i];if(w!==void 0&&!c){w.img=s;for(const m of w.cells)this.loadedLocations.push(gi(m));a=!0,this.sendLoaded()}}catch{f.cancel()}}),this.cache[i]=f}loadOrGetImage(n,o,r){const i=n,a=this.cache[i];if(a!==void 0){const s=wn(o,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,o,r,i)}}const Kd=Yd,Ud=(e,t)=>{const n=l.useMemo(()=>({...Ba,...e.headerIcons}),[e.headerIcons]),o=l.useMemo(()=>e.imageWindowLoader??new Kd,[e.imageWindowLoader]);return l.createElement(od,{...e,renderers:Xd,headerIcons:n,ref:t,imageWindowLoader:o})},ou=l.forwardRef(Ud);export{Ic as C,ou as D,J as G,Rl as T,Mr as a,Jt as b,eu as c,tu as d,Jd as e,po as f,Xn as g,zi as h,Qd as i,vo as j,Rs as k,la as l,_o as m,xo as p,xn as r,nu as u}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./data-grid-overlay-editor-6WKZfUKe.js","./index-BMVQvedj.js","./index-wocATsGp.js","./marked.esm-dbrxtycE.js","./iframe-ni8xiI1Q.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-repros.stories-7gn6IQHd.js b/docs/assets/data-editor-repros.stories-IduWsXDK.js similarity index 90% rename from docs/assets/data-editor-repros.stories-7gn6IQHd.js rename to docs/assets/data-editor-repros.stories-IduWsXDK.js index 788658414..a993425f2 100644 --- a/docs/assets/data-editor-repros.stories-7gn6IQHd.js +++ b/docs/assets/data-editor-repros.stories-IduWsXDK.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-hgJATaim.js";import{D as g}from"./data-editor-all-ATY7qU3b.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{B as f}from"./story-utils-K2EZnGjM.js";import{G as p}from"./image-window-loader-h6lJQmfV.js";import{D as g}from"./data-editor-all-Orvb2jqb.js";import"./index-BMVQvedj.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-2CxcBwGP.js b/docs/assets/data-editor.stories-qEwXLFDq.js similarity index 99% rename from docs/assets/data-editor.stories-2CxcBwGP.js rename to docs/assets/data-editor.stories-qEwXLFDq.js index 3471ca35a..2ba842ccf 100644 --- a/docs/assets/data-editor.stories-2CxcBwGP.js +++ b/docs/assets/data-editor.stories-qEwXLFDq.js @@ -1,4 +1,4 @@ -import{j as a}from"./marked.esm-dbrxtycE.js";import{B as Me}from"./story-utils-K2EZnGjM.js";import{C,G as i}from"./image-window-loader-hgJATaim.js";import{D as c}from"./data-editor-all-ATY7qU3b.js";import"./index-BMVQvedj.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{B as Me}from"./story-utils-K2EZnGjM.js";import{C,G as i}from"./image-window-loader-h6lJQmfV.js";import{D as c}from"./data-editor-all-Orvb2jqb.js";import"./index-BMVQvedj.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-hmiBYkvZ.js b/docs/assets/data-grid-overlay-editor-XTO4-8W8.js similarity index 93% rename from docs/assets/data-grid-overlay-editor-hmiBYkvZ.js rename to docs/assets/data-grid-overlay-editor-XTO4-8W8.js index 3a7e0aa8e..20b7ee7dd 100644 --- a/docs/assets/data-grid-overlay-editor-hmiBYkvZ.js +++ b/docs/assets/data-grid-overlay-editor-XTO4-8W8.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-ATY7qU3b.js";import{E as P,s as U,F as Z,T as ee,M as te}from"./image-window-loader-hgJATaim.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{E as P,s as U,F as Z,T as ee,M as te}from"./image-window-loader-h6lJQmfV.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-6WKZfUKe.js b/docs/assets/data-grid-overlay-editor-Z83AvWlM.js similarity index 96% rename from docs/assets/data-grid-overlay-editor-6WKZfUKe.js rename to docs/assets/data-grid-overlay-editor-Z83AvWlM.js index 790c536a6..71387b8bc 100644 --- a/docs/assets/data-grid-overlay-editor-6WKZfUKe.js +++ b/docs/assets/data-grid-overlay-editor-Z83AvWlM.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-ligl_Vjz.js";import{s as ee}from"./marked.esm-dbrxtycE.js";import"./iframe-ni8xiI1Q.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-85iGweFr.js";import{s as ee}from"./marked.esm-dbrxtycE.js";import"./iframe-t8ayfGqb.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-eVyCbotC.js b/docs/assets/data-grid.stories-7ldlZ5Fw.js similarity index 61% rename from docs/assets/data-grid.stories-eVyCbotC.js rename to docs/assets/data-grid.stories-7ldlZ5Fw.js index dbe8c2306..02df4bb3c 100644 --- a/docs/assets/data-grid.stories-eVyCbotC.js +++ b/docs/assets/data-grid.stories-7ldlZ5Fw.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 z}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 Y}from"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";const B={title:"Subcomponents/DataGrid",decorators:[n=>i("div",{children:i(z,{width:1800,height:1e3,children:i("div",{style:{position:"relative"},children:i(n,{})})})})]},A={columns:d.empty(),rows:d.empty(),current:void 0},w=n=>{if(n.kind!==r.Custom)return Y.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(b=>b+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,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:void 0,isFocused:!0,cellYOffset:e,isFilling:!1,onMouseMove:()=>{},groupHeaderHeight:0,accessibilityHeight:50,enableGroups:!1,selection:A,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())})}function s(){let n=0;return i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,isFocused:!0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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:void 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,resizeColumn:void 0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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,drawFocusRing:void 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,resizeColumn:void 0,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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:void 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 z}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 Y}from"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";const B={title:"Subcomponents/DataGrid",decorators:[n=>i("div",{children:i(z,{width:1800,height:1e3,children:i("div",{style:{position:"relative"},children:i(n,{})})})})]},A={columns:d.empty(),rows:d.empty(),current:void 0},w=n=>{if(n.kind!==r.Custom)return Y.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(b=>b+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,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:A,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())})}function s(){let n=0;return i(g,{getCellRenderer:w,width:1800,height:1e3,cellXOffset:0,isFocused:!0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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,resizeColumn:void 0,drawHeader:void 0,drawCell:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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,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,resizeColumn:void 0,drawHeader:void 0,experimental:void 0,headerIcons:void 0,isDraggable:void 0,onCanvasBlur:()=>{},onCanvasFocused:()=>{},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(() => { @@ -10,7 +10,7 @@ import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj cb(); return () => window.cancelAnimationFrame(handle); }, []); - return undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} resizeColumn={undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={undefined} isFocused={true} cellYOffset={y} isFilling={false} onMouseMove={() => undefined} groupHeaderHeight={0} accessibilityHeight={50} enableGroups={false} selection={emptyGridSelection} rows={100_000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven"].map(t => ({ + return undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} resizeColumn={undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={true} isFocused={true} cellYOffset={y} isFilling={false} onMouseMove={() => undefined} groupHeaderHeight={0} accessibilityHeight={50} enableGroups={false} selection={emptyGridSelection} rows={100_000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven"].map(t => ({ title: t, width: 122 + (x += 10) }))} getCellContent={([col, row]) => ({ @@ -22,7 +22,7 @@ import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj })} freezeColumns={0} firstColAccessible={true} verticalBorder={() => true} freezeTrailingRows={0} hasAppendRow={false} isResizing={false} isDragging={false} theme={mergeAndRealizeTheme(getDataEditorTheme())} />; }`,...(R=(C=l.parameters)==null?void 0:C.docs)==null?void 0:R.source}}};var D,S,T;s.parameters={...s.parameters,docs:{...(D=s.parameters)==null?void 0:D.docs,source:{originalSource:`function SelectedCellnotest() { let x = 0; - return undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} resizeColumn={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={undefined} onMouseMove={() => undefined} accessibilityHeight={50} isFilling={false} cellYOffset={0} groupHeaderHeight={34} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ + return undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} resizeColumn={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={true} onMouseMove={() => undefined} accessibilityHeight={50} isFilling={false} cellYOffset={0} groupHeaderHeight={34} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ title: t, width: 122 + (x += 10) }))} getCellContent={([col, row]) => ({ @@ -47,7 +47,7 @@ import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj }} freezeColumns={0} firstColAccessible={true} verticalBorder={() => true} freezeTrailingRows={0} hasAppendRow={false} isResizing={false} isDragging={false} theme={mergeAndRealizeTheme(getDataEditorTheme())} />; }`,...(T=(S=s.parameters)==null?void 0:S.docs)==null?void 0:T.source}}};var y,H,x;u.parameters={...u.parameters,docs:{...(y=u.parameters)==null?void 0:y.docs,source:{originalSource:`function SelectedRownotest() { let x = 0; - return undefined} width={1800} height={1000} cellXOffset={0} cellYOffset={0} isFocused={true} resizeColumn={undefined} drawHeader={undefined} drawCell={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={undefined} groupHeaderHeight={34} accessibilityHeight={50} isFilling={false} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ + return undefined} width={1800} height={1000} cellXOffset={0} cellYOffset={0} isFocused={true} resizeColumn={undefined} drawHeader={undefined} drawCell={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawFocusRing={true} groupHeaderHeight={34} accessibilityHeight={50} isFilling={false} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ title: t, width: 122 + (x += 10) }))} getCellContent={([col, row]) => ({ @@ -63,7 +63,7 @@ import{j as i}from"./marked.esm-dbrxtycE.js";import{r as m}from"./index-BMVQvedj }} freezeColumns={0} firstColAccessible={true} verticalBorder={() => true} freezeTrailingRows={0} hasAppendRow={false} isResizing={false} isDragging={false} theme={mergeAndRealizeTheme(getDataEditorTheme())} />; }`,...(x=(H=u.parameters)==null?void 0:H.docs)==null?void 0:x.source}}};var M,F,O;f.parameters={...f.parameters,docs:{...(M=f.parameters)==null?void 0:M.docs,source:{originalSource:`() => { let x = 0; - return undefined} width={1800} height={1000} cellXOffset={0} cellYOffset={0} isFocused={true} resizeColumn={undefined} drawHeader={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawCell={undefined} drawFocusRing={undefined} accessibilityHeight={50} isFilling={false} groupHeaderHeight={34} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ + return undefined} width={1800} height={1000} cellXOffset={0} cellYOffset={0} isFocused={true} resizeColumn={undefined} drawHeader={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseMoveRaw={() => undefined} onMouseUp={() => undefined} smoothScrollX={undefined} smoothScrollY={undefined} allowResize={undefined} canvasRef={undefined} disabledRows={undefined} eventTargetRef={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} translateX={undefined} translateY={undefined} dragAndDropState={undefined} drawCell={undefined} drawFocusRing={true} accessibilityHeight={50} isFilling={false} groupHeaderHeight={34} enableGroups={false} rows={1000} headerHeight={44} rowHeight={34} columns={["One", "Two", "Three", "Four", "Five", "Six", "Seven"].map(t => ({ title: t, width: 122 + (x += 10) }))} getCellContent={([col, row]) => ({ diff --git a/docs/assets/drag-source.stories-y9Kk4moG.js b/docs/assets/drag-source.stories-FO027sy9.js similarity index 84% rename from docs/assets/drag-source.stories-y9Kk4moG.js rename to docs/assets/drag-source.stories-FO027sy9.js index 61a9b242e..c0dde3aac 100644 --- a/docs/assets/drag-source.stories-y9Kk4moG.js +++ b/docs/assets/drag-source.stories-FO027sy9.js @@ -1,4 +1,4 @@ -import{j as e,F as m,a as c}from"./marked.esm-dbrxtycE.js";import{D as g}from"./data-editor-all-ATY7qU3b.js";import{B as u,D,P as w,u as h,d as C}from"./utils-wFAOo4Dx.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as g}from"./data-editor-all-Orvb2jqb.js";import{B as u,D,P as w,u as h,d as C}from"./utils-H5nRE5Sr.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-1V8ATNN4.js b/docs/assets/drop-events.stories-OLQy2H3_.js similarity index 93% rename from docs/assets/drop-events.stories-1V8ATNN4.js rename to docs/assets/drop-events.stories-OLQy2H3_.js index 1e8e29bcc..92181220f 100644 --- a/docs/assets/drop-events.stories-1V8ATNN4.js +++ b/docs/assets/drop-events.stories-OLQy2H3_.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-ATY7qU3b.js";import{a as w,B as b,D as L,P as u,M as f,d as N}from"./utils-wFAOo4Dx.js";import{G as C}from"./image-window-loader-hgJATaim.js";import{S as U}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{a as w,B as b,D as L,P as u,M as f,d as N}from"./utils-H5nRE5Sr.js";import{G as C}from"./image-window-loader-h6lJQmfV.js";import{S as U}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-kTdp_BxJ.js b/docs/assets/fill-handle.stories-R8Mb-UAF.js similarity index 88% rename from docs/assets/fill-handle.stories-kTdp_BxJ.js rename to docs/assets/fill-handle.stories-R8Mb-UAF.js index 68420754c..41145e4f1 100644 --- a/docs/assets/fill-handle.stories-kTdp_BxJ.js +++ b/docs/assets/fill-handle.stories-R8Mb-UAF.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-ATY7qU3b.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-wFAOo4Dx.js";import{G as E}from"./image-window-loader-hgJATaim.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.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-H5nRE5Sr.js";import{G as E}from"./image-window-loader-h6lJQmfV.js";import{S as G}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-6fXtjWtB.js b/docs/assets/freeze-columns.stories-6fXtjWtB.js deleted file mode 100644 index b4aa23ab8..000000000 --- a/docs/assets/freeze-columns.stories-6fXtjWtB.js +++ /dev/null @@ -1,9 +0,0 @@ -import{j as r,a as i}from"./marked.esm-dbrxtycE.js";import{D as p}from"./data-editor-all-ATY7qU3b.js";import{B as c,D as u,P as d,u as C,d as f}from"./utils-wFAOo4Dx.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const S={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(z,{children:r(c,{title:"Freeze columns",description:i(u,{children:["Columns at the start of your grid can be frozen in place by settings"," ",r(d,{children:"freezeColumns"})," to a number greater than 0."]}),children:r(o,{})})})]},e=o=>{const{cols:n,getCellContent:m}=C(100);return r(p,{...f,rowMarkers:"both",freezeColumns:o.freezeColumns,getCellContent:m,columns:n,verticalBorder:l=>l>0,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 { - cols, - getCellContent - } = useMockDataGenerator(100); - return c > 0} rows={1000} />; -}`,...(a=(s=e.parameters)==null?void 0:s.docs)==null?void 0:a.source}}};const _=["FreezeColumns"];export{e as FreezeColumns,_ as __namedExportsOrder,S as default}; diff --git a/docs/assets/freeze-columns.stories-B7dXYLEM.js b/docs/assets/freeze-columns.stories-B7dXYLEM.js new file mode 100644 index 000000000..601fced5b --- /dev/null +++ b/docs/assets/freeze-columns.stories-B7dXYLEM.js @@ -0,0 +1,9 @@ +import{j as r,a as m}from"./marked.esm-dbrxtycE.js";import{D as i}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as c,P as u,u as d,d as f}from"./utils-H5nRE5Sr.js";import{S as C}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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 { + cols, + getCellContent + } = useMockDataGenerator(100); + return ; +}`,...(a=(s=e.parameters)==null?void 0:s.docs)==null?void 0:a.source}}};const S=["FreezeColumns"];export{e as FreezeColumns,S as __namedExportsOrder,F as default}; diff --git a/docs/assets/freeze-rows.stories-k8ddUtsm.js b/docs/assets/freeze-rows.stories-YpVq2nt-.js similarity index 88% rename from docs/assets/freeze-rows.stories-k8ddUtsm.js rename to docs/assets/freeze-rows.stories-YpVq2nt-.js index 93bbd2997..e10d17fbf 100644 --- a/docs/assets/freeze-rows.stories-k8ddUtsm.js +++ b/docs/assets/freeze-rows.stories-YpVq2nt-.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-ATY7qU3b.js";import{B as g,D as f,u as k,c as D,d as S}from"./utils-wFAOo4Dx.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as g,D as f,u as k,c as D,d as S}from"./utils-H5nRE5Sr.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-wJpRKly_.js b/docs/assets/header-menus.stories-IZNw2k3y.js similarity index 93% rename from docs/assets/header-menus.stories-wJpRKly_.js rename to docs/assets/header-menus.stories-IZNw2k3y.js index 8a54c33f6..394d5dd2b 100644 --- a/docs/assets/header-menus.stories-wJpRKly_.js +++ b/docs/assets/header-menus.stories-IZNw2k3y.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-ATY7qU3b.js";import{B as D,D as R,P as O,a as S,d as w}from"./utils-wFAOo4Dx.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>n(A,{children:n(D,{title:"Header menus",description:n(p,{children:l(R,{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(O,{children:"menuIcon"})," prop."]})}),children:n(r,{})})})]},P=y("div")({name:"SimpleMenu",class:"s7szcfi",propsAsIs:!1}),i=()=>{const{cols:r,getCellContent:h,onColumnResize:C,setCellValue:g}=S(),f=d.useMemo(()=>r.map((t,s)=>s===2?{...t,hasMenu:!0,menuIcon:"dots"}:s===3?{...t,hasMenu:!0,menuIcon:"headerUri"}:{...t,hasMenu:!0}),[r]),[e,o]=d.useState(),u=e!==void 0,{layerProps:b,renderLayer:M}=H({isOpen:u,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)})}}),k=d.useCallback((t,s)=>{o({col:t,bounds:s})},[]),v=d.useCallback(()=>{console.log("Header clicked")},[]);return l(p,{children:[n(x,{...w,getCellContent:h,onHeaderMenuClick:k,onHeaderClicked:v,columns:f,onCellContextMenu:(t,s)=>s.preventDefault(),onCellEdited:g,onColumnResize:C,rows:1e3}),u&&M(l(P,{...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 a,c,m;i.parameters={...i.parameters,docs:{...(a=i.parameters)==null?void 0:a.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-Orvb2jqb.js";import{B as D,D as R,P as O,a as S,d as w}from"./utils-H5nRE5Sr.js";import{S as A}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";const J={title:"Glide-Data-Grid/DataEditor Demos",decorators:[r=>n(A,{children:n(D,{title:"Header menus",description:n(p,{children:l(R,{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(O,{children:"menuIcon"})," prop."]})}),children:n(r,{})})})]},P=y("div")({name:"SimpleMenu",class:"s7szcfi",propsAsIs:!1}),i=()=>{const{cols:r,getCellContent:h,onColumnResize:C,setCellValue:g}=S(),f=d.useMemo(()=>r.map((t,s)=>s===2?{...t,hasMenu:!0,menuIcon:"dots"}:s===3?{...t,hasMenu:!0,menuIcon:"headerUri"}:{...t,hasMenu:!0}),[r]),[e,o]=d.useState(),u=e!==void 0,{layerProps:b,renderLayer:M}=H({isOpen:u,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)})}}),k=d.useCallback((t,s)=>{o({col:t,bounds:s})},[]),v=d.useCallback(()=>{console.log("Header clicked")},[]);return l(p,{children:[n(x,{...w,getCellContent:h,onHeaderMenuClick:k,onHeaderClicked:v,columns:f,onCellContextMenu:(t,s)=>s.preventDefault(),onCellEdited:g,onColumnResize:C,rows:1e3}),u&&M(l(P,{...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 a,c,m;i.parameters={...i.parameters,docs:{...(a=i.parameters)==null?void 0:a.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/highlight-cells.stories-EM1DcUH0.js b/docs/assets/highlight-cells.stories-d6Ld1nM7.js similarity index 87% rename from docs/assets/highlight-cells.stories-EM1DcUH0.js rename to docs/assets/highlight-cells.stories-d6Ld1nM7.js index f572edd53..4f5e0151d 100644 --- a/docs/assets/highlight-cells.stories-EM1DcUH0.js +++ b/docs/assets/highlight-cells.stories-d6Ld1nM7.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-ATY7qU3b.js";import{B as S,D as C,P as f,u as w,d as D}from"./utils-wFAOo4Dx.js";import{C as s}from"./image-window-loader-hgJATaim.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as S,D as C,P as f,u as w,d as D}from"./utils-H5nRE5Sr.js";import{C as s}from"./image-window-loader-h6lJQmfV.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-ni8xiI1Q.js b/docs/assets/iframe-t8ayfGqb.js similarity index 59% rename from docs/assets/iframe-ni8xiI1Q.js rename to docs/assets/iframe-t8ayfGqb.js index 04c5062d7..8eed3a36f 100644 --- a/docs/assets/iframe-ni8xiI1Q.js +++ b/docs/assets/iframe-t8ayfGqb.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-GoH1iMdu.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-7gn6IQHd.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-2CxcBwGP.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-Ag4SHQ4N.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-sZPVGmNg.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-_YRJ7oxT.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-BadlQizl.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-Btx91Jtk.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-sbm8KDYQ.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-uX8Serp5.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-UB7A1A-i.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-T2bCCOhb.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-aYOYuYXs.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-MJZiF0H5.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-n1-kzW3w.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-T-EG5iIa.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-5zTW479G.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-F2P_Hxxx.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-zCbLcasW.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-VN36jONF.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-rXX4glfM.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-syi2U-B0.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-s0PuuzYR.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-ZjvtzRN2.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-GuhX1Jrr.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-6gciZswV.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-sP_45gy5.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-vbWU8h8P.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-RObg15Lg.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-y9Kk4moG.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-1V8ATNN4.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-kTdp_BxJ.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-6fXtjWtB.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-k8ddUtsm.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-wJpRKly_.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-EM1DcUH0.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-4UxtfACG.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-gLOd2BMK.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-SyQJcnnF.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-Xjwr_MCa.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-rHIKy8Yw.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-4Wrkki96.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-1HAYybuQ.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-wDflXFhy.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-ASfLg6lj.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-mYnEUUjW.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-BiJONp1O.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-ZWMs_gRb.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-6x2XV--i.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--t2MrJGI.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-hYfzbE0D.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-SZIK2AoM.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-wH0mtACy.js"),__vite__mapDeps([78,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/resizable-columns.stories.tsx":async()=>e(()=>import("./resizable-columns.stories-Sc3HX8f2.js"),__vite__mapDeps([79,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-UmAM6Ze_.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-to-left.stories.tsx":async()=>e(()=>import("./right-to-left.stories-B21b_QWi.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/row-and-header-sizes.stories.tsx":async()=>e(()=>import("./row-and-header-sizes.stories-QFH73U1l.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-hover.stories.tsx":async()=>e(()=>import("./row-hover.stories-g_7ySNqU.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-markers.stories.tsx":async()=>e(()=>import("./row-markers.stories-lU0WninX.js"),__vite__mapDeps([84,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-c07hXgiF.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/scroll-shadows.stories.tsx":async()=>e(()=>import("./scroll-shadows.stories-NAs8aeEG.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/search-as-filter.stories.tsx":async()=>e(()=>import("./search-as-filter.stories-KSmou1ov.js"),__vite__mapDeps([87,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-gWjcAL7N.js"),__vite__mapDeps([88,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/silly-numbers.stories.tsx":async()=>e(()=>import("./silly-numbers.stories-gW0ovL7r.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/small-editable-grid.stories.tsx":async()=>e(()=>import("./small-editable-grid.stories-0uP-BdOp.js"),__vite__mapDeps([90,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-5ANjQwqi.js"),__vite__mapDeps([91,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-VjvKBE_I.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/stretch-column-size.stories.tsx":async()=>e(()=>import("./stretch-column-size.stories-vls6kYIF.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/ten-million-cells.stories.tsx":async()=>e(()=>import("./ten-million-cells.stories-h9i75Mql.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/theme-per-column.stories.tsx":async()=>e(()=>import("./theme-per-column.stories-FcjCnzB-.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/theme-per-row.stories.tsx":async()=>e(()=>import("./theme-per-row.stories-Eu3WtEBj.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/theme-support.stories.tsx":async()=>e(()=>import("./theme-support.stories-4NM0iysP.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/tooltips.stories.tsx":async()=>e(()=>import("./tooltips.stories-xsUlaFji.js"),__vite__mapDeps([98,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-4OthilPr.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/uneven-rows.stories.tsx":async()=>e(()=>import("./uneven-rows.stories-zKUKvwce.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/validate-data.stories.tsx":async()=>e(()=>import("./validate-data.stories-ejj5JmRv.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/wrapping-text.stories.tsx":async()=>e(()=>import("./wrapping-text.stories-M9abOMjL.js"),__vite__mapDeps([102,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-eVyCbotC.js"),__vite__mapDeps([103,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-DAbjeSkr.js"),__vite__mapDeps([104,1,2,12,13,17,4,5,14,15,18,105]),import.meta.url),"./packages/source/src/stories/use-data-source.stories.tsx":async()=>e(()=>import("./use-data-source.stories-hjg5vgA3.js"),__vite__mapDeps([106,1,2,9,8,36,5,3,4,6,107]),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([108,2,8]),import.meta.url),e(()=>import("./entry-preview-docs-Q58bND8E.js"),__vite__mapDeps([109,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-Vtu6m6MQ.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-IduWsXDK.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-qEwXLFDq.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-CKUMiTc-.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-n3kS0Li9.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-zA_ZEgqL.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-Cjz8ZlZW.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-lzFPAAhl.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-5m-2j_0I.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-OZi1IFDi.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-9_LsU-jk.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-7SWafrI_.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-zdyCIgd0.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-u1pPUmjW.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-j70HTiom.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-dkRmLm5K.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-fKxfnZWA.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-kssBUpmm.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-jx_758La.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-RdRs9hWj.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-kZ0Yhfoj.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-xdLhv7k4.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-bndOvtUp.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-a9SFZLiG.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-k2kx3JIg.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-sCVCvvyD.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-LzebiMzB.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-sneBwz65.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-DXCIQAWC.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-FO027sy9.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-OLQy2H3_.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-R8Mb-UAF.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-B7dXYLEM.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-YpVq2nt-.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-IZNw2k3y.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-d6Ld1nM7.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-RcWZSjf2.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-VM6JAg9H.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-oPqd4IqH.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-SOrBfORV.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-WLnxbntf.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-ZGQpxfuS.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-P6IlOXMw.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-Z_0v27cG.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-bRcFhkz9.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-nru7-UGq.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-A_Lx3RKM.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-ehBQ4sav.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-sdcUdsuJ.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-0Ai_tt-9.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-q80YNc9k.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-bv75-Qfg.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-nxlJdvfv.js"),__vite__mapDeps([78,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/resizable-columns.stories.tsx":async()=>e(()=>import("./resizable-columns.stories-FVujiygH.js"),__vite__mapDeps([79,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-kBZv1_Df.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-to-left.stories.tsx":async()=>e(()=>import("./right-to-left.stories-qUoBnm3m.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/row-and-header-sizes.stories.tsx":async()=>e(()=>import("./row-and-header-sizes.stories-mfzrzOgV.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-hover.stories.tsx":async()=>e(()=>import("./row-hover.stories-sPMoBQT6.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-markers.stories.tsx":async()=>e(()=>import("./row-markers.stories-ljeoW-nD.js"),__vite__mapDeps([84,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-530Lb6MO.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/scroll-shadows.stories.tsx":async()=>e(()=>import("./scroll-shadows.stories-Lwuq98B7.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/search-as-filter.stories.tsx":async()=>e(()=>import("./search-as-filter.stories-JRWC8o2i.js"),__vite__mapDeps([87,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-JnB-tDZS.js"),__vite__mapDeps([88,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/silly-numbers.stories.tsx":async()=>e(()=>import("./silly-numbers.stories-BedUiNwX.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/small-editable-grid.stories.tsx":async()=>e(()=>import("./small-editable-grid.stories-hBZTigSy.js"),__vite__mapDeps([90,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-GTJV63Gq.js"),__vite__mapDeps([91,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-tw6A_N3Y.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/stretch-column-size.stories.tsx":async()=>e(()=>import("./stretch-column-size.stories-SdVFbo4t.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/ten-million-cells.stories.tsx":async()=>e(()=>import("./ten-million-cells.stories-oIkgW9SM.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/theme-per-column.stories.tsx":async()=>e(()=>import("./theme-per-column.stories-BlFcD3Pv.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/theme-per-row.stories.tsx":async()=>e(()=>import("./theme-per-row.stories-b7zGO_y8.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/theme-support.stories.tsx":async()=>e(()=>import("./theme-support.stories-kFZtcTg3.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/tooltips.stories.tsx":async()=>e(()=>import("./tooltips.stories-9P9czPXw.js"),__vite__mapDeps([98,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-cy84CW2d.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/uneven-rows.stories.tsx":async()=>e(()=>import("./uneven-rows.stories-y9dbdZUZ.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/validate-data.stories.tsx":async()=>e(()=>import("./validate-data.stories-pN9rQiyK.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/wrapping-text.stories.tsx":async()=>e(()=>import("./wrapping-text.stories-JUaoMIWD.js"),__vite__mapDeps([102,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-7ldlZ5Fw.js"),__vite__mapDeps([103,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-6ZtRyRmb.js"),__vite__mapDeps([104,1,2,12,13,17,4,5,14,15,18,105]),import.meta.url),"./packages/source/src/stories/use-data-source.stories.tsx":async()=>e(()=>import("./use-data-source.stories-bY2Du4Dr.js"),__vite__mapDeps([106,1,2,9,8,36,5,3,4,6,107]),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([108,2,8]),import.meta.url),e(()=>import("./entry-preview-docs-Q58bND8E.js"),__vite__mapDeps([109,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-GoH1iMdu.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./data-editor-all-ligl_Vjz.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./toConsumableArray-2oaFSNyq.js","./index-wocATsGp.js","./index.esm-Ejw8GwRl.js","./cell-rTh_AIOZ.css","./data-editor-repros.stories-7gn6IQHd.js","./story-utils-K2EZnGjM.js","./story-utils-P19cgLKl.css","./image-window-loader-hgJATaim.js","./image-window-loader-1jHxuE_X.css","./data-editor-all-ATY7qU3b.js","./scrolling-data-grid-ta-GKPbC.js","./scrolling-data-grid-dE2iz8sf.css","./data-editor-all-n_zxn1vv.css","./data-editor-repros-3oka-WZT.css","./data-editor.stories-2CxcBwGP.js","./00-faq.stories-Ag4SHQ4N.js","./doc-wrapper-eGylnU1T.js","./doc-wrapper-WI-RO4K9.css","./01-getting-started.stories-sZPVGmNg.js","./02-editing-data.stories-_YRJ7oxT.js","./03-grid-column.stories-BadlQizl.js","./04-streaming-data.stories-Btx91Jtk.js","./06-search.stories-sbm8KDYQ.js","./07-column-grouping.stories-uX8Serp5.js","./08-theming.stories-UB7A1A-i.js","./09-menus.stories-T2bCCOhb.js","./react-laag.esm-PpDllAFI.js","./add-column.stories-aYOYuYXs.js","./utils-wFAOo4Dx.js","./index-PWBWJyi_.js","./utils-ybqXy1Bp.css","./add-data-to-middle.stories-MJZiF0H5.js","./add-data-to-top.stories-n1-kzW3w.js","./add-data.stories-T-EG5iIa.js","./all-cell-kinds.stories-5zTW479G.js","./append-row-handle.stories-F2P_Hxxx.js","./automatic-row-markers.stories-zCbLcasW.js","./built-in-search.stories-VN36jONF.js","./cell-activated-event.stories-rXX4glfM.js","./column-group-collapse.stories-syi2U-B0.js","./column-groups.stories-s0PuuzYR.js","./content-alignment.stories-ZjvtzRN2.js","./controlled-search.stories-GuhX1Jrr.js","./controlled-selection.stories-6gciZswV.js","./copy-support.stories-sP_45gy5.js","./custom-header-icons.stories-vbWU8h8P.js","./custom-header.stories-RObg15Lg.js","./drag-source.stories-y9Kk4moG.js","./drop-events.stories-1V8ATNN4.js","./fill-handle.stories-kTdp_BxJ.js","./freeze-columns.stories-6fXtjWtB.js","./freeze-rows.stories-k8ddUtsm.js","./header-menus.stories-wJpRKly_.js","./header-menus-N_BOUD_t.css","./highlight-cells.stories-EM1DcUH0.js","./imperative-scroll.stories-4UxtfACG.js","./input-blending.stories-gLOd2BMK.js","./keybindings.stories-SyQJcnnF.js","./layout-integration.stories-Xjwr_MCa.js","./multi-select-columns.stories-rHIKy8Yw.js","./new-column-button.stories-4Wrkki96.js","./obscured-grid.stories-1HAYybuQ.js","./observe-visible-region.stories-wDflXFhy.js","./one-hundred-thousand-columns.stories-ASfLg6lj.js","./one-million-rows.stories-mYnEUUjW.js","./overscroll.stories-BiJONp1O.js","./padding.stories-ZWMs_gRb.js","./paste-support.stories-6x2XV--i.js","./prevent-diagonal-scroll.stories--t2MrJGI.js","./rapid-updates.stories-hYfzbE0D.js","./rearrange-columns.stories-SZIK2AoM.js","./reorder-rows.stories-wH0mtACy.js","./resizable-columns.stories-Sc3HX8f2.js","./right-element.stories-UmAM6Ze_.js","./right-to-left.stories-B21b_QWi.js","./row-and-header-sizes.stories-QFH73U1l.js","./row-hover.stories-g_7ySNqU.js","./row-markers.stories-lU0WninX.js","./scaled-view.stories-c07hXgiF.js","./scroll-shadows.stories-NAs8aeEG.js","./search-as-filter.stories-KSmou1ov.js","./server-side-data.stories-gWjcAL7N.js","./silly-numbers.stories-gW0ovL7r.js","./small-editable-grid.stories-0uP-BdOp.js","./smooth-scrolling-grid.stories-5ANjQwqi.js","./span-cell.stories-VjvKBE_I.js","./stretch-column-size.stories-vls6kYIF.js","./ten-million-cells.stories-h9i75Mql.js","./theme-per-column.stories-FcjCnzB-.js","./theme-per-row.stories-Eu3WtEBj.js","./theme-support.stories-4NM0iysP.js","./tooltips.stories-xsUlaFji.js","./trailing-row-options.stories-4OthilPr.js","./uneven-rows.stories-zKUKvwce.js","./validate-data.stories-ejj5JmRv.js","./wrapping-text.stories-M9abOMjL.js","./data-grid.stories-eVyCbotC.js","./scrolling-data-grid.stories-DAbjeSkr.js","./scrolling-data-grid-OMNPNZ5X.css","./use-data-source.stories-hjg5vgA3.js","./use-data-source-ruk7orBA.css","./entry-preview-rD48AoDU.js","./entry-preview-docs-Q58bND8E.js"] + __vite__mapDeps.viteFileDeps = ["./cell.stories-Vtu6m6MQ.js","./marked.esm-dbrxtycE.js","./index-BMVQvedj.js","./data-editor-all-85iGweFr.js","./throttle-7EuXLZa7.js","./_baseIteratee-WTHxv43n.js","./flatten-qRvRBp6y.js","./toConsumableArray-2oaFSNyq.js","./index-wocATsGp.js","./index.esm-Ejw8GwRl.js","./cell-rTh_AIOZ.css","./data-editor-repros.stories-IduWsXDK.js","./story-utils-K2EZnGjM.js","./story-utils-P19cgLKl.css","./image-window-loader-h6lJQmfV.js","./image-window-loader-1jHxuE_X.css","./data-editor-all-Orvb2jqb.js","./scrolling-data-grid-6lFEHS8-.js","./scrolling-data-grid-dE2iz8sf.css","./data-editor-all-n_zxn1vv.css","./data-editor-repros-3oka-WZT.css","./data-editor.stories-qEwXLFDq.js","./00-faq.stories-CKUMiTc-.js","./doc-wrapper-eGylnU1T.js","./doc-wrapper-WI-RO4K9.css","./01-getting-started.stories-n3kS0Li9.js","./02-editing-data.stories-zA_ZEgqL.js","./03-grid-column.stories-Cjz8ZlZW.js","./04-streaming-data.stories-lzFPAAhl.js","./06-search.stories-5m-2j_0I.js","./07-column-grouping.stories-OZi1IFDi.js","./08-theming.stories-9_LsU-jk.js","./09-menus.stories-7SWafrI_.js","./react-laag.esm-PpDllAFI.js","./add-column.stories-zdyCIgd0.js","./utils-H5nRE5Sr.js","./index-PWBWJyi_.js","./utils-ybqXy1Bp.css","./add-data-to-middle.stories-u1pPUmjW.js","./add-data-to-top.stories-j70HTiom.js","./add-data.stories-dkRmLm5K.js","./all-cell-kinds.stories-fKxfnZWA.js","./append-row-handle.stories-kssBUpmm.js","./automatic-row-markers.stories-jx_758La.js","./built-in-search.stories-RdRs9hWj.js","./cell-activated-event.stories-kZ0Yhfoj.js","./column-group-collapse.stories-xdLhv7k4.js","./column-groups.stories-bndOvtUp.js","./content-alignment.stories-a9SFZLiG.js","./controlled-search.stories-k2kx3JIg.js","./controlled-selection.stories-sCVCvvyD.js","./copy-support.stories-LzebiMzB.js","./custom-header-icons.stories-sneBwz65.js","./custom-header.stories-DXCIQAWC.js","./drag-source.stories-FO027sy9.js","./drop-events.stories-OLQy2H3_.js","./fill-handle.stories-R8Mb-UAF.js","./freeze-columns.stories-B7dXYLEM.js","./freeze-rows.stories-YpVq2nt-.js","./header-menus.stories-IZNw2k3y.js","./header-menus-N_BOUD_t.css","./highlight-cells.stories-d6Ld1nM7.js","./imperative-scroll.stories-RcWZSjf2.js","./input-blending.stories-VM6JAg9H.js","./keybindings.stories-oPqd4IqH.js","./layout-integration.stories-SOrBfORV.js","./multi-select-columns.stories-WLnxbntf.js","./new-column-button.stories-ZGQpxfuS.js","./obscured-grid.stories-P6IlOXMw.js","./observe-visible-region.stories-Z_0v27cG.js","./one-hundred-thousand-columns.stories-bRcFhkz9.js","./one-million-rows.stories-nru7-UGq.js","./overscroll.stories-A_Lx3RKM.js","./padding.stories-ehBQ4sav.js","./paste-support.stories-sdcUdsuJ.js","./prevent-diagonal-scroll.stories-0Ai_tt-9.js","./rapid-updates.stories-q80YNc9k.js","./rearrange-columns.stories-bv75-Qfg.js","./reorder-rows.stories-nxlJdvfv.js","./resizable-columns.stories-FVujiygH.js","./right-element.stories-kBZv1_Df.js","./right-to-left.stories-qUoBnm3m.js","./row-and-header-sizes.stories-mfzrzOgV.js","./row-hover.stories-sPMoBQT6.js","./row-markers.stories-ljeoW-nD.js","./scaled-view.stories-530Lb6MO.js","./scroll-shadows.stories-Lwuq98B7.js","./search-as-filter.stories-JRWC8o2i.js","./server-side-data.stories-JnB-tDZS.js","./silly-numbers.stories-BedUiNwX.js","./small-editable-grid.stories-hBZTigSy.js","./smooth-scrolling-grid.stories-GTJV63Gq.js","./span-cell.stories-tw6A_N3Y.js","./stretch-column-size.stories-SdVFbo4t.js","./ten-million-cells.stories-oIkgW9SM.js","./theme-per-column.stories-BlFcD3Pv.js","./theme-per-row.stories-b7zGO_y8.js","./theme-support.stories-kFZtcTg3.js","./tooltips.stories-9P9czPXw.js","./trailing-row-options.stories-cy84CW2d.js","./uneven-rows.stories-y9dbdZUZ.js","./validate-data.stories-pN9rQiyK.js","./wrapping-text.stories-JUaoMIWD.js","./data-grid.stories-7ldlZ5Fw.js","./scrolling-data-grid.stories-6ZtRyRmb.js","./scrolling-data-grid-OMNPNZ5X.css","./use-data-source.stories-bY2Du4Dr.js","./use-data-source-ruk7orBA.css","./entry-preview-rD48AoDU.js","./entry-preview-docs-Q58bND8E.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } \ No newline at end of file diff --git a/docs/assets/image-window-loader-h6lJQmfV.js b/docs/assets/image-window-loader-h6lJQmfV.js new file mode 100644 index 000000000..6bfee1ba2 --- /dev/null +++ b/docs/assets/image-window-loader-h6lJQmfV.js @@ -0,0 +1,18 @@ +var Pi=Object.defineProperty;var Bi=(e,t,n)=>t in e?Pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t,n)=>(Bi(e,typeof t!="symbol"?t+"":t,n),n);import{a as Ve,j as $,F as Rn,s as ht,b as Ti}from"./marked.esm-dbrxtycE.js";import{r as M,R as _n}from"./index-BMVQvedj.js";import{h as Ri,d as Li,v as Wi,_ as Ni,g as zi,c as mn,r as Oi,j as Xi,t as $i}from"./throttle-7EuXLZa7.js";import{_ as Yi}from"./iframe-t8ayfGqb.js";function Yo(e="This should not happen"){throw new Error(e)}function ut(e,t="Assertion failed"){if(!e)return Yo(t)}function Un(e,t){return Yo(t??"Hell froze over")}function Ks(e,t){try{return e()}catch{return t}}const po=Object.prototype.hasOwnProperty;function Nt(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--&&Nt(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(po.call(e,n)&&++o&&!po.call(t,n)||!(n in t)||!Nt(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const yn=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||{}),_i=(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))(_i||{}),Ln=(e=>(e.Triangle="triangle",e.Dots="dots",e))(Ln||{});function Gs(e){return"width"in e&&typeof e.width=="number"}async function Js(e){return typeof e=="object"?e:await e()}function Ui(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown")}function Qs(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 _o(e){return e.kind==="marker"||e.kind==="new-row"}function qi(e){if(!Ui(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;Un(e,"A cell was passed with an invalid kind")}function Zs(e){return Ri(e,"editor")}function Wn(e){return!(e.readonly??!1)}var Gt=(e=>(e.NewRow="new-row",e.Marker="marker",e))(Gt||{});function ji(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 dt(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=ji([...this.items,n]);return new dt(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&&tvo??(vo=new dt([]))),ee(dt,"fromSingleSelection",t=>dt.empty().add(t));let Nn=dt;function je(e,t,n,o,i=!1){const r=M.useRef();r.current=t,M.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 el(e,t){return e===void 0?void 0:t}const Vi=Math.PI;function wo(e){return e*Vi/180}const Uo=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),qo=(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}},jo=(e,t,n)=>Math.min(e,t-n*2),Vo=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,jn=e=>{const t=e.fgColor??"currentColor";return Ve("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"})]})},Ki=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 Gi(e,t,n){const[o,i]=M.useState(e),r=M.useRef(!0);M.useEffect(()=>()=>{r.current=!1},[]);const l=M.useRef(Li(s=>{r.current&&i(s)},n));return M.useLayoutEffect(()=>{r.current&&l.current(()=>e())},t),o}const Ji="֑-߿יִ-﷽ﹰ-ﻼ",Qi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Zi=new RegExp("^[^"+Qi+"]*["+Ji+"]");function Vn(e){return Zi.test(e)?"rtl":"not-rtl"}let fn;function ko(){if(typeof document>"u")return 0;if(fn!==void 0)return fn;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(),fn=n-o,fn}const Dt=Symbol();function tl(e){const t=M.useRef([Dt,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=M.useState(e),[,i]=M.useState(),r=M.useCallback(s=>{const a=t.current[0];a!==Dt&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Dt&&i({}),o(d=>typeof s=="function"?s(a===Dt?d:a):s),t.current[0]=Dt)},[]),l=M.useCallback(()=>{t.current[0]=Dt,i({})},[]);return[t.current[0]===Dt?n:t.current[0],r,l]}function Ko(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 nl(e){const t=M.useRef(e);return Nt(e,t.current)||(t.current=e),t.current}function er(e,t){return _n.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 nr(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,u]=t.span;return d>=o&&d<=i||u>=o&&d<=i||di}function or(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)&&xo(e,t,r)&&i++;for(const l of n.current.rangeStack)xo(e,t,l)&&i++;return i}function Jo(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 zt(e,t){let n=0;const o=Jo(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 h}const m=r-d,f=e-(a??0);if(typeof l=="number"){const c=Math.floor((f-u)/l)+s;return c>=m?void 0:c}else{let c=u;for(let h=s;h"u";async function lr(){var e;sr||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,gn=0,Vt={},Wi())}lr();function Qo(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Qt(e,t,n,o="middle"){const i=Qo(e,t,o,n);let r=Vt[i];return r===void 0&&(r=t.measureText(e),Vt[i]=r,gn++),gn>1e4&&(Vt={},gn=0),r}function ar(e,t){const n=Qo(e,void 0,"middle",t);return Vt[n]}function vt(e,t){return typeof t!="string"&&(t=t.baseFontFull),cr(e,t)}function Co(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const So=[];function cr(e,t){for(const r of So)if(r.key===t)return r.val;const n=Co(e,"alphabetic"),i=-(Co(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return So.push({key:t,val:i}),i}function dr(e,t,n,o,i,r){const{ctx:l,rect:s,theme:a}=e;let d=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(d=n-t,dn&&(e=e.slice(0,n)),e}function fr(e,t,n,o,i,r,l,s,a,d){const u=s.baseFontFull,g=Ni(e,t,u,i-s.cellHorizontalPadding*2,d??!1),m=ei(e,u),f=s.lineHeight*m,c=m+f*(g.length-1),h=c+s.cellVerticalPadding>r;h&&(e.save(),e.rect(n,o,i,r),e.clip());const b=o+r/2-c/2;let v=Math.max(o+s.cellVerticalPadding,b);for(const S of g)if(Zo(e,S,n,v,i,m,l,s,a),v+=f,v>o+r)break;h&&e.restore()}function ft(e,t,n,o,i){const{ctx:r,rect:l,theme:s}=e,{x:a,y:d,width:u,height:g}=l;o=o??!1,o||(t=ur(t,u));const m=vt(r,s),f=Vn(t)==="rtl";if(n===void 0&&f&&(n="right"),f&&(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?fr(r,t,a,d,u,g,m,s,n,i):Zo(r,t,a,d,u,g,m,s,n),c&&(r.textAlign="start"),f&&(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 hr(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 gr(e,t,n){const o=function(s,a){const d=a.x-s.x,u=a.y-s.y,g=Math.sqrt(d*d+u*u),m=d/g,f=u/g;return{x:d,y:a.y-s.y,len:g,nx:m,ny:f,ang:Math.atan2(f,m)}};let i;const r=t.length;let l=t[r-1];for(let s=0;s1?1:m),h=1,b=!1;f<0?c<0?c=Math.PI+c:(c=Math.PI-c,h=-1,b=!0):c>0&&(h=-1,b=!0),i=a.radius!==void 0?a.radius:n;const v=c/2;let S=Math.abs(Math.cos(v)*i/Math.sin(v)),C;S>Math.min(u.len/2,g.len/2)?(S=Math.min(u.len/2,g.len/2),C=Math.abs(S*Math.sin(v)/Math.cos(v))):C=i;let E=a.x+g.nx*S,D=a.y+g.ny*S;E+=-g.ny*C*h,D+=g.nx*C*h,e.arc(E,D,C,u.ang+Math.PI/2*h,g.ang-Math.PI/2*h,b),l=a,a=d}e.closePath()}function Xn(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c){const h={x:0,y:r+d,width:0,height:0};if(e>=f.length||t>=u||t<-2||e<0)return h;const b=r-i;if(e>=g){const v=l>e?-1:1,S=zt(f);h.x+=S+a;for(let C=l;C!==e;C+=v)h.x+=f[v===1?C:C-1].width*v}else for(let v=0;v0&&zn(f[v-1].group,S)&&f[v-1].sticky===C;){const D=f[v-1];h.x-=D.width,h.width+=D.width,v--}let E=e;for(;E+1n&&(h.width=n-h.x)}}else if(t>=u-m){let v=u-t;for(h.y=o;v>0;){const S=t+v-1;h.height=typeof c=="number"?c:c(S),h.y-=h.height,v--}h.height+=1}else{const v=s>t?-1:1;if(typeof c=="number"){const S=t-s;h.y+=S*c}else for(let S=s;S!==t;S+=v)h.y+=c(S)*v;h.height=(typeof c=="number"?c:c(t))+1}return h}const Kn=1<<21;function ot(e,t){return(t+2)*Kn+e}function ti(e){return e%Kn}function Gn(e){return Math.floor(e/Kn)-2}function Jn(e){const t=ti(e),n=Gn(e);return[t,n]}class ni{constructor(){ee(this,"visibleWindow",{x:0,y:0,width:0,height:0});ee(this,"freezeCols",0);ee(this,"freezeRows",[]);ee(this,"isInWindow",t=>{const n=ti(t),o=Gn(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&&Nt(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class mr extends ni{constructor(){super(...arguments);ee(this,"cache",new Map);ee(this,"setValue",(n,o)=>{this.cache.set(ot(n[0],n[1]),o)});ee(this,"getValue",n=>this.cache.get(ot(n[0],n[1])));ee(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class Kt{constructor(t=[]){ee(this,"cells");this.cells=new Set(t.map(n=>ot(n[0],n[1])))}add(t){this.cells.add(ot(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(ot(t[0],t[1]))}remove(t){this.cells.delete(ot(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gn(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{h.drawImage(b,0,0,g,g)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(o.globalAlpha=a),o.drawImage(f,0,0,g,g,i,r,l,l),a<1&&(o.globalAlpha=1)}}const Fn={};let pt=null;function pr(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function $n(e){const t=e.toLowerCase().trim();if(Fn[t]!==void 0)return Fn[t];pt=pt||pr(),pt.style.color="#000",pt.style.color=t;const n=getComputedStyle(pt).color;pt.style.color="#fff",pt.style.color=t;const o=getComputedStyle(pt).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),Fn[t]=i,i}function en(e,t){const[n,o,i]=$n(e);return`rgba(${n}, ${o}, ${i}, ${t})`}const Mo=new Map;function Io(e,t){const n=`${e}-${t}`,o=Mo.get(n);if(o!==void 0)return o;const i=Ye(e,t);return Mo.set(n,i),i}function Ye(e,t){if(t===void 0)return e;const[n,o,i,r]=$n(e);if(r===1)return e;const[l,s,a,d]=$n(t),u=r+d*(1-r),g=(r*n+d*l*(1-r))/u,m=(r*o+d*s*(1-r))/u,f=(r*i+d*a*(1-r))/u;return`rgba(${g}, ${m}, ${f}, ${u})`}function oi(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function pn(e,t,n,o,i,r,l,s,a){s=s??t;let d=t,u=e;const g=o-r;let m=!1;for(;ds&&a(d,u,f,!1,l&&u===o-1)===!0){m=!0;break}d+=f,u++}if(!m){d=n;for(let f=0;f!f.sticky))==null?void 0:m.sourceIndex)??0;if(a>g){const f=Math.max(s,g);let c=t,h=o;for(let b=r.sourceIndex-1;b>=f;b--)c-=l[b].width,h+=l[b].width;for(let b=r.sourceIndex+1;b<=a;b++)h+=l[b].width;u={x:c,y:n,width:h,height:i}}if(g>s){const f=Math.min(a,g-1);let c=t,h=o;for(let b=r.sourceIndex-1;b>=s;b--)c-=l[b].width,h+=l[b].width;for(let b=r.sourceIndex+1;b<=f;b++)h+=l[b].width;d={x:c,y:n,width:h,height:i}}return[d,u]}function il(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 si={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 rl(){return si}const sl=_n.createContext(si);function Jt(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]=Ye(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 ll(e,t,n,o){if(o==="any")return vr(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),nr([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 bn(e,t,n,o,i,r,l,s){return e<=i+l&&i<=e+n&&t<=r+s&&r<=t+o}function Qn(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function vr(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 wr(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 kr(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,u=r-e.y,g=e.y+e.height-s,m=a>0?e.x+Math.floor(a/o)*o:e.x,f=d>0?e.x+e.width-Math.floor(d/o)*o:e.x+e.width,c=u>0?e.y+Math.floor(u/o)*o:e.y,h=g>0?e.y+e.height-Math.floor(g/o)*o:e.y+e.height;return{x:m,y:c,width:f-m,height:h-c}}function xr(e,t,n,o,i){const[r,l,s,a]=t,[d,u,g,m]=i,{x:f,y:c,width:h,height:b}=e,v=[];if(h<=0||b<=0)return v;const S=f+h,C=c+b,E=fs,A=c+b>a,R=f>=r&&fr&&S<=s||fs,x=c>=l&&cl&&C<=a||ca;if(R&&x){const I=Math.max(f,r),w=Math.max(c,l),k=Math.min(S,s),p=Math.min(C,a);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:d,y:u,width:g-d+1,height:m-u+1}})}if(E&&D){const I=f,w=c,k=Math.min(S,r),p=Math.min(C,l);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:0,y:0,width:d+1,height:u+1}})}if(D&&R){const I=Math.max(f,r),w=c,k=Math.min(S,s),p=Math.min(C,l);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:d,y:0,width:g-d+1,height:u+1}})}if(D&&H){const I=Math.max(f,s),w=c,k=S,p=Math.min(C,l);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:g,y:0,width:n-g+1,height:u+1}})}if(E&&x){const I=f,w=Math.max(c,l),k=Math.min(S,r),p=Math.min(C,a);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:0,y:u,width:d+1,height:m-u+1}})}if(H&&x){const I=Math.max(f,s),w=Math.max(c,l),k=S,p=Math.min(C,a);v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:g,y:u,width:n-g+1,height:m-u+1}})}if(E&&A){const I=f,w=Math.max(c,a),k=Math.min(S,r),p=C;v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:0,y:m,width:d+1,height:o-m+1}})}if(A&&R){const I=Math.max(f,r),w=Math.max(c,a),k=Math.min(S,s),p=C;v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:d,y:m,width:g-d+1,height:o-m+1}})}if(H&&A){const I=Math.max(f,s),w=Math.max(c,a),k=S,p=C;v.push({rect:{x:I,y:w,width:k-I,height:p-w},clip:{x:g,y:m,width:n-g+1,height:o-m+1}})}return v}const Cr={kind:ae.Loading,allowOverlay:!1};function Eo(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S,C,E,D,H,A,R,x,B,I,w,k,p,j,_,Y,Z){let we=(C==null?void 0:C.size)??Number.MAX_SAFE_INTEGER;const me=performance.now();let de=k.baseFontFull;e.font=de;const re={ctx:e},ke=[0,0],ze=b>0?Ot(a,b,d):0;let O,He;const Oe=oi(S);return wt(t,s,r,l,i,(te,Se,kt,lt,xt)=>{const _e=Math.max(0,lt-Se),Pe=Se+_e,Be=i+1,gt=te.width-_e,Xe=o-i-1;if(S.length>0){let ye=!1;for(let ue=0;ue{e.save(),e.beginPath(),e.rect(Pe,Be,gt,Xe),e.clip()},Ue=E.columns.hasIndex(te.sourceIndex),Ie=g(te.group??"").overrideTheme,We=te.themeOverride===void 0&&Ie===void 0?k:Jt(k,Ie,te.themeOverride),ce=We.baseFontFull;ce!==de&&(de=ce,e.font=ce),se();let ve;return pn(xt,kt,o,a,d,b,v,Oe,(ye,ue,T,K,le)=>{var Qe,Ze,at;if(ue<0||(ke[0]=te.sourceIndex,ke[1]=ue,C!==void 0&&!C.has(ke)))return;if(S.length>0){let J=!1;for(let Fe=0;Feie.span!==void 0&&J>=ie.span[0]&&J<=ie.span[1]);Ge&&!c&&h?$e=0:Ge&&h&&($e=Math.max($e,1)),Ct&&$e++,Ge||(V&&$e++,Ue&&!le&&$e++);const St=ie.kind===ae.Protected?Re.bgCellMedium:Re.bgCell;let be;if((K||St!==k.bgCell)&&(be=Ye(St,be)),$e>0||Te){Te&&(be=Ye(Re.bgHeader,be));for(let J=0;J<$e;J++)be=Ye(Re.accentLight,be)}else if(D!==void 0){for(const J of D)if(J[0]===te.sourceIndex&&J[1]===ue){be=Ye(Re.bgSearchResult,be);break}}if(H!==void 0)for(let J=0;JZ&&!Ke){const J=Re.baseFontFull;J!==de&&(e.font=J,de=J),ve=li(e,ie,te.sourceIndex,ue,he,Ne,ne,ye,oe,T,$e>0,Re,be??Re.bgCell,A,R,(Je==null?void 0:Je.hoverAmount)??0,B,w,me,I,ve,p,j,_,Y)}return Mt&&e.restore(),ie.style==="faded"&&(e.globalAlpha=1),we--,Ee&&(e.restore(),(at=ve==null?void 0:ve.deprep)==null||at.call(ve,re),ve=void 0,se(),de=ce,e.font=ce),we<=0}),e.restore(),we<=0}),O}const Ut=[0,0],qt={x:0,y:0,width:0,height:0},Dn=[void 0,()=>{}];let Yn=!1;function Sr(){Yn=!0}function li(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S,C,E,D,H,A,R){var j,_;let x,B;b!==void 0&&b[0][0]===n&&b[0][1]===o&&(x=b[1][0],B=b[1][1]);let I;Ut[0]=n,Ut[1]=o,qt.x=l,qt.y=s,qt.width=a,qt.height=d,Dn[0]=H.getValue(Ut),Dn[1]=Y=>H.setValue(Ut,Y),Yn=!1;const w={ctx:e,theme:g,col:n,row:o,cell:t,rect:qt,highlighted:u,cellFillColor:m,hoverAmount:h,frameTime:S,hoverX:x,drawState:Dn,hoverY:B,imageLoader:f,spriteManager:c,hyperWrapping:v,overrideCursor:x!==void 0?R:void 0,requestAnimationFrame:Sr},k=dr(w,t.lastUpdated,S,E,i,r),p=A(t);if(p!==void 0){(E==null?void 0:E.renderer)!==p&&((j=E==null?void 0:E.deprep)==null||j.call(E,w),E=void 0);const Y=(_=p.drawPrep)==null?void 0:_.call(p,w,E);C!==void 0&&!_o(w.cell)?C(w,()=>p.draw(w,t)):p.draw(w,t),I=Y===void 0?void 0:{deprep:Y==null?void 0:Y.deprep,fillStyle:Y==null?void 0:Y.fillStyle,font:Y==null?void 0:Y.font,renderer:p}}return(k||Yn)&&(D==null||D(Ut)),I}function Zn(e,t,n,o,i,r,l,s,a=-20,d=-20,u=32,g="center",m="square"){const f=Math.floor(i+l/2),c=m==="circle"?1e4:t.roundingRadius??4;let h=jo(u,l,t.cellVerticalPadding),b=h/2;const v=qo(g,o,r,t.cellHorizontalPadding,h),S=Uo(v,f,h),C=Vo(o+a,i+d,S);switch(n){case!0:{e.beginPath(),st(e,v-h/2,f-h/2,h,h,c),m==="circle"&&(b*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-b+h/4.23,f-b+h/1.97),e.lineTo(v-b+h/2.42,f-b+h/1.44),e.lineTo(v-b+h/1.29,f-b+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case yn:case!1:{e.beginPath(),st(e,v-h/2+.5,f-h/2+.5,h-1,h-1,c),e.lineWidth=1,e.strokeStyle=C?t.textDark:t.textMedium,e.stroke();break}case qn:{e.beginPath(),st(e,v-h/2,f-h/2,h,h,c),e.fillStyle=C?t.textMedium:t.textLight,e.fill(),m==="circle"&&(b*=.8,h*=.8),e.beginPath(),e.moveTo(v-h/3,f),e.lineTo(v+h/3,f),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Un()}}function Mr(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){const C=l+s;if(C<=0)return;e.fillStyle=g.bgHeader,e.fillRect(0,0,i,C);const[E,D]=(o==null?void 0:o[0])??[],H=g.headerFontFull;e.font=H,wt(t,0,r,0,C,(A,R,x,B)=>{var re;if(b!==void 0&&!b.has([A.sourceIndex,-1]))return;const I=Math.max(0,B-R);e.save(),e.beginPath(),e.rect(R+I,s,A.width-I,l),e.clip();const w=h(A.group??"").overrideTheme,k=A.themeOverride===void 0&&w===void 0?g:Jt(g,w,A.themeOverride);k.bgHeader!==g.bgHeader&&(e.fillStyle=k.bgHeader,e.fill()),k!==g&&(e.font=k.baseFontFull);const p=u.columns.hasIndex(A.sourceIndex),j=a!==void 0||d,_=!j&&D===-1&&E===A.sourceIndex,Y=j?0:((re=f.find(ke=>ke.item[0]===A.sourceIndex&&ke.item[1]===-1))==null?void 0:re.hoverAmount)??0,Z=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===A.sourceIndex,we=p?k.accentColor:Z?k.bgHeaderHasFocus:k.bgHeader,me=n?s:0,de=A.sourceIndex===0?0:1;p?(e.fillStyle=we,e.fillRect(R+de,me,A.width-de,l)):(Z||Y>0)&&(e.beginPath(),e.rect(R+de,me,A.width-de,l),Z&&(e.fillStyle=k.bgHeaderHasFocus,e.fill()),Y>0&&(e.globalAlpha=Y,e.fillStyle=k.bgHeaderHovered,e.fill(),e.globalAlpha=1)),di(e,R,me,A.width,l,A,p,k,_,Z,Y,m,v,S),e.restore()}),n&&Ir(e,t,i,r,s,o,g,m,f,c,h,b)}function Ir(e,t,n,o,i,r,l,s,a,d,u,g){const[f,c]=(r==null?void 0:r[0])??[];let h=0;ii(t,n,o,i,(b,v,S,C,E,D)=>{if(g!==void 0&&!g.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(S,C,E,D),e.clip();const H=u(v),A=(H==null?void 0:H.overrideTheme)===void 0?l:Jt(l,H.overrideTheme),R=c===-2&&f!==void 0&&f>=b[0]&&f<=b[1],x=R?A.bgHeaderHovered:A.bgHeader;if(x!==l.bgHeader&&(e.fillStyle=x,e.fill()),e.fillStyle=A.textGroupHeader??A.textHeader,H!==void 0){let B=S;if(H.icon!==void 0&&(s.drawSprite(H.icon,"normal",e,B+8,(i-20)/2,20,A),B+=26),e.fillText(H.name,B+8,i/2+vt(e,l.headerFontFull)),H.actions!==void 0&&R){const I=ci({x:S,y:C,width:E,height:D},H.actions);e.beginPath();const w=I[0].x-10,k=S+E-w;e.rect(w,0,k,i);const p=e.createLinearGradient(w,0,w+k,0),j=en(x,0);p.addColorStop(0,j),p.addColorStop(10/k,x),p.addColorStop(1,x),e.fillStyle=p,e.fill(),e.globalAlpha=.6;const[_,Y]=(r==null?void 0:r[1])??[-1,-1];for(let Z=0;Z35){const E=m?35:o-35,D=m?35*.7:o-35*.7,H=E/o,A=D/o,R=e.createLinearGradient(t,0,t+o,0),x=en(h,0);R.addColorStop(m?1:0,h),R.addColorStop(H,h),R.addColorStop(A,x),R.addColorStop(m?0:1,x),e.fillStyle=R}else e.fillStyle=h;if(m&&(e.textAlign="right"),e.fillText(r.title,S,n+i/2+vt(e,s.headerFontFull)),m&&(e.textAlign="left"),b&&r.hasMenu===!0)if(r.menuIcon===void 0||r.menuIcon===Ln.Triangle){e.beginPath();const C=f.x+f.width/2-5.5,E=f.y+f.height/2-3;gr(e,[{x:C,y:E},{x:C+11,y:E},{x:C+5.5,y:E+6}],1),e.fillStyle=h,e.fill()}else if(r.menuIcon===Ln.Dots){e.beginPath();const C=f.x+f.width/2,E=f.y+f.height/2;hr(e,C,E),e.fillStyle=h,e.fill()}else{const C=f.x+(f.width-s.headerIconSize)/2,E=f.y+(f.height-s.headerIconSize)/2;u.drawSprite(r.menuIcon,"normal",e,C,E,s.headerIconSize,s)}}function di(e,t,n,o,i,r,l,s,a,d,u,g,m,f){const c=Vn(r.title)==="rtl",h=ai(t,n,o,i,c);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:i},column:r,columnIndex:r.sourceIndex,isSelected:l,hoverAmount:u,isHovered:a,hasSelectedCell:d,spriteManager:g,menuBounds:h},()=>Fo(e,t,n,o,i,r,l,s,a,u,g,f,c,h)):Fo(e,t,n,o,i,r,l,s,a,u,g,f,c,h)}function Er(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const C=oi(b);wt(t,a,l,s,r,(E,D,H,A,R)=>{if(E!==t[t.length-1])return;D+=E.width;const x=Math.max(D,A);x>o||(e.save(),e.beginPath(),e.rect(x,r+1,1e4,i-r-1),e.clip(),pn(R,H,i,d,u,c,h,C,(B,I,w,k)=>{if(!k&&b.length>0&&!b.some(Z=>bn(D,B,1e4,w,Z.x,Z.y,Z.width,Z.height)))return;const p=m.hasIndex(I),j=f.hasIndex(I);e.beginPath();const _=g==null?void 0:g(I),Y=_===void 0?S:Jt(S,_);Y.bgCell!==S.bgCell&&(e.fillStyle=Y.bgCell,e.fillRect(D,B,1e4,w)),j&&(e.fillStyle=Y.bgHeader,e.fillRect(D,B,1e4,w)),p&&(e.fillStyle=Y.accentLight,e.fillRect(D,B,1e4,w))}),e.restore())})}function Fr(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 u=a.horizontalBorderColor??a.borderColor,g=a.borderColor,m=d?zt(t):0;let f;if(m!==0&&(f=Io(g,a.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=f,e.stroke()),i>0){const c=g===u&&f!==void 0?f:Io(u,a.bgCell),h=Ot(r,i,s);e.beginPath(),e.moveTo(0,o-h+.5),e.lineTo(n,o-h+.5),e.strokeStyle=c,e.stroke()}}const ui=(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 Dr(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c){var w;const h=c.bgCell,{minX:b,maxX:v,minY:S,maxY:C}=ui(s,r,l),E=[],D=l-Ot(f,m,d);let H=a,A=n,R=0;for(;H+i=S&&k<=C-1){const j=u==null?void 0:u(A),_=j==null?void 0:j.bgCell;_!==void 0&&_!==h&&A>=f-m&&E.push({x:b,y:k,w:v-b,h:p,color:_})}H+=p,A0)for(let k=0;k=b&&j<=v&&g(k+1)&&E.push({x:j,y:R,w:p.width,h:B,color:_}),x+=p.width}if(E.length===0)return;let I;e.beginPath();for(let k=E.length-1;k>=0;k--){const p=E[k];I===void 0?I=p.color:p.color!==I&&(e.fillStyle=I,e.fill(),e.beginPath(),I=p.color),e.rect(p.x,p.y,p.w,p.h)}I!==void 0&&(e.fillStyle=I,e.fill()),e.beginPath()}function Do(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,r,l);for(const w of a)e.rect(w.x+1,w.y+1,w.width-1,w.height-1);e.clip("evenodd")}const S=b.horizontalBorderColor??b.borderColor,C=b.borderColor,{minX:E,maxX:D,minY:H,maxY:A}=ui(s,r,l),R=[];e.beginPath();let x=.5;for(let w=0;w=E&&p<=D&&f(w+1)&&R.push({x1:p,y1:Math.max(d,H),x2:p,y2:Math.min(l,A),color:C})}let B=l+.5;for(let w=h-c;w=H&&j<=A-1){const _=m==null?void 0:m(k);R.push({x1:E,y1:j,x2:D,y2:j,color:(_==null?void 0:_.horizontalBorderColor)??(_==null?void 0:_.borderColor)??S})}w+=g(k),k++}}const I=zi(R,w=>w.color);for(const w of Object.keys(I)){e.strokeStyle=w;for(const k of I[w])e.moveTo(k.x1,k.y1),e.lineTo(k.x2,k.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function Ar(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){const C=[];e.imageSmoothingEnabled=!1;const E=Math.min(i.cellYOffset,l),D=Math.max(i.cellYOffset,l);let H=0;if(typeof v=="number")H+=(D-E)*v;else for(let p=E;pi.cellYOffset&&(H=-H),H+=a-i.translateY;const A=Math.min(i.cellXOffset,r),R=Math.max(i.cellXOffset,r);let x=0;for(let p=A;pi.cellXOffset&&(x=-x),x+=s-i.translateX;const B=zt(b);if(x!==0&&H!==0)return{regions:[]};const I=d>0?Ot(m,d,v):0,w=u-B-Math.abs(x),k=g-f-I-Math.abs(H)-1;if(w>150&&k>150){const p={sx:0,sy:0,sw:u*c,sh:g*c,dx:0,dy:0,dw:u*c,dh:g*c};if(H>0?(p.sy=(f+1)*c,p.sh=k*c,p.dy=(H+f+1)*c,p.dh=k*c,C.push({x:0,y:f,width:u,height:H+1})):H<0&&(p.sy=(-H+f+1)*c,p.sh=k*c,p.dy=(f+1)*c,p.dh=k*c,C.push({x:0,y:g+H-I,width:u,height:-H+I})),x>0?(p.sx=B*c,p.sw=w*c,p.dx=(x+B)*c,p.dw=w*c,C.push({x:B-1,y:0,width:x+2,height:g})):x<0&&(p.sx=(B-x)*c,p.sw=w*c,p.dx=B*c,p.dw=w*c,C.push({x:u+x,y:0,width:-x,height:g})),e.setTransform(1,0,0,1,0,0),S){if(B>0&&x!==0&&H===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const j=B*c,_=g*c;e.drawImage(t,0,0,j,_,0,0,j,_)}if(I>0&&x===0&&H!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const j=(g-I)*c,_=u*c,Y=I*c;e.drawImage(t,0,j,_,Y,0,j,_,Y)}}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:C}}function Hr(e,t,n,o,i,r,l,s,a,d){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||i!==e.translateY||wt(a,n,o,i,s,(g,m,f,c)=>{if(g.sourceIndex===d){const h=Math.max(m,c)+1;return u.push({x:h,y:0,width:r-h,height:l}),!0}}),u}function Pr(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(b===void 0||b.length===0)return;const v=zt(s),S=Ot(f,m,g),C=[a,0,s.length,f-m],E=[v,0,t,n-S],D=b.map(A=>{const R=A.range,x=A.style??"dashed";return xr(R,C,t,n,E).map(B=>{const I=B.rect,w=Xn(I.x,I.y,t,n,u,d+u,o,i,r,l,f,a,m,s,g),k=I.width===1&&I.height===1?w:Xn(I.x+I.width-1,I.y+I.height-1,t,n,u,d+u,o,i,r,l,f,a,m,s,g);return I.x+I.width>=s.length&&(k.width-=1),I.y+I.height>=f&&(k.height-=1),{color:A.color,style:x,clip:B.clip,rect:kr({x:w.x,y:w.y,width:k.x+k.width-w.x,height:k.y+k.height-w.y},t,n,8)}})}),H=()=>{e.lineWidth=1;let A=!1;for(const R of D)for(const x of R)if((x==null?void 0:x.rect)!==void 0&&bn(0,0,t,n,x.rect.x,x.rect.y,x.rect.width,x.rect.height)){const B=A,I=!wr(x.clip,x.rect);I&&(e.save(),e.rect(x.clip.x,x.clip.y,x.clip.width,x.clip.height),e.clip()),x.style==="dashed"&&!A?(e.setLineDash([5,3]),A=!0):(x.style==="solid"||x.style==="solid-outline")&&A&&(e.setLineDash([]),A=!1),e.strokeStyle=x.style==="solid-outline"?Ye(Ye(x.color,h.borderColor),h.bgCell):en(x.color,1),e.strokeRect(x.rect.x+.5,x.rect.y+.5,x.rect.width-1,x.rect.height-1),I&&(e.restore(),A=B)}A&&e.setLineDash([])};return H(),H}function Ho(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 An(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b){if(u.current===void 0)return;const v=u.current.range,S=u.current.cell,C=[v.x+v.width-1,v.y+v.height-1];if(S[1]>=b&&C[1]>=b||!l.some(p=>p.sourceIndex===S[0]||p.sourceIndex===C[0]))return;const[D,H]=u.current.cell,A=m(u.current.cell),R=A.span??[D,D],x=H>=b-f,B=f>0&&!x?Ot(b,f,g)-1:0,I=C[1];let w;if(wt(l,o,i,r,d,(p,j,_,Y,Z)=>{if(p.sticky&&D>p.sourceIndex)return;const we=p.sourceIndexR[1],de=p.sourceIndex===C[0];if(!(!de&&(we||me)))return pn(Z,_,n,b,g,f,c,void 0,(re,ke,ze)=>{if(ke!==H&&ke!==I)return;let O=j,He=p.width;if(A.span!==void 0){const te=ri(A.span,j,re,p.width,ze,p,s),Se=p.sticky?te[0]:te[1];Se!==void 0&&(O=Se.x,He=Se.width)}return ke===I&&de&&h&&(w=()=>{var te;Y>O&&!p.sticky&&(e.beginPath(),e.rect(Y,0,t-Y,n),e.clip()),e.beginPath(),e.rect(O+He-4,re+ze-4,4,4),e.fillStyle=((te=p.themeOverride)==null?void 0:te.accentColor)??a.accentColor,e.fill()}),w!==void 0}),w!==void 0}),w===void 0)return;const k=()=>{e.save(),e.beginPath(),e.rect(0,d,t,n-d-B),e.clip(),w==null||w(),e.restore()};return k(),k}function Br(e,t,n,o,i,r,l,s,a){a===void 0||a.size===0||(e.beginPath(),ii(t,n,r,o,(d,u,g,m,f,c)=>{a.hasItemInRectangle({x:d[0],y:-2,width:d[1]-d[0]+1,height:1})&&e.rect(g,m,f,c)}),wt(t,s,r,l,i,(d,u,g,m)=>{const f=Math.max(0,m-u),c=u+f+1,h=d.width-f-1;a.has([d.sourceIndex,-1])&&e.rect(c,o,h,i-o)}),e.clip())}function Tr(e,t,n,o,i,r,l,s,a,d){let u=0;return wt(e,r,o,i,n,(g,m,f,c,h)=>(pn(h,f,t,l,s,a,d,void 0,(b,v,S,C)=>{C||(u=Math.max(v,u))}),!0)),u}function Po(e,t){var Mt;const{canvasCtx:n,headerCanvasCtx:o,width:i,height:r,cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mappedColumns:u,enableGroups:g,freezeColumns:m,dragAndDropState:f,theme:c,drawFocus:h,headerHeight:b,groupHeaderHeight:v,disabledRows:S,rowHeight:C,verticalBorder:E,overrideCursor:D,isResizing:H,selection:A,fillHandle:R,freezeTrailingRows:x,rows:B,getCellContent:I,getGroupDetails:w,getRowThemeOverride:k,isFocused:p,drawHeaderCallback:j,prelightCells:_,drawCellCallback:Y,highlightRegions:Z,resizeCol:we,imageLoader:me,lastBlitData:de,hoverValues:re,hyperWrapping:ke,hoverInfo:ze,spriteManager:O,maxScaleFactor:He,hasAppendRow:Oe,touchMode:te,enqueue:Se,renderStateProvider:kt,getCellRenderer:lt,renderStrategy:xt,bufferACtx:_e,bufferBCtx:Pe,damage:Be,minimumCellWidth:gt}=e;if(i===0||r===0)return;const Xe=xt==="double-buffer",se=Math.min(He,Math.ceil(window.devicePixelRatio??1)),Ue=xt!=="direct"&&Pr(e,t),Ie=n.canvas;(Ie.width!==i*se||Ie.height!==r*se)&&(Ie.width=i*se,Ie.height=r*se,Ie.style.width=i+"px",Ie.style.height=r+"px");const We=o.canvas,ce=g?v+b:b,ve=ce+1;(We.width!==i*se||We.height!==ve*se)&&(We.width=i*se,We.height=ve*se,We.style.width=i+"px",We.style.height=ve+"px");const ye=_e.canvas,ue=Pe.canvas;Xe&&(ye.width!==i*se||ye.height!==r*se)&&(ye.width=i*se,ye.height=r*se,de.current!==void 0&&(de.current.aBufferScroll=void 0)),Xe&&(ue.width!==i*se||ue.height!==r*se)&&(ue.width=i*se,ue.height=r*se,de.current!==void 0&&(de.current.bBufferScroll=void 0));const T=de.current;if(Ue===!0&&l===(T==null?void 0:T.cellXOffset)&&s===(T==null?void 0:T.cellYOffset)&&a===(T==null?void 0:T.translateX)&&d===(T==null?void 0:T.translateY))return;let K=null;Xe&&(K=n);const le=o;let V;Xe?Be!==void 0?V=(T==null?void 0:T.lastBuffer)==="b"?Pe:_e:V=(T==null?void 0:T.lastBuffer)==="b"?_e:Pe:V=n;const Te=V.canvas,ie=Xe?Te===ye?ue:ye:Ie,ne=typeof C=="number"?()=>C:C;le.save(),V.save(),le.beginPath(),V.beginPath(),le.textBaseline="middle",V.textBaseline="middle",se!==1&&(le.scale(se,se),V.scale(se,se));const oe=On(u,l,i,f,a);let Ee=[];const Ke=h&&((Mt=A.current)==null?void 0:Mt.cell[1])===s&&d===0;let it=!1;if(Z!==void 0){for(const he of Z)if(he.style!=="no-outline"&&he.range.y===s&&d===0){it=!0;break}}const mt=()=>{Mr(le,oe,g,ze,i,a,b,v,f,H,A,c,O,re,E,w,Be,j,te),Do(le,oe,s,a,d,i,r,void 0,void 0,v,ce,ne,k,E,x,B,c,!0),le.beginPath(),le.moveTo(0,ve-.5),le.lineTo(i,ve-.5),le.strokeStyle=Ye(c.headerBottomBorderColor??c.horizontalBorderColor??c.borderColor,c.bgHeader),le.stroke(),it&&Ao(le,i,r,l,s,a,d,u,m,b,v,C,x,B,Z,c),Ke&&An(le,i,r,s,a,d,oe,u,c,ce,A,ne,I,x,Oe,R,B)};if(Be!==void 0){const he=oe[oe.length-1].sourceIndex+1,Ne=Be.hasItemInRegion([{x:l,y:-2,width:he,height:2},{x:l,y:s,width:he,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:l,y:B-x,width:he,height:x,when:x>0}]),Je=Qe=>{Eo(Qe,oe,u,r,ce,a,d,s,B,ne,I,w,k,S,p,h,x,Oe,Ee,Be,A,_,Z,me,O,re,ze,Y,ke,c,Se,kt,lt,D,gt);const Ze=A.current;R&&h&&Ze!==void 0&&Be.has(Go(Ze.range))&&An(Qe,i,r,s,a,d,oe,u,c,ce,A,ne,I,x,Oe,R,B)};Ne&&(Je(V),K!==null&&(K.save(),K.scale(se,se),K.textBaseline="middle",Je(K),K.restore()),Be.hasHeader()&&(Br(le,oe,i,v,ce,a,d,s,Be),mt())),V.restore(),le.restore();return}if((Ue!==!0||l!==(T==null?void 0:T.cellXOffset)||a!==(T==null?void 0:T.translateX)||Ke!==(T==null?void 0:T.mustDrawFocusOnHeader)||it!==(T==null?void 0:T.mustDrawHighlightRingsOnHeader))&&mt(),Ue===!0){ut(ie!==void 0&&T!==void 0);const{regions:he}=Ar(V,ie,ie===ye?T.aBufferScroll:T.bBufferScroll,ie===ye?T.bBufferScroll:T.aBufferScroll,T,l,s,a,d,x,i,r,B,ce,se,u,oe,C,Xe);Ee=he}else Ue!==!1&&(ut(T!==void 0),Ee=Hr(T,l,s,a,d,i,r,ce,oe,Ue));Fr(V,oe,i,r,x,B,E,ne,c);const Re=Ao(V,i,r,l,s,a,d,u,m,b,v,C,x,B,Z,c),Ge=h?An(V,i,r,s,a,d,oe,u,c,ce,A,ne,I,x,Oe,R,B):void 0;if(V.fillStyle=c.bgCell,Ee.length>0){V.beginPath();for(const he of Ee)V.rect(he.x,he.y,he.width,he.height);V.clip(),V.fill(),V.beginPath()}else V.fillRect(0,0,i,r);const $e=Eo(V,oe,u,r,ce,a,d,s,B,ne,I,w,k,S,p,h,x,Oe,Ee,Be,A,_,Z,me,O,re,ze,Y,ke,c,Se,kt,lt,D,gt);Er(V,oe,u,i,r,ce,a,d,s,B,ne,k,A.rows,S,x,Oe,Ee,Be,c),Dr(V,oe,s,a,d,i,r,Ee,ce,ne,k,E,x,B,c),Do(V,oe,s,a,d,i,r,Ee,$e,v,ce,ne,k,E,x,B,c),Re==null||Re(),Ge==null||Ge(),H&&wt(oe,0,a,0,ce,(he,Ne)=>he.sourceIndex===we?(Ho(le,Ne+he.width,0,ce+1,Ye(c.resizeIndicatorColor??c.accentLight,c.bgHeader)),Ho(V,Ne+he.width,ce,r,Ye(c.resizeIndicatorColor??c.accentLight,c.bgCell)),!0):!1),K!==null&&(K.fillStyle=c.bgCell,K.fillRect(0,0,i,r),K.drawImage(V.canvas,0,0));const Ct=Tr(oe,r,ce,a,d,s,B,ne,x,Oe);me==null||me.setWindow({x:l,y:s,width:oe.length,height:Ct-s},m,Array.from({length:x},(he,Ne)=>B-1-Ne));const St=T!==void 0&&(l!==T.cellXOffset||a!==T.translateX),be=T!==void 0&&(s!==T.cellYOffset||d!==T.translateY);de.current={cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mustDrawFocusOnHeader:Ke,mustDrawHighlightRingsOnHeader:it,lastBuffer:Xe?Te===ye?"a":"b":void 0,aBufferScroll:Te===ye?[St,be]:T==null?void 0:T.aBufferScroll,bBufferScroll:Te===ue?[St,be]:T==null?void 0:T.bBufferScroll},V.restore(),le.restore()}const Rr=80;function Lr(e){const t=e-1;return t*t*t+1}class Wr{constructor(t){ee(this,"currentHoveredItem");ee(this,"leavingItems",[]);ee(this,"lastAnimationTime");ee(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>hn(o.item,t.item))||this.leavingItems.push(t)});ee(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>hn(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});ee(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ee(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ee(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Lr(t.hoverAmount)})));ee(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/Rr;for(const r of this.leavingItems)r.hoverAmount=mn(r.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=mn(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});ee(this,"setHovered",t=>{var n;if(!hn((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 Nr{constructor(t){ee(this,"fn");ee(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function eo(e){return new Nr(e)}const zr=eo(()=>window.navigator.userAgent.includes("Firefox")),Bo=eo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),al=eo(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Or(e){const t=M.useRef([]),n=M.useRef(0),o=M.useRef(e);o.current=e;const i=M.useCallback(()=>{const r=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(Jn);t.current=[],o.current(new Kt(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?r:l)},[]);return M.useCallback(r=>{t.current.length===0&&i();const l=ot(r[0],r[1]);t.current.includes(l)||t.current.push(l)},[i])}const At="header",Ht="group-header",To="out-of-bounds";var jt=(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))(jt||{});function Xr(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 Ro=6,$r=(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))??""},Yr=(e,t)=>{const{width:n,height:o,accessibilityHeight:i,columns:r,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:d=!1,groupHeaderHeight:u,rowHeight:g,rows:m,getCellContent:f,getRowThemeOverride:c,onHeaderMenuClick:h,enableGroups:b,isFilling:v,onCanvasFocused:S,onCanvasBlur:C,isFocused:E,selection:D,freezeColumns:H,onContextMenu:A,freezeTrailingRows:R,fixedShadowX:x=!0,fixedShadowY:B=!0,drawFocusRing:I,onMouseDown:w,onMouseUp:k,onMouseMoveRaw:p,onMouseMove:j,onItemHovered:_,dragAndDropState:Y,firstColAccessible:Z,onKeyDown:we,onKeyUp:me,highlightRegions:de,canvasRef:re,onDragStart:ke,onDragEnd:ze,eventTargetRef:O,isResizing:He,resizeColumn:Oe,isDragging:te,isDraggable:Se=!1,allowResize:kt,disabledRows:lt,hasAppendRow:xt,getGroupDetails:_e,theme:Pe,prelightCells:Be,headerIcons:gt,verticalBorder:Xe,drawCell:se,drawHeader:Ue,onCellFocused:Ie,onDragOverCell:We,onDrop:ce,onDragLeave:ve,imageWindowLoader:ye,smoothScrollX:ue=!1,smoothScrollY:T=!1,experimental:K,getCellRenderer:le}=e,V=e.translateX??0,Te=e.translateY??0,ie=Math.max(H,Math.min(r.length-1,l)),ne=M.useRef(null),oe=ye,Ee=M.useRef(),[Ke,it]=M.useState(!1),mt=M.useRef([]),Re=M.useRef(),[Ge,$e]=M.useState(),[Ct,St]=M.useState(),be=M.useRef(null),[Mt,he]=M.useState(),[Ne,Je]=M.useState(!1),Qe=M.useRef(Ne);Qe.current=Ne;const Ze=M.useMemo(()=>new br(gt,()=>{nn.current=void 0,Xt.current()}),[gt]),at=b?u+a:a,J=M.useRef(-1),Fe=((K==null?void 0:K.enableFirefoxRescaling)??!1)&&zr.value,xe=((K==null?void 0:K.enableSafariRescaling)??!1)&&Bo.value;M.useLayoutEffect(()=>{window.devicePixelRatio===1||!Fe&&!xe||(J.current!==-1&&it(!0),window.clearTimeout(J.current),J.current=window.setTimeout(()=>{it(!1),J.current=-1},200))},[s,ie,V,Te,Fe,xe]);const Ce=er(r,H),qe=x?zt(Ce,Y):0,pe=M.useCallback((y,F,N)=>{const W=y.getBoundingClientRect();if(F>=Ce.length||N>=m)return;const P=W.width/n,L=Xn(F,N,n,o,u,at,ie,s,V,Te,m,H,R,Ce,g);return P!==1&&(L.x*=P,L.y*=P,L.width*=P,L.height*=P),L.x+=W.x,L.y+=W.y,L},[n,o,u,at,ie,s,V,Te,m,H,R,Ce,g]),Le=M.useCallback((y,F,N,W)=>{const P=y.getBoundingClientRect(),L=P.width/n,U=(F-P.left)/L,q=(N-P.top)/L,z=5,De=On(Ce,ie,n,void 0,V);let X=0,ge=0;W instanceof MouseEvent&&(X=W.button,ge=W.buttons);const G=ir(U,De,V),Q=rr(q,o,b,a,u,m,g,s,Te,R),Ae=(W==null?void 0:W.shiftKey)===!0,et=(W==null?void 0:W.ctrlKey)===!0,Me=(W==null?void 0:W.metaKey)===!0,ct=W!==void 0&&!(W instanceof MouseEvent)||(W==null?void 0:W.pointerType)==="touch",yt=[U<0?-1:nn||q>o){const fe=U>n?1:U<0?-1:0,nt=q>o?1:q<0?-1:0;let rt=fe*2,Yt=nt*2;fe===0&&(rt=G===-1?jt.EndPadding:jt.Center),nt===0&&(Yt=Q===void 0?jt.EndPadding:jt.Center);let bt=!1;if(G===-1&&Q===-1){const _t=pe(y,Ce.length-1,-1);ut(_t!==void 0),bt=F<_t.x+_t.width+z}const En=U>n&&Uo&&q=0?(nt=!0,fe=pe(y,rt,Q),ut(fe!==void 0),tt={kind:b&&Q===-2?Ht:At,location:[rt,Q],bounds:fe,group:Ce[rt].group??"",isEdge:nt,shiftKey:Ae,ctrlKey:et,metaKey:Me,isTouch:ct,localEventX:F-fe.x,localEventY:N-fe.y,button:X,buttons:ge,scrollEdge:yt}):tt={kind:b&&Q===-2?Ht:At,group:Ce[G].group??"",location:[G,Q],bounds:fe,isEdge:nt,shiftKey:Ae,ctrlKey:et,metaKey:Me,isTouch:ct,localEventX:F-fe.x,localEventY:N-fe.y,button:X,buttons:ge,scrollEdge:yt}}else{const fe=pe(y,G,Q);ut(fe!==void 0);const nt=fe!==void 0&&fe.x+fe.width-F{}),Pt=M.useRef(Ge);Pt.current=Ge;const[Et,Ft]=M.useMemo(()=>{const y=document.createElement("canvas"),F=document.createElement("canvas");return y.style.display="none",y.style.opacity="0",y.style.position="fixed",F.style.display="none",F.style.opacity="0",F.style.position="fixed",[y.getContext("2d",{alpha:!1}),F.getContext("2d",{alpha:!1})]},[]);M.useLayoutEffect(()=>{if(!(Et===null||Ft===null))return document.documentElement.append(Et.canvas),document.documentElement.append(Ft.canvas),()=>{Et.canvas.remove(),Ft.canvas.remove()}},[Et,Ft]);const tn=M.useMemo(()=>new mr,[]),no=Fe&&Ke?1:xe&&Ke?2:5,oo=(K==null?void 0:K.disableMinimumCellWidth)===!0?1:10,nn=M.useRef(),on=M.useRef(null),rn=M.useRef(null),sn=M.useCallback(()=>{var U;const y=ne.current,F=be.current;if(y===null||F===null||(on.current===null&&(on.current=y.getContext("2d",{alpha:!1}),y.width=0,y.height=0),rn.current===null&&(rn.current=F.getContext("2d",{alpha:!1}),F.width=0,F.height=0),on.current===null||rn.current===null||Et===null||Ft===null))return;let N=!1;const W=q=>{N=!0,he(q)},P=nn.current,L={headerCanvasCtx:rn.current,canvasCtx:on.current,bufferACtx:Et,bufferBCtx:Ft,width:n,height:o,cellXOffset:ie,cellYOffset:s,translateX:Math.round(V),translateY:Math.round(Te),mappedColumns:Ce,enableGroups:b,freezeColumns:H,dragAndDropState:Y,theme:Pe,headerHeight:a,groupHeaderHeight:u,disabledRows:lt??Nn.empty(),rowHeight:g,verticalBorder:Xe,isResizing:He,resizeCol:Oe,isFocused:E,selection:D,fillHandle:d,drawCellCallback:se,hasAppendRow:xt,overrideCursor:W,maxScaleFactor:no,freezeTrailingRows:R,rows:m,drawFocus:I,getCellContent:f,getGroupDetails:_e??(q=>({name:q})),getRowThemeOverride:c,drawHeaderCallback:Ue,prelightCells:Be,highlightRegions:de,imageLoader:oe,lastBlitData:Re,damage:Ee.current,hoverValues:mt.current,hoverInfo:Pt.current,spriteManager:Ze,scrolling:Ke,hyperWrapping:(K==null?void 0:K.hyperWrapping)??!1,touchMode:Ne,enqueue:to.current,renderStateProvider:tn,renderStrategy:(K==null?void 0:K.renderStrategy)??(Bo.value?"double-buffer":"single-buffer"),getCellRenderer:le,minimumCellWidth:oo};L.damage===void 0?(nn.current=L,Po(L,P)):Po(L,void 0),!N&&(L.damage===void 0||L.damage.has((U=Pt==null?void 0:Pt.current)==null?void 0:U[0]))&&he(void 0)},[Et,Ft,n,o,ie,s,V,Te,Ce,b,H,Y,Pe,a,u,lt,g,Xe,He,xt,Oe,E,D,d,R,m,I,no,f,_e,c,se,Ue,Be,de,oe,Ze,Ke,K==null?void 0:K.hyperWrapping,K==null?void 0:K.renderStrategy,Ne,tn,le,oo]),Xt=M.useRef(sn);M.useLayoutEffect(()=>{sn(),Xt.current=sn},[sn]),M.useLayoutEffect(()=>{(async()=>{var F;((F=document==null?void 0:document.fonts)==null?void 0:F.ready)!==void 0&&(await document.fonts.ready,nn.current=void 0,Xt.current())})()},[]);const Bt=M.useCallback(y=>{Ee.current=y,Xt.current(),Ee.current=void 0},[]),fi=Or(Bt);to.current=fi;const io=M.useCallback(y=>{Bt(new Kt(y.map(F=>F.cell)))},[Bt]);oe.setCallback(Bt);const[hi,gi]=M.useState(!1),[ln,Tt]=It??[],mi=ln!==void 0&&Tt===-1,yi=ln!==void 0&&Tt===-2;let ro=!1,so=!1,an=Mt;if(an===void 0&&ln!==void 0&&Tt!==void 0&&Tt>-1&&Tt({contain:"strict",display:"block",cursor:lo}),[lo]),ao=M.useRef("default"),kn=O==null?void 0:O.current;kn!=null&&ao.current!==wn.cursor&&(kn.style.cursor=ao.current=wn.cursor);const Rt=M.useCallback((y,F,N,W)=>{if(_e===void 0)return;const P=_e(y);if(P.actions!==void 0){const L=ci(F,P.actions);for(const[U,q]of L.entries())if(Qn(q,N+F.x,W+q.y))return P.actions[U]}},[_e]),Lt=M.useCallback((y,F,N,W)=>{const P=r[F];if(!te&&!He&&P.hasMenu===!0&&!(Ct??!1)){const L=pe(y,F,-1);ut(L!==void 0);const U=ai(L.x,L.y,L.width,L.height,Vn(P.title)==="rtl");if(N>U.x&&NU.y&&W{const F=ne.current,N=O==null?void 0:O.current;if(F===null||y.target!==F&&y.target!==N)return;Cn.current=!0;let W,P;if(y instanceof MouseEvent?(W=y.clientX,P=y.clientY):(W=y.touches[0].clientX,P=y.touches[0].clientY),y.target===N&&N!==null){const U=N.getBoundingClientRect();if(W>U.right||P>U.bottom)return}const L=Le(F,W,P,y);$t.current=L.location,L.isTouch&&(xn.current=Date.now()),Qe.current!==L.isTouch&&Je(L.isTouch),!(L.kind===At&&Lt(F,L.location[0],W,P)!==void 0)&&(L.kind===Ht&&Rt(L.group,L.bounds,L.localEventX,L.localEventY)!==void 0||(w==null||w(L),!L.isTouch&&Se!==!0&&Se!==L.kind&&L.button<3&&L.button!==1&&y.preventDefault()))},[O,Se,Le,Rt,Lt,w]);je("touchstart",co,window,!1),je("mousedown",co,window,!1);const uo=M.useRef(0),fo=M.useCallback(y=>{var ge,G;const F=uo.current;uo.current=Date.now();const N=ne.current;if(Cn.current=!1,k===void 0||N===null)return;const W=O==null?void 0:O.current,P=y.target!==N&&y.target!==W;let L,U,q=!0;if(y instanceof MouseEvent){if(L=y.clientX,U=y.clientY,q=y.button<3,y.pointerType==="touch")return}else L=y.changedTouches[0].clientX,U=y.changedTouches[0].clientY;let z=Le(N,L,U,y);z.isTouch&&xn.current!==0&&Date.now()-xn.current>500&&(z={...z,isLongTouch:!0}),F!==0&&Date.now()-F<(z.isTouch?1e3:500)&&(z={...z,isDoubleClick:!0}),Qe.current!==z.isTouch&&Je(z.isTouch),!P&&y.cancelable&&q&&y.preventDefault();const[De]=z.location,X=Lt(N,De,L,U);if(z.kind===At&&X!==void 0){(z.button!==0||((ge=$t.current)==null?void 0:ge[0])!==De||((G=$t.current)==null?void 0:G[1])!==-1)&&k(z,!0);return}else if(z.kind===Ht){const Q=Rt(z.group,z.bounds,z.localEventX,z.localEventY);if(Q!==void 0){z.button===0&&Q.onClick(z);return}}k(z,P)},[k,O,Le,Lt,Rt]);je("mouseup",fo,window,!1),je("touchend",fo,window,!1);const bi=M.useCallback(y=>{var X,ge;const F=ne.current;if(F===null)return;const N=O==null?void 0:O.current,W=y.target!==F&&y.target!==N;let P,L,U=!0;y instanceof MouseEvent?(P=y.clientX,L=y.clientY,U=y.button<3):(P=y.changedTouches[0].clientX,L=y.changedTouches[0].clientY);const q=Le(F,P,L,y);Qe.current!==q.isTouch&&Je(q.isTouch),!W&&y.cancelable&&U&&y.preventDefault();const[z]=q.location,De=Lt(F,z,P,L);if(q.kind===At&&De!==void 0)q.button===0&&((X=$t.current)==null?void 0:X[0])===z&&((ge=$t.current)==null?void 0:ge[1])===-1&&(h==null||h(z,De));else if(q.kind===Ht){const G=Rt(q.group,q.bounds,q.localEventX,q.localEventY);G!==void 0&&q.button===0&&G.onClick(q)}},[O,Le,Lt,h,Rt]);je("click",bi,window,!1);const pi=M.useCallback(y=>{const F=ne.current,N=O==null?void 0:O.current;if(F===null||y.target!==F&&y.target!==N||A===void 0)return;const W=Le(F,y.clientX,y.clientY,y);A(W,()=>{y.cancelable&&y.preventDefault()})},[O,Le,A]);je("contextmenu",pi,(O==null?void 0:O.current)??null,!1);const ho=M.useCallback(y=>{Ee.current=new Kt(y.map(F=>F.item)),mt.current=y,Xt.current(),Ee.current=void 0},[]),go=M.useMemo(()=>new Wr(ho),[ho]),mo=M.useRef(go);mo.current=go,M.useLayoutEffect(()=>{const y=mo.current;if(It===void 0||It[1]<0){y.setHovered(It);return}const F=f(It,!0),N=le(F),W=N===void 0&&F.kind===ae.Custom||(N==null?void 0:N.needsHover)!==void 0&&(typeof N.needsHover=="boolean"?N.needsHover:N.needsHover(F));y.setHovered(W?It:void 0)},[f,le,It]);const yo=M.useRef(),vi=M.useCallback(y=>{var q;const F=ne.current;if(F===null)return;const N=O==null?void 0:O.current,W=y.target!==F&&y.target!==N,P=Le(F,y.clientX,y.clientY,y);if(P.kind!=="out-of-bounds"&&W&&!Cn.current&&!P.isTouch)return;const L=(z,De)=>{$e(X=>X===z||(X==null?void 0:X[0][0])===(z==null?void 0:z[0][0])&&(X==null?void 0:X[0][1])===(z==null?void 0:z[0][1])&&((X==null?void 0:X[1][0])===(z==null?void 0:z[1][0])&&(X==null?void 0:X[1][1])===(z==null?void 0:z[1][1])||!De)?X:z)};if(!Xr(P,yo.current))he(void 0),_==null||_(P),L(P.kind===To?void 0:[P.location,[P.localEventX,P.localEventY]],!0),yo.current=P;else if(P.kind==="cell"||P.kind===At||P.kind===Ht){let z=!1,De=!0;if(P.kind==="cell"){const ge=f(P.location);De=((q=le(ge))==null?void 0:q.needsHoverPosition)??ge.kind===ae.Custom,z=De}else P.kind===Ht&&(z=!0);const X=[P.location,[P.localEventX,P.localEventY]];L(X,De),Pt.current=X,z&&Bt(new Kt([P.location]))}const U=P.location[0]>=(Z?0:1);St(P.kind===At&&P.isEdge&&U&&kt===!0),gi(P.kind==="cell"&&P.isFillHandle),p==null||p(y),j(P)},[O,Le,Z,kt,p,j,_,f,le,Bt]);je("mousemove",vi,window,!0);const wi=M.useCallback(y=>{const F=ne.current;if(F===null)return;let N,W;D.current!==void 0&&(N=pe(F,D.current.cell[0],D.current.cell[1]),W=D.current.cell),we==null||we({bounds:N,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:W})},[we,D,pe]),ki=M.useCallback(y=>{const F=ne.current;if(F===null)return;let N,W;D.current!==void 0&&(N=pe(F,D.current.cell[0],D.current.cell[1]),W=D.current.cell),me==null||me({bounds:N,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:W})},[me,D,pe]),xi=M.useCallback(y=>{ne.current=y,re!==void 0&&(re.current=y)},[re]),Ci=M.useCallback(y=>{const F=ne.current;if(F===null||Se===!1||He){y.preventDefault();return}let N,W;const P=Le(F,y.clientX,y.clientY);if(Se!==!0&&P.kind!==Se){y.preventDefault();return}const L=(ge,G)=>{N=ge,W=G};let U,q,z;const De=(ge,G,Q)=>{U=ge,q=G,z=Q};let X=!1;if(ke==null||ke({...P,setData:L,setDragImage:De,preventDefault:()=>X=!0,defaultPrevented:()=>X}),!X&&N!==void 0&&W!==void 0&&y.dataTransfer!==null)if(y.dataTransfer.setData(N,W),y.dataTransfer.effectAllowed="copyLink",U!==void 0&&q!==void 0&&z!==void 0)y.dataTransfer.setDragImage(U,q,z);else{const[ge,G]=P.location;if(G!==void 0){const Q=document.createElement("canvas"),Ae=pe(F,ge,G);ut(Ae!==void 0);const et=Math.ceil(window.devicePixelRatio??1);Q.width=Ae.width*et,Q.height=Ae.height*et;const Me=Q.getContext("2d");Me!==null&&(Me.scale(et,et),Me.textBaseline="middle",G===-1?(Me.font=Pe.headerFontFull,Me.fillStyle=Pe.bgHeader,Me.fillRect(0,0,Q.width,Q.height),di(Me,0,0,Ae.width,Ae.height,Ce[ge],!1,Pe,!1,!1,0,Ze,Ue,!1)):(Me.font=Pe.baseFontFull,Me.fillStyle=Pe.bgCell,Me.fillRect(0,0,Q.width,Q.height),li(Me,f([ge,G]),0,G,!1,!1,0,0,Ae.width,Ae.height,!1,Pe,Pe.bgCell,oe,Ze,1,void 0,!1,0,void 0,void 0,void 0,tn,le,()=>{}))),Q.style.left="-100%",Q.style.position="absolute",Q.style.width=`${Ae.width}px`,Q.style.height=`${Ae.height}px`,document.body.append(Q),y.dataTransfer.setDragImage(Q,Ae.width/2,Ae.height/2),window.setTimeout(()=>{Q.remove()},0)}}else y.preventDefault()},[Se,He,Le,ke,pe,Pe,Ce,Ze,Ue,f,oe,tn,le]);je("dragstart",Ci,(O==null?void 0:O.current)??null,!1,!1);const Sn=M.useRef(),Si=M.useCallback(y=>{const F=ne.current;if(ce!==void 0&&y.preventDefault(),F===null||We===void 0)return;const N=Le(F,y.clientX,y.clientY),[W,P]=N.location,L=W-(Z?0:1),[U,q]=Sn.current??[];(U!==L||q!==P)&&(Sn.current=[L,P],We([L,P],y.dataTransfer))},[Z,Le,We,ce]);je("dragover",Si,(O==null?void 0:O.current)??null,!1,!1);const Mi=M.useCallback(()=>{Sn.current=void 0,ze==null||ze()},[ze]);je("dragend",Mi,(O==null?void 0:O.current)??null,!1,!1);const Ii=M.useCallback(y=>{const F=ne.current;if(F===null||ce===void 0)return;y.preventDefault();const N=Le(F,y.clientX,y.clientY),[W,P]=N.location,L=W-(Z?0:1);ce([L,P],y.dataTransfer)},[Z,Le,ce]);je("drop",Ii,(O==null?void 0:O.current)??null,!1,!1);const Ei=M.useCallback(()=>{ve==null||ve()},[ve]);je("dragleave",Ei,(O==null?void 0:O.current)??null,!1,!1);const bo=M.useRef(D);bo.current=D;const cn=M.useRef(null),Mn=M.useCallback(y=>{var F;ne.current===null||!ne.current.contains(document.activeElement)||(y===null&&bo.current.current!==void 0?(F=re==null?void 0:re.current)==null||F.focus({preventScroll:!0}):y!==null&&y.focus({preventScroll:!0}),cn.current=y)},[re]);M.useImperativeHandle(t,()=>({focus:()=>{var F;const y=cn.current;y===null||!document.contains(y)?(F=re==null?void 0:re.current)==null||F.focus({preventScroll:!0}):y.focus({preventScroll:!0})},getBounds:(y,F)=>{if(!(re===void 0||re.current===null))return pe(re.current,y??0,F??-1)},damage:io}),[re,io,pe]);const In=M.useRef(),Fi=Gi(()=>{var q,z,De;if(n<50||(K==null?void 0:K.disableAccessibilityTree)===!0)return null;let y=On(Ce,ie,n,Y,V);const F=Z?0:-1;!Z&&((q=y[0])==null?void 0:q.sourceIndex)===0&&(y=y.slice(1));const[N,W]=((z=D.current)==null?void 0:z.cell)??[],P=(De=D.current)==null?void 0:De.range,L=y.map(X=>X.sourceIndex),U=Oi(s,Math.min(m,s+i));return N!==void 0&&W!==void 0&&!(L.includes(N)&&U.includes(W))&&Mn(null),Ve("table",{role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":Ce.length+F,children:[$("thead",{role:"rowgroup",children:$("tr",{role:"row","aria-rowindex":1,children:y.map(X=>$("th",{role:"columnheader","aria-selected":D.columns.hasIndex(X.sourceIndex),"aria-colindex":X.sourceIndex+1+F,tabIndex:-1,onFocus:ge=>{if(ge.target!==cn.current)return Ie==null?void 0:Ie([X.sourceIndex,-1])},children:X.title},X.sourceIndex))})}),$("tbody",{role:"rowgroup",children:U.map(X=>$("tr",{role:"row","aria-selected":D.rows.hasIndex(X),"aria-rowindex":X+2,children:y.map(ge=>{const G=ge.sourceIndex,Q=ot(G,X),Ae=N===G&&W===X,et=P!==void 0&&G>=P.x&&G=P.y&&X{const tt=re==null?void 0:re.current;if(tt!=null)return we==null?void 0:we({bounds:pe(tt,G,X),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:ct})},onFocusCapture:tt=>{var fe,nt;if(!(tt.target===cn.current||((fe=In.current)==null?void 0:fe[0])===G&&((nt=In.current)==null?void 0:nt[1])===X))return In.current=ct,Ie==null?void 0:Ie(ct)},ref:Ae?Mn:void 0,tabIndex:-1,children:$r(yt,le)},Q)})},X))})]},"access-tree")},[n,Ce,ie,Y,V,m,s,i,D,Mn,f,re,we,pe,Ie],200),dn=H===0||!x?0:ie>H?1:mn(-V/100,0,1),Di=-s*32+Te,un=B?mn(-Di/100,0,1):0,Ai=M.useMemo(()=>{if(!dn&&!un)return null;const y={position:"absolute",top:0,left:qe,width:n-qe,height:o,opacity:dn,pointerEvents:"none",transition:ue?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},F={position:"absolute",top:at,left:0,width:n,height:o,opacity:un,pointerEvents:"none",transition:T?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return Ve(Rn,{children:[dn>0&&$("div",{id:"shadow-x",style:y}),un>0&&$("div",{id:"shadow-y",style:F})]})},[dn,un,qe,n,ue,at,o,T]),Hi=M.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return Ve(Rn,{children:[$("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:wi,onKeyUp:ki,onFocus:S,onBlur:C,ref:xi,style:wn,children:Fi}),$("canvas",{ref:be,style:Hi}),Ai]})},cl=M.memo(M.forwardRef(Yr));function _r(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:Un()}}function Ur(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"}:_r(l))})}function Lo(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=>Lo(l,!0)).join(",")):i.push(Lo(r.formatted,!1));t.push(i.join(" "))}return t.join(` +`)}function Hn(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function Wo(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function jr(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Vr(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("
${Hn(i.formatted)}
    ${i.formatted.map((l,s)=>`
  1. `+Hn(l)+"
  2. ").join("")}
${Hn(i.formatted)}
"),t.join("")}function Kr(e,t){const n=Ur(e,t),o=qr(n),i=Vr(n);return{textPlain:o,textHtml:i}}function dl(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),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,g=(u==null?void 0:u.children.length)===1&&u.children[0].nodeName==="FONT",m=a.querySelectorAll("br");for(const h of m)h.replaceWith(` +`);const f=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 h=a.querySelectorAll("li");r==null||r.push({rawValue:[...h].map(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...h].map(b=>b.textContent??""),format:"string-array"})}else if(f!==null)r==null||r.push({rawValue:jr(f),formatted:a.textContent??"",format:c});else{let h=a.textContent??"";g&&(h=h.replace(/\n(?!\n)/g,"")),r==null||r.push({rawValue:h??"",formatted:h??"",format:c})}}}return r!==void 0&&i.push(r),i}function ul(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 f=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof f=="function")return r;d.push(...f)}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 u=a.x-n,g=a.x+a.width-1-n;for(const m of d)for(const f of m)f.span!==void 0&&(u=Math.min(f.span[0],u),g=Math.max(f.span[1],g));u===a.x-n&&g===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:g-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function No(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function fl(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(No(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 hl(e,t,n){var s;const o=Kr(e,t),i=a=>{var d;(d=window.navigator.clipboard)==null||d.writeText(a)},r=(a,d)=>{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([a],{type:"text/plain"}),"text/html":new Blob([d],{type:"text/html"})})]),!0)},l=(a,d)=>{var u,g;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",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 Gr(e){return e!==!0}const zo=20,Jr={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=>Qr(e,e.cell.data,Wn(e.cell),e.cell.maxSize??zo),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,u=t.maxSize??zo,g=Math.floor(i.y+s/2),m=jo(u,s,r.cellVerticalPadding),f=qo(t.contentAlign??"center",a,l,r.cellHorizontalPadding,m),c=Uo(f,g,m),h=Vo(a+n,d+o,c);if(Wn(t)&&h)return{...t,data:Gr(t.data)}},onPaste:(e,t)=>{let n=yn;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 Qr(e,t,n,o){if(!n&&t===yn)return;const{ctx:i,hoverAmount:r,theme:l,rect:s,highlighted:a,hoverX:d,hoverY:u,cell:{contentAlign:g}}=e,{x:m,y:f,width:c,height:h}=s,b=.35;let v=n?1-b+b*r:.4;t===yn&&(v*=r),v!==0&&(i.globalAlpha=v,Zn(i,l,t,m,f,c,h,a,d,u,o,g),i.globalAlpha=1)}const Zr=ht("div")({name:"BubblesOverlayEditorStyle",class:"bed7b9f",propsAsIs:!1}),es=e=>{const{bubbles:t}=e;return Ve(Zr,{children:[t.map((n,o)=>$("div",{className:"boe-bubble",children:n},o)),$("textarea",{className:"gdg-input",autoFocus:!0})]})},ts=es,ns={getAccessibilityString:e=>Ko(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=>is(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(ts,{bubbles:t.data})},onPaste:()=>{}},os=4;function is(e,t){const{rect:n,theme:o,ctx:i,highlighted:r}=e,{x:l,y:s,width:a,height:d}=n,u=20,g=8,m=os;let f=l+o.cellHorizontalPadding;const c=[];for(const h of t){if(f>l+a)break;const b=Qt(h,i,o.baseFontFull).width;c.push({x:f,width:b}),f+=b+g*2+m}i.beginPath();for(const h of c)st(i,h.x,s+(d-u)/2,h.width+g*2,u,o.roundingRadius??u/2);i.fillStyle=r?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[h,b]of c.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(t[h],b.x+g,s+d/2+vt(i,o))}const rs=ht("div")({name:"DrilldownOverlayEditorStyle",class:"dy18k32",propsAsIs:!1}),ss=e=>{const{drilldowns:t}=e;return $(rs,{children:t.map((n,o)=>Ve("div",{className:"doe-bubble",children:[n.img!==void 0&&$("img",{src:n.img}),$("div",{children:n.text})]},o))})},ls=ss,as={getAccessibilityString:e=>Ko(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=>us(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return $(ls,{drilldowns:t.data})},onPaste:()=>{}},cs=4,Pn={};function ds(e,t,n,o){const i=Math.ceil(window.devicePixelRatio),r=5,l=n-r*2,s=4,a=n*i,d=o+r,u=o*3,g=(u+r*2)*i,m=`${e},${t},${i},${n}`;if(Pn[m]!==void 0)return{el:Pn[m],height:a,width:g,middleWidth:s*i,sideWidth:d*i,padding:r*i,dpr:i};const f=document.createElement("canvas"),c=f.getContext("2d");return c===null?null:(f.width=g,f.height=a,c.scale(i,i),Pn[m]=f,c.beginPath(),st(c,r,r,u,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,u,l,o),c.strokeStyle=t,c.lineWidth=1,c.stroke(),{el:f,height:a,width:g,sideWidth:d*i,middleWidth:o*i,padding:r*i,dpr:i})}function us(e,t){const{rect:n,theme:o,ctx:i,imageLoader:r,col:l,row:s}=e,{x:a,width:d}=n,u=o.baseFontFull,g=ei(i,u),m=Math.min(n.height,Math.max(16,Math.ceil(g*o.lineHeight)*2)),f=Math.floor(n.y+(n.height-m)/2),c=m-10,h=8,b=cs;let v=a+o.cellHorizontalPadding;const S=o.roundingRadius??6,C=ds(o.bgCell,o.drilldownBorder,m,S),E=[];for(const D of t){if(v>a+d)break;const A=Qt(D.text,i,u).width;let R=0;D.img!==void 0&&r.loadOrGetImage(D.img,l,s)!==void 0&&(R=c-8+4);const x=A+R+h*2;E.push({x:v,width:x}),v+=x+b}if(C!==null){const{el:D,height:H,middleWidth:A,sideWidth:R,width:x,dpr:B,padding:I}=C,w=R/B,k=I/B;for(const p of E){const j=Math.floor(p.x),_=Math.floor(p.width),Y=_-(w-k)*2;i.imageSmoothingEnabled=!1,i.drawImage(D,0,0,R,H,j-k,f,w,m),Y>0&&i.drawImage(D,R,0,A,H,j+(w-k),f,Y,m),i.drawImage(D,x-R,0,R,H,j+_-(w-k),f,w,m),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[D,H]of E.entries()){const A=t[D];let R=H.x+h;if(A.img!==void 0){const x=r.loadOrGetImage(A.img,l,s);if(x!==void 0){const B=c-8;let I=0,w=0,k=x.width,p=x.height;k>p?(I+=(k-p)/2,k=p):p>k&&(w+=(p-k)/2,p=k),i.beginPath(),st(i,R,f+m/2-B/2,B,B,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,I,w,k,p,R,f+m/2-B/2,B,B),i.restore(),R+=B+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(A.text,R,f+m/2+vt(i,o))}}const fs=ht("div")({name:"ImageOverlayEditorStyle",class:"i1f2fhaz",propsAsIs:!1}),hs=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 Ve(fs,{"data-testid":"GDG-default-image-overlay-editor",children:[$(Xi.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:$(jn,{})})]})},gs={getAccessibilityString:e=>e.data.join(", "),kind:ae.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>ms(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??hs,{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}}},Bn=4;function ms(e,t,n,o){const{rect:i,col:r,row:l,theme:s,ctx:a,imageLoader:d}=e,{x:u,y:g,height:m,width:f}=i,c=m-s.cellVerticalPadding*2,h=[];let b=0;for(let S=0;S0&&(a.beginPath(),st(a,v,g+s.cellVerticalPadding,C,c,n),a.save(),a.clip()),a.drawImage(S,v,g+s.cellVerticalPadding,C,c),n>0&&a.restore(),v+=C+Bn}}function ys(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const bs={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(ys(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=en(l.textDark,.1),i.fill()},onPaste:()=>{}},ps=ht("div")({name:"MarkdownContainer",class:"m1ec5h7p",propsAsIs:!1});class vs extends _n.PureComponent{constructor(){super(...arguments);ee(this,"targetElement",null);ee(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=Ti(i),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let a=r==null?void 0:r(l);if(a===void 0){const u=document.createElement("template");u.innerHTML=l,a=u.content}n.append(a);const d=n.getElementsByTagName("a");for(const u of d)u.target="_blank",u.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$(ps,{ref:this.containerRefHook})}}const ws=ht("textarea")({name:"InputBox",class:"iotb8b8",propsAsIs:!1}),ks=ht("div")({name:"ShadowBox",class:"s1xtsfdl",propsAsIs:!1}),xs=ht("div")({name:"GrowingEntryStyle",class:"g1d7u5bt",propsAsIs:!1});let Oo=0;const vn=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:i,altNewline:r,validatedSelection:l,...s}=e,{onChange:a,className:d}=s,u=M.useRef(null),g=n??"";ut(a!==void 0,"GrowingEntry must be a controlled input area");const[m]=M.useState(()=>"input-box-"+(Oo=(Oo+1)%1e7));M.useEffect(()=>{const c=u.current;if(c===null||c.disabled)return;const h=g.toString().length;c.focus(),c.setSelectionRange(i?0:h,h)},[]),M.useLayoutEffect(()=>{var c;if(l!==void 0){const h=typeof l=="number"?[l,null]:l;(c=u.current)==null||c.setSelectionRange(h[0],h[1])}},[l]);const f=M.useCallback(c=>{c.key==="Enter"&&c.shiftKey&&r===!0||o==null||o(c)},[r,o]);return Ve(xs,{className:"gdg-growing-entry",children:[$(ks,{className:d,children:g+` +`}),$(ws,{...s,className:(d??"")+" gdg-input",id:m,ref:u,onKeyDown:f,value:g,placeholder:t,dir:"auto"})]})},Cs=()=>e=>e.targetWidth,Xo=ht("div")({name:"MarkdownOverlayEditorStyle",class:"mmv7gx6",propsAsIs:!1,vars:{"mmv7gx6-0":[Cs(),"px"]}}),Ss=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:i,targetRect:r,onFinish:l,validatedSelection:s}=e,a=t.data,d=t.readonly===!0,[u,g]=M.useState(a===""||o),m=M.useCallback(()=>{g(c=>!c)},[]),f=a?"gdg-ml-6":"";return u?Ve(Xo,{targetWidth:r.width-20,children:[$(vn,{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 ${f}`,onClick:()=>l(t),children:$(Ki,{})})]}):Ve(Xo,{targetWidth:r.width,children:[$(vs,{contents:a,createNode:i}),!d&&Ve(Rn,{children:[$("div",{className:"spacer"}),$("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:m,children:$(jn,{})})]}),$("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0})]})},Ms={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Zt,measure:(e,t,n)=>{const o=t.data.split(` +`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>ft(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 $(Ss,{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}},Is={getAccessibilityString:e=>e.row.toString(),kind:Gt.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Es,measure:()=>44,draw:e=>Ds(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 Es(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=Fs,n.textAlign="center",r}function Fs(e){const{ctx:t}=e;t.textAlign="start"}function Ds(e,t,n,o,i,r){const{ctx:l,rect:s,hoverAmount:a,theme:d}=e,{x:u,y:g,width:m,height:f}=s,c=n?1:o==="checkbox-visible"?.6+.4*a:a;if(o!=="number"&&c>0){l.globalAlpha=c;const h=7*(n?a:1);if(Zn(l,d,n,i?u+h:u,g,i?m-h:m,f,!0,void 0,void 0,18,"center",r),i){l.globalAlpha=a,l.beginPath();for(const b of[3,6])for(const v of[-5,-1,3])l.rect(u+b,g+f/2+v,2,2);l.fillStyle=d.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const h=t.toString(),b=d.markerFontFull,v=u+m/2;o==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=d.textLight,l.font=b,l.fillText(h,v,g+f/2+vt(l,b)),a!==0&&(l.globalAlpha=1)}}const As={getAccessibilityString:()=>"",kind:Gt.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Hs(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Hs(e,t,n){const{ctx:o,rect:i,hoverAmount:r,theme:l,spriteManager:s}=e,{x:a,y:d,width:u,height:g}=i;o.beginPath(),o.globalAlpha=r,o.rect(a+1,d+1,u,g-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let f=0;if(n!==void 0){const h=g-8,b=a+8/2,v=d+8/2;s.drawSprite(n,"normal",o,b,v,h,l,m?1:r),f=h}else{f=24;const c=12,h=m?c:r*c,b=m?0:(1-r)*c*.5,v=l.cellHorizontalPadding+4;h>0&&(o.moveTo(a+v+b,d+g/2),o.lineTo(a+v+b+h,d+g/2),o.moveTo(a+v+b+h*.5,d+g/2-h*.5),o.lineTo(a+v+b+h*.5,d+g/2+h*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,f+a+l.cellHorizontalPadding+.5,d+g/2+vt(o,l)),o.beginPath()}const Ps=M.lazy(async()=>await Yi(()=>import("./number-overlay-editor-wZgFM_Mr.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),Bs={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:Zt,draw:e=>ft(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 $(M.Suspense,{fallback:null,children:$(Ps,{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}}},Ts={getAccessibilityString:()=>"",measure:()=>108,kind:ae.Protected,needsHover:!1,needsHoverPosition:!1,draw:Rs,onPaste:()=>{}};function Rs(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,u=Math.cos(wo(30))*s,g=Math.sin(wo(30))*s;for(let m=0;m<12;m++)t.moveTo(a,d-s),t.lineTo(a,d+s),t.moveTo(a+u,d-g),t.lineTo(a-u,d+g),t.moveTo(a-u,d-g),t.lineTo(a+u,d+g),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Ls={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Zt(e,t,e.theme.textLight),draw:e=>ft(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 $(vn,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:i,onChange:r=>n({...o,data:r.target.value})})},onPaste:()=>{}},Ws={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ae.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Zt,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:u,allowWrapping:g}=t;if(u===!0&&n>0){i.textBaseline="alphabetic";const m=l.cellHorizontalPadding,f=l.cellVerticalPadding,c=Qt(a,i,l.baseFontFull,"alphabetic"),h=r.height-f,b=Math.min(h,c.actualBoundingBoxAscent*2.5);i.beginPath(),st(i,r.x+m/2,r.y+(r.height-b)/2+1,c.width+m*3,b-1,l.roundingRadius??4),i.globalAlpha=n,i.fillStyle=en(l.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=l.textDark,i.textBaseline="middle",s==null||s("text")}ft(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 $(vn,{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}},Ns=ht("div")({name:"UriOverlayEditorStyle",class:"uwr6ffw",propsAsIs:!1}),zs=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:i,validatedSelection:r,preview:l}=e,[s,a]=M.useState(!i&&(t===""||o)),d=M.useCallback(()=>{a(!0)},[]);return s?$(vn,{validatedSelection:r,highlight:!0,autoFocus:!0,value:t,onChange:n}):Ve(Ns,{children:[$("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer",children:l}),!i&&$("div",{className:"gdg-edit-icon",onClick:d,children:$(jn,{})}),$("textarea",{className:"gdg-input",autoFocus:!0})]})},Os=zs;function $o(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 Xs={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:Zt,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 u=Qt(a,s,n.baseFontFull),g=$o(u,l,n,t.contentAlign),{x:m,y:f,width:c,height:h}=g;if(i>=m-4&&i<=m-4+c+8&&r>=f-4&&r<=f-4+h+8){const b=vt(s,n.baseFontFull);o("pointer");const v=5,S=f-b;s.beginPath(),s.moveTo(l.x+m,Math.floor(l.y+S+h+v)+.5),s.lineTo(l.x+m+c,Math.floor(l.y+S+h+v)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,ft({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),ft({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),ft({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),ft({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=d?n.linkColor:n.textDark,ft(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=ar(l,r.baseFontFull);if(s===void 0)return;const a=$o(s,n,r,t.contentAlign);Qn({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 $(Os,{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}},gl=[Is,As,Jr,ns,as,gs,bs,Ms,Bs,Ts,Ls,Ws,Xs],Tn=[];class $s extends ni{constructor(){super(...arguments);ee(this,"imageLoaded",()=>{});ee(this,"loadedLocations",[]);ee(this,"cache",{});ee(this,"sendLoaded",$i(()=>{this.imageLoaded(new Kt(this.loadedLocations)),this.loadedLocations=[]},20));ee(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,Tn.length<12?Tn.unshift(s):l||(s.src=""))}},u=new Promise(g=>s.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,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(Jn(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=ot(o,i);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,i,r)}}const ml=$s;export{Xr as A,ll as B,Nn as C,Un as D,Ui as E,Zs as F,ae as G,ol as H,Gt as I,dl as J,fl as K,ko as L,il as M,hl as N,ml as O,gl as P,cl as Q,Bo as R,zr as S,sl as T,Qs as U,_i as a,ut as b,al as c,nl as d,ul as e,tl as f,rl as g,en as h,Gs as i,Ks as j,Ot as k,Ht as l,Jt as m,zn as n,To as o,Qn as p,nr as q,Js as r,_o as s,Gr as t,je as u,qi as v,el as w,vr as x,hn 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"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/docs/assets/image-window-loader-hgJATaim.js b/docs/assets/image-window-loader-hgJATaim.js deleted file mode 100644 index 9a1cca43b..000000000 --- a/docs/assets/image-window-loader-hgJATaim.js +++ /dev/null @@ -1,18 +0,0 @@ -var Hi=Object.defineProperty;var Bi=(e,t,n)=>t in e?Hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t,n)=>(Bi(e,typeof t!="symbol"?t+"":t,n),n);import{a as Ge,j as Y,F as Rn,s as mt,b as Ti}from"./marked.esm-dbrxtycE.js";import{r as M,R as _n}from"./index-BMVQvedj.js";import{h as Ri,d as Li,v as Wi,_ as Ni,g as zi,c as mn,r as Oi,j as Xi,t as $i}from"./throttle-7EuXLZa7.js";import{_ as Yi}from"./iframe-ni8xiI1Q.js";function Yo(e="This should not happen"){throw new Error(e)}function ht(e,t="Assertion failed"){if(!e)return Yo(t)}function Un(e,t){return Yo(t??"Hell froze over")}function Ks(e,t){try{return e()}catch{return t}}const vo=Object.prototype.hasOwnProperty;function Nt(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--&&Nt(e[o],t[o]););return o===-1}if(!n||typeof e=="object"){o=0;for(n in e)if(vo.call(e,n)&&++o&&!vo.call(t,n)||!(n in t)||!Nt(e[n],t[n]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}const yn=null,qn=void 0;var le=(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))(le||{}),_i=(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))(_i||{}),Ln=(e=>(e.Triangle="triangle",e.Dots="dots",e))(Ln||{});function Gs(e){return"width"in e&&typeof e.width=="number"}async function Js(e){return typeof e=="object"?e:await e()}function Ui(e){return!(e.kind==="loading"||e.kind==="bubble"||e.kind==="row-id"||e.kind==="protected"||e.kind==="drilldown")}function Qs(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 _o(e){return e.kind==="marker"||e.kind==="new-row"}function qi(e){if(!Ui(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;Un(e,"A cell was passed with an invalid kind")}function Zs(e){return Ri(e,"editor")}function Wn(e){return!(e.readonly??!1)}var Gt=(e=>(e.NewRow="new-row",e.Marker="marker",e))(Gt||{});function ji(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 ft(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,o=ji([...this.items,n]);return new ft(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&&tpo??(po=new ft([]))),ee(ft,"fromSingleSelection",t=>ft.empty().add(t));let Nn=ft;function Ke(e,t,n,o,i=!1){const r=M.useRef();r.current=t,M.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 el(e,t){return e===void 0?void 0:t}const Vi=Math.PI;function wo(e){return e*Vi/180}const Uo=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),qo=(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}},jo=(e,t,n)=>Math.min(e,t-n*2),Vo=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,jn=e=>{const t=e.fgColor??"currentColor";return Ge("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("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"}),Y("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"})]})},Ki=e=>{const t=e.fgColor??"currentColor";return Y("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})};function Gi(e,t,n){const[o,i]=M.useState(e),r=M.useRef(!0);M.useEffect(()=>()=>{r.current=!1},[]);const l=M.useRef(Li(s=>{r.current&&i(s)},n));return M.useLayoutEffect(()=>{r.current&&l.current(()=>e())},t),o}const Ji="֑-߿יִ-﷽ﹰ-ﻼ",Qi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Zi=new RegExp("^[^"+Qi+"]*["+Ji+"]");function Vn(e){return Zi.test(e)?"rtl":"not-rtl"}let fn;function ko(){if(typeof document>"u")return 0;if(fn!==void 0)return fn;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(),fn=n-o,fn}const Dt=Symbol();function tl(e){const t=M.useRef([Dt,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,o]=M.useState(e),[,i]=M.useState(),r=M.useCallback(s=>{const a=t.current[0];a!==Dt&&(s=typeof s=="function"?s(a):s,s===a)||(a!==Dt&&i({}),o(d=>typeof s=="function"?s(a===Dt?d:a):s),t.current[0]=Dt)},[]),l=M.useCallback(()=>{t.current[0]=Dt,i({})},[]);return[t.current[0]===Dt?n:t.current[0],r,l]}function Ko(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 nl(e){const t=M.useRef(e);return Nt(e,t.current)||(t.current=e),t.current}function er(e,t){return _n.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 nr(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,u]=t.span;return d>=o&&d<=i||u>=o&&d<=i||di}function or(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)&&xo(e,t,r)&&i++;for(const l of n.current.rangeStack)xo(e,t,l)&&i++;return i}function Jo(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 zt(e,t){let n=0;const o=Jo(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 h}const m=r-d,f=e-(a??0);if(typeof l=="number"){const c=Math.floor((f-u)/l)+s;return c>=m?void 0:c}else{let c=u;for(let h=s;h"u";async function lr(){var e;sr||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,gn=0,Vt={},Wi())}lr();function Qo(e,t,n,o){return`${e}_${o??(t==null?void 0:t.font)}_${n}`}function Qt(e,t,n,o="middle"){const i=Qo(e,t,o,n);let r=Vt[i];return r===void 0&&(r=t.measureText(e),Vt[i]=r,gn++),gn>1e4&&(Vt={},gn=0),r}function ar(e,t){const n=Qo(e,void 0,"middle",t);return Vt[n]}function kt(e,t){return typeof t!="string"&&(t=t.baseFontFull),cr(e,t)}function Co(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const o=e.measureText(n);return e.restore(),o}const So=[];function cr(e,t){for(const r of So)if(r.key===t)return r.val;const n=Co(e,"alphabetic"),i=-(Co(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return So.push({key:t,val:i}),i}function dr(e,t,n,o,i,r){const{ctx:l,rect:s,theme:a}=e;let d=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(d=n-t,dn&&(e=e.slice(0,n)),e}function fr(e,t,n,o,i,r,l,s,a,d){const u=s.baseFontFull,g=Ni(e,t,u,i-s.cellHorizontalPadding*2,d??!1),m=ei(e,u),f=s.lineHeight*m,c=m+f*(g.length-1),h=c+s.cellVerticalPadding>r;h&&(e.save(),e.rect(n,o,i,r),e.clip());const b=o+r/2-c/2;let v=Math.max(o+s.cellVerticalPadding,b);for(const S of g)if(Zo(e,S,n,v,i,m,l,s,a),v+=f,v>o+r)break;h&&e.restore()}function gt(e,t,n,o,i){const{ctx:r,rect:l,theme:s}=e,{x:a,y:d,width:u,height:g}=l;o=o??!1,o||(t=ur(t,u));const m=kt(r,s),f=Vn(t)==="rtl";if(n===void 0&&f&&(n="right"),f&&(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?fr(r,t,a,d,u,g,m,s,n,i):Zo(r,t,a,d,u,g,m,s,n),c&&(r.textAlign="start"),f&&(r.direction="inherit")}}function at(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 hr(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 gr(e,t,n){const o=function(s,a){const d=a.x-s.x,u=a.y-s.y,g=Math.sqrt(d*d+u*u),m=d/g,f=u/g;return{x:d,y:a.y-s.y,len:g,nx:m,ny:f,ang:Math.atan2(f,m)}};let i;const r=t.length;let l=t[r-1];for(let s=0;s1?1:m),h=1,b=!1;f<0?c<0?c=Math.PI+c:(c=Math.PI-c,h=-1,b=!0):c>0&&(h=-1,b=!0),i=a.radius!==void 0?a.radius:n;const v=c/2;let S=Math.abs(Math.cos(v)*i/Math.sin(v)),C;S>Math.min(u.len/2,g.len/2)?(S=Math.min(u.len/2,g.len/2),C=Math.abs(S*Math.sin(v)/Math.cos(v))):C=i;let E=a.x+g.nx*S,D=a.y+g.ny*S;E+=-g.ny*C*h,D+=g.nx*C*h,e.arc(E,D,C,u.ang+Math.PI/2*h,g.ang-Math.PI/2*h,b),l=a,a=d}e.closePath()}function Xn(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c){const h={x:0,y:r+d,width:0,height:0};if(e>=f.length||t>=u||t<-2||e<0)return h;const b=r-i;if(e>=g){const v=l>e?-1:1,S=zt(f);h.x+=S+a;for(let C=l;C!==e;C+=v)h.x+=f[v===1?C:C-1].width*v}else for(let v=0;v0&&zn(f[v-1].group,S)&&f[v-1].sticky===C;){const D=f[v-1];h.x-=D.width,h.width+=D.width,v--}let E=e;for(;E+1n&&(h.width=n-h.x)}}else if(t>=u-m){let v=u-t;for(h.y=o;v>0;){const S=t+v-1;h.height=typeof c=="number"?c:c(S),h.y-=h.height,v--}h.height+=1}else{const v=s>t?-1:1;if(typeof c=="number"){const S=t-s;h.y+=S*c}else for(let S=s;S!==t;S+=v)h.y+=c(S)*v;h.height=(typeof c=="number"?c:c(t))+1}return h}const Kn=1<<21;function rt(e,t){return(t+2)*Kn+e}function ti(e){return e%Kn}function Gn(e){return Math.floor(e/Kn)-2}function Jn(e){const t=ti(e),n=Gn(e);return[t,n]}class ni{constructor(){ee(this,"visibleWindow",{x:0,y:0,width:0,height:0});ee(this,"freezeCols",0);ee(this,"freezeRows",[]);ee(this,"isInWindow",t=>{const n=ti(t),o=Gn(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&&Nt(this.freezeRows,o)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=o,this.clearOutOfWindow())}}class mr extends ni{constructor(){super(...arguments);ee(this,"cache",new Map);ee(this,"setValue",(n,o)=>{this.cache.set(rt(n[0],n[1]),o)});ee(this,"getValue",n=>this.cache.get(rt(n[0],n[1])));ee(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class Kt{constructor(t=[]){ee(this,"cells");this.cells=new Set(t.map(n=>rt(n[0],n[1])))}add(t){this.cells.add(rt(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(rt(t[0],t[1]))}remove(t){this.cells.delete(rt(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gn(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n{h.drawImage(b,0,0,g,g)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else a<1&&(o.globalAlpha=a),o.drawImage(f,0,0,g,g,i,r,l,l),a<1&&(o.globalAlpha=1)}}const Fn={};let wt=null;function vr(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function $n(e){const t=e.toLowerCase().trim();if(Fn[t]!==void 0)return Fn[t];wt=wt||vr(),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),Fn[t]=i,i}function en(e,t){const[n,o,i]=$n(e);return`rgba(${n}, ${o}, ${i}, ${t})`}const Mo=new Map;function Io(e,t){const n=`${e}-${t}`,o=Mo.get(n);if(o!==void 0)return o;const i=Ue(e,t);return Mo.set(n,i),i}function Ue(e,t){if(t===void 0)return e;const[n,o,i,r]=$n(e);if(r===1)return e;const[l,s,a,d]=$n(t),u=r+d*(1-r),g=(r*n+d*l*(1-r))/u,m=(r*o+d*s*(1-r))/u,f=(r*i+d*a*(1-r))/u;return`rgba(${g}, ${m}, ${f}, ${u})`}function oi(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function vn(e,t,n,o,i,r,l,s,a){s=s??t;let d=t,u=e;const g=o-r;let m=!1;for(;ds&&a(d,u,f,!1,l&&u===o-1)===!0){m=!0;break}d+=f,u++}if(!m){d=n;for(let f=0;f!f.sticky))==null?void 0:m.sourceIndex)??0;if(a>g){const f=Math.max(s,g);let c=t,h=o;for(let b=r.sourceIndex-1;b>=f;b--)c-=l[b].width,h+=l[b].width;for(let b=r.sourceIndex+1;b<=a;b++)h+=l[b].width;u={x:c,y:n,width:h,height:i}}if(g>s){const f=Math.min(a,g-1);let c=t,h=o;for(let b=r.sourceIndex-1;b>=s;b--)c-=l[b].width,h+=l[b].width;for(let b=r.sourceIndex+1;b<=f;b++)h+=l[b].width;d={x:c,y:n,width:h,height:i}}return[d,u]}function il(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 si={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 rl(){return si}const sl=_n.createContext(si);function Jt(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 ll(e,t,n,o){if(o==="any")return pr(e,{x:t,y:n,width:1,height:1});if(o==="vertical"&&(t=e.x),o==="horizontal"&&(n=e.y),nr([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 bn(e,t,n,o,i,r,l,s){return e<=i+l&&i<=e+n&&t<=r+s&&r<=t+o}function Qn(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function pr(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 wr(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 kr(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,u=r-e.y,g=e.y+e.height-s,m=a>0?e.x+Math.floor(a/o)*o:e.x,f=d>0?e.x+e.width-Math.floor(d/o)*o:e.x+e.width,c=u>0?e.y+Math.floor(u/o)*o:e.y,h=g>0?e.y+e.height-Math.floor(g/o)*o:e.y+e.height;return{x:m,y:c,width:f-m,height:h-c}}function xr(e,t,n,o,i){const[r,l,s,a]=t,[d,u,g,m]=i,{x:f,y:c,width:h,height:b}=e,v=[];if(h<=0||b<=0)return v;const S=f+h,C=c+b,E=fs,P=c+b>a,R=f>=r&&fr&&S<=s||fs,x=c>=l&&cl&&C<=a||ca;if(R&&x){const I=Math.max(f,r),k=Math.max(c,l),w=Math.min(S,s),p=Math.min(C,a);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:d,y:u,width:g-d+1,height:m-u+1}})}if(E&&D){const I=f,k=c,w=Math.min(S,r),p=Math.min(C,l);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:0,y:0,width:d+1,height:u+1}})}if(D&&R){const I=Math.max(f,r),k=c,w=Math.min(S,s),p=Math.min(C,l);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:d,y:0,width:g-d+1,height:u+1}})}if(D&&A){const I=Math.max(f,s),k=c,w=S,p=Math.min(C,l);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:g,y:0,width:n-g+1,height:u+1}})}if(E&&x){const I=f,k=Math.max(c,l),w=Math.min(S,r),p=Math.min(C,a);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:0,y:u,width:d+1,height:m-u+1}})}if(A&&x){const I=Math.max(f,s),k=Math.max(c,l),w=S,p=Math.min(C,a);v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:g,y:u,width:n-g+1,height:m-u+1}})}if(E&&P){const I=f,k=Math.max(c,a),w=Math.min(S,r),p=C;v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:0,y:m,width:d+1,height:o-m+1}})}if(P&&R){const I=Math.max(f,r),k=Math.max(c,a),w=Math.min(S,s),p=C;v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:d,y:m,width:g-d+1,height:o-m+1}})}if(A&&P){const I=Math.max(f,s),k=Math.max(c,a),w=S,p=C;v.push({rect:{x:I,y:k,width:w-I,height:p-k},clip:{x:g,y:m,width:n-g+1,height:o-m+1}})}return v}const Cr={kind:le.Loading,allowOverlay:!1};function Eo(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S,C,E,D,A,P,R,x,B,I,k,w,p,z,_,q,K){let we=(C==null?void 0:C.size)??Number.MAX_SAFE_INTEGER;const me=performance.now();let de=w.baseFontFull;e.font=de;const ie={ctx:e},ke=[0,0],Be=b>0?Ot(a,b,d):0;let X,Se;const Te=oi(S);return xt(t,s,r,l,i,(ae,Ie,ct,qe,Re)=>{const Le=Math.max(0,qe-Ie),He=Ie+Le,We=i+1,yt=ae.width-Le,Ye=o-i-1;if(S.length>0){let ye=!1;for(let ue=0;ue{e.save(),e.beginPath(),e.rect(He,We,yt,Ye),e.clip()},je=E.columns.hasIndex(ae.sourceIndex),Ee=g(ae.group??"").overrideTheme,Xe=ae.themeOverride===void 0&&Ee===void 0?w:Jt(w,Ee,ae.themeOverride),ce=Xe.baseFontFull;ce!==de&&(de=ce,e.font=ce),re();let pe;return vn(Re,ct,o,a,d,b,v,Te,(ye,ue,T,G,se)=>{var et,tt,dt;if(ue<0||(ke[0]=ae.sourceIndex,ke[1]=ue,C!==void 0&&!C.has(ke)))return;if(S.length>0){let Q=!1;for(let De=0;Deoe.span!==void 0&&Q>=oe.span[0]&&Q<=oe.span[1]);Qe&&!c&&h?_e=0:Qe&&h&&(_e=Math.max(_e,1)),Ct&&_e++,Qe||(V&&_e++,je&&!se&&_e++);const St=oe.kind===le.Protected?ze.bgCellMedium:ze.bgCell;let be;if((G||St!==w.bgCell)&&(be=Ue(St,be)),_e>0||Ne){Ne&&(be=Ue(ze.bgHeader,be));for(let Q=0;Q<_e;Q++)be=Ue(ze.accentLight,be)}else if(D!==void 0){for(const Q of D)if(Q[0]===ae.sourceIndex&&Q[1]===ue){be=Ue(ze.bgSearchResult,be);break}}if(A!==void 0)for(let Q=0;QK&&!Je){const Q=ze.baseFontFull;Q!==de&&(e.font=Q,de=Q),pe=li(e,oe,ae.sourceIndex,ue,he,$e,te,ye,ne,T,_e>0,ze,be??ze.bgCell,P,R,(Ze==null?void 0:Ze.hoverAmount)??0,B,k,me,I,pe,p,z,_,q)}return Mt&&e.restore(),oe.style==="faded"&&(e.globalAlpha=1),we--,Fe&&(e.restore(),(dt=pe==null?void 0:pe.deprep)==null||dt.call(pe,ie),pe=void 0,re(),de=ce,e.font=ce),we<=0}),e.restore(),we<=0}),X}const Ut=[0,0],qt={x:0,y:0,width:0,height:0},Dn=[void 0,()=>{}];let Yn=!1;function Sr(){Yn=!0}function li(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S,C,E,D,A,P,R){var z,_;let x,B;b!==void 0&&b[0][0]===n&&b[0][1]===o&&(x=b[1][0],B=b[1][1]);let I;Ut[0]=n,Ut[1]=o,qt.x=l,qt.y=s,qt.width=a,qt.height=d,Dn[0]=A.getValue(Ut),Dn[1]=q=>A.setValue(Ut,q),Yn=!1;const k={ctx:e,theme:g,col:n,row:o,cell:t,rect:qt,highlighted:u,cellFillColor:m,hoverAmount:h,frameTime:S,hoverX:x,drawState:Dn,hoverY:B,imageLoader:f,spriteManager:c,hyperWrapping:v,overrideCursor:x!==void 0?R:void 0,requestAnimationFrame:Sr},w=dr(k,t.lastUpdated,S,E,i,r),p=P(t);if(p!==void 0){(E==null?void 0:E.renderer)!==p&&((z=E==null?void 0:E.deprep)==null||z.call(E,k),E=void 0);const q=(_=p.drawPrep)==null?void 0:_.call(p,k,E);C!==void 0&&!_o(k.cell)?C(k,()=>p.draw(k,t)):p.draw(k,t),I=q===void 0?void 0:{deprep:q==null?void 0:q.deprep,fillStyle:q==null?void 0:q.fillStyle,font:q==null?void 0:q.font,renderer:p}}return(w||Yn)&&(D==null||D(Ut)),I}function Zn(e,t,n,o,i,r,l,s,a=-20,d=-20,u=32,g="center",m="square"){const f=Math.floor(i+l/2),c=m==="circle"?1e4:t.roundingRadius??4;let h=jo(u,l,t.cellVerticalPadding),b=h/2;const v=qo(g,o,r,t.cellHorizontalPadding,h),S=Uo(v,f,h),C=Vo(o+a,i+d,S);switch(n){case!0:{e.beginPath(),at(e,v-h/2,f-h/2,h,h,c),m==="circle"&&(b*=.8,h*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-b+h/4.23,f-b+h/1.97),e.lineTo(v-b+h/2.42,f-b+h/1.44),e.lineTo(v-b+h/1.29,f-b+h/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case yn:case!1:{e.beginPath(),at(e,v-h/2+.5,f-h/2+.5,h-1,h-1,c),e.lineWidth=1,e.strokeStyle=C?t.textDark:t.textMedium,e.stroke();break}case qn:{e.beginPath(),at(e,v-h/2,f-h/2,h,h,c),e.fillStyle=C?t.textMedium:t.textLight,e.fill(),m==="circle"&&(b*=.8,h*=.8),e.beginPath(),e.moveTo(v-h/3,f),e.lineTo(v+h/3,f),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:Un()}}function Mr(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){const C=l+s;if(C<=0)return;e.fillStyle=g.bgHeader,e.fillRect(0,0,i,C);const[E,D]=(o==null?void 0:o[0])??[],A=g.headerFontFull;e.font=A,xt(t,0,r,0,C,(P,R,x,B)=>{var ie;if(b!==void 0&&!b.has([P.sourceIndex,-1]))return;const I=Math.max(0,B-R);e.save(),e.beginPath(),e.rect(R+I,s,P.width-I,l),e.clip();const k=h(P.group??"").overrideTheme,w=P.themeOverride===void 0&&k===void 0?g:Jt(g,k,P.themeOverride);w.bgHeader!==g.bgHeader&&(e.fillStyle=w.bgHeader,e.fill()),w!==g&&(e.font=w.baseFontFull);const p=u.columns.hasIndex(P.sourceIndex),z=a!==void 0||d,_=!z&&D===-1&&E===P.sourceIndex,q=z?0:((ie=f.find(ke=>ke.item[0]===P.sourceIndex&&ke.item[1]===-1))==null?void 0:ie.hoverAmount)??0,K=(u==null?void 0:u.current)!==void 0&&u.current.cell[0]===P.sourceIndex,we=p?w.accentColor:K?w.bgHeaderHasFocus:w.bgHeader,me=n?s:0,de=P.sourceIndex===0?0:1;p?(e.fillStyle=we,e.fillRect(R+de,me,P.width-de,l)):(K||q>0)&&(e.beginPath(),e.rect(R+de,me,P.width-de,l),K&&(e.fillStyle=w.bgHeaderHasFocus,e.fill()),q>0&&(e.globalAlpha=q,e.fillStyle=w.bgHeaderHovered,e.fill(),e.globalAlpha=1)),di(e,R,me,P.width,l,P,p,w,_,K,q,m,v,S),e.restore()}),n&&Ir(e,t,i,r,s,o,g,m,f,c,h,b)}function Ir(e,t,n,o,i,r,l,s,a,d,u,g){const[f,c]=(r==null?void 0:r[0])??[];let h=0;ii(t,n,o,i,(b,v,S,C,E,D)=>{if(g!==void 0&&!g.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(S,C,E,D),e.clip();const A=u(v),P=(A==null?void 0:A.overrideTheme)===void 0?l:Jt(l,A.overrideTheme),R=c===-2&&f!==void 0&&f>=b[0]&&f<=b[1],x=R?P.bgHeaderHovered:P.bgHeader;if(x!==l.bgHeader&&(e.fillStyle=x,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,A!==void 0){let B=S;if(A.icon!==void 0&&(s.drawSprite(A.icon,"normal",e,B+8,(i-20)/2,20,P),B+=26),e.fillText(A.name,B+8,i/2+kt(e,l.headerFontFull)),A.actions!==void 0&&R){const I=ci({x:S,y:C,width:E,height:D},A.actions);e.beginPath();const k=I[0].x-10,w=S+E-k;e.rect(k,0,w,i);const p=e.createLinearGradient(k,0,k+w,0),z=en(x,0);p.addColorStop(0,z),p.addColorStop(10/w,x),p.addColorStop(1,x),e.fillStyle=p,e.fill(),e.globalAlpha=.6;const[_,q]=(r==null?void 0:r[1])??[-1,-1];for(let K=0;K35){const E=m?35:o-35,D=m?35*.7:o-35*.7,A=E/o,P=D/o,R=e.createLinearGradient(t,0,t+o,0),x=en(h,0);R.addColorStop(m?1:0,h),R.addColorStop(A,h),R.addColorStop(P,x),R.addColorStop(m?0:1,x),e.fillStyle=R}else e.fillStyle=h;if(m&&(e.textAlign="right"),e.fillText(r.title,S,n+i/2+kt(e,s.headerFontFull)),m&&(e.textAlign="left"),b&&r.hasMenu===!0)if(r.menuIcon===void 0||r.menuIcon===Ln.Triangle){e.beginPath();const C=f.x+f.width/2-5.5,E=f.y+f.height/2-3;gr(e,[{x:C,y:E},{x:C+11,y:E},{x:C+5.5,y:E+6}],1),e.fillStyle=h,e.fill()}else if(r.menuIcon===Ln.Dots){e.beginPath();const C=f.x+f.width/2,E=f.y+f.height/2;hr(e,C,E),e.fillStyle=h,e.fill()}else{const C=f.x+(f.width-s.headerIconSize)/2,E=f.y+(f.height-s.headerIconSize)/2;u.drawSprite(r.menuIcon,"normal",e,C,E,s.headerIconSize,s)}}function di(e,t,n,o,i,r,l,s,a,d,u,g,m,f){const c=Vn(r.title)==="rtl",h=ai(t,n,o,i,c);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:o,height:i},column:r,columnIndex:r.sourceIndex,isSelected:l,hoverAmount:u,isHovered:a,hasSelectedCell:d,spriteManager:g,menuBounds:h},()=>Fo(e,t,n,o,i,r,l,s,a,u,g,f,c,h)):Fo(e,t,n,o,i,r,l,s,a,u,g,f,c,h)}function Er(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const C=oi(b);xt(t,a,l,s,r,(E,D,A,P,R)=>{if(E!==t[t.length-1])return;D+=E.width;const x=Math.max(D,P);x>o||(e.save(),e.beginPath(),e.rect(x,r+1,1e4,i-r-1),e.clip(),vn(R,A,i,d,u,c,h,C,(B,I,k,w)=>{if(!w&&b.length>0&&!b.some(K=>bn(D,B,1e4,k,K.x,K.y,K.width,K.height)))return;const p=m.hasIndex(I),z=f.hasIndex(I);e.beginPath();const _=g==null?void 0:g(I),q=_===void 0?S:Jt(S,_);q.bgCell!==S.bgCell&&(e.fillStyle=q.bgCell,e.fillRect(D,B,1e4,k)),z&&(e.fillStyle=q.bgHeader,e.fillRect(D,B,1e4,k)),p&&(e.fillStyle=q.accentLight,e.fillRect(D,B,1e4,k))}),e.restore())})}function Fr(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 u=a.horizontalBorderColor??a.borderColor,g=a.borderColor,m=d?zt(t):0;let f;if(m!==0&&(f=Io(g,a.bgCell),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,o),e.strokeStyle=f,e.stroke()),i>0){const c=g===u&&f!==void 0?f:Io(u,a.bgCell),h=Ot(r,i,s);e.beginPath(),e.moveTo(0,o-h+.5),e.lineTo(n,o-h+.5),e.strokeStyle=c,e.stroke()}}const ui=(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 Dr(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c){var k;const h=c.bgCell,{minX:b,maxX:v,minY:S,maxY:C}=ui(s,r,l),E=[],D=l-Ot(f,m,d);let A=a,P=n,R=0;for(;A+i=S&&w<=C-1){const z=u==null?void 0:u(P),_=z==null?void 0:z.bgCell;_!==void 0&&_!==h&&P>=f-m&&E.push({x:b,y:w,w:v-b,h:p,color:_})}A+=p,P0)for(let w=0;w=b&&z<=v&&g(w+1)&&E.push({x:z,y:R,w:p.width,h:B,color:_}),x+=p.width}if(E.length===0)return;let I;e.beginPath();for(let w=E.length-1;w>=0;w--){const p=E[w];I===void 0?I=p.color:p.color!==I&&(e.fillStyle=I,e.fill(),e.beginPath(),I=p.color),e.rect(p.x,p.y,p.w,p.h)}I!==void 0&&(e.fillStyle=I,e.fill()),e.beginPath()}function Do(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v=!1){if(a!==void 0){e.beginPath(),e.save(),e.rect(0,0,r,l);for(const k of a)e.rect(k.x+1,k.y+1,k.width-1,k.height-1);e.clip("evenodd")}const S=b.horizontalBorderColor??b.borderColor,C=b.borderColor,{minX:E,maxX:D,minY:A,maxY:P}=ui(s,r,l),R=[];e.beginPath();let x=.5;for(let k=0;k=E&&p<=D&&f(k+1)&&R.push({x1:p,y1:Math.max(d,A),x2:p,y2:Math.min(l,P),color:C})}let B=l+.5;for(let k=h-c;k=A&&z<=P-1){const _=m==null?void 0:m(w);R.push({x1:E,y1:z,x2:D,y2:z,color:(_==null?void 0:_.horizontalBorderColor)??(_==null?void 0:_.borderColor)??S})}k+=g(w),w++}}const I=zi(R,k=>k.color);for(const k of Object.keys(I)){e.strokeStyle=k;for(const w of I[k])e.moveTo(w.x1,w.y1),e.lineTo(w.x2,w.y2);e.stroke(),e.beginPath()}a!==void 0&&e.restore()}function Ar(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b,v,S){const C=[];e.imageSmoothingEnabled=!1;const E=Math.min(i.cellYOffset,l),D=Math.max(i.cellYOffset,l);let A=0;if(typeof v=="number")A+=(D-E)*v;else for(let p=E;pi.cellYOffset&&(A=-A),A+=a-i.translateY;const P=Math.min(i.cellXOffset,r),R=Math.max(i.cellXOffset,r);let x=0;for(let p=P;pi.cellXOffset&&(x=-x),x+=s-i.translateX;let B=zt(b);if(B>0&&B++,x!==0&&A!==0)return{regions:[]};const I=d>0?Ot(m,d,v):0,k=u-B-Math.abs(x),w=g-f-I-Math.abs(A)-1;if(k>150&&w>150){const p={sx:0,sy:0,sw:u*c,sh:g*c,dx:0,dy:0,dw:u*c,dh:g*c};if(A>0?(p.sy=(f+1)*c,p.sh=w*c,p.dy=(A+f+1)*c,p.dh=w*c,C.push({x:0,y:f,width:u,height:A+1})):A<0&&(p.sy=(-A+f+1)*c,p.sh=w*c,p.dy=(f+1)*c,p.dh=w*c,C.push({x:0,y:g+A-I,width:u,height:-A+I})),x>0?(p.sx=B*c,p.sw=k*c,p.dx=(x+B)*c,p.dw=k*c,C.push({x:B-1,y:0,width:x+2,height:g})):x<0&&(p.sx=(B-x)*c,p.sw=k*c,p.dx=B*c,p.dw=k*c,C.push({x:u+x,y:0,width:-x,height:g})),e.setTransform(1,0,0,1,0,0),S){if(B>0&&x!==0&&A===0&&(o===void 0||(n==null?void 0:n[1])!==!1)){const z=B*c,_=g*c;e.drawImage(t,0,0,z,_,0,0,z,_)}if(I>0&&x===0&&A!==0&&(o===void 0||(n==null?void 0:n[0])!==!1)){const z=(g-I)*c,_=u*c,q=I*c;e.drawImage(t,0,z,_,q,0,z,_,q)}}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:C}}function Pr(e,t,n,o,i,r,l,s,a,d){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||o!==e.translateX||i!==e.translateY||xt(a,n,o,i,s,(g,m,f,c)=>{if(g.sourceIndex===d){const h=Math.max(m,c)+1;return u.push({x:h,y:0,width:r-h,height:l}),!0}}),u}function Hr(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;oP.style!=="no-outline");if(b===void 0||b.length===0)return;const v=zt(s),S=Ot(f,m,g),C=[a,0,s.length,f-m],E=[v,0,t,n-S],D=b.map(P=>{const R=P.range,x=P.style??"dashed";return xr(R,C,t,n,E).map(B=>{const I=B.rect,k=Xn(I.x,I.y,t,n,u,d+u,o,i,r,l,f,a,m,s,g),w=I.width===1&&I.height===1?k:Xn(I.x+I.width-1,I.y+I.height-1,t,n,u,d+u,o,i,r,l,f,a,m,s,g);return I.x+I.width>=s.length&&(w.width-=1),I.y+I.height>=f&&(w.height-=1),{color:P.color,style:x,clip:B.clip,rect:kr({x:k.x,y:k.y,width:w.x+w.width-k.x,height:w.y+w.height-k.y},t,n,8)}})}),A=()=>{e.lineWidth=1;let P=!1;for(const R of D)for(const x of R)if((x==null?void 0:x.rect)!==void 0&&bn(0,0,t,n,x.rect.x,x.rect.y,x.rect.width,x.rect.height)){const B=P,I=!wr(x.clip,x.rect);I&&(e.save(),e.rect(x.clip.x,x.clip.y,x.clip.width,x.clip.height),e.clip()),x.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(x.style==="solid"||x.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=x.style==="solid-outline"?Ue(Ue(x.color,h.borderColor),h.bgCell):en(x.color,1),e.strokeRect(x.rect.x+.5,x.rect.y+.5,x.rect.width-1,x.rect.height-1),I&&(e.restore(),P=B)}P&&e.setLineDash([])};return A(),A}function Po(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 An(e,t,n,o,i,r,l,s,a,d,u,g,m,f,c,h,b){if(u.current===void 0)return;const v=u.current.range,S=u.current.cell,C=[v.x+v.width-1,v.y+v.height-1];if(S[1]>=b&&C[1]>=b||!l.some(z=>z.sourceIndex===S[0]||z.sourceIndex===C[0]))return;const[D,A]=u.current.cell,P=m(u.current.cell),R=P.span??[D,D],x=A>=b-f,B=f>0&&!x?Ot(b,f,g)-1:0,I=C[1];let k,w;if(xt(l,o,i,r,d,(z,_,q,K,we)=>{if(K-=1,z.sticky&&D>z.sourceIndex)return;const me=z.sourceIndexR[1],ie=z.sourceIndex===C[0];if(!(!ie&&(me||de)))return vn(we,q,n,b,g,f,c,void 0,(ke,Be,X)=>{if(Be!==A&&Be!==I)return;let Se=_,Te=z.width;const ae=z.sourceIndex===s.length-1,Ie=Be===b-1;if(P.span!==void 0){const Re=ri(P.span,_,ke,z.width,X,z,s),Le=z.sticky?Re[0]:Re[1];Le!==void 0&&(Se=Le.x,Te=Le.width)}const ct=Be===I&&ie&&h,qe=Be===A&&!me&&!de&&k===void 0;return ct&&(w=()=>{var Re;K>Se&&!z.sticky&&!qe&&(e.beginPath(),e.rect(K,0,t-K,n),e.clip()),e.beginPath(),e.rect(Se+Te-4,ke+X-4,4,4),e.fillStyle=((Re=z.themeOverride)==null?void 0:Re.accentColor)??a.accentColor,e.fill()}),qe&&(k=()=>{var Re;K>Se&&!z.sticky&&(e.beginPath(),e.rect(K,0,t-K,n),e.clip()),e.beginPath(),e.rect(Se+.5,ke+.5,Te-(ae?1:0),X-(Ie?1:0)),e.strokeStyle=((Re=z.themeOverride)==null?void 0:Re.accentColor)??a.accentColor,e.lineWidth=1,e.stroke()}),k!==void 0&&(h?w!==void 0:!0)}),k!==void 0&&(h?w!==void 0:!0)}),k===void 0&&w===void 0)return;const p=()=>{e.save(),e.beginPath(),e.rect(0,d,t,n-d-B),e.clip(),k==null||k(),w==null||w(),e.restore()};return p(),p}function Br(e,t,n,o,i,r,l,s,a){a===void 0||a.size===0||(e.beginPath(),ii(t,n,r,o,(d,u,g,m,f,c)=>{a.hasItemInRectangle({x:d[0],y:-2,width:d[1]-d[0]+1,height:1})&&e.rect(g,m,f,c)}),xt(t,s,r,l,i,(d,u,g,m)=>{const f=Math.max(0,m-u),c=u+f+1,h=d.width-f-1;a.has([d.sourceIndex,-1])&&e.rect(c,o,h,i-o)}),e.clip())}function Tr(e,t,n,o,i,r,l,s,a,d){let u=0;return xt(e,r,o,i,n,(g,m,f,c,h)=>(vn(h,f,t,l,s,a,d,void 0,(b,v,S,C)=>{C||(u=Math.max(v,u))}),!0)),u}function Ho(e,t){var Mt;const{canvasCtx:n,headerCanvasCtx:o,width:i,height:r,cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mappedColumns:u,enableGroups:g,freezeColumns:m,dragAndDropState:f,theme:c,drawFocus:h,headerHeight:b,groupHeaderHeight:v,disabledRows:S,rowHeight:C,verticalBorder:E,overrideCursor:D,isResizing:A,selection:P,fillHandle:R,freezeTrailingRows:x,rows:B,getCellContent:I,getGroupDetails:k,getRowThemeOverride:w,isFocused:p,drawHeaderCallback:z,prelightCells:_,drawCellCallback:q,highlightRegions:K,resizeCol:we,imageLoader:me,lastBlitData:de,hoverValues:ie,hyperWrapping:ke,hoverInfo:Be,spriteManager:X,maxScaleFactor:Se,hasAppendRow:Te,touchMode:ae,enqueue:Ie,renderStateProvider:ct,getCellRenderer:qe,renderStrategy:Re,bufferACtx:Le,bufferBCtx:He,damage:We,minimumCellWidth:yt}=e;if(i===0||r===0)return;const Ye=Re==="double-buffer",re=Math.min(Se,Math.ceil(window.devicePixelRatio??1)),je=Re!=="direct"&&Hr(e,t),Ee=n.canvas;(Ee.width!==i*re||Ee.height!==r*re)&&(Ee.width=i*re,Ee.height=r*re,Ee.style.width=i+"px",Ee.style.height=r+"px");const Xe=o.canvas,ce=g?v+b:b,pe=ce+1;(Xe.width!==i*re||Xe.height!==pe*re)&&(Xe.width=i*re,Xe.height=pe*re,Xe.style.width=i+"px",Xe.style.height=pe+"px");const ye=Le.canvas,ue=He.canvas;Ye&&(ye.width!==i*re||ye.height!==r*re)&&(ye.width=i*re,ye.height=r*re,de.current!==void 0&&(de.current.aBufferScroll=void 0)),Ye&&(ue.width!==i*re||ue.height!==r*re)&&(ue.width=i*re,ue.height=r*re,de.current!==void 0&&(de.current.bBufferScroll=void 0));const T=de.current;if(je===!0&&l===(T==null?void 0:T.cellXOffset)&&s===(T==null?void 0:T.cellYOffset)&&a===(T==null?void 0:T.translateX)&&d===(T==null?void 0:T.translateY))return;let G=null;Ye&&(G=n);const se=o;let V;Ye?We!==void 0?V=(T==null?void 0:T.lastBuffer)==="b"?He:Le:V=(T==null?void 0:T.lastBuffer)==="b"?Le:He:V=n;const Ne=V.canvas,oe=Ye?Ne===ye?ue:ye:Ee,te=typeof C=="number"?()=>C:C;se.save(),V.save(),se.beginPath(),V.beginPath(),se.textBaseline="middle",V.textBaseline="middle",re!==1&&(se.scale(re,re),V.scale(re,re));const ne=On(u,l,i,f,a);let Fe=[];const Je=h&&((Mt=P.current)==null?void 0:Mt.cell[1])===s&&d===0;let st=!1;if(K!==void 0){for(const he of K)if(he.style!=="no-outline"&&he.range.y===s&&d===0){st=!0;break}}const bt=()=>{Mr(se,ne,g,Be,i,a,b,v,f,A,P,c,X,ie,E,k,We,z,ae),Do(se,ne,s,a,d,i,r,void 0,void 0,v,ce,te,w,E,x,B,c,!0),se.beginPath(),se.moveTo(0,pe-.5),se.lineTo(i,pe-.5),se.strokeStyle=Ue(c.headerBottomBorderColor??c.horizontalBorderColor??c.borderColor,c.bgHeader),se.stroke(),st&&Ao(se,i,r,l,s,a,d,u,m,b,v,C,x,B,K,c),Je&&An(se,i,r,s,a,d,ne,u,c,ce,P,te,I,x,Te,R,B)};if(We!==void 0){const he=ne[ne.length-1].sourceIndex+1,$e=We.hasItemInRegion([{x:l,y:-2,width:he,height:2},{x:l,y:s,width:he,height:300},{x:0,y:s,width:m,height:300},{x:0,y:-2,width:m,height:2},{x:l,y:B-x,width:he,height:x,when:x>0}]),Ze=et=>{Eo(et,ne,u,r,ce,a,d,s,B,te,I,k,w,S,p,h,x,Te,Fe,We,P,_,K,me,X,ie,Be,q,ke,c,Ie,ct,qe,D,yt);const tt=P.current;R&&h&&tt!==void 0&&We.has(Go(tt.range))&&An(et,i,r,s,a,d,ne,u,c,ce,P,te,I,x,Te,R,B)};$e&&(Ze(V),G!==null&&(G.save(),G.scale(re,re),G.textBaseline="middle",Ze(G),G.restore()),We.hasHeader()&&(Br(se,ne,i,v,ce,a,d,s,We),bt())),V.restore(),se.restore();return}if((je!==!0||l!==(T==null?void 0:T.cellXOffset)||a!==(T==null?void 0:T.translateX)||Je!==(T==null?void 0:T.mustDrawFocusOnHeader)||st!==(T==null?void 0:T.mustDrawHighlightRingsOnHeader))&&bt(),je===!0){ht(oe!==void 0&&T!==void 0);const{regions:he}=Ar(V,oe,oe===ye?T.aBufferScroll:T.bBufferScroll,oe===ye?T.bBufferScroll:T.aBufferScroll,T,l,s,a,d,x,i,r,B,ce,re,u,ne,C,Ye);Fe=he}else je!==!1&&(ht(T!==void 0),Fe=Pr(T,l,s,a,d,i,r,ce,ne,je));Fr(V,ne,i,r,x,B,E,te,c);const ze=Ao(V,i,r,l,s,a,d,u,m,b,v,C,x,B,K,c),Qe=h?An(V,i,r,s,a,d,ne,u,c,ce,P,te,I,x,Te,R,B):void 0;if(V.fillStyle=c.bgCell,Fe.length>0){V.beginPath();for(const he of Fe)V.rect(he.x,he.y,he.width,he.height);V.clip(),V.fill(),V.beginPath()}else V.fillRect(0,0,i,r);const _e=Eo(V,ne,u,r,ce,a,d,s,B,te,I,k,w,S,p,h,x,Te,Fe,We,P,_,K,me,X,ie,Be,q,ke,c,Ie,ct,qe,D,yt);Er(V,ne,u,i,r,ce,a,d,s,B,te,w,P.rows,S,x,Te,Fe,We,c),Dr(V,ne,s,a,d,i,r,Fe,ce,te,w,E,x,B,c),Do(V,ne,s,a,d,i,r,Fe,_e,v,ce,te,w,E,x,B,c),ze==null||ze(),Qe==null||Qe(),A&&xt(ne,0,a,0,ce,(he,$e)=>he.sourceIndex===we?(Po(se,$e+he.width,0,ce+1,Ue(c.resizeIndicatorColor??c.accentLight,c.bgHeader)),Po(V,$e+he.width,ce,r,Ue(c.resizeIndicatorColor??c.accentLight,c.bgCell)),!0):!1),G!==null&&(G.fillStyle=c.bgCell,G.fillRect(0,0,i,r),G.drawImage(V.canvas,0,0));const Ct=Tr(ne,r,ce,a,d,s,B,te,x,Te);me==null||me.setWindow({x:l,y:s,width:ne.length,height:Ct-s},m,Array.from({length:x},(he,$e)=>B-1-$e));const St=T!==void 0&&(l!==T.cellXOffset||a!==T.translateX),be=T!==void 0&&(s!==T.cellYOffset||d!==T.translateY);de.current={cellXOffset:l,cellYOffset:s,translateX:a,translateY:d,mustDrawFocusOnHeader:Je,mustDrawHighlightRingsOnHeader:st,lastBuffer:Ye?Ne===ye?"a":"b":void 0,aBufferScroll:Ne===ye?[St,be]:T==null?void 0:T.aBufferScroll,bBufferScroll:Ne===ue?[St,be]:T==null?void 0:T.bBufferScroll},V.restore(),se.restore()}const Rr=80;function Lr(e){const t=e-1;return t*t*t+1}class Wr{constructor(t){ee(this,"currentHoveredItem");ee(this,"leavingItems",[]);ee(this,"lastAnimationTime");ee(this,"addToLeavingItems",t=>{this.leavingItems.some(o=>hn(o.item,t.item))||this.leavingItems.push(t)});ee(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(o=>hn(o.item,t));return this.leavingItems=this.leavingItems.filter(o=>o!==n),(n==null?void 0:n.hoverAmount)??0});ee(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ee(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ee(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Lr(t.hoverAmount)})));ee(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const o=(t-this.lastAnimationTime)/Rr;for(const r of this.leavingItems)r.hoverAmount=mn(r.hoverAmount-o,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=mn(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});ee(this,"setHovered",t=>{var n;if(!hn((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 Nr{constructor(t){ee(this,"fn");ee(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function eo(e){return new Nr(e)}const zr=eo(()=>window.navigator.userAgent.includes("Firefox")),Bo=eo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),al=eo(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Or(e){const t=M.useRef([]),n=M.useRef(0),o=M.useRef(e);o.current=e;const i=M.useCallback(()=>{const r=()=>window.requestAnimationFrame(l),l=()=>{const s=t.current.map(Jn);t.current=[],o.current(new Kt(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?r:l)},[]);return M.useCallback(r=>{t.current.length===0&&i();const l=rt(r[0],r[1]);t.current.includes(l)||t.current.push(l)},[i])}const At="header",Pt="group-header",To="out-of-bounds";var jt=(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))(jt||{});function Xr(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 Ro=6,$r=(e,t)=>{if(e.kind===le.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},Yr=(e,t)=>{const{width:n,height:o,accessibilityHeight:i,columns:r,cellXOffset:l,cellYOffset:s,headerHeight:a,fillHandle:d=!1,groupHeaderHeight:u,rowHeight:g,rows:m,getCellContent:f,getRowThemeOverride:c,onHeaderMenuClick:h,enableGroups:b,isFilling:v,onCanvasFocused:S,onCanvasBlur:C,isFocused:E,selection:D,freezeColumns:A,onContextMenu:P,freezeTrailingRows:R,fixedShadowX:x=!0,fixedShadowY:B=!0,drawFocusRing:I=!0,onMouseDown:k,onMouseUp:w,onMouseMoveRaw:p,onMouseMove:z,onItemHovered:_,dragAndDropState:q,firstColAccessible:K,onKeyDown:we,onKeyUp:me,highlightRegions:de,canvasRef:ie,onDragStart:ke,onDragEnd:Be,eventTargetRef:X,isResizing:Se,resizeColumn:Te,isDragging:ae,isDraggable:Ie=!1,allowResize:ct,disabledRows:qe,hasAppendRow:Re,getGroupDetails:Le,theme:He,prelightCells:We,headerIcons:yt,verticalBorder:Ye,drawCell:re,drawHeader:je,onCellFocused:Ee,onDragOverCell:Xe,onDrop:ce,onDragLeave:pe,imageWindowLoader:ye,smoothScrollX:ue=!1,smoothScrollY:T=!1,experimental:G,getCellRenderer:se}=e,V=e.translateX??0,Ne=e.translateY??0,oe=Math.max(A,Math.min(r.length-1,l)),te=M.useRef(null),ne=ye,Fe=M.useRef(),[Je,st]=M.useState(!1),bt=M.useRef([]),ze=M.useRef(),[Qe,_e]=M.useState(),[Ct,St]=M.useState(),be=M.useRef(null),[Mt,he]=M.useState(),[$e,Ze]=M.useState(!1),et=M.useRef($e);et.current=$e;const tt=M.useMemo(()=>new br(yt,()=>{nn.current=void 0,Xt.current()}),[yt]),dt=b?u+a:a,Q=M.useRef(-1),De=((G==null?void 0:G.enableFirefoxRescaling)??!1)&&zr.value,xe=((G==null?void 0:G.enableSafariRescaling)??!1)&&Bo.value;M.useLayoutEffect(()=>{window.devicePixelRatio===1||!De&&!xe||(Q.current!==-1&&st(!0),window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{st(!1),Q.current=-1},200))},[s,oe,V,Ne,De,xe]);const Ce=er(r,A),Ve=x?zt(Ce,q):0,ve=M.useCallback((y,F,N)=>{const W=y.getBoundingClientRect();if(F>=Ce.length||N>=m)return;const H=W.width/n,L=Xn(F,N,n,o,u,dt,oe,s,V,Ne,m,A,R,Ce,g);return H!==1&&(L.x*=H,L.y*=H,L.width*=H,L.height*=H),L.x+=W.x,L.y+=W.y,L},[n,o,u,dt,oe,s,V,Ne,m,A,R,Ce,g]),Oe=M.useCallback((y,F,N,W)=>{const H=y.getBoundingClientRect(),L=H.width/n,U=(F-H.left)/L,j=(N-H.top)/L,O=5,Ae=On(Ce,oe,n,void 0,V);let $=0,ge=0;W instanceof MouseEvent&&($=W.button,ge=W.buttons);const J=ir(U,Ae,V),Z=rr(j,o,b,a,u,m,g,s,Ne,R),Pe=(W==null?void 0:W.shiftKey)===!0,nt=(W==null?void 0:W.ctrlKey)===!0,Me=(W==null?void 0:W.metaKey)===!0,ut=W!==void 0&&!(W instanceof MouseEvent)||(W==null?void 0:W.pointerType)==="touch",vt=[U<0?-1:nn||j>o){const fe=U>n?1:U<0?-1:0,it=j>o?1:j<0?-1:0;let lt=fe*2,Yt=it*2;fe===0&&(lt=J===-1?jt.EndPadding:jt.Center),it===0&&(Yt=Z===void 0?jt.EndPadding:jt.Center);let pt=!1;if(J===-1&&Z===-1){const _t=ve(y,Ce.length-1,-1);ht(_t!==void 0),pt=F<_t.x+_t.width+O}const En=U>n&&Uo&&j=0?(it=!0,fe=ve(y,lt,Z),ht(fe!==void 0),ot={kind:b&&Z===-2?Pt:At,location:[lt,Z],bounds:fe,group:Ce[lt].group??"",isEdge:it,shiftKey:Pe,ctrlKey:nt,metaKey:Me,isTouch:ut,localEventX:F-fe.x,localEventY:N-fe.y,button:$,buttons:ge,scrollEdge:vt}):ot={kind:b&&Z===-2?Pt:At,group:Ce[J].group??"",location:[J,Z],bounds:fe,isEdge:it,shiftKey:Pe,ctrlKey:nt,metaKey:Me,isTouch:ut,localEventX:F-fe.x,localEventY:N-fe.y,button:$,buttons:ge,scrollEdge:vt}}else{const fe=ve(y,J,Z);ht(fe!==void 0);const it=fe!==void 0&&fe.x+fe.width-F{}),Ht=M.useRef(Qe);Ht.current=Qe;const[Et,Ft]=M.useMemo(()=>{const y=document.createElement("canvas"),F=document.createElement("canvas");return y.style.display="none",y.style.opacity="0",y.style.position="fixed",F.style.display="none",F.style.opacity="0",F.style.position="fixed",[y.getContext("2d",{alpha:!1}),F.getContext("2d",{alpha:!1})]},[]);M.useLayoutEffect(()=>{if(!(Et===null||Ft===null))return document.documentElement.append(Et.canvas),document.documentElement.append(Ft.canvas),()=>{Et.canvas.remove(),Ft.canvas.remove()}},[Et,Ft]);const tn=M.useMemo(()=>new mr,[]),no=De&&Je?1:xe&&Je?2:5,oo=(G==null?void 0:G.disableMinimumCellWidth)===!0?1:10,nn=M.useRef(),on=M.useRef(null),rn=M.useRef(null),sn=M.useCallback(()=>{var U;const y=te.current,F=be.current;if(y===null||F===null||(on.current===null&&(on.current=y.getContext("2d",{alpha:!1}),y.width=0,y.height=0),rn.current===null&&(rn.current=F.getContext("2d",{alpha:!1}),F.width=0,F.height=0),on.current===null||rn.current===null||Et===null||Ft===null))return;let N=!1;const W=j=>{N=!0,he(j)},H=nn.current,L={headerCanvasCtx:rn.current,canvasCtx:on.current,bufferACtx:Et,bufferBCtx:Ft,width:n,height:o,cellXOffset:oe,cellYOffset:s,translateX:Math.round(V),translateY:Math.round(Ne),mappedColumns:Ce,enableGroups:b,freezeColumns:A,dragAndDropState:q,theme:He,headerHeight:a,groupHeaderHeight:u,disabledRows:qe??Nn.empty(),rowHeight:g,verticalBorder:Ye,isResizing:Se,resizeCol:Te,isFocused:E,selection:D,fillHandle:d,drawCellCallback:re,hasAppendRow:Re,overrideCursor:W,maxScaleFactor:no,freezeTrailingRows:R,rows:m,drawFocus:I,getCellContent:f,getGroupDetails:Le??(j=>({name:j})),getRowThemeOverride:c,drawHeaderCallback:je,prelightCells:We,highlightRegions:de,imageLoader:ne,lastBlitData:ze,damage:Fe.current,hoverValues:bt.current,hoverInfo:Ht.current,spriteManager:tt,scrolling:Je,hyperWrapping:(G==null?void 0:G.hyperWrapping)??!1,touchMode:$e,enqueue:to.current,renderStateProvider:tn,renderStrategy:(G==null?void 0:G.renderStrategy)??(Bo.value?"double-buffer":"single-buffer"),getCellRenderer:se,minimumCellWidth:oo};L.damage===void 0?(nn.current=L,Ho(L,H)):Ho(L,void 0),!N&&(L.damage===void 0||L.damage.has((U=Ht==null?void 0:Ht.current)==null?void 0:U[0]))&&he(void 0)},[Et,Ft,n,o,oe,s,V,Ne,Ce,b,A,q,He,a,u,qe,g,Ye,Se,Re,Te,E,D,d,R,m,I,no,f,Le,c,re,je,We,de,ne,tt,Je,G==null?void 0:G.hyperWrapping,G==null?void 0:G.renderStrategy,$e,tn,se,oo]),Xt=M.useRef(sn);M.useLayoutEffect(()=>{sn(),Xt.current=sn},[sn]),M.useLayoutEffect(()=>{(async()=>{var F;((F=document==null?void 0:document.fonts)==null?void 0:F.ready)!==void 0&&(await document.fonts.ready,nn.current=void 0,Xt.current())})()},[]);const Bt=M.useCallback(y=>{Fe.current=y,Xt.current(),Fe.current=void 0},[]),fi=Or(Bt);to.current=fi;const io=M.useCallback(y=>{Bt(new Kt(y.map(F=>F.cell)))},[Bt]);ne.setCallback(Bt);const[hi,gi]=M.useState(!1),[ln,Tt]=It??[],mi=ln!==void 0&&Tt===-1,yi=ln!==void 0&&Tt===-2;let ro=!1,so=!1,an=Mt;if(an===void 0&&ln!==void 0&&Tt!==void 0&&Tt>-1&&Tt({contain:"strict",display:"block",cursor:lo}),[lo]),ao=M.useRef("default"),kn=X==null?void 0:X.current;kn!=null&&ao.current!==wn.cursor&&(kn.style.cursor=ao.current=wn.cursor);const Rt=M.useCallback((y,F,N,W)=>{if(Le===void 0)return;const H=Le(y);if(H.actions!==void 0){const L=ci(F,H.actions);for(const[U,j]of L.entries())if(Qn(j,N+F.x,W+j.y))return H.actions[U]}},[Le]),Lt=M.useCallback((y,F,N,W)=>{const H=r[F];if(!ae&&!Se&&H.hasMenu===!0&&!(Ct??!1)){const L=ve(y,F,-1);ht(L!==void 0);const U=ai(L.x,L.y,L.width,L.height,Vn(H.title)==="rtl");if(N>U.x&&NU.y&&W{const F=te.current,N=X==null?void 0:X.current;if(F===null||y.target!==F&&y.target!==N)return;Cn.current=!0;let W,H;if(y instanceof MouseEvent?(W=y.clientX,H=y.clientY):(W=y.touches[0].clientX,H=y.touches[0].clientY),y.target===N&&N!==null){const U=N.getBoundingClientRect();if(W>U.right||H>U.bottom)return}const L=Oe(F,W,H,y);$t.current=L.location,L.isTouch&&(xn.current=Date.now()),et.current!==L.isTouch&&Ze(L.isTouch),!(L.kind===At&&Lt(F,L.location[0],W,H)!==void 0)&&(L.kind===Pt&&Rt(L.group,L.bounds,L.localEventX,L.localEventY)!==void 0||(k==null||k(L),!L.isTouch&&Ie!==!0&&Ie!==L.kind&&L.button<3&&L.button!==1&&y.preventDefault()))},[X,Ie,Oe,Rt,Lt,k]);Ke("touchstart",co,window,!1),Ke("mousedown",co,window,!1);const uo=M.useRef(0),fo=M.useCallback(y=>{var ge,J;const F=uo.current;uo.current=Date.now();const N=te.current;if(Cn.current=!1,w===void 0||N===null)return;const W=X==null?void 0:X.current,H=y.target!==N&&y.target!==W;let L,U,j=!0;if(y instanceof MouseEvent){if(L=y.clientX,U=y.clientY,j=y.button<3,y.pointerType==="touch")return}else L=y.changedTouches[0].clientX,U=y.changedTouches[0].clientY;let O=Oe(N,L,U,y);O.isTouch&&xn.current!==0&&Date.now()-xn.current>500&&(O={...O,isLongTouch:!0}),F!==0&&Date.now()-F<(O.isTouch?1e3:500)&&(O={...O,isDoubleClick:!0}),et.current!==O.isTouch&&Ze(O.isTouch),!H&&y.cancelable&&j&&y.preventDefault();const[Ae]=O.location,$=Lt(N,Ae,L,U);if(O.kind===At&&$!==void 0){(O.button!==0||((ge=$t.current)==null?void 0:ge[0])!==Ae||((J=$t.current)==null?void 0:J[1])!==-1)&&w(O,!0);return}else if(O.kind===Pt){const Z=Rt(O.group,O.bounds,O.localEventX,O.localEventY);if(Z!==void 0){O.button===0&&Z.onClick(O);return}}w(O,H)},[w,X,Oe,Lt,Rt]);Ke("mouseup",fo,window,!1),Ke("touchend",fo,window,!1);const bi=M.useCallback(y=>{var $,ge;const F=te.current;if(F===null)return;const N=X==null?void 0:X.current,W=y.target!==F&&y.target!==N;let H,L,U=!0;y instanceof MouseEvent?(H=y.clientX,L=y.clientY,U=y.button<3):(H=y.changedTouches[0].clientX,L=y.changedTouches[0].clientY);const j=Oe(F,H,L,y);et.current!==j.isTouch&&Ze(j.isTouch),!W&&y.cancelable&&U&&y.preventDefault();const[O]=j.location,Ae=Lt(F,O,H,L);if(j.kind===At&&Ae!==void 0)j.button===0&&(($=$t.current)==null?void 0:$[0])===O&&((ge=$t.current)==null?void 0:ge[1])===-1&&(h==null||h(O,Ae));else if(j.kind===Pt){const J=Rt(j.group,j.bounds,j.localEventX,j.localEventY);J!==void 0&&j.button===0&&J.onClick(j)}},[X,Oe,Lt,h,Rt]);Ke("click",bi,window,!1);const vi=M.useCallback(y=>{const F=te.current,N=X==null?void 0:X.current;if(F===null||y.target!==F&&y.target!==N||P===void 0)return;const W=Oe(F,y.clientX,y.clientY,y);P(W,()=>{y.cancelable&&y.preventDefault()})},[X,Oe,P]);Ke("contextmenu",vi,(X==null?void 0:X.current)??null,!1);const ho=M.useCallback(y=>{Fe.current=new Kt(y.map(F=>F.item)),bt.current=y,Xt.current(),Fe.current=void 0},[]),go=M.useMemo(()=>new Wr(ho),[ho]),mo=M.useRef(go);mo.current=go,M.useLayoutEffect(()=>{const y=mo.current;if(It===void 0||It[1]<0){y.setHovered(It);return}const F=f(It,!0),N=se(F),W=N===void 0&&F.kind===le.Custom||(N==null?void 0:N.needsHover)!==void 0&&(typeof N.needsHover=="boolean"?N.needsHover:N.needsHover(F));y.setHovered(W?It:void 0)},[f,se,It]);const yo=M.useRef(),pi=M.useCallback(y=>{var j;const F=te.current;if(F===null)return;const N=X==null?void 0:X.current,W=y.target!==F&&y.target!==N,H=Oe(F,y.clientX,y.clientY,y);if(H.kind!=="out-of-bounds"&&W&&!Cn.current&&!H.isTouch)return;const L=(O,Ae)=>{_e($=>$===O||($==null?void 0:$[0][0])===(O==null?void 0:O[0][0])&&($==null?void 0:$[0][1])===(O==null?void 0:O[0][1])&&(($==null?void 0:$[1][0])===(O==null?void 0:O[1][0])&&($==null?void 0:$[1][1])===(O==null?void 0:O[1][1])||!Ae)?$:O)};if(!Xr(H,yo.current))he(void 0),_==null||_(H),L(H.kind===To?void 0:[H.location,[H.localEventX,H.localEventY]],!0),yo.current=H;else if(H.kind==="cell"||H.kind===At||H.kind===Pt){let O=!1,Ae=!0;if(H.kind==="cell"){const ge=f(H.location);Ae=((j=se(ge))==null?void 0:j.needsHoverPosition)??ge.kind===le.Custom,O=Ae}else H.kind===Pt&&(O=!0);const $=[H.location,[H.localEventX,H.localEventY]];L($,Ae),Ht.current=$,O&&Bt(new Kt([H.location]))}const U=H.location[0]>=(K?0:1);St(H.kind===At&&H.isEdge&&U&&ct===!0),gi(H.kind==="cell"&&H.isFillHandle),p==null||p(y),z(H)},[X,Oe,K,ct,p,z,_,f,se,Bt]);Ke("mousemove",pi,window,!0);const wi=M.useCallback(y=>{const F=te.current;if(F===null)return;let N,W;D.current!==void 0&&(N=ve(F,D.current.cell[0],D.current.cell[1]),W=D.current.cell),we==null||we({bounds:N,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:W})},[we,D,ve]),ki=M.useCallback(y=>{const F=te.current;if(F===null)return;let N,W;D.current!==void 0&&(N=ve(F,D.current.cell[0],D.current.cell[1]),W=D.current.cell),me==null||me({bounds:N,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:W})},[me,D,ve]),xi=M.useCallback(y=>{te.current=y,ie!==void 0&&(ie.current=y)},[ie]),Ci=M.useCallback(y=>{const F=te.current;if(F===null||Ie===!1||Se){y.preventDefault();return}let N,W;const H=Oe(F,y.clientX,y.clientY);if(Ie!==!0&&H.kind!==Ie){y.preventDefault();return}const L=(ge,J)=>{N=ge,W=J};let U,j,O;const Ae=(ge,J,Z)=>{U=ge,j=J,O=Z};let $=!1;if(ke==null||ke({...H,setData:L,setDragImage:Ae,preventDefault:()=>$=!0,defaultPrevented:()=>$}),!$&&N!==void 0&&W!==void 0&&y.dataTransfer!==null)if(y.dataTransfer.setData(N,W),y.dataTransfer.effectAllowed="copyLink",U!==void 0&&j!==void 0&&O!==void 0)y.dataTransfer.setDragImage(U,j,O);else{const[ge,J]=H.location;if(J!==void 0){const Z=document.createElement("canvas"),Pe=ve(F,ge,J);ht(Pe!==void 0);const nt=Math.ceil(window.devicePixelRatio??1);Z.width=Pe.width*nt,Z.height=Pe.height*nt;const Me=Z.getContext("2d");Me!==null&&(Me.scale(nt,nt),Me.textBaseline="middle",J===-1?(Me.font=He.headerFontFull,Me.fillStyle=He.bgHeader,Me.fillRect(0,0,Z.width,Z.height),di(Me,0,0,Pe.width,Pe.height,Ce[ge],!1,He,!1,!1,0,tt,je,!1)):(Me.font=He.baseFontFull,Me.fillStyle=He.bgCell,Me.fillRect(0,0,Z.width,Z.height),li(Me,f([ge,J]),0,J,!1,!1,0,0,Pe.width,Pe.height,!1,He,He.bgCell,ne,tt,1,void 0,!1,0,void 0,void 0,void 0,tn,se,()=>{}))),Z.style.left="-100%",Z.style.position="absolute",Z.style.width=`${Pe.width}px`,Z.style.height=`${Pe.height}px`,document.body.append(Z),y.dataTransfer.setDragImage(Z,Pe.width/2,Pe.height/2),window.setTimeout(()=>{Z.remove()},0)}}else y.preventDefault()},[Ie,Se,Oe,ke,ve,He,Ce,tt,je,f,ne,tn,se]);Ke("dragstart",Ci,(X==null?void 0:X.current)??null,!1,!1);const Sn=M.useRef(),Si=M.useCallback(y=>{const F=te.current;if(ce!==void 0&&y.preventDefault(),F===null||Xe===void 0)return;const N=Oe(F,y.clientX,y.clientY),[W,H]=N.location,L=W-(K?0:1),[U,j]=Sn.current??[];(U!==L||j!==H)&&(Sn.current=[L,H],Xe([L,H],y.dataTransfer))},[K,Oe,Xe,ce]);Ke("dragover",Si,(X==null?void 0:X.current)??null,!1,!1);const Mi=M.useCallback(()=>{Sn.current=void 0,Be==null||Be()},[Be]);Ke("dragend",Mi,(X==null?void 0:X.current)??null,!1,!1);const Ii=M.useCallback(y=>{const F=te.current;if(F===null||ce===void 0)return;y.preventDefault();const N=Oe(F,y.clientX,y.clientY),[W,H]=N.location,L=W-(K?0:1);ce([L,H],y.dataTransfer)},[K,Oe,ce]);Ke("drop",Ii,(X==null?void 0:X.current)??null,!1,!1);const Ei=M.useCallback(()=>{pe==null||pe()},[pe]);Ke("dragleave",Ei,(X==null?void 0:X.current)??null,!1,!1);const bo=M.useRef(D);bo.current=D;const cn=M.useRef(null),Mn=M.useCallback(y=>{var F;te.current===null||!te.current.contains(document.activeElement)||(y===null&&bo.current.current!==void 0?(F=ie==null?void 0:ie.current)==null||F.focus({preventScroll:!0}):y!==null&&y.focus({preventScroll:!0}),cn.current=y)},[ie]);M.useImperativeHandle(t,()=>({focus:()=>{var F;const y=cn.current;y===null||!document.contains(y)?(F=ie==null?void 0:ie.current)==null||F.focus({preventScroll:!0}):y.focus({preventScroll:!0})},getBounds:(y,F)=>{if(!(ie===void 0||ie.current===null))return ve(ie.current,y??0,F??-1)},damage:io}),[ie,io,ve]);const In=M.useRef(),Fi=Gi(()=>{var j,O,Ae;if(n<50||(G==null?void 0:G.disableAccessibilityTree)===!0)return null;let y=On(Ce,oe,n,q,V);const F=K?0:-1;!K&&((j=y[0])==null?void 0:j.sourceIndex)===0&&(y=y.slice(1));const[N,W]=((O=D.current)==null?void 0:O.cell)??[],H=(Ae=D.current)==null?void 0:Ae.range,L=y.map($=>$.sourceIndex),U=Oi(s,Math.min(m,s+i));return N!==void 0&&W!==void 0&&!(L.includes(N)&&U.includes(W))&&Mn(null),Ge("table",{role:"grid","aria-rowcount":m+1,"aria-multiselectable":"true","aria-colcount":Ce.length+F,children:[Y("thead",{role:"rowgroup",children:Y("tr",{role:"row","aria-rowindex":1,children:y.map($=>Y("th",{role:"columnheader","aria-selected":D.columns.hasIndex($.sourceIndex),"aria-colindex":$.sourceIndex+1+F,tabIndex:-1,onFocus:ge=>{if(ge.target!==cn.current)return Ee==null?void 0:Ee([$.sourceIndex,-1])},children:$.title},$.sourceIndex))})}),Y("tbody",{role:"rowgroup",children:U.map($=>Y("tr",{role:"row","aria-selected":D.rows.hasIndex($),"aria-rowindex":$+2,children:y.map(ge=>{const J=ge.sourceIndex,Z=rt(J,$),Pe=N===J&&W===$,nt=H!==void 0&&J>=H.x&&J=H.y&&${const ot=ie==null?void 0:ie.current;if(ot!=null)return we==null?void 0:we({bounds:ve(ot,J,$),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:ut})},onFocusCapture:ot=>{var fe,it;if(!(ot.target===cn.current||((fe=In.current)==null?void 0:fe[0])===J&&((it=In.current)==null?void 0:it[1])===$))return In.current=ut,Ee==null?void 0:Ee(ut)},ref:Pe?Mn:void 0,tabIndex:-1,children:$r(vt,se)},Z)})},$))})]},"access-tree")},[n,Ce,oe,q,V,m,s,i,D,Mn,f,ie,we,ve,Ee],200),dn=A===0||!x?0:oe>A?1:mn(-V/100,0,1),Di=-s*32+Ne,un=B?mn(-Di/100,0,1):0,Ai=M.useMemo(()=>{if(!dn&&!un)return null;const y={position:"absolute",top:0,left:Ve,width:n-Ve,height:o,opacity:dn,pointerEvents:"none",transition:ue?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},F={position:"absolute",top:dt,left:0,width:n,height:o,opacity:un,pointerEvents:"none",transition:T?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return Ge(Rn,{children:[dn>0&&Y("div",{id:"shadow-x",style:y}),un>0&&Y("div",{id:"shadow-y",style:F})]})},[dn,un,Ve,n,ue,dt,o,T]),Pi=M.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return Ge(Rn,{children:[Y("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:wi,onKeyUp:ki,onFocus:S,onBlur:C,ref:xi,style:wn,children:Fi}),Y("canvas",{ref:be,style:Pi}),Ai]})},cl=M.memo(M.forwardRef(Yr));function _r(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case le.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===qn?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case le.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case le.Image:case le.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case le.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case le.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case le.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case le.Markdown:case le.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case le.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case le.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case le.Protected:return{formatted:"************",rawValue:"",format:"string"};default:Un()}}function Ur(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"}:_r(l))})}function Lo(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=>Lo(l,!0)).join(",")):i.push(Lo(r.formatted,!1));t.push(i.join(" "))}return t.join(` -`)}function Pn(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function Wo(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function jr(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Vr(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("
${Pn(i.formatted)}
    ${i.formatted.map((l,s)=>`
  1. `+Pn(l)+"
  2. ").join("")}
${Pn(i.formatted)}
"),t.join("")}function Kr(e,t){const n=Ur(e,t),o=qr(n),i=Vr(n);return{textPlain:o,textHtml:i}}function dl(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),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,g=(u==null?void 0:u.children.length)===1&&u.children[0].nodeName==="FONT",m=a.querySelectorAll("br");for(const h of m)h.replaceWith(` -`);const f=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 h=a.querySelectorAll("li");r==null||r.push({rawValue:[...h].map(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...h].map(b=>b.textContent??""),format:"string-array"})}else if(f!==null)r==null||r.push({rawValue:jr(f),formatted:a.textContent??"",format:c});else{let h=a.textContent??"";g&&(h=h.replace(/\n(?!\n)/g,"")),r==null||r.push({rawValue:h??"",formatted:h??"",format:c})}}}return r!==void 0&&i.push(r),i}function ul(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 f=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof f=="function")return r;d.push(...f)}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 u=a.x-n,g=a.x+a.width-1-n;for(const m of d)for(const f of m)f.span!==void 0&&(u=Math.min(f.span[0],u),g=Math.max(f.span[1],g));u===a.x-n&&g===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:g-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function No(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function fl(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(No(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 hl(e,t,n){var s;const o=Kr(e,t),i=a=>{var d;(d=window.navigator.clipboard)==null||d.writeText(a)},r=(a,d)=>{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([a],{type:"text/plain"}),"text/html":new Blob([d],{type:"text/html"})})]),!0)},l=(a,d)=>{var u,g;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",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 Gr(e){return e!==!0}const zo=20,Jr={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:le.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Qr(e,e.cell.data,Wn(e.cell),e.cell.maxSize??zo),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,u=t.maxSize??zo,g=Math.floor(i.y+s/2),m=jo(u,s,r.cellVerticalPadding),f=qo(t.contentAlign??"center",a,l,r.cellHorizontalPadding,m),c=Uo(f,g,m),h=Vo(a+n,d+o,c);if(Wn(t)&&h)return{...t,data:Gr(t.data)}},onPaste:(e,t)=>{let n=yn;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 Qr(e,t,n,o){if(!n&&t===yn)return;const{ctx:i,hoverAmount:r,theme:l,rect:s,highlighted:a,hoverX:d,hoverY:u,cell:{contentAlign:g}}=e,{x:m,y:f,width:c,height:h}=s,b=.35;let v=n?1-b+b*r:.4;t===yn&&(v*=r),v!==0&&(i.globalAlpha=v,Zn(i,l,t,m,f,c,h,a,d,u,o,g),i.globalAlpha=1)}const Zr=mt("div")({name:"BubblesOverlayEditorStyle",class:"bed7b9f",propsAsIs:!1}),es=e=>{const{bubbles:t}=e;return Ge(Zr,{children:[t.map((n,o)=>Y("div",{className:"boe-bubble",children:n},o)),Y("textarea",{className:"gdg-input",autoFocus:!0})]})},ts=es,ns={getAccessibilityString:e=>Ko(e.data),kind:le.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=>is(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return Y(ts,{bubbles:t.data})},onPaste:()=>{}},os=4;function is(e,t){const{rect:n,theme:o,ctx:i,highlighted:r}=e,{x:l,y:s,width:a,height:d}=n,u=20,g=8,m=os;let f=l+o.cellHorizontalPadding;const c=[];for(const h of t){if(f>l+a)break;const b=Qt(h,i,o.baseFontFull).width;c.push({x:f,width:b}),f+=b+g*2+m}i.beginPath();for(const h of c)at(i,h.x,s+(d-u)/2,h.width+g*2,u,o.roundingRadius??u/2);i.fillStyle=r?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[h,b]of c.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(t[h],b.x+g,s+d/2+kt(i,o))}const rs=mt("div")({name:"DrilldownOverlayEditorStyle",class:"dy18k32",propsAsIs:!1}),ss=e=>{const{drilldowns:t}=e;return Y(rs,{children:t.map((n,o)=>Ge("div",{className:"doe-bubble",children:[n.img!==void 0&&Y("img",{src:n.img}),Y("div",{children:n.text})]},o))})},ls=ss,as={getAccessibilityString:e=>Ko(e.data.map(t=>t.text)),kind:le.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=>us(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return Y(ls,{drilldowns:t.data})},onPaste:()=>{}},cs=4,Hn={};function ds(e,t,n,o){const i=Math.ceil(window.devicePixelRatio),r=5,l=n-r*2,s=4,a=n*i,d=o+r,u=o*3,g=(u+r*2)*i,m=`${e},${t},${i},${n}`;if(Hn[m]!==void 0)return{el:Hn[m],height:a,width:g,middleWidth:s*i,sideWidth:d*i,padding:r*i,dpr:i};const f=document.createElement("canvas"),c=f.getContext("2d");return c===null?null:(f.width=g,f.height=a,c.scale(i,i),Hn[m]=f,c.beginPath(),at(c,r,r,u,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(),at(c,r+.5,r+.5,u,l,o),c.strokeStyle=t,c.lineWidth=1,c.stroke(),{el:f,height:a,width:g,sideWidth:d*i,middleWidth:o*i,padding:r*i,dpr:i})}function us(e,t){const{rect:n,theme:o,ctx:i,imageLoader:r,col:l,row:s}=e,{x:a,width:d}=n,u=o.baseFontFull,g=ei(i,u),m=Math.min(n.height,Math.max(16,Math.ceil(g*o.lineHeight)*2)),f=Math.floor(n.y+(n.height-m)/2),c=m-10,h=8,b=cs;let v=a+o.cellHorizontalPadding;const S=o.roundingRadius??6,C=ds(o.bgCell,o.drilldownBorder,m,S),E=[];for(const D of t){if(v>a+d)break;const P=Qt(D.text,i,u).width;let R=0;D.img!==void 0&&r.loadOrGetImage(D.img,l,s)!==void 0&&(R=c-8+4);const x=P+R+h*2;E.push({x:v,width:x}),v+=x+b}if(C!==null){const{el:D,height:A,middleWidth:P,sideWidth:R,width:x,dpr:B,padding:I}=C,k=R/B,w=I/B;for(const p of E){const z=Math.floor(p.x),_=Math.floor(p.width),q=_-(k-w)*2;i.imageSmoothingEnabled=!1,i.drawImage(D,0,0,R,A,z-w,f,k,m),q>0&&i.drawImage(D,R,0,P,A,z+(k-w),f,q,m),i.drawImage(D,x-R,0,R,A,z+_-(k-w),f,k,m),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[D,A]of E.entries()){const P=t[D];let R=A.x+h;if(P.img!==void 0){const x=r.loadOrGetImage(P.img,l,s);if(x!==void 0){const B=c-8;let I=0,k=0,w=x.width,p=x.height;w>p?(I+=(w-p)/2,w=p):p>w&&(k+=(p-w)/2,p=w),i.beginPath(),at(i,R,f+m/2-B/2,B,B,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,I,k,w,p,R,f+m/2-B/2,B,B),i.restore(),R+=B+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(P.text,R,f+m/2+kt(i,o))}}const fs=mt("div")({name:"ImageOverlayEditorStyle",class:"i1f2fhaz",propsAsIs:!1}),hs=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 Ge(fs,{"data-testid":"GDG-default-image-overlay-editor",children:[Y(Xi.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l,children:r.map(s=>{const a=(i==null?void 0:i(s))??Y("img",{draggable:!1,src:s});return Y("div",{className:"gdg-centering-container",children:a},s)})}),n&&o&&Y("button",{className:"gdg-edit-icon",onClick:o,children:Y(jn,{})})]})},gs={getAccessibilityString:e=>e.data.join(", "),kind:le.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>ms(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 Y(o??hs,{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}}},Bn=4;function ms(e,t,n,o){const{rect:i,col:r,row:l,theme:s,ctx:a,imageLoader:d}=e,{x:u,y:g,height:m,width:f}=i,c=m-s.cellVerticalPadding*2,h=[];let b=0;for(let S=0;S0&&(a.beginPath(),at(a,v,g+s.cellVerticalPadding,C,c,n),a.save(),a.clip()),a.drawImage(S,v,g+s.cellVerticalPadding,C,c),n>0&&a.restore(),v+=C+Bn}}function ys(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const bs={getAccessibilityString:()=>"",kind:le.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(ys(n,o)*t.skeletonWidthVariability));const a=l.cellHorizontalPadding,d=t.skeletonHeight??Math.min(18,r.height-2*l.cellVerticalPadding);at(i,r.x+a,r.y+(r.height-d)/2,s,d,l.roundingRadius??3),i.fillStyle=en(l.textDark,.1),i.fill()},onPaste:()=>{}},vs=mt("div")({name:"MarkdownContainer",class:"m1ec5h7p",propsAsIs:!1});class ps extends _n.PureComponent{constructor(){super(...arguments);ee(this,"targetElement",null);ee(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=Ti(i),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let a=r==null?void 0:r(l);if(a===void 0){const u=document.createElement("template");u.innerHTML=l,a=u.content}n.append(a);const d=n.getElementsByTagName("a");for(const u of d)u.target="_blank",u.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),Y(vs,{ref:this.containerRefHook})}}const ws=mt("textarea")({name:"InputBox",class:"iotb8b8",propsAsIs:!1}),ks=mt("div")({name:"ShadowBox",class:"s1xtsfdl",propsAsIs:!1}),xs=mt("div")({name:"GrowingEntryStyle",class:"g1d7u5bt",propsAsIs:!1});let Oo=0;const pn=e=>{const{placeholder:t,value:n,onKeyDown:o,highlight:i,altNewline:r,validatedSelection:l,...s}=e,{onChange:a,className:d}=s,u=M.useRef(null),g=n??"";ht(a!==void 0,"GrowingEntry must be a controlled input area");const[m]=M.useState(()=>"input-box-"+(Oo=(Oo+1)%1e7));M.useEffect(()=>{const c=u.current;if(c===null||c.disabled)return;const h=g.toString().length;c.focus(),c.setSelectionRange(i?0:h,h)},[]),M.useLayoutEffect(()=>{var c;if(l!==void 0){const h=typeof l=="number"?[l,null]:l;(c=u.current)==null||c.setSelectionRange(h[0],h[1])}},[l]);const f=M.useCallback(c=>{c.key==="Enter"&&c.shiftKey&&r===!0||o==null||o(c)},[r,o]);return Ge(xs,{className:"gdg-growing-entry",children:[Y(ks,{className:d,children:g+` -`}),Y(ws,{...s,className:(d??"")+" gdg-input",id:m,ref:u,onKeyDown:f,value:g,placeholder:t,dir:"auto"})]})},Cs=()=>e=>e.targetWidth,Xo=mt("div")({name:"MarkdownOverlayEditorStyle",class:"mmv7gx6",propsAsIs:!1,vars:{"mmv7gx6-0":[Cs(),"px"]}}),Ss=e=>{const{value:t,onChange:n,forceEditMode:o,createNode:i,targetRect:r,onFinish:l,validatedSelection:s}=e,a=t.data,d=t.readonly===!0,[u,g]=M.useState(a===""||o),m=M.useCallback(()=>{g(c=>!c)},[]),f=a?"gdg-ml-6":"";return u?Ge(Xo,{targetWidth:r.width-20,children:[Y(pn,{autoFocus:!0,highlight:!1,validatedSelection:s,value:a,onKeyDown:c=>{c.key==="Enter"&&c.stopPropagation()},onChange:n}),Y("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>l(t),children:Y(Ki,{})})]}):Ge(Xo,{targetWidth:r.width,children:[Y(ps,{contents:a,createNode:i}),!d&&Ge(Rn,{children:[Y("div",{className:"spacer"}),Y("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:m,children:Y(jn,{})})]}),Y("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0})]})},Ms={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:le.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Zt,measure:(e,t,n)=>{const o=t.data.split(` -`)[0];return e.measureText(o).width+2*n.cellHorizontalPadding},draw:e=>gt(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 Y(Ss,{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}},Is={getAccessibilityString:e=>e.row.toString(),kind:Gt.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Es,measure:()=>44,draw:e=>Ds(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 Es(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=Fs,n.textAlign="center",r}function Fs(e){const{ctx:t}=e;t.textAlign="start"}function Ds(e,t,n,o,i,r){const{ctx:l,rect:s,hoverAmount:a,theme:d}=e,{x:u,y:g,width:m,height:f}=s,c=n?1:o==="checkbox-visible"?.6+.4*a:a;if(o!=="number"&&c>0){l.globalAlpha=c;const h=7*(n?a:1);if(Zn(l,d,n,i?u+h:u,g,i?m-h:m,f,!0,void 0,void 0,18,"center",r),i){l.globalAlpha=a,l.beginPath();for(const b of[3,6])for(const v of[-5,-1,3])l.rect(u+b,g+f/2+v,2,2);l.fillStyle=d.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(o==="number"||o==="both"&&!n){const h=t.toString(),b=d.markerFontFull,v=u+m/2;o==="both"&&a!==0&&(l.globalAlpha=1-a),l.fillStyle=d.textLight,l.font=b,l.fillText(h,v,g+f/2+kt(l,b)),a!==0&&(l.globalAlpha=1)}}const As={getAccessibilityString:()=>"",kind:Gt.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ps(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Ps(e,t,n){const{ctx:o,rect:i,hoverAmount:r,theme:l,spriteManager:s}=e,{x:a,y:d,width:u,height:g}=i;o.beginPath(),o.globalAlpha=r,o.rect(a+1,d+1,u,g-2),o.fillStyle=l.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const m=t!=="";let f=0;if(n!==void 0){const h=g-8,b=a+8/2,v=d+8/2;s.drawSprite(n,"normal",o,b,v,h,l,m?1:r),f=h}else{f=24;const c=12,h=m?c:r*c,b=m?0:(1-r)*c*.5,v=l.cellHorizontalPadding+4;h>0&&(o.moveTo(a+v+b,d+g/2),o.lineTo(a+v+b+h,d+g/2),o.moveTo(a+v+b+h*.5,d+g/2-h*.5),o.lineTo(a+v+b+h*.5,d+g/2+h*.5),o.lineWidth=2,o.strokeStyle=l.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=l.textMedium,o.fillText(t,f+a+l.cellHorizontalPadding+.5,d+g/2+kt(o,l)),o.beginPath()}const Hs=M.lazy(async()=>await Yi(()=>import("./number-overlay-editor-wZgFM_Mr.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),Bs={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:le.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:Zt,draw:e=>gt(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 Y(M.Suspense,{fallback:null,children:Y(Hs,{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}}},Ts={getAccessibilityString:()=>"",measure:()=>108,kind:le.Protected,needsHover:!1,needsHoverPosition:!1,draw:Rs,onPaste:()=>{}};function Rs(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,u=Math.cos(wo(30))*s,g=Math.sin(wo(30))*s;for(let m=0;m<12;m++)t.moveTo(a,d-s),t.lineTo(a,d+s),t.moveTo(a+u,d-g),t.lineTo(a-u,d+g),t.moveTo(a-u,d-g),t.lineTo(a+u,d+g),a+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Ls={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:le.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Zt(e,t,e.theme.textLight),draw:e=>gt(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 Y(pn,{highlight:t,autoFocus:o.readonly!==!0,disabled:o.readonly!==!1,value:o.data,validatedSelection:i,onChange:r=>n({...o,data:r.target.value})})},onPaste:()=>{}},Ws={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:le.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Zt,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:u,allowWrapping:g}=t;if(u===!0&&n>0){i.textBaseline="alphabetic";const m=l.cellHorizontalPadding,f=l.cellVerticalPadding,c=Qt(a,i,l.baseFontFull,"alphabetic"),h=r.height-f,b=Math.min(h,c.actualBoundingBoxAscent*2.5);i.beginPath(),at(i,r.x+m/2,r.y+(r.height-b)/2+1,c.width+m*3,b-1,l.roundingRadius??4),i.globalAlpha=n,i.fillStyle=en(l.textDark,.1),i.fill(),i.globalAlpha=1,i.fillStyle=l.textDark,i.textBaseline="middle",s==null||s("text")}gt(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 Y(pn,{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}},Ns=mt("div")({name:"UriOverlayEditorStyle",class:"uwr6ffw",propsAsIs:!1}),zs=e=>{const{uri:t,onChange:n,forceEditMode:o,readonly:i,validatedSelection:r,preview:l}=e,[s,a]=M.useState(!i&&(t===""||o)),d=M.useCallback(()=>{a(!0)},[]);return s?Y(pn,{validatedSelection:r,highlight:!0,autoFocus:!0,value:t,onChange:n}):Ge(Ns,{children:[Y("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer",children:l}),!i&&Y("div",{className:"gdg-edit-icon",onClick:d,children:Y(jn,{})}),Y("textarea",{className:"gdg-input",autoFocus:!0})]})},Os=zs;function $o(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 Xs={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:le.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Zt,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 u=Qt(a,s,n.baseFontFull),g=$o(u,l,n,t.contentAlign),{x:m,y:f,width:c,height:h}=g;if(i>=m-4&&i<=m-4+c+8&&r>=f-4&&r<=f-4+h+8){const b=kt(s,n.baseFontFull);o("pointer");const v=5,S=f-b;s.beginPath(),s.moveTo(l.x+m,Math.floor(l.y+S+h+v)+.5),s.lineTo(l.x+m+c,Math.floor(l.y+S+h+v)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,gt({...e,rect:{...l,x:l.x-1}},a,t.contentAlign),gt({...e,rect:{...l,x:l.x-2}},a,t.contentAlign),gt({...e,rect:{...l,x:l.x+1}},a,t.contentAlign),gt({...e,rect:{...l,x:l.x+2}},a,t.contentAlign),s.restore()}}s.fillStyle=d?n.linkColor:n.textDark,gt(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=ar(l,r.baseFontFull);if(s===void 0)return;const a=$o(s,n,r,t.contentAlign);Qn({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 Y(Os,{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}},gl=[Is,As,Jr,ns,as,gs,bs,Ms,Bs,Ts,Ls,Ws,Xs],Tn=[];class $s extends ni{constructor(){super(...arguments);ee(this,"imageLoaded",()=>{});ee(this,"loadedLocations",[]);ee(this,"cache",{});ee(this,"sendLoaded",$i(()=>{this.imageLoaded(new Kt(this.loadedLocations)),this.loadedLocations=[]},20));ee(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,Tn.length<12?Tn.unshift(s):l||(s.src=""))}},u=new Promise(g=>s.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,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(Jn(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=rt(o,i);return l.cells.includes(s)||l.cells.push(s),l.img}else this.loadImage(n,o,i,r)}}const ml=$s;export{Xr as A,ll as B,Nn as C,Un as D,Ui as E,Zs as F,le as G,ol as H,Gt as I,dl as J,fl as K,ko as L,il as M,hl as N,ml as O,gl as P,cl as Q,Bo as R,zr as S,sl as T,Qs as U,_i as a,ht as b,al as c,nl as d,ul as e,tl as f,rl as g,en as h,Gs as i,Ks as j,Ot as k,Pt as l,Jt as m,zn as n,To as o,Qn as p,nr as q,Js as r,_o as s,Gr as t,Ke as u,qi as v,el as w,pr as x,hn 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"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} \ No newline at end of file diff --git a/docs/assets/imperative-scroll.stories-4UxtfACG.js b/docs/assets/imperative-scroll.stories-RcWZSjf2.js similarity index 88% rename from docs/assets/imperative-scroll.stories-4UxtfACG.js rename to docs/assets/imperative-scroll.stories-RcWZSjf2.js index 6809e2b75..0d1967b36 100644 --- a/docs/assets/imperative-scroll.stories-4UxtfACG.js +++ b/docs/assets/imperative-scroll.stories-RcWZSjf2.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-ATY7qU3b.js";import{a as C,B as h,D as v,P as A,M as k,d as D}from"./utils-wFAOo4Dx.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{a as C,B as h,D as v,P as A,M as k,d as D}from"./utils-H5nRE5Sr.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-gLOd2BMK.js b/docs/assets/input-blending.stories-VM6JAg9H.js similarity index 89% rename from docs/assets/input-blending.stories-gLOd2BMK.js rename to docs/assets/input-blending.stories-VM6JAg9H.js index a4c52e954..04a7aaa3d 100644 --- a/docs/assets/input-blending.stories-gLOd2BMK.js +++ b/docs/assets/input-blending.stories-VM6JAg9H.js @@ -1,4 +1,4 @@ -import{j as n}from"./marked.esm-dbrxtycE.js";import{D as u}from"./data-editor-all-ATY7qU3b.js";import{B as s,D as a,u as p,d as m}from"./utils-wFAOo4Dx.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as u}from"./data-editor-all-Orvb2jqb.js";import{B as s,D as a,u as p,d as m}from"./utils-H5nRE5Sr.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-SyQJcnnF.js b/docs/assets/keybindings.stories-oPqd4IqH.js similarity index 92% rename from docs/assets/keybindings.stories-SyQJcnnF.js rename to docs/assets/keybindings.stories-oPqd4IqH.js index ffa7262ad..6ef9b4358 100644 --- a/docs/assets/keybindings.stories-SyQJcnnF.js +++ b/docs/assets/keybindings.stories-oPqd4IqH.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-ATY7qU3b.js";import{u as x,B as K,D as v,d as w}from"./utils-wFAOo4Dx.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{u as x,B as K,D as v,d as w}from"./utils-H5nRE5Sr.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-Xjwr_MCa.js b/docs/assets/layout-integration.stories-SOrBfORV.js similarity index 82% rename from docs/assets/layout-integration.stories-Xjwr_MCa.js rename to docs/assets/layout-integration.stories-SOrBfORV.js index 0ae7311aa..f0545c494 100644 --- a/docs/assets/layout-integration.stories-Xjwr_MCa.js +++ b/docs/assets/layout-integration.stories-SOrBfORV.js @@ -1,4 +1,4 @@ -import{j as t,a,F as d}from"./marked.esm-dbrxtycE.js";import{D as s}from"./data-editor-all-ATY7qU3b.js";import{b as m,D as h,u as c,d as n}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as s}from"./data-editor-all-Orvb2jqb.js";import{b as m,D as h,u as c,d as n}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-rHIKy8Yw.js b/docs/assets/multi-select-columns.stories-WLnxbntf.js similarity index 80% rename from docs/assets/multi-select-columns.stories-rHIKy8Yw.js rename to docs/assets/multi-select-columns.stories-WLnxbntf.js index 8dd292a02..a1a688b14 100644 --- a/docs/assets/multi-select-columns.stories-rHIKy8Yw.js +++ b/docs/assets/multi-select-columns.stories-WLnxbntf.js @@ -1,4 +1,4 @@ -import{j as e,a as t,F as m}from"./marked.esm-dbrxtycE.js";import{D as p}from"./data-editor-all-ATY7qU3b.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-wFAOo4Dx.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as p}from"./data-editor-all-Orvb2jqb.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-H5nRE5Sr.js";import{S as M}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-4Wrkki96.js b/docs/assets/new-column-button.stories-ZGQpxfuS.js similarity index 83% rename from docs/assets/new-column-button.stories-4Wrkki96.js rename to docs/assets/new-column-button.stories-ZGQpxfuS.js index 3e8114cb1..0bb4bfe8a 100644 --- a/docs/assets/new-column-button.stories-4Wrkki96.js +++ b/docs/assets/new-column-button.stories-ZGQpxfuS.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-ATY7qU3b.js";import{B as d,D as p,P as C,u as f,d as h,C as w}from"./utils-wFAOo4Dx.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as d,D as p,P as C,u as f,d as h,C as w}from"./utils-H5nRE5Sr.js";import{S as g}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-1HAYybuQ.js b/docs/assets/obscured-grid.stories-P6IlOXMw.js similarity index 85% rename from docs/assets/obscured-grid.stories-1HAYybuQ.js rename to docs/assets/obscured-grid.stories-P6IlOXMw.js index 3e789ac8d..88f247d0d 100644 --- a/docs/assets/obscured-grid.stories-1HAYybuQ.js +++ b/docs/assets/obscured-grid.stories-P6IlOXMw.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-ATY7qU3b.js";import{B as C,D as m,M as p,u as g,d as x}from"./utils-wFAOo4Dx.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as u}from"./data-editor-all-Orvb2jqb.js";import{B as C,D as m,M as p,u as g,d as x}from"./utils-H5nRE5Sr.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-wDflXFhy.js b/docs/assets/observe-visible-region.stories-Z_0v27cG.js similarity index 84% rename from docs/assets/observe-visible-region.stories-wDflXFhy.js rename to docs/assets/observe-visible-region.stories-Z_0v27cG.js index 181b49109..a18943ae7 100644 --- a/docs/assets/observe-visible-region.stories-wDflXFhy.js +++ b/docs/assets/observe-visible-region.stories-Z_0v27cG.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-ATY7qU3b.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-wFAOo4Dx.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.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-H5nRE5Sr.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-ASfLg6lj.js b/docs/assets/one-hundred-thousand-columns.stories-bRcFhkz9.js similarity index 73% rename from docs/assets/one-hundred-thousand-columns.stories-ASfLg6lj.js rename to docs/assets/one-hundred-thousand-columns.stories-bRcFhkz9.js index 86cba58d3..8d4a30894 100644 --- a/docs/assets/one-hundred-thousand-columns.stories-ASfLg6lj.js +++ b/docs/assets/one-hundred-thousand-columns.stories-bRcFhkz9.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-ATY7qU3b.js";import{B as l,D as m,u as d,d as p}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as i}from"./data-editor-all-Orvb2jqb.js";import{B as l,D as m,u as d,d as p}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-mYnEUUjW.js b/docs/assets/one-million-rows.stories-nru7-UGq.js similarity index 72% rename from docs/assets/one-million-rows.stories-mYnEUUjW.js rename to docs/assets/one-million-rows.stories-nru7-UGq.js index 6ba22d65b..221a86ede 100644 --- a/docs/assets/one-million-rows.stories-mYnEUUjW.js +++ b/docs/assets/one-million-rows.stories-nru7-UGq.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-ATY7qU3b.js";import{B as l,D as m,u as p,d as c}from"./utils-wFAOo4Dx.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as n}from"./data-editor-all-Orvb2jqb.js";import{B as l,D as m,u as p,d as c}from"./utils-H5nRE5Sr.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-BiJONp1O.js b/docs/assets/overscroll.stories-A_Lx3RKM.js similarity index 78% rename from docs/assets/overscroll.stories-BiJONp1O.js rename to docs/assets/overscroll.stories-A_Lx3RKM.js index abceb7762..58e6144c2 100644 --- a/docs/assets/overscroll.stories-BiJONp1O.js +++ b/docs/assets/overscroll.stories-A_Lx3RKM.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-ATY7qU3b.js";import{B as u,D as g,P as t,u as h,d as D}from"./utils-wFAOo4Dx.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as v}from"./data-editor-all-Orvb2jqb.js";import{B as u,D as g,P as t,u as h,d as D}from"./utils-H5nRE5Sr.js";import{S as f}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-ZWMs_gRb.js b/docs/assets/padding.stories-ehBQ4sav.js similarity index 78% rename from docs/assets/padding.stories-ZWMs_gRb.js rename to docs/assets/padding.stories-ehBQ4sav.js index 38a286d3e..a7da4c168 100644 --- a/docs/assets/padding.stories-ZWMs_gRb.js +++ b/docs/assets/padding.stories-ehBQ4sav.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-ATY7qU3b.js";import{B as h,D as u,P as e,u as D,d as f}from"./utils-wFAOo4Dx.js";import{S as x}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as c}from"./data-editor-all-Orvb2jqb.js";import{B as h,D as u,P as e,u as D,d as f}from"./utils-H5nRE5Sr.js";import{S as x}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-6x2XV--i.js b/docs/assets/paste-support.stories-sdcUdsuJ.js similarity index 80% rename from docs/assets/paste-support.stories-6x2XV--i.js rename to docs/assets/paste-support.stories-sdcUdsuJ.js index 60926bec4..c33151cd6 100644 --- a/docs/assets/paste-support.stories-6x2XV--i.js +++ b/docs/assets/paste-support.stories-sdcUdsuJ.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-ATY7qU3b.js";import{B as u,D as c,P as g,M as h,u as f,d as C}from"./utils-wFAOo4Dx.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as m}from"./data-editor-all-Orvb2jqb.js";import{B as u,D as c,P as g,M as h,u as f,d as C}from"./utils-H5nRE5Sr.js";import{S as y}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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--t2MrJGI.js b/docs/assets/prevent-diagonal-scroll.stories-0Ai_tt-9.js similarity index 74% rename from docs/assets/prevent-diagonal-scroll.stories--t2MrJGI.js rename to docs/assets/prevent-diagonal-scroll.stories-0Ai_tt-9.js index 914ce7e83..99ae5067e 100644 --- a/docs/assets/prevent-diagonal-scroll.stories--t2MrJGI.js +++ b/docs/assets/prevent-diagonal-scroll.stories-0Ai_tt-9.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-ATY7qU3b.js";import{B as c,D as m,P as d,u as g,d as D}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as p}from"./data-editor-all-Orvb2jqb.js";import{B as c,D as m,P as d,u as g,d as D}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-hYfzbE0D.js b/docs/assets/rapid-updates.stories-q80YNc9k.js similarity index 92% rename from docs/assets/rapid-updates.stories-hYfzbE0D.js rename to docs/assets/rapid-updates.stories-q80YNc9k.js index bd1618f1d..1525dea60 100644 --- a/docs/assets/rapid-updates.stories-hYfzbE0D.js +++ b/docs/assets/rapid-updates.stories-q80YNc9k.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-wFAOo4Dx.js";import{G as v}from"./image-window-loader-hgJATaim.js";import{S as A}from"./story-utils-K2EZnGjM.js";import{D as F}from"./data-editor-all-ATY7qU3b.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-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./scrolling-data-grid-ta-GKPbC.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-H5nRE5Sr.js";import{G as v}from"./image-window-loader-h6lJQmfV.js";import{S as A}from"./story-utils-K2EZnGjM.js";import{D as F}from"./data-editor-all-Orvb2jqb.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-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./scrolling-data-grid-6lFEHS8-.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-SZIK2AoM.js b/docs/assets/rearrange-columns.stories-bv75-Qfg.js similarity index 88% rename from docs/assets/rearrange-columns.stories-SZIK2AoM.js rename to docs/assets/rearrange-columns.stories-bv75-Qfg.js index 0e10301a2..3f3c6c6a5 100644 --- a/docs/assets/rearrange-columns.stories-SZIK2AoM.js +++ b/docs/assets/rearrange-columns.stories-bv75-Qfg.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-ATY7qU3b.js";import{B as h,D as k,P as f,u as I,d as S}from"./utils-wFAOo4Dx.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as h,D as k,P as f,u as I,d as S}from"./utils-H5nRE5Sr.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-wH0mtACy.js b/docs/assets/reorder-rows.stories-nxlJdvfv.js similarity index 99% rename from docs/assets/reorder-rows.stories-wH0mtACy.js rename to docs/assets/reorder-rows.stories-nxlJdvfv.js index dc426105f..5aaf600c2 100644 --- a/docs/assets/reorder-rows.stories-wH0mtACy.js +++ b/docs/assets/reorder-rows.stories-nxlJdvfv.js @@ -1,4 +1,4 @@ -import{j as Pt,F as sp,a as ap}from"./marked.esm-dbrxtycE.js";import{c as ue,R as tr}from"./index-BMVQvedj.js";import{D as cp}from"./data-editor-all-ATY7qU3b.js";import{B as hp,D as gp,P as _p,d as pp}from"./utils-wFAOo4Dx.js";import{G as dp}from"./image-window-loader-hgJATaim.js";import{S as vp}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";var rr={exports:{}};/** +import{j as Pt,F as sp,a as ap}from"./marked.esm-dbrxtycE.js";import{c as ue,R as tr}from"./index-BMVQvedj.js";import{D as cp}from"./data-editor-all-Orvb2jqb.js";import{B as hp,D as gp,P as _p,d as pp}from"./utils-H5nRE5Sr.js";import{G as dp}from"./image-window-loader-h6lJQmfV.js";import{S as vp}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";var rr={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/docs/assets/resizable-columns.stories-Sc3HX8f2.js b/docs/assets/resizable-columns.stories-FVujiygH.js similarity index 85% rename from docs/assets/resizable-columns.stories-Sc3HX8f2.js rename to docs/assets/resizable-columns.stories-FVujiygH.js index d434aa855..8c7313afd 100644 --- a/docs/assets/resizable-columns.stories-Sc3HX8f2.js +++ b/docs/assets/resizable-columns.stories-FVujiygH.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-ATY7qU3b.js";import{B as d,D as h,P as s,M as C,u as g,d as f}from"./utils-wFAOo4Dx.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as d,D as h,P as s,M as C,u as g,d as f}from"./utils-H5nRE5Sr.js";import{S as z}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-UmAM6Ze_.js b/docs/assets/right-element.stories-kBZv1_Df.js similarity index 90% rename from docs/assets/right-element.stories-UmAM6Ze_.js rename to docs/assets/right-element.stories-kBZv1_Df.js index 863b447fc..5ad2cb752 100644 --- a/docs/assets/right-element.stories-UmAM6Ze_.js +++ b/docs/assets/right-element.stories-kBZv1_Df.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-ATY7qU3b.js";import{B as R,D as b,P as y,u as C,d as x}from"./utils-wFAOo4Dx.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as R,D as b,P as y,u as C,d as x}from"./utils-H5nRE5Sr.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-B21b_QWi.js b/docs/assets/right-to-left.stories-qUoBnm3m.js similarity index 86% rename from docs/assets/right-to-left.stories-B21b_QWi.js rename to docs/assets/right-to-left.stories-qUoBnm3m.js index 41b749738..16f27c30a 100644 --- a/docs/assets/right-to-left.stories-B21b_QWi.js +++ b/docs/assets/right-to-left.stories-qUoBnm3m.js @@ -1,4 +1,4 @@ -import{j as e,F as d}from"./marked.esm-dbrxtycE.js";import{R as C}from"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ATY7qU3b.js";import{B as p,D as g,u as E,d as f}from"./utils-wFAOo4Dx.js";import{G as h}from"./image-window-loader-hgJATaim.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const O={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(R,{children:e(p,{title:"Right ",description:e(d,{children:e(g,{children:"The data editor automatically detects RTL in text cells and respects it."})}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:r,setCellValue:s,onColumnResize:i}=E(60,!1),D=C.useCallback(l=>{const[c,w]=l;return c!==0?r(l):{kind:h.Text,allowOverlay:!0,data:"אני גדעון, מומחה לאפליקציות גלייד.",displayData:"אני גדעון, מומחה לאפליקציות גלייד.",allowWrapping:!0}},[r]);return e(m,{...f,getCellContent:D,columns:o,onColumnResize:i,getCellsForSelection:!0,rowMarkers:"both",onPaste:!0,onCellEdited:s,rows:1e3})};var u,n,a;t.parameters={...t.parameters,docs:{...(u=t.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{j as e,F as d}from"./marked.esm-dbrxtycE.js";import{R as C}from"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as g,u as E,d as f}from"./utils-H5nRE5Sr.js";import{G as h}from"./image-window-loader-h6lJQmfV.js";import{S as R}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const O={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>e(R,{children:e(p,{title:"Right ",description:e(d,{children:e(g,{children:"The data editor automatically detects RTL in text cells and respects it."})}),children:e(o,{})})})]},t=()=>{const{cols:o,getCellContent:r,setCellValue:s,onColumnResize:i}=E(60,!1),D=C.useCallback(l=>{const[c,w]=l;return c!==0?r(l):{kind:h.Text,allowOverlay:!0,data:"אני גדעון, מומחה לאפליקציות גלייד.",displayData:"אני גדעון, מומחה לאפליקציות גלייד.",allowWrapping:!0}},[r]);return e(m,{...f,getCellContent:D,columns:o,onColumnResize:i,getCellsForSelection:!0,rowMarkers:"both",onPaste:!0,onCellEdited:s,rows:1e3})};var u,n,a;t.parameters={...t.parameters,docs:{...(u=t.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const { cols, getCellContent, diff --git a/docs/assets/row-and-header-sizes.stories-QFH73U1l.js b/docs/assets/row-and-header-sizes.stories-mfzrzOgV.js similarity index 78% rename from docs/assets/row-and-header-sizes.stories-QFH73U1l.js rename to docs/assets/row-and-header-sizes.stories-mfzrzOgV.js index cba93441b..0e10340c2 100644 --- a/docs/assets/row-and-header-sizes.stories-QFH73U1l.js +++ b/docs/assets/row-and-header-sizes.stories-mfzrzOgV.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-ATY7qU3b.js";import{B as p,D as c,P as a,M as g,u as w,d as H}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as l}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as c,P as a,M as g,u as w,d as H}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-hover.stories-g_7ySNqU.js b/docs/assets/row-hover.stories-sPMoBQT6.js similarity index 85% rename from docs/assets/row-hover.stories-g_7ySNqU.js rename to docs/assets/row-hover.stories-sPMoBQT6.js index 4a60e5052..304dcc528 100644 --- a/docs/assets/row-hover.stories-g_7ySNqU.js +++ b/docs/assets/row-hover.stories-sPMoBQT6.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-ATY7qU3b.js";import{B as v,D as h,P as R,a as g,d as C}from"./utils-wFAOo4Dx.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as v,D as h,P as R,a as g,d as C}from"./utils-H5nRE5Sr.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-lU0WninX.js b/docs/assets/row-markers.stories-ljeoW-nD.js similarity index 77% rename from docs/assets/row-markers.stories-lU0WninX.js rename to docs/assets/row-markers.stories-ljeoW-nD.js index 00e15856d..f83ffbf79 100644 --- a/docs/assets/row-markers.stories-lU0WninX.js +++ b/docs/assets/row-markers.stories-ljeoW-nD.js @@ -1,4 +1,4 @@ -import{j as r,F as c,a as l}from"./marked.esm-dbrxtycE.js";import"./index-BMVQvedj.js";import{D as m}from"./data-editor-all-ATY7qU3b.js";import{B as p,D as d,P as k,u,d as h}from"./utils-wFAOo4Dx.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(b,{children:r(p,{title:"Row markers",description:r(c,{children:l(d,{children:["Row Markers can be controlled by setting the ",r(k,{children:"rowMarkers"})," prop."]})}),children:r(o,{})})})]},e=o=>{const{cols:n,getCellContent:i}=u(10,!1);return r(m,{...h,getCellContent:i,verticalBorder:!1,rowMarkers:{kind:o.markers,checkboxStyle:"circle"},columns:n,rows:400})};e.args={markers:"both"};e.argTypes={markers:{control:{type:"select"},options:["both","checkbox","number","none","clickable-number","checkbox-visible"]}};var t,s,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`p => { +import{j as r,F as c,a as l}from"./marked.esm-dbrxtycE.js";import{D as m}from"./data-editor-all-Orvb2jqb.js";import{B as p,D as d,P as k,u,d as h}from"./utils-H5nRE5Sr.js";import{S as b}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";const v={title:"Glide-Data-Grid/DataEditor Demos",decorators:[o=>r(b,{children:r(p,{title:"Row markers",description:r(c,{children:l(d,{children:["Row Markers can be controlled by setting the ",r(k,{children:"rowMarkers"})," prop."]})}),children:r(o,{})})})]},e=o=>{const{cols:n,getCellContent:i}=u(10,!1);return r(m,{...h,getCellContent:i,verticalBorder:!1,rowMarkers:{kind:o.markers,checkboxStyle:"circle"},columns:n,rows:400})};e.args={markers:"both"};e.argTypes={markers:{control:{type:"select"},options:["both","checkbox","number","none","clickable-number","checkbox-visible"]}};var t,s,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`p => { const { cols, getCellContent diff --git a/docs/assets/scaled-view.stories-c07hXgiF.js b/docs/assets/scaled-view.stories-530Lb6MO.js similarity index 68% rename from docs/assets/scaled-view.stories-c07hXgiF.js rename to docs/assets/scaled-view.stories-530Lb6MO.js index 106ad95c5..b8ae5b539 100644 --- a/docs/assets/scaled-view.stories-c07hXgiF.js +++ b/docs/assets/scaled-view.stories-530Lb6MO.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-ATY7qU3b.js";import{B as m,D as p,u as c,d}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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{D as l}from"./data-editor-all-Orvb2jqb.js";import{B as m,D as p,u as c,d}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./index-BMVQvedj.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-shadows.stories-NAs8aeEG.js b/docs/assets/scroll-shadows.stories-Lwuq98B7.js similarity index 90% rename from docs/assets/scroll-shadows.stories-NAs8aeEG.js rename to docs/assets/scroll-shadows.stories-Lwuq98B7.js index 1628d5559..9828edfda 100644 --- a/docs/assets/scroll-shadows.stories-NAs8aeEG.js +++ b/docs/assets/scroll-shadows.stories-Lwuq98B7.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-ATY7qU3b.js";import{B as b,D as R,u as y,d as k}from"./utils-wFAOo4Dx.js";import{C as c}from"./image-window-loader-hgJATaim.js";import{S as B}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as b,D as R,u as y,d as k}from"./utils-H5nRE5Sr.js";import{C as c}from"./image-window-loader-h6lJQmfV.js";import{S as B}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-ta-GKPbC.js b/docs/assets/scrolling-data-grid-6lFEHS8-.js similarity index 99% rename from docs/assets/scrolling-data-grid-ta-GKPbC.js rename to docs/assets/scrolling-data-grid-6lFEHS8-.js index b1c65ecf9..b6401d90c 100644 --- a/docs/assets/scrolling-data-grid-ta-GKPbC.js +++ b/docs/assets/scrolling-data-grid-6lFEHS8-.js @@ -1 +1 @@ -import{j,a as ue,F as we,s as ve}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{c as me}from"./throttle-7EuXLZa7.js";import{Q as Ce,R as he,u as ge}from"./image-window-loader-hgJATaim.js";function ce(e,u,v,o){return me(Math.round(u-(e.growOffset??0)),Math.ceil(v),Math.floor(o))}const Re=e=>{const[u,v]=t.useState(),[o,D]=t.useState(),[l,X]=t.useState(),[f,h]=t.useState(),[x,b]=t.useState(!1),[L,i]=t.useState(),[m,Y]=t.useState(),[$,te]=t.useState(),[oe,ee]=t.useState(!1),[ne,re]=t.useState(),{onHeaderMenuClick:F,getCellContent:se,onColumnMoved:C,onColumnResize:y,onColumnResizeStart:G,onColumnResizeEnd:W,gridRef:_,maxColumnWidth:z,minColumnWidth:H,onRowMoved:A,lockColumns:B,onColumnProposeMove:K,onMouseDown:J,onMouseUp:P,onItemHovered:Z,onDragStart:n,canvasRef:M}=e,I=(y??W??G)!==void 0,{columns:a,selection:Q}=e,r=Q.columns,R=t.useCallback(s=>{const[g,w]=s.location;l!==void 0&&f!==g&&g>=B?(b(!0),h(g)):m!==void 0&&w!==void 0?(ee(!0),te(Math.max(0,w))):o===void 0&&!x&&!oe&&(Z==null||Z(s))},[l,m,f,Z,B,o,x,oe]),c=C!==void 0,U=t.useCallback(s=>{var g;if(s.button===0){const[w,d]=s.location;if(s.kind==="out-of-bounds"&&s.isEdge&&I){const k=(g=_==null?void 0:_.current)==null?void 0:g.getBounds(a.length-1,-1);k!==void 0&&(v(k.x),D(a.length-1))}else if(s.kind==="header"&&w>=B){const k=M==null?void 0:M.current;if(s.isEdge&&I&&k){v(s.bounds.x),D(w);const ae=k.getBoundingClientRect().width/k.offsetWidth,ie=s.bounds.width/ae;G==null||G(a[w],ie,w,ie+(a[w].growOffset??0))}else s.kind==="header"&&c&&(i(s.bounds.x),X(w))}else s.kind==="cell"&&B>0&&w===0&&d!==void 0&&A!==void 0&&(re(s.bounds.y),Y(d))}J==null||J(s)},[J,I,B,A,_,a,c,G,M]),V=t.useCallback((s,g)=>{x||oe||F==null||F(s,g)},[x,oe,F]),T=t.useRef(-1),q=t.useCallback(()=>{T.current=-1,Y(void 0),te(void 0),re(void 0),ee(!1),X(void 0),h(void 0),i(void 0),b(!1),D(void 0),v(void 0)},[]),N=t.useCallback((s,g)=>{if(s.button===0){if(o!==void 0){if((r==null?void 0:r.hasIndex(o))===!0)for(const d of r){if(d===o)continue;const k=a[d],p=ce(k,T.current,H,z);y==null||y(k,p,d,p+(k.growOffset??0))}const w=ce(a[o],T.current,H,z);if(W==null||W(a[o],w,o,w+(a[o].growOffset??0)),r.hasIndex(o))for(const d of r){if(d===o)continue;const k=a[d],p=ce(k,T.current,H,z);W==null||W(k,p,d,p+(k.growOffset??0))}}q(),l!==void 0&&f!==void 0&&(C==null||C(l,f)),m!==void 0&&$!==void 0&&(A==null||A(m,$))}P==null||P(s,g)},[P,o,l,f,m,$,r,W,a,H,z,y,C,A,q]),S=t.useMemo(()=>{if(!(l===void 0||f===void 0)&&l!==f&&(K==null?void 0:K(l,f))!==!1)return{src:l,dest:f}},[l,f,K]),E=t.useCallback(s=>{const g=M==null?void 0:M.current;if(l!==void 0&&L!==void 0)Math.abs(s.clientX-L)>20&&b(!0);else if(m!==void 0&&ne!==void 0)Math.abs(s.clientY-ne)>20&&ee(!0);else if(o!==void 0&&u!==void 0&&g){const d=g.getBoundingClientRect().width/g.offsetWidth,k=(s.clientX-u)/d,p=a[o],ae=ce(p,k,H,z);if(y==null||y(p,ae,o,ae+(p.growOffset??0)),T.current=k,(r==null?void 0:r.first())===o)for(const ie of r){if(ie===o)continue;const de=a[ie],fe=ce(de,T.current,H,z);y==null||y(de,fe,ie,fe+(de.growOffset??0))}}},[l,L,m,ne,o,u,a,H,z,y,r,M]),O=t.useCallback((s,g)=>{if(m===void 0||$===void 0)return se(s,g);let[w,d]=s;return d===$?d=m:(d>$&&(d-=1),d>=m&&(d+=1)),se([w,d],g)},[m,$,se]),le=t.useCallback(s=>{n==null||n(s),s.defaultPrevented()||q()},[q,n]);return j(Ce,{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,verticalBorder:e.verticalBorder,width:e.width,getCellContent:O,isResizing:o!==void 0,onHeaderMenuClick:V,isDragging:x,onItemHovered:R,onDragStart:le,onMouseDown:U,allowResize:I,onMouseUp:N,dragAndDropState:S,onMouseMoveRaw:E,ref:_})},Se=Re;function De(e){const u=t.useRef(null),[v,o]=t.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return t.useLayoutEffect(()=>{const D=X=>{for(const f of X){const{width:h,height:x}=f&&f.contentRect||{};o(b=>b.width===h&&b.height===x?b:{width:h,height:x})}},l=new window.ResizeObserver(D);return u.current&&l.observe(u.current,void 0),()=>{l.disconnect()}},[u.current]),{ref:u,...v}}const be=(e,u,v)=>{const o=t.useRef(null),D=t.useRef(null),l=t.useRef(null),X=t.useRef(0),f=t.useRef(u);f.current=u;const h=v.current;t.useEffect(()=>{const x=()=>{var i,m;if(D.current===!1&&h!==null){const Y=[h.scrollLeft,h.scrollTop];if(((i=l.current)==null?void 0:i[0])===Y[0]&&((m=l.current)==null?void 0:m[1])===Y[1])if(X.current>10){l.current=null,D.current=null;return}else X.current++;else X.current=0,f.current(Y[0],Y[1]),l.current=Y;o.current=window.setTimeout(x,8.333333333333334)}},b=()=>{D.current=!0,l.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},L=i=>{i.touches.length===0&&(D.current=!1,X.current=0,o.current=window.setTimeout(x,8.333333333333334))};if(e&&h!==null){const i=h;return i.addEventListener("touchstart",b),i.addEventListener("touchend",L),()=>{i.removeEventListener("touchstart",b),i.removeEventListener("touchend",L),o.current!==null&&window.clearTimeout(o.current)}}},[e,h])},ye=be,xe=()=>e=>e.isSafari?"scroll":"auto",He=ve("div")({name:"ScrollRegionStyle",class:"sj2f20c",propsAsIs:!1,vars:{"sj2f20c-0":[xe()]}});function Me(e){const[u,v]=t.useState(!1),o=typeof window>"u"?null:window,D=t.useRef(0);return ge("touchstart",t.useCallback(()=>{window.clearTimeout(D.current),v(!0)},[]),o,!0,!1),ge("touchend",t.useCallback(l=>{l.touches.length===0&&(D.current=window.setTimeout(()=>v(!1),e))},[e]),o,!0,!1),u}const ke=e=>{var a,Q;const{children:u,clientHeight:v,scrollHeight:o,scrollWidth:D,update:l,draggable:X,className:f,preventDiagonalScrolling:h=!1,paddingBottom:x=0,paddingRight:b=0,rightElement:L,rightElementProps:i,kineticScrollPerfHack:m=!1,scrollRef:Y,initialSize:$}=e,te=[],oe=(i==null?void 0:i.sticky)??!1,ee=(i==null?void 0:i.fill)??!1,ne=t.useRef(0),re=t.useRef(0),F=t.useRef(null),se=typeof window>"u"?1:window.devicePixelRatio,C=t.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),y=t.useRef(null),G=Me(200),[W,_]=t.useState(!0),z=t.useRef(0);t.useLayoutEffect(()=>{if(!W||G||C.current.lockDirection===void 0)return;const r=F.current;if(r===null)return;const[R,c]=C.current.lockDirection;R!==void 0?r.scrollLeft=R:c!==void 0&&(r.scrollTop=c),C.current.lockDirection=void 0},[G,W]);const H=t.useCallback((r,R)=>{var g;const c=F.current;if(c===null)return;R=R??c.scrollTop,r=r??c.scrollLeft;const U=C.current.scrollTop,V=C.current.scrollLeft,T=r-V,q=R-U;G&&T!==0&&q!==0&&(Math.abs(T)>3||Math.abs(q)>3)&&h&&C.current.lockDirection===void 0&&(C.current.lockDirection=Math.abs(T)0&&(Math.abs(le)>2e3||O===0||O===s)&&o>c.scrollHeight+5){const w=O/s,d=(o-E)*w;ne.current=d-O}N!==void 0&&(window.clearTimeout(z.current),_(!1),z.current=window.setTimeout(()=>_(!0),200)),l({x:r,y:O+ne.current,width:S-b,height:E-x,paddingRight:((g=y.current)==null?void 0:g.clientWidth)??0})},[x,b,o,l,h,G]);ye(m&&he.value,H,F);const A=t.useRef(H);A.current=H;const B=t.useRef(),K=t.useRef(!1);t.useLayoutEffect(()=>{K.current?H():K.current=!0},[H,x,b]);const J=t.useCallback(r=>{F.current=r,Y!==void 0&&(Y.current=r)},[Y]);let P=0,Z=0;for(te.push(j("div",{style:{width:D,height:0}},P++));ZA.current(),0),B.current={width:M,height:I}),(M??0)===0||(I??0)===0?j("div",{ref:n}):j("div",{ref:n,children:ue(He,{isSafari:he.value,children:[j("div",{className:"dvn-underlay",children:u}),j("div",{ref:J,style:B.current,draggable:X,onDragStart:r=>{X||(r.stopPropagation(),r.preventDefault())},className:"dvn-scroller "+(f??""),onScroll:()=>H(),children:ue("div",{className:"dvn-scroll-inner"+(L===void 0?" dvn-hidden":""),children:[j("div",{className:"dvn-stack",children:te}),L!==void 0&&ue(we,{children:[!ee&&j("div",{className:"dvn-spacer"}),j("div",{ref:y,style:{height:I,maxHeight:v-Math.ceil(se%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:b,flexGrow:ee?1:void 0,right:oe?b??0:void 0,pointerEvents:"auto"},children:L})]})]})})]})})},Te=e=>{const{columns:u,rows:v,rowHeight:o,headerHeight:D,groupHeaderHeight:l,enableGroups:X,freezeColumns:f,experimental:h,nonGrowWidth:x,clientSize:b,className:L,onVisibleRegionChanged:i,scrollRef:m,preventDiagonalScrolling:Y,rightElement:$,rightElementProps:te,overscrollX:oe,overscrollY:ee,initialSize:ne,smoothScrollX:re=!1,smoothScrollY:F=!1,isDraggable:se}=e,{paddingRight:C,paddingBottom:y}=h??{},[G,W]=b,_=t.useRef(),z=t.useRef(),H=t.useRef(),A=t.useRef(),B=x+Math.max(0,oe??0);let K=X?D+l:D;if(typeof o=="number")K+=v*o;else for(let n=0;n{var q,N;if(J.current===void 0)return;const n={...J.current};let M=0,I=n.x<0?-n.x:0,a=0,Q=0;n.x=n.x<0?0:n.x;let r=0;for(let S=0;S=E+S.width)M+=S.width,Q++,a++;else if(n.x>E)M+=S.width,re?I+=E-n.x:Q++,a++;else if(n.x+n.width>E)M+=S.width,a++;else break}let R=0,c=0,U=0;if(typeof o=="number")F?(c=Math.floor(n.y/o),R=c*o-n.y):c=Math.ceil(n.y/o),U=Math.ceil(n.height/o)+c,R<0&&U++;else{let S=0;for(let E=0;E=S+O)S+=O,c++,U++;else if(n.y>le)S+=O,F?R+=le-n.y:c++,U++;else if(n.y+n.height>O/2+S)S+=O,U++;else break}}const V={x:Q,y:c,width:a-Q,height:U-c},T=_.current;(T===void 0||T.y!==V.y||T.x!==V.x||T.height!==V.height||T.width!==V.width||z.current!==I||H.current!==R||n.width!==((q=A.current)==null?void 0:q[0])||n.height!==((N=A.current)==null?void 0:N[1]))&&(i==null||i({x:Q,y:c,width:a-Q,height:U-c},n.width,n.height,n.paddingRight??0,I,R),_.current=V,z.current=I,H.current=R,A.current=[n.width,n.height])},[u,o,v,i,f,re,F]),Z=t.useCallback(n=>{J.current=n,P()},[P]);return t.useEffect(()=>{P()},[P]),j(ke,{scrollRef:m,className:L,kineticScrollPerfHack:h==null?void 0:h.kineticScrollPerfHack,preventDiagonalScrolling:Y,draggable:se===!0||typeof se=="string",scrollWidth:B+(C??0),scrollHeight:K+(y??0),clientHeight:W,rightElement:$,paddingBottom:y,paddingRight:C,rightElementProps:te,update:Z,initialSize:ne,children:j(Se,{eventTargetRef:m,width:G,height:W,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,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})})},We=Te;export{We as G}; +import{j,a as ue,F as we,s as ve}from"./marked.esm-dbrxtycE.js";import{r as t}from"./index-BMVQvedj.js";import{c as me}from"./throttle-7EuXLZa7.js";import{Q as Ce,R as he,u as ge}from"./image-window-loader-h6lJQmfV.js";function ce(e,u,v,o){return me(Math.round(u-(e.growOffset??0)),Math.ceil(v),Math.floor(o))}const Re=e=>{const[u,v]=t.useState(),[o,D]=t.useState(),[l,X]=t.useState(),[f,h]=t.useState(),[x,b]=t.useState(!1),[L,i]=t.useState(),[m,Y]=t.useState(),[$,te]=t.useState(),[oe,ee]=t.useState(!1),[ne,re]=t.useState(),{onHeaderMenuClick:F,getCellContent:se,onColumnMoved:C,onColumnResize:y,onColumnResizeStart:G,onColumnResizeEnd:W,gridRef:_,maxColumnWidth:z,minColumnWidth:H,onRowMoved:A,lockColumns:B,onColumnProposeMove:K,onMouseDown:J,onMouseUp:P,onItemHovered:Z,onDragStart:n,canvasRef:M}=e,I=(y??W??G)!==void 0,{columns:a,selection:Q}=e,r=Q.columns,R=t.useCallback(s=>{const[g,w]=s.location;l!==void 0&&f!==g&&g>=B?(b(!0),h(g)):m!==void 0&&w!==void 0?(ee(!0),te(Math.max(0,w))):o===void 0&&!x&&!oe&&(Z==null||Z(s))},[l,m,f,Z,B,o,x,oe]),c=C!==void 0,U=t.useCallback(s=>{var g;if(s.button===0){const[w,d]=s.location;if(s.kind==="out-of-bounds"&&s.isEdge&&I){const k=(g=_==null?void 0:_.current)==null?void 0:g.getBounds(a.length-1,-1);k!==void 0&&(v(k.x),D(a.length-1))}else if(s.kind==="header"&&w>=B){const k=M==null?void 0:M.current;if(s.isEdge&&I&&k){v(s.bounds.x),D(w);const ae=k.getBoundingClientRect().width/k.offsetWidth,ie=s.bounds.width/ae;G==null||G(a[w],ie,w,ie+(a[w].growOffset??0))}else s.kind==="header"&&c&&(i(s.bounds.x),X(w))}else s.kind==="cell"&&B>0&&w===0&&d!==void 0&&A!==void 0&&(re(s.bounds.y),Y(d))}J==null||J(s)},[J,I,B,A,_,a,c,G,M]),V=t.useCallback((s,g)=>{x||oe||F==null||F(s,g)},[x,oe,F]),T=t.useRef(-1),q=t.useCallback(()=>{T.current=-1,Y(void 0),te(void 0),re(void 0),ee(!1),X(void 0),h(void 0),i(void 0),b(!1),D(void 0),v(void 0)},[]),N=t.useCallback((s,g)=>{if(s.button===0){if(o!==void 0){if((r==null?void 0:r.hasIndex(o))===!0)for(const d of r){if(d===o)continue;const k=a[d],p=ce(k,T.current,H,z);y==null||y(k,p,d,p+(k.growOffset??0))}const w=ce(a[o],T.current,H,z);if(W==null||W(a[o],w,o,w+(a[o].growOffset??0)),r.hasIndex(o))for(const d of r){if(d===o)continue;const k=a[d],p=ce(k,T.current,H,z);W==null||W(k,p,d,p+(k.growOffset??0))}}q(),l!==void 0&&f!==void 0&&(C==null||C(l,f)),m!==void 0&&$!==void 0&&(A==null||A(m,$))}P==null||P(s,g)},[P,o,l,f,m,$,r,W,a,H,z,y,C,A,q]),S=t.useMemo(()=>{if(!(l===void 0||f===void 0)&&l!==f&&(K==null?void 0:K(l,f))!==!1)return{src:l,dest:f}},[l,f,K]),E=t.useCallback(s=>{const g=M==null?void 0:M.current;if(l!==void 0&&L!==void 0)Math.abs(s.clientX-L)>20&&b(!0);else if(m!==void 0&&ne!==void 0)Math.abs(s.clientY-ne)>20&&ee(!0);else if(o!==void 0&&u!==void 0&&g){const d=g.getBoundingClientRect().width/g.offsetWidth,k=(s.clientX-u)/d,p=a[o],ae=ce(p,k,H,z);if(y==null||y(p,ae,o,ae+(p.growOffset??0)),T.current=k,(r==null?void 0:r.first())===o)for(const ie of r){if(ie===o)continue;const de=a[ie],fe=ce(de,T.current,H,z);y==null||y(de,fe,ie,fe+(de.growOffset??0))}}},[l,L,m,ne,o,u,a,H,z,y,r,M]),O=t.useCallback((s,g)=>{if(m===void 0||$===void 0)return se(s,g);let[w,d]=s;return d===$?d=m:(d>$&&(d-=1),d>=m&&(d+=1)),se([w,d],g)},[m,$,se]),le=t.useCallback(s=>{n==null||n(s),s.defaultPrevented()||q()},[q,n]);return j(Ce,{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,verticalBorder:e.verticalBorder,width:e.width,getCellContent:O,isResizing:o!==void 0,onHeaderMenuClick:V,isDragging:x,onItemHovered:R,onDragStart:le,onMouseDown:U,allowResize:I,onMouseUp:N,dragAndDropState:S,onMouseMoveRaw:E,ref:_})},Se=Re;function De(e){const u=t.useRef(null),[v,o]=t.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return t.useLayoutEffect(()=>{const D=X=>{for(const f of X){const{width:h,height:x}=f&&f.contentRect||{};o(b=>b.width===h&&b.height===x?b:{width:h,height:x})}},l=new window.ResizeObserver(D);return u.current&&l.observe(u.current,void 0),()=>{l.disconnect()}},[u.current]),{ref:u,...v}}const be=(e,u,v)=>{const o=t.useRef(null),D=t.useRef(null),l=t.useRef(null),X=t.useRef(0),f=t.useRef(u);f.current=u;const h=v.current;t.useEffect(()=>{const x=()=>{var i,m;if(D.current===!1&&h!==null){const Y=[h.scrollLeft,h.scrollTop];if(((i=l.current)==null?void 0:i[0])===Y[0]&&((m=l.current)==null?void 0:m[1])===Y[1])if(X.current>10){l.current=null,D.current=null;return}else X.current++;else X.current=0,f.current(Y[0],Y[1]),l.current=Y;o.current=window.setTimeout(x,8.333333333333334)}},b=()=>{D.current=!0,l.current=null,o.current!==null&&(window.clearTimeout(o.current),o.current=null)},L=i=>{i.touches.length===0&&(D.current=!1,X.current=0,o.current=window.setTimeout(x,8.333333333333334))};if(e&&h!==null){const i=h;return i.addEventListener("touchstart",b),i.addEventListener("touchend",L),()=>{i.removeEventListener("touchstart",b),i.removeEventListener("touchend",L),o.current!==null&&window.clearTimeout(o.current)}}},[e,h])},ye=be,xe=()=>e=>e.isSafari?"scroll":"auto",He=ve("div")({name:"ScrollRegionStyle",class:"sj2f20c",propsAsIs:!1,vars:{"sj2f20c-0":[xe()]}});function Me(e){const[u,v]=t.useState(!1),o=typeof window>"u"?null:window,D=t.useRef(0);return ge("touchstart",t.useCallback(()=>{window.clearTimeout(D.current),v(!0)},[]),o,!0,!1),ge("touchend",t.useCallback(l=>{l.touches.length===0&&(D.current=window.setTimeout(()=>v(!1),e))},[e]),o,!0,!1),u}const ke=e=>{var a,Q;const{children:u,clientHeight:v,scrollHeight:o,scrollWidth:D,update:l,draggable:X,className:f,preventDiagonalScrolling:h=!1,paddingBottom:x=0,paddingRight:b=0,rightElement:L,rightElementProps:i,kineticScrollPerfHack:m=!1,scrollRef:Y,initialSize:$}=e,te=[],oe=(i==null?void 0:i.sticky)??!1,ee=(i==null?void 0:i.fill)??!1,ne=t.useRef(0),re=t.useRef(0),F=t.useRef(null),se=typeof window>"u"?1:window.devicePixelRatio,C=t.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),y=t.useRef(null),G=Me(200),[W,_]=t.useState(!0),z=t.useRef(0);t.useLayoutEffect(()=>{if(!W||G||C.current.lockDirection===void 0)return;const r=F.current;if(r===null)return;const[R,c]=C.current.lockDirection;R!==void 0?r.scrollLeft=R:c!==void 0&&(r.scrollTop=c),C.current.lockDirection=void 0},[G,W]);const H=t.useCallback((r,R)=>{var g;const c=F.current;if(c===null)return;R=R??c.scrollTop,r=r??c.scrollLeft;const U=C.current.scrollTop,V=C.current.scrollLeft,T=r-V,q=R-U;G&&T!==0&&q!==0&&(Math.abs(T)>3||Math.abs(q)>3)&&h&&C.current.lockDirection===void 0&&(C.current.lockDirection=Math.abs(T)0&&(Math.abs(le)>2e3||O===0||O===s)&&o>c.scrollHeight+5){const w=O/s,d=(o-E)*w;ne.current=d-O}N!==void 0&&(window.clearTimeout(z.current),_(!1),z.current=window.setTimeout(()=>_(!0),200)),l({x:r,y:O+ne.current,width:S-b,height:E-x,paddingRight:((g=y.current)==null?void 0:g.clientWidth)??0})},[x,b,o,l,h,G]);ye(m&&he.value,H,F);const A=t.useRef(H);A.current=H;const B=t.useRef(),K=t.useRef(!1);t.useLayoutEffect(()=>{K.current?H():K.current=!0},[H,x,b]);const J=t.useCallback(r=>{F.current=r,Y!==void 0&&(Y.current=r)},[Y]);let P=0,Z=0;for(te.push(j("div",{style:{width:D,height:0}},P++));ZA.current(),0),B.current={width:M,height:I}),(M??0)===0||(I??0)===0?j("div",{ref:n}):j("div",{ref:n,children:ue(He,{isSafari:he.value,children:[j("div",{className:"dvn-underlay",children:u}),j("div",{ref:J,style:B.current,draggable:X,onDragStart:r=>{X||(r.stopPropagation(),r.preventDefault())},className:"dvn-scroller "+(f??""),onScroll:()=>H(),children:ue("div",{className:"dvn-scroll-inner"+(L===void 0?" dvn-hidden":""),children:[j("div",{className:"dvn-stack",children:te}),L!==void 0&&ue(we,{children:[!ee&&j("div",{className:"dvn-spacer"}),j("div",{ref:y,style:{height:I,maxHeight:v-Math.ceil(se%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:b,flexGrow:ee?1:void 0,right:oe?b??0:void 0,pointerEvents:"auto"},children:L})]})]})})]})})},Te=e=>{const{columns:u,rows:v,rowHeight:o,headerHeight:D,groupHeaderHeight:l,enableGroups:X,freezeColumns:f,experimental:h,nonGrowWidth:x,clientSize:b,className:L,onVisibleRegionChanged:i,scrollRef:m,preventDiagonalScrolling:Y,rightElement:$,rightElementProps:te,overscrollX:oe,overscrollY:ee,initialSize:ne,smoothScrollX:re=!1,smoothScrollY:F=!1,isDraggable:se}=e,{paddingRight:C,paddingBottom:y}=h??{},[G,W]=b,_=t.useRef(),z=t.useRef(),H=t.useRef(),A=t.useRef(),B=x+Math.max(0,oe??0);let K=X?D+l:D;if(typeof o=="number")K+=v*o;else for(let n=0;n{var q,N;if(J.current===void 0)return;const n={...J.current};let M=0,I=n.x<0?-n.x:0,a=0,Q=0;n.x=n.x<0?0:n.x;let r=0;for(let S=0;S=E+S.width)M+=S.width,Q++,a++;else if(n.x>E)M+=S.width,re?I+=E-n.x:Q++,a++;else if(n.x+n.width>E)M+=S.width,a++;else break}let R=0,c=0,U=0;if(typeof o=="number")F?(c=Math.floor(n.y/o),R=c*o-n.y):c=Math.ceil(n.y/o),U=Math.ceil(n.height/o)+c,R<0&&U++;else{let S=0;for(let E=0;E=S+O)S+=O,c++,U++;else if(n.y>le)S+=O,F?R+=le-n.y:c++,U++;else if(n.y+n.height>O/2+S)S+=O,U++;else break}}const V={x:Q,y:c,width:a-Q,height:U-c},T=_.current;(T===void 0||T.y!==V.y||T.x!==V.x||T.height!==V.height||T.width!==V.width||z.current!==I||H.current!==R||n.width!==((q=A.current)==null?void 0:q[0])||n.height!==((N=A.current)==null?void 0:N[1]))&&(i==null||i({x:Q,y:c,width:a-Q,height:U-c},n.width,n.height,n.paddingRight??0,I,R),_.current=V,z.current=I,H.current=R,A.current=[n.width,n.height])},[u,o,v,i,f,re,F]),Z=t.useCallback(n=>{J.current=n,P()},[P]);return t.useEffect(()=>{P()},[P]),j(ke,{scrollRef:m,className:L,kineticScrollPerfHack:h==null?void 0:h.kineticScrollPerfHack,preventDiagonalScrolling:Y,draggable:se===!0||typeof se=="string",scrollWidth:B+(C??0),scrollHeight:K+(y??0),clientHeight:W,rightElement:$,paddingBottom:y,paddingRight:C,rightElementProps:te,update:Z,initialSize:ne,children:j(Se,{eventTargetRef:m,width:G,height:W,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,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})})},We=Te;export{We as G}; diff --git a/docs/assets/scrolling-data-grid.stories-DAbjeSkr.js b/docs/assets/scrolling-data-grid.stories-6ZtRyRmb.js similarity index 76% rename from docs/assets/scrolling-data-grid.stories-DAbjeSkr.js rename to docs/assets/scrolling-data-grid.stories-6ZtRyRmb.js index bc0041f47..bae416816 100644 --- a/docs/assets/scrolling-data-grid.stories-DAbjeSkr.js +++ b/docs/assets/scrolling-data-grid.stories-6ZtRyRmb.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-ta-GKPbC.js";import{G as c,O as D,m as b,g as H,C as l,P as G}from"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";const X=y("div")({name:"InnerContainer",class:"i1iwi3t9",propsAsIs:!1}),Y=o=>{if(o.kind!==c.Custom)return G.find(r=>r.kind===o.kind)},$={title:"Subcomponents/ScrollingDataGrid",decorators:[o=>i("div",{children:i(x,{width:1500,height:1e3,children:i(X,{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:Y,onMouseMove:()=>{},rows:1e4,enableGroups:!1,clientSize:[1e3,1e3,0],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:()=>{},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:void 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-6lFEHS8-.js";import{G as c,O as D,m as b,g as H,C as l,P as G}from"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";const X=y("div")({name:"InnerContainer",class:"i1iwi3t9",propsAsIs:!1}),Y=o=>{if(o.kind!==c.Custom)return G.find(r=>r.kind===o.kind)},$={title:"Subcomponents/ScrollingDataGrid",decorators:[o=>i("div",{children:i(x,{width:1500,height:1e3,children:i(X,{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:Y,onMouseMove:()=>{},rows:1e4,enableGroups:!1,clientSize:[1e3,1e3,0],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:()=>{},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); @@ -22,7 +22,7 @@ import{j as i,s as y}from"./marked.esm-dbrxtycE.js";import{r as n}from"./index-B data: \`\${col},\${row} Testing things that are way too long\`, allowOverlay: true }), []); - return undefined} rows={10_000} enableGroups={false} clientSize={[1000, 1000, 0]} cellXOffset={x} cellYOffset={y} drawHeader={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} nonGrowWidth={1000} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseUp={() => undefined} canvasRef={undefined} className={undefined} drawCell={undefined} disabledRows={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} drawFocusRing={undefined} initialSize={undefined} overscrollX={undefined} overscrollY={undefined} preventDiagonalScrolling={undefined} rightElement={undefined} rightElementProps={undefined} scrollRef={undefined} minColumnWidth={50} isFocused={true} theme={mergeAndRealizeTheme(getDefaultTheme())} isFilling={false} maxColumnWidth={500} accessibilityHeight={50} translateX={translateX} translateY={translateY} lockColumns={0} selection={{ + return undefined} rows={10_000} enableGroups={false} clientSize={[1000, 1000, 0]} cellXOffset={x} cellYOffset={y} drawHeader={undefined} experimental={undefined} headerIcons={undefined} isDraggable={undefined} nonGrowWidth={1000} onCanvasBlur={() => undefined} onCanvasFocused={() => undefined} onCellFocused={() => undefined} onContextMenu={() => undefined} onDragEnd={() => undefined} onDragLeave={() => undefined} onDragOverCell={() => undefined} onDragStart={() => undefined} onDrop={() => undefined} onItemHovered={() => undefined} onKeyDown={() => undefined} onKeyUp={() => undefined} onMouseDown={() => undefined} onMouseUp={() => undefined} canvasRef={undefined} className={undefined} drawCell={undefined} disabledRows={undefined} fillHandle={undefined} fixedShadowX={undefined} fixedShadowY={undefined} getGroupDetails={undefined} getRowThemeOverride={undefined} highlightRegions={undefined} imageWindowLoader={new ImageWindowLoaderImpl()} onHeaderMenuClick={undefined} prelightCells={undefined} drawFocusRing={true} initialSize={undefined} overscrollX={undefined} overscrollY={undefined} preventDiagonalScrolling={undefined} rightElement={undefined} rightElementProps={undefined} scrollRef={undefined} minColumnWidth={50} isFocused={true} theme={mergeAndRealizeTheme(getDefaultTheme())} isFilling={false} maxColumnWidth={500} accessibilityHeight={50} translateX={translateX} translateY={translateY} lockColumns={0} selection={{ current: undefined, rows: CompactSelection.empty(), columns: CompactSelection.empty() diff --git a/docs/assets/search-as-filter.stories-KSmou1ov.js b/docs/assets/search-as-filter.stories-JRWC8o2i.js similarity index 90% rename from docs/assets/search-as-filter.stories-KSmou1ov.js rename to docs/assets/search-as-filter.stories-JRWC8o2i.js index 9e1019184..0f22cd85a 100644 --- a/docs/assets/search-as-filter.stories-KSmou1ov.js +++ b/docs/assets/search-as-filter.stories-JRWC8o2i.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-hgJATaim.js";import{D as y}from"./data-editor-all-ATY7qU3b.js";import{B as R,D,a as F,d as v}from"./utils-wFAOo4Dx.js";import{S as E}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-h6lJQmfV.js";import{D as y}from"./data-editor-all-Orvb2jqb.js";import{B as R,D,a as F,d as v}from"./utils-H5nRE5Sr.js";import{S as E}from"./story-utils-K2EZnGjM.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-gWjcAL7N.js b/docs/assets/server-side-data.stories-JnB-tDZS.js similarity index 93% rename from docs/assets/server-side-data.stories-gWjcAL7N.js rename to docs/assets/server-side-data.stories-JnB-tDZS.js index 973f6bdc6..869137136 100644 --- a/docs/assets/server-side-data.stories-gWjcAL7N.js +++ b/docs/assets/server-side-data.stories-JnB-tDZS.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-hgJATaim.js";import{S as B}from"./story-utils-K2EZnGjM.js";import{D as W}from"./data-editor-all-ATY7qU3b.js";import{a as F,b as O,r as C}from"./throttle-7EuXLZa7.js";import{B as V}from"./utils-wFAOo4Dx.js";import{a as j}from"./doc-wrapper-eGylnU1T.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-ta-GKPbC.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./toConsumableArray-2oaFSNyq.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-h6lJQmfV.js";import{S as B}from"./story-utils-K2EZnGjM.js";import{D as W}from"./data-editor-all-Orvb2jqb.js";import{a as F,b as O,r as C}from"./throttle-7EuXLZa7.js";import{B as V}from"./utils-H5nRE5Sr.js";import{a as j}from"./doc-wrapper-eGylnU1T.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-6lFEHS8-.js";import"./index-PWBWJyi_.js";import"./index.esm-Ejw8GwRl.js";import"./index-wocATsGp.js";import"./toConsumableArray-2oaFSNyq.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/silly-numbers.stories-gW0ovL7r.js b/docs/assets/silly-numbers.stories-BedUiNwX.js similarity index 78% rename from docs/assets/silly-numbers.stories-gW0ovL7r.js rename to docs/assets/silly-numbers.stories-BedUiNwX.js index 396ebb2ba..78ca50ec0 100644 --- a/docs/assets/silly-numbers.stories-gW0ovL7r.js +++ b/docs/assets/silly-numbers.stories-BedUiNwX.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-ATY7qU3b.js";import{B as n,D as m,u as p,d as c}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as n,D as m,u as p,d as c}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-0uP-BdOp.js b/docs/assets/small-editable-grid.stories-hBZTigSy.js similarity index 78% rename from docs/assets/small-editable-grid.stories-0uP-BdOp.js rename to docs/assets/small-editable-grid.stories-hBZTigSy.js index f327d82e1..66a23d085 100644 --- a/docs/assets/small-editable-grid.stories-0uP-BdOp.js +++ b/docs/assets/small-editable-grid.stories-hBZTigSy.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-ATY7qU3b.js";import{B as d,D as m,u as p,d as c}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as d,D as m,u as p,d as c}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-5ANjQwqi.js b/docs/assets/smooth-scrolling-grid.stories-GTJV63Gq.js similarity index 77% rename from docs/assets/smooth-scrolling-grid.stories-5ANjQwqi.js rename to docs/assets/smooth-scrolling-grid.stories-GTJV63Gq.js index 1c0b7a25f..99cd6fd6c 100644 --- a/docs/assets/smooth-scrolling-grid.stories-5ANjQwqi.js +++ b/docs/assets/smooth-scrolling-grid.stories-GTJV63Gq.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-ATY7qU3b.js";import{B as p,D as d,P as l,u as h,d as S}from"./utils-wFAOo4Dx.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as p,D as d,P as l,u as h,d as S}from"./utils-H5nRE5Sr.js";import{S as u}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-VjvKBE_I.js b/docs/assets/span-cell.stories-tw6A_N3Y.js similarity index 89% rename from docs/assets/span-cell.stories-VjvKBE_I.js rename to docs/assets/span-cell.stories-tw6A_N3Y.js index 13b8e5288..be20891c3 100644 --- a/docs/assets/span-cell.stories-VjvKBE_I.js +++ b/docs/assets/span-cell.stories-tw6A_N3Y.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-ATY7qU3b.js";import{B as w,D as S,P as C,M as x,u as G,d as v}from"./utils-wFAOo4Dx.js";import{G as m}from"./image-window-loader-hgJATaim.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as w,D as S,P as C,M as x,u as G,d as v}from"./utils-H5nRE5Sr.js";import{G as m}from"./image-window-loader-h6lJQmfV.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-vls6kYIF.js b/docs/assets/stretch-column-size.stories-SdVFbo4t.js similarity index 84% rename from docs/assets/stretch-column-size.stories-vls6kYIF.js rename to docs/assets/stretch-column-size.stories-SdVFbo4t.js index f08c3a410..6cb54939b 100644 --- a/docs/assets/stretch-column-size.stories-vls6kYIF.js +++ b/docs/assets/stretch-column-size.stories-SdVFbo4t.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-ATY7qU3b.js";import{B as z,D as R,P as S,u as f,d as g}from"./utils-wFAOo4Dx.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as z,D as R,P as S,u as f,d as g}from"./utils-H5nRE5Sr.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-h9i75Mql.js b/docs/assets/ten-million-cells.stories-oIkgW9SM.js similarity index 76% rename from docs/assets/ten-million-cells.stories-h9i75Mql.js rename to docs/assets/ten-million-cells.stories-oIkgW9SM.js index 3f3e09e26..a86e77d3f 100644 --- a/docs/assets/ten-million-cells.stories-h9i75Mql.js +++ b/docs/assets/ten-million-cells.stories-oIkgW9SM.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-ATY7qU3b.js";import{B as a,D as m,u as p,d as c}from"./utils-wFAOo4Dx.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as a,D as m,u as p,d as c}from"./utils-H5nRE5Sr.js";import{S as d}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-FcjCnzB-.js b/docs/assets/theme-per-column.stories-BlFcD3Pv.js similarity index 90% rename from docs/assets/theme-per-column.stories-FcjCnzB-.js rename to docs/assets/theme-per-column.stories-BlFcD3Pv.js index a447c87d1..7cab374b4 100644 --- a/docs/assets/theme-per-column.stories-FcjCnzB-.js +++ b/docs/assets/theme-per-column.stories-BlFcD3Pv.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-ATY7qU3b.js";import{B as p,D as A,a as g,d as u}from"./utils-wFAOo4Dx.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as p,D as A,a as g,d as u}from"./utils-H5nRE5Sr.js";import{S as h}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-Eu3WtEBj.js b/docs/assets/theme-per-row.stories-b7zGO_y8.js similarity index 85% rename from docs/assets/theme-per-row.stories-Eu3WtEBj.js rename to docs/assets/theme-per-row.stories-b7zGO_y8.js index a47902eaf..90a472251 100644 --- a/docs/assets/theme-per-row.stories-Eu3WtEBj.js +++ b/docs/assets/theme-per-row.stories-b7zGO_y8.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-ATY7qU3b.js";import{B as f,D as h,P as g,u as R,d as w}from"./utils-wFAOo4Dx.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as f,D as h,P as g,u as R,d as w}from"./utils-H5nRE5Sr.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-4NM0iysP.js b/docs/assets/theme-support.stories-kFZtcTg3.js similarity index 93% rename from docs/assets/theme-support.stories-4NM0iysP.js rename to docs/assets/theme-support.stories-kFZtcTg3.js index a5f835730..78621acf2 100644 --- a/docs/assets/theme-support.stories-4NM0iysP.js +++ b/docs/assets/theme-support.stories-kFZtcTg3.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-ATY7qU3b.js";import{a as S,B as w,D as k,P as x,M as D,d as H}from"./utils-wFAOo4Dx.js";import{S as F}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{a as S,B as w,D as k,P as x,M as D,d as H}from"./utils-H5nRE5Sr.js";import{S as F}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-xsUlaFji.js b/docs/assets/tooltips.stories-9P9czPXw.js similarity index 89% rename from docs/assets/tooltips.stories-xsUlaFji.js rename to docs/assets/tooltips.stories-9P9czPXw.js index 159ca6b74..c85956eee 100644 --- a/docs/assets/tooltips.stories-xsUlaFji.js +++ b/docs/assets/tooltips.stories-9P9czPXw.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-ATY7qU3b.js";import{B as T,D as v,P as R,u as x,d as C}from"./utils-wFAOo4Dx.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as T,D as v,P as R,u as x,d as C}from"./utils-H5nRE5Sr.js";import{S as k}from"./story-utils-K2EZnGjM.js";import"./index-wocATsGp.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-4OthilPr.js b/docs/assets/trailing-row-options.stories-cy84CW2d.js similarity index 89% rename from docs/assets/trailing-row-options.stories-4OthilPr.js rename to docs/assets/trailing-row-options.stories-cy84CW2d.js index 026c9fe59..bc30fda60 100644 --- a/docs/assets/trailing-row-options.stories-4OthilPr.js +++ b/docs/assets/trailing-row-options.stories-cy84CW2d.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-ATY7qU3b.js";import{B as x,D as I,P as f,u as D,c as b,d as k}from"./utils-wFAOo4Dx.js";import{a}from"./image-window-loader-hgJATaim.js";import{S as T}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as x,D as I,P as f,u as D,c as b,d as k}from"./utils-H5nRE5Sr.js";import{a}from"./image-window-loader-h6lJQmfV.js";import{S as T}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-zKUKvwce.js b/docs/assets/uneven-rows.stories-y9dbdZUZ.js similarity index 73% rename from docs/assets/uneven-rows.stories-zKUKvwce.js rename to docs/assets/uneven-rows.stories-y9dbdZUZ.js index 894941bad..ff5939a96 100644 --- a/docs/assets/uneven-rows.stories-zKUKvwce.js +++ b/docs/assets/uneven-rows.stories-y9dbdZUZ.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-ATY7qU3b.js";import{B as l,D as c,P as d,u,d as w}from"./utils-wFAOo4Dx.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./image-window-loader-hgJATaim.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as l,D as c,P as d,u,d as w}from"./utils-H5nRE5Sr.js";import{S as D}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./image-window-loader-h6lJQmfV.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-hjg5vgA3.js b/docs/assets/use-data-source.stories-bY2Du4Dr.js similarity index 99% rename from docs/assets/use-data-source.stories-hjg5vgA3.js rename to docs/assets/use-data-source.stories-bY2Du4Dr.js index 2cb1c0376..fab491c18 100644 --- a/docs/assets/use-data-source.stories-hjg5vgA3.js +++ b/docs/assets/use-data-source.stories-bY2Du4Dr.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-ligl_Vjz.js";import{e as Se,r as I}from"./throttle-7EuXLZa7.js";import"./index-wocATsGp.js";import"./iframe-ni8xiI1Q.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-85iGweFr.js";import{e as Se,r as I}from"./throttle-7EuXLZa7.js";import"./index-wocATsGp.js";import"./iframe-t8ayfGqb.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-wFAOo4Dx.js b/docs/assets/utils-H5nRE5Sr.js similarity index 99% rename from docs/assets/utils-wFAOo4Dx.js rename to docs/assets/utils-H5nRE5Sr.js index 464027a0d..1ecd8390c 100644 --- a/docs/assets/utils-wFAOo4Dx.js +++ b/docs/assets/utils-H5nRE5Sr.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-hgJATaim.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-h6lJQmfV.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-ejj5JmRv.js b/docs/assets/validate-data.stories-pN9rQiyK.js similarity index 81% rename from docs/assets/validate-data.stories-ejj5JmRv.js rename to docs/assets/validate-data.stories-pN9rQiyK.js index 76836ad5f..e1e85c582 100644 --- a/docs/assets/validate-data.stories-ejj5JmRv.js +++ b/docs/assets/validate-data.stories-pN9rQiyK.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-ATY7qU3b.js";import{B as m,D as p,P as f,M as C,u as D,d as V}from"./utils-wFAOo4Dx.js";import{G as h}from"./image-window-loader-hgJATaim.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as m,D as p,P as f,M as C,u as D,d as V}from"./utils-H5nRE5Sr.js";import{G as h}from"./image-window-loader-h6lJQmfV.js";import{S as w}from"./story-utils-K2EZnGjM.js";import"./iframe-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./throttle-7EuXLZa7.js";import"./_baseIteratee-WTHxv43n.js";import"./flatten-qRvRBp6y.js";import"./scrolling-data-grid-6lFEHS8-.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-M9abOMjL.js b/docs/assets/wrapping-text.stories-JUaoMIWD.js similarity index 88% rename from docs/assets/wrapping-text.stories-M9abOMjL.js rename to docs/assets/wrapping-text.stories-JUaoMIWD.js index 0263fa894..263be748f 100644 --- a/docs/assets/wrapping-text.stories-M9abOMjL.js +++ b/docs/assets/wrapping-text.stories-JUaoMIWD.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-ATY7qU3b.js";import{B as h,D as x,P as w,u as y,d as W}from"./utils-wFAOo4Dx.js";import{G as D}from"./image-window-loader-hgJATaim.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-ni8xiI1Q.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-ta-GKPbC.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-Orvb2jqb.js";import{B as h,D as x,P as w,u as y,d as W}from"./utils-H5nRE5Sr.js";import{G as D}from"./image-window-loader-h6lJQmfV.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-t8ayfGqb.js";import"../sb-preview/runtime.js";import"./flatten-qRvRBp6y.js";import"./_baseIteratee-WTHxv43n.js";import"./scrolling-data-grid-6lFEHS8-.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 82bcbcd99..ed7b2a2c5 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -382,7 +382,7 @@ } - + diff --git a/docs/project.json b/docs/project.json index e3b5ae062..66669a3be 100644 --- a/docs/project.json +++ b/docs/project.json @@ -1 +1 @@ -{"generatedAt":1706916410723,"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.7","storybookVersionSpecifier":"^7.6.7","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"7.6.7"},"@storybook/addon-controls":{"version":"7.6.7"},"@storybook/addon-links":{"version":"7.6.7"},"@storybook/addons":{"version":"7.6.7"},"@storybook/builder-vite":{"version":"7.6.12"},"@storybook/react":{"version":"7.6.7"},"@storybook/react-vite":{"version":"7.6.12"},"@storybook/react-webpack5":{"version":"7.6.7"},"storybook":{"version":"7.6.7"}},"addons":{"@storybook/addon-storysource":{"version":"7.6.7"},"$SNIP/node_modules/@storybook/addon-controls":{"version":null}}} +{"generatedAt":1706924770475,"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.7","storybookVersionSpecifier":"^7.6.7","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"7.6.7"},"@storybook/addon-controls":{"version":"7.6.7"},"@storybook/addon-links":{"version":"7.6.7"},"@storybook/addons":{"version":"7.6.7"},"@storybook/builder-vite":{"version":"7.6.12"},"@storybook/react":{"version":"7.6.7"},"@storybook/react-vite":{"version":"7.6.12"},"@storybook/react-webpack5":{"version":"7.6.7"},"storybook":{"version":"7.6.7"}},"addons":{"@storybook/addon-storysource":{"version":"7.6.7"},"$SNIP/node_modules/@storybook/addon-controls":{"version":null}}}