@sheetxl/react 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{VKHWR3AWoMzuFI7k.cjs → B9LGS8BmnoMbzu30.cjs} +1 -1
- package/browser/cjs/{COCkgm8-fe2c7LYP.cjs → B_FP53qR3PJ1H8Na.cjs} +1 -1
- package/browser/cjs/{DaoAGX07szjW7Na_.cjs → D3e2wXiI5aQO332L.cjs} +1 -1
- package/browser/cjs/index.cjs +13 -13
- package/browser/esm/{Vb46TnWVv7cNzPMf.mjs → BC91Htcrvw2he2mK.mjs} +1 -1
- package/browser/esm/{MFoCOovTxqHMrS-r.mjs → Cyt8i0yMUhcyUi_X.mjs} +1 -1
- package/browser/esm/{tWtXdQeWDT3tp47E.mjs → DkcoDi-4aZ6TgzgC.mjs} +1 -1
- package/browser/esm/index.mjs +521 -518
- package/node/esm/{C8Okkdlpyj9V_Xym.mjs → BNOLvMnsg0e12DKh.mjs} +1 -1
- package/node/esm/index.mjs +16 -13
- package/package.json +5 -5
- package/types/index.d.ts +7 -1
package/browser/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
import { FormulaError as Qr, NumberFormat as Kt, ICell as Yt, IBorder as Et, ITextFrame as ve, GeomUtils as Rt, ScalarType as jn, IFont as dt, IRange as qe, LicenseManager as el, IColor as Ql, AutoFill as ei, ISheetView as en, Color as tl, IFill as ho, RangeClipboardItem as ti, ExternalRangeClipboardItem as ni, TextUtils as er, IAnchored as ln, CoordUtils as oi, ThemeCollection as ri } from "@sheetxl/sdk";
|
|
3
3
|
import { LicenseManager as Fd } from "@sheetxl/sdk";
|
|
4
|
-
import { ReactUtils as it, useImperativeElement as _t, useCallbackRef as ie, KeyCodes as It, SimpleCommand as Ue, Command as J, KeyModifiers as
|
|
4
|
+
import { ReactUtils as it, useImperativeElement as _t, useCallbackRef as ie, KeyCodes as It, SimpleCommand as Ue, Command as J, KeyModifiers as te, CommandGroup as Co, useCopyPaste as nl, useEditMode as un, useGlobalClipboard as li, NotificationType as tr, useCommands as ol, ScrollbarOrientation as an, VirtualScrollbar as ii, MouseButtonCodes as rl, ToolTipPlacement as Ln, DefaultNotifier as ai, HorizontalAlignment as si, ScrollPane as di, useFullscreenPortal as ci, defaultCreateScrollStartButton as ui, defaultCreateScrollEndButton as gi, defaultCreateScrollEdgeButton as hi, ScrollUtils as gr } from "@sheetxl/utils-react";
|
|
5
5
|
export * from "@sheetxl/utils-react";
|
|
6
6
|
import { jsx as p, jsxs as Je, Fragment as Sn } from "react/jsx-runtime";
|
|
7
7
|
import { CommonUtils as rt, AnchorLocation as yt, TypesUtils as _n, CoordUtils as qt } from "@sheetxl/utils";
|
|
@@ -9,7 +9,7 @@ import tt, { memo as ft, useMemo as Ce, useState as ue, forwardRef as wt, useRef
|
|
|
9
9
|
import { STANDARD_KEY_CHARS as wi, useSelection as il, useHeaderSelection as yi, HeaderRenderer as bi, Grid as al, HeaderDivider as qi, SELECTION_CLIP_INSETS as jo, defaultSelectionRenderer as Ci, useKeyboardEditorOverlay as Si, Selection as sl, SVGLine as ao } from "@sheetxl/grid-react";
|
|
10
10
|
import { unstable_batchedUpdates as Hn, createPortal as dl } from "react-dom";
|
|
11
11
|
/**
|
|
12
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.
|
|
12
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.6
|
|
13
13
|
*
|
|
14
14
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
15
15
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -47,7 +47,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
47
47
|
}
|
|
48
48
|
else T = q.getNumberFormat();
|
|
49
49
|
O || (B = q.getTextOverflow());
|
|
50
|
-
const W = B ? B.colBounds.width + B.leftOffset + B.rightOffset : L,
|
|
50
|
+
const W = B ? B.colBounds.width + B.leftOffset + B.rightOffset : L, ne = B ? B.anchorBounds.x - B.leftOffset : 0, z = B ? B.anchorBounds.width : L, A = B ? B.anchorBounds.x : 0;
|
|
51
51
|
let P, $ = q.getRenderHorizontalAlignment();
|
|
52
52
|
T && (P = T?.formattedRuns, M = P?.runs[0]?.text ?? T.displayText);
|
|
53
53
|
const ge = q.getCalcStatus() === Yt.CalcStatus.Pending;
|
|
@@ -64,26 +64,26 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
64
64
|
(Oe !== void 0 || _ || be || L !== z) && (Object.keys(C).length === 1 && C.background === "none" || (Y = null, Ae = p("div", { className: "fill", style: { marginLeft: `${K}px`, marginTop: `${a}px`, left: A * c, width: it.boundPixel(z * c - K + 1 + _), height: it.boundPixel(r.height - a + 1 + be), ...C } }, "background")));
|
|
65
65
|
}
|
|
66
66
|
let we = null;
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
67
|
+
const Ze = q.getComments(), he = q.getWarnings(), Ke = q.getErrors();
|
|
68
|
+
if (Ze || j || Ke.length > 0 || he.length > 0) {
|
|
69
69
|
const Oe = { size: 7 * c, darkMode: F, cellWidth: z * c + 2, cellHeight: w * c + 2, style: { top: -1, left: A * c - 1 } };
|
|
70
|
-
we = we ?? [], (he.length > 0 ||
|
|
70
|
+
we = we ?? [], (he.length > 0 || Ke.length > 0 || j) && we.push(p(hr, { anchorLocation: yt.TopLeft, ...Oe }, `indicator-${we.length}`)), Ze && we.push(p(hr, { anchorLocation: yt.TopRight, ...Oe }, `indicator-${we.length}`));
|
|
71
71
|
}
|
|
72
72
|
const De = S.getFont();
|
|
73
73
|
let ce = T?.conditionalColor;
|
|
74
74
|
const de = S.getAlignment(), me = de.getHorizontal() === ve.HorizontalAlignment.Fill, ye = de.getHorizontal() === ve.HorizontalAlignment.CenterContinuous || me, Te = ye || O ? 0 : de.getRotation(), Ie = q.getInsets(), xe = Ie.top + Ie.bottom;
|
|
75
75
|
let Ne = Ie.left, Pe = Ie.right;
|
|
76
|
-
const
|
|
76
|
+
const _e = { ...o, left: o.left - 1, top: o.top - 1, width: o.width + 1 + _, height: o.height + 1 + be }, h = q.getColumnFilter(), je = h && !h?.hasHiddenButton();
|
|
77
77
|
let ut = null;
|
|
78
78
|
ge && (ut = Je("div", { className: "slider", children: [p("div", { className: "line" }), p("div", { className: "subline inc" })] }, "pending"));
|
|
79
|
-
const Qe = !(ge ||
|
|
79
|
+
const Qe = !(ge || je || Ae || l || we || P?.runs.length > 1 || B || Te % 360 != 0);
|
|
80
80
|
Y?.background === "none" && (Y = null);
|
|
81
81
|
let X = ye || !(!B || !(B.rightIndex > 0 || B.leftIndex > 0 || B.colSpan > 1));
|
|
82
82
|
if (!X) {
|
|
83
83
|
const Oe = q.getSpans();
|
|
84
84
|
(Oe.width > 1 || Oe.height > 1) && (X = !0);
|
|
85
85
|
}
|
|
86
|
-
const Le = { ...Y, ...
|
|
86
|
+
const Le = { ...Y, ..._e, pointerEvents: b ? "auto" : void 0 };
|
|
87
87
|
if (!rt.isEmpty(M) || !rt.isEmpty(T?.repeatPlaceholder)) {
|
|
88
88
|
const Oe = T?.canWrap ?? !1;
|
|
89
89
|
let C = null, oe = null, N = null, K = [], a = !0;
|
|
@@ -106,7 +106,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
106
106
|
}
|
|
107
107
|
let f = null;
|
|
108
108
|
Oe && (f = { width: R });
|
|
109
|
-
let I = null,
|
|
109
|
+
let I = null, m = T?.repeatPlaceholder;
|
|
110
110
|
const V = x.layout(f);
|
|
111
111
|
if (C = V.bounds, O ? C = { ...C, width: 0 } : P && (C = { ...C, width: T.repeatPlaceholder || T.repeatChars.length > 0 ? R : P.width }), Te && Oe) {
|
|
112
112
|
let se = null;
|
|
@@ -116,7 +116,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
116
116
|
fe = { ...fe, x: (Be.width - fe.width) / 2, y: (Be.height - fe.height) / 2 }, se = se ? Rt.unionBounds(se, fe) : fe;
|
|
117
117
|
} }), C = { ...se, width: se.width + Ne + Pe };
|
|
118
118
|
}
|
|
119
|
-
if (!
|
|
119
|
+
if (!m && q.getType() !== jn.String && Math.floor(C.width) > R) {
|
|
120
120
|
if (S.getNumberFormat() === "General" && q.getType() === jn.Number) {
|
|
121
121
|
const se = S.measureText("0"), ke = Math.floor(R / se.width), pe = v, fe = rt.splitNumber(pe), Me = Math.min(10, ke - (Math.max(1, fe.ipLength) + 1) - (pe < 0 ? 1 : 0));
|
|
122
122
|
if (Me >= -1) {
|
|
@@ -130,11 +130,11 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
I || (
|
|
133
|
+
I || (m = "#");
|
|
134
134
|
}
|
|
135
|
-
if (!
|
|
136
|
-
const se = S.measureText(
|
|
137
|
-
I = ke > 0 ?
|
|
135
|
+
if (!m && P?.lastRepeatIndex >= 0 && P?.width > R && (m = "#"), m && R > 0) {
|
|
136
|
+
const se = S.measureText(m), ke = Math.floor((R || 1) / (se?.width || 1));
|
|
137
|
+
I = ke > 0 ? m.repeat(ke) : "";
|
|
138
138
|
}
|
|
139
139
|
if (O && ($ = ve.HorizontalAlignment.Left), I) {
|
|
140
140
|
const se = S.measureText(I).width;
|
|
@@ -211,7 +211,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
211
211
|
const Pt = He.length;
|
|
212
212
|
for (let ot = 0; ot < Pt; ot++) {
|
|
213
213
|
const vt = He[ot];
|
|
214
|
-
(vt.type === Kt.ParseRunType.Text || vt.type === Kt.ParseRunType.Repeat) && (vt.type, Kt.ParseRunType.Repeat, Ct(vt, Ft, ot, ke, Me === ve.HorizontalAlignment.Justify || Me === ve.HorizontalAlignment.Distributed || Be?.lastRepeatIndex >= 0 ? R : nt.width, Qe, { x: oe.x +
|
|
214
|
+
(vt.type === Kt.ParseRunType.Text || vt.type === Kt.ParseRunType.Repeat) && (vt.type, Kt.ParseRunType.Repeat, Ct(vt, Ft, ot, ke, Me === ve.HorizontalAlignment.Justify || Me === ve.HorizontalAlignment.Distributed || Be?.lastRepeatIndex >= 0 ? R : nt.width, Qe, { x: oe.x + ne, y: oe.y, width: vt.width, height: C.height }, 0, fe, et)), Ft += vt.width;
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
217
|
I ? le(I, 0, { x: 0, y: 0, ...C }, V.lines[0].baseline, $, !0, null, ee) : V.visitLines({ visitTextLine: (se, ke, pe) => {
|
|
@@ -227,8 +227,8 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
227
227
|
K.length > 0 && (ae = K);
|
|
228
228
|
}
|
|
229
229
|
if (Qe) return ae && ae.length > 0 ? ae : p("div", { style: Le, ...H });
|
|
230
|
-
let Ge = b ? "auto" :
|
|
231
|
-
if (
|
|
230
|
+
let Ge = b ? "auto" : _e.pointerEvents, Fe = null;
|
|
231
|
+
if (je) {
|
|
232
232
|
const Oe = { x: A * c - 1, y: -1, width: z * c + 1, height: w * c + 1 };
|
|
233
233
|
Ge = "auto", Fe = G({ renderBounds: Oe, darkMode: F, className: "filter-button", disabled: !q.isEditAllowed(), zoom: c, filter: q.getColumnFilter(), onFilterButtonMouseDown: D, ...E }), Fe && (Fe = p("div", { style: { ...Oe, position: "absolute", zIndex: 2, display: "flex", alignItems: "end" }, onDoubleClick: (C) => {
|
|
234
234
|
C.stopPropagation(), C.preventDefault();
|
|
@@ -236,15 +236,15 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
236
236
|
}
|
|
237
237
|
ge && !ae && (ae = p("div", { style: { position: "absolute", left: 0, right: 0, top: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", pointerEvents: "none" }, children: "..." }, "pending-ellipsis"));
|
|
238
238
|
const Ve = [Ae, ae, l, we, ut, Fe];
|
|
239
|
-
return p("div", { style: { ...Y, ...
|
|
239
|
+
return p("div", { style: { ...Y, ..._e, pointerEvents: Ge }, ...H, children: Ve });
|
|
240
240
|
}, mr = { text: "", placeholder: "" }, pr = (e, t) => {
|
|
241
241
|
if (!e.clean().getStyle().getNumberFormat().endsWith("%")) return !1;
|
|
242
242
|
const n = t ?? e.dirty ?? "";
|
|
243
243
|
return n.length === 0 || n.endsWith("%") && !isNaN(parseFloat(n.substring(0, n.length - 1)));
|
|
244
244
|
}, Ri = Object.freeze([It.Delete, It.Home, It.End]), Ti = ft(wt((e, t) => {
|
|
245
|
-
const { editState: n, onStartEdit: r, onChangeEdit: l, onSubmitEdit: o, onCancelEdit: i, onDoneEdit: c, defaultTextStyle: g, useRichStyling: s = !0, bodyStyle: y, activeCoords: d, sheet: u, commands: k, containerBounds: b, setNaturalDimensions: D, onFocus: E, disabled: G, style: H, zoom: w = 1, linesVisible: L, autoFocus: q = !1, ...v } = e, { height: S = 0, width: F = 0 } = b ?? {}, T = y?.darkMode ?? !1, M = Re(null), [j, U] = ue(!1), [B, O] = ue(null), [W,
|
|
245
|
+
const { editState: n, onStartEdit: r, onChangeEdit: l, onSubmitEdit: o, onCancelEdit: i, onDoneEdit: c, defaultTextStyle: g, useRichStyling: s = !0, bodyStyle: y, activeCoords: d, sheet: u, commands: k, containerBounds: b, setNaturalDimensions: D, onFocus: E, disabled: G, style: H, zoom: w = 1, linesVisible: L, autoFocus: q = !1, ...v } = e, { height: S = 0, width: F = 0 } = b ?? {}, T = y?.darkMode ?? !1, M = Re(null), [j, U] = ue(!1), [B, O] = ue(null), [W, ne] = ue(() => n);
|
|
246
246
|
Se(() => {
|
|
247
|
-
be.current = !1,
|
|
247
|
+
be.current = !1, ne(n);
|
|
248
248
|
}, [n]);
|
|
249
249
|
const z = Ce(() => {
|
|
250
250
|
const C = W.clean();
|
|
@@ -269,12 +269,12 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
269
269
|
return ee && (re = "'" + re), { text: re, placeholder: se };
|
|
270
270
|
}
|
|
271
271
|
return { text: V.dirty ?? "", placeholder: "" };
|
|
272
|
-
})(W), I = f.text,
|
|
273
|
-
return { style: oe, isWrapped: R, textValue: I, formula: N, frameVertAlign: x, placeholder: f.placeholder, insets: s ? C.getInsets() : _n.EmptyRect, textAlign:
|
|
272
|
+
})(W), I = f.text, m = ve.toCSSHorizontalTextAlign(s && !N ? W.clean()?.getRenderHorizontalAlignment() : ve.HorizontalAlignment.Left);
|
|
273
|
+
return { style: oe, isWrapped: R, textValue: I, formula: N, frameVertAlign: x, placeholder: f.placeholder, insets: s ? C.getInsets() : _n.EmptyRect, textAlign: m };
|
|
274
274
|
}, [W, g, T, w, s]), A = Re(null), P = _t(t, () => ({ startEdit: (C) => {
|
|
275
275
|
M.current = C?.initialSelection;
|
|
276
276
|
const oe = { ...n, editMode: C?.editMode ?? !1 };
|
|
277
|
-
C?.text !== void 0 && (oe.dirty = C.text), oe.editMode === n.editMode && oe.dirty === n.dirty || (
|
|
277
|
+
C?.text !== void 0 && (oe.dirty = C.text), oe.editMode === n.editMode && oe.dirty === n.dirty || (ne(oe), ae?.(oe));
|
|
278
278
|
}, submitEdit: () => Ae(), cancelEdit() {
|
|
279
279
|
we();
|
|
280
280
|
}, autoFocus() {
|
|
@@ -300,11 +300,11 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
300
300
|
const ae = ie(l, [l]), Y = ie((C) => {
|
|
301
301
|
if (W.dirty === C) return;
|
|
302
302
|
const oe = { ...W };
|
|
303
|
-
oe.dirty = C, A.current,
|
|
303
|
+
oe.dirty = C, A.current, ne(oe), ae?.(oe);
|
|
304
304
|
}, [W]), _ = ie((C) => {
|
|
305
305
|
if (W.editMode === C) return;
|
|
306
306
|
const oe = { ...W };
|
|
307
|
-
oe.editMode = C,
|
|
307
|
+
oe.editMode = C, ne(oe), ae?.(oe);
|
|
308
308
|
}, [W]), be = Re(!1), Ae = ie(() => {
|
|
309
309
|
if (be.current) return !1;
|
|
310
310
|
try {
|
|
@@ -314,13 +314,13 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
314
314
|
}
|
|
315
315
|
return !0;
|
|
316
316
|
}, [o, W]), we = ie(() => {
|
|
317
|
-
be.current = !0,
|
|
318
|
-
}, [i, n]),
|
|
317
|
+
be.current = !0, ne(n), i?.(), c?.();
|
|
318
|
+
}, [i, n]), Ze = ie((C) => {
|
|
319
319
|
if (!A.current) return;
|
|
320
320
|
if (C.key, C.isDefaultPrevented(), !(C.isTrusted || C.nativeEvent.ctrlKey || C.nativeEvent.metaKey || C.nativeEvent.altKey || C.nativeEvent.isComposing || wi.indexOf(C.nativeEvent.key) === -1 && C.nativeEvent.key !== "Backspace")) {
|
|
321
321
|
const f = { ...W };
|
|
322
322
|
let I = 0;
|
|
323
|
-
return pr(f, f.dirty) && !isNaN(parseFloat(C.key)) ? (f.dirty?.endsWith("%") ? f.dirty = (f.dirty.substring(0, f.dirty.length - 1) ?? "") + C.key + "%" : f.dirty = (f.dirty ?? "") + C.key + "%", I = f.dirty.length - 1) : C.nativeEvent.key === "Backspace" ? (f.dirty = "", I = f.dirty.length) : (f.dirty = (f.dirty ?? "") + C.key, I = f.dirty.length), A.current.value = f?.dirty, M.current = { start: I, end: I, direction: "forward" }, A.current?.setSelectionRange(I, I, "forward"),
|
|
323
|
+
return pr(f, f.dirty) && !isNaN(parseFloat(C.key)) ? (f.dirty?.endsWith("%") ? f.dirty = (f.dirty.substring(0, f.dirty.length - 1) ?? "") + C.key + "%" : f.dirty = (f.dirty ?? "") + C.key + "%", I = f.dirty.length - 1) : C.nativeEvent.key === "Backspace" ? (f.dirty = "", I = f.dirty.length) : (f.dirty = (f.dirty ?? "") + C.key, I = f.dirty.length), A.current.value = f?.dirty, M.current = { start: I, end: I, direction: "forward" }, A.current?.setSelectionRange(I, I, "forward"), ne(f), ae?.(f), void C.preventDefault();
|
|
324
324
|
}
|
|
325
325
|
const oe = C.nativeEvent.ctrlKey, N = C.nativeEvent.shiftKey, K = C.nativeEvent.altKey, a = C.nativeEvent.metaKey;
|
|
326
326
|
if (oe && C.key === "z" && C.stopPropagation(), C.which === It.Escape) return C.preventDefault(), void we();
|
|
@@ -357,7 +357,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
357
357
|
A.current?.focus(), setTimeout(() => {
|
|
358
358
|
A.current?.select();
|
|
359
359
|
}, 0);
|
|
360
|
-
}, []),
|
|
360
|
+
}, []), Ke = Xe(() => {
|
|
361
361
|
A.current?.focus(), console.log("implement toggleRelativeReferences");
|
|
362
362
|
}, []), De = ie(() => {
|
|
363
363
|
const C = A.current?.value;
|
|
@@ -370,7 +370,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
370
370
|
}, [d, u]);
|
|
371
371
|
Se(() => u.getRange(d).addListener(() => {
|
|
372
372
|
const C = { ...W, clean: () => u.getRange(d).getCell() };
|
|
373
|
-
|
|
373
|
+
ne(C), ae?.(C);
|
|
374
374
|
}), [d, u, W]);
|
|
375
375
|
const ce = Xe(() => {
|
|
376
376
|
const C = W.clean().createTemporaryCell({ value: Zn(), style: { numberFormat: "Medium Time" } }).toText();
|
|
@@ -392,7 +392,7 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
392
392
|
return Y(K), O({ start: A.current.selectionStart + N.length, end: A.current.selectionStart + N.length, direction: "forward" }), !0;
|
|
393
393
|
} }), [A.current]), Te = Ce(() => ({ contains: (C) => A.current?.contains(C) || !1, focus() {
|
|
394
394
|
A.current.focus();
|
|
395
|
-
} }), []), Ie = Ce(() => [new Ue("selectAll", Te, { label: "Select All", description: "Select all of the text in cell.", shortcut: { key: "a", modifiers: [
|
|
395
|
+
} }), []), Ie = Ce(() => [new Ue("selectAll", Te, { label: "Select All", description: "Select all of the text in cell.", shortcut: { key: "a", modifiers: [te.Ctrl] } }, he), new Ue("startEditValueAbove", Te, { label: "Copy From Above", description: "Copy the value from the cell above the active cell into the cell or the formula bar.", shortcut: [{ key: '"', modifiers: [te.Ctrl] }, { key: '"', modifiers: [te.Ctrl, te.Shift] }] }, De), new Ue("startEditCurrentTime", Te, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [te.Ctrl, te.Shift] } }, ce), new Ue("startEditCurrentDate", Te, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [te.Ctrl] } }, de), new J("relativeReferencesToggle", Te, { label: "Toggle References", description: "Toggles cell references from relative to absolute, to partially absolute, back to relative again.", shortcut: { key: "F4" } }, Ke), new J("toggleEditorFocus", Te, { label: "Toggle Editor Focus", description: "Moves focus between editors such as formula editor and inline editor.", shortcut: { key: "F2", modifiers: [te.Ctrl] } })], []), xe = Ce(() => {
|
|
396
396
|
let C = null;
|
|
397
397
|
const oe = () => ({ contains: (N) => A.current?.contains(N) || !1, focus() {
|
|
398
398
|
A.current.focus();
|
|
@@ -400,11 +400,11 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
400
400
|
return C = k ? k.createChildGroup(oe, "editor", !1) : new Co(oe, "editor"), C.addCommands(Ie, !0), C;
|
|
401
401
|
}, [k, Ie]), Ne = Ce(() => ({ notifier: null, source: me, target: ye, commands: xe }), [me, ye, xe]);
|
|
402
402
|
nl(Ne);
|
|
403
|
-
const [Pe,
|
|
403
|
+
const [Pe, _e] = ue(!q);
|
|
404
404
|
Se(() => {
|
|
405
|
-
|
|
405
|
+
_e(!1);
|
|
406
406
|
}, []);
|
|
407
|
-
const
|
|
407
|
+
const h = ie((C) => {
|
|
408
408
|
U(!0), xe?.activate();
|
|
409
409
|
const oe = M.current;
|
|
410
410
|
if (oe !== !1) {
|
|
@@ -413,11 +413,11 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
413
413
|
pr(W, a) && (N = a.length - 1, K = a.length - 1), N = oe?.start ?? N ?? a.length, K = oe?.end ?? K ?? a.length, M.current = !1, O({ start: N, end: K, direction: "forward" });
|
|
414
414
|
}
|
|
415
415
|
E?.(C);
|
|
416
|
-
}, [E, W]),
|
|
417
|
-
let ut =
|
|
418
|
-
const Qe =
|
|
419
|
-
let Le, Ge =
|
|
420
|
-
z.frameVertAlign === ve.VerticalAlignment.Center ? Ge = Math.max(0, (S - (
|
|
416
|
+
}, [E, W]), je = z.insets;
|
|
417
|
+
let ut = je.left + 1;
|
|
418
|
+
const Qe = je.left + je.right + 2 - 1, X = $?.bounds.height ?? 0;
|
|
419
|
+
let Le, Ge = je.top;
|
|
420
|
+
z.frameVertAlign === ve.VerticalAlignment.Center ? Ge = Math.max(0, (S - (je.top + je.bottom) - X) / 2) : z.frameVertAlign === ve.VerticalAlignment.Bottom && (Ge = Math.max(0, S - (je.top + je.bottom) - X)), L !== void 0 && $?.lines[0]?.bounds && (Le = $?.lines[0]?.bounds.height * L);
|
|
421
421
|
const Fe = z.style.getFont();
|
|
422
422
|
let Ve = Fe.getSize();
|
|
423
423
|
Fe.isSuperSub() && (Ve *= Fe.getSuperSubScale()), Ve *= dt.getDeviceScale() * w;
|
|
@@ -426,14 +426,14 @@ const Zn = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Xs = Object.fr
|
|
|
426
426
|
A.current && document.activeElement !== A.current && requestAnimationFrame(() => {
|
|
427
427
|
A.current.focus();
|
|
428
428
|
});
|
|
429
|
-
}, ref: P, ...v, style: { display: "flex", flexGrow: 1, alignSelf: "stretch", height: "100%", width: "100%", maxWidth: "100%", maxHeight: "100%", cursor: "initial", ...H }, children: p("div", { className: "editor-placement", style: { display: "flex", flexGrow: 1, position: "relative", top: Ge * w + 1, left: ut * w, width: `calc(100% - ${Qe * w}px)`, maxWidth: `calc(100% - ${Qe * w}px)`, height: (Le ?? X) * w, maxHeight: (Le ?? X) * w }, children: p("textarea", { spellCheck: "false", placeholder: z.placeholder, ref: A, value: z.textValue, disabled: Pe, readOnly: G || u.getProtection().isReadOnly(), name: "sheet-cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", font: "inherit", ...Oe, fontSize: Ve ? `${Ve}px` : "inherit", textAlign: z.textAlign, lineHeight: ($?.lines[0]?.bounds.height ?? 0) * w + "px", height: ($?.bounds.height ?? 0) * w, boxSizing: "border-box", padding: "0px", margin: "0px", borderWidth: 0, outline: "none", resize: "none", overflow: "hidden", background: "transparent", maxHeight: "100%", maxWidth: "100%", width: "100%", userSelect: "text", position: "absolute", whiteSpace: z.isWrapped ? "normal" : "pre", wordWrap: "break-word" }, onFocus:
|
|
429
|
+
}, ref: P, ...v, style: { display: "flex", flexGrow: 1, alignSelf: "stretch", height: "100%", width: "100%", maxWidth: "100%", maxHeight: "100%", cursor: "initial", ...H }, children: p("div", { className: "editor-placement", style: { display: "flex", flexGrow: 1, position: "relative", top: Ge * w + 1, left: ut * w, width: `calc(100% - ${Qe * w}px)`, maxWidth: `calc(100% - ${Qe * w}px)`, height: (Le ?? X) * w, maxHeight: (Le ?? X) * w }, children: p("textarea", { spellCheck: "false", placeholder: z.placeholder, ref: A, value: z.textValue, disabled: Pe, readOnly: G || u.getProtection().isReadOnly(), name: "sheet-cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", font: "inherit", ...Oe, fontSize: Ve ? `${Ve}px` : "inherit", textAlign: z.textAlign, lineHeight: ($?.lines[0]?.bounds.height ?? 0) * w + "px", height: ($?.bounds.height ?? 0) * w, boxSizing: "border-box", padding: "0px", margin: "0px", borderWidth: 0, outline: "none", resize: "none", overflow: "hidden", background: "transparent", maxHeight: "100%", maxWidth: "100%", width: "100%", userSelect: "text", position: "absolute", whiteSpace: z.isWrapped ? "normal" : "pre", wordWrap: "break-word" }, onFocus: h, onBlur: () => {
|
|
430
430
|
U(!1);
|
|
431
431
|
}, onSelect: (C) => {
|
|
432
432
|
}, onChange: (C) => {
|
|
433
433
|
A.current && !be.current && (M.current = !1, Y(C.target.value), z.textValue, C.target.value, C.target.selectionStart, C.target.selectionEnd, C.target.selectionDirection, O({ start: C.target.selectionStart, end: C.target.selectionEnd, direction: C.target.selectionDirection }));
|
|
434
434
|
}, onMouseDown: (C) => {
|
|
435
435
|
j && _(!0);
|
|
436
|
-
}, onKeyDown:
|
|
436
|
+
}, onKeyDown: Ze }) }) });
|
|
437
437
|
})), Mi = (e, t) => ({ clean: e, dirty: t, editMode: !1 }), Di = (e) => {
|
|
438
438
|
const { length: t = 0, width: n = 1, dashArray: r = null, dashArrayAdditional: l = null, isDouble: o = !1, isAngled: i = !1, offsetX: c = 0, offsetY: g = 0, isVertical: s = !1, ...y } = e, d = (H) => {
|
|
439
439
|
let w = null;
|
|
@@ -517,13 +517,13 @@ const dn = ul && window.ResizeObserver !== void 0 ? function() {
|
|
|
517
517
|
E = Math.floor(E + (O.width === 2 ? 0 : O.width / 2));
|
|
518
518
|
}
|
|
519
519
|
if (w) {
|
|
520
|
-
const O = g ? "colStart" : "rowStart", W = g ? "colEnd" : "rowEnd",
|
|
520
|
+
const O = g ? "colStart" : "rowStart", W = g ? "colEnd" : "rowEnd", ne = g ? y?.getRowOffset : y?.getColOffset;
|
|
521
521
|
let z = 0, A = 0;
|
|
522
522
|
L = [], q = [];
|
|
523
523
|
for (let P = 0; P < s.length; P++) {
|
|
524
524
|
const $ = s[P];
|
|
525
|
-
if ($.stroke.getStyle() === Et.StrokeStyle.Double &&
|
|
526
|
-
const ge =
|
|
525
|
+
if ($.stroke.getStyle() === Et.StrokeStyle.Double && ne) {
|
|
526
|
+
const ge = ne($.range[v]) - (F - G);
|
|
527
527
|
$.range[O] < r[O] && (L.push(ge - z), z = ge, L.push(1), z++), $.range[W] > r[W] && (q.push(ge - A), A = ge, q.push(1), A++);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
@@ -543,38 +543,38 @@ const dn = ul && window.ResizeObserver !== void 0 ? function() {
|
|
|
543
543
|
const u = s.getVisibleColumnOffsets(), k = s.getVisibleRowOffsets();
|
|
544
544
|
let b = [], D = [];
|
|
545
545
|
const E = s.getVisibleColumns(), G = s.getVisibleRows(), H = [], w = [], L = [], q = (T, M, j, U, B, O, W) => {
|
|
546
|
-
const
|
|
547
|
-
T[M] || (T[M] = []), T[M].length > 0 && T[M][T[M].length - 1]?.index === U ? T[M][T[M].length - 1] =
|
|
546
|
+
const ne = { index: U, stroke: B, visibleIndex: j, edge: O, length: W };
|
|
547
|
+
T[M] || (T[M] = []), T[M].length > 0 && T[M][T[M].length - 1]?.index === U ? T[M][T[M].length - 1] = ne : T[M].push(ne);
|
|
548
548
|
};
|
|
549
549
|
for (let T = 0; T < d.length; T++) {
|
|
550
550
|
const M = d[T], j = M.coords;
|
|
551
551
|
if (!j) continue;
|
|
552
552
|
const U = M?.range ?? { rowStart: j.rowIndex, colStart: j.colIndex, rowEnd: j.rowIndex, colEnd: j.colIndex }, B = s.getVisibleRangeCoords();
|
|
553
553
|
if (!qt.isRangesIntersect(U, B) && !qt.isRangeWithinRange(U, B)) continue;
|
|
554
|
-
const O = j.colIndex, W = j.rowIndex,
|
|
554
|
+
const O = j.colIndex, W = j.rowIndex, ne = u[O], z = k[W];
|
|
555
555
|
if (U.rowEnd !== U.rowStart) {
|
|
556
|
-
const
|
|
557
|
-
b.push({ ...U, rowStart:
|
|
556
|
+
const Ze = k[U.rowStart]?.spanIndex ?? -1, he = k[U.rowEnd]?.spanIndex ?? k[G[G.length - 1]].spanIndex + 1;
|
|
557
|
+
b.push({ ...U, rowStart: Ze, rowEnd: he });
|
|
558
558
|
}
|
|
559
559
|
if (U.colEnd !== U.colStart) {
|
|
560
|
-
const
|
|
561
|
-
D.push({ ...U, colStart:
|
|
560
|
+
const Ze = u[U.colStart]?.spanIndex ?? -1, he = u[U.colEnd]?.spanIndex ?? u[E[E.length - 1]].spanIndex + 1;
|
|
561
|
+
D.push({ ...U, colStart: Ze, colEnd: he });
|
|
562
562
|
}
|
|
563
563
|
const A = M.value, P = e(A, T);
|
|
564
564
|
if (!P || P.isEmpty()) continue;
|
|
565
565
|
const $ = P.getLeft(), ge = P.getTop(), ae = P.getRight(), Y = P.getBottom();
|
|
566
566
|
let _ = 1, be = 1;
|
|
567
|
-
if (!
|
|
568
|
-
const Ae =
|
|
567
|
+
if (!ne || !z) continue;
|
|
568
|
+
const Ae = ne.spanIndex, we = z.spanIndex;
|
|
569
569
|
$.isNone() || q(H, Ae, we, W, $, Et.Edge.Left, _), ge.isNone() || q(w, we, Ae, O, ge, Et.Edge.Top, be), ae.isNone() || q(H, Ae + be, we, W, ae, Et.Edge.Right, _), Y.isNone() || q(w, we + _, Ae, O, Y, Et.Edge.Bottom, be);
|
|
570
570
|
}
|
|
571
571
|
const v = (T, M, j) => {
|
|
572
572
|
const U = [];
|
|
573
573
|
return T.forEach((B, O) => {
|
|
574
574
|
let W = null;
|
|
575
|
-
B.sort((
|
|
576
|
-
for (let
|
|
577
|
-
const z = B[
|
|
575
|
+
B.sort((ne, z) => ne.visibleIndex - z.visibleIndex);
|
|
576
|
+
for (let ne = 0; ne < B.length; ne++) {
|
|
577
|
+
const z = B[ne];
|
|
578
578
|
if (!z?.stroke || M[O] === void 0 && M[O - 1] === void 0) continue;
|
|
579
579
|
let A = !1;
|
|
580
580
|
if (j) for (let ae = 0; !A && ae < b.length; ae++) {
|
|
@@ -606,13 +606,13 @@ const dn = ul && window.ResizeObserver !== void 0 ? function() {
|
|
|
606
606
|
for (let T = 0; T < F.length; T++) {
|
|
607
607
|
const M = F[T];
|
|
608
608
|
let j = M.stroke;
|
|
609
|
-
const U = `rBorder:${M.index}:${M.from}:${M.to}:${M.edge}`, B = { rowStart: M.index, rowEnd: M.index, colStart: M.from, colEnd: M.to + 1 }, O = s.getLayout(), W = !1,
|
|
609
|
+
const U = `rBorder:${M.index}:${M.from}:${M.to}:${M.edge}`, B = { rowStart: M.index, rowEnd: M.index, colStart: M.from, colEnd: M.to + 1 }, O = s.getLayout(), W = !1, ne = O.getColOffset(B.colStart), z = O.getRowOffset(B.rowStart), A = [ne, z, O.getColOffset(B.colEnd), z];
|
|
610
610
|
L.push(t({ key: U, points: A, stroke: j, darkMode: r, forceThinBorder: l, shiftIfWide: i, range: B, intersections: M.intersections, layout: O, isVertical: W }));
|
|
611
611
|
}
|
|
612
612
|
for (let T = 0; T < S.length; T++) {
|
|
613
613
|
const M = S[T];
|
|
614
614
|
let j = M.stroke;
|
|
615
|
-
const U = `cBorder:${M.index}:${M.from}:${M.to}:${M.edge}`, B = { rowStart: M.from, rowEnd: M.to + 1, colStart: M.index, colEnd: M.index }, O = s.getLayout(), W = !0,
|
|
615
|
+
const U = `cBorder:${M.index}:${M.from}:${M.to}:${M.edge}`, B = { rowStart: M.from, rowEnd: M.to + 1, colStart: M.index, colEnd: M.index }, O = s.getLayout(), W = !0, ne = O.getColOffset(B.colStart), z = [ne, O.getRowOffset(B.rowStart), ne, O.getRowOffset(B.rowEnd)];
|
|
616
616
|
L.push(t({ key: U, stroke: j, points: z, darkMode: r, forceThinBorder: l, shiftIfWide: i, range: B, intersections: M.intersections, layout: O, isVertical: W }));
|
|
617
617
|
}
|
|
618
618
|
return p("svg", { width: `${y.width}`, height: `${y.height}`, viewBox: `0 0 ${y.width} ${y.height}`, preserveAspectRatio: "none", shapeRendering: "crispEdges", style: { position: "absolute", left: "0px", top: "0px", width: `${y.width}px`, height: `${y.height}px`, pointerEvents: "none", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", overflow: "visible" }, children: L }, "borders");
|
|
@@ -622,30 +622,30 @@ const dn = ul && window.ResizeObserver !== void 0 ? function() {
|
|
|
622
622
|
}), Qs = ft((e) => {
|
|
623
623
|
const { getBorderAt: t, width: n, height: r, style: l, rowCount: o = 2, columnCount: i = 2, darkMode: c, forceThinBorder: g, children: s, ...y } = e, d = Re(null), [u, { width: k, height: b }] = dn(), D = n ?? k, E = r ?? b, G = Ce(() => {
|
|
624
624
|
const W = [];
|
|
625
|
-
for (let
|
|
626
|
-
const A = { colIndex: z, rowIndex:
|
|
625
|
+
for (let ne = 0; ne < o; ne++) for (let z = 0; z < i; z++) {
|
|
626
|
+
const A = { colIndex: z, rowIndex: ne };
|
|
627
627
|
W.push({ coords: A, value: A });
|
|
628
628
|
}
|
|
629
629
|
return W;
|
|
630
630
|
}, []), H = Xe((W) => G, [G]), { overlay: w } = gl({ getVisibleCells: H, getBorderAt: t, darkMode: c, forceThinBorder: g }), L = Math.floor(D / i), q = Math.floor(E / o), v = { getColOffset: (W) => Math.ceil(W * L) + 0, getRowOffset: (W) => Math.ceil(W * q) + 0, getColIndex: (W) => Math.floor((W - 0) / L) - 1, getRowIndex: (W) => Math.floor((W - 0) / q) - 1 }, S = { rowStart: 0, colStart: 0, rowEnd: o, colEnd: i }, F = { x: 0, y: 0, width: Math.max(0, D) + 0, height: Math.max(0, E) + 0 }, T = Ce(() => {
|
|
631
|
-
const W = {},
|
|
632
|
-
for (let z = 0; z < i; z++) W[z] = { offset: z *
|
|
631
|
+
const W = {}, ne = Math.floor(D / i);
|
|
632
|
+
for (let z = 0; z < i; z++) W[z] = { offset: z * ne, size: ne, spanIndex: z };
|
|
633
633
|
return W;
|
|
634
634
|
}, [D, E]), M = Ce(() => {
|
|
635
|
-
const W = {},
|
|
636
|
-
for (let z = 0; z < o; z++) W[z] = { offset: z *
|
|
635
|
+
const W = {}, ne = Math.floor(E / o);
|
|
636
|
+
for (let z = 0; z < o; z++) W[z] = { offset: z * ne, size: ne, spanIndex: z };
|
|
637
637
|
return W;
|
|
638
638
|
}, [D, E]);
|
|
639
639
|
if (!w) return null;
|
|
640
640
|
const j = { width: D, height: E }, U = { width: D, height: E }, B = { getStage: () => d.current, getTotalSize: () => j, getViewportSize: () => U, getLayout: () => v, getCellCoordsAsRangeCoords: qt.cellToRange, getVisibleRangeCoords: () => S, getVisibleRows: () => {
|
|
641
641
|
const W = [];
|
|
642
|
-
for (let
|
|
642
|
+
for (let ne = 0; ne < o; ne++) W.push(ne);
|
|
643
643
|
return W;
|
|
644
|
-
}, getTotalRangeCoords: () => S, getRelativePointFromClient: (W,
|
|
644
|
+
}, getTotalRangeCoords: () => S, getRelativePointFromClient: (W, ne) => ({ x: W, y: ne }), getVisibleColumns: () => {
|
|
645
645
|
const W = [];
|
|
646
|
-
for (let
|
|
646
|
+
for (let ne = 0; ne < i; ne++) W.push(ne);
|
|
647
647
|
return W;
|
|
648
|
-
}, toClipBounds: (W,
|
|
648
|
+
}, toClipBounds: (W, ne) => F, toViewBounds: (W) => W, toAbsoluteBounds: (W) => W, getBounds: () => F, getInsets: () => null, getRangeCoordsBounds: (W, ne) => null, getVisibleColumnOffsets: () => T, getVisibleRowOffsets: () => M, allViews: () => ({ [vr]: B }), getAnchor: () => vr, getZoom: () => 1, scrollCellCoordsIntoView: Oi, getCellCoordsFromClient: Li, getScrollOrientation: () => Ni, getScrollTopLeft: () => wr, getFreezeTopLeft: () => wr }, O = w(B);
|
|
649
649
|
return Je("div", { style: { ...l, position: "relative", display: "flex" }, ...y, children: [p("div", { ref: kn([d, u]), style: { flex: "1 1 100%", display: "flex", maxWidth: "100%", maxHeight: "100%" }, children: s }), O] });
|
|
650
650
|
});
|
|
651
651
|
function hl(e) {
|
|
@@ -744,10 +744,10 @@ function Wi(e) {
|
|
|
744
744
|
k.current = t, M();
|
|
745
745
|
}, [t]);
|
|
746
746
|
const U = ie(() => t.getRange(s).getCell(), [t, s]), B = ie(async (a, x, R = null, f = !1, I = !0) => {
|
|
747
|
-
const
|
|
748
|
-
const le = await Promise.resolve(I && i?.showBusy?.(
|
|
747
|
+
const m = a?.label?.(), V = async () => {
|
|
748
|
+
const le = await Promise.resolve(I && i?.showBusy?.(m ?? "Busy..."));
|
|
749
749
|
try {
|
|
750
|
-
await t.doBatch(async () => x(t),
|
|
750
|
+
await t.doBatch(async () => x(t), m), f && v.setMode(null), le && le();
|
|
751
751
|
} catch (se) {
|
|
752
752
|
if (le && le(), !se) return;
|
|
753
753
|
i?.showError?.(se);
|
|
@@ -766,21 +766,21 @@ function Wi(e) {
|
|
|
766
766
|
if (n) {
|
|
767
767
|
let le = null;
|
|
768
768
|
if (R !== !1 && a) {
|
|
769
|
-
const se = R ??
|
|
769
|
+
const se = R ?? m;
|
|
770
770
|
le = new Ue(a.key(), o, { label: se, description: se }, re);
|
|
771
771
|
}
|
|
772
772
|
n(le);
|
|
773
773
|
}
|
|
774
774
|
return re();
|
|
775
775
|
}, [t, n, i]), O = ie((a, x, R = !1, f) => B(a, (I) => {
|
|
776
|
-
const
|
|
777
|
-
R &&
|
|
776
|
+
const m = I.getSelectedRanges();
|
|
777
|
+
R && m.updateStyle(null, f), m.updateStyle(x, f), m.autoFit({ expandOnly: qe.Orientation.Column, minContent: !0, skipCustomSize: !0 });
|
|
778
778
|
}), [t]), W = ie((a, x, R) => {
|
|
779
779
|
B(a, (f) => {
|
|
780
780
|
let I = x;
|
|
781
781
|
(R || x?.address) && (I = I ?? {}, !R && x?.address?.startsWith("#") ? R = x?.address.substring(1) : R && (I.displayText = R)), f.getSelectedRange().setHyperlink(I);
|
|
782
782
|
});
|
|
783
|
-
}, [t]),
|
|
783
|
+
}, [t]), ne = ie((a, x) => {
|
|
784
784
|
B(a, (R) => {
|
|
785
785
|
R.getSelectedRange().setComments(x);
|
|
786
786
|
});
|
|
@@ -789,8 +789,8 @@ function Wi(e) {
|
|
|
789
789
|
R.getSelectedRanges().clear(x);
|
|
790
790
|
});
|
|
791
791
|
}, [t]), A = ie(async (a, x, R = !1, f = !1) => B(a, async (I) => {
|
|
792
|
-
let
|
|
793
|
-
R && (x === qe.Orientation.Row ?
|
|
792
|
+
let m = I.getSelectedRanges();
|
|
793
|
+
R && (x === qe.Orientation.Row ? m = m.getEntireRows(f) : x === qe.Orientation.Column && (m = m.getEntireColumns(f)));
|
|
794
794
|
let V = null;
|
|
795
795
|
const Z = v.getMode()?.key;
|
|
796
796
|
if (Z === "copy" || Z === "cut") {
|
|
@@ -798,38 +798,38 @@ function Wi(e) {
|
|
|
798
798
|
ee && ee.getItemType() === "range" && (V = ee.getItem(), V.getCoords() || (V = null));
|
|
799
799
|
}
|
|
800
800
|
if (V) {
|
|
801
|
-
const ee = await
|
|
801
|
+
const ee = await m.insertFrom(V, { ...V.getMarkOptions(), orientation: x, autoSelect: !0 });
|
|
802
802
|
!ee || ee.isEntireRows() || ee.isEntireColumns() || ee.autoFit({ orientations: qe.Orientations.Row, minContent: !0 }), v.setMode(null);
|
|
803
|
-
} else
|
|
803
|
+
} else m.insert(x, { autoSelect: !0 });
|
|
804
804
|
}, "Insert Cells", !1), [v]), [P, $] = ue(null), ge = ie((a) => t.getStyles().setDefaultTableStyle(a), [t]), ae = ie((a) => {
|
|
805
805
|
t.getStyles().getTableStyle(a)?.delete();
|
|
806
806
|
}, [t]), Y = ie((a, x) => {
|
|
807
807
|
B(a, async (R) => {
|
|
808
808
|
const f = R.getSelectedRange(), I = R.getSelectedCell().getCoords();
|
|
809
|
-
let
|
|
809
|
+
let m = null, V = 0;
|
|
810
810
|
const Z = I.rowIndex > 0 ? R.getRange({ rowIndex: I.rowIndex, colIndex: I.colIndex }).getExtended(qe.Direction.Up) : null;
|
|
811
|
-
Z && R.getRange({ colStart: I.colIndex, rowStart: Z.getCoords().rowStart, colEnd: I.colIndex, rowEnd: Z.getCoords().rowStart }).isContentful() && (
|
|
811
|
+
Z && R.getRange({ colStart: I.colIndex, rowStart: Z.getCoords().rowStart, colEnd: I.colIndex, rowEnd: Z.getCoords().rowStart }).isContentful() && (m = qe.Direction.Up, V = I.rowIndex - Z.getCoords().rowEnd);
|
|
812
812
|
const ee = I.colIndex > 0 ? R.getRange({ rowIndex: I.rowIndex, colIndex: I.colIndex - 1 }).getExtended(qe.Direction.Left) : null;
|
|
813
813
|
if (ee && R.getRange({ colStart: ee.getCoords().colStart, rowStart: I.rowIndex, colEnd: ee.getCoords().colStart, rowEnd: I.rowIndex }).isContentful()) {
|
|
814
814
|
const le = I.colIndex - ee.getCoords().colEnd;
|
|
815
|
-
(le < V || !
|
|
815
|
+
(le < V || !m) && (m = qe.Direction.Left, V = le);
|
|
816
816
|
}
|
|
817
817
|
let re = null;
|
|
818
|
-
if (
|
|
818
|
+
if (m === qe.Direction.Up) {
|
|
819
819
|
if (re = { ...Z.getCoords() }, (re.rowEnd === I.rowIndex || !R.getRange({ colIndex: I.colIndex, rowIndex: I.rowIndex - 1 }).isContentful()) && re.rowStart > 0 && R.getRange({ colIndex: I.colIndex, rowIndex: re.rowStart - 1 }).isContentful()) {
|
|
820
820
|
const le = Z.getExtended(qe.Direction.Up);
|
|
821
821
|
re = { colStart: I.colIndex, rowStart: le.getCoords().rowStart, colEnd: I.colIndex, rowEnd: Z.getCoords().rowEnd };
|
|
822
822
|
}
|
|
823
823
|
re.rowEnd = I.rowIndex - 1;
|
|
824
|
-
} else if (
|
|
824
|
+
} else if (m === qe.Direction.Left) {
|
|
825
825
|
if (re = { ...ee.getCoords() }, (re.colEnd === I.colIndex || !R.getRange({ colIndex: I.colIndex - 1, rowIndex: I.rowIndex }).isContentful()) && re.colStart > 0 && R.getRange({ colIndex: re.colStart - 1, rowIndex: I.rowIndex }).isContentful()) {
|
|
826
826
|
const le = ee.getExtended(qe.Direction.Left);
|
|
827
827
|
re = { colStart: le.getCoords().colStart, rowStart: I.rowIndex, colEnd: le.getCoords().colEnd, rowEnd: I.rowIndex };
|
|
828
828
|
}
|
|
829
829
|
re.colEnd = I.colIndex - 1;
|
|
830
830
|
}
|
|
831
|
-
if (f.size !== 1 &&
|
|
832
|
-
const le = f.getCoords(), se = f.startIncrementalUpdates({ orientation: qe.Orientation.Column }), ke = { ...re }, pe = le.rowStart, fe = le.rowEnd, Me = le.colStart, We = le.colEnd, Be =
|
|
831
|
+
if (f.size !== 1 && m) {
|
|
832
|
+
const le = f.getCoords(), se = f.startIncrementalUpdates({ orientation: qe.Orientation.Column }), ke = { ...re }, pe = le.rowStart, fe = le.rowEnd, Me = le.colStart, We = le.colEnd, Be = m === qe.Direction.Up;
|
|
833
833
|
for (let et = Me; et <= We; et++) {
|
|
834
834
|
ke.colStart = Be ? et : re.colStart + (et - Me), ke.colEnd = Be ? et : re.colEnd + (et - Me);
|
|
835
835
|
for (let $e = pe; $e <= fe; $e++) {
|
|
@@ -846,12 +846,12 @@ function Wi(e) {
|
|
|
846
846
|
}, !1);
|
|
847
847
|
}, [t]), _ = ie((a, x, R = !1, f = !0) => {
|
|
848
848
|
B(a, async (I) => {
|
|
849
|
-
let
|
|
849
|
+
let m = null;
|
|
850
850
|
if (P) return void P.updateStyleOptions(x);
|
|
851
851
|
{
|
|
852
852
|
const ee = I.getSelectedRanges().getFixed(!0), re = I.getSelectedRange().getDefaultSortCriteria();
|
|
853
853
|
let le = { ranges: ee, hasHeader: re?.options?.hasHeader ?? !1 };
|
|
854
|
-
|
|
854
|
+
m = f ? new Promise((se, ke) => {
|
|
855
855
|
const pe = { tableOptions: le, onCancel: () => {
|
|
856
856
|
ke();
|
|
857
857
|
}, onDone: (fe) => {
|
|
@@ -860,7 +860,7 @@ function Wi(e) {
|
|
|
860
860
|
i.showWindow?.("tableNew", pe);
|
|
861
861
|
}) : { option: "Ok", tableOptions: le };
|
|
862
862
|
}
|
|
863
|
-
const V = await Promise.resolve(
|
|
863
|
+
const V = await Promise.resolve(m);
|
|
864
864
|
if (V?.option !== "Ok") throw null;
|
|
865
865
|
const Z = await Promise.resolve(i?.showBusy?.(a.label()));
|
|
866
866
|
try {
|
|
@@ -873,10 +873,10 @@ function Wi(e) {
|
|
|
873
873
|
}, [P]), be = ie(() => r, [r]), Ae = ie((a) => ({ styles: () => t.getStyles(), table: () => a, bodyStyle: be, getNames: () => t.getNames() }), [t]), we = ie(async (a, x, R, f = !0) => {
|
|
874
874
|
let I = null;
|
|
875
875
|
if (!x) {
|
|
876
|
-
let
|
|
877
|
-
|
|
876
|
+
let m = t.getSelectedRange();
|
|
877
|
+
m.size === 1 && (m = m.getSurrounding());
|
|
878
878
|
let V = t.getTables().getItems({ address: t.getSelectedRange() });
|
|
879
|
-
V.length > 0 && (x = V[0]), await
|
|
879
|
+
V.length > 0 && (x = V[0]), await m.select();
|
|
880
880
|
}
|
|
881
881
|
if (x) {
|
|
882
882
|
if (f) {
|
|
@@ -884,22 +884,22 @@ function Wi(e) {
|
|
|
884
884
|
R && await x.select();
|
|
885
885
|
} catch {
|
|
886
886
|
}
|
|
887
|
-
I = new Promise(async (
|
|
887
|
+
I = new Promise(async (m, V) => {
|
|
888
888
|
a.update({ context: Ae(x) });
|
|
889
|
-
const Z = { command: a, commands:
|
|
890
|
-
|
|
889
|
+
const Z = { command: a, commands: h, notifier: i, onDone: (re) => {
|
|
890
|
+
m(re);
|
|
891
891
|
} }, ee = await i.showWindow?.("tableDetails", Z, { disableAutoDestroy: !0 });
|
|
892
892
|
setTimeout(() => {
|
|
893
893
|
ee.focus();
|
|
894
894
|
}, 180);
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
-
Promise.resolve(I).then((
|
|
898
|
-
}, (
|
|
899
|
-
i?.showError?.(
|
|
897
|
+
Promise.resolve(I).then((m) => {
|
|
898
|
+
}, (m) => {
|
|
899
|
+
i?.showError?.(m);
|
|
900
900
|
});
|
|
901
901
|
}
|
|
902
|
-
}, [i]),
|
|
902
|
+
}, [i]), Ze = ie(async (a, x, R = !1) => {
|
|
903
903
|
let f = null;
|
|
904
904
|
if (x) x.isITable ? f = x : x.getValue() && (f = x.getValue());
|
|
905
905
|
else {
|
|
@@ -908,8 +908,8 @@ function Wi(e) {
|
|
|
908
908
|
}
|
|
909
909
|
if (f) {
|
|
910
910
|
if (!R) {
|
|
911
|
-
const I = f.getRange().getCoords(),
|
|
912
|
-
if (
|
|
911
|
+
const I = f.getRange().getCoords(), m = (I.colEnd - I.colStart + 1) * (I.rowEnd - I.rowStart + 1);
|
|
912
|
+
if (m > 1e4 && await i?.showOptions({ title: "Confirm", description: `Converting a table to range with '${m}' cells will set a large number of cell styles and may affect performance.
|
|
913
913
|
Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Convert")
|
|
914
914
|
return;
|
|
915
915
|
}
|
|
@@ -921,17 +921,17 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
921
921
|
B(a, async (f) => {
|
|
922
922
|
let I = f.getSelectedRanges();
|
|
923
923
|
if (I.getCount() > 1) throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");
|
|
924
|
-
let
|
|
925
|
-
|
|
924
|
+
let m = I.at(0);
|
|
925
|
+
m.size === 1 && (m = m.getSurrounding());
|
|
926
926
|
const V = f.getSelection().getCoords().cell;
|
|
927
|
-
let Z =
|
|
927
|
+
let Z = m.getDefaultSortCriteria(qe.Orientation.Row, V);
|
|
928
928
|
if (!Z) {
|
|
929
929
|
if (R) throw new Error("Invalid sort selection. Sort requires a single range with data.");
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
932
|
let ee = Z.options;
|
|
933
933
|
if (R && (ee = new Promise((le, se) => {
|
|
934
|
-
const ke = { range:
|
|
934
|
+
const ke = { range: m, options: Z.options, cell: V, onCancel: () => {
|
|
935
935
|
se();
|
|
936
936
|
}, onDone: (pe) => {
|
|
937
937
|
pe ? le(pe.options) : se();
|
|
@@ -940,26 +940,26 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
940
940
|
})), ee = await Promise.resolve(ee), !ee) return;
|
|
941
941
|
const re = await Promise.resolve(i?.showBusy?.(a.label()));
|
|
942
942
|
try {
|
|
943
|
-
|
|
943
|
+
m.doBatch(() => {
|
|
944
944
|
const le = { ...ee, ...x };
|
|
945
|
-
|
|
945
|
+
m.sort(le), m.autoFit({ orientations: le?.orientation === qe.Orientation.Column ? qe.Orientations.Column : qe.Orientations.Row, skipCustomSize: !0, minContent: !0 });
|
|
946
946
|
}, a?.label?.());
|
|
947
947
|
} catch (le) {
|
|
948
948
|
re(), i?.showError?.(le);
|
|
949
949
|
}
|
|
950
950
|
re();
|
|
951
951
|
}, !1, !1, !1);
|
|
952
|
-
}, [i]),
|
|
952
|
+
}, [i]), Ke = ie(() => {
|
|
953
953
|
console.log("compactedSelection");
|
|
954
|
-
const a = t.getSelection().getCoords(), x = t.getSelectedRanges().getFlattened().getCoords(), R = ((
|
|
955
|
-
const V = new Blob([
|
|
954
|
+
const a = t.getSelection().getCoords(), x = t.getSelectedRanges().getFlattened().getCoords(), R = ((m) => {
|
|
955
|
+
const V = new Blob([m], { type: "application/javascript" }), Z = URL.createObjectURL(V), ee = new Worker(Z);
|
|
956
956
|
return URL.revokeObjectURL(Z), ee;
|
|
957
957
|
})("console.log('hello from worker');");
|
|
958
958
|
setTimeout(() => {
|
|
959
959
|
R.terminate(), console.log("Worker terminated");
|
|
960
960
|
}, 5e3);
|
|
961
961
|
let f = -1;
|
|
962
|
-
for (let
|
|
962
|
+
for (let m = 0; f === -1 && m < x.length; m++) qt.isCellWithinRange(a.cell, x[m]) && (f = m);
|
|
963
963
|
if (qt.isEqualRangesArrays(a.ranges, x)) return;
|
|
964
964
|
const I = { cell: a.cell, ranges: x, rangeIndex: f };
|
|
965
965
|
t.getSelection().updateCoords(I);
|
|
@@ -971,8 +971,8 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
971
971
|
else {
|
|
972
972
|
const f = t.getSelectedRange();
|
|
973
973
|
if (f.isEntireRange()) {
|
|
974
|
-
const I = t.getSelection().getCoords().cell,
|
|
975
|
-
R =
|
|
974
|
+
const I = t.getSelection().getCoords().cell, m = t.getRange(I);
|
|
975
|
+
R = m.getSurrounding(), R.isEntireRange() && (R = m);
|
|
976
976
|
} else R = f.getSurrounding({ contentOnly: a });
|
|
977
977
|
}
|
|
978
978
|
R && await R.select();
|
|
@@ -987,8 +987,8 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
987
987
|
const R = D(), f = Math.min(R.width - 8, 480), I = Math.min(R.height - 8, 288);
|
|
988
988
|
try {
|
|
989
989
|
t.getSelectedRanges(), x = await t.getMovables().add({ bounds: { x: R.left + (R.width - f) / 2, y: R.top + (R.height - I) / 2, width: f, height: I }, type: "chart", json: a.template }), x.select(), v.setMode(null);
|
|
990
|
-
} catch (
|
|
991
|
-
i?.showError?.(
|
|
990
|
+
} catch (m) {
|
|
991
|
+
i?.showError?.(m);
|
|
992
992
|
}
|
|
993
993
|
return x;
|
|
994
994
|
}, [t, i]);
|
|
@@ -999,16 +999,16 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
999
999
|
return f(), v.setMode(null), I;
|
|
1000
1000
|
} catch (I) {
|
|
1001
1001
|
f();
|
|
1002
|
-
let
|
|
1003
|
-
typeof
|
|
1002
|
+
let m = I;
|
|
1003
|
+
typeof m != "string" && (console.warn(I), m = "Unable to resolve image."), i?.showMessage?.(m, { type: tr.Error });
|
|
1004
1004
|
}
|
|
1005
1005
|
}, [t, i]), ye = ie((a, x) => {
|
|
1006
1006
|
B(a, async (R) => {
|
|
1007
1007
|
const f = R.getSelectedRanges();
|
|
1008
1008
|
f.doBatch(() => {
|
|
1009
|
-
const I = x === qe.Direction.Up || x === qe.Direction.Down,
|
|
1010
|
-
for (let V = 0; V <
|
|
1011
|
-
const Z =
|
|
1009
|
+
const I = x === qe.Direction.Up || x === qe.Direction.Down, m = f.getCoords().slice().sort(qt.createRangeComparator(I ? qe.Orientation.Row : qe.Orientation.Column));
|
|
1010
|
+
for (let V = 0; V < m.length; V++) {
|
|
1011
|
+
const Z = m[V];
|
|
1012
1012
|
let ee = Z;
|
|
1013
1013
|
const re = R.getRange(ee).getMerges();
|
|
1014
1014
|
let le = 0, se = 0;
|
|
@@ -1028,7 +1028,7 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
1028
1028
|
R && (a = R.toTextUnformatted(!0));
|
|
1029
1029
|
}
|
|
1030
1030
|
b?.({ text: a });
|
|
1031
|
-
}, [t]), [Ie, xe] = sn((a) => a + 1, 0), [Ne, Pe] = sn((a) => a + 1, 0),
|
|
1031
|
+
}, [t]), [Ie, xe] = sn((a) => a + 1, 0), [Ne, Pe] = sn((a) => a + 1, 0), _e = Ce(() => [new J("gridlinesToggle", o, { label: "Gridlines", scopedLabels: { view: "Gridlines" }, description: "Toggle whether the lines between rows and columns in the sheet are displayed." }), new J("sheetViewToggleGridlinesRows", o, { label: "Row Gridlines", scopedLabels: { view: "Row Gridlines", gridlines: "Rows" }, description: "Toggle whether the lines between rows in the sheet are displayed." }), new J("sheetViewToggleGridlinesColumns", o, { label: "Column Gridlines", scopedLabels: { view: "Columns Gridlines", gridlines: "Columns" }, description: "Toggle whether the lines between columns in the sheet are displayed." }), new J("sheetViewFormatGridlinesColor", o, { label: "Gridlines Color", description: "Color the rows and column gridlines." }), new J("sheetViewToggleShowHeadings", o, { label: "Headings", scopedLabels: { view: "Headings" }, description: "Toggle whether the row and column headings are displayed." }), new J("sheetViewToggleShowHeadingRows", o, { label: "Row Headings", scopedLabels: { view: "Row Headings", headings: "Rows" }, description: "Toggle whether the row headings are displayed." }), new J("sheetViewToggleShowHeadingColumns", o, { label: "Column Headings", scopedLabels: { view: "Columns Headings", headings: "Columns" }, description: "Toggle whether the column headings are displayed." }), new J("sheetViewToggleShowHeadingsNumeric", o, { label: "Numeric Headers", description: "Toggle whether cell headings show numbers or A1 conventions.", shortcut: { key: "h", modifiers: [te.Ctrl, te.Shift] } }), new J("sheetViewToggleFormulaView", o, { label: "Show Formulas", description: "Toggle whether cells show formula or values.", shortcut: [{ key: "`", modifiers: [te.Ctrl] }, { key: "`", modifiers: [te.Ctrl, te.Shift] }] }), new J("sheetViewToggleShowZeros", o, { label: "Show Zeros", description: "Toggle whether cell with zero value shows '0' or blank." }), new Ue("selectComments", o, { label: "Select Comments", description: "Select the cells with comments.", shortcut: { key: "O", modifiers: [te.Ctrl, te.Shift] } }, () => De()), new J("selectAll", o, { label: "Select All", description: "Select the closest data or the entire sheet if no data is nearby.", shortcut: [{ key: "A", modifiers: [te.Ctrl] }, { key: "Space", modifiers: [te.Ctrl, te.Shift] }] }, (a = !1) => ce(!1, a)), new Ue("selectRegion", o, { label: "Select Region", description: "Select the closest data.", shortcut: { key: "*", modifiers: [te.Ctrl, te.Shift] } }, () => ce(!0, !1)), new Ue("breakSelection", o, { label: "Select Visible", description: "Break the selection based on hidden rows and columns.", shortcut: { key: "Semicolon", modifiers: [te.Ctrl, te.Alt] } }, () => Ke()), new Ue("formatTextRotate0", o, { label: "No Text Rotation", description: "Remove all text rotation." }), new Ue("formatTextRotate45", o, { label: "Angle Clockwise", description: "Angle text 45 degrees downward." }), new Ue("formatTextRotate90", o, { label: "Rotate Text Down", description: "Angle your text so that it aligns with the left." }), new Ue("formatTextRotate270", o, { label: "Rotate Text Up", description: "Angle your text so that it aligns with the right." }), new Ue("formatTextRotate315", o, { label: "Angle Counterclockwise", description: "Angle text 45 degrees upward." }), new J("formatTextRotateCustom", o, { label: "Custom Text Rotation", description: "Angle your text using a custom angle." }), new Ue("formatTextRotateVertical", o, { label: "Vertical Text", description: "Stack text vertically." }), new Ue("sortAscending", o, { label: "Sort Ascending", scopedLabels: { sort: "Ascending" }, description: "Lowest to Highest." }, function() {
|
|
1032
1032
|
he(this, { reverse: !1 }, !1);
|
|
1033
1033
|
}), new Ue("sortDescending", o, { label: "Sort Descending", scopedLabels: { sort: "Descending" }, description: "Highest to Lowest." }, function() {
|
|
1034
1034
|
he(this, { reverse: !0 }, !1);
|
|
@@ -1049,64 +1049,64 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1049
1049
|
O(this, { fill: a });
|
|
1050
1050
|
}), new J("formatFontColor", o, { label: "Font Color", description: "Change the color of your text." }, function(a) {
|
|
1051
1051
|
O(this, { font: { fill: a } });
|
|
1052
|
-
}), new J("formatBoldToggle", o, { label: "Bold", description: "Toggle bold formatting of text.", shortcut: [{ key: "B", modifiers: [
|
|
1052
|
+
}), new J("formatBoldToggle", o, { label: "Bold", description: "Toggle bold formatting of text.", shortcut: [{ key: "B", modifiers: [te.Ctrl] }, { key: "2", modifiers: [te.Ctrl] }] }), new J("formatItalicToggle", o, { label: "Italic", description: "Toggle italic formatting of text.", shortcut: [{ key: "I", modifiers: [te.Ctrl] }, { key: "3", modifiers: [te.Ctrl] }] }), new J("formatUnderlinedToggle", o, { label: "Underline", scopedLabels: { underline: "Single" }, description: "Underline the text.", shortcut: [{ key: "u", modifiers: [te.Ctrl] }, { key: "4", modifiers: [te.Ctrl] }] }), new J("formatUnderlinedDoubleToggle", o, { label: "Double Underline", scopedLabels: { underline: "Double" }, description: "Double underline the text." }), new J("formatUnderlinedAccountingToggle", o, { label: "Accounting Underline", scopedLabels: { underline: "Accounting" }, description: "Use accounting underline for the text." }), new J("formatUnderlinedAccountingDoubleToggle", o, { label: "Double Accounting Underline", scopedLabels: { underline: "Double Accounting" }, description: "Use accounting double underline the text." }), new J("formatStrikeThroughToggle", o, { label: "Strikethrough", description: "Toggle strike-through formatting of text.", shortcut: { key: "5", modifiers: [te.Ctrl] } }), new J("formatSuperscriptToggle", o, { label: "Superscript", description: "Format your text to be smaller and sit at the top of the line." }), new J("formatSubscriptToggle", o, { label: "Subscript", description: "Format your text to be smaller and sit at the bottom of the line." }), new J("formatAlignTopToggle", o, { label: "Align Top", description: "Align text to the top." }), new J("formatTextOverflowVisibleToggle", o, { label: "Overflow Text", description: "Overflow text to the next cells." }), new J("formatTextOverflowWrapToggle", o, { label: "Wrap Text", description: "Wrap text with the existing cell and increase the height as required." }), new J("formatTextOverflowClipToggle", o, { label: "Clip Text", description: "Clip text that falls outside of the existing cell." }), new J("formatTextOverflowShrinkToggle", o, { label: "Shrink Text", description: "Shrink the text font to fit within existing cell." }), new J("formatTextOverflowEllipsisToggle", o, { label: "Ellipsis Text", description: "Add a trailing '…' to the text to indicate text is partially hidden." }), new J("formatAlignMiddleToggle", o, { label: "Align Middle", description: "Align text so that it is centered between the top and bottom of the cell." }), new J("formatAlignBottomToggle", o, { label: "Align Bottom", description: "Align text to the bottom." }), new J("formatAlignJustifyVerticalToggle", o, { label: "Justify Vertically", description: "Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell." }), new J("formatAlignDistributedVerticalToggle", o, { label: "Distribute Vertically", description: "Justify your content vertically." }), new J("formatAlignLeftToggle", o, { label: "Align Left", description: "Align your content to the left." }), new J("formatAlignCenterToggle", o, { label: "Align Center", description: "Center your content." }), new J("formatAlignRightToggle", o, { label: "Align Right", description: "Align your content to the right." }), new J("formatAlignJustifyToggle", o, { label: "Align Justify", description: "Justify your content." }), new J("formatAlignCenterContinuousToggle", o, { label: "Center Across", description: "Center your content across multiple cells." }), new J("formatAlignFillToggle", o, { label: "Fill Across", description: "Repeat the value to fill the entire cell." }), new J("formatAlignDistributedHorizontalToggle", o, { label: "Distribute Horizontally", description: "Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell." }), new Ue("formatFontSizeIncrease", o, { label: "Increase Font Size", description: "Make your text a bit bigger.", shortcut: { key: ">", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1053
1053
|
O(this, (a) => ({ font: { size: _o(a.getFont().getSize(), !0) } }));
|
|
1054
|
-
}), new Ue("formatFontSizeDecrease", o, { label: "Decrease Font Size", description: "Make your text a bit smaller.", shortcut: { key: "<", modifiers: [
|
|
1054
|
+
}), new Ue("formatFontSizeDecrease", o, { label: "Decrease Font Size", description: "Make your text a bit smaller.", shortcut: { key: "<", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1055
1055
|
O(this, (a) => ({ font: { size: _o(a.getFont().getSize(), !1) } }));
|
|
1056
1056
|
}), new J("formatFontFamily", o, { label: "Font", description: "Select the font your text." }, function(a) {
|
|
1057
1057
|
O(this, { font: { family: a } });
|
|
1058
1058
|
}), new J("formatFontSize", o, { label: "Font Size", description: "Change the size of your text." }, function(a) {
|
|
1059
1059
|
O(this, { font: { size: a } });
|
|
1060
|
-
}), new J("formatNumberDialog", o, { label: "Custom Number Format", scopedLabels: { numberFormat: "Custom" }, description: "Create a custom number format.", shortcut: [{ key: "1", modifiers: [
|
|
1061
|
-
const R = this, f = { initialValue: a ?? x.state(), context: x.context(), onInputOption: (I,
|
|
1060
|
+
}), new J("formatNumberDialog", o, { label: "Custom Number Format", scopedLabels: { numberFormat: "Custom" }, description: "Create a custom number format.", shortcut: [{ key: "1", modifiers: [te.Ctrl] }, { key: "1", modifiers: [te.Ctrl, te.Alt] }] }, function(a, x) {
|
|
1061
|
+
const R = this, f = { initialValue: a ?? x.state(), context: x.context(), onInputOption: (I, m) => {
|
|
1062
1062
|
O(R, { numberFormat: I });
|
|
1063
1063
|
} };
|
|
1064
1064
|
i.showWindow?.("numberFormat", f);
|
|
1065
1065
|
}), new J("formatNumberFormat", o, { label: "Number Format", description: "Choose the format for your cells, such as percentage, currency, date or time." }, function(a) {
|
|
1066
1066
|
O(this, { numberFormat: a });
|
|
1067
|
-
}), new J("formatNumberFormatGeneralStyle", o, { label: "General Style", description: "Remove all specific formatting.", shortcut: { key: "Backquote", modifiers: [
|
|
1067
|
+
}), new J("formatNumberFormatGeneralStyle", o, { label: "General Style", description: "Remove all specific formatting.", shortcut: { key: "Backquote", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1068
1068
|
O(this, { numberFormat: Kt.Type.General });
|
|
1069
|
-
}), new J("formatNumberFormatNumberStyle", o, { label: "Number Style", description: "Format as number with two decimals and comma.", shortcut: { key: "1", modifiers: [
|
|
1069
|
+
}), new J("formatNumberFormatNumberStyle", o, { label: "Number Style", description: "Format as number with two decimals and comma.", shortcut: { key: "1", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1070
1070
|
O(this, { numberFormat: "#,##0.00" });
|
|
1071
|
-
}), new J("formatNumberFormatTimeStyle", o, { label: "Time Style", description: "Format as time with hour and minute, and AM or PM.", shortcut: { key: "2", modifiers: [
|
|
1071
|
+
}), new J("formatNumberFormatTimeStyle", o, { label: "Time Style", description: "Format as time with hour and minute, and AM or PM.", shortcut: { key: "2", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1072
1072
|
O(this, { numberFormat: "h:mm AM/PM" });
|
|
1073
|
-
}), new J("formatNumberFormatDateStyle", o, { label: "Date Style", description: "Format as date with day, month, and year.", shortcut: { key: "3", modifiers: [
|
|
1073
|
+
}), new J("formatNumberFormatDateStyle", o, { label: "Date Style", description: "Format as date with day, month, and year.", shortcut: { key: "3", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1074
1074
|
O(this, { numberFormat: "d-mmm-yy" });
|
|
1075
|
-
}), new J("formatNumberFormatAccountingStyle", o, { label: "Accounting Style", description: "Format as Dollars, Euros, or other currency.", shortcut: { key: "4", modifiers: [
|
|
1075
|
+
}), new J("formatNumberFormatAccountingStyle", o, { label: "Accounting Style", description: "Format as Dollars, Euros, or other currency.", shortcut: { key: "4", modifiers: [te.Ctrl, te.Shift] } }, function(a) {
|
|
1076
1076
|
O(this, { numberFormat: a ?? '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)' });
|
|
1077
|
-
}), new J("formatNumberFormatPercentStyle", o, { label: "Percent Style", description: "Format as a percent with no decimal places.", shortcut: { key: "5", modifiers: [
|
|
1077
|
+
}), new J("formatNumberFormatPercentStyle", o, { label: "Percent Style", description: "Format as a percent with no decimal places.", shortcut: { key: "5", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1078
1078
|
O(this, { numberFormat: "0%" });
|
|
1079
|
-
}), new J("formatNumberFormatScientificStyle", o, { label: "Scientific Style", description: "Format as a scientific number with two decimal places .", shortcut: { key: "6", modifiers: [
|
|
1079
|
+
}), new J("formatNumberFormatScientificStyle", o, { label: "Scientific Style", description: "Format as a scientific number with two decimal places .", shortcut: { key: "6", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1080
1080
|
O(this, { numberFormat: "0.00E+00" });
|
|
1081
|
-
}), new J("formatNumberFormatCommaStyle", o, { label: "Comma Style", description: "Format with a thousands separator.", shortcut: { key: ",", modifiers: [
|
|
1081
|
+
}), new J("formatNumberFormatCommaStyle", o, { label: "Comma Style", description: "Format with a thousands separator.", shortcut: { key: ",", modifiers: [te.Ctrl] } }, function() {
|
|
1082
1082
|
O(this, { numberFormat: '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)' });
|
|
1083
1083
|
}), new J("formatNumberFormatIncreaseDecimal", o, { label: "Increase Decimal", description: "Show more decimal places for a more precise value." }, function() {
|
|
1084
1084
|
O(this, (a) => ({ numberFormat: Kt.Parser.adjustDecimalPlaces(a.getNumberFormat(), 1) }));
|
|
1085
1085
|
}), new J("formatNumberFormatDecreaseDecimal", o, { label: "Decrease Decimal", description: "Show few decimal places." }, function() {
|
|
1086
1086
|
O(this, (a) => ({ numberFormat: Kt.Parser.adjustDecimalPlaces(a.getNumberFormat(), -1) }));
|
|
1087
|
-
}), new J("displayPlaceholdersToggle", o, { label: "Display Placeholders", description: "Switch between hiding objects, displaying objects, and displaying placeholders for objects.", shortcut: { key: "6", modifiers: [
|
|
1088
|
-
}), new J("displayOutlineSymbolsToggle", o, { label: "Display Outline Symbols", description: "Display or hide the outline symbols.", shortcut: { key: "8", modifiers: [
|
|
1087
|
+
}), new J("displayPlaceholdersToggle", o, { label: "Display Placeholders", description: "Switch between hiding objects, displaying objects, and displaying placeholders for objects.", shortcut: { key: "6", modifiers: [te.Ctrl] } }), new Ue("noOp", o, { label: "Do nothing", description: "Do Nothing.", shortcut: { key: "7", modifiers: [te.Ctrl] } }, function() {
|
|
1088
|
+
}), new J("displayOutlineSymbolsToggle", o, { label: "Display Outline Symbols", description: "Display or hide the outline symbols.", shortcut: { key: "8", modifiers: [te.Ctrl] } }), new J("hideRows", o, { label: "Hide Rows", description: "Hide the rows.", shortcut: { key: "9", modifiers: [te.Ctrl] } }), new J("unhideRows", o, { label: "Unhide Rows", description: "Unhide the rows.", shortcut: { key: "(", modifiers: [te.Ctrl, te.Shift] } }), new J("hideColumns", o, { label: "Hide Columns", description: "Hide the columns.", shortcut: [{ key: "0", modifiers: [te.Ctrl] }, { key: "0", modifiers: [te.Ctrl, te.Alt] }] }), new J("unhideColumns", o, { label: "Unhide Columns", description: "Unhide the columns.", shortcut: { key: ")", modifiers: [te.Ctrl, te.Shift] } }), new Ue("calculate", o, { label: "Calculate Sheet", description: "Recalculate the formulas on the current sheet.", shortcut: { key: "=", modifiers: [te.Ctrl] } }), new J("insertFunction", o, { label: "Insert Function", disabled: !0, scopedLabels: { insert: "Function", insertFunction: "More Functions..." }, description: "Work with the function in the current cell.", shortcut: { key: "F3", modifiers: [te.Shift] } }, function(a, x) {
|
|
1089
|
+
console.log("insertFunction");
|
|
1090
|
+
}), new J("insertFunctionSum", o, { label: "Quick Sum", scopedLabels: { insertFunction: "Sum" }, description: "Quick sum of the cells.", shortcut: { key: "=", modifiers: [te.Alt] } }, function() {
|
|
1089
1091
|
Y(this, "SUM");
|
|
1090
|
-
}), new J("
|
|
1092
|
+
}), new J("insertFunctionAverage", o, { label: "Quick Average", scopedLabels: { insertFunction: "Average" }, description: "Quick average of the cells." }, function() {
|
|
1091
1093
|
Y(this, "AVERAGE");
|
|
1092
|
-
}), new J("
|
|
1094
|
+
}), new J("insertFunctionCount", o, { label: "Quick Count", scopedLabels: { insertFunction: "Count Numbers" }, description: "Quick count of the cells." }, function() {
|
|
1093
1095
|
Y(this, "COUNT");
|
|
1094
|
-
}), new J("
|
|
1096
|
+
}), new J("insertFunctionMax", o, { label: "Quick Max", scopedLabels: { insertFunction: "Max" }, description: "Quick maximum of the cells." }, function() {
|
|
1095
1097
|
Y(this, "MAX");
|
|
1096
|
-
}), new J("
|
|
1098
|
+
}), new J("insertFunctionMin", o, { label: "Quick Min", scopedLabels: { insertFunction: "Min" }, description: "Quick minimum of the cells." }, function() {
|
|
1097
1099
|
Y(this, "MIN");
|
|
1098
|
-
}), new J("startEditCurrentTime", o, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [
|
|
1100
|
+
}), new J("startEditCurrentTime", o, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1099
1101
|
b?.({ text: t.createTemporaryCell({ value: Zn(), style: { numberFormat: "Medium Time" } }).toText() });
|
|
1100
|
-
}), new J("startEditCurrentDate", o, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [
|
|
1102
|
+
}), new J("startEditCurrentDate", o, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [te.Ctrl] } }, function() {
|
|
1101
1103
|
b?.({ text: t.createTemporaryCell({ value: Zn(), style: { numberFormat: "Short Date" } }).toText() });
|
|
1102
|
-
}), new Ue("sheetZoomOut", o, { label: "Zoom Out", description: "Zoom out to see less detail but more area.", shortcut: [{ key: "-", modifiers: [
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
const R = this, f = { context: x.context(), onUpdateHyperlink: (I, h) => {
|
|
1106
|
-
W(R, I, h);
|
|
1104
|
+
}), new Ue("sheetZoomOut", o, { label: "Zoom Out", description: "Zoom out to see less detail but more area.", shortcut: [{ key: "-", modifiers: [te.Ctrl, te.Alt] }, { key: "NumpadSubtract", modifiers: [te.Ctrl, te.Alt] }] }), new Ue("sheetZoomIn", o, { label: "Zoom In", description: "Zoom in to see more detail but less area.", shortcut: [{ key: "=", modifiers: [te.Ctrl, te.Alt] }, { key: "NumpadAdd", modifiers: [te.Ctrl, te.Alt] }] }), new Ue("sheetZoom100", o, { label: "Zoom 100%", description: "Zoom document to 100%.", shortcut: { key: "o", modifiers: [te.Ctrl, te.Alt] } }), new J("updateHyperlink", o, { label: "Link", scopedLabels: { contextMenu: "Insert Link…", insert: "Link…", hyperlink: "Edit" }, description: "Create a hyperlink to either another webpage or another location within this document.", context: () => U, shortcut: [{ key: "K", modifiers: [te.Ctrl] }, { key: "K", modifiers: [te.Ctrl, te.Alt] }] }, async function(a, x) {
|
|
1105
|
+
const R = this, f = { context: x.context(), onUpdateHyperlink: (I, m) => {
|
|
1106
|
+
W(R, I, m);
|
|
1107
1107
|
} };
|
|
1108
1108
|
i.showWindow?.("hyperlink", f);
|
|
1109
|
-
}), new J("openHyperlink", o, { label: "Open Link", scopedLabels: { hyperlink: "Open" }, shortcut: { key: "Enter", modifiers: [
|
|
1109
|
+
}), new J("openHyperlink", o, { label: "Open Link", scopedLabels: { hyperlink: "Open" }, shortcut: { key: "Enter", modifiers: [te.Ctrl] }, description: "Open the hyperlink or goto another location within this document.", context: () => U }, async (a, x) => {
|
|
1110
1110
|
const R = x.context()();
|
|
1111
1111
|
if (!R) return;
|
|
1112
1112
|
const f = R.getHyperlink();
|
|
@@ -1117,17 +1117,17 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1117
1117
|
}
|
|
1118
1118
|
}), new J("deleteHyperlink", o, { label: "Delete Link", scopedLabels: { hyperlink: "Delete" }, description: "Remove the hyperlink.", context: () => U }, function(a, x) {
|
|
1119
1119
|
W(this, null, null);
|
|
1120
|
-
}), new Ue("insertNote", o, { label: "Insert Note", scopedLabels: { contextMenu: "Insert Note…", insert: "Note" }, shortcut: { key: "F2", modifiers: [
|
|
1120
|
+
}), new Ue("insertNote", o, { label: "Insert Note", scopedLabels: { contextMenu: "Insert Note…", insert: "Note" }, shortcut: { key: "F2", modifiers: [te.Shift] }, description: "Add a note to the cell." }, (a, x) => {
|
|
1121
1121
|
((R, f) => {
|
|
1122
1122
|
R?.showMessage?.(Je("p", { style: { marginTop: "0px", marginBottom: "0px" }, children: [f, " is not yet implemented.", p("br", {}), p("br", {}), "Please see the ", p("a", { style: { whiteSpace: "nowrap" }, href: "https://www.sheetxl.com/docs/guides/introduction/roadmap", target: "_blank", rel: "noopener", children: "SheetXL Roadmap" }), "."] }));
|
|
1123
1123
|
})(i, x.label());
|
|
1124
|
-
}), new J("updateComments", o, { label: "Comments", scopedLabels: { contextMenu: "Insert Comments…", insert: "Comments…" }, shortcut: { key: "M", modifiers: [
|
|
1124
|
+
}), new J("updateComments", o, { label: "Comments", scopedLabels: { contextMenu: "Insert Comments…", insert: "Comments…" }, shortcut: { key: "M", modifiers: [te.Ctrl, te.Alt] }, description: "Add a comment to the current cell.", context: () => U }, async function(a, x) {
|
|
1125
1125
|
const R = this, f = { context: x.context(), onUpdateComments: (I) => {
|
|
1126
|
-
|
|
1126
|
+
ne(R, I);
|
|
1127
1127
|
} };
|
|
1128
1128
|
i.showWindow?.("comments", f);
|
|
1129
1129
|
}), new J("deleteComments", o, { label: "Delete Comments", description: "Remove any comments.", context: () => U }, function(a, x) {
|
|
1130
|
-
|
|
1130
|
+
ne(this, null);
|
|
1131
1131
|
}), new J("insertImageFromFile", o, { label: "Insert Image", scopedLabels: { contextMenu: "Insert Image…", insert: "Image…", insertImage: "From Device…" }, description: "Insert a picture from your device." }, async function(a = null) {
|
|
1132
1132
|
let x = null, R = null;
|
|
1133
1133
|
typeof a == "string" ? R = a : x = a?.file ? a.file : a, (x || (x = await rt.openFileDialog(R ?? "image/*"), x)) && await me(this, { file: x }, a?.options);
|
|
@@ -1138,7 +1138,7 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1138
1138
|
a = x.input;
|
|
1139
1139
|
}
|
|
1140
1140
|
a && me(this, { fetch: a });
|
|
1141
|
-
}), new Ue("insertTable", o, { label: "Insert Table", scopedLabels: { contextMenu: "Insert Table…", insert: "Table" }, description: "Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.", shortcut: [{ key: "L", modifiers: [
|
|
1141
|
+
}), new Ue("insertTable", o, { label: "Insert Table", scopedLabels: { contextMenu: "Insert Table…", insert: "Table" }, description: "Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.", shortcut: [{ key: "L", modifiers: [te.Ctrl] }, { key: "T", modifiers: [te.Alt, te.Ctrl] }] }, function() {
|
|
1142
1142
|
_(this);
|
|
1143
1143
|
}), new J("editTable", o, { label: "Edit Table…", scopedLabels: { table: "Edit…", namedItem: "Edit…" }, description: "Edit the table to adjust formatting, sorting, filtering, or other advanced features." }, function(a) {
|
|
1144
1144
|
let x = null, R = !1;
|
|
@@ -1146,21 +1146,21 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1146
1146
|
}), new J("deleteTable", o, { label: "Delete Table", scopedLabels: { delete: "Table", table: "Delete", namedItem: "Delete" }, description: `Remove the table.
|
|
1147
1147
|
|
|
1148
1148
|
The table and table specific styling will be removed but the values will be preserved.` }, function(a) {
|
|
1149
|
-
|
|
1149
|
+
Ze(this, a, !0);
|
|
1150
1150
|
}), new J("convertTableToRange", o, { label: "Convert To Range", description: `Convert the table into a normal range of cells.
|
|
1151
1151
|
|
|
1152
1152
|
The values and the formatting are preserved.` }, function(a) {
|
|
1153
|
-
|
|
1154
|
-
}), new J("tableTotalRowToggle", o, { label: "Toggle Table Total Row", description: "Toggle Total Row on/off.", scopedLabels: { table: "Total Row" }, shortcut: { key: "T", modifiers: [
|
|
1153
|
+
Ze(this, a, !1);
|
|
1154
|
+
}), new J("tableTotalRowToggle", o, { label: "Toggle Table Total Row", description: "Toggle Total Row on/off.", scopedLabels: { table: "Total Row" }, shortcut: { key: "T", modifiers: [te.Ctrl, te.Alt] } }, function() {
|
|
1155
1155
|
const a = this.context().table();
|
|
1156
1156
|
a && a.setShowTotals(!a.getShowTotals());
|
|
1157
1157
|
}), new J("tableHeaderRowToggle", o, { label: "Toggle Table Header Row", description: "Toggle Header Row on/off.", scopedLabels: { table: "Header Row" } }, function() {
|
|
1158
1158
|
const a = this.context().table();
|
|
1159
1159
|
a && a.setShowHeaders(!a.getShowHeaders());
|
|
1160
|
-
}), new J("autoFilterToggle", o, { label: "Toggle Filter", scopedLabels: { filter: "Filter" }, description: "Toggle Auto Filter on/off.", shortcut: { key: "L", modifiers: [
|
|
1160
|
+
}), new J("autoFilterToggle", o, { label: "Toggle Filter", scopedLabels: { filter: "Filter" }, description: "Toggle Auto Filter on/off.", shortcut: { key: "L", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1161
1161
|
const a = this.context().table();
|
|
1162
1162
|
a && a.setShowFilterButton(!a.getShowFilterButton());
|
|
1163
|
-
}), new J("autoFilterReapply", o, { label: "Reapply Filter", scopedLabels: { filter: "Reapply" }, description: "Reapply the filter and sort with the latest changes.", shortcut: { key: "L", modifiers: [
|
|
1163
|
+
}), new J("autoFilterReapply", o, { label: "Reapply Filter", scopedLabels: { filter: "Reapply" }, description: "Reapply the filter and sort with the latest changes.", shortcut: { key: "L", modifiers: [te.Ctrl, te.Alt] } }), new J("autoFilterClear", o, { label: "Clear Filter", scopedLabels: { filter: "Clear" }, description: "Clear the filters criteria from the current filter.." }), new Ue("startEditValueAbove", o, { label: "Copy From Above", description: "Copy the value from the cell above the active cell into the cell or the formula bar.", shortcut: [{ key: "Quote", modifiers: [te.Ctrl] }, { key: '"', modifiers: [te.Ctrl, te.Shift] }] }, Te), new J("formatPainterToggle", o, { label: "Format Painter", description: "Apply style to another part of your workbook." }), new Ue("insertCells", o, { label: "Insert Cells", scopedLabels: { insertCells: "At Selection" }, description: "Inserts cells at the current selection.", shortcut: { key: "=", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1164
1164
|
A(this);
|
|
1165
1165
|
}), new Ue("insertCellsShiftRight", o, { label: "Insert Cells (Shift Right)", scopedLabels: { insertCells: "Shift Right" }, description: "Insert cells to the left and shift the current cells to the right." }, function() {
|
|
1166
1166
|
A(this, qe.Orientation.Column);
|
|
@@ -1174,7 +1174,7 @@ The values and the formatting are preserved.` }, function(a) {
|
|
|
1174
1174
|
return A(this, qe.Orientation.Row, !0, !0);
|
|
1175
1175
|
}), new Ue("insertColumnsAfter", o, { label: "Insert Column After", scopedLabels: { insertCells: "Column After" }, description: "Insert a column after the current position." }, function() {
|
|
1176
1176
|
return A(this, qe.Orientation.Column, !0, !0);
|
|
1177
|
-
}), new Ue("deleteCells", o, { label: "Delete Cells", scopedLabels: { deleteCells: "At Selection" }, description: "Delete the cells.", shortcut: { key: "-", modifiers: [
|
|
1177
|
+
}), new Ue("deleteCells", o, { label: "Delete Cells", scopedLabels: { deleteCells: "At Selection" }, description: "Delete the cells.", shortcut: { key: "-", modifiers: [te.Ctrl] } }, function() {
|
|
1178
1178
|
return de(this);
|
|
1179
1179
|
}), new Ue("deleteCellsShiftUp", o, { label: "Delete Cells (Shift Up)", scopedLabels: { deleteCells: "Shift up" }, description: "Delete cells the current current downward." }, function() {
|
|
1180
1180
|
return de(this, qe.Orientation.Row);
|
|
@@ -1184,17 +1184,17 @@ The values and the formatting are preserved.` }, function(a) {
|
|
|
1184
1184
|
return de(this, qe.Orientation.Row, !0);
|
|
1185
1185
|
}), new Ue("deleteColumns", o, { label: "Delete Columns", scopedLabels: { deleteCells: "Columns" }, description: "Delete the columns at the current selection." }, function() {
|
|
1186
1186
|
return de(this, qe.Orientation.Column, !0);
|
|
1187
|
-
}), new Ue("flashFill", o, { label: "Flash Fill", description: "Do a flash fill.", shortcut: [{ key: "e", modifiers: [
|
|
1187
|
+
}), new Ue("flashFill", o, { label: "Flash Fill", description: "Do a flash fill.", shortcut: [{ key: "e", modifiers: [te.Ctrl] }, { key: "e", modifiers: [te.Ctrl, te.Alt] }] }), new Ue("fillDown", o, { label: "Fill Down", description: "Copy the top-most value from the selection to the bottom of the selection.", shortcut: { key: "d", modifiers: [te.Ctrl] } }, function() {
|
|
1188
1188
|
return ye(this, qe.Direction.Down);
|
|
1189
|
-
}), new Ue("fillRight", o, { label: "Fill Right", description: "Copy the left-most value from the selection to the right of the selection.", shortcut: [{ key: "r", modifiers: [
|
|
1189
|
+
}), new Ue("fillRight", o, { label: "Fill Right", description: "Copy the left-most value from the selection to the right of the selection.", shortcut: [{ key: "r", modifiers: [te.Ctrl] }] }, function() {
|
|
1190
1190
|
return ye(this, qe.Direction.Right);
|
|
1191
1191
|
}), new Ue("fillUp", o, { label: "Fill Up", description: "Copy the bottom-most value from the selection to the top of the selection." }, function() {
|
|
1192
1192
|
return ye(this, qe.Direction.Up);
|
|
1193
1193
|
}), new Ue("fillLeft", o, { label: "Fill Left", description: "Copy the right-most value from the selection to the left of the selection." }, function() {
|
|
1194
1194
|
return ye(this, qe.Direction.Left);
|
|
1195
|
-
}), new Ue("formatBorderAddOutline", o, { label: "Add Outline Border", description: "Apply an outline border.", shortcut: { key: "7", modifiers: [
|
|
1195
|
+
}), new Ue("formatBorderAddOutline", o, { label: "Add Outline Border", description: "Apply an outline border.", shortcut: { key: "7", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1196
1196
|
return O(this, { border: { left: { style: Et.StrokeStyle.Thin, color: null }, top: { style: Et.StrokeStyle.Thin, color: null }, right: { style: Et.StrokeStyle.Thin, color: null }, bottom: { style: Et.StrokeStyle.Thin, color: null } } });
|
|
1197
|
-
}), new Ue("formatBorderClearOutline", o, { label: "Remove Outline Border", description: "Remove the outline border.", shortcut: { key: "_", modifiers: [
|
|
1197
|
+
}), new Ue("formatBorderClearOutline", o, { label: "Remove Outline Border", description: "Remove the outline border.", shortcut: { key: "_", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1198
1198
|
return O(this, { border: null });
|
|
1199
1199
|
}), new Ue("formatIndentDecrease", o, { label: "Decrease Indent", description: "Move your content closer to the border." }, function() {
|
|
1200
1200
|
return O(this, (a) => {
|
|
@@ -1206,7 +1206,7 @@ The values and the formatting are preserved.` }, function(a) {
|
|
|
1206
1206
|
const x = { alignment: { indent: a.getAlignment().getIndent() + 1 } };
|
|
1207
1207
|
return a.getAlignment().getHorizontal() === ve.HorizontalAlignment.General && (x.alignment.horizontal = ve.HorizontalAlignment.Left), x;
|
|
1208
1208
|
});
|
|
1209
|
-
}), new J("mergeToggle", o, { label: "Merge", description: "Combine and center the contents into a single cell.", shortcut: { key: "m", modifiers: [
|
|
1209
|
+
}), new J("mergeToggle", o, { label: "Merge", description: "Combine and center the contents into a single cell.", shortcut: { key: "m", modifiers: [te.Ctrl] } }), new Ue("mergeHorizontal", o, { label: "Merge Horizontally", description: "Combine the contents into horizontal rows." }), new Ue("mergeVertical", o, { label: "Merge Vertically", description: "Combine the contents into vertical columns." }), new Ue("unmerge", o, { label: "Unmerge", description: "Split merged cells into multiple cells." }), new Ue("clearContents", o, { label: "Clear Contents", scopedLabels: { clear: "Contents" }, description: `Clear only the contents in the cells.
|
|
1210
1210
|
|
|
1211
1211
|
The formatting is not cleared.`, shortcut: { key: "Delete" } }, function() {
|
|
1212
1212
|
z(this, Yt.Content.Values);
|
|
@@ -1218,36 +1218,36 @@ The formatting is not cleared.`, shortcut: { key: "Delete" } }, function() {
|
|
|
1218
1218
|
z(this, Yt.Content.Comments);
|
|
1219
1219
|
}), new Ue("clearAll", o, { label: "Clear All", scopedLabels: { clear: "All" }, description: `Clears everything from the cells.
|
|
1220
1220
|
|
|
1221
|
-
All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers: [
|
|
1221
|
+
All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
1222
1222
|
z(this);
|
|
1223
|
-
}), new J("freezeToggle", o, { label: "Freeze Panes", description: "Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)." }), new J("freezeToggleHorizontal", o, { label: "Freeze Top Rows", description: "Keep the top rows visible while scrolling through the rest of the sheet." }), new J("freezeToggleVertical", o, { label: "Freeze Left Columns", description: "Keep the left columns visible while scrolling through the rest of the sheet." }), new Ue("unfreeze", o, { label: "Unfreeze Panes", description: "Unfreeze both the rows and columns." }), new Ue("autoFitRows", o, { label: "Autofit Rows", description: "Adjust the rows to the best height." }), new Ue("autoFitColumns", o, { label: "Autofit Columns", description: "Adjust the columns to the best width." })], []),
|
|
1223
|
+
}), new J("freezeToggle", o, { label: "Freeze Panes", description: "Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)." }), new J("freezeToggleHorizontal", o, { label: "Freeze Top Rows", description: "Keep the top rows visible while scrolling through the rest of the sheet." }), new J("freezeToggleVertical", o, { label: "Freeze Left Columns", description: "Keep the left columns visible while scrolling through the rest of the sheet." }), new Ue("unfreeze", o, { label: "Unfreeze Panes", description: "Unfreeze both the rows and columns." }), new Ue("autoFitRows", o, { label: "Autofit Rows", description: "Adjust the rows to the best height." }), new Ue("autoFitColumns", o, { label: "Autofit Columns", description: "Adjust the columns to the best width." })], []), h = Ce(() => {
|
|
1224
1224
|
let a = null;
|
|
1225
|
-
return a = l ? l.createChildGroup(o, "sheet", !1) : new Co(o, "sheet"), a.addCommands(
|
|
1226
|
-
}, [l,
|
|
1225
|
+
return a = l ? l.createChildGroup(o, "sheet", !1) : new Co(o, "sheet"), a.addCommands(_e, !0), a;
|
|
1226
|
+
}, [l, _e]), [je, ut] = ue(!1), [Qe, X] = ue(!1);
|
|
1227
1227
|
Se(() => {
|
|
1228
1228
|
if (k.current !== t || !d) return;
|
|
1229
1229
|
const a = d.getCoords(), x = t.getTables().getItems({ address: a[0] });
|
|
1230
1230
|
T((V) => rt.isEqualArrays(V, x) ? V : x), s && x[0] && qt.isCellWithinRange(s, x[0].getRange().getCoords()) ? $(x[0] ?? null) : $(null);
|
|
1231
1231
|
const R = t.getSelectedRanges(), f = R.getMerges().length > 0, I = R.isOverlapping();
|
|
1232
|
-
let
|
|
1233
|
-
for (let V = 0;
|
|
1234
|
-
X(I), ut(x.length === 0 && !I && (f || !
|
|
1232
|
+
let m = !0;
|
|
1233
|
+
for (let V = 0; m && V < a.length; V++) m = qt.isSingleCell(a[V]);
|
|
1234
|
+
X(I), ut(x.length === 0 && !I && (f || !m));
|
|
1235
1235
|
}, [Ne, d, t]), ol(l, null, { onChange: () => {
|
|
1236
1236
|
const a = !t.getProtection().isFormatCellsAllowed(), x = v.getMode()?.key === "formatPainter";
|
|
1237
|
-
|
|
1237
|
+
h.getCommand("formatPainterToggle").update({ disabled: a || !l?.getCommand("copy"), state: () => x }).updateCallback(() => x ? void v.setMode(null) : h.getCommand("copy").execute({ editMode: { key: "formatPainter", description: "Use the mouse to apply the copied format to another selection.", cursor: `url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer` } }));
|
|
1238
1238
|
} }, [v, Ie, l]), ht(t.getView(), { onFreezeSplitChange: () => {
|
|
1239
1239
|
Pe();
|
|
1240
1240
|
} }), ht(t.getSelection(), { onChange: () => {
|
|
1241
1241
|
j();
|
|
1242
1242
|
} });
|
|
1243
1243
|
const Le = () => {
|
|
1244
|
-
|
|
1245
|
-
}, darkMode: r.darkMode, autoColor: t.getStyles().parseColor(r.strokeFill), schemeLookup: t.getStyles().schemeLookup(), recentColors: () => t.getStyles().recentColors(), addRecentColor: (a) => t.getStyles().addRecentColor(a), clearRecentColors: () => t.getStyles().clearRecentColors() }) }),
|
|
1244
|
+
h.getCommand("sheetViewFormatGridlinesColor").update({ state: () => t.getView().getGridLineColor(), context: () => ({ onColorSelect: (a) => {
|
|
1245
|
+
}, darkMode: r.darkMode, autoColor: t.getStyles().parseColor(r.strokeFill), schemeLookup: t.getStyles().schemeLookup(), recentColors: () => t.getStyles().recentColors(), addRecentColor: (a) => t.getStyles().addRecentColor(a), clearRecentColors: () => t.getStyles().clearRecentColors() }) }), h.getCommand("formatSheetTabColor").updateCallback((a) => {
|
|
1246
1246
|
t.setTabColor(a);
|
|
1247
1247
|
}).update({ state: () => t?.getTabColor() ?? so, context: () => ({ onColorSelect: (a) => {
|
|
1248
1248
|
}, darkMode: r.darkMode, autoColor: so, schemeLookup: t.getStyles().schemeLookup(), recentColors: () => t.getStyles().recentColors(), addRecentColor: (a) => t.getStyles().addRecentColor(a), clearRecentColors: () => t.getStyles().clearRecentColors() }) });
|
|
1249
1249
|
}, Ge = () => {
|
|
1250
|
-
|
|
1250
|
+
h.getCommand("formatBorder").update({ context: () => ({ onBorderSelect: (a) => {
|
|
1251
1251
|
G(a);
|
|
1252
1252
|
}, darkMode: r.darkMode, quickBorder: E, autoColor: t.getStyles().getNormal().getFont().getFill(), autoStyle: Et.StrokeStyle.Thin, createTemporaryBorder: (a) => t.getStyles().getNormal().createTemporaryStyle({ border: a }).getBorder(), schemeLookup: t.getStyles().schemeLookup() }) });
|
|
1253
1253
|
};
|
|
@@ -1255,15 +1255,15 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1255
1255
|
Ge();
|
|
1256
1256
|
}, [E]), Se(() => {
|
|
1257
1257
|
const a = !t.getProtection().isInsertHyperlinksAllowed();
|
|
1258
|
-
|
|
1258
|
+
h.getCommand("openHyperlink").update({ disabled: !U().getHyperlink() }), h.getCommand("deleteHyperlink").update({ disabled: a || !U().getHyperlink() });
|
|
1259
1259
|
const x = U().getHyperlink() ? "Edit" : "Insert", R = "Link";
|
|
1260
|
-
|
|
1260
|
+
h.getCommand("updateHyperlink").update({ label: () => (U().getHyperlink(), `${x} ${R}`), scopedLabels: { contextMenu: `${x} ${R}…`, insert: `${R}…`, hyperlink: `${x}…` }, disabled: a });
|
|
1261
1261
|
}, [U()?.getHyperlink(), Ie]), Se(() => {
|
|
1262
1262
|
const a = U().getComments(), x = () => a ? "Edit" : "Insert", R = () => a ? "Comments" : "Comment";
|
|
1263
|
-
|
|
1263
|
+
h.getCommand("updateComments").update({ label: () => `${x()} ${R()}`, scopedLabels: { contextMenu: `${x()} ${R()}…`, insert: `${R()}…` } });
|
|
1264
1264
|
}, [U()?.getComments(), Ie]), ht(t, { onViewChange: () => {
|
|
1265
1265
|
const a = t.getView();
|
|
1266
|
-
|
|
1266
|
+
h.getCommand("sheetViewToggleFormulaView").update({ state: a.isShowFormulas() }), h.getCommand("sheetViewToggleShowZeros").update({ state: a.isShowZeros() }), h.getCommand("gridlinesToggle").update({ state: a.isShowColumnGridlines() || a.isShowRowGridlines() }), h.getCommand("sheetViewToggleGridlinesColumns").update({ state: a.isShowColumnGridlines() }), h.getCommand("sheetViewToggleGridlinesRows").update({ state: a.isShowRowGridlines() }), h.getCommand("sheetViewToggleShowHeadings").update({ state: a.isShowColumnHeaders() || a.isShowRowHeaders() }), h.getCommand("sheetViewToggleShowHeadingColumns").update({ state: a.isShowColumnHeaders() }), h.getCommand("sheetViewToggleShowHeadingRows").update({ state: a.isShowRowHeaders() }), h.getCommand("sheetViewToggleShowHeadingsNumeric").update({ state: () => t.getView().getColumnHeaderStyle() === en.HeaderTextStyle.Zero && t.getView().getRowHeaderStyle() === en.HeaderTextStyle.Zero }), Le();
|
|
1267
1267
|
}, onTabColorChange: () => {
|
|
1268
1268
|
Le();
|
|
1269
1269
|
}, onMergesChange: () => {
|
|
@@ -1280,57 +1280,59 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1280
1280
|
Le(), Ge();
|
|
1281
1281
|
}, [r]), Se(() => {
|
|
1282
1282
|
const a = !t.getProtection().isFormatCellsAllowed(), x = F.length > 0 && !P || a, R = Ae(P), f = { context: R };
|
|
1283
|
-
|
|
1283
|
+
h.getCommand("editTable").update(f), h.getCommand("deleteTable").update(f), h.getCommand("convertTableToRange").update(f);
|
|
1284
1284
|
const I = { context: R, disabled: x };
|
|
1285
|
-
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1285
|
+
h.getCommand("formatTableStyle").update({ label: P ? "Apply Table Style" : "Format As Table", ...I }), h.getCommand("formatTableStyleClearCellStyles").update(I), h.getCommand("deleteTableStyle").update(I), h.getCommand("convertTableToRange").update(I), h.getCommand("insertTable").update({ disabled: x || F.length > 0 });
|
|
1286
|
+
const m = { context: R, disabled: x || F.length === 0 };
|
|
1287
|
+
h.getCommand("tableHeaderRowToggle").update(m), h.getCommand("tableTotalRowToggle").update(m), h.getCommand("autoFilterToggle").update(m), h.getCommand("formatTableStyleClearTableStyle").update({ ...m, disabled: m.disabled || !P || P.getStyleOptions().name === null });
|
|
1288
1288
|
}, [P, F, Ie]), Se(() => {
|
|
1289
|
-
|
|
1289
|
+
h.getCommand("sheetZoomOut").updateCallback(() => {
|
|
1290
1290
|
t.getView().update({ zoomScale: rt.findNextStep(t.getView().getZoomScale(), !1) });
|
|
1291
|
-
}),
|
|
1291
|
+
}), h.getCommand("sheetZoomIn").updateCallback(() => {
|
|
1292
1292
|
t.getView().update({ zoomScale: rt.findNextStep(t.getView().getZoomScale()) });
|
|
1293
|
-
}),
|
|
1293
|
+
}), h.getCommand("sheetZoom100").updateCallback(() => {
|
|
1294
1294
|
t.getView().update({ zoomScale: 100 });
|
|
1295
|
-
}),
|
|
1295
|
+
}), h.getCommand("gridlinesToggle").updateCallback(() => {
|
|
1296
1296
|
const a = t.getView().isShowColumnGridlines() && t.getView().isShowRowGridlines();
|
|
1297
1297
|
t.getView().update({ showColumnGridlines: !a, showRowGridlines: !a });
|
|
1298
|
-
}),
|
|
1298
|
+
}), h.getCommand("sheetViewToggleGridlinesRows").updateCallback(() => {
|
|
1299
1299
|
t.getView().update({ showRowGridlines: !t.getView().isShowRowGridlines() });
|
|
1300
|
-
}),
|
|
1300
|
+
}), h.getCommand("sheetViewToggleGridlinesColumns").updateCallback(() => {
|
|
1301
1301
|
t.getView().update({ showColumnGridlines: !t.getView().isShowColumnGridlines() });
|
|
1302
|
-
}),
|
|
1302
|
+
}), h.getCommand("sheetViewFormatGridlinesColor").updateCallback((a) => {
|
|
1303
1303
|
t.getView().update({ gridLineColor: a });
|
|
1304
|
-
}),
|
|
1304
|
+
}), h.getCommand("sheetViewToggleShowHeadings").updateCallback(() => {
|
|
1305
1305
|
const a = t.getView().isShowColumnHeaders() && t.getView().isShowRowHeaders();
|
|
1306
1306
|
t.getView().update({ showColumnHeaders: !a, showRowHeaders: !a });
|
|
1307
|
-
}),
|
|
1307
|
+
}), h.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(() => {
|
|
1308
1308
|
t.getView().update({ showColumnHeaders: !t.getView().isShowColumnHeaders() });
|
|
1309
|
-
}),
|
|
1309
|
+
}), h.getCommand("sheetViewToggleShowHeadingRows").updateCallback(() => {
|
|
1310
1310
|
t.getView().update({ showRowHeaders: !t.getView().isShowRowHeaders() });
|
|
1311
|
-
}),
|
|
1311
|
+
}), h.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(() => {
|
|
1312
1312
|
const a = t.getView().getColumnHeaderStyle() === en.HeaderTextStyle.Zero && t.getView().getRowHeaderStyle() === en.HeaderTextStyle.Zero;
|
|
1313
1313
|
t.getView().update({ columnHeaderStyle: a ? en.HeaderTextStyle.A1 : en.HeaderTextStyle.Zero, rowHeaderStyle: a ? en.HeaderTextStyle.One : en.HeaderTextStyle.Zero });
|
|
1314
|
-
}),
|
|
1314
|
+
}), h.getCommand("sheetViewToggleFormulaView").updateCallback(() => {
|
|
1315
1315
|
t.getView().update({ showFormulas: !t.getView().isShowFormulas() });
|
|
1316
|
-
}),
|
|
1316
|
+
}), h.getCommand("sheetViewToggleShowZeros").updateCallback(() => {
|
|
1317
1317
|
t.getView().update({ showZeros: !t.getView().isShowZeros() });
|
|
1318
|
-
})
|
|
1318
|
+
}), h.getCommand("calculate").updateCallback(() => {
|
|
1319
|
+
t.getEntireRange().calculate(!0);
|
|
1320
|
+
}), h.getCommand("insertFunction").update({ context: () => ({ searchByCategory: (a) => (console.log("category", a), []) }) });
|
|
1319
1321
|
}, [t]), Se(() => {
|
|
1320
1322
|
const a = t.getView().getFreezePanes(), x = () => a.coords.rowIndex !== 0, R = () => a.coords.colIndex !== 0, f = () => a.coords.rowIndex !== 0 || a.coords.colIndex !== 0;
|
|
1321
|
-
|
|
1323
|
+
h.getCommand("freezeToggle").updateCallback(() => {
|
|
1322
1324
|
f() ? t.getView().setFreezePanes(null) : f() ? R() ? t.getView().setFreezePanes({ coords: { rowIndex: s.rowIndex } }) : x() && t.getView().setFreezePanes({ coords: { colIndex: s.colIndex } }) : t.getView().setFreezePanes({ coords: s });
|
|
1323
|
-
}).update({ state: f, disabled: () => !s || !f() && s.rowIndex === 0 && s.colIndex === 0 }),
|
|
1325
|
+
}).update({ state: f, disabled: () => !s || !f() && s.rowIndex === 0 && s.colIndex === 0 }), h.getCommand("freezeToggleHorizontal").updateCallback(() => {
|
|
1324
1326
|
t.getView().setFreezePanes({ coords: { rowIndex: x() ? 0 : s.rowIndex } });
|
|
1325
|
-
}).update({ state: x, disabled: () => !s || !x() && s.rowIndex === 0 }),
|
|
1327
|
+
}).update({ state: x, disabled: () => !s || !x() && s.rowIndex === 0 }), h.getCommand("freezeToggleVertical").updateCallback(() => {
|
|
1326
1328
|
t.getView().setFreezePanes({ coords: { colIndex: R() ? 0 : s.colIndex } });
|
|
1327
|
-
}).update({ state: R, disabled: () => !s || !R() && s.colIndex === 0 }),
|
|
1329
|
+
}).update({ state: R, disabled: () => !s || !R() && s.colIndex === 0 }), h.getCommand("unfreeze").updateCallback(() => {
|
|
1328
1330
|
t.getView().setFreezePanes(null);
|
|
1329
1331
|
}).update({ disabled: () => !f() });
|
|
1330
1332
|
}, [Ne, s, t, r]);
|
|
1331
1333
|
const Fe = U().getStyle(), Ve = Fe.getFont(), Oe = Fe.getAlignment(), C = Oe.getHorizontal(), oe = Oe.getVertical(), N = Oe.getOverflow(), K = Oe.getRotation();
|
|
1332
1334
|
return Se(() => {
|
|
1333
|
-
|
|
1335
|
+
h.getCommand("formatCellStyle").update({ context: () => ({ styles: () => t.getStyles(), named: () => U().getStyle(!0).getNamed(), bodyStyle: be, createTemporaryCell: (He) => t.createTemporaryCell(He) }) }), h.getCommand("formatFillColor").update({ state: () => {
|
|
1334
1336
|
let He = null;
|
|
1335
1337
|
const at = Fe.getFill();
|
|
1336
1338
|
return at?.getType() === ho.Type.Solid ? He = at.getColor() : at?.getType() === ho.Type.Gradient ? He = at.getStops()?.[0]?.getColor() : at?.getType() === ho.Type.Pattern && (He = at.getBackground()), He;
|
|
@@ -1339,151 +1341,151 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1339
1341
|
return { onColorSelect: (at) => {
|
|
1340
1342
|
w(at ?? so);
|
|
1341
1343
|
}, darkMode: r.darkMode, quickColor: H, autoColor: so, schemeLookup: He.schemeLookup(), recentColors: He.recentColors(), addRecentColor: (at) => He.addRecentColor(at), clearRecentColors: () => He.clearRecentColors() };
|
|
1342
|
-
} }),
|
|
1344
|
+
} }), h.getCommand("formatFontColor").update({ state: () => Ve.toJSON()?.fill ? Ve.getFill() : null, context: () => {
|
|
1343
1345
|
const He = t.getStyles();
|
|
1344
1346
|
return { onColorSelect: (at) => {
|
|
1345
1347
|
q(at);
|
|
1346
1348
|
}, darkMode: r.darkMode, quickColor: L, autoColor: He.getNormal().getFont().getFill(), schemeLookup: He.schemeLookup(), recentColors: He.recentColors(), addRecentColor: (at) => He.addRecentColor(at), clearRecentColors: () => He.clearRecentColors() };
|
|
1347
|
-
} }),
|
|
1349
|
+
} }), h.getCommand("formatNumberFormat").update({ state: () => Fe.getNumberFormat(), context: () => U }), h.getCommand("formatNumberDialog").update({ state: () => Fe.getNumberFormat(), context: () => U }), h.getCommand("formatFontFamily").update({ state: () => Ve.getFamily() }), h.getCommand("formatFontSize").update({ state: () => Ve.getSize() });
|
|
1348
1350
|
const a = function() {
|
|
1349
1351
|
const He = Ve.getWeight() || 0;
|
|
1350
1352
|
return !isNaN(He) && He > 500;
|
|
1351
1353
|
};
|
|
1352
|
-
|
|
1354
|
+
h.getCommand("formatBoldToggle").updateCallback(function() {
|
|
1353
1355
|
O(this, { font: { weight: a() ? 400 : 700 } });
|
|
1354
1356
|
}).update({ state: a });
|
|
1355
1357
|
const x = function() {
|
|
1356
1358
|
return Ve.getStyle() === dt.Style.Italic;
|
|
1357
1359
|
};
|
|
1358
|
-
|
|
1360
|
+
h.getCommand("formatItalicToggle").updateCallback(function() {
|
|
1359
1361
|
O(this, { font: { style: x() ? dt.Style.Normal : dt.Style.Italic } });
|
|
1360
|
-
}).update({ state: x }),
|
|
1362
|
+
}).update({ state: x }), h.getCommand("formatStrikeThroughToggle").updateCallback(function() {
|
|
1361
1363
|
O(this, { font: { strike: !Ve.getStrike() } });
|
|
1362
|
-
}).update({ state: Ve.getStrike() }),
|
|
1364
|
+
}).update({ state: Ve.getStrike() }), h.getCommand("formatUnderlinedToggle").updateCallback(function() {
|
|
1363
1365
|
O(this, { font: { underline: Ve.getUnderline() !== dt.UnderlineStyle.Single ? dt.UnderlineStyle.Single : dt.UnderlineStyle.None } });
|
|
1364
|
-
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.Single }),
|
|
1366
|
+
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.Single }), h.getCommand("formatUnderlinedDoubleToggle").updateCallback(function() {
|
|
1365
1367
|
O(this, { font: { underline: Ve.getUnderline() !== dt.UnderlineStyle.Double ? dt.UnderlineStyle.Double : dt.UnderlineStyle.None } });
|
|
1366
|
-
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.Double }),
|
|
1368
|
+
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.Double }), h.getCommand("formatUnderlinedAccountingToggle").updateCallback(function() {
|
|
1367
1369
|
O(this, { font: { underline: Ve.getUnderline() !== dt.UnderlineStyle.SingleAccounting ? dt.UnderlineStyle.SingleAccounting : dt.UnderlineStyle.None } });
|
|
1368
|
-
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.SingleAccounting }),
|
|
1370
|
+
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.SingleAccounting }), h.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function() {
|
|
1369
1371
|
O(this, { font: { underline: Ve.getUnderline() !== dt.UnderlineStyle.DoubleAccounting ? dt.UnderlineStyle.DoubleAccounting : dt.UnderlineStyle.None } });
|
|
1370
|
-
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.DoubleAccounting }),
|
|
1372
|
+
}).update({ state: Ve.getUnderline() === dt.UnderlineStyle.DoubleAccounting }), h.getCommand("formatSuperscriptToggle").updateCallback(function() {
|
|
1371
1373
|
O(this, { font: { verticalAlign: Ve.getVerticalAlignment() !== dt.VerticalAlignment.Super ? dt.VerticalAlignment.Super : dt.VerticalAlignment.Baseline } });
|
|
1372
|
-
}).update({ state: Ve.getVerticalAlignment() === dt.VerticalAlignment.Super }),
|
|
1374
|
+
}).update({ state: Ve.getVerticalAlignment() === dt.VerticalAlignment.Super }), h.getCommand("formatSubscriptToggle").updateCallback(function() {
|
|
1373
1375
|
O(this, { font: { verticalAlign: Ve.getVerticalAlignment() !== dt.VerticalAlignment.Sub ? dt.VerticalAlignment.Sub : dt.VerticalAlignment.Baseline } });
|
|
1374
1376
|
}).update({ state: Ve.getVerticalAlignment() === dt.VerticalAlignment.Sub });
|
|
1375
1377
|
const R = () => N === ve.Overflow.Visible;
|
|
1376
|
-
|
|
1378
|
+
h.getCommand("formatTextOverflowVisibleToggle").updateCallback(function() {
|
|
1377
1379
|
O(this, { alignment: { overflow: (R(), ve.Overflow.Visible) } });
|
|
1378
1380
|
}).update({ state: R });
|
|
1379
1381
|
const f = () => N === ve.Overflow.Wrap;
|
|
1380
|
-
|
|
1382
|
+
h.getCommand("formatTextOverflowWrapToggle").updateCallback(function() {
|
|
1381
1383
|
O(this, { alignment: { overflow: f() ? ve.Overflow.Visible : ve.Overflow.Wrap } });
|
|
1382
1384
|
}).update({ state: f });
|
|
1383
1385
|
const I = function() {
|
|
1384
1386
|
return N === ve.Overflow.Clip;
|
|
1385
1387
|
};
|
|
1386
|
-
|
|
1388
|
+
h.getCommand("formatTextOverflowClipToggle").updateCallback(function() {
|
|
1387
1389
|
O(this, { alignment: { overflow: I() ? ve.Overflow.Visible : ve.Overflow.Clip } });
|
|
1388
1390
|
}).update({ state: I });
|
|
1389
|
-
const
|
|
1391
|
+
const m = function() {
|
|
1390
1392
|
return N === ve.Overflow.Shrink;
|
|
1391
1393
|
};
|
|
1392
|
-
|
|
1393
|
-
O(this, { alignment: { overflow:
|
|
1394
|
-
}).update({ state:
|
|
1394
|
+
h.getCommand("formatTextOverflowShrinkToggle").updateCallback(function() {
|
|
1395
|
+
O(this, { alignment: { overflow: m() ? ve.Overflow.Visible : ve.Overflow.Shrink } });
|
|
1396
|
+
}).update({ state: m });
|
|
1395
1397
|
const V = function() {
|
|
1396
1398
|
return N === ve.Overflow.Shrink;
|
|
1397
1399
|
};
|
|
1398
|
-
|
|
1400
|
+
h.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function() {
|
|
1399
1401
|
O(this, { alignment: { overflow: V() ? ve.Overflow.Visible : ve.Overflow.Ellipsis } });
|
|
1400
1402
|
}).update({ state: V, disabled: !0 });
|
|
1401
1403
|
const Z = function() {
|
|
1402
1404
|
return oe === ve.VerticalAlignment.Top;
|
|
1403
1405
|
};
|
|
1404
|
-
|
|
1406
|
+
h.getCommand("formatAlignTopToggle").updateCallback(function() {
|
|
1405
1407
|
O(this, { alignment: { vertical: Z() ? ve.VerticalAlignment.Bottom : ve.VerticalAlignment.Top } });
|
|
1406
1408
|
}).update({ state: Z });
|
|
1407
1409
|
const ee = function() {
|
|
1408
1410
|
return oe === ve.VerticalAlignment.Center;
|
|
1409
1411
|
};
|
|
1410
|
-
|
|
1412
|
+
h.getCommand("formatAlignMiddleToggle").updateCallback(function() {
|
|
1411
1413
|
O(this, { alignment: { vertical: ee() ? ve.VerticalAlignment.Bottom : ve.VerticalAlignment.Center } });
|
|
1412
1414
|
}).update({ state: ee });
|
|
1413
1415
|
const re = function() {
|
|
1414
1416
|
return oe === ve.VerticalAlignment.Bottom;
|
|
1415
1417
|
};
|
|
1416
|
-
|
|
1418
|
+
h.getCommand("formatAlignBottomToggle").updateCallback(function() {
|
|
1417
1419
|
O(this, { alignment: { vertical: (re(), ve.VerticalAlignment.Bottom) } });
|
|
1418
1420
|
}).update({ state: re });
|
|
1419
1421
|
const le = function() {
|
|
1420
1422
|
return oe === ve.VerticalAlignment.Justify;
|
|
1421
1423
|
};
|
|
1422
|
-
|
|
1424
|
+
h.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function() {
|
|
1423
1425
|
O(this, { alignment: { vertical: le() ? ve.VerticalAlignment.Bottom : ve.VerticalAlignment.Justify } });
|
|
1424
1426
|
}).update({ state: le });
|
|
1425
1427
|
const se = function() {
|
|
1426
1428
|
return oe === ve.VerticalAlignment.Distributed;
|
|
1427
1429
|
};
|
|
1428
|
-
|
|
1430
|
+
h.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function() {
|
|
1429
1431
|
O(this, { alignment: { vertical: se() ? ve.VerticalAlignment.Bottom : ve.VerticalAlignment.Distributed } });
|
|
1430
1432
|
}).update({ state: se });
|
|
1431
1433
|
const ke = function() {
|
|
1432
1434
|
return C === ve.HorizontalAlignment.Left;
|
|
1433
1435
|
};
|
|
1434
|
-
|
|
1436
|
+
h.getCommand("formatAlignLeftToggle").updateCallback(function() {
|
|
1435
1437
|
O(this, { alignment: { horizontal: ke() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Left } });
|
|
1436
1438
|
}).update({ state: ke });
|
|
1437
1439
|
const pe = function() {
|
|
1438
1440
|
return C === ve.HorizontalAlignment.Center;
|
|
1439
1441
|
};
|
|
1440
|
-
|
|
1442
|
+
h.getCommand("formatAlignCenterToggle").updateCallback(function() {
|
|
1441
1443
|
O(this, { alignment: { horizontal: pe() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Center } });
|
|
1442
1444
|
}).update({ state: pe });
|
|
1443
1445
|
const fe = function() {
|
|
1444
1446
|
return C === ve.HorizontalAlignment.CenterContinuous;
|
|
1445
1447
|
};
|
|
1446
|
-
|
|
1448
|
+
h.getCommand("formatAlignCenterContinuousToggle").updateCallback(function() {
|
|
1447
1449
|
const He = { alignment: { horizontal: fe() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.CenterContinuous, rotation: null } };
|
|
1448
1450
|
O(this, He);
|
|
1449
1451
|
}).update({ state: fe });
|
|
1450
1452
|
const Me = function() {
|
|
1451
1453
|
return C === ve.HorizontalAlignment.Fill;
|
|
1452
1454
|
};
|
|
1453
|
-
|
|
1455
|
+
h.getCommand("formatAlignFillToggle").updateCallback(function() {
|
|
1454
1456
|
const He = { alignment: { horizontal: Me() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Fill, rotation: null } };
|
|
1455
1457
|
O(this, He);
|
|
1456
1458
|
}).update({ state: Me });
|
|
1457
1459
|
const We = function() {
|
|
1458
1460
|
return C === ve.HorizontalAlignment.Distributed;
|
|
1459
1461
|
};
|
|
1460
|
-
|
|
1462
|
+
h.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function() {
|
|
1461
1463
|
O(this, { alignment: { horizontal: We() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Distributed } });
|
|
1462
1464
|
}).update({ state: We });
|
|
1463
1465
|
const Be = function() {
|
|
1464
1466
|
return C === ve.HorizontalAlignment.Right;
|
|
1465
1467
|
};
|
|
1466
|
-
|
|
1468
|
+
h.getCommand("formatAlignRightToggle").updateCallback(function() {
|
|
1467
1469
|
O(this, { alignment: { horizontal: Be() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Right } });
|
|
1468
1470
|
}).update({ state: Be });
|
|
1469
1471
|
const et = function() {
|
|
1470
1472
|
return C === ve.HorizontalAlignment.Justify;
|
|
1471
1473
|
};
|
|
1472
|
-
|
|
1474
|
+
h.getCommand("formatAlignJustifyToggle").updateCallback(function() {
|
|
1473
1475
|
O(this, { alignment: { horizontal: et() ? ve.HorizontalAlignment.General : ve.HorizontalAlignment.Justify } });
|
|
1474
1476
|
}).update({ state: et });
|
|
1475
1477
|
const $e = !t.getProtection().isFormatCellsAllowed(), nt = C === ve.HorizontalAlignment.CenterContinuous || C === ve.HorizontalAlignment.Fill;
|
|
1476
|
-
|
|
1478
|
+
h.getCommand("formatTextRotate0").updateCallback(function(He) {
|
|
1477
1479
|
O(this, { alignment: { rotation: 0 } });
|
|
1478
|
-
}).update({ disabled: $e || nt, state: K === 0 }),
|
|
1480
|
+
}).update({ disabled: $e || nt, state: K === 0 }), h.getCommand("formatTextRotate45").updateCallback(function(He) {
|
|
1479
1481
|
O(this, { alignment: { rotation: He ?? 1 ? 45 : 0 } });
|
|
1480
|
-
}).update({ disabled: $e || nt, state: K === 45 }),
|
|
1482
|
+
}).update({ disabled: $e || nt, state: K === 45 }), h.getCommand("formatTextRotate90").updateCallback(function(He) {
|
|
1481
1483
|
O(this, { alignment: { rotation: He ?? 1 ? 90 : 0 } });
|
|
1482
|
-
}).update({ disabled: $e || nt, state: K === 90 }),
|
|
1484
|
+
}).update({ disabled: $e || nt, state: K === 90 }), h.getCommand("formatTextRotate270").updateCallback(function(He) {
|
|
1483
1485
|
O(this, { alignment: { rotation: He ?? 1 ? 270 : 0 } });
|
|
1484
|
-
}).update({ disabled: $e || nt, state: K === 270 }),
|
|
1486
|
+
}).update({ disabled: $e || nt, state: K === 270 }), h.getCommand("formatTextRotate315").updateCallback(function(He) {
|
|
1485
1487
|
O(this, { alignment: { rotation: He ?? 1 ? 315 : 0 } });
|
|
1486
|
-
}).update({ disabled: $e || nt, state: K === 315 }),
|
|
1488
|
+
}).update({ disabled: $e || nt, state: K === 315 }), h.getCommand("formatTextRotateCustom").updateCallback(function(He) {
|
|
1487
1489
|
O(this, { alignment: { rotation: He } });
|
|
1488
1490
|
}).update({ disabled: $e || nt, state: K ?? 0 });
|
|
1489
1491
|
}, [Fe, t, r, H, L]), Se(() => {
|
|
@@ -1527,46 +1529,46 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1527
1529
|
}
|
|
1528
1530
|
});
|
|
1529
1531
|
};
|
|
1530
|
-
|
|
1532
|
+
h.getCommand("mergeToggle").updateCallback(function() {
|
|
1531
1533
|
qt.isSingleCell(t.getSelectedRange().getCoords()) || (x ? f(this) : R(qe.Orientations.Both, this));
|
|
1532
|
-
}).update({ state: x, disabled: !
|
|
1534
|
+
}).update({ state: x, disabled: !je || a }), h.getCommand("mergeHorizontal").updateCallback(function() {
|
|
1533
1535
|
R(qe.Orientations.Column, this);
|
|
1534
|
-
}).update({ disabled: !
|
|
1536
|
+
}).update({ disabled: !je || a }), h.getCommand("mergeVertical").updateCallback(function() {
|
|
1535
1537
|
R(qe.Orientations.Row, this);
|
|
1536
|
-
}).update({ disabled: !
|
|
1538
|
+
}).update({ disabled: !je }), h.getCommand("unmerge").updateCallback(function() {
|
|
1537
1539
|
f(this);
|
|
1538
|
-
}).update({ disabled: !x || !
|
|
1540
|
+
}).update({ disabled: !x || !je || a });
|
|
1539
1541
|
const I = { disabled: a };
|
|
1540
|
-
|
|
1542
|
+
h.getCommand("hideRows").updateCallback(function() {
|
|
1541
1543
|
B(this, (ot) => {
|
|
1542
1544
|
ot.getRowHeaders().setHidden(ot.getSelectedRanges().getCoords(), !0);
|
|
1543
1545
|
});
|
|
1544
|
-
}).update(I),
|
|
1546
|
+
}).update(I), h.getCommand("hideColumns").updateCallback(function() {
|
|
1545
1547
|
B(this, (ot) => {
|
|
1546
1548
|
ot.getColumnHeaders().setHidden(ot.getSelectedRanges().getCoords(), !0);
|
|
1547
1549
|
});
|
|
1548
|
-
}).update(I),
|
|
1550
|
+
}).update(I), h.getCommand("unhideRows").updateCallback(function() {
|
|
1549
1551
|
B(this, (ot) => {
|
|
1550
1552
|
ot.getRowHeaders().setHidden(ot.getSelectedRanges().getCoords(), !1);
|
|
1551
1553
|
});
|
|
1552
|
-
}).update(I),
|
|
1554
|
+
}).update(I), h.getCommand("unhideColumns").updateCallback(function() {
|
|
1553
1555
|
B(this, (ot) => {
|
|
1554
1556
|
ot.getColumnHeaders().setHidden(ot.getSelectedRanges().getCoords(), !1);
|
|
1555
1557
|
});
|
|
1556
|
-
}).update(I),
|
|
1558
|
+
}).update(I), h.getCommand("autoFitRows").updateCallback(function() {
|
|
1557
1559
|
B(this, (ot) => {
|
|
1558
1560
|
ot.getSelectedRanges().autoFit({ orientations: qe.Orientations.Row });
|
|
1559
1561
|
});
|
|
1560
|
-
}).update(I),
|
|
1562
|
+
}).update(I), h.getCommand("autoFitColumns").updateCallback(function() {
|
|
1561
1563
|
B(this, (ot) => {
|
|
1562
1564
|
ot.getSelectedRanges().autoFit({ orientations: qe.Orientations.Column });
|
|
1563
1565
|
});
|
|
1564
1566
|
}).update(I);
|
|
1565
|
-
let
|
|
1566
|
-
!d || a || Qe || (
|
|
1567
|
+
let m = !1, V = 0, Z = !1, ee = !1, re = 0, le = !1;
|
|
1568
|
+
!d || a || Qe || (m = d.isEntireColumnsAny(), m && !d.isEntireColumns() ? Z = !0 : V = d.getColumnCount(), ee = d.isEntireRowsAny(), ee && !d.isEntireRows() ? le = !0 : re = d.getRowCount());
|
|
1567
1569
|
const se = { disabled: a || d && d.getCount() !== 1 };
|
|
1568
|
-
|
|
1569
|
-
const ke = { disabled:
|
|
1570
|
+
h.getCommand("sortAscending").update(se), h.getCommand("sortDescending").update(se);
|
|
1571
|
+
const ke = { disabled: m || ee || a || Qe }, pe = m || a || Qe || le;
|
|
1570
1572
|
pe && (V = 1);
|
|
1571
1573
|
const fe = ee || a || Qe || Z;
|
|
1572
1574
|
fe && (re = 1);
|
|
@@ -1575,12 +1577,12 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1575
1577
|
let Ft = "", Pt = "";
|
|
1576
1578
|
if (d) {
|
|
1577
1579
|
const ot = d.getDefaultShiftOrientation() === qe.Orientation.Column;
|
|
1578
|
-
Ft = ` (${ot ? "Shift Right" : "Shift Down"})`, Pt = ` (${ot ? "Shift Left" : "Shift up"})`,
|
|
1580
|
+
Ft = ` (${ot ? "Shift Right" : "Shift Down"})`, Pt = ` (${ot ? "Shift Left" : "Shift up"})`, h.getCommand("deleteCells").update({ label: `Delete Cells${Pt}` });
|
|
1579
1581
|
}
|
|
1580
|
-
|
|
1581
|
-
}, [Ne,
|
|
1582
|
+
h.getCommand("insertCells").update({ label: `Insert ${Me}Cells${Ft}`, scopedLabels: { insertCells: `${Me}At Selection` } }), h.getCommand("insertCellsShiftRight").update(ke), h.getCommand("insertCellsShiftDown").update(ke), h.getCommand("deleteCellsShiftUp").update(ke), h.getCommand("deleteCellsShiftLeft").update(ke), h.getCommand("insertRows").update({ label: `Insert ${et}Row${$e}`, scopedLabels: { insertCells: `${et}Row${$e}` }, disabled: fe }), h.getCommand("insertRowsAfter").update({ label: `Insert ${et}Row${$e} Below`, disabled: fe }), h.getCommand("insertColumns").update({ label: `Insert ${We}Column${Be}`, scopedLabels: { insertCells: `${We}Column${Be}` }, disabled: pe }), h.getCommand("insertColumnsAfter").update({ label: `Insert ${We}Column${Be} After`, disabled: pe }), h.getCommand("deleteRows").update({ label: `Delete ${at}Row${Ct}`, scopedLabels: { deleteCells: `${at}Row${Ct}` }, disabled: fe }), h.getCommand("deleteColumns").update({ label: `Delete ${nt}Column${He}`, scopedLabels: { deleteCells: `${nt}Column${He}` }, disabled: pe });
|
|
1583
|
+
}, [Ne, je, Qe, d, v, i, Ie]), Se(() => {
|
|
1582
1584
|
const a = t.getProtection(), x = t.getProtection().isLocked(), R = !a.isFormatCellsAllowed(), f = { disabled: R };
|
|
1583
|
-
|
|
1585
|
+
h.getCommand("protectionSheetToggle").updateCallback(async (V, Z) => {
|
|
1584
1586
|
let ee = null;
|
|
1585
1587
|
try {
|
|
1586
1588
|
if (x) {
|
|
@@ -1596,10 +1598,10 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1596
1598
|
} catch (re) {
|
|
1597
1599
|
ee?.(), i?.showError?.(re);
|
|
1598
1600
|
}
|
|
1599
|
-
}).update({ state: x, label: () => x ? "Unprotect Sheet" : "Protect Sheet", scopedLabels: { sheet: x ? "Unprotect" : "Protect" } }),
|
|
1600
|
-
const I = C === ve.HorizontalAlignment.CenterContinuous || C === ve.HorizontalAlignment.Fill,
|
|
1601
|
-
|
|
1602
|
-
}, [Ne]),
|
|
1601
|
+
}).update({ state: x, label: () => x ? "Unprotect Sheet" : "Protect Sheet", scopedLabels: { sheet: x ? "Unprotect" : "Protect" } }), h.getCommand("deleteTable").update(f), h.getCommand("sortAscending").update(f), h.getCommand("sortDescending").update(f), h.getCommand("sortCustom")?.update(f), h.getCommand("updateComments").update(f), h.getCommand("deleteComments").update(f), h.getCommand("insertChart")?.update(f), h.getCommand("insertImageFromFile").update(f), h.getCommand("insertImageFromURL").update(f), h.getCommand("formatBorder").update(f), h.getCommand("formatFillColor").update(f), h.getCommand("formatFontColor").update(f), h.getCommand("formatBoldToggle").update(f), h.getCommand("formatItalicToggle").update(f), h.getCommand("formatUnderlinedToggle").update(f), h.getCommand("formatStrikeThroughToggle").update(f), h.getCommand("formatSuperscriptToggle").update(f), h.getCommand("formatSubscriptToggle").update(f), h.getCommand("formatAlignTopToggle").update(f), h.getCommand("formatTextOverflowVisibleToggle").update(f), h.getCommand("formatTextOverflowWrapToggle").update(f), h.getCommand("formatTextOverflowClipToggle").update(f), h.getCommand("formatTextOverflowShrinkToggle").update(f), h.getCommand("formatAlignMiddleToggle").update(f), h.getCommand("formatAlignBottomToggle").update(f), h.getCommand("formatAlignDistributedVerticalToggle").update(f), h.getCommand("formatAlignJustifyVerticalToggle").update(f), h.getCommand("formatAlignLeftToggle").update(f), h.getCommand("formatAlignCenterToggle").update(f), h.getCommand("formatAlignRightToggle").update(f), h.getCommand("formatAlignJustifyToggle").update(f), h.getCommand("formatAlignCenterContinuousToggle").update(f), h.getCommand("formatAlignDistributedHorizontalToggle").update(f), h.getCommand("formatAlignFillToggle").update(f), h.getCommand("formatFontSizeIncrease").update(f), h.getCommand("formatFontSizeDecrease").update(f), h.getCommand("formatFontFamily").update(f), h.getCommand("formatFontSize").update(f), h.getCommand("formatNumberFormat").update(f), h.getCommand("formatNumberFormatGeneralStyle").update(f), h.getCommand("formatNumberFormatNumberStyle").update(f), h.getCommand("formatNumberFormatTimeStyle").update(f), h.getCommand("formatNumberFormatDateStyle").update(f), h.getCommand("formatNumberFormatAccountingStyle").update(f), h.getCommand("formatNumberFormatPercentStyle").update(f), h.getCommand("formatNumberFormatScientificStyle").update(f), h.getCommand("formatNumberFormatCommaStyle").update(f), h.getCommand("formatNumberFormatIncreaseDecimal").update(f), h.getCommand("formatNumberFormatDecreaseDecimal").update(f), h.getCommand("hideColumns").update(f), h.getCommand("unhideColumns").update(f), h.getCommand("hideRows").update(f), h.getCommand("unhideRows").update(f), h.getCommand("insertFunctionSum").update(f), h.getCommand("insertFunctionAverage").update(f), h.getCommand("insertFunctionCount").update(f), h.getCommand("insertFunctionMax").update(f), h.getCommand("insertFunctionMin").update(f), h.getCommand("insertFunction").update(f), h.getCommand("startEditCurrentTime").update(f), h.getCommand("startEditCurrentDate").update(f), h.getCommand("startEditValueAbove").update(f), h.getCommand("fillDown").update(f), h.getCommand("fillRight").update(f), h.getCommand("fillUp").update(f), h.getCommand("fillLeft").update(f), h.getCommand("formatCellStyle").update(f), h.getCommand("formatTableStyle").update(f), h.getCommand("formatPainterToggle").update(f), h.getCommand("formatBorderAddOutline").update(f), h.getCommand("formatBorderClearOutline").update(f), h.getCommand("formatIndentDecrease").update(f), h.getCommand("formatIndentIncrease").update(f), h.getCommand("clearContents").update(f), h.getCommand("clearFormats").update(f), h.getCommand("clearAll").update(f), h.getCommand("clearComments").update(f), h.getCommand("clearHyperlinks").update(f), h.getCommand("autoFilterClear").update(f), h.getCommand("autoFilterReapply").update(f);
|
|
1602
|
+
const I = C === ve.HorizontalAlignment.CenterContinuous || C === ve.HorizontalAlignment.Fill, m = { disabled: R || I };
|
|
1603
|
+
h.getCommand("formatTextRotate0").update(m), h.getCommand("formatTextRotate45").update(m), h.getCommand("formatTextRotate90").update(m), h.getCommand("formatTextRotate270").update(m), h.getCommand("formatTextRotate315").update(m), h.getCommand("formatTextRotateCustom").update(m), h.getCommand("formatTextRotateVertical").update(m);
|
|
1604
|
+
}, [Ne]), h;
|
|
1603
1605
|
}
|
|
1604
1606
|
var yr, br;
|
|
1605
1607
|
(function() {
|
|
@@ -1631,28 +1633,28 @@ var yr, br;
|
|
|
1631
1633
|
yr = function(b, D, E) {
|
|
1632
1634
|
var G, H, w, L, q, v, S = 0, F = !1, T = !1, M = !0;
|
|
1633
1635
|
if (typeof b != "function") throw new TypeError("Expected a function");
|
|
1634
|
-
function j(
|
|
1636
|
+
function j(ne) {
|
|
1635
1637
|
var z = G, A = H;
|
|
1636
|
-
return G = H = void 0, S =
|
|
1638
|
+
return G = H = void 0, S = ne, L = b.apply(A, z);
|
|
1637
1639
|
}
|
|
1638
|
-
function U(
|
|
1639
|
-
var z =
|
|
1640
|
-
return v === void 0 || z >= D || z < 0 || T &&
|
|
1640
|
+
function U(ne) {
|
|
1641
|
+
var z = ne - v;
|
|
1642
|
+
return v === void 0 || z >= D || z < 0 || T && ne - S >= w;
|
|
1641
1643
|
}
|
|
1642
1644
|
function B() {
|
|
1643
|
-
var
|
|
1644
|
-
if (U(
|
|
1645
|
+
var ne = d();
|
|
1646
|
+
if (U(ne)) return O(ne);
|
|
1645
1647
|
q = setTimeout(B, function(z) {
|
|
1646
1648
|
var A = D - (z - v);
|
|
1647
1649
|
return T ? y(A, w - (z - S)) : A;
|
|
1648
|
-
}(
|
|
1650
|
+
}(ne));
|
|
1649
1651
|
}
|
|
1650
|
-
function O(
|
|
1651
|
-
return q = void 0, M && G ? j(
|
|
1652
|
+
function O(ne) {
|
|
1653
|
+
return q = void 0, M && G ? j(ne) : (G = H = void 0, L);
|
|
1652
1654
|
}
|
|
1653
1655
|
function W() {
|
|
1654
|
-
var
|
|
1655
|
-
if (G = arguments, H = this, v =
|
|
1656
|
+
var ne = d(), z = U(ne);
|
|
1657
|
+
if (G = arguments, H = this, v = ne, z) {
|
|
1656
1658
|
if (q === void 0) return function(A) {
|
|
1657
1659
|
return S = A, q = setTimeout(B, D), F ? j(A) : L;
|
|
1658
1660
|
}(v);
|
|
@@ -1766,7 +1768,7 @@ const ml = ft(wt((e, t) => {
|
|
|
1766
1768
|
}, [v, S] = ue(q), [F, T] = ue(null), [M, j] = ue(!1), U = r === an.Vertical ? l.getRowHeaders() : l.getColumnHeaders(), B = () => {
|
|
1767
1769
|
const Y = l.getUsedRange()?.getCoords() ?? qt.EmptyRange, _ = l.getSelection().getCoords().cell;
|
|
1768
1770
|
return { colIndex: Math.max(Y.colEnd, _.colIndex), rowIndex: Math.max(Y.rowEnd, _.rowIndex) };
|
|
1769
|
-
}, [O, W] = ue(B),
|
|
1771
|
+
}, [O, W] = ue(B), ne = O ? (r === an.Vertical ? O.rowIndex : O.colIndex) + 1 : 0, z = () => {
|
|
1770
1772
|
const Y = B();
|
|
1771
1773
|
qt.isEqualCells(O, Y) || W(Y);
|
|
1772
1774
|
};
|
|
@@ -1781,9 +1783,9 @@ const ml = ft(wt((e, t) => {
|
|
|
1781
1783
|
}, [s, w, v, r, F, U, M, l]);
|
|
1782
1784
|
const A = ie((Y, _, be) => {
|
|
1783
1785
|
L(Y);
|
|
1784
|
-
const Ae = Y + v.scroll, we = _ + v.shift,
|
|
1785
|
-
c?.(Ae, we,
|
|
1786
|
-
}, [c, v]), P = s - v.scroll, $ = d - v.shift, ge = y - (v.shift + v.scroll), ae = U.findOffset(
|
|
1786
|
+
const Ae = Y + v.scroll, we = _ + v.shift, Ze = be + v.shift + v.scroll;
|
|
1787
|
+
c?.(Ae, we, Ze);
|
|
1788
|
+
}, [c, v]), P = s - v.scroll, $ = d - v.shift, ge = y - (v.shift + v.scroll), ae = U.findOffset(ne) * (l.getView().getZoomScale() / 100) - (v.scroll + v.shift);
|
|
1787
1789
|
return p(ii, { ref: E, style: n, offset: P, viewportSize: $, totalSize: ge, orientation: r, showCustomScrollButtons: g, onMouseDown: (Y) => {
|
|
1788
1790
|
T({ anchor: { x: Y.clientX, y: Y.clientY } }), Y.preventDefault();
|
|
1789
1791
|
}, onScrollOffset: A, onMouseOut: () => {
|
|
@@ -1805,7 +1807,7 @@ const Tr = (e, t, n = null) => {
|
|
|
1805
1807
|
Bt(() => {
|
|
1806
1808
|
O.current = !0;
|
|
1807
1809
|
}, [n]);
|
|
1808
|
-
const W = Ce(() => n.getEntireRange().getCoords().max + 1, [n]),
|
|
1810
|
+
const W = Ce(() => n.getEntireRange().getCoords().max + 1, [n]), ne = Ce(() => {
|
|
1809
1811
|
const N = S === qe.Orientation.Column;
|
|
1810
1812
|
return { left: N ? L.left : 0, top: N ? 0 : L.top };
|
|
1811
1813
|
}, [L]), [z, A] = ue(B?.getView().getZoomScale() / 100), [P, $] = ue(null);
|
|
@@ -1828,12 +1830,12 @@ const Tr = (e, t, n = null) => {
|
|
|
1828
1830
|
}, [S, z, i]), Bt(() => {
|
|
1829
1831
|
$(null), A(n?.getSheet().getView().getZoomScale() / 100), Ie(ye());
|
|
1830
1832
|
}, [n]);
|
|
1831
|
-
const be = Xe((N) => n.at(N)?.isHidden() || n.at(N)?.getSize() === 0, [n]), Ae = Xe((N, K) => n.hiddenHeadersAt(N, K), [be]), we = ie((N) => n.isSelected(N), [n]),
|
|
1833
|
+
const be = Xe((N) => n.at(N)?.isHidden() || n.at(N)?.getSize() === 0, [n]), Ae = Xe((N, K) => n.hiddenHeadersAt(N, K), [be]), we = ie((N) => n.isSelected(N), [n]), Ze = ie((N) => n.isSelectedAll(N), [n]), he = Xe(() => n.getMinSize(), [n]), Ke = Xe(() => n.getMaxSize(), [n]), De = ie((N, K, a) => {
|
|
1832
1834
|
K /= z;
|
|
1833
|
-
const x = { size: K = Math.max(he(), Math.min(rt.roundAccurately(K, he()),
|
|
1835
|
+
const x = { size: K = Math.max(he(), Math.min(rt.roundAccurately(K, he()), Ke())), hidden: !1 }, R = [];
|
|
1834
1836
|
if (K <= 0 && (x.hidden = !0, x.size = a), R.push({ address: { min: N, max: N }, update: x }), K < 0) {
|
|
1835
|
-
const f = S === qe.Orientation.Column, I = f ? Te.getColOffset : Te.getRowOffset,
|
|
1836
|
-
let Z =
|
|
1837
|
+
const f = S === qe.Orientation.Column, I = f ? Te.getColOffset : Te.getRowOffset, m = f ? Te.getColIndex : Te.getRowIndex, V = I(N);
|
|
1838
|
+
let Z = m(V + K);
|
|
1837
1839
|
const ee = I(Z);
|
|
1838
1840
|
ee === V + K ? Z-- : R.push({ address: { min: Z, max: Z }, update: { size: V - ee + K } }), N - Z > 1 && R.push({ address: { min: Z + 1, max: N - 1 }, update: { hidden: !0 } });
|
|
1839
1841
|
}
|
|
@@ -1844,13 +1846,13 @@ const Tr = (e, t, n = null) => {
|
|
|
1844
1846
|
if (n.isSelectedAll(N)) {
|
|
1845
1847
|
const I = n.getSelectedRuns();
|
|
1846
1848
|
I.length > 1 ? R = "Resize " + (x ? "Columns" : "Rows") : f = I[0];
|
|
1847
|
-
const
|
|
1848
|
-
n.updateHeaderPairs(Tr(I,
|
|
1849
|
+
const m = { hidden: K <= 0, size: (K <= 0 ? a : K) / z };
|
|
1850
|
+
n.updateHeaderPairs(Tr(I, m, N));
|
|
1849
1851
|
}
|
|
1850
1852
|
if (f) {
|
|
1851
1853
|
const I = f.max - f.min + 1;
|
|
1852
|
-
let
|
|
1853
|
-
|
|
1854
|
+
let m;
|
|
1855
|
+
m = I === 1 ? n.getRange(f).at(0).getDisplayText() : n.getRange(f).toString(), R = `Resize ${x ? "Column" : "Row"}${I > 1 ? "s" : ""} '${m}'`;
|
|
1854
1856
|
}
|
|
1855
1857
|
G?.(N, K, R);
|
|
1856
1858
|
}, [T, n, G]), de = ie((N, K) => {
|
|
@@ -1858,48 +1860,48 @@ const Tr = (e, t, n = null) => {
|
|
|
1858
1860
|
D(N, K, `Resize ${a ? "Column" : "Row"}(s)`);
|
|
1859
1861
|
}, [D]), me = ie((N) => {
|
|
1860
1862
|
let K = !1;
|
|
1861
|
-
const a = S === qe.Orientation.Column, x = n.getSheet().getEntireRange().getCoords(), R = [], f = n.getSelectedRuns(), I = (
|
|
1863
|
+
const a = S === qe.Orientation.Column, x = n.getSheet().getEntireRange().getCoords(), R = [], f = n.getSelectedRuns(), I = (m) => {
|
|
1862
1864
|
let V;
|
|
1863
|
-
V = a ? { colStart:
|
|
1865
|
+
V = a ? { colStart: m.min, rowStart: x.rowStart, colEnd: m.max, rowEnd: x.rowEnd } : { colStart: x.colStart, rowStart: m.min, colEnd: x.colEnd, rowEnd: m.max }, R.push(V);
|
|
1864
1866
|
};
|
|
1865
|
-
for (let
|
|
1866
|
-
const V = f[
|
|
1867
|
+
for (let m = 0; m < f.length; m++) {
|
|
1868
|
+
const V = f[m];
|
|
1867
1869
|
V.value.isSelectedAll && (V.min <= N && V.max >= N && (K = !0), I(V));
|
|
1868
1870
|
}
|
|
1869
1871
|
if (K || I({ min: N, max: N }), n.getSheet().getRanges(R).autoFit({ orientations: a ? qe.Orientations.Column : qe.Orientations.Row }), be(N)) {
|
|
1870
|
-
const
|
|
1871
|
-
K || V.push({ address: N, update:
|
|
1872
|
+
const m = { hidden: null }, V = Tr(f, m);
|
|
1873
|
+
K || V.push({ address: N, update: m }), n.updateHeaderPairs(V);
|
|
1872
1874
|
}
|
|
1873
1875
|
G?.(N, null, "Resize Column(s)");
|
|
1874
1876
|
}, [T, n, G, be]), ye = () => {
|
|
1875
1877
|
const N = S === qe.Orientation.Column;
|
|
1876
1878
|
return { getColOffset: (K) => N ? n.findOffset(K) : K === 0 ? 0 : i / z, getColIndex: (K) => N ? n.findIndex(K) : 0, getRowOffset: (K) => N ? K === 0 ? 0 : i / z : n.findOffset(K), getRowIndex: (K) => N ? 0 : n.findIndex(K) };
|
|
1877
|
-
}, [Te, Ie] = ue(() => ye()), xe = Xe((N, K) => N.nativeEvent.which !== rl.Right || !
|
|
1879
|
+
}, [Te, Ie] = ue(() => ye()), xe = Xe((N, K) => N.nativeEvent.which !== rl.Right || !Ze(S === qe.Orientation.Column ? K.colIndex : K.rowIndex), [S, Ze]), Ne = ie((N) => {
|
|
1878
1880
|
l.focusSheet();
|
|
1879
1881
|
}, [l]), Pe = ie((N) => {
|
|
1880
1882
|
B?.getSelection().updateCoords(N);
|
|
1881
|
-
}, [B]), { ...
|
|
1883
|
+
}, [B]), { ..._e } = il({ gridRef: r, commands: null, layout: Te, selection: Y, fillHandleBorderColor: d.body.fill, selectionBackgroundColor: d.selection.fill, selectionBorderColor: d.selection.strokeFill, selectionRemoveBackgroundColor: d.selectionRemove.fill, selectionRemoveBorderColor: d.selectionRemove.strokeFill, disableTouchSelection: !0, onSelectionChange: Pe, canSelectionSpanMergedCells: (N) => {
|
|
1882
1884
|
const K = B.getRange(N);
|
|
1883
1885
|
return K.isEntireColumns() || K.isEntireRows();
|
|
1884
|
-
} }),
|
|
1886
|
+
} }), h = ie(() => {
|
|
1885
1887
|
q?.();
|
|
1886
1888
|
const N = B?.getSelection();
|
|
1887
1889
|
N && N.setAdjusting(N.getCoords());
|
|
1888
|
-
}, [B, q]),
|
|
1890
|
+
}, [B, q]), je = ie(async () => {
|
|
1889
1891
|
B?.getSelection().setAdjusting(null), v?.();
|
|
1890
|
-
}, [B, v]), { ...ut } = yi({ orientation: S, headerCount: W, gridRef: F, gridMainRef: r, newSelection:
|
|
1892
|
+
}, [B, v]), { ...ut } = yi({ orientation: S, headerCount: W, gridRef: F, gridMainRef: r, newSelection: _e?.newSelection, modifySelection: _e?.modifySelection, appendSelection: _e?.appendSelection, clearSelections: _e?.clearSelections, pointerDownInterceptor: xe, onPointerUp: Ne, onDragStart: h, onDragEnd: je }), Qe = d.selection?.strokeFill;
|
|
1891
1893
|
Se(() => {
|
|
1892
1894
|
if (!F.current) return void $(null);
|
|
1893
|
-
const N = S === qe.Orientation.Column, K = n.getSelectedRuns(), a = n.isProtected() ? null : De, x = (f, I,
|
|
1894
|
-
if (
|
|
1895
|
-
}, R = (f, I,
|
|
1895
|
+
const N = S === qe.Orientation.Column, K = n.getSelectedRuns(), a = n.isProtected() ? null : De, x = (f, I, m) => {
|
|
1896
|
+
if (m) return p("div", N ? { style: { position: "absolute", borderBottom: `${d.headerSelection.strokeWidth}px solid ${Qe}`, pointerEvents: "none", top: `${it.boundPixel(-d.headerSelection.strokeWidth / 2)}px`, left: `${it.boundPixel(m.x - d.headerSelection.strokeWidth)}px`, width: `${it.boundPixel(m.width + d.headerSelection.strokeWidth + 1, !0)}px`, height: i + d.headerSelection.strokeWidth - 0.5 + "px" } } : { style: { position: "absolute", borderRight: `${d.headerSelection.strokeWidth}px solid ${Qe}`, pointerEvents: "none", top: `${it.boundPixel(m.y - d.headerSelection.strokeWidth)}px`, left: `${it.boundPixel(-d.headerSelection.strokeWidth / 2)}px`, width: i + d.headerSelection.strokeWidth - 0.5 + "px", height: `${it.boundPixel(m.height + d.headerSelection.strokeWidth + 1, !0)}px` } }, f);
|
|
1897
|
+
}, R = (f, I, m) => {
|
|
1896
1898
|
const V = { x: 0, y: 0, width: 0, height: 0 };
|
|
1897
1899
|
if (N) {
|
|
1898
|
-
const Z =
|
|
1900
|
+
const Z = m.toClipBounds(m.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: f, colEnd: Math.min(W, I) }), jo);
|
|
1899
1901
|
if (!Z) return;
|
|
1900
1902
|
V.x = Z.x, V.width = Z.width;
|
|
1901
1903
|
} else {
|
|
1902
|
-
const Z =
|
|
1904
|
+
const Z = m.toClipBounds(m.getRangeCoordsBounds({ rowStart: f, rowEnd: Math.min(W, I), colStart: 0, colEnd: 0 }), jo);
|
|
1903
1905
|
if (!Z) return;
|
|
1904
1906
|
V.y = Z.y, V.height = Z.height;
|
|
1905
1907
|
}
|
|
@@ -1907,29 +1909,29 @@ const Tr = (e, t, n = null) => {
|
|
|
1907
1909
|
};
|
|
1908
1910
|
$([(f) => {
|
|
1909
1911
|
const I = [];
|
|
1910
|
-
let
|
|
1912
|
+
let m = null, V = N ? f.getVisibleColumns() : f.getVisibleRows();
|
|
1911
1913
|
const Z = N ? f.getTotalRangeCoords().colStart : f.getTotalRangeCoords().rowStart;
|
|
1912
1914
|
V.length > 0 && V[0] > Z && (V = [V[0] - 1, ...V]);
|
|
1913
1915
|
let ee = [];
|
|
1914
1916
|
const re = [];
|
|
1915
1917
|
for (let fe = 0; fe < V.length; fe++) {
|
|
1916
1918
|
const Me = V[fe], We = fe < V.length - 1 ? V[fe + 1] : Me + Ae(Me + 1, !1) + 1, Be = Me + 1 !== We;
|
|
1917
|
-
if (!
|
|
1919
|
+
if (!m || m.max < Me) if (K.length > 0 && K[K.length - 1].max >= Me) {
|
|
1918
1920
|
const nt = rt.findEqualOrGreater(K, Me, (He) => He.max);
|
|
1919
|
-
|
|
1920
|
-
} else
|
|
1921
|
+
m = K[nt];
|
|
1922
|
+
} else m = null;
|
|
1921
1923
|
let et = !1, $e = !1;
|
|
1922
|
-
if (
|
|
1924
|
+
if (m?.value && (m.min <= Me || m.min <= We && !Be) && (et = !0, $e = m.value.isSelectedAll), Me === Z) {
|
|
1923
1925
|
let nt = !1, He = !1;
|
|
1924
|
-
|
|
1926
|
+
m?.value && m.min <= Me && (nt = !0, He = m.value.isSelectedAll), Me > 0 && re.push({ index: Me - 1, isNextHidden: Be, isSelected: nt, isSelectedAll: He, disabledResize: !0 });
|
|
1925
1927
|
}
|
|
1926
1928
|
if ($e && ee.push(re.length), re.push({ index: Me, isHidden: fe === 0 && Ae(Me, !1) > 0, isNextHidden: Be, isSelected: et, isSelectedAll: $e, onDividerMouseDown: H, onDividerResizeStart: de, onDividerResize: a, onDividerMouseUp: w, onDividerResizeEnd: ce, onDividerAutoFit: me }), Be) {
|
|
1927
1929
|
let nt = !1, He = !1;
|
|
1928
|
-
if (
|
|
1930
|
+
if (m && m.min >= Me && m.max <= We - 1 && m.value.isSelectedAll && ee.push(re.length), !(m?.value && m.max >= We)) if (K.length > 0 && K[K.length - 1].max >= We) {
|
|
1929
1931
|
const at = rt.findEqualOrGreater(K, We, (Ct) => Ct.max);
|
|
1930
|
-
|
|
1931
|
-
} else
|
|
1932
|
-
|
|
1932
|
+
m = K[at];
|
|
1933
|
+
} else m = null;
|
|
1934
|
+
m?.value && m.min <= We && (nt = m.value.isSelected, He = m.value.isSelectedAll), We > 0 && re.push({ index: We - 1, isHidden: !0, isSelected: nt, isSelectedAll: He, onDividerMouseDown: H, onDividerResizeStart: de, onDividerResize: a, onDividerMouseUp: w, onDividerResizeEnd: ce, onDividerAutoFit: me });
|
|
1933
1935
|
}
|
|
1934
1936
|
}
|
|
1935
1937
|
if (ee.length > 0) {
|
|
@@ -1950,15 +1952,15 @@ const Tr = (e, t, n = null) => {
|
|
|
1950
1952
|
return I;
|
|
1951
1953
|
}, (f) => {
|
|
1952
1954
|
const I = [];
|
|
1953
|
-
for (let
|
|
1955
|
+
for (let m = 0; K && m < K.length; m++) I.push(x(`selection:${f.getAnchor()}:${m}`, 0, R(K[m].min, K[m].max, f)));
|
|
1954
1956
|
return I;
|
|
1955
1957
|
}]);
|
|
1956
1958
|
}, [j, !0, Qe, d, Te, W, y, T, z]), Se(() => {
|
|
1957
1959
|
F.current?.invalidate();
|
|
1958
1960
|
}, [T]);
|
|
1959
1961
|
const X = ie((N) => s ? s(N) : n.getTextAt(N), [s, n]), Le = ie((N) => {
|
|
1960
|
-
const { header: K, headerSelect: a, headerSelectAll: x, headerHover: R } = d ?? {}, { range: f, key: I, ...
|
|
1961
|
-
return p(bi, { orientation: S, index: S === qe.Orientation.Column ? f.colStart : f.rowStart, isSelected: we, isSelectedAll:
|
|
1962
|
+
const { header: K, headerSelect: a, headerSelectAll: x, headerHover: R } = d ?? {}, { range: f, key: I, ...m } = N;
|
|
1963
|
+
return p(bi, { orientation: S, index: S === qe.Orientation.Column ? f.colStart : f.rowStart, isSelected: we, isSelectedAll: Ze, zoomScale: 100 * z, headerText: X, headerStyle: K, headerStyleSelect: a, headerStyleSelectAll: x, headerStyleHover: R, verticalPadding: u, horizontalPadding: k, ...m }, I);
|
|
1962
1964
|
}, [T, W, d, z, n]), Ge = un(), Fe = Ce(() => {
|
|
1963
1965
|
const N = "white", K = "black", a = {};
|
|
1964
1966
|
if (it.detectIt().primaryInput !== "touch") {
|
|
@@ -1979,8 +1981,8 @@ const Tr = (e, t, n = null) => {
|
|
|
1979
1981
|
b({ originalEvent: N, clientX: N.clientX, clientY: N.clientY, rowIndex: a ? -1 : K.rowIndex, colIndex: a ? K.colIndex : -1 }), N.stopPropagation(), N.preventDefault();
|
|
1980
1982
|
}, [ut, b]), oe = Ce(() => {
|
|
1981
1983
|
const N = S === qe.Orientation.Column;
|
|
1982
|
-
return p("div", { ref: Ve, children: p(al, { className: "sheet-header", style: Fe, ref: F, scrollPoint:
|
|
1983
|
-
}, [P, Te, c, g,
|
|
1984
|
+
return p("div", { ref: Ve, children: p(al, { className: "sheet-header", style: Fe, ref: F, scrollPoint: ne, columnCount: N ? W : 1, rowCount: N ? 1 : W, width: N ? c : i, height: N ? i : g, freezeLeft: N ? y : void 0, freezeTop: N ? void 0 : y, hiddenColumnsAt: N ? Ae : void 0, hiddenRowsAt: N ? void 0 : Ae, showGridLines: !1, layout: Te, clipCells: !1, allowOverlaysOverflow: !0, enableMouseWheel: !1, onContextMenu: C, onPointerDown: Oe, zoom: z, cellRenderer: Le, overlays: P }) });
|
|
1985
|
+
}, [P, Te, c, g, ne, Fe, j]);
|
|
1984
1986
|
return Se(() => {
|
|
1985
1987
|
O.current = !1, F.current?.invalidate(), U();
|
|
1986
1988
|
}, [n, d]), oe;
|
|
@@ -2027,7 +2029,7 @@ const Tr = (e, t, n = null) => {
|
|
|
2027
2029
|
if (!r) return;
|
|
2028
2030
|
const S = [new J("pasteValues", v, { label: "Paste Values", scopedLabels: { paste: "Values" }, description: `Paste only the values of the selected cells.
|
|
2029
2031
|
|
|
2030
|
-
The formatting is not applied.`, shortcut: { key: "V", modifiers: [
|
|
2032
|
+
The formatting is not applied.`, shortcut: { key: "V", modifiers: [te.Ctrl, te.Shift] } }), new J("pasteFormats", v, { label: "Paste Formatting", scopedLabels: { paste: "Formatting" }, description: `Paste only the formats of the selected cells.
|
|
2031
2033
|
|
|
2032
2034
|
The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formulas", scopedLabels: { paste: "Formulas" }, description: "Paste only the formulas of the selected cells. The values and formatting is not applied." }), new J("pasteTranspose", v, { label: "Paste Transpose", scopedLabels: { paste: "Transpose" }, description: "Paste with the rows and columns flipped." }), new J("pasteLinks", v, { label: "Paste Links", scopedLabels: { paste: "Links" }, description: "Paste as formula references to the original cells." })];
|
|
2033
2035
|
r.addCommands(S, !0);
|
|
@@ -2046,8 +2048,8 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2046
2048
|
return U && U.length !== 0 ? (B) => {
|
|
2047
2049
|
const O = [];
|
|
2048
2050
|
for (let W = 0; W < U.length; W++) {
|
|
2049
|
-
const
|
|
2050
|
-
z && (O.push(k({ range:
|
|
2051
|
+
const ne = U[W], z = B.toClipBounds(B.getRangeCoordsBounds(ne, { top: 0, left: 0, right: 1, bottom: 1 }), jo);
|
|
2052
|
+
z && (O.push(k({ range: ne, key: `copy-selection-background-${W}`, x: z.x, y: z.y, width: Math.max(z.width, 0), height: Math.max(z.height, 0), stroke: T, strokeWidth: 2 })), O.push(k({ range: ne, key: `copy-selection-foreground-${W}`, x: z.x + (z.width <= 2 ? -1 : 0), y: z.y, width: Math.max(z.width, 3), height: Math.max(z.height, 3), stroke: M, strokeWidth: 2, isAnimatedStroke: !0 })));
|
|
2051
2053
|
}
|
|
2052
2054
|
return O;
|
|
2053
2055
|
} : null;
|
|
@@ -2079,7 +2081,7 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2079
2081
|
case qe.Direction.Right:
|
|
2080
2082
|
return xe.colEnd;
|
|
2081
2083
|
}
|
|
2082
|
-
}, [s]),
|
|
2084
|
+
}, [s]), ne = ie(() => {
|
|
2083
2085
|
const ce = s.getUsedRange()?.getCoords(), de = s.getRowHeaders().getUsedRange()?.getCoords(), me = s.getColumnHeaders().getUsedRange()?.getCoords();
|
|
2084
2086
|
return { ...ce, colEnd: Math.max(ce?.colEnd ?? 0, me?.max ?? 0), rowEnd: Math.max(ce?.rowEnd ?? 0, de?.max ?? 0) };
|
|
2085
2087
|
}, [s]), z = ie((ce, de) => s.getRowHeaders().hiddenHeadersAt(ce, de), [s]), A = ie((ce, de) => s.getColumnHeaders().hiddenHeadersAt(ce, de), [s]), P = ie((ce) => s.getRange(ce, { excludeHidden: !0 }).getMerges(), [s]), $ = ie((ce) => {
|
|
@@ -2098,7 +2100,7 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2098
2100
|
} }), ht(s, { onProtectionChange: () => {
|
|
2099
2101
|
F(s.getProtection().isLocked());
|
|
2100
2102
|
} });
|
|
2101
|
-
const { body: Y = {} } = d || {}, _ = n.getLayout(), be = !(U && H.ranges.length <= 1 && k === null && !S && (!q.getMode() || ae)), { cursor: Ae, overlay: we, onPointerDown:
|
|
2103
|
+
const { body: Y = {} } = d || {}, _ = n.getLayout(), be = !(U && H.ranges.length <= 1 && k === null && !S && (!q.getMode() || ae)), { cursor: Ae, overlay: we, onPointerDown: Ze } = il({ gridRef: y, commands: r, layout: _, getCellCoordsAsRangeCoords: O, selection: H, fillHandleBorderColor: Y.fill, selectionBackgroundColor: u ? d.selection.fill : d.selectionInactive.fill, selectionBorderColor: u ? d.selection.strokeFill : d.selectionInactive.strokeFill, selectionRemoveBackgroundColor: u ? d.selectionRemove.fill : d.selectionInactive.fill, selectionRemoveBorderColor: u ? d.selectionRemove.strokeFill : d.selectionInactive.strokeFill, disableFillDrag: be, disableMoveDrag: j || !(u && H.ranges.length <= 1 && k === null && !S), disableTouchSelection: B, onSelectionChange: L, onSelectionDragStart: $, onSelectionDragEnd: ge, onMoveDragStart: (ce, de, me) => {
|
|
2102
2104
|
q.setMode(Dr(0, me));
|
|
2103
2105
|
}, onMoveDragUpdate: (ce, de, me) => {
|
|
2104
2106
|
q.setMode(Dr(0, me));
|
|
@@ -2109,9 +2111,10 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2109
2111
|
const ye = s.getRange(de);
|
|
2110
2112
|
if (i?.showOptions) {
|
|
2111
2113
|
const Pe = ye.getDifferences(ce);
|
|
2112
|
-
let
|
|
2113
|
-
|
|
2114
|
-
|
|
2114
|
+
let _e = !1;
|
|
2115
|
+
const h = Pe.getCount();
|
|
2116
|
+
for (let je = 0; !_e && je < h; je++) _e = Pe.at(je).isContentful();
|
|
2117
|
+
if (_e && await i?.showOptions({ title: "Confirm", description: "There is already data here. Do you want to replace it?", options: ["Replace", "Cancel"], defaultOption: "Replace" }) !== "Replace")
|
|
2115
2118
|
return;
|
|
2116
2119
|
}
|
|
2117
2120
|
const Te = !me.ctrlKey, Ie = me.shiftKey, xe = Ie ? Te ? "Insert Moved Cells" : "Insert Copied Cells" : Te ? "Move Cells" : "Copy Cells", Ne = await i?.showBusy?.(xe);
|
|
@@ -2125,7 +2128,7 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2125
2128
|
} finally {
|
|
2126
2129
|
Ne?.();
|
|
2127
2130
|
}
|
|
2128
|
-
}, contentfulCellFinder: W, hiddenRowsAt: z, hiddenColumnsAt: A, mergedRanges: P, getDataCoords:
|
|
2131
|
+
}, contentfulCellFinder: W, hiddenRowsAt: z, hiddenColumnsAt: A, mergedRanges: P, getDataCoords: ne, canSelectionSpanMergedCells: (ce) => {
|
|
2129
2132
|
const de = s.getRange(ce);
|
|
2130
2133
|
return de.isEntireColumns() || de.isEntireRows();
|
|
2131
2134
|
}, onFill: async (ce, de) => {
|
|
@@ -2143,33 +2146,33 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2143
2146
|
if (y.current && E) {
|
|
2144
2147
|
q.setMode(la);
|
|
2145
2148
|
try {
|
|
2146
|
-
v.current?.direction !== me && (v.current = null, s.getRange(ce).autoFill(de, { previewOnly: (
|
|
2147
|
-
v.current = { callback:
|
|
2149
|
+
v.current?.direction !== me && (v.current = null, s.getRange(ce).autoFill(de, { previewOnly: (h) => {
|
|
2150
|
+
v.current = { callback: h, direction: me };
|
|
2148
2151
|
} }));
|
|
2149
2152
|
const ye = v.current?.callback?.(de);
|
|
2150
2153
|
if (!ye || ye.isEmpty()) return;
|
|
2151
2154
|
const Te = ye.toText();
|
|
2152
2155
|
if (!Te) return;
|
|
2153
2156
|
const Ie = qt.cellToRange(ye.getCoords()), xe = n.getRelativePointFromClient(0, 0);
|
|
2154
|
-
let Ne = 0, Pe = 0,
|
|
2157
|
+
let Ne = 0, Pe = 0, _e = Ln.Bottom;
|
|
2155
2158
|
if (me === qe.Direction.Down) {
|
|
2156
2159
|
Ne = _.getColOffset(Ie.colEnd + 1) - xe.x;
|
|
2157
|
-
const
|
|
2158
|
-
Pe =
|
|
2160
|
+
const h = _.getRowOffset(Ie.rowEnd), je = _.getRowOffset(Ie.rowEnd + 1);
|
|
2161
|
+
Pe = je - (je - h) / 2 - xe.y, _e = Ln.Right;
|
|
2159
2162
|
} else if (me === qe.Direction.Right) {
|
|
2160
2163
|
Pe = _.getRowOffset(Ie.rowEnd + 1) - xe.y;
|
|
2161
|
-
const
|
|
2162
|
-
Ne =
|
|
2164
|
+
const h = _.getColOffset(Ie.colEnd), je = _.getColOffset(Ie.colEnd + 1);
|
|
2165
|
+
Ne = je - (je - h) / 2 - xe.x, _e = Ln.Bottom;
|
|
2163
2166
|
} else if (me === qe.Direction.Up) {
|
|
2164
2167
|
Ne = _.getColOffset(Ie.colEnd + 1) - xe.x;
|
|
2165
|
-
const
|
|
2166
|
-
Pe =
|
|
2168
|
+
const h = _.getRowOffset(Ie.rowStart), je = _.getRowOffset(Ie.rowStart + 1);
|
|
2169
|
+
Pe = je - (je - h) / 2 - xe.y, _e = Ln.Right;
|
|
2167
2170
|
} else if (me === qe.Direction.Left) {
|
|
2168
2171
|
Pe = _.getRowOffset(Ie.rowEnd + 1) - xe.y;
|
|
2169
|
-
const
|
|
2170
|
-
Ne =
|
|
2172
|
+
const h = _.getColOffset(Ie.colStart), je = _.getColOffset(Ie.colStart + 1);
|
|
2173
|
+
Ne = je - (je - h) / 2 - xe.x, _e = Ln.Bottom;
|
|
2171
2174
|
}
|
|
2172
|
-
E({ anchor: { x: Ne, y: Pe }, display: Te, placement:
|
|
2175
|
+
E({ anchor: { x: Ne, y: Pe }, display: Te, placement: _e });
|
|
2173
2176
|
} catch (ye) {
|
|
2174
2177
|
i?.showError?.(ye);
|
|
2175
2178
|
}
|
|
@@ -2177,16 +2180,16 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2177
2180
|
}, onFillDone: () => {
|
|
2178
2181
|
v.current = null, q.setMode(null), G?.();
|
|
2179
2182
|
} }), he = ie((ce) => {
|
|
2180
|
-
|
|
2181
|
-
}, [
|
|
2183
|
+
Ze(it.createSyntheticEvent(ce));
|
|
2184
|
+
}, [Ze, k]);
|
|
2182
2185
|
Se(() => {
|
|
2183
2186
|
const ce = n?.getStage();
|
|
2184
2187
|
if (ce) return ce.addEventListener("pointerdown", he), () => {
|
|
2185
2188
|
ce.removeEventListener("pointerdown", he);
|
|
2186
2189
|
};
|
|
2187
2190
|
}, [n?.getStage()]);
|
|
2188
|
-
const
|
|
2189
|
-
return p("div", { className: Vt(l, "sheet-selection", ea), style: { position: "absolute", width: D?.width, height: D?.height, overflow: "hidden", pointerEvents: "none", willChange: "none" }, ref: kn([
|
|
2191
|
+
const Ke = _t(t, () => ({}), []), De = Re(null);
|
|
2192
|
+
return p("div", { className: Vt(l, "sheet-selection", ea), style: { position: "absolute", width: D?.width, height: D?.height, overflow: "hidden", pointerEvents: "none", willChange: "none" }, ref: kn([Ke, De]), ...b, children: we(n) });
|
|
2190
2193
|
})), co = Object.freeze({ x: 0, y: 0, width: 0, height: 0 }), aa = { fireOnModelChange: !1 }, sa = ft(wt((e, t) => {
|
|
2191
2194
|
const { children: n, view: r, movable: l, onRefLoad: o, onRefUnload: i, onHide: c, onShow: g, onUnFocus: s, isDragging: y, updateFrameBounds: d, dragStart: u, style: k, disabled: b, renderMovable: D, ...E } = e, [G, H] = ue(co), [w, L] = ue(null), [q, v] = ue(!1), S = Re(null);
|
|
2192
2195
|
Bt(() => {
|
|
@@ -2223,11 +2226,11 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2223
2226
|
w && !S?.current?.contains(T.relatedTarget) && L(null), T.relatedTarget && v(!1);
|
|
2224
2227
|
}, ...E, children: F });
|
|
2225
2228
|
})), da = "_movable-area_314c6_5", ca = ft(wt((e, t) => {
|
|
2226
|
-
const { view: n, movables: r, movablesView: l, renderMovable: o, transactional: i, onUnFocus: c, onFocus: g, disabled: s = !1, disableDrag: y = !1, disableResize: d = !1, className: u, style: k, renderDirections: b = ["nw", "n", "ne", "w", "e", "sw", "s", "se"], onFirstRender: D, ...E } = e, G = n.getBounds(), H = ie(D, [D]), w = ie(c, [c]), L = ie(g, [g]), [q, v] = ue([]), [S, F] = ue(!1), [T, M] = ue(!1), j = Re(!0), U = Re(/* @__PURE__ */ new Map()), B = Re(/* @__PURE__ */ new Map()), O = Re(/* @__PURE__ */ new Map()), W = Re(/* @__PURE__ */ new Map()),
|
|
2229
|
+
const { view: n, movables: r, movablesView: l, renderMovable: o, transactional: i, onUnFocus: c, onFocus: g, disabled: s = !1, disableDrag: y = !1, disableResize: d = !1, className: u, style: k, renderDirections: b = ["nw", "n", "ne", "w", "e", "sw", "s", "se"], onFirstRender: D, ...E } = e, G = n.getBounds(), H = ie(D, [D]), w = ie(c, [c]), L = ie(g, [g]), [q, v] = ue([]), [S, F] = ue(!1), [T, M] = ue(!1), j = Re(!0), U = Re(/* @__PURE__ */ new Map()), B = Re(/* @__PURE__ */ new Map()), O = Re(/* @__PURE__ */ new Map()), W = Re(/* @__PURE__ */ new Map()), ne = Re(/* @__PURE__ */ new Map()), z = Re({ onRequestFocus: (X) => (de(X), null) }), A = Re(null), P = Re(null), $ = Re(null), [ge, ae] = sn((X) => X + 1, 0);
|
|
2227
2230
|
Bt(() => {
|
|
2228
2231
|
ae();
|
|
2229
2232
|
}, [n, r]), ht(r, { onCollectionChange: () => {
|
|
2230
|
-
const X = r.getItems({ address: n.getVisibleRangeCoords(), excludeHidden: !0 }), Le =
|
|
2233
|
+
const X = r.getItems({ address: n.getVisibleRangeCoords(), excludeHidden: !0 }), Le = ne.current;
|
|
2231
2234
|
Le.forEach((Fe) => {
|
|
2232
2235
|
Fe();
|
|
2233
2236
|
}), Le.clear();
|
|
@@ -2257,9 +2260,9 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2257
2260
|
}), v((Ge) => rt.isEqualArrays(Ge, X) ? Ge : X);
|
|
2258
2261
|
}, be = Re(null), Ae = Ce(() => new Promise((X) => {
|
|
2259
2262
|
be.current = X;
|
|
2260
|
-
}), []), we = Re(null),
|
|
2263
|
+
}), []), we = Re(null), Ze = ie(async (X, Le) => {
|
|
2261
2264
|
we.current = Le, await (async () => !(!await Ae.then() || !$.current))() && we.current === Le && $.current.dragStart(X, Le);
|
|
2262
|
-
}, [q]), [he,
|
|
2265
|
+
}, [q]), [he, Ke] = ue(!1), De = Re(null), ce = Re(null), de = ie(async (X = null) => {
|
|
2263
2266
|
if (X || (X = l.getMovableSelection()[0]), !X) return w?.(), !1;
|
|
2264
2267
|
const Le = O.current.get(X);
|
|
2265
2268
|
Le ? (await rt.whenFocus(Le), Le.focus(), ce.current = Le, De.current = null) : De.current = X;
|
|
@@ -2281,7 +2284,7 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2281
2284
|
oe.onShow = R;
|
|
2282
2285
|
}, isDragging: a && (T || S), disabled: s, renderMovable: o, updateFrameBounds: (R) => {
|
|
2283
2286
|
Y(C, R);
|
|
2284
|
-
}, dragStart:
|
|
2287
|
+
}, dragStart: Ze, onMouseUp: () => {
|
|
2285
2288
|
if (we.current = null, P.current) {
|
|
2286
2289
|
F(!1), M(!1);
|
|
2287
2290
|
let R = !1;
|
|
@@ -2341,22 +2344,22 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2341
2344
|
}, [xe.current]);
|
|
2342
2345
|
const Ne = _t(t, () => ({ isMovableArea: () => !0, focusMovable: de, focus: () => {
|
|
2343
2346
|
de();
|
|
2344
|
-
} }), [l]), [Pe,
|
|
2347
|
+
} }), [l]), [Pe, _e] = ue(null), h = Re(!1), je = Re(!1), ut = Re(!1);
|
|
2345
2348
|
Se(() => {
|
|
2346
|
-
if (s || q.length === 0 || ut.current ||
|
|
2347
|
-
if (
|
|
2349
|
+
if (s || q.length === 0 || ut.current || h.current) return;
|
|
2350
|
+
if (je.current) return void requestAnimationFrame(() => {
|
|
2348
2351
|
$.current && A.current && $.current.refTargets.length > 0 && (ut.current = !0, be.current?.(!0)), v([...q]);
|
|
2349
2352
|
});
|
|
2350
|
-
|
|
2353
|
+
h.current = !0;
|
|
2351
2354
|
const X = tt.lazy(async () => {
|
|
2352
2355
|
try {
|
|
2353
|
-
const Le = await import("./
|
|
2354
|
-
return
|
|
2356
|
+
const Le = await import("./Cyt8i0yMUhcyUi_X.mjs");
|
|
2357
|
+
return h.current = !1, je.current = !0, v([...q]), Le;
|
|
2355
2358
|
} catch (Le) {
|
|
2356
2359
|
return console.warn(Le), be.current?.(!1), null;
|
|
2357
2360
|
}
|
|
2358
2361
|
});
|
|
2359
|
-
|
|
2362
|
+
_e(X);
|
|
2360
2363
|
}, [q, s, y, d]);
|
|
2361
2364
|
const Qe = Ce(() => !Pe || s ? null : p(ll, { children: p(Pe, { className: Vt({ dragging: S || T, resizing: S, moving: T }), container: null, ref: $, target: $.current ? q : [], draggable: !s && !y, resizable: !s && !d, individualGroupable: !0, edgeDraggable: !1, throttleDrag: 2, throttleResize: 2, origin: !1, keepRatio: !1, renderDirections: b, onResizeStart: (X) => {
|
|
2362
2365
|
ye(X.target, "Resize");
|
|
@@ -2375,8 +2378,8 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2375
2378
|
Ve === 0 ? (Ge = R, Fe = f) : (N *= R / Ge, a *= R / Ge, K *= f / Fe, x *= f / Fe);
|
|
2376
2379
|
const I = { ...C.startBounds };
|
|
2377
2380
|
if (I.width = Math.max(0, R + N), I.height = Math.max(0, f + K), X.direction[0] === -1 && (I.width = Math.max(0, Math.min(C.startBounds.x + R, R - a))), X.direction[1] === -1 && (I.height = Math.max(0, Math.min(C.startBounds.y + f, f - x))), Le && (oe.isLockAspectRatio() || X.inputEvent?.shiftKey)) {
|
|
2378
|
-
const
|
|
2379
|
-
V >
|
|
2381
|
+
const m = R / f, V = I.width / I.height;
|
|
2382
|
+
V > m ? I.height = I.width / m : V < m && (I.width = I.height * m);
|
|
2380
2383
|
}
|
|
2381
2384
|
X.direction[0] === -1 && (I.x = Math.max(0, Math.min(C.startBounds.x + R, C.startBounds.x + R - I.width))), X.direction[1] === -1 && (I.y = Math.min(C.startBounds.y + f, C.startBounds.y + f - I.height)), C.movable.setBounds(n.toAbsoluteBounds(I));
|
|
2382
2385
|
}
|
|
@@ -2395,9 +2398,9 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2395
2398
|
}, onMouseUp: (X) => {
|
|
2396
2399
|
} }) }), [ge, Pe, q, n, s, y, d, S, T]);
|
|
2397
2400
|
return p("div", { className: Vt(u, "movable-area", da), style: { width: G.width, height: G.height, ...k, position: "absolute", overflow: "hidden", willChange: "transform" }, ref: kn([Ne, xe]), ...E, children: p("div", { className: "movable-scroll", style: { position: "absolute", cursor: "initial", left: 0, top: 0, width: G.width, height: G.height }, ...E, children: Je("div", { ref: A, style: { position: "absolute", pointerEvents: "auto" }, onFocus: (X) => {
|
|
2398
|
-
L?.(),
|
|
2401
|
+
L?.(), Ke(!0);
|
|
2399
2402
|
}, onBlur: (X) => {
|
|
2400
|
-
|
|
2403
|
+
Ke(!1);
|
|
2401
2404
|
}, onKeyDownCapture: (X) => {
|
|
2402
2405
|
if (X.isDefaultPrevented()) return;
|
|
2403
2406
|
const Le = X.nativeEvent.ctrlKey, Ge = X.nativeEvent.altKey, Fe = X.nativeEvent.shiftKey;
|
|
@@ -2420,9 +2423,9 @@ The content is not applied.` }), new J("pasteFormulas", v, { label: "Paste Formu
|
|
|
2420
2423
|
const x = a.getBounds();
|
|
2421
2424
|
let R = 1 + N;
|
|
2422
2425
|
K || (R = 1 / R);
|
|
2423
|
-
const f = Math.sqrt(Math.pow(x.width, 2) + Math.pow(x.height, 2)), I = Math.atan2(x.height, x.width),
|
|
2424
|
-
if (
|
|
2425
|
-
const V =
|
|
2426
|
+
const f = Math.sqrt(Math.pow(x.width, 2) + Math.pow(x.height, 2)), I = Math.atan2(x.height, x.width), m = R * f;
|
|
2427
|
+
if (m < 10) return;
|
|
2428
|
+
const V = m * Math.cos(I), Z = m * Math.sin(I), ee = { x: x.x + (x.width - V) / 2, y: x.y + (x.height - Z) / 2, width: V, height: Z };
|
|
2426
2429
|
a.setBounds(ee);
|
|
2427
2430
|
}, "Resize");
|
|
2428
2431
|
}, oe = (N) => {
|
|
@@ -2507,19 +2510,19 @@ function ua(e) {
|
|
|
2507
2510
|
}
|
|
2508
2511
|
T?.commit();
|
|
2509
2512
|
});
|
|
2510
|
-
}, [n, r]), [k, b] = ue(n.getMovableSelection()[0] ?? null), [D, E] = ue(!k || k?.isProtected()), G = Ce(() => [new J("moveToFront", o, { label: "Bring to Front", description: "Move to the front of all of the other drawings.", shortcut: { key: "BracketRight", modifiers: [
|
|
2513
|
+
}, [n, r]), [k, b] = ue(n.getMovableSelection()[0] ?? null), [D, E] = ue(!k || k?.isProtected()), G = Ce(() => [new J("moveToFront", o, { label: "Bring to Front", description: "Move to the front of all of the other drawings.", shortcut: { key: "BracketRight", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
2511
2514
|
u(this, (w) => {
|
|
2512
2515
|
w.moveToFront();
|
|
2513
2516
|
});
|
|
2514
|
-
}), new J("moveForward", o, { label: "Bring Forward", description: "Move forward one layer in the z order.", shortcut: { key: "BracketRight", modifiers: [
|
|
2517
|
+
}), new J("moveForward", o, { label: "Bring Forward", description: "Move forward one layer in the z order.", shortcut: { key: "BracketRight", modifiers: [te.Ctrl] } }, function() {
|
|
2515
2518
|
u(this, (w) => {
|
|
2516
2519
|
w.moveForward();
|
|
2517
2520
|
});
|
|
2518
|
-
}), new J("moveToBack", o, { label: "Send to Back", description: "Move to the back of all of the other drawings.", shortcut: { key: "BracketLeft", modifiers: [
|
|
2521
|
+
}), new J("moveToBack", o, { label: "Send to Back", description: "Move to the back of all of the other drawings.", shortcut: { key: "BracketLeft", modifiers: [te.Ctrl, te.Shift] } }, function() {
|
|
2519
2522
|
u(this, (w) => {
|
|
2520
2523
|
w.moveToBack();
|
|
2521
2524
|
});
|
|
2522
|
-
}), new J("moveBackward", o, { label: "Send Backward", description: "Move backwards one layer in the z order.", shortcut: { key: "BracketLeft", modifiers: [
|
|
2525
|
+
}), new J("moveBackward", o, { label: "Send Backward", description: "Move backwards one layer in the z order.", shortcut: { key: "BracketLeft", modifiers: [te.Ctrl] } }, function() {
|
|
2523
2526
|
u(this, (w) => {
|
|
2524
2527
|
w.moveBackward();
|
|
2525
2528
|
});
|
|
@@ -2674,15 +2677,15 @@ const td = ft(wt((e, t) => {
|
|
|
2674
2677
|
} });
|
|
2675
2678
|
const W = ie((A) => {
|
|
2676
2679
|
O(A), D && j();
|
|
2677
|
-
}, [O, U, D]),
|
|
2680
|
+
}, [O, U, D]), ne = Xe((A) => {
|
|
2678
2681
|
O(A);
|
|
2679
2682
|
}, [O]), z = Xe((A) => {
|
|
2680
2683
|
B(A);
|
|
2681
2684
|
}, [B]);
|
|
2682
2685
|
return Se(() => {
|
|
2683
2686
|
const A = n?.getStage();
|
|
2684
|
-
if (A) return A.addEventListener("pointerdown", W), A.addEventListener("dblclick",
|
|
2685
|
-
A.removeEventListener("pointerdown", W), A.removeEventListener("dblclick",
|
|
2687
|
+
if (A) return A.addEventListener("pointerdown", W), A.addEventListener("dblclick", ne), A.addEventListener("keydown", z), () => {
|
|
2688
|
+
A.removeEventListener("pointerdown", W), A.removeEventListener("dblclick", ne), A.removeEventListener("keydown", z);
|
|
2686
2689
|
};
|
|
2687
2690
|
}, [n?.getStage()]), Se(() => {
|
|
2688
2691
|
const A = y.getMode(), P = A?.key;
|
|
@@ -2800,31 +2803,31 @@ const td = ft(wt((e, t) => {
|
|
|
2800
2803
|
if (tt.useEffect(() => {
|
|
2801
2804
|
el._validate(!0);
|
|
2802
2805
|
}, []), !n) throw new Error("ISheet must be provided.");
|
|
2803
|
-
const [
|
|
2806
|
+
const [ne, z] = tt.useReducer((Q) => Q + 1, 0), [A, { width: P, height: $ }] = dn(), ge = ie(T, [T]), ae = ie(M, [M]), Y = ie(j, [j]), _ = ie(U, [U]), be = Re(!1);
|
|
2804
2807
|
Bt(() => {
|
|
2805
2808
|
be.current = !0;
|
|
2806
2809
|
}, [n]);
|
|
2807
|
-
const Ae = n?.getStyles(), we = Ce(() => Ar(r, Ae), [r, Ae]),
|
|
2810
|
+
const Ae = n?.getStyles(), we = Ce(() => Ar(r, Ae), [r, Ae]), Ze = Ce(() => Ar(l, Ae), [l, Ae]), { body: he = {}, buttonSurface: Ke = {} } = we, { header: De = {}, headerSelect: ce = {}, headerSelectAll: de = {} } = Ze, me = Re(null), [ye, Te] = ue(() => n?.getView()), Ie = (ye?.getZoomScale() ?? 100) / 100, xe = Ce(() => ({ vertical: ye.isShowColumnGridlines() && Ie >= 0.4, horizontal: ye.isShowRowGridlines() && Ie >= 0.4 }), [ye?.isShowColumnGridlines(), ye?.isShowRowGridlines(), Ie]), Ne = Ce(() => {
|
|
2808
2811
|
if (ye?.getGridLineColor()) return { strokeDasharray: "1,1" };
|
|
2809
|
-
}, [ye?.getGridLineColor(), we]), Pe = i ?? ye?.isShowColumnHeaders(),
|
|
2812
|
+
}, [ye?.getGridLineColor(), we]), Pe = i ?? ye?.isShowColumnHeaders(), _e = g ?? ye?.isShowRowHeaders(), [h, je] = ue({ width: 0, height: 0 }), ut = Ce(() => {
|
|
2810
2813
|
let Q = 40, Ee = 20;
|
|
2811
2814
|
const ze = n?.getStyles().getNormal().getFont();
|
|
2812
|
-
if (
|
|
2813
|
-
const Ye = ze?.toCSS()?.fontFamily ?? we.header.text.fontFamily, lt = ze?.getSize() ?? we.header.text.fontSize, gt = dt.getSharedMeasurer()("" +
|
|
2815
|
+
if (h.width > 0 && h.height > 0) {
|
|
2816
|
+
const Ye = ze?.toCSS()?.fontFamily ?? we.header.text.fontFamily, lt = ze?.getSize() ?? we.header.text.fontSize, gt = dt.getSharedMeasurer()("" + h.height, Math.ceil(lt * dt.getDeviceScale()), Ye);
|
|
2814
2817
|
Q = gt.width, Ee = gt.lineHeight;
|
|
2815
2818
|
}
|
|
2816
2819
|
return { width: Math.round(Q + 5), height: Math.round(Ee + 3) };
|
|
2817
|
-
}, [
|
|
2820
|
+
}, [h, we?.header.text, n]), Qe = _e ? Ie * ut.width : De.edgeStrokeWidth, X = Pe ? Ie * ut.height : De.edgeStrokeWidth, Le = Math.max(P, (n?.getColumnHeaders().getDefaultSize() ?? ut.width) + Qe + 1), Ge = Math.max($, (n?.getRowHeaders().getDefaultSize() ?? ut.height) + X + 1), Fe = Re(/* @__PURE__ */ new Map()), Ve = Re(null), Oe = () => ({ getColOffset: (Q) => n.getColumnHeaders().findOffset(Q), getColIndex: (Q) => n.getColumnHeaders().findIndex(Q), getRowOffset: (Q) => n.getRowHeaders().findOffset(Q), getRowIndex: (Q) => n.getRowHeaders().findIndex(Q) }), [C, oe] = ue(() => Oe()), [N, K] = ue(!1), [a, x] = ue(null), R = !0, f = we.selection?.strokeFill, I = Xe(() => jt.current, []), [m, V] = ue(), Z = ie((Q) => {
|
|
2818
2821
|
V(Q), n && n.getView() && n.getView().setTopLeft(Q ? { left: Q.left, top: Q.top } : null), u?.(Q);
|
|
2819
2822
|
}, [n, u]), ee = Re(null);
|
|
2820
2823
|
Se(() => {
|
|
2821
|
-
if (!
|
|
2822
|
-
const Q = n.getRangeAtBounds({ x:
|
|
2824
|
+
if (!m || !n) return;
|
|
2825
|
+
const Q = n.getRangeAtBounds({ x: m.left, y: m.top, width: m.width, height: m.height });
|
|
2823
2826
|
ee.current?.(), ee.current = Q.addListener(() => {
|
|
2824
2827
|
const Ee = Q.getCoords();
|
|
2825
2828
|
me?.current?.invalidate(Ee);
|
|
2826
2829
|
});
|
|
2827
|
-
}, [
|
|
2830
|
+
}, [m, n]);
|
|
2828
2831
|
const [re, le] = ue(() => n?.getView().getTopLeft()), se = ie((Q) => {
|
|
2829
2832
|
const Ee = qt.cellToRange(Q);
|
|
2830
2833
|
if (n.isClosed()) return Ee;
|
|
@@ -2836,7 +2839,7 @@ const td = ft(wt((e, t) => {
|
|
|
2836
2839
|
return Q.coords.colIndex > 0 && (Ee[yt.Left] = { index: Q.coords.colIndex, scrollOffset: Q.topLeft.left }), Q.coords.rowIndex > 0 && (Ee[yt.Top] = { index: Q.coords.rowIndex, scrollOffset: Q.topLeft.top }), Ee;
|
|
2837
2840
|
}, [pe, fe] = ue(() => ke(n.getView().getFreezePanes())), Me = un(), We = Xe(() => me.current, []), Be = ie((Q) => {
|
|
2838
2841
|
Me.setMode((Ee) => Ee?.key === "edit" ? { ...Ee, args: { ...Ee.args } } : { key: "edit", args: { stateAndCoords: null, start: Q } });
|
|
2839
|
-
}, []), et = ie(() =>
|
|
2842
|
+
}, []), et = ie(() => m, [m]), $e = Wi({ sheet: n, commands: k, target: We, onRepeatCommandChange: b, bodyStyle: he, notifier: F, onStartEdit: Be, getViewport: et }), [nt, He] = ue(n.getSelection().isEntire()), [at, Ct] = ue(ye?.getMovableSelection().length > 0), Ft = a !== null || at, Pt = null, [ot, vt] = ue(!1);
|
|
2840
2843
|
Se(() => {
|
|
2841
2844
|
vt(!1);
|
|
2842
2845
|
}, [n.getProtection()]);
|
|
@@ -2862,7 +2865,7 @@ const td = ft(wt((e, t) => {
|
|
|
2862
2865
|
Te(n.getView()), oe(Oe());
|
|
2863
2866
|
}, onLayoutChange: () => {
|
|
2864
2867
|
const Q = n.getEntireRange();
|
|
2865
|
-
|
|
2868
|
+
je({ height: Q.getRowCount(), width: Q.getColumnCount() }), oe(Oe());
|
|
2866
2869
|
}, onStyleChange: () => {
|
|
2867
2870
|
rn();
|
|
2868
2871
|
}, onMovablesChange: () => {
|
|
@@ -2876,7 +2879,7 @@ const td = ft(wt((e, t) => {
|
|
|
2876
2879
|
const Ot = Re(!1), hn = Ce(() => {
|
|
2877
2880
|
const Q = (ze, Ye) => {
|
|
2878
2881
|
bt.current = !0, Mt([(lt) => {
|
|
2879
|
-
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: 0, rowEnd:
|
|
2882
|
+
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: 0, rowEnd: h.height, colStart: ze, colEnd: ze }))) return;
|
|
2880
2883
|
const gt = lt.getLayout(), pt = Math.max(0, gt.getColOffset(ze)), ct = lt.getBounds(), xt = Math.min(ct.x + ct.width, gt.getColOffset(ze + 1)), Dt = lt.getAnchor();
|
|
2881
2884
|
if (Ye !== null && (Dt === yt.Left || Dt === yt.Center || Dt === yt.Right)) {
|
|
2882
2885
|
const Lo = rt.roundAccurately(Ye * rt.getDPI(), 0), lo = rt.roundAccurately(n?.getColumnWidthAsFontUnit(Ye / Ie), 2).toFixed(2), Oo = "Width: " + (Ye ? lo + " (" + Lo + " pixels)" : "Hidden"), Nn = vn.current.getGridElement().getRelativePointFromClient(0, 0), wn = 0 - Nn.y, io = 0 - Nn.y + X, Bo = { x: pt - (Nn.x - ct.x), y: wn, width: xt - pt, height: io - wn };
|
|
@@ -2905,7 +2908,7 @@ const td = ft(wt((e, t) => {
|
|
|
2905
2908
|
}, [n, c, X, Lt]), En = Ce(() => {
|
|
2906
2909
|
const Q = (ze, Ye) => {
|
|
2907
2910
|
bt.current = !0, Mt([(lt) => {
|
|
2908
|
-
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: ze, rowEnd: ze, colStart: 0, colEnd:
|
|
2911
|
+
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: ze, rowEnd: ze, colStart: 0, colEnd: h.width }))) return;
|
|
2909
2912
|
const gt = lt.getLayout(), pt = Math.max(0, gt.getRowOffset(ze)), ct = lt.getBounds(), xt = Math.min(ct.y + ct.height, gt.getRowOffset(ze + 1)), Dt = lt.getAnchor();
|
|
2910
2913
|
if (Ye !== null && (Dt === yt.Top || Dt === yt.Center || Dt === yt.Bottom)) {
|
|
2911
2914
|
const Lo = Math.floor(10 * rt.getDPI()) / 10, lo = rt.roundAccurately(Ye * Lo, 0), Oo = rt.roundAccurately(lo / Ie / (n?.getRowHeaders().getScaleFactor() * rt.getDPI()), 2).toFixed(2), Nn = "Height: " + (Ye ? Oo + " (" + lo + " pixels)" : "Hidden"), wn = fn.current.getGridElement().getRelativePointFromClient(0, 0), io = 0 - wn.x, Bo = 0 - wn.x + Qe, Jl = { x: io, y: pt - (wn.y - ct.y), width: Bo - io, height: xt - pt };
|
|
@@ -2960,7 +2963,7 @@ const td = ft(wt((e, t) => {
|
|
|
2960
2963
|
}, [we]);
|
|
2961
2964
|
const no = nt ? de.edgeStrokeFill : De.fill, mt = nt ? ce.fill : typeof we.headerHover == "function" ? we.headerHover(De)?.fill : De.fill, oo = Ce(() => H ? p("div", { className: Vt("sheetxl-viewport-overlay", Vi), style: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute" }, children: H }) : p(Sn, {}), [H]);
|
|
2962
2965
|
let mn = null;
|
|
2963
|
-
Pe &&
|
|
2966
|
+
Pe && _e && (mn = Je("div", { tabIndex: -1, className: "top-left-corner", style: { padding: "2 2", position: "absolute", height: `${X}px`, width: `${Qe}px`, zIndex: 1, boxSizing: "border-box", cursor: "cell" }, onMouseDown: (Q) => {
|
|
2964
2967
|
let Ee = !Q.ctrlKey;
|
|
2965
2968
|
$e?.getCommand("selectAll")?.execute(!Ee || Q.button !== 0), Q.nativeEvent.which === rl.Right ? o?.({ originalEvent: Q, clientX: Q.clientX, clientY: Q.clientY, rowIndex: -1, colIndex: -1 }) : me.current?.focus();
|
|
2966
2969
|
}, children: [p("div", { style: { height: X - 5 + "px", width: X - 5 + "px", clipPath: `path('M${X - 5} 0 L0 ${X - 5} L${X - 5} ${X - 5} L${X - 5} 0 Z')`, borderRight: `2px solid ${no}`, borderBottom: `2px solid ${no}`, background: `${mt}`, boxSizing: "border-box", position: "absolute", right: "2px", bottom: "2px" } }), p("div", { style: { position: "absolute", height: `${X}px`, width: `${Qe}px`, boxSizing: "border-box", borderRight: `solid 1px ${De.strokeFill}`, borderBottom: `solid 1px ${De.strokeFill}`, right: "-1px", bottom: "-1px" } })] }));
|
|
@@ -3006,7 +3009,7 @@ const td = ft(wt((e, t) => {
|
|
|
3006
3009
|
}, [Me]), Do = ie(async (Q) => {
|
|
3007
3010
|
const Ee = Me.getMode();
|
|
3008
3011
|
return Q.keyCode === It.Escape && Ee ? (Q.preventDefault(), void Me.setMode(null)) : Q.keyCode === It.Enter && Mo ? (Q.preventDefault(), await $e?.getCommand("paste")?.execute(), void Me.setMode(null)) : void $e?.dispatchToFocusedCommand(Q);
|
|
3009
|
-
}, [$e, Me]), fn = Re(null), ro = Ce(() => p("div", { tabIndex: -1, style: { position: "relative", flex: "0", top: `${X + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${X}px)`, boxSizing: "border-box", zIndex: "2" }, children: p(Mr, { ref: fn, sheetElement: jt.current, gridRef: me, freezeStart: pe?.[yt.Top], oppositeSize: Qe, containerWidth: Qe, containerHeight: Ge, sheetHeader: n.getRowHeaders(), gridStyle:
|
|
3012
|
+
}, [$e, Me]), fn = Re(null), ro = Ce(() => p("div", { tabIndex: -1, style: { position: "relative", flex: "0", top: `${X + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${X}px)`, boxSizing: "border-box", zIndex: "2" }, children: p(Mr, { ref: fn, sheetElement: jt.current, gridRef: me, freezeStart: pe?.[yt.Top], oppositeSize: Qe, containerWidth: Qe, containerHeight: Ge, sheetHeader: n.getRowHeaders(), gridStyle: Ze, verticalPadding: Math.max(0, Math.floor(n.getStyles().getNormal().getFont().getSize() / 10)), scrollPoint: Zt, onSheetContextMenu: o, tabIndex: -1, style: { position: "relative", flex: "0", top: `${X + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${X}px)`, boxSizing: "border-box", zIndex: "2", ...En?.style }, ...En }) }), [Qe, X, Ge, n, Zt, pe?.[yt.Top], we, R, o, De.fill, s]), vn = Re(null), Gl = Ce(() => p("div", { tabIndex: -1, style: { position: "relative", left: "0px", width: "100%", height: `${X + De.edgeStrokeWidth}px`, minHeight: `${X + De.edgeStrokeWidth}px`, borderBottom: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" }, children: p(Mr, { ref: vn, sheetElement: jt.current, gridRef: me, freezeStart: pe?.[yt.Left], oppositeSize: X, containerWidth: Le, containerHeight: X, sheetHeader: n.getColumnHeaders(), gridStyle: Ze, scrollPoint: on, onSheetContextMenu: o, ...hn, style: { ...hn?.style, position: "relative", left: "0px", width: "100%", height: `${X + De.edgeStrokeWidth}px`, minHeight: `${X + De.edgeStrokeWidth}px`, borderBottom: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" } }) }), [X, Le, n, on, pe?.[yt.Left], we, De.fill, R, o, c]), jl = ie((Q) => {
|
|
3010
3013
|
const { value: Ee, key: ze, ...Ye } = Q;
|
|
3011
3014
|
let lt = Ee, gt = a;
|
|
3012
3015
|
if (!gt || gt.colIndex === Q.coords.colIndex && gt.rowIndex === Q.coords.rowIndex || (gt = null), !lt) {
|
|
@@ -3038,12 +3041,12 @@ const td = ft(wt((e, t) => {
|
|
|
3038
3041
|
const ct = (Dt, Qt, Fn) => Fn ? { stroke: Ye.getBottom().isNone() ? "none" : Dt.getColor().toRGBA(he.darkMode).toString(), ...Qt } : Qt;
|
|
3039
3042
|
pt = ct(Ye.getBottom(), pt, !Ye.getBottom().isNone()), pt = ct(Ye.getTop(), pt, !Ye.getTop().isNone()), gt = ct(Ye.getRight(), gt, !Ye.getRight().isNone()), gt = ct(Ye.getLeft(), gt, !Ye.getLeft().isNone());
|
|
3040
3043
|
let xt = ye?.getGridLineColor()?.toRGBA(he.darkMode).toString() ?? he.strokeFill;
|
|
3041
|
-
return lt || (pt = ct(Ye.getBottom(), pt, !0), pt = ct(Ye.getTop(), pt, !0), gt = ct(Ye.getRight(), gt, !0), gt = ct(Ye.getLeft(), gt, !0)), p(al, { className: "sheetxl-sheet-primary", style: { ...wa, ...ze.toCSS(he.darkMode), ...Ee.toCSS(he.darkMode, Ie), "--sxl-app-color-background": he.fill, "--sxl-app-color-shadow": we.colorShadow, "--sxl-app-color-grey": we.colorGrey, "--sxl-app-color-button-fill":
|
|
3044
|
+
return lt || (pt = ct(Ye.getBottom(), pt, !0), pt = ct(Ye.getTop(), pt, !0), gt = ct(Ye.getRight(), gt, !0), gt = ct(Ye.getLeft(), gt, !0)), p(al, { className: "sheetxl-sheet-primary", style: { ...wa, ...ze.toCSS(he.darkMode), ...Ee.toCSS(he.darkMode, Ie), "--sxl-app-color-background": he.fill, "--sxl-app-color-shadow": we.colorShadow, "--sxl-app-color-grey": we.colorGrey, "--sxl-app-color-button-fill": Ke.fill, "--sxl-app-color-button-text": Ke.text?.fill, "--sxl-app-color-button-border": Ke.edgeStrokeFill, "--sxl-app-color-primary-dark": we.selection.strokeFill }, ref: me, zoom: Ie, ...B, onFirstRender: (Dt) => {
|
|
3042
3045
|
Zl(!0), B?.onFirstRender?.(Dt), $e?.activate();
|
|
3043
|
-
}, showGridLines: xe, gridLineColor: xt, gridLineColumnsProps: gt, gridLineRowsProps: pt, freezeLeft: pe?.[yt.Left], freezeLeftProps: zn, freezeTop: pe?.[yt.Top], freezeTopProps: zn, width: Le, height: Ge, columnCount:
|
|
3046
|
+
}, showGridLines: xe, gridLineColor: xt, gridLineColumnsProps: gt, gridLineRowsProps: pt, freezeLeft: pe?.[yt.Left], freezeLeftProps: zn, freezeTop: pe?.[yt.Top], freezeTopProps: zn, width: Le, height: Ge, columnCount: h.width, rowCount: h.height, cursor: Ht ?? Pt ?? "cell", clipCells: !0, layout: C, cellRenderer: jl, overlayRenderer: _l, getCellCoordsAsRangeCoords: se, getVisibleCells: In, onWheelScroll: At, onPointerDown: pn, onKeyDown: Do, onViewportChange: Z, onImmediateScroll: An, scrollPoint: re, stageProps: { onFocus: () => {
|
|
3044
3047
|
$e?.activate();
|
|
3045
3048
|
} }, overlays: Jt });
|
|
3046
|
-
}, [
|
|
3049
|
+
}, [ne]);
|
|
3047
3050
|
Se(() => {
|
|
3048
3051
|
be.current || z();
|
|
3049
3052
|
}, [C, pe, Ie, $e, re?.left, re?.top, he, B, Le, Ge, Ht, Jt, R, Pt]);
|
|
@@ -3062,7 +3065,7 @@ const td = ft(wt((e, t) => {
|
|
|
3062
3065
|
}, ref: jt, ...W, children: p("div", { className: Vt("sheetxl-sheet", Bi), style: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", display: "flex", flexDirection: "column", flex: "1 1 100%", zIndex: "0", ...Yl }, children: Je("div", { style: { display: "flex", flexDirection: "row", flex: "1 1 100%" }, children: [mn, ro, Je("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden", position: "relative" }, children: [Gl, Je("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", position: "relative", borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, backgroundColor: he.fill }, ref: A, onContextMenu: St, children: [Kl, oo, p(Pi, { style: { position: "absolute", right: 24, bottom: 4 }, colorLicensee: we?.selection?.strokeFill, colorCredits: we?.body?.text?.fill })] })] })] }) }) });
|
|
3063
3066
|
if (y) {
|
|
3064
3067
|
const Q = (Ee) => p(ml, { ...Ee, sheet: n });
|
|
3065
|
-
Ao = p(di, { style: { flex: "1 1 100%", overflow: "hidden", background: `${De.fill}`, minHeight: 2 * ut.height, minWidth: 2 * ut.width, ...S }, viewport:
|
|
3068
|
+
Ao = p(di, { style: { flex: "1 1 100%", overflow: "hidden", background: `${De.fill}`, minHeight: 2 * ut.height, minWidth: 2 * ut.width, ...S }, viewport: m, touchElement: me.current?.stage, disableTouch: Ft, onScrollViewport: (Ee) => {
|
|
3066
3069
|
me.current?.scrollTo(Ee);
|
|
3067
3070
|
}, createHorizontalScrollbar: Q, createVerticalScrollbar: Q, ...d, children: Ao });
|
|
3068
3071
|
}
|
|
@@ -3110,24 +3113,24 @@ const od = ft(wt((e, t) => {
|
|
|
3110
3113
|
Se(() => {
|
|
3111
3114
|
q(l);
|
|
3112
3115
|
}, [l]);
|
|
3113
|
-
const v = Re(null), [S, F] = ue(null), T = Xe(function(
|
|
3114
|
-
const z =
|
|
3116
|
+
const v = Re(null), [S, F] = ue(null), T = Xe(function(ne) {
|
|
3117
|
+
const z = ne.message;
|
|
3115
3118
|
S !== z && (s?.showMessage?.(z, { type: tr.Error }), F(z));
|
|
3116
|
-
}, [s, S]), M = Xe((
|
|
3119
|
+
}, [s, S]), M = Xe((ne) => {
|
|
3117
3120
|
let z = !1;
|
|
3118
3121
|
try {
|
|
3119
|
-
z = o?.(
|
|
3122
|
+
z = o?.(ne) ?? !0;
|
|
3120
3123
|
} catch (A) {
|
|
3121
3124
|
T(A);
|
|
3122
3125
|
}
|
|
3123
|
-
return z ? (v.current = null, w(!1), q(
|
|
3126
|
+
return z ? (v.current = null, w(!1), q(ne), z) : (setTimeout(() => {
|
|
3124
3127
|
v.current?.focus();
|
|
3125
3128
|
}, 0), z);
|
|
3126
3129
|
}, [o]), j = ie(() => {
|
|
3127
3130
|
q(l), v.current = null, w(!1), c?.();
|
|
3128
3131
|
}, [c, l]), U = Ce(() => {
|
|
3129
3132
|
if (!H) return null;
|
|
3130
|
-
const
|
|
3133
|
+
const ne = { className: Vt(Ca), autoFocus: !0, spellCheck: !1, name: "editable-label", autoComplete: "off", maxLength: u, type: "text", value: L, onFocus: (z) => {
|
|
3131
3134
|
v.current || (v.current = z.target, setTimeout(() => {
|
|
3132
3135
|
z.target?.select();
|
|
3133
3136
|
}, 0));
|
|
@@ -3136,11 +3139,11 @@ const od = ft(wt((e, t) => {
|
|
|
3136
3139
|
}, onChange: (z) => {
|
|
3137
3140
|
H && q(z.target.value);
|
|
3138
3141
|
}, onMouseDown: (z) => z.stopPropagation(), onKeyDown: (z) => z.code === "Escape" ? (z.preventDefault(), void j()) : z.code === "Enter" ? (z.preventDefault(), void M(z.target.value)) : void (z.code !== "Tab" ? z.stopPropagation() : M(z.target.value)) };
|
|
3139
|
-
return p(Sn, { children: g(
|
|
3142
|
+
return p(Sn, { children: g(ne) });
|
|
3140
3143
|
}, [H, L, M, j, g, k]), [B, O] = ue();
|
|
3141
3144
|
Bt(() => {
|
|
3142
|
-
let
|
|
3143
|
-
(d || E) && (
|
|
3145
|
+
let ne = Object.assign({}, n);
|
|
3146
|
+
(d || E) && (ne = Object.assign(ne, y)), O(ne);
|
|
3144
3147
|
}, [d, E, y, n]), Se(() => {
|
|
3145
3148
|
U && i?.(L);
|
|
3146
3149
|
}, [U, i, L]);
|
|
@@ -3969,22 +3972,22 @@ const os = ft(function(e) {
|
|
|
3969
3972
|
var t, n, r, l;
|
|
3970
3973
|
let { id: o, accessibility: i, autoScroll: c = !0, children: g, sensors: s = Xa, collisionDetection: y = La, measuring: d, modifiers: u, ...k } = e;
|
|
3971
3974
|
const b = sn(ts, void 0, es), [D, E] = b, [G, H] = function() {
|
|
3972
|
-
const [
|
|
3975
|
+
const [m] = ue(() => /* @__PURE__ */ new Set()), V = Xe((Z) => (m.add(Z), () => m.delete(Z)), [m]);
|
|
3973
3976
|
return [Xe((Z) => {
|
|
3974
3977
|
let { type: ee, event: re } = Z;
|
|
3975
|
-
|
|
3978
|
+
m.forEach((le) => {
|
|
3976
3979
|
var se;
|
|
3977
3980
|
return (se = le[ee]) == null ? void 0 : se.call(le, re);
|
|
3978
3981
|
});
|
|
3979
|
-
}, [
|
|
3982
|
+
}, [m]), V];
|
|
3980
3983
|
}(), [w, L] = ue(nn.Uninitialized), q = w === nn.Initialized, { draggable: { active: v, nodes: S, translate: F }, droppable: { containers: T } } = D, M = v != null ? S.get(v) : null, j = Re({ initial: null, translated: null }), U = Ce(() => {
|
|
3981
|
-
var
|
|
3982
|
-
return v != null ? { id: v, data: (
|
|
3983
|
-
}, [v, M]), B = Re(null), [O, W] = ue(null), [
|
|
3984
|
+
var m;
|
|
3985
|
+
return v != null ? { id: v, data: (m = M?.data) != null ? m : Ja, rect: j } : null;
|
|
3986
|
+
}, [v, M]), B = Re(null), [O, W] = ue(null), [ne, z] = ue(null), A = Kn(k, Object.values(k)), P = Qn("DndDescribedBy", o), $ = Ce(() => T.getEnabled(), [T]), ge = Ce(() => ({ draggable: { ...mo.draggable, ...ae?.draggable }, droppable: { ...mo.droppable, ...ae?.droppable }, dragOverlay: { ...mo.dragOverlay, ...ae?.dragOverlay } }), [(ae = d) == null ? void 0 : ae.draggable, ae?.droppable, ae?.dragOverlay]);
|
|
3984
3987
|
var ae;
|
|
3985
|
-
const { droppableRects: Y, measureDroppableContainers: _, measuringScheduled: be } = function(
|
|
3988
|
+
const { droppableRects: Y, measureDroppableContainers: _, measuringScheduled: be } = function(m, V) {
|
|
3986
3989
|
let { dragging: Z, dependencies: ee, config: re } = V;
|
|
3987
|
-
const [le, se] = ue(null), { frequency: ke, measure: pe, strategy: fe } = re, Me = Re(
|
|
3990
|
+
const [le, se] = ue(null), { frequency: ke, measure: pe, strategy: fe } = re, Me = Re(m), We = function() {
|
|
3988
3991
|
switch (fe) {
|
|
3989
3992
|
case Xn.Always:
|
|
3990
3993
|
return !1;
|
|
@@ -3997,9 +4000,9 @@ const os = ft(function(e) {
|
|
|
3997
4000
|
He === void 0 && (He = []), Be.current || se((at) => at === null ? He : at.concat(He.filter((Ct) => !at.includes(Ct))));
|
|
3998
4001
|
}, [Be]), $e = Re(null), nt = Wn((He) => {
|
|
3999
4002
|
if (We && !Z) return Wr;
|
|
4000
|
-
if (!He || He === Wr || Me.current !==
|
|
4003
|
+
if (!He || He === Wr || Me.current !== m || le != null) {
|
|
4001
4004
|
const at = /* @__PURE__ */ new Map();
|
|
4002
|
-
for (let Ct of
|
|
4005
|
+
for (let Ct of m) {
|
|
4003
4006
|
if (!Ct) continue;
|
|
4004
4007
|
if (le && le.length > 0 && !le.includes(Ct.id) && Ct.rect.current) {
|
|
4005
4008
|
at.set(Ct.id, Ct.rect.current);
|
|
@@ -4011,10 +4014,10 @@ const os = ft(function(e) {
|
|
|
4011
4014
|
return at;
|
|
4012
4015
|
}
|
|
4013
4016
|
return He;
|
|
4014
|
-
}, [
|
|
4017
|
+
}, [m, le, Z, We, pe]);
|
|
4015
4018
|
return Se(() => {
|
|
4016
|
-
Me.current =
|
|
4017
|
-
}, [
|
|
4019
|
+
Me.current = m;
|
|
4020
|
+
}, [m]), Se(() => {
|
|
4018
4021
|
We || et();
|
|
4019
4022
|
}, [Z, We]), Se(() => {
|
|
4020
4023
|
le && le.length > 0 && se(null);
|
|
@@ -4023,20 +4026,20 @@ const os = ft(function(e) {
|
|
|
4023
4026
|
et(), $e.current = null;
|
|
4024
4027
|
}, ke));
|
|
4025
4028
|
}, [ke, We, et, ...ee]), { droppableRects: nt, measureDroppableContainers: et, measuringScheduled: le != null };
|
|
4026
|
-
}($, { dragging: q, dependencies: [F.x, F.y], config: ge.droppable }), Ae = function(
|
|
4027
|
-
const Z = V != null ?
|
|
4029
|
+
}($, { dragging: q, dependencies: [F.x, F.y], config: ge.droppable }), Ae = function(m, V) {
|
|
4030
|
+
const Z = V != null ? m.get(V) : void 0, ee = Z ? Z.node.current : null;
|
|
4028
4031
|
return Wn((re) => {
|
|
4029
4032
|
var le;
|
|
4030
4033
|
return V == null ? null : (le = ee ?? re) != null ? le : null;
|
|
4031
4034
|
}, [ee, V]);
|
|
4032
|
-
}(S, v), we = Ce(() =>
|
|
4033
|
-
const
|
|
4035
|
+
}(S, v), we = Ce(() => ne ? vo(ne) : null, [ne]), Ze = function() {
|
|
4036
|
+
const m = O?.autoScrollEnabled === !1, V = typeof c == "object" ? c.enabled === !1 : c === !1, Z = q && !m && !V;
|
|
4034
4037
|
return typeof c == "object" ? { ...c, enabled: Z } : { enabled: Z };
|
|
4035
|
-
}(), he = function(
|
|
4036
|
-
return Jo(
|
|
4038
|
+
}(), he = function(m, V) {
|
|
4039
|
+
return Jo(m, V);
|
|
4037
4040
|
}(Ae, ge.draggable.measure);
|
|
4038
|
-
(function(
|
|
4039
|
-
let { activeNode: V, measure: Z, initialRect: ee, config: re = !0 } =
|
|
4041
|
+
(function(m) {
|
|
4042
|
+
let { activeNode: V, measure: Z, initialRect: ee, config: re = !0 } = m;
|
|
4040
4043
|
const le = Re(!1), { x: se, y: ke } = typeof re == "boolean" ? { x: re, y: re } : re;
|
|
4041
4044
|
Ut(() => {
|
|
4042
4045
|
if (!se && !ke || !V) return void (le.current = !1);
|
|
@@ -4049,9 +4052,9 @@ const os = ft(function(e) {
|
|
|
4049
4052
|
Me && Me.scrollBy({ top: fe.y, left: fe.x });
|
|
4050
4053
|
}
|
|
4051
4054
|
}, [V, se, ke, ee, Z]);
|
|
4052
|
-
})({ activeNode: v != null ? S.get(v) : null, config:
|
|
4053
|
-
const
|
|
4054
|
-
let { measure: V } =
|
|
4055
|
+
})({ activeNode: v != null ? S.get(v) : null, config: Ze.layoutShiftCompensation, initialRect: he, measure: ge.draggable.measure });
|
|
4056
|
+
const Ke = $r(Ae, ge.draggable.measure, he), De = $r(Ae ? Ae.parentElement : null), ce = Re({ activatorEvent: null, active: null, activeNode: Ae, collisionRect: null, collisions: null, droppableRects: Y, draggableNodes: S, draggingNode: null, draggingNodeRect: null, droppableContainers: T, over: null, scrollableAncestors: [], scrollAdjustedTranslate: null }), de = T.getNodeFor((t = ce.current.over) == null ? void 0 : t.id), me = function(m) {
|
|
4057
|
+
let { measure: V } = m;
|
|
4055
4058
|
const [Z, ee] = ue(null), re = bo({ callback: Xe((pe) => {
|
|
4056
4059
|
for (const { target: fe } of pe) if (Jn(fe)) {
|
|
4057
4060
|
ee((Me) => {
|
|
@@ -4065,40 +4068,40 @@ const os = ft(function(e) {
|
|
|
4065
4068
|
re?.disconnect(), fe && re?.observe(fe), ee(fe ? V(fe) : null);
|
|
4066
4069
|
}, [V, re]), [se, ke] = po(le);
|
|
4067
4070
|
return Ce(() => ({ nodeRef: se, rect: Z, setRef: ke }), [Z, se, ke]);
|
|
4068
|
-
}({ measure: ge.dragOverlay.measure }), ye = (n = me.nodeRef.current) != null ? n : Ae, Te = q ? (r = me.rect) != null ? r :
|
|
4071
|
+
}({ measure: ge.dragOverlay.measure }), ye = (n = me.nodeRef.current) != null ? n : Ae, Te = q ? (r = me.rect) != null ? r : Ke : null, Ie = !!(me.nodeRef.current && me.rect), xe = Or(Ne = Ie ? null : Ke, Jo(Ne));
|
|
4069
4072
|
var Ne;
|
|
4070
|
-
const Pe = jr(ye ? zt(ye) : null),
|
|
4071
|
-
const V = Re(
|
|
4073
|
+
const Pe = jr(ye ? zt(ye) : null), _e = function(m) {
|
|
4074
|
+
const V = Re(m), Z = Wn((ee) => m ? ee && ee !== Ur && m && V.current && m.parentNode === V.current.parentNode ? ee : Ro(m) : Ur, [m]);
|
|
4072
4075
|
return Se(() => {
|
|
4073
|
-
V.current =
|
|
4074
|
-
}, [
|
|
4075
|
-
}(q ? de ?? Ae : null),
|
|
4076
|
+
V.current = m;
|
|
4077
|
+
}, [m]), Z;
|
|
4078
|
+
}(q ? de ?? Ae : null), h = function(m, V) {
|
|
4076
4079
|
V === void 0 && (V = Tn);
|
|
4077
|
-
const [Z] =
|
|
4080
|
+
const [Z] = m, ee = jr(Z ? zt(Z) : null), [re, le] = ue(_r);
|
|
4078
4081
|
function se() {
|
|
4079
|
-
le(() =>
|
|
4082
|
+
le(() => m.length ? m.map((pe) => Tl(pe) ? ee : new Ko(V(pe), pe)) : _r);
|
|
4080
4083
|
}
|
|
4081
4084
|
const ke = bo({ callback: se });
|
|
4082
4085
|
return Ut(() => {
|
|
4083
|
-
ke?.disconnect(), se(),
|
|
4084
|
-
}, [
|
|
4085
|
-
}(
|
|
4086
|
-
const [V, Z] = ue(null), ee = Re(
|
|
4086
|
+
ke?.disconnect(), se(), m.forEach((pe) => ke?.observe(pe));
|
|
4087
|
+
}, [m]), re;
|
|
4088
|
+
}(_e), je = Bl(u, { transform: { x: F.x - xe.x, y: F.y - xe.y, scaleX: 1, scaleY: 1 }, activatorEvent: ne, active: U, activeNodeRect: Ke, containerNodeRect: De, draggingNodeRect: Te, over: ce.current.over, overlayNodeRect: me.rect, scrollableAncestors: _e, scrollableAncestorRects: h, windowRect: Pe }), ut = we ? qn(we, F) : null, Qe = function(m) {
|
|
4089
|
+
const [V, Z] = ue(null), ee = Re(m), re = Xe((le) => {
|
|
4087
4090
|
const se = $o(le.target);
|
|
4088
4091
|
se && Z((ke) => ke ? (ke.set(se, Zo(se)), new Map(ke)) : null);
|
|
4089
4092
|
}, []);
|
|
4090
4093
|
return Se(() => {
|
|
4091
4094
|
const le = ee.current;
|
|
4092
|
-
if (
|
|
4095
|
+
if (m !== le) {
|
|
4093
4096
|
se(le);
|
|
4094
|
-
const ke =
|
|
4097
|
+
const ke = m.map((pe) => {
|
|
4095
4098
|
const fe = $o(pe);
|
|
4096
4099
|
return fe ? (fe.addEventListener("scroll", re, { passive: !0 }), [fe, Zo(fe)]) : null;
|
|
4097
4100
|
}).filter((pe) => pe != null);
|
|
4098
|
-
Z(ke.length ? new Map(ke) : null), ee.current =
|
|
4101
|
+
Z(ke.length ? new Map(ke) : null), ee.current = m;
|
|
4099
4102
|
}
|
|
4100
4103
|
return () => {
|
|
4101
|
-
se(
|
|
4104
|
+
se(m), se(le);
|
|
4102
4105
|
};
|
|
4103
4106
|
function se(ke) {
|
|
4104
4107
|
ke.forEach((pe) => {
|
|
@@ -4106,15 +4109,15 @@ const os = ft(function(e) {
|
|
|
4106
4109
|
fe?.removeEventListener("scroll", re);
|
|
4107
4110
|
});
|
|
4108
4111
|
}
|
|
4109
|
-
}, [re,
|
|
4110
|
-
}(
|
|
4111
|
-
return { ...
|
|
4112
|
-
}(Ie ?
|
|
4112
|
+
}, [re, m]), Ce(() => m.length ? V ? Array.from(V.values()).reduce((le, se) => qn(le, se), Gt) : Dl(m) : Gt, [m, V]);
|
|
4113
|
+
}(_e), X = Gr(Qe), Le = Gr(Qe, [Ke]), Ge = qn(je, X), Fe = Te ? Ba(Te, je) : null, Ve = U && Fe ? y({ active: U, collisionRect: Fe, droppableRects: Y, droppableContainers: $, pointerCoordinates: ut }) : null, Oe = Cl(Ve, "id"), [C, oe] = ue(null), N = function(m, V, Z) {
|
|
4114
|
+
return { ...m, scaleX: V && Z ? V.width / Z.width : 1, scaleY: V && Z ? V.height / Z.height : 1 };
|
|
4115
|
+
}(Ie ? je : qn(je, Le), (l = C?.rect) != null ? l : null, Ke), K = Re(null), a = Xe((m, V) => {
|
|
4113
4116
|
let { sensor: Z, options: ee } = V;
|
|
4114
4117
|
if (B.current == null) return;
|
|
4115
4118
|
const re = S.get(B.current);
|
|
4116
4119
|
if (!re) return;
|
|
4117
|
-
const le =
|
|
4120
|
+
const le = m.nativeEvent, se = new Z({ active: B.current, activeNode: re, event: le, options: ee, context: ce, onAbort(pe) {
|
|
4118
4121
|
if (!S.get(pe)) return;
|
|
4119
4122
|
const { onDragAbort: fe } = A.current, Me = { id: pe };
|
|
4120
4123
|
fe?.(Me), G({ type: "onDragAbort", event: Me });
|
|
@@ -4153,51 +4156,51 @@ const os = ft(function(e) {
|
|
|
4153
4156
|
};
|
|
4154
4157
|
}
|
|
4155
4158
|
K.current = se;
|
|
4156
|
-
}, [S]), x = Xe((
|
|
4159
|
+
}, [S]), x = Xe((m, V) => (Z, ee) => {
|
|
4157
4160
|
const re = Z.nativeEvent, le = S.get(ee);
|
|
4158
4161
|
if (B.current !== null || !le || re.dndKit || re.defaultPrevented) return;
|
|
4159
4162
|
const se = { active: le };
|
|
4160
|
-
|
|
4161
|
-
}, [S, a]), R = function(
|
|
4162
|
-
return Ce(() =>
|
|
4163
|
+
m(Z, V.options, se) === !0 && (re.dndKit = { capturedBy: V.sensor }, B.current = ee, a(Z, V));
|
|
4164
|
+
}, [S, a]), R = function(m, V) {
|
|
4165
|
+
return Ce(() => m.reduce((Z, ee) => {
|
|
4163
4166
|
const { sensor: re } = ee;
|
|
4164
4167
|
return [...Z, ...re.activators.map((le) => ({ eventName: le.eventName, handler: V(le.handler, ee) }))];
|
|
4165
|
-
}, []), [
|
|
4168
|
+
}, []), [m, V]);
|
|
4166
4169
|
}(s, x);
|
|
4167
|
-
(function(
|
|
4170
|
+
(function(m) {
|
|
4168
4171
|
Se(() => {
|
|
4169
4172
|
if (!So) return;
|
|
4170
|
-
const V =
|
|
4173
|
+
const V = m.map((Z) => {
|
|
4171
4174
|
let { sensor: ee } = Z;
|
|
4172
4175
|
return ee.setup == null ? void 0 : ee.setup();
|
|
4173
4176
|
});
|
|
4174
4177
|
return () => {
|
|
4175
4178
|
for (const Z of V) Z?.();
|
|
4176
4179
|
};
|
|
4177
|
-
},
|
|
4180
|
+
}, m.map((V) => {
|
|
4178
4181
|
let { sensor: Z } = V;
|
|
4179
4182
|
return Z;
|
|
4180
4183
|
}));
|
|
4181
4184
|
})(s), Ut(() => {
|
|
4182
|
-
|
|
4183
|
-
}, [
|
|
4184
|
-
const { onDragMove:
|
|
4185
|
+
Ke && w === nn.Initializing && L(nn.Initialized);
|
|
4186
|
+
}, [Ke, w]), Se(() => {
|
|
4187
|
+
const { onDragMove: m } = A.current, { active: V, activatorEvent: Z, collisions: ee, over: re } = ce.current;
|
|
4185
4188
|
if (!V || !Z) return;
|
|
4186
4189
|
const le = { active: V, activatorEvent: Z, collisions: ee, delta: { x: Ge.x, y: Ge.y }, over: re };
|
|
4187
4190
|
Hn(() => {
|
|
4188
|
-
|
|
4191
|
+
m?.(le), G({ type: "onDragMove", event: le });
|
|
4189
4192
|
});
|
|
4190
4193
|
}, [Ge.x, Ge.y]), Se(() => {
|
|
4191
|
-
const { active:
|
|
4192
|
-
if (!
|
|
4193
|
-
const { onDragOver: le } = A.current, se = ee.get(Oe), ke = se && se.rect.current ? { id: se.id, rect: se.rect.current, data: se.data, disabled: se.disabled } : null, pe = { active:
|
|
4194
|
+
const { active: m, activatorEvent: V, collisions: Z, droppableContainers: ee, scrollAdjustedTranslate: re } = ce.current;
|
|
4195
|
+
if (!m || B.current == null || !V || !re) return;
|
|
4196
|
+
const { onDragOver: le } = A.current, se = ee.get(Oe), ke = se && se.rect.current ? { id: se.id, rect: se.rect.current, data: se.data, disabled: se.disabled } : null, pe = { active: m, activatorEvent: V, collisions: Z, delta: { x: re.x, y: re.y }, over: ke };
|
|
4194
4197
|
Hn(() => {
|
|
4195
4198
|
oe(ke), le?.(pe), G({ type: "onDragOver", event: pe });
|
|
4196
4199
|
});
|
|
4197
4200
|
}, [Oe]), Ut(() => {
|
|
4198
|
-
ce.current = { activatorEvent:
|
|
4199
|
-
}, [U, Ae, Ve, Fe, S, ye, Te, Y, T, C,
|
|
4200
|
-
const f = Ce(() => ({ active: U, activeNode: Ae, activeNodeRect:
|
|
4201
|
+
ce.current = { activatorEvent: ne, active: U, activeNode: Ae, collisionRect: Fe, collisions: Ve, droppableRects: Y, draggableNodes: S, draggingNode: ye, draggingNodeRect: Te, droppableContainers: T, over: C, scrollableAncestors: _e, scrollAdjustedTranslate: Ge }, j.current = { initial: Te, translated: Fe };
|
|
4202
|
+
}, [U, Ae, Ve, Fe, S, ye, Te, Y, T, C, _e, Ge]), Za({ ...Ze, delta: F, draggingRect: Fe, pointerCoordinates: ut, scrollableAncestors: _e, scrollableAncestorRects: h });
|
|
4203
|
+
const f = Ce(() => ({ active: U, activeNode: Ae, activeNodeRect: Ke, activatorEvent: ne, collisions: Ve, containerNodeRect: De, dragOverlay: me, draggableNodes: S, droppableContainers: T, droppableRects: Y, over: C, measureDroppableContainers: _, scrollableAncestors: _e, scrollableAncestorRects: h, measuringConfiguration: ge, measuringScheduled: be, windowRect: Pe }), [U, Ae, Ke, ne, Ve, De, me, S, T, Y, C, _, _e, h, ge, be, Pe]), I = Ce(() => ({ activatorEvent: ne, activators: R, active: U, activeNodeRect: Ke, ariaDescribedById: { draggable: P }, dispatch: E, draggableNodes: S, over: C, measureDroppableContainers: _ }), [ne, R, U, Ke, E, P, S, C, _]);
|
|
4201
4204
|
return tt.createElement(yl.Provider, { value: H }, tt.createElement(eo.Provider, { value: I }, tt.createElement(Ol.Provider, { value: f }, tt.createElement(To.Provider, { value: N }, g)), tt.createElement(ns, { disabled: i?.restoreFocus === !1 })), tt.createElement(Aa, { ...i, hiddenTextDescribedById: P }));
|
|
4202
4205
|
}), rs = xn(null), Zr = "button";
|
|
4203
4206
|
function ls(e) {
|
|
@@ -4358,9 +4361,9 @@ function ks(e) {
|
|
|
4358
4361
|
return typeof de == "boolean" ? { draggable: de, droppable: !1 } : { draggable: (ye = de?.draggable) != null ? ye : me.draggable, droppable: (Te = de?.droppable) != null ? Te : me.droppable };
|
|
4359
4362
|
}(r, k), L = y.indexOf(i), q = Ce(() => ({ sortable: { containerId: d, index: L, items: y }, ...l }), [d, l, L, y]), v = Ce(() => y.slice(y.indexOf(i)), [y, i]), { rect: S, node: F, isOver: T, setNodeRef: M } = function(de) {
|
|
4360
4363
|
let { data: me, disabled: ye = !1, id: Te, resizeObserverConfig: Ie } = de;
|
|
4361
|
-
const xe = Qn("Droppable"), { active: Ne, dispatch: Pe, over:
|
|
4364
|
+
const xe = Qn("Droppable"), { active: Ne, dispatch: Pe, over: _e, measureDroppableContainers: h } = Xt(eo), je = Re({ disabled: ye }), ut = Re(!1), Qe = Re(null), X = Re(null), { disabled: Le, updateMeasurementsFor: Ge, timeout: Fe } = { ...is, ...Ie }, Ve = Kn(Ge ?? Te), Oe = bo({ callback: Xe(() => {
|
|
4362
4365
|
ut.current ? (X.current != null && clearTimeout(X.current), X.current = setTimeout(() => {
|
|
4363
|
-
|
|
4366
|
+
h(Array.isArray(Ve.current) ? Ve.current : [Ve.current]), X.current = null;
|
|
4364
4367
|
}, Fe)) : ut.current = !0;
|
|
4365
4368
|
}, [Fe]), disabled: Le || !Ne }), C = Xe((a, x) => {
|
|
4366
4369
|
Oe && (x && (Oe.unobserve(x), ut.current = !1), a && Oe.observe(a));
|
|
@@ -4368,22 +4371,22 @@ function ks(e) {
|
|
|
4368
4371
|
return Se(() => {
|
|
4369
4372
|
Oe && oe.current && (Oe.disconnect(), ut.current = !1, Oe.observe(oe.current));
|
|
4370
4373
|
}, [oe, Oe]), Se(() => (Pe({ type: kt.RegisterDroppable, element: { id: Te, key: xe, disabled: ye, node: oe, rect: Qe, data: K } }), () => Pe({ type: kt.UnregisterDroppable, key: xe, id: Te })), [Te]), Se(() => {
|
|
4371
|
-
ye !==
|
|
4372
|
-
}, [Te, xe, ye, Pe]), { active: Ne, rect: Qe, isOver:
|
|
4373
|
-
}({ id: i, data: q, disabled: w.droppable, resizeObserverConfig: { updateMeasurementsFor: v, ...g } }), { active: j, activatorEvent: U, activeNodeRect: B, attributes: O, setNodeRef: W, listeners:
|
|
4374
|
+
ye !== je.current.disabled && (Pe({ type: kt.SetDroppableDisabled, id: Te, key: xe, disabled: ye }), je.current.disabled = ye);
|
|
4375
|
+
}, [Te, xe, ye, Pe]), { active: Ne, rect: Qe, isOver: _e?.id === Te, node: oe, over: _e, setNodeRef: N };
|
|
4376
|
+
}({ id: i, data: q, disabled: w.droppable, resizeObserverConfig: { updateMeasurementsFor: v, ...g } }), { active: j, activatorEvent: U, activeNodeRect: B, attributes: O, setNodeRef: W, listeners: ne, isDragging: z, over: A, setActivatorNodeRef: P, transform: $ } = ls({ id: i, data: q, attributes: { ...xs, ...n }, disabled: w.draggable }), ge = function() {
|
|
4374
4377
|
for (var de = arguments.length, me = new Array(de), ye = 0; ye < de; ye++) me[ye] = arguments[ye];
|
|
4375
4378
|
return Ce(() => (Te) => {
|
|
4376
4379
|
me.forEach((Ie) => Ie(Te));
|
|
4377
4380
|
}, me);
|
|
4378
|
-
}(M, W), ae = !!j, Y = ae && !b && uo(u) && uo(E), _ = !G && z, be = _ && Y ? $ : null, Ae = Y ? be ?? (c ?? H)({ rects: D, activeNodeRect: B, activeIndex: u, overIndex: E, index: L }) : null, we = uo(u) && uo(E) ? o({ id: i, items: y, activeIndex: u, overIndex: E }) : L,
|
|
4381
|
+
}(M, W), ae = !!j, Y = ae && !b && uo(u) && uo(E), _ = !G && z, be = _ && Y ? $ : null, Ae = Y ? be ?? (c ?? H)({ rects: D, activeNodeRect: B, activeIndex: u, overIndex: E, index: L }) : null, we = uo(u) && uo(E) ? o({ id: i, items: y, activeIndex: u, overIndex: E }) : L, Ze = j?.id, he = Re({ activeId: Ze, items: y, newIndex: we, containerId: d }), Ke = y !== he.current.items, De = t({ active: j, containerId: d, isDragging: z, isSorting: ae, id: i, index: L, items: y, newIndex: he.current.newIndex, previousItems: he.current.items, previousContainerId: he.current.containerId, transition: s, wasDragging: he.current.activeId != null }), ce = function(de) {
|
|
4379
4382
|
let { disabled: me, index: ye, node: Te, rect: Ie } = de;
|
|
4380
4383
|
const [xe, Ne] = ue(null), Pe = Re(ye);
|
|
4381
4384
|
return Ut(() => {
|
|
4382
4385
|
if (!me && ye !== Pe.current && Te.current) {
|
|
4383
|
-
const
|
|
4384
|
-
if (
|
|
4385
|
-
const
|
|
4386
|
-
(
|
|
4386
|
+
const _e = Ie.current;
|
|
4387
|
+
if (_e) {
|
|
4388
|
+
const h = Tn(Te.current, { ignoreTransform: !0 }), je = { x: _e.left - h.left, y: _e.top - h.top, scaleX: _e.width / h.width, scaleY: _e.height / h.height };
|
|
4389
|
+
(je.x || je.y) && Ne(je);
|
|
4387
4390
|
}
|
|
4388
4391
|
}
|
|
4389
4392
|
ye !== Pe.current && (Pe.current = ye);
|
|
@@ -4394,14 +4397,14 @@ function ks(e) {
|
|
|
4394
4397
|
return Se(() => {
|
|
4395
4398
|
ae && he.current.newIndex !== we && (he.current.newIndex = we), d !== he.current.containerId && (he.current.containerId = d), y !== he.current.items && (he.current.items = y);
|
|
4396
4399
|
}, [ae, we, d, y]), Se(() => {
|
|
4397
|
-
if (
|
|
4398
|
-
if (
|
|
4400
|
+
if (Ze === he.current.activeId) return;
|
|
4401
|
+
if (Ze != null && he.current.activeId == null) return void (he.current.activeId = Ze);
|
|
4399
4402
|
const de = setTimeout(() => {
|
|
4400
|
-
he.current.activeId =
|
|
4403
|
+
he.current.activeId = Ze;
|
|
4401
4404
|
}, 50);
|
|
4402
4405
|
return () => clearTimeout(de);
|
|
4403
|
-
}, [
|
|
4404
|
-
if (ce ||
|
|
4406
|
+
}, [Ze]), { active: j, activeIndex: u, attributes: O, data: q, rect: S, index: L, newIndex: we, items: y, isOver: T, isSorting: ae, isDragging: z, listeners: ne, node: F, overIndex: E, over: A, setNodeRef: ge, setActivatorNodeRef: P, setDroppableNodeRef: M, setDraggableNodeRef: W, transform: ce ?? Ae, transition: function() {
|
|
4407
|
+
if (ce || Ke && he.current.newIndex === L) return Ss;
|
|
4405
4408
|
if (!(_ && !ko(U) || !s) && (ae || De))
|
|
4406
4409
|
return cn.Transition.toString({ ...s, property: $l });
|
|
4407
4410
|
}() };
|
|
@@ -4482,11 +4485,11 @@ const Ms = (e) => {
|
|
|
4482
4485
|
const [j, U] = ue(null), B = function() {
|
|
4483
4486
|
for (var A = arguments.length, P = new Array(A), $ = 0; $ < A; $++) P[$] = arguments[$];
|
|
4484
4487
|
return Ce(() => [...P].filter((ge) => ge != null), [...P]);
|
|
4485
|
-
}(Wo(zl, { activationConstraint: r }), Wo(Fl, { activationConstraint: r }), Wo(rr, { scrollBehavior: "Cypress" in window ? "auto" : void 0, coordinateGetter: c })), O = T.indexOf.bind(T), W = j ? O(j) : -1,
|
|
4488
|
+
}(Wo(zl, { activationConstraint: r }), Wo(Fl, { activationConstraint: r }), Wo(rr, { scrollBehavior: "Cypress" in window ? "auto" : void 0, coordinateGetter: c })), O = T.indexOf.bind(T), W = j ? O(j) : -1, ne = [];
|
|
4486
4489
|
T.map((A, P) => {
|
|
4487
|
-
|
|
4490
|
+
ne.push(p(zs, { id: A, handle: d, index: P, style: s, wrapperStyle: F, disabled: b(A), renderItem: G, animateLayoutChanges: l, useDragOverlay: v, getNewIndex: y }, A + "-" + P));
|
|
4488
4491
|
const $ = H?.({ key: "divider-" + P });
|
|
4489
|
-
$ &&
|
|
4492
|
+
$ && ne.push($);
|
|
4490
4493
|
});
|
|
4491
4494
|
const { getPortalContainer: z } = ci();
|
|
4492
4495
|
return Je(os, { sensors: B, collisionDetection: i, onDragStart: (A) => {
|
|
@@ -4499,7 +4502,7 @@ const Ms = (e) => {
|
|
|
4499
4502
|
}
|
|
4500
4503
|
}, onDragCancel: () => {
|
|
4501
4504
|
U(null);
|
|
4502
|
-
}, measuring: D, modifiers: E, children: [p("div", { style: { display: "flex", justifyContent: "flex-start", boxSizing: "border-box", ...q }, className: Vt(n, $t.Wrapper), children: p(ys, { items: T, strategy: L, children: p(Es, { ref: t, children:
|
|
4505
|
+
}, measuring: D, modifiers: E, children: [p("div", { style: { display: "flex", justifyContent: "flex-start", boxSizing: "border-box", ...q }, className: Vt(n, $t.Wrapper), children: p(ys, { items: T, strategy: L, children: p(Es, { ref: t, children: ne }) }) }), v ? dl(p(fs, { adjustScale: o, dropAnimation: g, children: j ? p(Ul, { value: T[W], handle: d, renderItem: G, wrapperStyle: F({ index: W, isDragging: !0, id: T[W] }), index: W, dragging: !0, style: s({ id: T[W], index: W, isSorting: j !== null, isDragging: !0, overIndex: -1, isDragOverlay: !0 }), dragOverlay: !0 }) : null }), z()) : null] });
|
|
4503
4506
|
}));
|
|
4504
4507
|
function zs({ disabled: e, animateLayoutChanges: t, getNewIndex: n, handle: r, id: l, index: o, onRemove: i, style: c, renderItem: g, useDragOverlay: s, wrapperStyle: y }) {
|
|
4505
4508
|
const { attributes: d, isDragging: u, isSorting: k, listeners: b, overIndex: D, setNodeRef: E, transform: G, transition: H } = ks({ id: l, animateLayoutChanges: t, disabled: e, getNewIndex: n });
|
|
@@ -4517,7 +4520,7 @@ const Fs = "_TabStrip_3x0dp_1", Ns = new tl("rgb(33, 115, 70)"), Ls = "#eee", Os
|
|
|
4517
4520
|
Ne !== v && (S(Ne), c?.(Ne)), M(Ne);
|
|
4518
4521
|
}, [c, v]), U = Xe((xe, Ne) => {
|
|
4519
4522
|
s?.(xe, Ne);
|
|
4520
|
-
}, [s]), B = Re(null), [O, W] = ue(-1),
|
|
4523
|
+
}, [s]), B = Re(null), [O, W] = ue(-1), ne = Xe((xe, Ne) => {
|
|
4521
4524
|
g?.(xe, Ne);
|
|
4522
4525
|
}, [g]);
|
|
4523
4526
|
Bt(() => {
|
|
@@ -4532,37 +4535,37 @@ const Fs = "_TabStrip_3x0dp_1", Ns = new tl("rgb(33, 115, 70)"), Ls = "#eee", Os
|
|
|
4532
4535
|
z.current?.[xe]?.cancel();
|
|
4533
4536
|
} }, A.current), [v, O]);
|
|
4534
4537
|
const P = Xe(({ value: xe, index: Ne, dragging: Pe }) => {
|
|
4535
|
-
const { style:
|
|
4538
|
+
const { style: _e, maxLength: h, ...je } = D || {}, ut = p(xa, { ref: (Qe) => {
|
|
4536
4539
|
z.current[Ne] = Qe;
|
|
4537
|
-
}, value: xe, disabled: E, maxLength:
|
|
4540
|
+
}, value: xe, disabled: E, maxLength: h, style: { color: v === Ne && w ? w?.toRGBA().toString() : "inherit", flex: "1 1 100%", paddingTop: "1px", paddingBottom: "1px", ..._e }, styleHover: {}, onSubmit: (Qe) => (B.current = !1, W(-1), ne(Ne, Qe)), onCancel: () => {
|
|
4538
4541
|
B.current = !1, W(-1);
|
|
4539
4542
|
}, onChange: (Qe) => {
|
|
4540
4543
|
B.current = !0, W(Ne);
|
|
4541
|
-
}, ...
|
|
4544
|
+
}, ...je });
|
|
4542
4545
|
return k({ onClick: (Qe) => j(Qe, Ne), value: xe, index: Ne, editing: O === Ne && B.current, editable: !0, disabled: E, selectedIndex: v, background: H, activeColor: w, borderColor: L, borderWidth: q, dragging: Pe, children: ut });
|
|
4543
|
-
}, [v,
|
|
4546
|
+
}, [v, ne, j, D, E, O, k]), [$, { width: ge }] = dn(), [ae, { width: Y }] = dn(), _ = Re(null), [be, Ae] = ue({ left: 0, top: 0, width: 0, height: 0 }), [we, Ze] = ue(null);
|
|
4544
4547
|
Se(() => {
|
|
4545
4548
|
we !== null && _.current && _.current.scrollTo({ left: we, behavior: "smooth" });
|
|
4546
4549
|
}, [we]);
|
|
4547
4550
|
const he = Xe((xe, Ne = !1) => {
|
|
4548
4551
|
if (!_.current) return 0;
|
|
4549
|
-
let Pe = _.current.firstChild.getBoundingClientRect(),
|
|
4550
|
-
return
|
|
4551
|
-
}, []),
|
|
4552
|
+
let Pe = _.current.firstChild.getBoundingClientRect(), _e = _.current.firstChild.firstChild.children, h = 0;
|
|
4553
|
+
return h = Ne ? 0 : gr.getScrollTo(xe, Pe.left, _e, !0, Math.max(0, xe - 200)), Ze(h), Math.max(0, h);
|
|
4554
|
+
}, []), Ke = Xe((xe, Ne = !1) => {
|
|
4552
4555
|
if (!_.current) return 0;
|
|
4553
|
-
let Pe = _.current.firstChild.getBoundingClientRect(),
|
|
4554
|
-
const
|
|
4555
|
-
return
|
|
4556
|
+
let Pe = _.current.firstChild.getBoundingClientRect(), _e = _.current.firstChild.firstChild.children, h = 0;
|
|
4557
|
+
const je = Math.ceil(Y - ge);
|
|
4558
|
+
return h = Ne ? je : gr.getScrollTo(xe, Pe.left, _e, !1, Math.max(0, xe + 200)), Ze(h), Math.min(je, h);
|
|
4556
4559
|
}, [Y, ge]), De = Re(null), ce = Re(null), de = Xe(() => {
|
|
4557
4560
|
ce.current && (clearTimeout(ce.current), ce.current = null, De.current = null);
|
|
4558
4561
|
}, []), me = Xe((xe, Ne, Pe = 260) => {
|
|
4559
4562
|
De.current = xe, ce.current = setTimeout(() => {
|
|
4560
|
-
const
|
|
4561
|
-
|
|
4563
|
+
const _e = Ne ? he(De.current || xe) : Ke(De.current || xe);
|
|
4564
|
+
_e !== De.current ? me(_e, Ne, 120) : de();
|
|
4562
4565
|
}, Pe);
|
|
4563
|
-
}, [he,
|
|
4566
|
+
}, [he, Ke, de]);
|
|
4564
4567
|
Se(() => () => de(), [de]);
|
|
4565
|
-
const ye = Ce(() => ({ style: { marginLeft: "4px", marginRight: "6px" }, disabled: Math.floor(be.left) <= 0 || Math.floor(Y - ge) === 0, orientation: an.Horizontal, onMouseUp: de, onMouseLeave: de, onMouseDown: () => me(_.current.scrollLeft, !0), onClick: (xe) => he(Math.min(_.current.scrollLeft, we ?? Number.MAX_SAFE_INTEGER), xe.ctrlKey) }), [be, we, Y, ge]), Te = Ce(() => ({ style: { marginLeft: "6px", marginRight: "4px" }, disabled: Math.floor(Y - ge) <= Math.ceil(be.left), orientation: an.Horizontal, onMouseUp: de, onMouseLeave: de, onMouseDown: () => me(_.current.scrollLeft, !1), onClick: (xe) =>
|
|
4568
|
+
const ye = Ce(() => ({ style: { marginLeft: "4px", marginRight: "6px" }, disabled: Math.floor(be.left) <= 0 || Math.floor(Y - ge) === 0, orientation: an.Horizontal, onMouseUp: de, onMouseLeave: de, onMouseDown: () => me(_.current.scrollLeft, !0), onClick: (xe) => he(Math.min(_.current.scrollLeft, we ?? Number.MAX_SAFE_INTEGER), xe.ctrlKey) }), [be, we, Y, ge]), Te = Ce(() => ({ style: { marginLeft: "6px", marginRight: "4px" }, disabled: Math.floor(Y - ge) <= Math.ceil(be.left), orientation: an.Horizontal, onMouseUp: de, onMouseLeave: de, onMouseDown: () => me(_.current.scrollLeft, !1), onClick: (xe) => Ke(Math.max(_.current.scrollLeft, we ?? 0), xe.ctrlKey) }), [be, we, Y, ge]), Ie = Ce(() => Je(Sn, { children: [p("div", { style: { minWidth: "16px" } }), n, u?.(ye)] }), [ye, Te, y, d, n, u]);
|
|
4566
4569
|
return Je("div", { style: { ...r, display: "flex", alignItems: "stretch" }, className: Vt(Fs, l), ref: A, children: [p("div", { style: { borderTop: `solid ${L} ${q}px`, position: "absolute", width: "100%" } }), p("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: Ie }), p("div", { className: "Tabs", ref: $, style: { flex: "1 1 100%", display: "flex", position: "relative", overflow: "hidden" }, children: p("div", { style: { position: "relative", overflowY: "hidden", overflowX: "hidden", marginBottom: "3px" }, ref: _, onScroll: (xe) => {
|
|
4567
4570
|
Ae({ left: xe.target.scrollLeft, top: xe.target.scrollTop, width: xe.target.scrollWidth, height: xe.target.scrollHeight });
|
|
4568
4571
|
}, children: p(Is, { isDisabled: (xe) => E || G, items: F, strategy: ws, modifiers: [Ms], ref: ae, renderItem: P, renderDivider: b, onMove: U, activationConstraint: { distance: 15 } }) }) }), p("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: u(Te) })] });
|
|
@@ -4576,7 +4579,7 @@ const Dd = (e) => {
|
|
|
4576
4579
|
}, Ed = () => {
|
|
4577
4580
|
const e = Xt(sr), [t] = ue(() => new ri());
|
|
4578
4581
|
return Ce(() => e || t, [e]);
|
|
4579
|
-
}, Vs = "_script-editor_iy654_5", Hs = tt.lazy(() => import("./
|
|
4582
|
+
}, Vs = "_script-editor_iy654_5", Hs = tt.lazy(() => import("./DkcoDi-4aZ6TgzgC.mjs")), Ps = { lightbulb: { enabled: !1 }, tabSize: 2, acceptSuggestionOnCommitCharacter: !0, acceptSuggestionOnEnter: "on", accessibilitySupport: "auto", automaticLayout: !0, autoIndent: !1, codeLens: !0, colorDecorators: !0, contextmenu: !0, cursorBlinking: "blink", cursorSmoothCaretAnimation: !1, cursorStyle: "line", disableLayerHinting: !1, disableMonospaceOptimizations: !1, dragAndDrop: !0, glyphMargin: !0, fixedOverflowWidgets: !1, folding: !0, foldingStrategy: "auto", fontLigatures: !1, formatOnPaste: !0, formatOnType: !1, hideCursorInOverviewRuler: !1, highlightActiveIndentGuide: !0, links: !0, lineDecorationsWidth: 8, lineNumbersMinChars: 3, mouseWheelZoom: !1, multiCursorMergeOverlapping: !0, multiCursorModifier: "alt", overviewRulerBorder: !0, overviewRulerLanes: 2, quickSuggestions: !0, quickSuggestionsDelay: 100, readOnly: !1, renderControlCharacters: !1, renderFinalNewline: !0, renderIndentGuides: !0, renderLineHighlight: "all", renderWhitespace: "none", revealHorizontalRightPadding: 30, roundedSelection: !0, rulers: [], scrollBeyondLastColumn: 5, scrollBeyondLastLine: !0, selectOnLineNumbers: !0, selectionClipboard: !0, selectionHighlight: !0, showLightbulbIconMode: !1, showFoldingControls: "mouseover", smoothScrolling: !0, suggestOnTriggerCharacters: !0, wordBasedSuggestions: !0, wordSeparators: `~!@#$%^&*()-=+[{]}|;:'",.<>/?`, wordWrap: "off", wordWrapBreakAfterCharacters: " })]?|&,;", wordWrapBreakBeforeCharacters: "{([+", wordWrapBreakObtrusiveCharacters: ".", wordWrapColumn: 80, wordWrapMinified: !0, wrappingIndent: "none" };
|
|
4580
4583
|
let Bn, Vn, tn = ["define", "require"];
|
|
4581
4584
|
const Jr = async (e, t, n) => {
|
|
4582
4585
|
const r = e.getModel();
|
|
@@ -4667,14 +4670,14 @@ const Ad = ft(wt((e, t) => {
|
|
|
4667
4670
|
const ge = P.monaco, ae = await (async (Y, _, be = "export") => {
|
|
4668
4671
|
const Ae = Y.getModel();
|
|
4669
4672
|
if (!Ae) return null;
|
|
4670
|
-
const we = await _.languages.typescript.getTypeScriptWorker(),
|
|
4671
|
-
let
|
|
4673
|
+
const we = await _.languages.typescript.getTypeScriptWorker(), Ze = await we(Ae.uri), he = await Ze.getNavigationTree(Ae.uri.toString());
|
|
4674
|
+
let Ke = null, De = Y.getSelection();
|
|
4672
4675
|
const ce = De.startLineNumber === De.endLineNumber && De.startColumn === De.endColumn ? Ae.getLineCount() : Math.min(De.endLineNumber, Ae.getLineCount());
|
|
4673
|
-
for (let de = De.startLineNumber; !
|
|
4676
|
+
for (let de = De.startLineNumber; !Ke && de <= ce; de++) {
|
|
4674
4677
|
const me = dr(he, Ae.getOffsetAt({ lineNumber: de, column: 1 }), "function", be);
|
|
4675
|
-
me && (
|
|
4678
|
+
me && (Ke = me.text);
|
|
4676
4679
|
}
|
|
4677
|
-
return
|
|
4680
|
+
return Ke;
|
|
4678
4681
|
})($, ge);
|
|
4679
4682
|
return y?.({ message: (ae ?? "").toUpperCase() }), ae ? { source: $.getValue(), name: ae } : null;
|
|
4680
4683
|
}, [y]), T = ie(async (P, $, ge) => {
|
|
@@ -4682,12 +4685,12 @@ const Ad = ft(wt((e, t) => {
|
|
|
4682
4685
|
ae && (async function(_, be) {
|
|
4683
4686
|
const Ae = [];
|
|
4684
4687
|
for (let we = 1; we < _.getLineCount() + 1; we++) {
|
|
4685
|
-
const
|
|
4686
|
-
he !== -1 && Ae.push({ message: "found 'modelt'", resource: "https://www.sheetxl.com", severity: be.MarkerSeverity.Hint, startLineNumber:
|
|
4688
|
+
const Ze = { startLineNumber: we, startColumn: 1, endLineNumber: we, endColumn: _.getLineLength(we) + 1 }, he = _.getValueInRange(Ze).indexOf("modelt");
|
|
4689
|
+
he !== -1 && Ae.push({ message: "found 'modelt'", resource: "https://www.sheetxl.com", severity: be.MarkerSeverity.Hint, startLineNumber: Ze.startLineNumber, startColumn: he + 1, endLineNumber: Ze.startLineNumber, endColumn: he + 5 });
|
|
4687
4690
|
}
|
|
4688
4691
|
be.editor.setModelMarkers(_, "owner", Ae);
|
|
4689
4692
|
}(P, $), async function(_, be, Ae, we) {
|
|
4690
|
-
const
|
|
4693
|
+
const Ze = await be.languages.typescript.getTypeScriptWorker(), he = await Ze(_.uri), Ke = await he.getNavigationTree(_.uri.toString()), De = Qo(_, be, we, Ke).map((ce) => {
|
|
4691
4694
|
let de = null, me = null;
|
|
4692
4695
|
return ce.type === "formula" ? (de = "formula.margin-icon", me = "Formula") : ce.type === "macro" ? (de = "macro.margin-icon", me = "Macro") : ce.type === "autoRun" && (de = "autorun.margin-icon", me = "Auto Run"), { range: new be.Range(ce.lineNumber, 1, ce.lineNumber, 1), options: { isWholeLine: !1, glyphMarginClassName: de, glyphMarginHoverMessage: { value: me }, stickiness: be.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } };
|
|
4693
4696
|
});
|
|
@@ -4741,7 +4744,7 @@ const Ad = ft(wt((e, t) => {
|
|
|
4741
4744
|
}, []), O = Re(null), W = ie((P, $) => {
|
|
4742
4745
|
u.current = { monaco: $, editor: P }, S(!0), j("Loading Types");
|
|
4743
4746
|
const ge = w.getScripts().getModules().getItems()[0]?.getSource() ?? "";
|
|
4744
|
-
P.setValue(ge), import("./
|
|
4747
|
+
P.setValue(ge), import("./BC91Htcrvw2he2mK.mjs").then((Y) => Y.c).then(async (Y) => {
|
|
4745
4748
|
j(""), Y.AutoTypings.create(P, { shareCache: !0, dontAdaptEditorOptions: !0, monaco: $, onUpdate: (_, be) => {
|
|
4746
4749
|
if (_.type === "LookedUpPackage" && _.success !== void 0) {
|
|
4747
4750
|
const Ae = $.languages.typescript.typescriptDefaults.getDiagnosticsOptions();
|
|
@@ -4768,10 +4771,10 @@ const Ad = ft(wt((e, t) => {
|
|
|
4768
4771
|
});
|
|
4769
4772
|
} }), P.onMouseDown(async (Y) => {
|
|
4770
4773
|
if (Y.target.type === $.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
4771
|
-
const _ = Y.target.position.lineNumber, be = await $.languages.typescript.getTypeScriptWorker(), Ae = await be(ae.uri), we = await Ae.getNavigationTree(ae.uri.toString()),
|
|
4772
|
-
if (
|
|
4774
|
+
const _ = Y.target.position.lineNumber, be = await $.languages.typescript.getTypeScriptWorker(), Ae = await be(ae.uri), we = await Ae.getNavigationTree(ae.uri.toString()), Ze = P?.getValue(), he = (await w?.saveSource(Ze)).getFunctions().getItems(), Ke = Qo(ae, $, he, we).find((De) => De.lineNumber === _);
|
|
4775
|
+
if (Ke) {
|
|
4773
4776
|
const De = Y.event.browserEvent.button;
|
|
4774
|
-
De === 0 ?
|
|
4777
|
+
De === 0 ? Ke.type === "macro" || Ke.type === "autoRun" ? L({ functionName: Ke.name }) : Ke.type === "formula" && w.quickInsertFunction?.(Ke.name) : De === 2 && (console.log("Context menu for function:", Ke.name), Y.event.browserEvent.preventDefault());
|
|
4775
4778
|
}
|
|
4776
4779
|
}
|
|
4777
4780
|
}), P.onDidChangeModelContent(() => {
|
|
@@ -4782,12 +4785,12 @@ const Ad = ft(wt((e, t) => {
|
|
|
4782
4785
|
const ae = P.getModel();
|
|
4783
4786
|
(function(Y, _) {
|
|
4784
4787
|
_.languages.registerInlayHintsProvider("typescript", { provideInlayHints(be, Ae, we) {
|
|
4785
|
-
const
|
|
4788
|
+
const Ze = [];
|
|
4786
4789
|
for (let he = 1; he < be.getLineCount() + 1; he++) {
|
|
4787
|
-
const
|
|
4788
|
-
ce !== -1 &&
|
|
4790
|
+
const Ke = { startLineNumber: he, startColumn: 1, endLineNumber: he, endColumn: be.getLineLength(he) + 1 }, De = "hint", ce = be.getValueInRange(Ke).indexOf("hint");
|
|
4791
|
+
ce !== -1 && Ze.push({ kind: _.languages.InlayHintKind.Type, position: { lineNumber: Ke.startLineNumber, column: ce + De.length + 1 }, label: "[hint]" });
|
|
4789
4792
|
}
|
|
4790
|
-
return { hints:
|
|
4793
|
+
return { hints: Ze, dispose: () => {
|
|
4791
4794
|
} };
|
|
4792
4795
|
} });
|
|
4793
4796
|
})(0, $), ae.onDidChangeContent((Y) => {
|
|
@@ -4796,7 +4799,7 @@ const Ad = ft(wt((e, t) => {
|
|
|
4796
4799
|
}), P.onDidChangeCursorPosition((Y) => {
|
|
4797
4800
|
j();
|
|
4798
4801
|
});
|
|
4799
|
-
}, [w, y]),
|
|
4802
|
+
}, [w, y]), ne = Ce(() => v ? null : g || p("div", { style: { position: "absolute", width: "100%", height: "100%" }, children: "Loading..." }), [v, g]), z = Ce(() => {
|
|
4800
4803
|
if (!v) {
|
|
4801
4804
|
if (!Bn) {
|
|
4802
4805
|
Bn = {};
|
|
@@ -4826,13 +4829,13 @@ const Ad = ft(wt((e, t) => {
|
|
|
4826
4829
|
}
|
|
4827
4830
|
if (!ae) {
|
|
4828
4831
|
$.languages.registerLinkProvider("*", { provideLinks: (_, be) => {
|
|
4829
|
-
const Ae = [], we = { links: Ae },
|
|
4830
|
-
for (let he = 1; he <=
|
|
4831
|
-
const
|
|
4832
|
+
const Ae = [], we = { links: Ae }, Ze = _.getLinesContent();
|
|
4833
|
+
for (let he = 1; he <= Ze.length; he++) {
|
|
4834
|
+
const Ke = Ze[he - 1], De = $.editor.tokenize(Ke, "typescript");
|
|
4832
4835
|
for (let ce = 0; ce < De[0].length; ce++) {
|
|
4833
4836
|
const de = De[0]?.[ce];
|
|
4834
4837
|
if (de && de.type.startsWith("string")) {
|
|
4835
|
-
let me = de.offset, ye = De[0]?.[ce + 1]?.offset ??
|
|
4838
|
+
let me = de.offset, ye = De[0]?.[ce + 1]?.offset ?? Ke.length, Te = new $.Range(he, me + 1, he, ye + 1), Ie = _.getValueInRange(Te);
|
|
4836
4839
|
const xe = Ie[0];
|
|
4837
4840
|
xe !== "`" && xe !== "'" && xe !== '"' || (me++, Ie = Ie.substring(1));
|
|
4838
4841
|
const Ne = Ie[Ie.length - 1];
|
|
@@ -4891,8 +4894,8 @@ const Ad = ft(wt((e, t) => {
|
|
|
4891
4894
|
Bn = void 0;
|
|
4892
4895
|
})(), S(!0);
|
|
4893
4896
|
})();
|
|
4894
|
-
}, onMount: W }) }),
|
|
4895
|
-
}, [w, G, o,
|
|
4897
|
+
}, onMount: W }) }), ne] });
|
|
4898
|
+
}, [w, G, o, ne, c]), A = _t(t, () => ({ isScriptEditorElement: () => !0, focus: (P) => {
|
|
4896
4899
|
B(P);
|
|
4897
4900
|
}, close: () => {
|
|
4898
4901
|
k?.();
|