@sheetxl/react 0.3.0 → 0.3.2
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/LICENSE.md +11 -11
- package/README.md +6 -6
- package/browser/cjs/{BL8hTp8FYM5T9E5f.cjs → D-0WM3WLNkBmpkR7.cjs} +1 -1
- package/browser/cjs/{BQ_91aDM5RxG61kH.cjs → FCohP5dn4iuyOTLc.cjs} +2 -41
- package/browser/cjs/{DwzdPnGwygXdeBcG.cjs → R73-QjsdHTLkTXS-.cjs} +1 -1
- package/browser/cjs/index.cjs +10 -10
- package/browser/esm/{BBXb1iMeHl2-2ySN.mjs → Bmhartce5vI06Jzb.mjs} +8 -67
- package/browser/esm/{CdZhYY-3Yx45v_R1.mjs → Dd5Hw20mgcqmSzz-.mjs} +1 -1
- package/browser/esm/{Cvs8IxShGgM1I_El.mjs → EDdXuzJXIj6ZJJDu.mjs} +1 -1
- package/browser/esm/index.mjs +662 -662
- package/node/assets/style.css +1 -1
- package/node/esm/{C8Rzlfn3M6qoqUcE.mjs → BR0U9m_vjm4t5-Ua.mjs} +1 -1
- package/node/esm/index.mjs +12 -12
- package/package.json +6 -6
package/browser/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import { FormulaError as Xr, NumberFormat as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1tnw9_9 ._viewport-overlay_1tnw9_11{pointer-events:none}._sheetxl-sheet_1tnw9_9 ._viewport-overlay_1tnw9_11 *{pointer-events:initial}._sheetxl-sheet_1tnw9_9 .cell-container>*{overflow:hidden}._sheetxl-sheet_1tnw9_9 .cell-container .text-box{position:absolute}._sheetxl-sheet_1tnw9_9 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1tnw9_9 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1tnw9_9 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1tnw9_9 .cell-container .fill{position:absolute}._sheetxl-sheet_1tnw9_9 .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_1tnw9_1 1.5s infinite alternate}@keyframes _pulse_1tnw9_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1tnw9_9 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1tnw9_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1tnw9_9 .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_1tnw9_9 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1tnw9_9 .cell-container .inc{animation-delay:0s;animation:_increase_1tnw9_1 3s infinite}@keyframes _fadeIn_1tnw9_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1tnw9_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_1tbzy_9 .fill-handle .dragging,._movable-area_1xcl8_9 .moveable-control-box .dragging{opacity:0}._movable-area_1xcl8_9 .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_1xcl8_9 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_1xcl8_9 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_w34rk_11{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_6tyma_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_6tyma_65{0%{opacity:0}to{opacity:1}}._Wrapper_6tyma_49{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_6tyma_49._dragOverlay_6tyma_73{z-index:999}._Item_6tyma_93{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_6tyma_93:not(._withHandle_6tyma_121){touch-action:manipulation}._Item_6tyma_93._dragging_6tyma_131:not(._dragOverlay_6tyma_73){z-index:999}._Item_6tyma_93._dragOverlay_6tyma_73{cursor:inherit;animation:_pop_6tyma_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_11qr0_1{display:flex;box-sizing:border-box}._TabStrip_nciwy_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_nciwy_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_faoxm_9 .monaco-editor{position:absolute}._script-editor_faoxm_9 .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_faoxm_9 .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_faoxm_9 .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_faoxm_9 .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
|
+
import { FormulaError as Xr, NumberFormat as Zt, ICell as Kt, IBorder as At, ITextFrame as pe, GeomUtils as Rt, ScalarType as Pn, IFont as st, IRange as we, LicenseManager as Yr, IColor as Xl, AutoFill as Yl, ISheetView as Qt, Color as Jr, IFill as co, RangeClipboardItem as Jl, ExternalRangeClipboardItem as Ql, TextUtils as Yo, IAnchored as on, CoordUtils as ei, ThemeCollection as ti } from "@sheetxl/sdk";
|
|
3
3
|
import { LicenseManager as Ad } from "@sheetxl/sdk";
|
|
4
|
-
import { ReactUtils as it, useImperativeElement as
|
|
4
|
+
import { ReactUtils as it, useImperativeElement as jt, useCallbackRef as ie, KeyCodes as It, SimpleCommand as Ue, Command as X, KeyModifiers as Q, CommandGroup as yo, useCopyPaste as Qr, useEditMode as dn, useGlobalClipboard as ni, NotificationType as Jo, useCommands as el, ScrollbarOrientation as rn, VirtualScrollbar as oi, MouseButtonCodes as tl, ToolTipPlacement as zn, DefaultNotifier as ri, HorizontalAlignment as li, ScrollPane as ii, useFullscreenPortal as ai, defaultCreateScrollStartButton as si, defaultCreateScrollEndButton as di, defaultCreateScrollEdgeButton as ci, ScrollUtils as sr } from "@sheetxl/utils-react";
|
|
5
5
|
export * from "@sheetxl/utils-react";
|
|
6
6
|
import { jsx as p, jsxs as Je, Fragment as bn } from "react/jsx-runtime";
|
|
7
7
|
import { CommonUtils as ot, AnchorLocation as wt, TypesUtils as Wn, CoordUtils as bt } from "@sheetxl/utils";
|
|
@@ -9,12 +9,12 @@ import tt, { memo as pt, useMemo as ye, useState as ue, forwardRef as vt, useRef
|
|
|
9
9
|
import { STANDARD_KEY_CHARS as pi, useSelection as ol, useHeaderSelection as fi, HeaderRenderer as vi, Grid as rl, HeaderDivider as wi, SELECTION_CLIP_INSETS as $o, defaultSelectionRenderer as yi, useKeyboardEditorOverlay as bi, Selection as ll, SVGLine as ro } from "@sheetxl/grid-react";
|
|
10
10
|
import { unstable_batchedUpdates as Nn, createPortal as il } from "react-dom";
|
|
11
11
|
/**
|
|
12
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.3.
|
|
12
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.3.2
|
|
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.
|
|
16
16
|
*/
|
|
17
|
-
const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e),
|
|
17
|
+
const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), Zs = Object.freeze(Object.defineProperty({ __proto__: null, nowWithPrecision: $n }, Symbol.toStringTag, { value: "Module" })), al = Object.freeze([8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 36, 48, 72]), Uo = (e, t = !0, n = al) => {
|
|
18
18
|
if (!n || n.length === 0) return e;
|
|
19
19
|
if (e === void 0) return n[0];
|
|
20
20
|
if (t && e >= n[n.length - 1] || !t && e <= n[0]) return e;
|
|
@@ -38,12 +38,12 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
38
38
|
}, Ci = (e) => {
|
|
39
39
|
const { value: t, coords: n, bounds: r, children: l, style: o, range: i, zoom: c = 1, view: u, bodyStyle: s, normalStyle: C, showFormulas: d, showZeros: g, docTheme: R, onLinkMouseDown: b, onFilterButtonMouseDown: E, filterButtonProps: A, createFilterButton: U = qi, ...P } = e, w = r.height / c, N = r.width / c, q = t, v = q.getValue(), S = t.getStyle(), L = s?.darkMode ?? !1;
|
|
40
40
|
let M, D;
|
|
41
|
-
const
|
|
41
|
+
const _ = v && v.isFormulaError, $ = _ && v instanceof Xr.Parse;
|
|
42
42
|
let V, O = d || $;
|
|
43
43
|
if (O) if (q.isSpillOverflow()) D = "";
|
|
44
44
|
else {
|
|
45
45
|
const Ve = q.getFormulaText();
|
|
46
|
-
Ve ? D = Ve : M = q.getNumberFormat(
|
|
46
|
+
Ve ? D = Ve : M = q.getNumberFormat(Zt.Type.General);
|
|
47
47
|
}
|
|
48
48
|
else M = q.getNumberFormat();
|
|
49
49
|
O || (V = q.getTextOverflow());
|
|
@@ -51,42 +51,42 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
51
51
|
let B, te = q.getRenderHorizontalAlignment();
|
|
52
52
|
M && (B = M?.formattedRuns, D = B?.runs[0]?.text ?? M.displayText);
|
|
53
53
|
const Se = q.getCalcStatus() === Kt.CalcStatus.Pending;
|
|
54
|
-
let oe = null,
|
|
54
|
+
let oe = null, G = S.getFill().toCSS(L, r), ae = 0, Ae = 0;
|
|
55
55
|
if (!S.getBorder().isEmpty()) {
|
|
56
56
|
const Ve = S.getBorder().getRight();
|
|
57
57
|
!Ve.isNone() && At.BuiltInDefinitions.get(Ve.getStyle()).width > 1 && (ae = 1);
|
|
58
58
|
const x = S.getBorder().getBottom();
|
|
59
|
-
!x.isNone() && At.BuiltInDefinitions.get(x.getStyle()).width > 1 && (
|
|
59
|
+
!x.isNone() && At.BuiltInDefinitions.get(x.getStyle()).width > 1 && (Ae = 1);
|
|
60
60
|
}
|
|
61
61
|
let Fe = null;
|
|
62
|
-
if (N !== I || ae ||
|
|
63
|
-
const { backgroundPosition: Ve, ...x } =
|
|
64
|
-
(Ve !== void 0 || ae ||
|
|
62
|
+
if (N !== I || ae || Ae || typeof G?.backgroundPosition == "number") {
|
|
63
|
+
const { backgroundPosition: Ve, ...x } = G, ne = Ve ?? 0, F = u?.getScrollTopLeft(), Z = ne ? -(r.x + (F.left ?? 0)) % ne : 0, a = ne ? -(r.y + (F.top ?? 0)) % ne : 0;
|
|
64
|
+
(Ve !== void 0 || ae || Ae || N !== I) && (Object.keys(x).length === 1 && x.background === "none" || (G = null, Fe = p("div", { className: "fill", style: { marginLeft: `${Z}px`, marginTop: `${a}px`, left: y * c, width: it.boundPixel(I * c - Z + 1 + ae), height: it.boundPixel(r.height - a + 1 + Ae), ...x } }, "background")));
|
|
65
65
|
}
|
|
66
66
|
let fe = null;
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
67
|
+
const _e = q.getComments(), ve = q.getWarnings(), Ge = q.getErrors();
|
|
68
|
+
if (_e || _ || Ge.length > 0 || ve.length > 0) {
|
|
69
69
|
const Ve = { size: 7 * c, darkMode: L, cellWidth: I * c + 2, cellHeight: w * c + 2, style: { top: -1, left: y * c - 1 } };
|
|
70
|
-
fe = fe ?? [], (ve.length > 0 ||
|
|
70
|
+
fe = fe ?? [], (ve.length > 0 || Ge.length > 0 || _) && fe.push(p(dr, { anchorLocation: wt.TopLeft, ...Ve }, `indicator-${fe.length}`)), _e && fe.push(p(dr, { anchorLocation: wt.TopRight, ...Ve }, `indicator-${fe.length}`));
|
|
71
71
|
}
|
|
72
72
|
const De = S.getFont();
|
|
73
73
|
let ge = M?.conditionalColor;
|
|
74
74
|
const ce = S.getAlignment(), ke = ce.getHorizontal() === pe.HorizontalAlignment.Fill, de = ce.getHorizontal() === pe.HorizontalAlignment.CenterContinuous || ke, xe = de || O ? 0 : ce.getRotation(), Oe = q.getInsets(), qe = Oe.top + Oe.bottom;
|
|
75
75
|
let Le = Oe.left, We = Oe.right;
|
|
76
|
-
const
|
|
76
|
+
const Ze = { ...o, left: o.left - 1, top: o.top - 1, width: o.width + 1 + ae, height: o.height + 1 + Ae }, m = q.getColumnFilter(), Ke = m && !m?.hasHiddenButton();
|
|
77
77
|
let ct = null;
|
|
78
78
|
Se && (ct = Je("div", { className: "slider", children: [p("div", { className: "line" }), p("div", { className: "subline inc" })] }, "pending"));
|
|
79
79
|
const Qe = !(Se || Ke || Fe || l || fe || B?.runs.length > 1 || V || xe % 360 != 0);
|
|
80
|
-
|
|
80
|
+
G?.background === "none" && (G = null);
|
|
81
81
|
let K = de || !(!V || !(V.rightIndex > 0 || V.leftIndex > 0 || V.colSpan > 1));
|
|
82
82
|
if (!K) {
|
|
83
83
|
const Ve = q.getSpans();
|
|
84
84
|
(Ve.width > 1 || Ve.height > 1) && (K = !0);
|
|
85
85
|
}
|
|
86
|
-
const Ne = { ...
|
|
86
|
+
const Ne = { ...G, ...Ze, pointerEvents: b ? "auto" : void 0 };
|
|
87
87
|
if (!ot.isEmpty(D) || !ot.isEmpty(M?.repeatPlaceholder)) {
|
|
88
88
|
const Ve = M?.canWrap ?? !1;
|
|
89
|
-
let x = null, ne = null, F = null,
|
|
89
|
+
let x = null, ne = null, F = null, Z = [], a = !0;
|
|
90
90
|
g || O || v !== 0 || (a = !1);
|
|
91
91
|
const k = q.getTextFrame(O);
|
|
92
92
|
if (a && k) {
|
|
@@ -145,12 +145,12 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
145
145
|
ne.width = he.width, ne.height = he.height;
|
|
146
146
|
}
|
|
147
147
|
te === pe.HorizontalAlignment.Center || te === pe.HorizontalAlignment.CenterContinuous ? ne.x = (W - ne.width) / 2 : te === pe.HorizontalAlignment.Right ? ne.x = W - ne.width - 0.5 : ne.x = 0.5, ce.getVertical() === pe.VerticalAlignment.Center ? ne.y = (w - ne.height) / 2 : ce.getVertical() === pe.VerticalAlignment.Bottom ? ne.y = w - ne.height - qe : ne.y = qe;
|
|
148
|
-
const
|
|
148
|
+
const j = Qe ? { ...P } : void 0, J = { style: { left: o.left - 1, top: o.top - 1, width: o.width + 1, height: o.height + 1, transform: xe ? `rotate(${xe}deg)` : void 0, cursor: b ? "pointer" : void 0, pointerEvents: b ? "auto" : void 0, zIndex: K ? 1 : void 0, ...G }, onMouseDown: b, onDoubleClick: b ? (se) => {
|
|
149
149
|
se.stopPropagation(), se.preventDefault();
|
|
150
|
-
} : null, ...
|
|
150
|
+
} : null, ...j };
|
|
151
151
|
$ && (J.style.textDecorationStyle = "wavy", J.style.textDecorationColor = L ? "rgb(0, 255, 255)" : "red", J.style.textDecorationLine = "underline");
|
|
152
152
|
const re = De.getSize(), le = (se, Ce, he, me, Re, Pe, Be, et = null) => {
|
|
153
|
-
let $e = re * c, Ee = he, rt = Be?.runs ? Be.runs : [{ type:
|
|
153
|
+
let $e = re * c, Ee = he, rt = Be?.runs ? Be.runs : [{ type: Zt.ParseRunType.Text, text: se, width: S.measureText(se, $e).width }];
|
|
154
154
|
Be && Be?.width !== x.width && (x = { ...x, width: Be?.width });
|
|
155
155
|
let qt = Le;
|
|
156
156
|
if (Be?.lastRepeatIndex >= 0 && T > Be?.width) {
|
|
@@ -162,31 +162,31 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
162
162
|
const Mt = Math.floor(Nt / nt.width);
|
|
163
163
|
Lt = Mt > 0 ? nt.text.repeat(Mt) : "", Bt = Nt;
|
|
164
164
|
}
|
|
165
|
-
ft[Be.lastRepeatIndex] = { type:
|
|
165
|
+
ft[Be.lastRepeatIndex] = { type: Zt.ParseRunType.Repeat, text: Lt, width: Bt }, rt = ft, x = { ...x, width: Be.width + Bt };
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
const Ct = (nt, ft, Nt, Bt, Lt, Mt, yt, Yt, cn, kn = null) => {
|
|
169
169
|
let tn, Rn = Ee.width;
|
|
170
170
|
Re === pe.HorizontalAlignment.Justify ? (Rn = Lt, Pe || (tn = "justify")) : Re === pe.HorizontalAlignment.Distributed && (Rn = Lt, tn = Pe || nt.text.split(" ").length - 1 == 0 ? "center" : "justify");
|
|
171
|
-
const { style:
|
|
171
|
+
const { style: Gt, className: Xn, ...Yn } = kn;
|
|
172
172
|
let un = nt.text;
|
|
173
173
|
if (Re === pe.HorizontalAlignment.Fill && M?.repeatChars.length === 0) {
|
|
174
174
|
const xt = Math.max(1, Math.floor((Ee?.width ?? 0) / (yt?.width ?? 1)));
|
|
175
175
|
un = un.repeat(xt);
|
|
176
176
|
}
|
|
177
|
-
let
|
|
177
|
+
let _t = Ee.height;
|
|
178
178
|
const nn = De.getVerticalAlignment(), Tn = nn === st.VerticalAlignment.Sub, ko = nn === st.VerticalAlignment.Super;
|
|
179
179
|
if (Tn || ko) {
|
|
180
180
|
const xt = De.getSuperSubScale();
|
|
181
|
-
$e *= xt,
|
|
181
|
+
$e *= xt, _t *= xt;
|
|
182
182
|
}
|
|
183
|
-
const ht = { textAlign: tn, textAlignLast: tn, background: void 0, ...
|
|
183
|
+
const ht = { textAlign: tn, textAlignLast: tn, background: void 0, ...Gt, ...De.toCSS(L, c, !0), fontSize: $e * st.getDeviceScale() };
|
|
184
184
|
ge && (ht.color = ge.toCSS(L));
|
|
185
185
|
const Mn = qt + ft;
|
|
186
186
|
let gn = Oe.top + Ee.y + 0;
|
|
187
187
|
if (Tn && (gn += cn - $e), Mt) {
|
|
188
188
|
const xt = (yt.x + Mn) * c + 1, Dt = (yt.y + gn) * c + 1;
|
|
189
|
-
Dt < 0 ? ht.marginTop = Dt : ht.paddingTop = Dt, xt < 0 ? (ht.width = (
|
|
189
|
+
Dt < 0 ? ht.marginTop = Dt : ht.paddingTop = Dt, xt < 0 ? (ht.width = (Gt?.width ?? 0) - xt, ht.left = (Gt?.left ?? 0) + xt) : ht.paddingLeft = xt, ht.paddingRight = Math.max(0, (Gt?.width ?? 0) - Rn * c - xt), ht.paddingBottom = Math.max(0, (Gt?.height ?? 0) - Ee.height * c - Dt), ht.height = (Gt?.height ?? 0) + (Dt < 0 ? -Dt : 0), (Dt < 0 || xt < 0) && (ht.clipPath = `inset(${Dt < 0 ? -Dt : 0}px 0px 0px ${xt < 0 ? 1 - xt : 0}px)`);
|
|
190
190
|
} else if (ht.left = (yt.x + Mn) * c + 1, ht.top = (yt.y + gn) * c + 1, ht.width = yt.width * c, ht.height = yt.height * c, xe && !Ve) {
|
|
191
191
|
ht.left = (yt.x + ft) * c + 1, ht.top = (yt.y + (Ee.y + 0)) * c + 1;
|
|
192
192
|
const xt = Rt.centerPoint({ x: qt + ft, y: 0, width: nt.width, height: Ee.height }), Dt = Rt.centerPoint({ x: qt, y: 0, width: Lt, height: Ee.height }), Dn = Rt.rotatePoints([xt], xe, Dt), Qn = { x: Dn[0].x - xt.x, y: Dn[0].y - xt.y };
|
|
@@ -196,9 +196,9 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
196
196
|
const mn = Rt.centerPoint(hn), to = { x: mn.x - Dt.x, y: mn.y - Dt.y };
|
|
197
197
|
ht.left = ht.left + to.x * c, ht.top = ht.top + to.y * c;
|
|
198
198
|
}
|
|
199
|
-
ht.lineHeight =
|
|
199
|
+
ht.lineHeight = _t * c + "px";
|
|
200
200
|
const Jn = Qe ? void 0 : "text-line";
|
|
201
|
-
|
|
201
|
+
Z.push(p("div", { className: Xn ? `${Xn} ${Jn}` : Jn, style: ht, ...Yn, children: un }, `text-${Ee.y}-${Bt}-${Nt}`));
|
|
202
202
|
};
|
|
203
203
|
if (ce.getOverflow() === pe.Overflow.Shrink && T > 0) {
|
|
204
204
|
let nt = x?.width ?? 0, ft = 0;
|
|
@@ -211,7 +211,7 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
211
211
|
const Ht = rt.length;
|
|
212
212
|
for (let nt = 0; nt < Ht; nt++) {
|
|
213
213
|
const ft = rt[nt];
|
|
214
|
-
(ft.type ===
|
|
214
|
+
(ft.type === Zt.ParseRunType.Text || ft.type === Zt.ParseRunType.Repeat) && (ft.type, Zt.ParseRunType.Repeat, Ct(ft, Ft, nt, Ce, Re === pe.HorizontalAlignment.Justify || Re === pe.HorizontalAlignment.Distributed || Be?.lastRepeatIndex >= 0 ? T : Ee.width, Qe, { x: ne.x + ee, y: ne.y, width: ft.width, height: x.height }, 0, me, et)), Ft += ft.width;
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
217
|
z ? le(z, 0, { x: 0, y: 0, ...x }, H.lines[0].baseline, te, !0, null, J) : H.visitLines({ visitTextLine: (se, Ce, he) => {
|
|
@@ -223,46 +223,46 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
223
223
|
le(me, Ce, et, k.lines[0].baseline, Pe, Re, he === 1 ? B : null, Qe && Ce > 0 ? { ...J, style: { ...J.style, background: void 0 } } : J);
|
|
224
224
|
} });
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
Z.length > 0 && (oe = Z);
|
|
227
227
|
}
|
|
228
228
|
if (Qe) return oe && oe.length > 0 ? oe : p("div", { style: Ne, ...P });
|
|
229
|
-
let
|
|
229
|
+
let je = b ? "auto" : Ze.pointerEvents, ze = null;
|
|
230
230
|
if (Ke) {
|
|
231
231
|
const Ve = { x: y * c - 1, y: -1, width: I * c + 1, height: w * c + 1 };
|
|
232
|
-
|
|
232
|
+
je = "auto", ze = U({ renderBounds: Ve, darkMode: L, className: "filter-button", disabled: !q.isEditAllowed(), zoom: c, filter: q.getColumnFilter(), onFilterButtonMouseDown: E, ...A }), ze && (ze = p("div", { style: { ...Ve, position: "absolute", zIndex: 2, display: "flex", alignItems: "end" }, onDoubleClick: (x) => {
|
|
233
233
|
x.stopPropagation(), x.preventDefault();
|
|
234
234
|
}, children: ze }, "filterButton"));
|
|
235
235
|
}
|
|
236
236
|
Se && !oe && (oe = p("div", { style: { position: "absolute", left: 0, right: 0, top: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", pointerEvents: "none" }, children: "..." }, "pending-ellipsis"));
|
|
237
237
|
const He = [Fe, oe, l, fe, ct, ze];
|
|
238
|
-
return p("div", { style: { ...
|
|
238
|
+
return p("div", { style: { ...G, ...Ze, pointerEvents: je }, ...P, children: He });
|
|
239
239
|
}, cr = { text: "", placeholder: "" }, ur = (e, t) => {
|
|
240
240
|
if (!e.clean().getStyle().getNumberFormat().endsWith("%")) return !1;
|
|
241
241
|
const n = t ?? e.dirty ?? "";
|
|
242
242
|
return n.length === 0 || n.endsWith("%") && !isNaN(parseFloat(n.substring(0, n.length - 1)));
|
|
243
243
|
}, xi = Object.freeze([It.Delete, It.Home, It.End]), Si = pt(vt((e, t) => {
|
|
244
|
-
const { editState: n, onStartEdit: r, onChangeEdit: l, onSubmitEdit: o, onCancelEdit: i, onDoneEdit: c, defaultTextStyle: u, useRichStyling: s = !0, bodyStyle: C, activeCoords: d, sheet: g, commands: R, containerBounds: b, setNaturalDimensions: E, onFocus: A, disabled: U, style: P, zoom: w = 1, linesVisible: N, autoFocus: q = !1, ...v } = e, { height: S = 0, width: L = 0 } = b ?? {}, M = C?.darkMode ?? !1, D = Te(null), [
|
|
244
|
+
const { editState: n, onStartEdit: r, onChangeEdit: l, onSubmitEdit: o, onCancelEdit: i, onDoneEdit: c, defaultTextStyle: u, useRichStyling: s = !0, bodyStyle: C, activeCoords: d, sheet: g, commands: R, containerBounds: b, setNaturalDimensions: E, onFocus: A, disabled: U, style: P, zoom: w = 1, linesVisible: N, autoFocus: q = !1, ...v } = e, { height: S = 0, width: L = 0 } = b ?? {}, M = C?.darkMode ?? !1, D = Te(null), [_, $] = ue(!1), [V, O] = ue(null), [W, ee] = ue(() => n);
|
|
245
245
|
be(() => {
|
|
246
|
-
|
|
246
|
+
Ae.current = !1, ee(n);
|
|
247
247
|
}, [n]);
|
|
248
248
|
const I = ye(() => {
|
|
249
249
|
const x = W.clean();
|
|
250
250
|
let ne = x.getStyle();
|
|
251
251
|
s || (ne = ne.createTemporaryStyle({ font: { size: u?.fontSize } }));
|
|
252
|
-
const F = x.getFormula(),
|
|
252
|
+
const F = x.getFormula(), Z = ne.getAlignment(), a = F ? pe.HorizontalAlignment.Left : Z.getHorizontal(), k = Z.getVertical(), T = Z.getOverflow() === pe.Overflow.Wrap || x.getType() === Pn.String && (a === pe.HorizontalAlignment.Justify || a === pe.HorizontalAlignment.Distributed || k === pe.VerticalAlignment.Justify || k === pe.VerticalAlignment.Distributed), f = ((H) => {
|
|
253
253
|
if (!H) return cr;
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
let J =
|
|
254
|
+
const j = H.clean();
|
|
255
|
+
if (!j) return cr;
|
|
256
|
+
let J = j.getStyle()?.getQuotePrefix();
|
|
257
257
|
if (H.dirty === void 0 || H.dirty === null) {
|
|
258
|
-
let re = "", le =
|
|
259
|
-
le && (re = le, J = !1), re || (re =
|
|
258
|
+
let re = "", le = j.getFormulaText();
|
|
259
|
+
le && (re = le, J = !1), re || (re = j.toTextUnformatted(!0) ?? "");
|
|
260
260
|
let se = "";
|
|
261
|
-
if (!H.editMode &&
|
|
262
|
-
const Ce =
|
|
261
|
+
if (!H.editMode && j.isSpillOverflow()) {
|
|
262
|
+
const Ce = j.getSpill();
|
|
263
263
|
if (Ce) {
|
|
264
264
|
const he = Ce.getCell(), me = he.getFormulaText();
|
|
265
|
-
he.isEqual(
|
|
265
|
+
he.isEqual(j) || (se = me);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
return J && (re = "'" + re), { text: re, placeholder: se };
|
|
@@ -270,7 +270,7 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
270
270
|
return { text: H.dirty ?? "", placeholder: "" };
|
|
271
271
|
})(W), z = f.text, h = pe.toCSSHorizontalTextAlign(s && !F ? W.clean()?.getRenderHorizontalAlignment() : pe.HorizontalAlignment.Left);
|
|
272
272
|
return { style: ne, isWrapped: T, textValue: z, formula: F, frameVertAlign: k, placeholder: f.placeholder, insets: s ? x.getInsets() : Wn.EmptyRect, textAlign: h };
|
|
273
|
-
}, [W, u, M, w, s]), y = Te(null), B =
|
|
273
|
+
}, [W, u, M, w, s]), y = Te(null), B = jt(t, () => ({ startEdit: (x) => {
|
|
274
274
|
D.current = x?.initialSelection;
|
|
275
275
|
const ne = { ...n, editMode: x?.editMode ?? !1 };
|
|
276
276
|
x?.text !== void 0 && (ne.dirty = x.text), ne.editMode === n.editMode && ne.dirty === n.dirty || (ee(ne), oe?.(ne));
|
|
@@ -282,21 +282,21 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
282
282
|
y.current.focus();
|
|
283
283
|
}, getLineHeight: Se }), [r, n]);
|
|
284
284
|
Ot(() => {
|
|
285
|
-
if (!V || !
|
|
285
|
+
if (!V || !_) return;
|
|
286
286
|
const x = y.current;
|
|
287
287
|
I.textValue, x && x.setSelectionRange(V.start, V.end, V.direction);
|
|
288
288
|
}, [y.current, V, I.textValue]);
|
|
289
289
|
const te = ye(() => {
|
|
290
290
|
const x = W?.clean(), ne = I.style.createTemporaryTextFrame(I.textValue, x?.getType() === Pn.String), F = s ? x.getInsets().right + x.getInsets().left : 0;
|
|
291
|
-
let
|
|
292
|
-
return I.isWrapped && (
|
|
291
|
+
let Z = null;
|
|
292
|
+
return I.isWrapped && (Z = { width: L - F }), ne.layout(Z);
|
|
293
293
|
}, [I, L, W, s]), Se = ie(() => Math.ceil(te?.lines[0]?.bounds.height), [te]);
|
|
294
294
|
Ot(() => {
|
|
295
295
|
if (!te) return;
|
|
296
|
-
const x = I.style, ne = x.getInsets() ?? Wn.EmptyRect, F = s ? ne.left + ne.right : 0,
|
|
296
|
+
const x = I.style, ne = x.getInsets() ?? Wn.EmptyRect, F = s ? ne.left + ne.right : 0, Z = s ? 0.04 * x.getFont().getSize() : 1, a = Math.round(I.isWrapped ? void 0 : te.bounds.width + F + Z), k = Math.round(te.bounds.height);
|
|
297
297
|
E?.({ width: a, height: k });
|
|
298
298
|
}, [te, E, I, s, W]);
|
|
299
|
-
const oe = ie(l, [l]),
|
|
299
|
+
const oe = ie(l, [l]), G = ie((x) => {
|
|
300
300
|
if (W.dirty === x) return;
|
|
301
301
|
const ne = { ...W };
|
|
302
302
|
ne.dirty = x, y.current, ee(ne), oe?.(ne);
|
|
@@ -304,33 +304,33 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
304
304
|
if (W.editMode === x) return;
|
|
305
305
|
const ne = { ...W };
|
|
306
306
|
ne.editMode = x, ee(ne), oe?.(ne);
|
|
307
|
-
}, [W]),
|
|
308
|
-
if (
|
|
307
|
+
}, [W]), Ae = Te(!1), Fe = ie(() => {
|
|
308
|
+
if (Ae.current) return !1;
|
|
309
309
|
try {
|
|
310
|
-
o?.(W), c?.(),
|
|
310
|
+
o?.(W), c?.(), Ae.current = !0;
|
|
311
311
|
} catch {
|
|
312
312
|
return !1;
|
|
313
313
|
}
|
|
314
314
|
return !0;
|
|
315
315
|
}, [o, W]), fe = ie(() => {
|
|
316
|
-
|
|
317
|
-
}, [i, n]),
|
|
316
|
+
Ae.current = !0, ee(n), i?.(), c?.();
|
|
317
|
+
}, [i, n]), _e = ie((x) => {
|
|
318
318
|
if (!y.current) return;
|
|
319
319
|
if (x.key, x.isDefaultPrevented(), !(x.isTrusted || x.nativeEvent.ctrlKey || x.nativeEvent.metaKey || x.nativeEvent.altKey || x.nativeEvent.isComposing || pi.indexOf(x.nativeEvent.key) === -1 && x.nativeEvent.key !== "Backspace")) {
|
|
320
320
|
const f = { ...W };
|
|
321
321
|
let z = 0;
|
|
322
322
|
return ur(f, f.dirty) && !isNaN(parseFloat(x.key)) ? (f.dirty?.endsWith("%") ? f.dirty = (f.dirty.substring(0, f.dirty.length - 1) ?? "") + x.key + "%" : f.dirty = (f.dirty ?? "") + x.key + "%", z = f.dirty.length - 1) : x.nativeEvent.key === "Backspace" ? (f.dirty = "", z = f.dirty.length) : (f.dirty = (f.dirty ?? "") + x.key, z = f.dirty.length), y.current.value = f?.dirty, D.current = { start: z, end: z, direction: "forward" }, y.current?.setSelectionRange(z, z, "forward"), ee(f), oe?.(f), void x.preventDefault();
|
|
323
323
|
}
|
|
324
|
-
const ne = x.nativeEvent.ctrlKey, F = x.nativeEvent.shiftKey,
|
|
324
|
+
const ne = x.nativeEvent.ctrlKey, F = x.nativeEvent.shiftKey, Z = x.nativeEvent.altKey, a = x.nativeEvent.metaKey;
|
|
325
325
|
if (ne && x.key === "z" && x.stopPropagation(), x.which === It.Escape) return x.preventDefault(), void fe();
|
|
326
326
|
if (x.which === It.F2) return ae(!0), void x.preventDefault();
|
|
327
327
|
const k = x.target;
|
|
328
328
|
if (x.key === "%" && k.selectionStart === k.selectionEnd && k.value[k.selectionStart] === "%" && W?.clean().getStyle().numberFormat.includes("%")) return O({ start: k.selectionStart + 1, end: k.selectionEnd + 1, direction: k.selectionDirection }), void x.preventDefault();
|
|
329
329
|
if (x.which === It.Enter) {
|
|
330
|
-
if (x.preventDefault(), a ||
|
|
330
|
+
if (x.preventDefault(), a || Z) {
|
|
331
331
|
const f = I.textValue.substring(0, k.selectionStart) + `
|
|
332
332
|
` + I.textValue.substring(k.selectionEnd);
|
|
333
|
-
return
|
|
333
|
+
return G(f), void O({ start: k.selectionStart + 1, end: k.selectionStart + 1, direction: k.selectionDirection });
|
|
334
334
|
}
|
|
335
335
|
return void (Fe() && g.getSelection().traverse(we.Orientation.Column, F));
|
|
336
336
|
}
|
|
@@ -349,14 +349,14 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
349
349
|
case It.Down:
|
|
350
350
|
T = we.Direction.Down;
|
|
351
351
|
}
|
|
352
|
-
if (T && !(ne || F ||
|
|
352
|
+
if (T && !(ne || F || Z || a) && !W.editMode)
|
|
353
353
|
return void Fe();
|
|
354
354
|
W.editMode && (T || xi.includes(x.which)) && x.stopPropagation();
|
|
355
355
|
}, [W, g, I]), ve = Ye(() => {
|
|
356
356
|
y.current?.focus(), setTimeout(() => {
|
|
357
357
|
y.current?.select();
|
|
358
358
|
}, 0);
|
|
359
|
-
}, []),
|
|
359
|
+
}, []), Ge = Ye(() => {
|
|
360
360
|
y.current?.focus(), console.log("implement toggleRelativeReferences");
|
|
361
361
|
}, []), De = ie(() => {
|
|
362
362
|
const x = y.current?.value;
|
|
@@ -365,7 +365,7 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
365
365
|
const F = g.getRange({ rowIndex: d.rowIndex - 1, colIndex: d.colIndex }).getCell();
|
|
366
366
|
F && (ne = F.toTextUnformatted(!0));
|
|
367
367
|
}
|
|
368
|
-
|
|
368
|
+
G(x + ne);
|
|
369
369
|
}, [d, g]);
|
|
370
370
|
be(() => g.getRange(d).addListener(() => {
|
|
371
371
|
const x = { ...W, clean: () => g.getRange(d).getCell() };
|
|
@@ -373,25 +373,25 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
373
373
|
}), [d, g]);
|
|
374
374
|
const ge = Ye(() => {
|
|
375
375
|
const x = W.clean().createTemporaryCell({ value: $n(), style: { numberFormat: "Medium Time" } }).toText();
|
|
376
|
-
|
|
376
|
+
G((y.current?.value ?? "") + x);
|
|
377
377
|
}, [g]), ce = Ye(() => {
|
|
378
378
|
const x = W.clean().createTemporaryCell({ value: $n(), style: { numberFormat: "Short Date" } }).toText();
|
|
379
|
-
|
|
379
|
+
G((y.current?.value ?? "") + x);
|
|
380
380
|
}, [g]), ke = ye(() => ({ element: () => y.current, doCopy: (x) => {
|
|
381
381
|
const ne = y.current.value.substring(y.current.selectionStart, y.current.selectionEnd);
|
|
382
382
|
if (x?.isCut) {
|
|
383
383
|
const F = y.current.value.substring(0, y.current.selectionStart) + y.current.value.substring(y.current.selectionEnd, y.current.value.length);
|
|
384
|
-
|
|
384
|
+
G(F);
|
|
385
385
|
}
|
|
386
386
|
return ne;
|
|
387
387
|
} }), [y.current]), de = ye(() => ({ element: () => y.current, doPaste: async (x, ne) => {
|
|
388
388
|
const F = await x.toText?.();
|
|
389
389
|
if (!F) return !0;
|
|
390
|
-
const
|
|
391
|
-
return Z
|
|
390
|
+
const Z = y.current.value.substring(0, y.current.selectionStart) + F + y.current.value.substring(y.current.selectionEnd, y.current.value.length);
|
|
391
|
+
return G(Z), O({ start: y.current.selectionStart + F.length, end: y.current.selectionStart + F.length, direction: "forward" }), !0;
|
|
392
392
|
} }), [y.current]), xe = ye(() => ({ contains: (x) => y.current?.contains(x) || !1, focus() {
|
|
393
393
|
y.current.focus();
|
|
394
|
-
} }), []), Oe = ye(() => [new Ue("selectAll", xe, { label: "Select All", description: "Select all of the text in cell.", shortcut: { key: "a", modifiers: [Q.Ctrl] } }, ve), new Ue("startEditValueAbove", xe, { 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: [Q.Ctrl] }, { key: '"', modifiers: [Q.Ctrl, Q.Shift] }] }, De), new Ue("startEditCurrentTime", xe, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl, Q.Shift] } }, ge), new Ue("startEditCurrentDate", xe, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl] } }, ce), new X("relativeReferencesToggle", xe, { label: "Toggle References", description: "Toggles cell references from relative to absolute, to partially absolute, back to relative again.", shortcut: { key: "F4" } },
|
|
394
|
+
} }), []), Oe = ye(() => [new Ue("selectAll", xe, { label: "Select All", description: "Select all of the text in cell.", shortcut: { key: "a", modifiers: [Q.Ctrl] } }, ve), new Ue("startEditValueAbove", xe, { 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: [Q.Ctrl] }, { key: '"', modifiers: [Q.Ctrl, Q.Shift] }] }, De), new Ue("startEditCurrentTime", xe, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl, Q.Shift] } }, ge), new Ue("startEditCurrentDate", xe, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl] } }, ce), new X("relativeReferencesToggle", xe, { label: "Toggle References", description: "Toggles cell references from relative to absolute, to partially absolute, back to relative again.", shortcut: { key: "F4" } }, Ge), new X("toggleEditorFocus", xe, { label: "Toggle Editor Focus", description: "Moves focus between editors such as formula editor and inline editor.", shortcut: { key: "F2", modifiers: [Q.Ctrl] } })], []), qe = ye(() => {
|
|
395
395
|
let x = null;
|
|
396
396
|
const ne = () => ({ contains: (F) => y.current?.contains(F) || !1, focus() {
|
|
397
397
|
y.current.focus();
|
|
@@ -399,24 +399,24 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
399
399
|
return x = R ? R.createChildGroup(ne, "editor", !1) : new yo(ne, "editor"), x.addCommands(Oe, !0), x;
|
|
400
400
|
}, [R, Oe]), Le = ye(() => ({ notifier: null, source: ke, target: de, commands: qe }), [ke, de, qe]);
|
|
401
401
|
Qr(Le);
|
|
402
|
-
const [We,
|
|
402
|
+
const [We, Ze] = ue(!q);
|
|
403
403
|
be(() => {
|
|
404
|
-
|
|
404
|
+
Ze(!1);
|
|
405
405
|
}, []);
|
|
406
406
|
const m = ie((x) => {
|
|
407
407
|
$(!0), qe?.activate();
|
|
408
408
|
const ne = D.current;
|
|
409
409
|
if (ne !== !1) {
|
|
410
|
-
let F,
|
|
410
|
+
let F, Z;
|
|
411
411
|
const a = y.current.value;
|
|
412
|
-
ur(W, a) && (F = a.length - 1,
|
|
412
|
+
ur(W, a) && (F = a.length - 1, Z = a.length - 1), F = ne?.start ?? F ?? a.length, Z = ne?.end ?? Z ?? a.length, D.current = !1, O({ start: F, end: Z, direction: "forward" });
|
|
413
413
|
}
|
|
414
414
|
A?.(x);
|
|
415
415
|
}, [A, W]), Ke = I.insets;
|
|
416
416
|
let ct = Ke.left + 1;
|
|
417
417
|
const Qe = Ke.left + Ke.right + 2 - 1, K = te?.bounds.height ?? 0;
|
|
418
|
-
let Ne,
|
|
419
|
-
I.frameVertAlign === pe.VerticalAlignment.Center ?
|
|
418
|
+
let Ne, je = Ke.top;
|
|
419
|
+
I.frameVertAlign === pe.VerticalAlignment.Center ? je = Math.max(0, (S - (Ke.top + Ke.bottom) - K) / 2) : I.frameVertAlign === pe.VerticalAlignment.Bottom && (je = Math.max(0, S - (Ke.top + Ke.bottom) - K)), N !== void 0 && te?.lines[0]?.bounds && (Ne = te?.lines[0]?.bounds.height * N);
|
|
420
420
|
const ze = I.style.getFont();
|
|
421
421
|
let He = ze.getSize();
|
|
422
422
|
ze.isSuperSub() && (He *= ze.getSuperSubScale()), He *= st.getDeviceScale() * w;
|
|
@@ -425,14 +425,14 @@ const $n = (e = 6e4) => new Date(Math.floor(Date.now() / e) * e), js = Object.fr
|
|
|
425
425
|
y.current && document.activeElement !== y.current && requestAnimationFrame(() => {
|
|
426
426
|
y.current.focus();
|
|
427
427
|
});
|
|
428
|
-
}, ref: B, ...v, style: { display: "flex", flexGrow: 1, alignSelf: "stretch", height: "100%", width: "100%", maxWidth: "100%", maxHeight: "100%", cursor: "initial", ...P }, children: p("div", { className: "editor-placement", style: { display: "flex", flexGrow: 1, position: "relative", top:
|
|
428
|
+
}, ref: B, ...v, style: { display: "flex", flexGrow: 1, alignSelf: "stretch", height: "100%", width: "100%", maxWidth: "100%", maxHeight: "100%", cursor: "initial", ...P }, children: p("div", { className: "editor-placement", style: { display: "flex", flexGrow: 1, position: "relative", top: je * w + 1, left: ct * w, width: `calc(100% - ${Qe * w}px)`, maxWidth: `calc(100% - ${Qe * w}px)`, height: (Ne ?? K) * w, maxHeight: (Ne ?? K) * w }, children: p("textarea", { spellCheck: "false", placeholder: I.placeholder, ref: y, value: I.textValue, disabled: We, readOnly: U, name: "sheet-cell-editor", autoComplete: "off", autoCapitalize: "off", style: { flex: "1 1 100%", font: "inherit", ...Ve, fontSize: He ? `${He}px` : "inherit", textAlign: I.textAlign, lineHeight: (te?.lines[0]?.bounds.height ?? 0) * w + "px", height: (te?.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: I.isWrapped ? "normal" : "pre", wordWrap: "break-word" }, onFocus: m, onBlur: () => {
|
|
429
429
|
$(!1);
|
|
430
430
|
}, onSelect: (x) => {
|
|
431
431
|
}, onChange: (x) => {
|
|
432
|
-
y.current && !
|
|
432
|
+
y.current && !Ae.current && (D.current = !1, G(x.target.value), I.textValue, x.target.value, x.target.selectionStart, x.target.selectionEnd, x.target.selectionDirection, O({ start: x.target.selectionStart, end: x.target.selectionEnd, direction: x.target.selectionDirection }));
|
|
433
433
|
}, onMouseDown: (x) => {
|
|
434
|
-
|
|
435
|
-
}, onKeyDown:
|
|
434
|
+
_ && ae(!0);
|
|
435
|
+
}, onKeyDown: _e }) }) });
|
|
436
436
|
})), ki = (e, t) => ({ clean: e, dirty: t, editMode: !1 }), Ri = (e) => {
|
|
437
437
|
const { length: t = 0, width: n = 1, dashArray: r = null, dashArrayAdditional: l = null, isDouble: o = !1, isAngled: i = !1, offsetX: c = 0, offsetY: u = 0, isVertical: s = !1, ...C } = e, d = (P) => {
|
|
438
438
|
let w = null;
|
|
@@ -530,8 +530,8 @@ const an = sl && window.ResizeObserver !== void 0 ? function() {
|
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
let M = u ? -Math.floor(d.width / 2) : -U, D = u ? -U : -Math.floor(d.width / 2);
|
|
533
|
-
const
|
|
534
|
-
return p(Ri, { offsetX: g + M +
|
|
533
|
+
const _ = c && d.width > 2 ? -1 : 0;
|
|
534
|
+
return p(Ri, { offsetX: g + M + _, offsetY: R + D + _, length: A + U, isVertical: u, stroke: P, width: d.width, dashArray: N ?? d.pattern, dashArrayAdditional: q, isDouble: w, isAngled: d.description.toLowerCase().includes("slant") }, t);
|
|
535
535
|
}, dl = ({ getBorderAt: e, borderRenderer: t = Ai, getVisibleCells: n, darkMode: r, forceThinBorder: l = !1, defaultColor: o = "black", shiftIfWide: i = !1 }) => {
|
|
536
536
|
const c = ie(n, [n]);
|
|
537
537
|
return { overlay: ye(() => (s) => {
|
|
@@ -541,33 +541,33 @@ const an = sl && window.ResizeObserver !== void 0 ? function() {
|
|
|
541
541
|
if (d.length === 0) return;
|
|
542
542
|
const g = s.getVisibleColumnOffsets(), R = s.getVisibleRowOffsets();
|
|
543
543
|
let b = [], E = [];
|
|
544
|
-
const A = s.getVisibleColumns(), U = s.getVisibleRows(), P = [], w = [], N = [], q = (M, D,
|
|
545
|
-
const ee = { index: $, stroke: V, visibleIndex:
|
|
544
|
+
const A = s.getVisibleColumns(), U = s.getVisibleRows(), P = [], w = [], N = [], q = (M, D, _, $, V, O, W) => {
|
|
545
|
+
const ee = { index: $, stroke: V, visibleIndex: _, edge: O, length: W };
|
|
546
546
|
M[D] || (M[D] = []), M[D].length > 0 && M[D][M[D].length - 1]?.index === $ ? M[D][M[D].length - 1] = ee : M[D].push(ee);
|
|
547
547
|
};
|
|
548
548
|
for (let M = 0; M < d.length; M++) {
|
|
549
|
-
const D = d[M],
|
|
550
|
-
if (!
|
|
551
|
-
const $ = D?.range ?? { rowStart:
|
|
549
|
+
const D = d[M], _ = D.coords;
|
|
550
|
+
if (!_) continue;
|
|
551
|
+
const $ = D?.range ?? { rowStart: _.rowIndex, colStart: _.colIndex, rowEnd: _.rowIndex, colEnd: _.colIndex }, V = s.getVisibleRangeCoords();
|
|
552
552
|
if (!bt.isRangesIntersect($, V) && !bt.isRangeWithinRange($, V)) continue;
|
|
553
|
-
const O =
|
|
553
|
+
const O = _.colIndex, W = _.rowIndex, ee = g[O], I = R[W];
|
|
554
554
|
if ($.rowEnd !== $.rowStart) {
|
|
555
|
-
const
|
|
556
|
-
b.push({ ...$, rowStart:
|
|
555
|
+
const _e = R[$.rowStart]?.spanIndex ?? -1, ve = R[$.rowEnd]?.spanIndex ?? R[U[U.length - 1]].spanIndex + 1;
|
|
556
|
+
b.push({ ...$, rowStart: _e, rowEnd: ve });
|
|
557
557
|
}
|
|
558
558
|
if ($.colEnd !== $.colStart) {
|
|
559
|
-
const
|
|
560
|
-
E.push({ ...$, colStart:
|
|
559
|
+
const _e = g[$.colStart]?.spanIndex ?? -1, ve = g[$.colEnd]?.spanIndex ?? g[A[A.length - 1]].spanIndex + 1;
|
|
560
|
+
E.push({ ...$, colStart: _e, colEnd: ve });
|
|
561
561
|
}
|
|
562
562
|
const y = D.value, B = e(y, M);
|
|
563
563
|
if (!B || B.isEmpty()) continue;
|
|
564
|
-
const te = B.getLeft(), Se = B.getTop(), oe = B.getRight(),
|
|
565
|
-
let ae = 1,
|
|
564
|
+
const te = B.getLeft(), Se = B.getTop(), oe = B.getRight(), G = B.getBottom();
|
|
565
|
+
let ae = 1, Ae = 1;
|
|
566
566
|
if (!ee || !I) continue;
|
|
567
567
|
const Fe = ee.spanIndex, fe = I.spanIndex;
|
|
568
|
-
te.isNone() || q(P, Fe, fe, W, te, At.Edge.Left, ae), Se.isNone() || q(w, fe, Fe, O, Se, At.Edge.Top,
|
|
568
|
+
te.isNone() || q(P, Fe, fe, W, te, At.Edge.Left, ae), Se.isNone() || q(w, fe, Fe, O, Se, At.Edge.Top, Ae), oe.isNone() || q(P, Fe + Ae, fe, W, oe, At.Edge.Right, ae), G.isNone() || q(w, fe + ae, Fe, O, G, At.Edge.Bottom, Ae);
|
|
569
569
|
}
|
|
570
|
-
const v = (M, D,
|
|
570
|
+
const v = (M, D, _) => {
|
|
571
571
|
const $ = [];
|
|
572
572
|
return M.forEach((V, O) => {
|
|
573
573
|
let W = null;
|
|
@@ -576,13 +576,13 @@ const an = sl && window.ResizeObserver !== void 0 ? function() {
|
|
|
576
576
|
const I = V[ee];
|
|
577
577
|
if (!I?.stroke || D[O] === void 0 && D[O - 1] === void 0) continue;
|
|
578
578
|
let y = !1;
|
|
579
|
-
if (
|
|
580
|
-
let
|
|
581
|
-
|
|
579
|
+
if (_) for (let oe = 0; !y && oe < b.length; oe++) {
|
|
580
|
+
let G = b[oe];
|
|
581
|
+
G.colStart <= I.index && G.colEnd >= I.index && G.rowStart < O && G.rowEnd >= O && (y = !0);
|
|
582
582
|
}
|
|
583
583
|
else for (let oe = 0; !y && oe < E.length; oe++) {
|
|
584
|
-
let
|
|
585
|
-
|
|
584
|
+
let G = E[oe];
|
|
585
|
+
G.rowStart <= I.index && G.rowEnd >= I.index && G.colStart < O && G.colEnd >= O && (y = !0);
|
|
586
586
|
}
|
|
587
587
|
if (y) continue;
|
|
588
588
|
const B = I.stroke?.getColor(), te = B ? B.toRGBA().toString() : o, Se = I.stroke.getStyle() + ":" + te;
|
|
@@ -596,23 +596,23 @@ const an = sl && window.ResizeObserver !== void 0 ? function() {
|
|
|
596
596
|
if (S.length === 0 && L.length === 0) return null;
|
|
597
597
|
for (let M = 0; M < L.length; M++) {
|
|
598
598
|
const D = L[M];
|
|
599
|
-
let
|
|
599
|
+
let _ = ot.findEqualOrGreater(S, D.from, (V) => V.index), $ = !1;
|
|
600
600
|
for (; !$; ) {
|
|
601
|
-
const V = S[
|
|
601
|
+
const V = S[_++];
|
|
602
602
|
V && V.index >= D.from && V.index <= D.to + 1 && V.from <= D.index && V.to + 1 >= D.index && (D.intersections.push({ stroke: V.stroke, range: { rowStart: V.from, rowEnd: V.to + 1, colStart: V.index, colEnd: V.index } }), V.intersections.push({ stroke: D.stroke, range: { rowStart: D.index, rowEnd: D.index, colStart: D.from, colEnd: D.to + 1 } })), $ = !V || V.index > D.to + 1;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
for (let M = 0; M < L.length; M++) {
|
|
606
606
|
const D = L[M];
|
|
607
|
-
let
|
|
607
|
+
let _ = D.stroke;
|
|
608
608
|
const $ = `rBorder:${D.index}:${D.from}:${D.to}:${D.edge}`, V = { rowStart: D.index, rowEnd: D.index, colStart: D.from, colEnd: D.to + 1 }, O = s.getLayout(), W = !1, ee = O.getColOffset(V.colStart), I = O.getRowOffset(V.rowStart), y = [ee, I, O.getColOffset(V.colEnd), I];
|
|
609
|
-
N.push(t({ key: $, points: y, stroke:
|
|
609
|
+
N.push(t({ key: $, points: y, stroke: _, darkMode: r, forceThinBorder: l, shiftIfWide: i, range: V, intersections: D.intersections, layout: O, isVertical: W }));
|
|
610
610
|
}
|
|
611
611
|
for (let M = 0; M < S.length; M++) {
|
|
612
612
|
const D = S[M];
|
|
613
|
-
let
|
|
613
|
+
let _ = D.stroke;
|
|
614
614
|
const $ = `cBorder:${D.index}:${D.from}:${D.to}:${D.edge}`, V = { rowStart: D.from, rowEnd: D.to + 1, colStart: D.index, colEnd: D.index }, O = s.getLayout(), W = !0, ee = O.getColOffset(V.colStart), I = [ee, O.getRowOffset(V.rowStart), ee, O.getRowOffset(V.rowEnd)];
|
|
615
|
-
N.push(t({ key: $, stroke:
|
|
615
|
+
N.push(t({ key: $, stroke: _, points: I, darkMode: r, forceThinBorder: l, shiftIfWide: i, range: V, intersections: D.intersections, layout: O, isVertical: W }));
|
|
616
616
|
}
|
|
617
617
|
return p("svg", { width: `${C.width}`, height: `${C.height}`, viewBox: `0 0 ${C.width} ${C.height}`, preserveAspectRatio: "none", shapeRendering: "crispEdges", style: { position: "absolute", left: "0px", top: "0px", width: `${C.width}px`, height: `${C.height}px`, pointerEvents: "none", transitionTimingFunction: "linear", transitionDelay: "0", transitionProperty: "left, top, width, height", willChange: "left, top, width, height, stroke-dashoffset", overflow: "visible" }, children: N }, "borders");
|
|
618
618
|
}, [e, r]) };
|
|
@@ -636,7 +636,7 @@ const an = sl && window.ResizeObserver !== void 0 ? function() {
|
|
|
636
636
|
return W;
|
|
637
637
|
}, [E, A]);
|
|
638
638
|
if (!w) return null;
|
|
639
|
-
const
|
|
639
|
+
const _ = { width: E, height: A }, $ = { width: E, height: A }, V = { getStage: () => d.current, getTotalSize: () => _, getViewportSize: () => $, getLayout: () => v, getCellCoordsAsRangeCoords: bt.cellToRange, getVisibleRangeCoords: () => S, getVisibleRows: () => {
|
|
640
640
|
const W = [];
|
|
641
641
|
for (let ee = 0; ee < o; ee++) W.push(ee);
|
|
642
642
|
return W;
|
|
@@ -660,7 +660,7 @@ function Vt() {
|
|
|
660
660
|
for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = cl(e)) && (r && (r += " "), r += t);
|
|
661
661
|
return r;
|
|
662
662
|
}
|
|
663
|
-
const Ni = "_sheetxl-
|
|
663
|
+
const Ni = "_sheetxl-sheet_1tnw9_9", Li = "_viewport-overlay_1tnw9_11", Oi = (e) => {
|
|
664
664
|
const { style: t, ...n } = e ?? {};
|
|
665
665
|
return Je("svg", { style: { width: "135px", height: "37px", ...t }, viewBox: "0 0 135 37", ...n, children: [p("path", { d: "M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z", fill: "#547dbe", fillRule: "evenodd" }), p("path", { d: "M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z", fill: "#ffffff", fillRule: "evenodd" }), p("path", { d: "m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z", fill: "#547dbe", fillRule: "evenodd", strokeWidth: "0.4" }), p("path", { d: "M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z", fill: "#eb594d" }), p("path", { d: "m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z", stroke: "#eb594d", strokeWidth: "2", fill: "#f9cecb" })] });
|
|
666
666
|
}, Vi = pt((e) => {
|
|
@@ -737,7 +737,7 @@ function Bi(e) {
|
|
|
737
737
|
Nn(() => {
|
|
738
738
|
te(k), C(f), g(a);
|
|
739
739
|
});
|
|
740
|
-
}, [t, L, d, s]),
|
|
740
|
+
}, [t, L, d, s]), _ = Ye(ot.debounce(D, 210), [D]);
|
|
741
741
|
be(() => {
|
|
742
742
|
R.current = t, D();
|
|
743
743
|
}, [t]);
|
|
@@ -750,12 +750,12 @@ function Bi(e) {
|
|
|
750
750
|
if (le && le(), !se) return;
|
|
751
751
|
i?.showError?.(se);
|
|
752
752
|
}
|
|
753
|
-
},
|
|
753
|
+
}, j = [];
|
|
754
754
|
let J = !1;
|
|
755
|
-
const re = async () => (
|
|
755
|
+
const re = async () => (j.push(H), (async () => {
|
|
756
756
|
if (!J) {
|
|
757
|
-
for (J = !0;
|
|
758
|
-
const le =
|
|
757
|
+
for (J = !0; j.length > 0; ) {
|
|
758
|
+
const le = j.shift();
|
|
759
759
|
le && await le();
|
|
760
760
|
}
|
|
761
761
|
J = !1;
|
|
@@ -790,8 +790,8 @@ function Bi(e) {
|
|
|
790
790
|
let h = z.getSelectedRanges();
|
|
791
791
|
T && (k === we.Orientation.Row ? h = h.getEntireRows(f) : k === we.Orientation.Column && (h = h.getEntireColumns(f)));
|
|
792
792
|
let H = null;
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
793
|
+
const j = v.getMode()?.key;
|
|
794
|
+
if (j === "copy" || j === "cut") {
|
|
795
795
|
const J = await S.getClipboard().readReference();
|
|
796
796
|
J && J.getItemType() === "range" && (H = J.getItem(), H.getCoords() || (H = null));
|
|
797
797
|
}
|
|
@@ -801,12 +801,12 @@ function Bi(e) {
|
|
|
801
801
|
} else h.insert(k, { autoSelect: !0 });
|
|
802
802
|
}, "Insert Cells", !1), [v]), [B, te] = ue(null), Se = ie((a) => t.getStyles().setDefaultTableStyle(a), [t]), oe = ie((a) => {
|
|
803
803
|
t.getStyles().getTableStyle(a)?.delete();
|
|
804
|
-
}, [t]),
|
|
804
|
+
}, [t]), G = ie((a, k) => {
|
|
805
805
|
V(a, async (T) => {
|
|
806
806
|
const f = T.getSelectedRange(), z = T.getSelectedCell().getCoords();
|
|
807
807
|
let h = null, H = 0;
|
|
808
|
-
const
|
|
809
|
-
|
|
808
|
+
const j = z.rowIndex > 0 ? T.getRange({ rowIndex: z.rowIndex, colIndex: z.colIndex }).getExtended(we.Direction.Up) : null;
|
|
809
|
+
j && T.getRange({ colStart: z.colIndex, rowStart: j.getCoords().rowStart, colEnd: z.colIndex, rowEnd: j.getCoords().rowStart }).isContentful() && (h = we.Direction.Up, H = z.rowIndex - j.getCoords().rowEnd);
|
|
810
810
|
const J = z.colIndex > 0 ? T.getRange({ rowIndex: z.rowIndex, colIndex: z.colIndex - 1 }).getExtended(we.Direction.Left) : null;
|
|
811
811
|
if (J && T.getRange({ colStart: J.getCoords().colStart, rowStart: z.rowIndex, colEnd: J.getCoords().colStart, rowEnd: z.rowIndex }).isContentful()) {
|
|
812
812
|
const le = z.colIndex - J.getCoords().colEnd;
|
|
@@ -814,9 +814,9 @@ function Bi(e) {
|
|
|
814
814
|
}
|
|
815
815
|
let re = null;
|
|
816
816
|
if (h === we.Direction.Up) {
|
|
817
|
-
if (re = { ...
|
|
818
|
-
const le =
|
|
819
|
-
re = { colStart: z.colIndex, rowStart: le.getCoords().rowStart, colEnd: z.colIndex, rowEnd:
|
|
817
|
+
if (re = { ...j.getCoords() }, (re.rowEnd === z.rowIndex || !T.getRange({ colIndex: z.colIndex, rowIndex: z.rowIndex - 1 }).isContentful()) && re.rowStart > 0 && T.getRange({ colIndex: z.colIndex, rowIndex: re.rowStart - 1 }).isContentful()) {
|
|
818
|
+
const le = j.getExtended(we.Direction.Up);
|
|
819
|
+
re = { colStart: z.colIndex, rowStart: le.getCoords().rowStart, colEnd: z.colIndex, rowEnd: j.getCoords().rowEnd };
|
|
820
820
|
}
|
|
821
821
|
re.rowEnd = z.rowIndex - 1;
|
|
822
822
|
} else if (h === we.Direction.Left) {
|
|
@@ -860,15 +860,15 @@ function Bi(e) {
|
|
|
860
860
|
}
|
|
861
861
|
const H = await Promise.resolve(h);
|
|
862
862
|
if (H?.option !== "Ok") throw null;
|
|
863
|
-
const
|
|
863
|
+
const j = await Promise.resolve(i?.showBusy?.(a.label()));
|
|
864
864
|
try {
|
|
865
865
|
await z.getTables().add(H.tableOptions.ranges.at(0), { styleName: k?.name, clearFormatting: T, hasHeader: H.tableOptions.hasHeader }).getRange().select();
|
|
866
866
|
} catch (J) {
|
|
867
|
-
|
|
867
|
+
j(), i?.showError?.(J);
|
|
868
868
|
}
|
|
869
|
-
|
|
869
|
+
j();
|
|
870
870
|
}, !1, !0, !1);
|
|
871
|
-
}, [B]),
|
|
871
|
+
}, [B]), Ae = ie(() => r, [r]), Fe = ie((a) => ({ styles: () => t.getStyles(), table: () => a, bodyStyle: Ae, getNames: () => t.getNames() }), [t]), fe = ie(async (a, k, T, f = !0) => {
|
|
872
872
|
let z = null;
|
|
873
873
|
if (!k) {
|
|
874
874
|
let h = t.getSelectedRange();
|
|
@@ -884,9 +884,9 @@ function Bi(e) {
|
|
|
884
884
|
}
|
|
885
885
|
z = new Promise(async (h, H) => {
|
|
886
886
|
a.update({ context: Fe(k) });
|
|
887
|
-
const
|
|
887
|
+
const j = { command: a, commands: m, notifier: i, onDone: (re) => {
|
|
888
888
|
h(re);
|
|
889
|
-
} }, J = await i.showWindow?.("tableDetails",
|
|
889
|
+
} }, J = await i.showWindow?.("tableDetails", j, { disableAutoDestroy: !0 });
|
|
890
890
|
setTimeout(() => {
|
|
891
891
|
J.focus();
|
|
892
892
|
}, 180);
|
|
@@ -897,7 +897,7 @@ function Bi(e) {
|
|
|
897
897
|
i?.showError?.(h);
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
|
-
}, [i]),
|
|
900
|
+
}, [i]), _e = ie(async (a, k, T = !1) => {
|
|
901
901
|
let f = null;
|
|
902
902
|
if (k) k.isITable ? f = k : k.getValue() && (f = k.getValue());
|
|
903
903
|
else {
|
|
@@ -922,14 +922,14 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
922
922
|
let h = z.at(0);
|
|
923
923
|
h.size === 1 && (h = h.getSurrounding());
|
|
924
924
|
const H = f.getSelection().getCoords().cell;
|
|
925
|
-
let
|
|
926
|
-
if (!
|
|
925
|
+
let j = h.getDefaultSortCriteria(we.Orientation.Row, H);
|
|
926
|
+
if (!j) {
|
|
927
927
|
if (T) throw new Error("Invalid sort selection. Sort requires a single range with data.");
|
|
928
928
|
return;
|
|
929
929
|
}
|
|
930
|
-
let J =
|
|
930
|
+
let J = j.options;
|
|
931
931
|
if (T && (J = new Promise((le, se) => {
|
|
932
|
-
const Ce = { range: h, options:
|
|
932
|
+
const Ce = { range: h, options: j.options, cell: H, onCancel: () => {
|
|
933
933
|
se();
|
|
934
934
|
}, onDone: (he) => {
|
|
935
935
|
he ? le(he.options) : se();
|
|
@@ -947,11 +947,11 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
947
947
|
}
|
|
948
948
|
re();
|
|
949
949
|
}, !1, !1, !1);
|
|
950
|
-
}, [i]),
|
|
950
|
+
}, [i]), Ge = ie(() => {
|
|
951
951
|
console.log("compactedSelection");
|
|
952
952
|
const a = t.getSelection().getCoords(), k = t.getSelectedRanges().getFlattened().getCoords(), T = ((h) => {
|
|
953
|
-
const H = new Blob([h], { type: "application/javascript" }),
|
|
954
|
-
return URL.revokeObjectURL(
|
|
953
|
+
const H = new Blob([h], { type: "application/javascript" }), j = URL.createObjectURL(H), J = new Worker(j);
|
|
954
|
+
return URL.revokeObjectURL(j), J;
|
|
955
955
|
})("console.log('hello from worker');");
|
|
956
956
|
setTimeout(() => {
|
|
957
957
|
T.terminate(), console.log("Worker terminated");
|
|
@@ -1006,15 +1006,15 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
1006
1006
|
f.doBatch(() => {
|
|
1007
1007
|
const z = k === we.Direction.Up || k === we.Direction.Down, h = f.getCoords().slice().sort(bt.createRangeComparator(z ? we.Orientation.Row : we.Orientation.Column));
|
|
1008
1008
|
for (let H = 0; H < h.length; H++) {
|
|
1009
|
-
const
|
|
1010
|
-
let J =
|
|
1009
|
+
const j = h[H];
|
|
1010
|
+
let J = j;
|
|
1011
1011
|
const re = T.getRange(J).getMerges();
|
|
1012
1012
|
let le = 0, se = 0;
|
|
1013
1013
|
if (re.length > 0) {
|
|
1014
1014
|
const Ce = re[0];
|
|
1015
1015
|
le = Ce.rowEnd - Ce.rowStart, se = Ce.colEnd - Ce.colStart;
|
|
1016
1016
|
}
|
|
1017
|
-
k === we.Direction.Left ? J = { ...
|
|
1017
|
+
k === we.Direction.Left ? J = { ...j, colStart: j.colEnd + se } : k === we.Direction.Right ? J = { ...j, colEnd: j.colStart + se } : k === we.Direction.Up ? J = { ...j, rowStart: j.rowEnd + le } : k === we.Direction.Down && (J = { ...j, rowEnd: j.rowStart + le }), T.getRange(J).autoFill(j, { filler: Yl.Types.Copy }), T.getRange(j).autoFit({ orientations: we.Orientations.Row, skipCustomSize: !0, minContent: !0 });
|
|
1018
1018
|
}
|
|
1019
1019
|
}, { autoSelect: !0, description: a.label() });
|
|
1020
1020
|
});
|
|
@@ -1026,7 +1026,7 @@ Continue?`, options: ["Convert", "Cancel"], defaultOption: "Convert" }) !== "Con
|
|
|
1026
1026
|
T && (a = T.toTextUnformatted(!0));
|
|
1027
1027
|
}
|
|
1028
1028
|
b?.({ text: a });
|
|
1029
|
-
}, [t]), [Oe, qe] = ln((a) => a + 1, 0), [Le, We] = ln((a) => a + 1, 0),
|
|
1029
|
+
}, [t]), [Oe, qe] = ln((a) => a + 1, 0), [Le, We] = ln((a) => a + 1, 0), Ze = ye(() => [new X("gridlinesToggle", o, { label: "Gridlines", scopedLabels: { view: "Gridlines" }, description: "Toggle whether the lines between rows and columns in the sheet are displayed." }), new X("sheetViewToggleGridlinesRows", o, { label: "Row Gridlines", scopedLabels: { view: "Row Gridlines", gridlines: "Rows" }, description: "Toggle whether the lines between rows in the sheet are displayed." }), new X("sheetViewToggleGridlinesColumns", o, { label: "Column Gridlines", scopedLabels: { view: "Columns Gridlines", gridlines: "Columns" }, description: "Toggle whether the lines between columns in the sheet are displayed." }), new X("sheetViewFormatGridlinesColor", o, { label: "Gridlines Color", description: "Color the rows and column gridlines." }), new X("sheetViewToggleShowHeadings", o, { label: "Headings", scopedLabels: { view: "Headings" }, description: "Toggle whether the row and column headings are displayed." }), new X("sheetViewToggleShowHeadingRows", o, { label: "Row Headings", scopedLabels: { view: "Row Headings", headings: "Rows" }, description: "Toggle whether the row headings are displayed." }), new X("sheetViewToggleShowHeadingColumns", o, { label: "Column Headings", scopedLabels: { view: "Columns Headings", headings: "Columns" }, description: "Toggle whether the column headings are displayed." }), new X("sheetViewToggleShowHeadingsNumeric", o, { label: "Numeric Headers", description: "Toggle whether cell headings show numbers or A1 conventions.", shortcut: { key: "h", modifiers: [Q.Ctrl, Q.Shift] } }), new X("sheetViewToggleFormulaView", o, { label: "Show Formulas", description: "Toggle whether cells show formula or values.", shortcut: [{ key: "`", modifiers: [Q.Ctrl] }, { key: "`", modifiers: [Q.Ctrl, Q.Shift] }] }), new X("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: [Q.Ctrl, Q.Shift] } }, () => De()), new X("selectAll", o, { label: "Select All", description: "Select the closest data or the entire sheet if no data is nearby.", shortcut: [{ key: "A", modifiers: [Q.Ctrl] }, { key: "Space", modifiers: [Q.Ctrl, Q.Shift] }] }, (a = !1) => ge(!1, a)), new Ue("selectRegion", o, { label: "Select Region", description: "Select the closest data.", shortcut: { key: "*", modifiers: [Q.Ctrl, Q.Shift] } }, () => ge(!0, !1)), new Ue("breakSelection", o, { label: "Select Visible", description: "Break the selection based on hidden rows and columns.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl, Q.Alt] } }, () => Ge()), 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 X("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() {
|
|
1030
1030
|
ve(this, { reverse: !1 }, !1);
|
|
1031
1031
|
}), new Ue("sortDescending", o, { label: "Sort Descending", scopedLabels: { sort: "Descending" }, description: "Highest to Lowest." }, function() {
|
|
1032
1032
|
ve(this, { reverse: !0 }, !1);
|
|
@@ -1063,7 +1063,7 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1063
1063
|
}), new X("formatNumberFormat", o, { label: "Number Format", description: "Choose the format for your cells, such as percentage, currency, date or time." }, function(a) {
|
|
1064
1064
|
O(this, { numberFormat: a });
|
|
1065
1065
|
}), new X("formatNumberFormatGeneralStyle", o, { label: "General Style", description: "Remove all specific formatting.", shortcut: { key: "Backquote", modifiers: [Q.Ctrl, Q.Shift] } }, function() {
|
|
1066
|
-
O(this, { numberFormat:
|
|
1066
|
+
O(this, { numberFormat: Zt.Type.General });
|
|
1067
1067
|
}), new X("formatNumberFormatNumberStyle", o, { label: "Number Style", description: "Format as number with two decimals and comma.", shortcut: { key: "1", modifiers: [Q.Ctrl, Q.Shift] } }, function() {
|
|
1068
1068
|
O(this, { numberFormat: "#,##0.00" });
|
|
1069
1069
|
}), new X("formatNumberFormatTimeStyle", o, { label: "Time Style", description: "Format as time with hour and minute, and AM or PM.", shortcut: { key: "2", modifiers: [Q.Ctrl, Q.Shift] } }, function() {
|
|
@@ -1079,20 +1079,20 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1079
1079
|
}), new X("formatNumberFormatCommaStyle", o, { label: "Comma Style", description: "Format with a thousands separator.", shortcut: { key: ",", modifiers: [Q.Ctrl] } }, function() {
|
|
1080
1080
|
O(this, { numberFormat: '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)' });
|
|
1081
1081
|
}), new X("formatNumberFormatIncreaseDecimal", o, { label: "Increase Decimal", description: "Show more decimal places for a more precise value." }, function() {
|
|
1082
|
-
O(this, (a) => ({ numberFormat:
|
|
1082
|
+
O(this, (a) => ({ numberFormat: Zt.Parser.adjustDecimalPlaces(a.getNumberFormat(), 1) }));
|
|
1083
1083
|
}), new X("formatNumberFormatDecreaseDecimal", o, { label: "Decrease Decimal", description: "Show few decimal places." }, function() {
|
|
1084
|
-
O(this, (a) => ({ numberFormat:
|
|
1084
|
+
O(this, (a) => ({ numberFormat: Zt.Parser.adjustDecimalPlaces(a.getNumberFormat(), -1) }));
|
|
1085
1085
|
}), new X("displayPlaceholdersToggle", o, { label: "Display Placeholders", description: "Switch between hiding objects, displaying objects, and displaying placeholders for objects.", shortcut: { key: "6", modifiers: [Q.Ctrl] } }), new Ue("noOp", o, { label: "Do nothing", description: "Do Nothing.", shortcut: { key: "7", modifiers: [Q.Ctrl] } }, function() {
|
|
1086
1086
|
}), new X("displayOutlineSymbolsToggle", o, { label: "Display Outline Symbols", description: "Display or hide the outline symbols.", shortcut: { key: "8", modifiers: [Q.Ctrl] } }), new X("hideRows", o, { label: "Hide Rows", description: "Hide the rows.", shortcut: { key: "9", modifiers: [Q.Ctrl] } }), new X("unhideRows", o, { label: "Unhide Rows", description: "Unhide the rows.", shortcut: { key: "(", modifiers: [Q.Ctrl, Q.Shift] } }), new X("hideColumns", o, { label: "Hide Columns", description: "Hide the columns.", shortcut: [{ key: "0", modifiers: [Q.Ctrl] }, { key: "0", modifiers: [Q.Ctrl, Q.Alt] }] }), new X("unhideColumns", o, { label: "Unhide Columns", description: "Unhide the columns.", shortcut: { key: ")", modifiers: [Q.Ctrl, Q.Shift] } }), new X("quickFormulaSum", o, { label: "Quick Sum", scopedLabels: { quickFormula: "Sum" }, description: "Quick sum of the cells.", shortcut: { key: "=", modifiers: [Q.Alt] } }, function() {
|
|
1087
|
-
|
|
1087
|
+
G(this, "SUM");
|
|
1088
1088
|
}), new X("quickFormulaAverage", o, { label: "Quick Average", scopedLabels: { quickFormula: "Average" }, description: "Quick average of the cells." }, function() {
|
|
1089
|
-
|
|
1089
|
+
G(this, "AVERAGE");
|
|
1090
1090
|
}), new X("quickFormulaCount", o, { label: "Quick Count", scopedLabels: { quickFormula: "Count Numbers" }, description: "Quick count of the cells." }, function() {
|
|
1091
|
-
|
|
1091
|
+
G(this, "COUNT");
|
|
1092
1092
|
}), new X("quickFormulaMax", o, { label: "Quick Max", scopedLabels: { quickFormula: "Max" }, description: "Quick maximum of the cells." }, function() {
|
|
1093
|
-
|
|
1093
|
+
G(this, "MAX");
|
|
1094
1094
|
}), new X("quickFormulaMin", o, { label: "Quick Min", scopedLabels: { quickFormula: "Min" }, description: "Quick minimum of the cells." }, function() {
|
|
1095
|
-
|
|
1095
|
+
G(this, "MIN");
|
|
1096
1096
|
}), new X("startEditCurrentTime", o, { label: "Current Time", description: "Insert the current time.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl, Q.Shift] } }, function() {
|
|
1097
1097
|
b?.({ text: t.createTemporaryCell({ value: $n(), style: { numberFormat: "Medium Time" } }).toText() });
|
|
1098
1098
|
}), new X("startEditCurrentDate", o, { label: "Current Date", description: "Insert the current date.", shortcut: { key: "Semicolon", modifiers: [Q.Ctrl] } }, function() {
|
|
@@ -1144,11 +1144,11 @@ For example, you can prevent people from editing locked cells or making formatti
|
|
|
1144
1144
|
}), new X("deleteTable", o, { label: "Delete Table", scopedLabels: { delete: "Table", table: "Delete", namedItem: "Delete" }, description: `Remove the table.
|
|
1145
1145
|
|
|
1146
1146
|
The table and table specific styling will be removed but the values will be preserved.` }, function(a) {
|
|
1147
|
-
|
|
1147
|
+
_e(this, a, !0);
|
|
1148
1148
|
}), new X("convertTableToRange", o, { label: "Convert To Range", description: `Convert the table into a normal range of cells.
|
|
1149
1149
|
|
|
1150
1150
|
The values and the formatting are preserved.` }, function(a) {
|
|
1151
|
-
|
|
1151
|
+
_e(this, a, !1);
|
|
1152
1152
|
}), new X("tableTotalRowToggle", o, { label: "Toggle Table Total Row", description: "Toggle Total Row on/off.", scopedLabels: { table: "Total Row" }, shortcut: { key: "T", modifiers: [Q.Ctrl, Q.Alt] } }, function() {
|
|
1153
1153
|
const a = this.context().table();
|
|
1154
1154
|
a && a.setShowTotals(!a.getShowTotals());
|
|
@@ -1220,8 +1220,8 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1220
1220
|
I(this);
|
|
1221
1221
|
}), new X("freezeToggle", o, { label: "Freeze Panes", description: "Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)." }), new X("freezeToggleHorizontal", o, { label: "Freeze Top Rows", description: "Keep the top rows visible while scrolling through the rest of the sheet." }), new X("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." })], []), m = ye(() => {
|
|
1222
1222
|
let a = null;
|
|
1223
|
-
return a = l ? l.createChildGroup(o, "sheet", !1) : new yo(o, "sheet"), a.addCommands(
|
|
1224
|
-
}, [l,
|
|
1223
|
+
return a = l ? l.createChildGroup(o, "sheet", !1) : new yo(o, "sheet"), a.addCommands(Ze, !0), a;
|
|
1224
|
+
}, [l, Ze]), [Ke, ct] = ue(!1), [Qe, K] = ue(!1);
|
|
1225
1225
|
be(() => {
|
|
1226
1226
|
if (R.current !== t || !d) return;
|
|
1227
1227
|
const a = d.getCoords(), k = t.getTables().search({ address: a[0] });
|
|
@@ -1236,7 +1236,7 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1236
1236
|
} }, [v, Oe, l]), gt(t.getView(), { onFreezeSplitChange: () => {
|
|
1237
1237
|
We();
|
|
1238
1238
|
} }), gt(t.getSelection(), { onChange: () => {
|
|
1239
|
-
|
|
1239
|
+
_();
|
|
1240
1240
|
} });
|
|
1241
1241
|
const Ne = () => {
|
|
1242
1242
|
m.getCommand("sheetViewFormatGridlinesColor").update({ state: () => t.getView().getGridLineColor(), context: () => ({ onColorSelect: (a) => {
|
|
@@ -1244,13 +1244,13 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1244
1244
|
t.setTabColor(a);
|
|
1245
1245
|
}).update({ state: () => t?.getTabColor() ?? lo, context: () => ({ onColorSelect: (a) => {
|
|
1246
1246
|
}, darkMode: r.darkMode, autoColor: lo, schemeLookup: t.getStyles().schemeLookup(), recentColors: () => t.getStyles().recentColors(), addRecentColor: (a) => t.getStyles().addRecentColor(a), clearRecentColors: () => t.getStyles().clearRecentColors() }) });
|
|
1247
|
-
},
|
|
1247
|
+
}, je = () => {
|
|
1248
1248
|
m.getCommand("formatBorder").update({ context: () => ({ onBorderSelect: (a) => {
|
|
1249
1249
|
U(a);
|
|
1250
1250
|
}, darkMode: r.darkMode, quickBorder: A, autoColor: t.getStyles().getNormal().getFont().getFill(), autoStyle: At.StrokeStyle.Thin, createTemporaryBorder: (a) => t.getStyles().getNormal().createTemporaryStyle({ border: a }).getBorder(), schemeLookup: t.getStyles().schemeLookup() }) });
|
|
1251
1251
|
};
|
|
1252
1252
|
be(() => {
|
|
1253
|
-
|
|
1253
|
+
je();
|
|
1254
1254
|
}, [A]), be(() => {
|
|
1255
1255
|
const a = !t.getProtection().isInsertHyperlinksAllowed();
|
|
1256
1256
|
m.getCommand("openHyperlink").update({ disabled: !$().getHyperlink() }), m.getCommand("deleteHyperlink").update({ disabled: a || !$().getHyperlink() });
|
|
@@ -1273,9 +1273,9 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1273
1273
|
}, onProtectionChange: () => {
|
|
1274
1274
|
We(), qe();
|
|
1275
1275
|
}, onStyleChange: () => {
|
|
1276
|
-
Ne(),
|
|
1276
|
+
Ne(), je(), We();
|
|
1277
1277
|
} }), be(() => {
|
|
1278
|
-
Ne(),
|
|
1278
|
+
Ne(), je();
|
|
1279
1279
|
}, [r]), be(() => {
|
|
1280
1280
|
const a = !t.getProtection().isFormatCellsAllowed(), k = L.length > 0 && !B || a, T = Fe(B), f = { context: T };
|
|
1281
1281
|
m.getCommand("editTable").update(f), m.getCommand("deleteTable").update(f), m.getCommand("convertTableToRange").update(f);
|
|
@@ -1326,9 +1326,9 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1326
1326
|
t.getView().setFreezePanes(null);
|
|
1327
1327
|
}).update({ disabled: () => !f() });
|
|
1328
1328
|
}, [Le, s, t, r]);
|
|
1329
|
-
const ze = $().getStyle(), He = ze.getFont(), Ve = ze.getAlignment(), x = Ve.getHorizontal(), ne = Ve.getVertical(), F = Ve.getOverflow(),
|
|
1329
|
+
const ze = $().getStyle(), He = ze.getFont(), Ve = ze.getAlignment(), x = Ve.getHorizontal(), ne = Ve.getVertical(), F = Ve.getOverflow(), Z = Ve.getRotation();
|
|
1330
1330
|
return be(() => {
|
|
1331
|
-
m.getCommand("formatCellStyle").update({ context: () => ({ styles: () => t.getStyles(), named: () => $().getStyle(!0).getNamed(), bodyStyle:
|
|
1331
|
+
m.getCommand("formatCellStyle").update({ context: () => ({ styles: () => t.getStyles(), named: () => $().getStyle(!0).getNamed(), bodyStyle: Ae, createTemporaryCell: (Ee) => t.createTemporaryCell(Ee) }) }), m.getCommand("formatFillColor").update({ state: () => {
|
|
1332
1332
|
let Ee = null;
|
|
1333
1333
|
const rt = ze.getFill();
|
|
1334
1334
|
return rt?.getType() === co.Type.Solid ? Ee = rt.getColor() : rt?.getType() === co.Type.Gradient ? Ee = rt.getStops()?.[0]?.getColor() : rt?.getType() === co.Type.Pattern && (Ee = rt.getBackground()), Ee;
|
|
@@ -1396,12 +1396,12 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1396
1396
|
m.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function() {
|
|
1397
1397
|
O(this, { alignment: { overflow: H() ? pe.Overflow.Visible : pe.Overflow.Ellipsis } });
|
|
1398
1398
|
}).update({ state: H, disabled: !0 });
|
|
1399
|
-
const
|
|
1399
|
+
const j = function() {
|
|
1400
1400
|
return ne === pe.VerticalAlignment.Top;
|
|
1401
1401
|
};
|
|
1402
1402
|
m.getCommand("formatAlignTopToggle").updateCallback(function() {
|
|
1403
|
-
O(this, { alignment: { vertical:
|
|
1404
|
-
}).update({ state:
|
|
1403
|
+
O(this, { alignment: { vertical: j() ? pe.VerticalAlignment.Bottom : pe.VerticalAlignment.Top } });
|
|
1404
|
+
}).update({ state: j });
|
|
1405
1405
|
const J = function() {
|
|
1406
1406
|
return ne === pe.VerticalAlignment.Center;
|
|
1407
1407
|
};
|
|
@@ -1473,17 +1473,17 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1473
1473
|
const $e = x === pe.HorizontalAlignment.CenterContinuous || x === pe.HorizontalAlignment.Fill;
|
|
1474
1474
|
m.getCommand("formatTextRotate0").updateCallback(function(Ee) {
|
|
1475
1475
|
O(this, { alignment: { rotation: 0 } });
|
|
1476
|
-
}).update({ disabled: $e, state:
|
|
1476
|
+
}).update({ disabled: $e, state: Z === 0 }), m.getCommand("formatTextRotate45").updateCallback(function(Ee) {
|
|
1477
1477
|
O(this, { alignment: { rotation: Ee ?? 1 ? 45 : 0 } });
|
|
1478
|
-
}).update({ disabled: $e, state:
|
|
1478
|
+
}).update({ disabled: $e, state: Z === 45 }), m.getCommand("formatTextRotate90").updateCallback(function(Ee) {
|
|
1479
1479
|
O(this, { alignment: { rotation: Ee ?? 1 ? 90 : 0 } });
|
|
1480
|
-
}).update({ disabled: $e, state:
|
|
1480
|
+
}).update({ disabled: $e, state: Z === 90 }), m.getCommand("formatTextRotate270").updateCallback(function(Ee) {
|
|
1481
1481
|
O(this, { alignment: { rotation: Ee ?? 1 ? 270 : 0 } });
|
|
1482
|
-
}).update({ disabled: $e, state:
|
|
1482
|
+
}).update({ disabled: $e, state: Z === 270 }), m.getCommand("formatTextRotate315").updateCallback(function(Ee) {
|
|
1483
1483
|
O(this, { alignment: { rotation: Ee ?? 1 ? 315 : 0 } });
|
|
1484
|
-
}).update({ disabled: $e, state:
|
|
1484
|
+
}).update({ disabled: $e, state: Z === 315 }), m.getCommand("formatTextRotateCustom").updateCallback(function(Ee) {
|
|
1485
1485
|
O(this, { alignment: { rotation: Ee } });
|
|
1486
|
-
}).update({ disabled: $e, state:
|
|
1486
|
+
}).update({ disabled: $e, state: Z ?? 0 });
|
|
1487
1487
|
}, [ze, t, r, P, N]), be(() => {
|
|
1488
1488
|
const a = !t.getProtection().isFormatCellsAllowed(), k = t.getSelectedRanges().getMerges().length > 0, T = async (nt, ft) => {
|
|
1489
1489
|
V(ft, async (Nt) => {
|
|
@@ -1560,13 +1560,13 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1560
1560
|
nt.getSelectedRanges().autoFit({ orientations: we.Orientations.Column });
|
|
1561
1561
|
});
|
|
1562
1562
|
}).update(z);
|
|
1563
|
-
let h = !1, H = 0,
|
|
1564
|
-
!d || a || Qe || (h = d.isEntireColumnsAny(), h && !d.isEntireColumns() ?
|
|
1563
|
+
let h = !1, H = 0, j = !1, J = !1, re = 0, le = !1;
|
|
1564
|
+
!d || a || Qe || (h = d.isEntireColumnsAny(), h && !d.isEntireColumns() ? j = !0 : H = d.getColumnCount(), J = d.isEntireRowsAny(), J && !d.isEntireRows() ? le = !0 : re = d.getRowCount());
|
|
1565
1565
|
const se = { disabled: a || d && d.getCount() !== 1 };
|
|
1566
1566
|
m.getCommand("sortAscending").update(se), m.getCommand("sortDescending").update(se);
|
|
1567
1567
|
const Ce = { disabled: h || J || a || Qe }, he = h || a || Qe || le;
|
|
1568
1568
|
he && (H = 1);
|
|
1569
|
-
const me = J || a || Qe ||
|
|
1569
|
+
const me = J || a || Qe || j;
|
|
1570
1570
|
me && (re = 1);
|
|
1571
1571
|
let Re = "", Pe = "", Be = "", et = "", $e = "", Ee = "", rt = "", qt = "", Ct = "";
|
|
1572
1572
|
H > 1 && (Ee = Pe = H + " ", rt = Be = "s"), re > 1 && (qt = et = re + " ", Ct = $e = "s"), v.getMode()?.key === "copy" ? (Re = et = Pe = "Copied ", Be = $e = "s") : v.getMode()?.key === "cut" && (Re = et = Pe = "Cut ", Be = $e = "s");
|
|
@@ -1578,7 +1578,7 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1578
1578
|
m.getCommand("insertCells").update({ label: `Insert ${Re}Cells${Ft}`, scopedLabels: { insertCells: `${Re}At Selection` } }), m.getCommand("insertCellsShiftRight").update(Ce), m.getCommand("insertCellsShiftDown").update(Ce), m.getCommand("deleteCellsShiftUp").update(Ce), m.getCommand("deleteCellsShiftLeft").update(Ce), m.getCommand("insertRows").update({ label: `Insert ${et}Row${$e}`, scopedLabels: { insertCells: `${et}Row${$e}` }, disabled: me }), m.getCommand("insertRowsAfter").update({ label: `Insert ${et}Row${$e} Below`, disabled: me }), m.getCommand("insertColumns").update({ label: `Insert ${Pe}Column${Be}`, scopedLabels: { insertCells: `${Pe}Column${Be}` }, disabled: he }), m.getCommand("insertColumnsAfter").update({ label: `Insert ${Pe}Column${Be} After`, disabled: he }), m.getCommand("deleteRows").update({ label: `Delete ${qt}Row${Ct}`, scopedLabels: { deleteCells: `${qt}Row${Ct}` }, disabled: me }), m.getCommand("deleteColumns").update({ label: `Delete ${Ee}Column${rt}`, scopedLabels: { deleteCells: `${Ee}Column${rt}` }, disabled: he });
|
|
1579
1579
|
}, [Le, Ke, Qe, d, v, i, Oe]), be(() => {
|
|
1580
1580
|
const a = t.getProtection(), k = t.getProtection().isLocked(), T = !a.isFormatCellsAllowed(), f = { disabled: T };
|
|
1581
|
-
m.getCommand("protectionSheetToggle").updateCallback(async (H,
|
|
1581
|
+
m.getCommand("protectionSheetToggle").updateCallback(async (H, j) => {
|
|
1582
1582
|
let J = null;
|
|
1583
1583
|
try {
|
|
1584
1584
|
if (k) {
|
|
@@ -1588,8 +1588,8 @@ All contents and formatting are removed.`, shortcut: { key: "Delete", modifiers:
|
|
|
1588
1588
|
if (le.option !== "Unprotect") return;
|
|
1589
1589
|
re = le.input;
|
|
1590
1590
|
}
|
|
1591
|
-
J = await Promise.resolve(i?.showBusy?.(
|
|
1592
|
-
} else J = await Promise.resolve(i?.showBusy?.(
|
|
1591
|
+
J = await Promise.resolve(i?.showBusy?.(j.label())), await a.unlock(re);
|
|
1592
|
+
} else J = await Promise.resolve(i?.showBusy?.(j.label())), await a.lock();
|
|
1593
1593
|
J?.();
|
|
1594
1594
|
} catch (re) {
|
|
1595
1595
|
J?.(), i?.showError?.(re);
|
|
@@ -1629,7 +1629,7 @@ var pr, fr;
|
|
|
1629
1629
|
pr = function(b, E, A) {
|
|
1630
1630
|
var U, P, w, N, q, v, S = 0, L = !1, M = !1, D = !0;
|
|
1631
1631
|
if (typeof b != "function") throw new TypeError("Expected a function");
|
|
1632
|
-
function
|
|
1632
|
+
function _(ee) {
|
|
1633
1633
|
var I = U, y = P;
|
|
1634
1634
|
return U = P = void 0, S = ee, N = b.apply(y, I);
|
|
1635
1635
|
}
|
|
@@ -1646,15 +1646,15 @@ var pr, fr;
|
|
|
1646
1646
|
}(ee));
|
|
1647
1647
|
}
|
|
1648
1648
|
function O(ee) {
|
|
1649
|
-
return q = void 0, D && U ?
|
|
1649
|
+
return q = void 0, D && U ? _(ee) : (U = P = void 0, N);
|
|
1650
1650
|
}
|
|
1651
1651
|
function W() {
|
|
1652
1652
|
var ee = d(), I = $(ee);
|
|
1653
1653
|
if (U = arguments, P = this, v = ee, I) {
|
|
1654
1654
|
if (q === void 0) return function(y) {
|
|
1655
|
-
return S = y, q = setTimeout(V, E), L ?
|
|
1655
|
+
return S = y, q = setTimeout(V, E), L ? _(y) : N;
|
|
1656
1656
|
}(v);
|
|
1657
|
-
if (M) return q = setTimeout(V, E),
|
|
1657
|
+
if (M) return q = setTimeout(V, E), _(v);
|
|
1658
1658
|
}
|
|
1659
1659
|
return q === void 0 && (q = setTimeout(V, E)), N;
|
|
1660
1660
|
}
|
|
@@ -1751,39 +1751,39 @@ function Cr(e, t) {
|
|
|
1751
1751
|
const ul = pt(vt((e, t) => {
|
|
1752
1752
|
const { style: n = it.EmptyCssProperties, orientation: r, sheet: l, onShowTooltip: o, onCloseTooltip: i, onScrollOffset: c, showCustomScrollButtons: u = !1, offset: s = 0, totalSize: C = 0, viewportSize: d = 0, ...g } = e;
|
|
1753
1753
|
if (!l) throw new Error("SheetScrollBar needs a sheet model");
|
|
1754
|
-
const [R] = an(), b = ie(o, [o]), E = ie(i, [i]), A = ye(() => U === null && P === null ? null : (
|
|
1755
|
-
Cr(U,
|
|
1754
|
+
const [R] = an(), b = ie(o, [o]), E = ie(i, [i]), A = ye(() => U === null && P === null ? null : (G) => {
|
|
1755
|
+
Cr(U, G), Cr(P, G);
|
|
1756
1756
|
}, [U = R, P = t]);
|
|
1757
1757
|
var U, P;
|
|
1758
1758
|
const [w, N] = ue(() => {
|
|
1759
|
-
const
|
|
1760
|
-
return r === rn.Vertical ?
|
|
1759
|
+
const G = l.getView().getTopLeft();
|
|
1760
|
+
return r === rn.Vertical ? G.top : G.left;
|
|
1761
1761
|
}), q = () => {
|
|
1762
|
-
const
|
|
1763
|
-
return r === rn.Vertical ?
|
|
1764
|
-
}, [v, S] = ue(q), [L, M] = ue(null), [D,
|
|
1765
|
-
const
|
|
1766
|
-
return { colIndex: Math.max(
|
|
1762
|
+
const G = l.getView().getFreezePanes();
|
|
1763
|
+
return r === rn.Vertical ? G.coords.rowIndex === 0 ? { shift: 0, scroll: 0 } : { shift: l.getRowHeaders().findOffset(G.coords.rowIndex) - G.topLeft.top, scroll: G.topLeft.top } : G.coords.colIndex === 0 ? { shift: 0, scroll: 0 } : { shift: l.getColumnHeaders().findOffset(G.coords.colIndex) - G.topLeft.left, scroll: G.topLeft.left };
|
|
1764
|
+
}, [v, S] = ue(q), [L, M] = ue(null), [D, _] = ue(!1), $ = r === rn.Vertical ? l.getRowHeaders() : l.getColumnHeaders(), V = () => {
|
|
1765
|
+
const G = l.getUsedRange()?.getCoords() ?? bt.EmptyRange, ae = l.getSelection().getCoords().cell;
|
|
1766
|
+
return { colIndex: Math.max(G.colEnd, ae.colIndex), rowIndex: Math.max(G.rowEnd, ae.rowIndex) };
|
|
1767
1767
|
}, [O, W] = ue(V), ee = O ? (r === rn.Vertical ? O.rowIndex : O.colIndex) + 1 : 0, I = () => {
|
|
1768
|
-
const
|
|
1769
|
-
bt.isEqualCells(O,
|
|
1768
|
+
const G = V();
|
|
1769
|
+
bt.isEqualCells(O, G) || W(G);
|
|
1770
1770
|
};
|
|
1771
1771
|
gt(l.getView(), { onFreezeSplitChange: () => {
|
|
1772
1772
|
S(q);
|
|
1773
1773
|
} }), gt(l.getSelection(), { onChange: I }), gt(l, { onUsedRangeChange: I }), be(() => {
|
|
1774
1774
|
W(V());
|
|
1775
1775
|
}, [l]), be(() => {
|
|
1776
|
-
if (!L) return D && E?.(), void
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1776
|
+
if (!L) return D && E?.(), void _(!1);
|
|
1777
|
+
const G = $.getTextAt($.findIndex(w / (l.getView().getZoomScale() / 100) + v.scroll + v.shift));
|
|
1778
|
+
_(!0), b?.({ ...L, display: (r === rn.Vertical ? "Row" : "Column") + ": " + G });
|
|
1779
1779
|
}, [s, w, v, r, L, $, D, l]);
|
|
1780
|
-
const y = ie((
|
|
1781
|
-
N(
|
|
1782
|
-
const Fe =
|
|
1783
|
-
c?.(Fe, fe,
|
|
1780
|
+
const y = ie((G, ae, Ae) => {
|
|
1781
|
+
N(G);
|
|
1782
|
+
const Fe = G + v.scroll, fe = ae + v.shift, _e = Ae + v.shift + v.scroll;
|
|
1783
|
+
c?.(Fe, fe, _e);
|
|
1784
1784
|
}, [c, v]), B = s - v.scroll, te = d - v.shift, Se = C - (v.shift + v.scroll), oe = $.findOffset(ee) * (l.getView().getZoomScale() / 100) - (v.scroll + v.shift);
|
|
1785
|
-
return p(oi, { ref: A, style: n, offset: B, viewportSize: te, totalSize: Se, orientation: r, showCustomScrollButtons: u, onMouseDown: (
|
|
1786
|
-
M({ anchor: { x:
|
|
1785
|
+
return p(oi, { ref: A, style: n, offset: B, viewportSize: te, totalSize: Se, orientation: r, showCustomScrollButtons: u, onMouseDown: (G) => {
|
|
1786
|
+
M({ anchor: { x: G.clientX, y: G.clientY } }), G.preventDefault();
|
|
1787
1787
|
}, onScrollOffset: y, onMouseOut: () => {
|
|
1788
1788
|
M(null);
|
|
1789
1789
|
}, onMouseUp: () => {
|
|
@@ -1799,7 +1799,7 @@ const xr = (e, t, n = null) => {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
return r;
|
|
1801
1801
|
}, Sr = pt(vt((e, t) => {
|
|
1802
|
-
const { sheetHeader: n, gridRef: r, sheetElement: l, commands: o, oppositeSize: i = 30, containerWidth: c, containerHeight: u, headerText: s, freezeStart: C, gridStyle: d, verticalPadding: g, horizontalPadding: R, onSheetContextMenu: b, onResizeHeadersStart: E, onResizeHeaders: A, onResizeHeadersEnd: U, onResizeHeadersDown: P, onResizeHeadersUp: w, scrollPoint: N, onSelectionStart: q, onSelectionEnd: v } = e, S = ye(() => n.getOrientation(), [n]), L = Te(null), [M, D] = ln((F) => F + 1, 0), [
|
|
1802
|
+
const { sheetHeader: n, gridRef: r, sheetElement: l, commands: o, oppositeSize: i = 30, containerWidth: c, containerHeight: u, headerText: s, freezeStart: C, gridStyle: d, verticalPadding: g, horizontalPadding: R, onSheetContextMenu: b, onResizeHeadersStart: E, onResizeHeaders: A, onResizeHeadersEnd: U, onResizeHeadersDown: P, onResizeHeadersUp: w, scrollPoint: N, onSelectionStart: q, onSelectionEnd: v } = e, S = ye(() => n.getOrientation(), [n]), L = Te(null), [M, D] = ln((F) => F + 1, 0), [_, $] = ln((F) => F + 1, 0), V = n?.getSheet(), O = Te(!1);
|
|
1803
1803
|
Ot(() => {
|
|
1804
1804
|
O.current = !0;
|
|
1805
1805
|
}, [n]);
|
|
@@ -1814,7 +1814,7 @@ const xr = (e, t, n = null) => {
|
|
|
1814
1814
|
L.current?.invalidate(), $();
|
|
1815
1815
|
}, []), oe = Ye(ot.debounce(() => {
|
|
1816
1816
|
Se();
|
|
1817
|
-
}, 10), []), [
|
|
1817
|
+
}, 10), []), [G, ae] = ue(null);
|
|
1818
1818
|
gt(n.getSheet(), { onSelectionChange() {
|
|
1819
1819
|
ae(V?.getSelection().getCoords()), oe();
|
|
1820
1820
|
}, onProtectionChange() {
|
|
@@ -1826,23 +1826,23 @@ const xr = (e, t, n = null) => {
|
|
|
1826
1826
|
}, [S, I, i]), Ot(() => {
|
|
1827
1827
|
te(null), y(n?.getSheet().getView().getZoomScale() / 100), Oe(de());
|
|
1828
1828
|
}, [n]);
|
|
1829
|
-
const
|
|
1830
|
-
|
|
1831
|
-
const k = { size:
|
|
1832
|
-
if (
|
|
1829
|
+
const Ae = Ye((F) => n.at(F)?.isHidden() || n.at(F)?.getSize() === 0, [n]), Fe = Ye((F, Z) => n.hiddenHeadersAt(F, Z), [Ae]), fe = ie((F) => n.isSelected(F), [n]), _e = ie((F) => n.isSelectedAll(F), [n]), ve = Ye(() => n.getMinSize(), [n]), Ge = Ye(() => n.getMaxSize(), [n]), De = ie((F, Z, a) => {
|
|
1830
|
+
Z /= I;
|
|
1831
|
+
const k = { size: Z = Math.max(ve(), Math.min(ot.roundAccurately(Z, ve()), Ge())), hidden: !1 }, T = [];
|
|
1832
|
+
if (Z <= 0 && (k.hidden = !0, k.size = a), T.push({ address: { min: F, max: F }, update: k }), Z < 0) {
|
|
1833
1833
|
const f = S === we.Orientation.Column, z = f ? xe.getColOffset : xe.getRowOffset, h = f ? xe.getColIndex : xe.getRowIndex, H = z(F);
|
|
1834
|
-
let
|
|
1835
|
-
const J = z(
|
|
1836
|
-
J === H +
|
|
1834
|
+
let j = h(H + Z);
|
|
1835
|
+
const J = z(j);
|
|
1836
|
+
J === H + Z ? j-- : T.push({ address: { min: j, max: j }, update: { size: H - J + Z } }), F - j > 1 && T.push({ address: { min: j + 1, max: F - 1 }, update: { hidden: !0 } });
|
|
1837
1837
|
}
|
|
1838
|
-
n.updateHeaderPairs(T), A?.(F,
|
|
1839
|
-
}, [M, n, I, A]), ge = ie((F,
|
|
1838
|
+
n.updateHeaderPairs(T), A?.(F, Z, a);
|
|
1839
|
+
}, [M, n, I, A]), ge = ie((F, Z, a) => {
|
|
1840
1840
|
const k = S === we.Orientation.Column;
|
|
1841
1841
|
let T = null, f = { min: F, max: F };
|
|
1842
1842
|
if (n.isSelectedAll(F)) {
|
|
1843
1843
|
const z = n.getSelectedRuns();
|
|
1844
1844
|
z.length > 1 ? T = "Resize " + (k ? "Columns" : "Rows") : f = z[0];
|
|
1845
|
-
const h = { hidden:
|
|
1845
|
+
const h = { hidden: Z <= 0, size: (Z <= 0 ? a : Z) / I };
|
|
1846
1846
|
n.updateHeaderPairs(xr(z, h, F));
|
|
1847
1847
|
}
|
|
1848
1848
|
if (f) {
|
|
@@ -1850,82 +1850,82 @@ const xr = (e, t, n = null) => {
|
|
|
1850
1850
|
let h;
|
|
1851
1851
|
h = z === 1 ? n.getRange(f).at(0).getDisplayText() : n.getRange(f).toString(), T = `Resize ${k ? "Column" : "Row"}${z > 1 ? "s" : ""} '${h}'`;
|
|
1852
1852
|
}
|
|
1853
|
-
U?.(F,
|
|
1854
|
-
}, [M, n, U]), ce = ie((F,
|
|
1853
|
+
U?.(F, Z, T);
|
|
1854
|
+
}, [M, n, U]), ce = ie((F, Z) => {
|
|
1855
1855
|
const a = S === we.Orientation.Column;
|
|
1856
|
-
E(F,
|
|
1856
|
+
E(F, Z, `Resize ${a ? "Column" : "Row"}(s)`);
|
|
1857
1857
|
}, [E]), ke = ie((F) => {
|
|
1858
|
-
let
|
|
1858
|
+
let Z = !1;
|
|
1859
1859
|
const a = S === we.Orientation.Column, k = n.getSheet().getEntireRange().getCoords(), T = [], f = n.getSelectedRuns(), z = (h) => {
|
|
1860
1860
|
let H;
|
|
1861
1861
|
H = a ? { colStart: h.min, rowStart: k.rowStart, colEnd: h.max, rowEnd: k.rowEnd } : { colStart: k.colStart, rowStart: h.min, colEnd: k.colEnd, rowEnd: h.max }, T.push(H);
|
|
1862
1862
|
};
|
|
1863
1863
|
for (let h = 0; h < f.length; h++) {
|
|
1864
1864
|
const H = f[h];
|
|
1865
|
-
H.value.isSelectedAll && (H.min <= F && H.max >= F && (
|
|
1865
|
+
H.value.isSelectedAll && (H.min <= F && H.max >= F && (Z = !0), z(H));
|
|
1866
1866
|
}
|
|
1867
|
-
if (
|
|
1867
|
+
if (Z || z({ min: F, max: F }), n.getSheet().getRanges(T).autoFit({ orientations: a ? we.Orientations.Column : we.Orientations.Row }), Ae(F)) {
|
|
1868
1868
|
const h = { hidden: null }, H = xr(f, h);
|
|
1869
|
-
|
|
1869
|
+
Z || H.push({ address: F, update: h }), n.updateHeaderPairs(H);
|
|
1870
1870
|
}
|
|
1871
1871
|
U?.(F, null, "Resize Column(s)");
|
|
1872
|
-
}, [M, n, U,
|
|
1872
|
+
}, [M, n, U, Ae]), de = () => {
|
|
1873
1873
|
const F = S === we.Orientation.Column;
|
|
1874
|
-
return { getColOffset: (
|
|
1875
|
-
}, [xe, Oe] = ue(() => de()), qe = Ye((F,
|
|
1874
|
+
return { getColOffset: (Z) => F ? n.findOffset(Z) : Z === 0 ? 0 : i / I, getColIndex: (Z) => F ? n.findIndex(Z) : 0, getRowOffset: (Z) => F ? Z === 0 ? 0 : i / I : n.findOffset(Z), getRowIndex: (Z) => F ? 0 : n.findIndex(Z) };
|
|
1875
|
+
}, [xe, Oe] = ue(() => de()), qe = Ye((F, Z) => F.nativeEvent.which !== tl.Right || !_e(S === we.Orientation.Column ? Z.colIndex : Z.rowIndex), [S, _e]), Le = ie((F) => {
|
|
1876
1876
|
l.focusSheet();
|
|
1877
1877
|
}, [l]), We = ie((F) => {
|
|
1878
1878
|
V?.getSelection().updateCoords(F);
|
|
1879
|
-
}, [V]), { ...
|
|
1880
|
-
const
|
|
1881
|
-
return
|
|
1879
|
+
}, [V]), { ...Ze } = ol({ gridRef: r, commands: null, layout: xe, selection: G, fillHandleBorderColor: d.body.fill, selectionBackgroundColor: d.selection.fill, selectionBorderColor: d.selection.strokeFill, selectionRemoveBackgroundColor: d.selectionRemove.fill, selectionRemoveBorderColor: d.selectionRemove.strokeFill, disableTouchSelection: !0, onSelectionChange: We, canSelectionSpanMergedCells: (F) => {
|
|
1880
|
+
const Z = V.getRange(F);
|
|
1881
|
+
return Z.isEntireColumns() || Z.isEntireRows();
|
|
1882
1882
|
} }), m = ie(() => {
|
|
1883
1883
|
q?.();
|
|
1884
1884
|
const F = V?.getSelection();
|
|
1885
1885
|
F && F.setAdjusting(F.getCoords());
|
|
1886
1886
|
}, [V, q]), Ke = ie(async () => {
|
|
1887
1887
|
V?.getSelection().setAdjusting(null), v?.();
|
|
1888
|
-
}, [V, v]), { ...ct } = fi({ orientation: S, headerCount: W, gridRef: L, gridMainRef: r, newSelection:
|
|
1888
|
+
}, [V, v]), { ...ct } = fi({ orientation: S, headerCount: W, gridRef: L, gridMainRef: r, newSelection: Ze?.newSelection, modifySelection: Ze?.modifySelection, appendSelection: Ze?.appendSelection, clearSelections: Ze?.clearSelections, pointerDownInterceptor: qe, onPointerUp: Le, onDragStart: m, onDragEnd: Ke }), Qe = d.selection?.strokeFill;
|
|
1889
1889
|
be(() => {
|
|
1890
1890
|
if (!L.current) return void te(null);
|
|
1891
|
-
const F = S === we.Orientation.Column,
|
|
1891
|
+
const F = S === we.Orientation.Column, Z = n.getSelectedRuns(), a = n.isProtected() ? null : De, k = (f, z, h) => {
|
|
1892
1892
|
if (h) return p("div", F ? { style: { position: "absolute", borderBottom: `${d.headerSelection.strokeWidth}px solid ${Qe}`, pointerEvents: "none", top: `${it.boundPixel(-d.headerSelection.strokeWidth / 2)}px`, left: `${it.boundPixel(h.x - d.headerSelection.strokeWidth)}px`, width: `${it.boundPixel(h.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(h.y - d.headerSelection.strokeWidth)}px`, left: `${it.boundPixel(-d.headerSelection.strokeWidth / 2)}px`, width: i + d.headerSelection.strokeWidth - 0.5 + "px", height: `${it.boundPixel(h.height + d.headerSelection.strokeWidth + 1, !0)}px` } }, f);
|
|
1893
1893
|
}, T = (f, z, h) => {
|
|
1894
1894
|
const H = { x: 0, y: 0, width: 0, height: 0 };
|
|
1895
1895
|
if (F) {
|
|
1896
|
-
const
|
|
1897
|
-
if (!
|
|
1898
|
-
H.x =
|
|
1896
|
+
const j = h.toClipBounds(h.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: f, colEnd: Math.min(W, z) }), $o);
|
|
1897
|
+
if (!j) return;
|
|
1898
|
+
H.x = j.x, H.width = j.width;
|
|
1899
1899
|
} else {
|
|
1900
|
-
const
|
|
1901
|
-
if (!
|
|
1902
|
-
H.y =
|
|
1900
|
+
const j = h.toClipBounds(h.getRangeCoordsBounds({ rowStart: f, rowEnd: Math.min(W, z), colStart: 0, colEnd: 0 }), $o);
|
|
1901
|
+
if (!j) return;
|
|
1902
|
+
H.y = j.y, H.height = j.height;
|
|
1903
1903
|
}
|
|
1904
1904
|
return { x: H.x, y: H.y, width: H.width, height: H.height };
|
|
1905
1905
|
};
|
|
1906
1906
|
te([(f) => {
|
|
1907
1907
|
const z = [];
|
|
1908
1908
|
let h = null, H = F ? f.getVisibleColumns() : f.getVisibleRows();
|
|
1909
|
-
const
|
|
1910
|
-
H.length > 0 && H[0] >
|
|
1909
|
+
const j = F ? f.getTotalRangeCoords().colStart : f.getTotalRangeCoords().rowStart;
|
|
1910
|
+
H.length > 0 && H[0] > j && (H = [H[0] - 1, ...H]);
|
|
1911
1911
|
let J = [];
|
|
1912
1912
|
const re = [];
|
|
1913
1913
|
for (let me = 0; me < H.length; me++) {
|
|
1914
1914
|
const Re = H[me], Pe = me < H.length - 1 ? H[me + 1] : Re + Fe(Re + 1, !1) + 1, Be = Re + 1 !== Pe;
|
|
1915
|
-
if (!h || h.max < Re) if (
|
|
1916
|
-
const Ee = ot.findEqualOrGreater(
|
|
1917
|
-
h =
|
|
1915
|
+
if (!h || h.max < Re) if (Z.length > 0 && Z[Z.length - 1].max >= Re) {
|
|
1916
|
+
const Ee = ot.findEqualOrGreater(Z, Re, (rt) => rt.max);
|
|
1917
|
+
h = Z[Ee];
|
|
1918
1918
|
} else h = null;
|
|
1919
1919
|
let et = !1, $e = !1;
|
|
1920
|
-
if (h?.value && (h.min <= Re || h.min <= Pe && !Be) && (et = !0, $e = h.value.isSelectedAll), Re ===
|
|
1920
|
+
if (h?.value && (h.min <= Re || h.min <= Pe && !Be) && (et = !0, $e = h.value.isSelectedAll), Re === j) {
|
|
1921
1921
|
let Ee = !1, rt = !1;
|
|
1922
1922
|
h?.value && h.min <= Re && (Ee = !0, rt = h.value.isSelectedAll), Re > 0 && re.push({ index: Re - 1, isNextHidden: Be, isSelected: Ee, isSelectedAll: rt, disabledResize: !0 });
|
|
1923
1923
|
}
|
|
1924
1924
|
if ($e && J.push(re.length), re.push({ index: Re, isHidden: me === 0 && Fe(Re, !1) > 0, isNextHidden: Be, isSelected: et, isSelectedAll: $e, onDividerMouseDown: P, onDividerResizeStart: ce, onDividerResize: a, onDividerMouseUp: w, onDividerResizeEnd: ge, onDividerAutoFit: ke }), Be) {
|
|
1925
1925
|
let Ee = !1, rt = !1;
|
|
1926
|
-
if (h && h.min >= Re && h.max <= Pe - 1 && h.value.isSelectedAll && J.push(re.length), !(h?.value && h.max >= Pe)) if (
|
|
1927
|
-
const qt = ot.findEqualOrGreater(
|
|
1928
|
-
h =
|
|
1926
|
+
if (h && h.min >= Re && h.max <= Pe - 1 && h.value.isSelectedAll && J.push(re.length), !(h?.value && h.max >= Pe)) if (Z.length > 0 && Z[Z.length - 1].max >= Pe) {
|
|
1927
|
+
const qt = ot.findEqualOrGreater(Z, Pe, (Ct) => Ct.max);
|
|
1928
|
+
h = Z[qt];
|
|
1929
1929
|
} else h = null;
|
|
1930
1930
|
h?.value && h.min <= Pe && (Ee = h.value.isSelected, rt = h.value.isSelectedAll), Pe > 0 && re.push({ index: Pe - 1, isHidden: !0, isSelected: Ee, isSelectedAll: rt, onDividerMouseDown: P, onDividerResizeStart: ce, onDividerResize: a, onDividerMouseUp: w, onDividerResizeEnd: ge, onDividerAutoFit: ke });
|
|
1931
1931
|
}
|
|
@@ -1937,7 +1937,7 @@ const xr = (e, t, n = null) => {
|
|
|
1937
1937
|
let et = null;
|
|
1938
1938
|
F ? (et = f.getRangeCoordsBounds({ rowStart: 0, rowEnd: 0, colStart: Be, colEnd: Be }), et.x + et.width > f.getBounds().width && (me -= 1, me === 0 && (me = -1))) : (et = f.getRangeCoordsBounds({ rowStart: Be, rowEnd: Be, colStart: 0, colEnd: 0 }), et.y + et.height > f.getBounds().height && (me -= 1, me === 0 && (me = -1)));
|
|
1939
1939
|
}
|
|
1940
|
-
const Re =
|
|
1940
|
+
const Re = Z?.[Z.length - 1], Pe = f.getAnchor();
|
|
1941
1941
|
if (Pe === "t" || Pe === "l") {
|
|
1942
1942
|
const Be = re[J[Math.max(0, J.length - 1)]];
|
|
1943
1943
|
Be.showTouchDivider = Re && Re.max <= Be.index;
|
|
@@ -1948,44 +1948,44 @@ const xr = (e, t, n = null) => {
|
|
|
1948
1948
|
return z;
|
|
1949
1949
|
}, (f) => {
|
|
1950
1950
|
const z = [];
|
|
1951
|
-
for (let h = 0;
|
|
1951
|
+
for (let h = 0; Z && h < Z.length; h++) z.push(k(`selection:${f.getAnchor()}:${h}`, 0, T(Z[h].min, Z[h].max, f)));
|
|
1952
1952
|
return z;
|
|
1953
1953
|
}]);
|
|
1954
|
-
}, [
|
|
1954
|
+
}, [_, !0, Qe, d, xe, W, C, M, I]), be(() => {
|
|
1955
1955
|
L.current?.invalidate();
|
|
1956
1956
|
}, [M]);
|
|
1957
1957
|
const K = ie((F) => s ? s(F) : n.getTextAt(F), [s, n]), Ne = ie((F) => {
|
|
1958
|
-
const { header:
|
|
1959
|
-
return p(vi, { orientation: S, index: S === we.Orientation.Column ? f.colStart : f.rowStart, isSelected: fe, isSelectedAll:
|
|
1960
|
-
}, [M, W, d, I, n]),
|
|
1961
|
-
const F = "white",
|
|
1958
|
+
const { header: Z, headerSelect: a, headerSelectAll: k, headerHover: T } = d ?? {}, { range: f, key: z, ...h } = F;
|
|
1959
|
+
return p(vi, { orientation: S, index: S === we.Orientation.Column ? f.colStart : f.rowStart, isSelected: fe, isSelectedAll: _e, zoomScale: 100 * I, headerText: K, headerStyle: Z, headerStyleSelect: a, headerStyleSelectAll: k, headerStyleHover: T, verticalPadding: g, horizontalPadding: R, ...h }, z);
|
|
1960
|
+
}, [M, W, d, I, n]), je = dn(), ze = ye(() => {
|
|
1961
|
+
const F = "white", Z = "black", a = {};
|
|
1962
1962
|
if (it.detectIt().primaryInput !== "touch") {
|
|
1963
|
-
let k = S === we.Orientation.Column ? `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${
|
|
1964
|
-
|
|
1963
|
+
let k = S === we.Orientation.Column ? `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${Z}' fill='${F}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer` : `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Z}' fill='${F}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;
|
|
1964
|
+
je.getMode()?.key === "formatPainter" && (k = `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='${Z}' fill='${F}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`), a.cursor = k;
|
|
1965
1965
|
}
|
|
1966
1966
|
return a.backgroundColor = d?.header?.fill || "transparent", a;
|
|
1967
|
-
}, [S, M,
|
|
1967
|
+
}, [S, M, je, d]), He = jt(t, () => ({ scrollTo: (F) => {
|
|
1968
1968
|
L.current?.scrollTo(F);
|
|
1969
1969
|
}, forceRender: () => {
|
|
1970
1970
|
D();
|
|
1971
1971
|
}, getGridElement: () => L.current }), []), Ve = Ye((F) => {
|
|
1972
1972
|
ct.onPointerDown(F);
|
|
1973
1973
|
}, [ct]), x = Ye((F) => {
|
|
1974
|
-
const
|
|
1975
|
-
if (!
|
|
1974
|
+
const Z = ct.getCellCoordsFromClient(F.clientX, F.clientY);
|
|
1975
|
+
if (!Z || !b) return;
|
|
1976
1976
|
const a = S === we.Orientation.Column;
|
|
1977
|
-
b({ originalEvent: F, clientX: F.clientX, clientY: F.clientY, rowIndex: a ? -1 :
|
|
1977
|
+
b({ originalEvent: F, clientX: F.clientX, clientY: F.clientY, rowIndex: a ? -1 : Z.rowIndex, colIndex: a ? Z.colIndex : -1 }), F.stopPropagation(), F.preventDefault();
|
|
1978
1978
|
}, [ct, b]), ne = ye(() => {
|
|
1979
1979
|
const F = S === we.Orientation.Column;
|
|
1980
1980
|
return p("div", { ref: He, children: p(rl, { className: "sheet-header", style: ze, ref: L, scrollPoint: ee, columnCount: F ? W : 1, rowCount: F ? 1 : W, width: F ? c : i, height: F ? i : u, freezeLeft: F ? C : void 0, freezeTop: F ? void 0 : C, hiddenColumnsAt: F ? Fe : void 0, hiddenRowsAt: F ? void 0 : Fe, showGridLines: !1, layout: xe, clipCells: !1, allowOverlaysOverflow: !0, enableMouseWheel: !1, onContextMenu: x, onPointerDown: Ve, zoom: I, cellRenderer: Ne, overlays: B }) });
|
|
1981
|
-
}, [B, xe, c, u, ee, ze,
|
|
1981
|
+
}, [B, xe, c, u, ee, ze, _]);
|
|
1982
1982
|
return be(() => {
|
|
1983
1983
|
O.current = !1, L.current?.invalidate(), $();
|
|
1984
1984
|
}, [n, d]), ne;
|
|
1985
1985
|
})), Pi = pt(vt((e, t) => {
|
|
1986
1986
|
const { view: n, sheet: r, getVisibleCells: l, gridStyle: o } = e, i = ie((s, C) => s.getStyle().getBorder(), []), { overlay: c } = dl({ getVisibleCells: l, getBorderAt: i, darkMode: o.body.darkMode, shiftIfWide: !0 }), u = c(n);
|
|
1987
1987
|
return u && n ? u : null;
|
|
1988
|
-
})), Wi = { key: "copy", description: "'Copy' Select destination and press ENTER or choose Paste." }, $i = { key: "cut", description: "'Cut' Select destination and press ENTER or choose Paste." }, Ui = { type: Kt.Content.Values },
|
|
1988
|
+
})), Wi = { key: "copy", description: "'Copy' Select destination and press ENTER or choose Paste." }, $i = { key: "cut", description: "'Cut' Select destination and press ENTER or choose Paste." }, Ui = { type: Kt.Content.Values }, _i = { fitDestination: !0, type: Kt.Content.Formats }, ji = { fitDestination: !0, type: Kt.Content.Formulas }, Gi = { transpose: !0 }, Zi = { fitDestination: !0, adjustCells: (e, t, n) => ({ value: `=${t.getA1({ $colIndex: !0, $rowIndex: !0 })}` }) }, Ki = ({ element: e, sheet: t, sheetView: n, commands: r, onClipboardUpdate: l, onPaste: o, selectionRenderer: i = yi, copyForegroundColor: c = "rgb(33, 115, 70)", cutForegroundColor: u = "rgb(33, 115, 70)", copyBackgroundColor: s = "white", cutBackgroundColor: C = "white", notifier: d, ...g }) => {
|
|
1989
1989
|
const R = ie(i, [i]), b = Te(null), E = dn(), A = E.getMode(), U = ye(() => ({ element: e, doCopy: (v) => {
|
|
1990
1990
|
const S = t.getSelectedRanges().getSnapshot(v);
|
|
1991
1991
|
return new Jl(S);
|
|
@@ -1997,8 +1997,8 @@ const xr = (e, t, n = null) => {
|
|
|
1997
1997
|
S?.contentsOnly && delete (S = { ...S, type: Kt.Content.Values }).contentsOnly;
|
|
1998
1998
|
const L = t.getSelectedRange(), M = v.getItem(), D = M.getName();
|
|
1999
1999
|
return await L.doBatch(async () => {
|
|
2000
|
-
const
|
|
2001
|
-
!
|
|
2000
|
+
const _ = await L.copyFrom(M, S);
|
|
2001
|
+
!_ || _.isEntireRows() || _.isEntireColumns() || _.autoFit({ orientations: we.Orientations.Row, minContent: !0 });
|
|
2002
2002
|
}, { description: "Paste" + (D ? ` ${D}` : ""), autoSelect: !0 }), !0;
|
|
2003
2003
|
} }), [t, n, d, e]), { clipboard: w, ...N } = Qr({ ...g, source: U, commands: r, target: P, notifier: d, onClipboardUpdate: (v) => {
|
|
2004
2004
|
const S = v?.getItemType() === "range" ? v : null;
|
|
@@ -2014,9 +2014,9 @@ const xr = (e, t, n = null) => {
|
|
|
2014
2014
|
let L = E.getMode()?.key === "cut" || v.isCut?.();
|
|
2015
2015
|
if (!L && E.getMode()?.key === "copy") {
|
|
2016
2016
|
const M = v.getItem().getCoords(), D = t.getSelectedRanges().getCoords();
|
|
2017
|
-
let
|
|
2018
|
-
if (!
|
|
2019
|
-
L =
|
|
2017
|
+
let _ = !1;
|
|
2018
|
+
if (!_ && M && D && v.getItem().getSource?.() === t) for (let $ = 0; !_ && $ < D.length; $++) _ = bt.isRangesIntersect(M, D[$]);
|
|
2019
|
+
L = _;
|
|
2020
2020
|
}
|
|
2021
2021
|
L && E.setMode(null), e?.()?.focus(), o?.(v, S);
|
|
2022
2022
|
} });
|
|
@@ -2032,7 +2032,7 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2032
2032
|
}, [r, e]), be(() => {
|
|
2033
2033
|
if (!r) return;
|
|
2034
2034
|
const v = { disabled: !t.getProtection().isFormatCellsAllowed() };
|
|
2035
|
-
r.getCommand("pasteValues").updateCallback((S) => N.paste({ ...Ui, ...S })).update(v), r.getCommand("pasteFormats").updateCallback((S, L) => N.paste({ ...
|
|
2035
|
+
r.getCommand("pasteValues").updateCallback((S) => N.paste({ ...Ui, ...S })).update(v), r.getCommand("pasteFormats").updateCallback((S, L) => N.paste({ ..._i, description: L.label(), ...S })).update(v), r.getCommand("pasteFormulas").updateCallback((S, L) => N.paste({ ...ji, description: L.label(), ...S })).update(v), r.getCommand("pasteTranspose").updateCallback((S, L) => N.paste({ ...Gi, description: L.label(), ...S })).update(v), r.getCommand("pasteLinks").updateCallback((S, L) => N.paste({ ...Zi, description: L.label(), ...S })).update(v), r.getCommand("cut").update(v), r.getCommand("paste").update(v);
|
|
2036
2036
|
}, [t, r]);
|
|
2037
2037
|
const q = ye(() => {
|
|
2038
2038
|
if (!A || !b.current) return;
|
|
@@ -2040,7 +2040,7 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2040
2040
|
if (v !== "copy" && v !== "cut" && v !== "formatPainter") return;
|
|
2041
2041
|
const S = b.current.getItem();
|
|
2042
2042
|
if (S.getSource() !== t) return;
|
|
2043
|
-
const L = b.current.isCut?.(), M = L ? C : s, D = L ? u : c,
|
|
2043
|
+
const L = b.current.isCut?.(), M = L ? C : s, D = L ? u : c, _ = S.getCoords(), $ = _ ? [_] : null;
|
|
2044
2044
|
return $ && $.length !== 0 ? (V) => {
|
|
2045
2045
|
const O = [];
|
|
2046
2046
|
for (let W = 0; W < $.length; W++) {
|
|
@@ -2057,10 +2057,10 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2057
2057
|
} }), be(() => {
|
|
2058
2058
|
n?.getStage();
|
|
2059
2059
|
}, [n?.getStage()]), C && n ? C(n) : null;
|
|
2060
|
-
})), Yi = "_sheet-
|
|
2060
|
+
})), Yi = "_sheet-selection_1tbzy_9", Ji = { key: "dragCut", description: "Drag selection to move cell contents.", cursor: "move" }, Qi = { key: "dragCutInsert", description: "Drag selection to insert cell contents.", cursor: "copy" }, ea = { key: "dragCopy", description: "Drag selection to copy cell contents." }, ta = { key: "dragCopyInsert", description: "Drag selection to insert copied cell contents.", cursor: "move" }, kr = (e, t) => t.ctrlKey && t.shiftKey ? ta : t.ctrlKey ? ea : t.shiftKey ? Qi : Ji, na = { key: "fill", description: "Drag selection to extend series or fill.", cursor: "crosshair" }, oa = pt(vt((e, t) => {
|
|
2061
2061
|
const { view: n, commands: r, className: l, onFirstRender: o, notifier: i, onShowTooltip: c, onCloseTooltip: u, sheet: s, gridRef: C, gridStyle: d, isActive: g, editingCoords: R, ...b } = e, E = n?.getBounds(), A = ie(c, [c]), U = ie(u, [u]), [P, w] = ue(() => s?.getSelection().getCoords()), N = ie((ge) => {
|
|
2062
2062
|
bt.isEqualSelectionCoords(ge, P) || s && s.getSelection().updateCoords(ge);
|
|
2063
|
-
}, [s, P]), q = dn(), v = Te(null), [S, L] = ue(s?.getProtection().isLocked()), [M, D] = ue(s?.getView().getMovableSelection().length > 0),
|
|
2063
|
+
}, [s, P]), q = dn(), v = Te(null), [S, L] = ue(s?.getProtection().isLocked()), [M, D] = ue(s?.getView().getMovableSelection().length > 0), _ = it.detectIt().primaryInput === "touch", $ = !_ && g, V = R !== null || M, O = ie((ge) => {
|
|
2064
2064
|
const ce = bt.cellToRange(ge);
|
|
2065
2065
|
if (s.isClosed()) return ce;
|
|
2066
2066
|
const ke = s.getRange(ce, { excludeHidden: !0 }).getMerges();
|
|
@@ -2096,7 +2096,7 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2096
2096
|
} }), gt(s, { onProtectionChange: () => {
|
|
2097
2097
|
L(s.getProtection().isLocked());
|
|
2098
2098
|
} });
|
|
2099
|
-
const { body:
|
|
2099
|
+
const { body: G = {} } = d || {}, ae = n.getLayout(), Ae = !($ && P.ranges.length <= 1 && R === null && !S && (!q.getMode() || oe)), { cursor: Fe, overlay: fe, onPointerDown: _e } = ol({ gridRef: C, commands: r, layout: ae, getCellCoordsAsRangeCoords: O, selection: P, fillHandleBorderColor: G.fill, selectionBackgroundColor: g ? d.selection.fill : d.selectionInactive.fill, selectionBorderColor: g ? d.selection.strokeFill : d.selectionInactive.strokeFill, selectionRemoveBackgroundColor: g ? d.selectionRemove.fill : d.selectionInactive.fill, selectionRemoveBorderColor: g ? d.selectionRemove.strokeFill : d.selectionInactive.strokeFill, disableFillDrag: Ae, disableMoveDrag: _ || !(g && P.ranges.length <= 1 && R === null && !S), disableTouchSelection: V, onSelectionChange: N, onSelectionDragStart: te, onSelectionDragEnd: Se, onMoveDragStart: (ge, ce, ke) => {
|
|
2100
2100
|
q.setMode(kr(0, ke));
|
|
2101
2101
|
}, onMoveDragUpdate: (ge, ce, ke) => {
|
|
2102
2102
|
q.setMode(kr(0, ke));
|
|
@@ -2107,9 +2107,9 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2107
2107
|
const de = s.getRange(ce);
|
|
2108
2108
|
if (i?.showOptions) {
|
|
2109
2109
|
const We = de.getDifferences(ge);
|
|
2110
|
-
let
|
|
2111
|
-
for (let m = 0; !
|
|
2112
|
-
if (
|
|
2110
|
+
let Ze = !1;
|
|
2111
|
+
for (let m = 0; !Ze && m < We.getCount(); m++) Ze = We.at(m).isContentful();
|
|
2112
|
+
if (Ze && await i?.showOptions({ title: "Confirm", description: "There is already data here. Do you want to replace it?", options: ["Replace", "Cancel"], defaultOption: "Replace" }) !== "Replace")
|
|
2113
2113
|
return;
|
|
2114
2114
|
}
|
|
2115
2115
|
const xe = !ke.ctrlKey, Oe = ke.shiftKey, qe = Oe ? xe ? "Insert Moved Cells" : "Insert Copied Cells" : xe ? "Move Cells" : "Copy Cells", Le = await i?.showBusy?.(qe);
|
|
@@ -2149,25 +2149,25 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2149
2149
|
const xe = de.toText();
|
|
2150
2150
|
if (!xe) return;
|
|
2151
2151
|
const Oe = bt.cellToRange(de.getCoords()), qe = n.getRelativePointFromClient(0, 0);
|
|
2152
|
-
let Le = 0, We = 0,
|
|
2152
|
+
let Le = 0, We = 0, Ze = zn.Bottom;
|
|
2153
2153
|
if (ke === we.Direction.Down) {
|
|
2154
2154
|
Le = ae.getColOffset(Oe.colEnd + 1) - qe.x;
|
|
2155
2155
|
const m = ae.getRowOffset(Oe.rowEnd), Ke = ae.getRowOffset(Oe.rowEnd + 1);
|
|
2156
|
-
We = Ke - (Ke - m) / 2 - qe.y,
|
|
2156
|
+
We = Ke - (Ke - m) / 2 - qe.y, Ze = zn.Right;
|
|
2157
2157
|
} else if (ke === we.Direction.Right) {
|
|
2158
2158
|
We = ae.getRowOffset(Oe.rowEnd + 1) - qe.y;
|
|
2159
2159
|
const m = ae.getColOffset(Oe.colEnd), Ke = ae.getColOffset(Oe.colEnd + 1);
|
|
2160
|
-
Le = Ke - (Ke - m) / 2 - qe.x,
|
|
2160
|
+
Le = Ke - (Ke - m) / 2 - qe.x, Ze = zn.Bottom;
|
|
2161
2161
|
} else if (ke === we.Direction.Up) {
|
|
2162
2162
|
Le = ae.getColOffset(Oe.colEnd + 1) - qe.x;
|
|
2163
2163
|
const m = ae.getRowOffset(Oe.rowStart), Ke = ae.getRowOffset(Oe.rowStart + 1);
|
|
2164
|
-
We = Ke - (Ke - m) / 2 - qe.y,
|
|
2164
|
+
We = Ke - (Ke - m) / 2 - qe.y, Ze = zn.Right;
|
|
2165
2165
|
} else if (ke === we.Direction.Left) {
|
|
2166
2166
|
We = ae.getRowOffset(Oe.rowEnd + 1) - qe.y;
|
|
2167
2167
|
const m = ae.getColOffset(Oe.colStart), Ke = ae.getColOffset(Oe.colStart + 1);
|
|
2168
|
-
Le = Ke - (Ke - m) / 2 - qe.x,
|
|
2168
|
+
Le = Ke - (Ke - m) / 2 - qe.x, Ze = zn.Bottom;
|
|
2169
2169
|
}
|
|
2170
|
-
A({ anchor: { x: Le, y: We }, display: xe, placement:
|
|
2170
|
+
A({ anchor: { x: Le, y: We }, display: xe, placement: Ze });
|
|
2171
2171
|
} catch (de) {
|
|
2172
2172
|
i?.showError?.(de);
|
|
2173
2173
|
}
|
|
@@ -2175,16 +2175,16 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2175
2175
|
}, onFillDone: () => {
|
|
2176
2176
|
v.current = null, q.setMode(null), U?.();
|
|
2177
2177
|
} }), ve = ie((ge) => {
|
|
2178
|
-
|
|
2179
|
-
}, [
|
|
2178
|
+
_e(it.createSyntheticEvent(ge));
|
|
2179
|
+
}, [_e, R]);
|
|
2180
2180
|
be(() => {
|
|
2181
2181
|
const ge = n?.getStage();
|
|
2182
2182
|
if (ge) return ge.addEventListener("pointerdown", ve), () => {
|
|
2183
2183
|
ge.removeEventListener("pointerdown", ve);
|
|
2184
2184
|
};
|
|
2185
2185
|
}, [n?.getStage()]);
|
|
2186
|
-
const
|
|
2187
|
-
return p("div", { className: Vt(l, "sheet-selection", Yi), style: { position: "absolute", width: E?.width, height: E?.height, overflow: "hidden", pointerEvents: "none", willChange: "none" }, ref: Cn([
|
|
2186
|
+
const Ge = jt(t, () => ({}), []), De = Te(null);
|
|
2187
|
+
return p("div", { className: Vt(l, "sheet-selection", Yi), style: { position: "absolute", width: E?.width, height: E?.height, overflow: "hidden", pointerEvents: "none", willChange: "none" }, ref: Cn([Ge, De]), ...b, children: fe(n) });
|
|
2188
2188
|
})), io = Object.freeze({ x: 0, y: 0, width: 0, height: 0 }), ra = { fireOnModelChange: !1 }, la = pt(vt((e, t) => {
|
|
2189
2189
|
const { children: n, view: r, movable: l, onRefLoad: o, onRefUnload: i, onHide: c, onShow: u, onUnFocus: s, isDragging: C, updateFrameBounds: d, dragStart: g, style: R, disabled: b, renderMovable: E, ...A } = e, [U, P] = ue(io), [w, N] = ue(null), [q, v] = ue(!1), S = Te(null);
|
|
2190
2190
|
Ot(() => {
|
|
@@ -2196,8 +2196,8 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2196
2196
|
}, [r?.getBounds()]), gt(l, { onBoundsChange: (M) => {
|
|
2197
2197
|
const D = M.getBounds();
|
|
2198
2198
|
if (!D) return;
|
|
2199
|
-
const
|
|
2200
|
-
P(
|
|
2199
|
+
const _ = r.toViewBounds(D);
|
|
2200
|
+
P(_ ?? io), d(_);
|
|
2201
2201
|
}, onSelectionChange: () => {
|
|
2202
2202
|
const M = ot.hasFocus(S.current, !0);
|
|
2203
2203
|
!q && !M || l.isSelected() || s();
|
|
@@ -2213,15 +2213,15 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2213
2213
|
return E({ view: r, movable: l, disabled: b, isDragging: C, style: { position: "relative", left: 0, top: 0, width: M, height: D }, onHide: c, onShow: u });
|
|
2214
2214
|
}, [r, l, U.width, U.height, b, C]);
|
|
2215
2215
|
return p("div", { className: "movable", tabIndex: 0, ref: Cn([S, t]), style: { display: "flex", alignItems: "stretch", justifyContent: "stretch", position: "absolute", maxWidth: "auto", maxHeight: "auto", minWidth: "auto", minHeight: "auto", left: U.x, top: U.y, width: U.width, height: U.height, ...R }, onMouseDown: async (M) => {
|
|
2216
|
-
const D = M.shiftKey || M.ctrlKey,
|
|
2217
|
-
D &&
|
|
2216
|
+
const D = M.shiftKey || M.ctrlKey, _ = l.isSelected(), $ = M.currentTarget;
|
|
2217
|
+
D && _ ? l.unselect() : (_ && !D || await l.select({ addToSelection: D }), g(M.nativeEvent, $), $.focus());
|
|
2218
2218
|
}, onFocus: (M) => {
|
|
2219
2219
|
M.relatedTarget && !w && N(M.relatedTarget), v(!0);
|
|
2220
2220
|
}, onBlur: (M) => {
|
|
2221
2221
|
w && !S?.current?.contains(M.relatedTarget) && N(null), M.relatedTarget && v(!1);
|
|
2222
2222
|
}, ...A, children: L });
|
|
2223
|
-
})), ia = "_movable-
|
|
2224
|
-
const { view: n, movables: r, movablesView: l, renderMovable: o, transactional: i, onUnFocus: c, onFocus: u, disabled: s = !1, disableDrag: C = !1, disableResize: d = !1, className: g, style: R, renderDirections: b = ["nw", "n", "ne", "w", "e", "sw", "s", "se"], onFirstRender: E, ...A } = e, U = n.getBounds(), P = ie(E, [E]), w = ie(c, [c]), N = ie(u, [u]), [q, v] = ue([]), [S, L] = ue(!1), [M, D] = ue(!1),
|
|
2223
|
+
})), ia = "_movable-area_1xcl8_9", aa = pt(vt((e, t) => {
|
|
2224
|
+
const { view: n, movables: r, movablesView: l, renderMovable: o, transactional: i, onUnFocus: c, onFocus: u, disabled: s = !1, disableDrag: C = !1, disableResize: d = !1, className: g, style: R, renderDirections: b = ["nw", "n", "ne", "w", "e", "sw", "s", "se"], onFirstRender: E, ...A } = e, U = n.getBounds(), P = ie(E, [E]), w = ie(c, [c]), N = ie(u, [u]), [q, v] = ue([]), [S, L] = ue(!1), [M, D] = ue(!1), _ = Te(!0), $ = Te(/* @__PURE__ */ new Map()), V = Te(/* @__PURE__ */ new Map()), O = Te(/* @__PURE__ */ new Map()), W = Te(/* @__PURE__ */ new Map()), ee = Te(/* @__PURE__ */ new Map()), I = Te({ onRequestFocus: (K) => (ce(K), null) }), y = Te(null), B = Te(null), te = Te(null), [Se, oe] = ln((K) => K + 1, 0);
|
|
2225
2225
|
Ot(() => {
|
|
2226
2226
|
oe();
|
|
2227
2227
|
}, [n, r]), gt(r, { onCollectionChange: () => {
|
|
@@ -2229,11 +2229,11 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2229
2229
|
Ne.forEach((ze) => {
|
|
2230
2230
|
ze();
|
|
2231
2231
|
}), Ne.clear();
|
|
2232
|
-
const
|
|
2232
|
+
const je = I.current;
|
|
2233
2233
|
for (let ze = 0; ze < K.length; ze++) {
|
|
2234
2234
|
const He = K[ze];
|
|
2235
2235
|
if (He.isClosed()) continue;
|
|
2236
|
-
const Ve = He.addListeners(
|
|
2236
|
+
const Ve = He.addListeners(je);
|
|
2237
2237
|
Ne.set(He, Ve);
|
|
2238
2238
|
}
|
|
2239
2239
|
oe();
|
|
@@ -2242,33 +2242,33 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2242
2242
|
} }), gt(l, { onMovableSelectionChange(K) {
|
|
2243
2243
|
ae(), oe();
|
|
2244
2244
|
} });
|
|
2245
|
-
const
|
|
2246
|
-
const
|
|
2245
|
+
const G = Ye((K, Ne) => {
|
|
2246
|
+
const je = O.current.get(K);
|
|
2247
2247
|
te.current && (te.current.getTargets().forEach((ze) => {
|
|
2248
|
-
if (ze ===
|
|
2248
|
+
if (ze === je) return ze.style.left = Ne.x + "px", ze.style.top = Ne.y + "px", ze.style.width = Ne.width + "px", void (ze.style.height = Ne.height + "px");
|
|
2249
2249
|
}), te.current.updateRect());
|
|
2250
2250
|
}, []), ae = () => {
|
|
2251
2251
|
const K = [], Ne = l.getMovableSelection();
|
|
2252
|
-
Ne.forEach((
|
|
2253
|
-
const ze = O.current.get(
|
|
2254
|
-
ze && Ne.indexOf(
|
|
2255
|
-
}), v((
|
|
2256
|
-
},
|
|
2257
|
-
|
|
2258
|
-
}), []), fe = Te(null),
|
|
2252
|
+
Ne.forEach((je) => {
|
|
2253
|
+
const ze = O.current.get(je);
|
|
2254
|
+
ze && Ne.indexOf(je) !== -1 && K.push(ze);
|
|
2255
|
+
}), v((je) => ot.isEqualArrays(je, K) ? je : K);
|
|
2256
|
+
}, Ae = Te(null), Fe = ye(() => new Promise((K) => {
|
|
2257
|
+
Ae.current = K;
|
|
2258
|
+
}), []), fe = Te(null), _e = ie(async (K, Ne) => {
|
|
2259
2259
|
fe.current = Ne, await (async () => !(!await Fe.then() || !te.current))() && fe.current === Ne && te.current.dragStart(K, Ne);
|
|
2260
|
-
}, [q]), [ve,
|
|
2260
|
+
}, [q]), [ve, Ge] = ue(!1), De = Te(null), ge = Te(null), ce = ie(async (K = null) => {
|
|
2261
2261
|
if (K || (K = l.getMovableSelection()[0]), !K) return w?.(), !1;
|
|
2262
2262
|
const Ne = O.current.get(K);
|
|
2263
2263
|
Ne ? (await ot.whenFocus(Ne), Ne.focus(), ge.current = Ne, De.current = null) : De.current = K;
|
|
2264
2264
|
}, [l]);
|
|
2265
2265
|
be(() => {
|
|
2266
|
-
ve && q.length > 0 && ge.current !== q[0] && ce(),
|
|
2266
|
+
ve && q.length > 0 && ge.current !== q[0] && ce(), _.current && (P?.(), _.current = !1);
|
|
2267
2267
|
}, [q]);
|
|
2268
2268
|
const ke = ye(() => {
|
|
2269
2269
|
const K = r.search({ address: n.getVisibleRangeCoords(), excludeHidden: !0 });
|
|
2270
2270
|
if (K.length === 0 && $.current.size === 0) return null;
|
|
2271
|
-
const Ne = (x, ne, F,
|
|
2271
|
+
const Ne = (x, ne, F, Z = !0) => {
|
|
2272
2272
|
const a = x.isSelected(), k = { tabIndex: F, view: n, movable: x, onRefLoad: (T) => {
|
|
2273
2273
|
De.current === x && (T.focus(), ge.current = T, De.current = null), O.current.set(x, T), V.current.set(T, x), ne.rendered = !0, ae();
|
|
2274
2274
|
}, onRefUnload: (T) => {
|
|
@@ -2278,8 +2278,8 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2278
2278
|
}, onShow: (T) => {
|
|
2279
2279
|
ne.onShow = T;
|
|
2280
2280
|
}, isDragging: a && (M || S), disabled: s, renderMovable: o, updateFrameBounds: (T) => {
|
|
2281
|
-
|
|
2282
|
-
}, dragStart:
|
|
2281
|
+
G(x, T);
|
|
2282
|
+
}, dragStart: _e, onMouseUp: () => {
|
|
2283
2283
|
if (fe.current = null, B.current) {
|
|
2284
2284
|
L(!1), D(!1);
|
|
2285
2285
|
let T = !1;
|
|
@@ -2287,38 +2287,38 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2287
2287
|
ot.isEqualBounds(f.movable.getBounds(), f.startBounds) || (T = !0);
|
|
2288
2288
|
}), T ? xe() : Oe();
|
|
2289
2289
|
}
|
|
2290
|
-
}, style: { opacity:
|
|
2290
|
+
}, style: { opacity: Z ? S && a ? 0.7 : void 0 : 0, zIndex: S && a ? x.getZIndex() + K.length : void 0, pointerEvents: Z ? void 0 : "none", cursor: M && a ? "grabbing" : s || C ? "initial" : "move", boxShadow: !a || M && !S ? void 0 : "1px 1px 2px 2px rgba(0,0,0,.15)" } };
|
|
2291
2291
|
return p(la, { ...k }, `movable-${x.getUUID()}`);
|
|
2292
|
-
},
|
|
2292
|
+
}, je = $.current, ze = /* @__PURE__ */ new Map(), He = [];
|
|
2293
2293
|
for (let x = 0; x < K.length; x++) {
|
|
2294
2294
|
const ne = K[x];
|
|
2295
2295
|
if (ne.isClosed()) continue;
|
|
2296
|
-
let F =
|
|
2297
|
-
F || (F = { frame: null, shown: null, onShow: null, onHide: null, rendered: !1, doShow: (
|
|
2296
|
+
let F = je.get(ne);
|
|
2297
|
+
F || (F = { frame: null, shown: null, onShow: null, onHide: null, rendered: !1, doShow: (Z, a) => {
|
|
2298
2298
|
if (!a || a.shown === !0) return;
|
|
2299
2299
|
a.shown = !0;
|
|
2300
2300
|
const k = ++a.visibilityRequestId;
|
|
2301
2301
|
requestAnimationFrame(() => {
|
|
2302
|
-
const T = $.current.get(
|
|
2303
|
-
T && k === a.visibilityRequestId && (a.onShow?.(
|
|
2302
|
+
const T = $.current.get(Z);
|
|
2303
|
+
T && k === a.visibilityRequestId && (a.onShow?.(Z), T.shown = !0);
|
|
2304
2304
|
});
|
|
2305
|
-
}, doHide: async (
|
|
2305
|
+
}, doHide: async (Z, a) => {
|
|
2306
2306
|
if (!a || a?.shown === !1) return;
|
|
2307
2307
|
a.shown = !1;
|
|
2308
|
-
const k = ++a.visibilityRequestId, T = await Promise.resolve(a.onHide?.(
|
|
2309
|
-
k === a.visibilityRequestId && T !== !1 && (a.shown = !1, $.current.delete(
|
|
2310
|
-
}, visibilityRequestId: 0 }), F.frame = Ne(ne, F, x, !0), He.push(F.frame), F.doShow(ne, F),
|
|
2308
|
+
const k = ++a.visibilityRequestId, T = await Promise.resolve(a.onHide?.(Z));
|
|
2309
|
+
k === a.visibilityRequestId && T !== !1 && (a.shown = !1, $.current.delete(Z), oe());
|
|
2310
|
+
}, visibilityRequestId: 0 }), F.frame = Ne(ne, F, x, !0), He.push(F.frame), F.doShow(ne, F), je.delete(ne), ze.set(ne, F);
|
|
2311
2311
|
}
|
|
2312
2312
|
const Ve = [];
|
|
2313
2313
|
return l.getMovableSelection().forEach((x) => {
|
|
2314
|
-
const ne =
|
|
2315
|
-
ne && (ne.frame = Ne(x, ne, -1, !1), Ve.push(ne.frame),
|
|
2316
|
-
}),
|
|
2317
|
-
x.frame = Ne(ne, x, -1, !1), Ve.push(x.frame), x.doHide(ne, x),
|
|
2314
|
+
const ne = je.get(x);
|
|
2315
|
+
ne && (ne.frame = Ne(x, ne, -1, !1), Ve.push(ne.frame), je.delete(x), ze.set(x, ne));
|
|
2316
|
+
}), je.forEach((x, ne) => {
|
|
2317
|
+
x.frame = Ne(ne, x, -1, !1), Ve.push(x.frame), x.doHide(ne, x), je.delete(ne), ze.set(ne, x);
|
|
2318
2318
|
}), $.current = ze, ae(), [...Ve, ...He];
|
|
2319
2319
|
}, [Se, n, o, s, C, d, S, M]), de = ie((K, Ne) => {
|
|
2320
|
-
const
|
|
2321
|
-
B.current && (console.warn(`Transaction ${B.current.getDescription()} is being replaced by ${
|
|
2320
|
+
const je = `${Ne} ${q.length === 1 ? Yo.capitalize(V.current?.get(q[0]).getContent().getType()) : "Drawings"}`;
|
|
2321
|
+
B.current && (console.warn(`Transaction ${B.current.getDescription()} is being replaced by ${je}`), B.current.rollback(), B.current = null), B.current = i.beginCommit({ description: je }), W.current.clear();
|
|
2322
2322
|
for (let ze = 0; ze < q.length; ze++) {
|
|
2323
2323
|
const He = q[ze], Ve = V.current?.get(He);
|
|
2324
2324
|
Ve ? W.current.set(He, { movable: Ve, startBounds: n.toViewBounds(Ve.getBounds()) }) : console.warn("invalid element", Ve);
|
|
@@ -2337,24 +2337,24 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2337
2337
|
K.preventDefault(), K.srcElement.scrollTop = 0, K.srcElement.scrollLeft = 0;
|
|
2338
2338
|
});
|
|
2339
2339
|
}, [qe.current]);
|
|
2340
|
-
const Le =
|
|
2340
|
+
const Le = jt(t, () => ({ isMovableArea: () => !0, focusMovable: ce, focus: () => {
|
|
2341
2341
|
ce();
|
|
2342
|
-
} }), [l]), [We,
|
|
2342
|
+
} }), [l]), [We, Ze] = ue(null), m = Te(!1), Ke = Te(!1), ct = Te(!1);
|
|
2343
2343
|
be(() => {
|
|
2344
2344
|
if (s || q.length === 0 || ct.current || m.current) return;
|
|
2345
2345
|
if (Ke.current) return void requestAnimationFrame(() => {
|
|
2346
|
-
te.current && y.current && te.current.refTargets.length > 0 && (ct.current = !0,
|
|
2346
|
+
te.current && y.current && te.current.refTargets.length > 0 && (ct.current = !0, Ae.current?.(!0)), v([...q]);
|
|
2347
2347
|
});
|
|
2348
2348
|
m.current = !0;
|
|
2349
2349
|
const K = tt.lazy(async () => {
|
|
2350
2350
|
try {
|
|
2351
|
-
const Ne = await import("./
|
|
2351
|
+
const Ne = await import("./Bmhartce5vI06Jzb.mjs");
|
|
2352
2352
|
return m.current = !1, Ke.current = !0, v([...q]), Ne;
|
|
2353
2353
|
} catch (Ne) {
|
|
2354
|
-
return console.warn(Ne),
|
|
2354
|
+
return console.warn(Ne), Ae.current?.(!1), null;
|
|
2355
2355
|
}
|
|
2356
2356
|
});
|
|
2357
|
-
|
|
2357
|
+
Ze(K);
|
|
2358
2358
|
}, [q, s, C, d]);
|
|
2359
2359
|
const Qe = ye(() => !We || s ? null : p(nl, { children: p(We, { className: Vt({ dragging: S || M, resizing: S, moving: M }), container: null, ref: te, target: te.current ? q : [], draggable: !s && !C, resizable: !s && !d, individualGroupable: !0, edgeDraggable: !1, throttleDrag: 2, throttleResize: 2, origin: !1, keepRatio: !1, renderDirections: b, onResizeStart: (K) => {
|
|
2360
2360
|
de(K.target, "Resize");
|
|
@@ -2362,17 +2362,17 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2362
2362
|
if (!B.current) return K.stopDrag(), void oe();
|
|
2363
2363
|
L(!0);
|
|
2364
2364
|
const Ne = K.direction[0] !== 0 && K.direction[1] !== 0;
|
|
2365
|
-
let
|
|
2365
|
+
let je = 0, ze = 0;
|
|
2366
2366
|
for (let He = 0; He < q.length; He++) {
|
|
2367
2367
|
const Ve = q[He], x = W.current.get(Ve), ne = V.current.get(Ve);
|
|
2368
2368
|
if (!x || !ne) {
|
|
2369
2369
|
console.warn("invalid element");
|
|
2370
2370
|
continue;
|
|
2371
2371
|
}
|
|
2372
|
-
let F = K.dist[0],
|
|
2373
|
-
He === 0 ? (
|
|
2372
|
+
let F = K.dist[0], Z = K.dist[1], a = K.drag.dist[0], k = K.drag.dist[1], T = x.startBounds.width, f = x.startBounds.height;
|
|
2373
|
+
He === 0 ? (je = T, ze = f) : (F *= T / je, a *= T / je, Z *= f / ze, k *= f / ze);
|
|
2374
2374
|
const z = { ...x.startBounds };
|
|
2375
|
-
if (z.width = Math.max(0, T + F), z.height = Math.max(0, f +
|
|
2375
|
+
if (z.width = Math.max(0, T + F), z.height = Math.max(0, f + Z), K.direction[0] === -1 && (z.width = Math.max(0, Math.min(x.startBounds.x + T, T - a))), K.direction[1] === -1 && (z.height = Math.max(0, Math.min(x.startBounds.y + f, f - k))), Ne && (ne.isLockAspectRatio() || K.inputEvent?.shiftKey)) {
|
|
2376
2376
|
const h = T / f, H = z.width / z.height;
|
|
2377
2377
|
H > h ? z.height = z.width / h : H < h && (z.width = z.height * h);
|
|
2378
2378
|
}
|
|
@@ -2386,47 +2386,47 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2386
2386
|
if (!B.current) return K.stopDrag(), void oe();
|
|
2387
2387
|
D(!0);
|
|
2388
2388
|
for (let Ne = 0; Ne < q.length; Ne++) {
|
|
2389
|
-
const
|
|
2389
|
+
const je = q[Ne], ze = W.current.get(je);
|
|
2390
2390
|
ze ? ze.movable.setBounds(n.toAbsoluteBounds({ ...ze.startBounds, x: ze.startBounds.x + K.translate[0], y: ze.startBounds.y + K.translate[1] })) : console.warn("invalid element");
|
|
2391
2391
|
}
|
|
2392
2392
|
}, onDragEnd: (K) => {
|
|
2393
2393
|
}, onMouseUp: (K) => {
|
|
2394
2394
|
} }) }), [Se, We, q, n, s, C, d, S, M]);
|
|
2395
2395
|
return p("div", { className: Vt(g, "movable-area", ia), style: { width: U.width, height: U.height, ...R, position: "absolute", overflow: "hidden", willChange: "transform" }, ref: Cn([Le, qe]), ...A, children: p("div", { className: "movable-scroll", style: { position: "absolute", cursor: "initial", left: 0, top: 0, width: U.width, height: U.height }, ...A, children: Je("div", { ref: y, style: { position: "absolute", pointerEvents: "auto" }, onFocus: (K) => {
|
|
2396
|
-
N?.(),
|
|
2396
|
+
N?.(), Ge(!0);
|
|
2397
2397
|
}, onBlur: (K) => {
|
|
2398
|
-
|
|
2398
|
+
Ge(!1);
|
|
2399
2399
|
}, onKeyDownCapture: (K) => {
|
|
2400
2400
|
if (K.isDefaultPrevented()) return;
|
|
2401
|
-
const Ne = K.nativeEvent.ctrlKey,
|
|
2401
|
+
const Ne = K.nativeEvent.ctrlKey, je = K.nativeEvent.altKey, ze = K.nativeEvent.shiftKey;
|
|
2402
2402
|
if (K.which === It.Escape) {
|
|
2403
2403
|
const F = l.getMovableSelection();
|
|
2404
|
-
let
|
|
2404
|
+
let Z = [...F];
|
|
2405
2405
|
return q.forEach((a) => {
|
|
2406
|
-
if (
|
|
2406
|
+
if (Z.length === 0) return;
|
|
2407
2407
|
const k = V.current.get(a);
|
|
2408
|
-
let T =
|
|
2409
|
-
|
|
2410
|
-
}),
|
|
2408
|
+
let T = Z.indexOf(k);
|
|
2409
|
+
Z.splice(T, 1);
|
|
2410
|
+
}), Z.length !== F.length && l.selectMovables(Z), Z.length === 0 && w?.(), void K.preventDefault();
|
|
2411
2411
|
}
|
|
2412
2412
|
const He = 0.1, Ve = (F) => {
|
|
2413
|
-
r.updateSelected((
|
|
2414
|
-
|
|
2413
|
+
r.updateSelected((Z) => {
|
|
2414
|
+
Z.setRotation(Z.getRotation() + F);
|
|
2415
2415
|
}, "Rotate");
|
|
2416
|
-
}, x = (F,
|
|
2416
|
+
}, x = (F, Z = !0) => {
|
|
2417
2417
|
r.updateSelected((a) => {
|
|
2418
2418
|
const k = a.getBounds();
|
|
2419
2419
|
let T = 1 + F;
|
|
2420
|
-
|
|
2420
|
+
Z || (T = 1 / T);
|
|
2421
2421
|
const f = Math.sqrt(Math.pow(k.width, 2) + Math.pow(k.height, 2)), z = Math.atan2(k.height, k.width), h = T * f;
|
|
2422
2422
|
if (h < 10) return;
|
|
2423
|
-
const H = h * Math.cos(z),
|
|
2423
|
+
const H = h * Math.cos(z), j = h * Math.sin(z), J = { x: k.x + (k.width - H) / 2, y: k.y + (k.height - j) / 2, width: H, height: j };
|
|
2424
2424
|
a.setBounds(J);
|
|
2425
2425
|
}, "Resize");
|
|
2426
2426
|
}, ne = (F) => {
|
|
2427
|
-
r.updateSelected((
|
|
2428
|
-
const a =
|
|
2429
|
-
|
|
2427
|
+
r.updateSelected((Z) => {
|
|
2428
|
+
const a = Z.getBounds(), k = { x: a.x + (F.x ?? 0), y: a.y + (F.y ?? 0), width: a.width + (F.width ?? 0), height: a.height + (F.height ?? 0) };
|
|
2429
|
+
Z.setBounds(k);
|
|
2430
2430
|
}, "Nudge");
|
|
2431
2431
|
};
|
|
2432
2432
|
if (K.which === It.Delete) r.updateSelected((F) => {
|
|
@@ -2435,7 +2435,7 @@ The content is not applied.` }), new X("pasteFormulas", v, { label: "Paste Formu
|
|
|
2435
2435
|
else if (K.key === "a" && Ne) {
|
|
2436
2436
|
const F = l.getMovableSelection();
|
|
2437
2437
|
l.selectMovables(r.search(), !0), l.selectMovables(F, !0), K.preventDefault();
|
|
2438
|
-
} else K.key === "ArrowLeft" ? (ze ? x(He, !1) :
|
|
2438
|
+
} else K.key === "ArrowLeft" ? (ze ? x(He, !1) : je ? Ve(-10) : ne({ x: Ne ? -10 : -1 }), K.preventDefault()) : K.key === "ArrowRight" ? (ze ? x(He, !0) : je ? Ve(10) : ne({ x: Ne ? 10 : 1 }), K.preventDefault()) : K.key === "ArrowUp" ? (ze ? x(He, !0) : ne({ y: Ne ? -10 : -1 }), K.preventDefault()) : K.key === "ArrowDown" && (ze ? x(He, !1) : ne({ y: Ne ? 10 : 1 }), K.preventDefault());
|
|
2439
2439
|
}, children: [ke, Qe] }) }) });
|
|
2440
2440
|
})), fn = (e) => {
|
|
2441
2441
|
let t = Number.MAX_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER, r = 0, l = 0;
|
|
@@ -2498,10 +2498,10 @@ function sa(e) {
|
|
|
2498
2498
|
r && (M = r.beginCommit(L));
|
|
2499
2499
|
const D = n.getMovableSelection();
|
|
2500
2500
|
if (D.length === 0) return;
|
|
2501
|
-
const
|
|
2501
|
+
const _ = q?.(D);
|
|
2502
2502
|
for (let $ = 0; $ < D.length; $++) {
|
|
2503
2503
|
const V = D[$];
|
|
2504
|
-
N(V,
|
|
2504
|
+
N(V, _);
|
|
2505
2505
|
}
|
|
2506
2506
|
M?.commit();
|
|
2507
2507
|
});
|
|
@@ -2592,8 +2592,8 @@ function sa(e) {
|
|
|
2592
2592
|
const N = t.getCount(), q = n.getMovableSelection(), v = E || N <= 1 || q.length === 0;
|
|
2593
2593
|
let S = { disabled: v }, L = S;
|
|
2594
2594
|
if (!v && q.length === 1) {
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2595
|
+
const _ = q[0];
|
|
2596
|
+
_.getZIndex() === 0 && (S = { disabled: !0 }), _.getZIndex() === N - 1 && (L = { disabled: !0 });
|
|
2597
2597
|
}
|
|
2598
2598
|
P.getCommand("moveToFront").update(L), P.getCommand("moveForward").update(L), P.getCommand("moveToBack").update(S), P.getCommand("moveBackward").update(S);
|
|
2599
2599
|
const M = { disabled: E || q.length <= 1 };
|
|
@@ -2606,7 +2606,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2606
2606
|
const { children: n, disabled: r, description: l, view: o, isDragging: i, onHide: c, onShow: u, ...s } = e;
|
|
2607
2607
|
be(() => {
|
|
2608
2608
|
}, [l]);
|
|
2609
|
-
const C =
|
|
2609
|
+
const C = jt(t, () => ({ isEmptyFrame: () => !0 }), []), [d, { height: g, width: R }] = an();
|
|
2610
2610
|
return p("div", { ...s, ref: Cn([C, d]), children: p("div", { className: "chart-editor", style: { width: "100%", height: "100%", border: "var(--sxl-app-color-grey, grey) solid 1px", backgroundColor: "var(--sxl-app-color-background, white)", backgroundImage: "var(--sxl-app-image-background)", alignItems: "center", justifyContent: "center", zoom: o.getZoom(), display: "flex", position: "relative", filter: r ? "blur(1px)" : void 0, boxShadow: i ? "1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))" : void 0 }, children: p("div", { style: { textAlign: "center" }, children: l }) }) });
|
|
2611
2611
|
})), da = pt(vt((e, t) => {
|
|
2612
2612
|
const { view: n, sheet: r, movableProps: l, renderMovable: o, commands: i, target: c, notifier: u, onRepeatCommandChange: s } = e, C = sa({ movables: r.getMovables(), movablesView: r?.getView(), transactional: r, onRepeatCommandChange: s, commands: i, target: c, notifier: u });
|
|
@@ -2649,10 +2649,10 @@ const Js = pt(vt((e, t) => {
|
|
|
2649
2649
|
if (!r) return null;
|
|
2650
2650
|
const { ref: te, ...Se } = y;
|
|
2651
2651
|
return p(Si, { ref: te, ...Se, sheet: r, bodyStyle: l?.body, activeCoords: B, commands: u, onChangeEdit: (oe) => {
|
|
2652
|
-
const
|
|
2653
|
-
C.setMode((ae) => ({ ...ae, description:
|
|
2652
|
+
const G = { sheet: r, coords: B, editState: oe };
|
|
2653
|
+
C.setMode((ae) => ({ ...ae, description: G.editState.editMode ? "Edit" : "Enter", args: { ...ae?.args, stateAndCoords: G } }));
|
|
2654
2654
|
}, editState: R.editState });
|
|
2655
|
-
}, [r, U, o, R, E]), { overlay: M, startEdit: D, submitEdit:
|
|
2655
|
+
}, [r, U, o, R, E]), { overlay: M, startEdit: D, submitEdit: _, cancelEdit: $, onKeyboardEventNative: V, onPointerEventNative: O } = bi({ view: n, activeCoords: d, getCellEditor: L, canEdit: () => {
|
|
2656
2656
|
const y = !r.getProtection().isLocked();
|
|
2657
2657
|
return y || i(), y;
|
|
2658
2658
|
}, onBeforeStartEdit: (y) => {
|
|
@@ -2669,7 +2669,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2669
2669
|
g(r.getSelection().getCoords().cell);
|
|
2670
2670
|
} });
|
|
2671
2671
|
const W = ie((y) => {
|
|
2672
|
-
O(y), E &&
|
|
2672
|
+
O(y), E && _();
|
|
2673
2673
|
}, [O, $, E]), ee = Ye((y) => {
|
|
2674
2674
|
O(y);
|
|
2675
2675
|
}, [O]), I = Ye((y) => {
|
|
@@ -2682,7 +2682,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2682
2682
|
};
|
|
2683
2683
|
}, [n?.getStage()]), be(() => {
|
|
2684
2684
|
const y = C.getMode(), B = y?.key;
|
|
2685
|
-
B === "edit" || B === "enter" ? R ? y.args?.cancel ? $() : y.args?.submit ?
|
|
2685
|
+
B === "edit" || B === "enter" ? R ? y.args?.cancel ? $() : y.args?.submit ? _() : b(y.args?.stateAndCoords) : D(y.args?.start) : E && $();
|
|
2686
2686
|
}, [C]), M(n, t);
|
|
2687
2687
|
})), gl = "white", hl = "black", ua = `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${hl}' fill='${gl}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`, ga = `url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${hl}' fill='${gl}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`, ha = pt(vt((e, t) => {
|
|
2688
2688
|
const { view: n, sheet: r } = e, [l, o] = tt.useState(r.getTables().getCount() > 0), [i, c] = tt.useState(null), [u, s] = tt.useState(null), [C, d] = tt.useState(null), [g, R] = tt.useState(null), b = ie(() => {
|
|
@@ -2734,7 +2734,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2734
2734
|
if (i) for (let S = 0; S < i.length; S++) {
|
|
2735
2735
|
const L = i[S], M = L.getRange().getCoords();
|
|
2736
2736
|
let D = n.getRangeCoordsBounds(M);
|
|
2737
|
-
const
|
|
2737
|
+
const _ = n.getRelativePointFromClient(q.clientX, q.clientY), $ = _.x, V = _.y;
|
|
2738
2738
|
if ($ >= D.x && $ <= D.x + D.width && V >= D.y && V <= D.y + D.height) {
|
|
2739
2739
|
const O = n.getViewportSize();
|
|
2740
2740
|
$ <= 0 || V <= 0 || $ >= O.width || V >= O.height || (v = L);
|
|
@@ -2753,16 +2753,16 @@ const Js = pt(vt((e, t) => {
|
|
|
2753
2753
|
const v = i[q];
|
|
2754
2754
|
if (v.isClosed()) continue;
|
|
2755
2755
|
const S = v === g, L = v === C, M = v.getRange().getCoords(), D = n.getRangeCoordsBounds(M);
|
|
2756
|
-
let
|
|
2756
|
+
let _;
|
|
2757
2757
|
if (S || L) {
|
|
2758
2758
|
const $ = v.getStyle().getProperties(), V = $.headerRow?.fill?.background ?? $.wholeTable?.border?.top?.color?.toString();
|
|
2759
2759
|
if (V && r) {
|
|
2760
2760
|
const O = r.getStyles().parseColor(V);
|
|
2761
|
-
O && (
|
|
2761
|
+
O && (_ = O.toCSS());
|
|
2762
2762
|
}
|
|
2763
|
-
|
|
2763
|
+
_ || (_ = "var(--sxl-app-color-shadow, rgba(0,0,0,.15))");
|
|
2764
2764
|
}
|
|
2765
|
-
N.push(p("div", { style: { position: "absolute", left: D.x, top: D.y, width: Math.min(16, D.width), height: D.height, pointerEvents: "all", cursor: ua }, onMouseDown: A }, `table-select-row-${v.getName()}`)), N.push(p("div", { style: { position: "absolute", left: D.x, top: D.y, width: Math.min(16, D.width), height: Math.min(16, D.height), pointerEvents: "all", cursor: ga }, onMouseDown: E }, `table-select-${v.getName()}`)), N.push(p(ll, { x: D.x, y: D.y, width: D.width, height: D.height, range: M, strokeWidth: L ? 0.5 : 0, stroke:
|
|
2765
|
+
N.push(p("div", { style: { position: "absolute", left: D.x, top: D.y, width: Math.min(16, D.width), height: D.height, pointerEvents: "all", cursor: ua }, onMouseDown: A }, `table-select-row-${v.getName()}`)), N.push(p("div", { style: { position: "absolute", left: D.x, top: D.y, width: Math.min(16, D.width), height: Math.min(16, D.height), pointerEvents: "all", cursor: ga }, onMouseDown: E }, `table-select-${v.getName()}`)), N.push(p(ll, { x: D.x, y: D.y, width: D.width, height: D.height, range: M, strokeWidth: L ? 0.5 : 0, stroke: _ ?? "var(--sxl-app-color-grey, grey)", style: { willChange: "box-shadow", transition: "box-shadow 80ms ease-in-out", boxShadow: S ? `${_} 0px 0px 1px 1px` : void 0 } }, `table-outline-${v.getName()}`));
|
|
2766
2766
|
}
|
|
2767
2767
|
return N;
|
|
2768
2768
|
})), ma = pt(vt((e, t) => {
|
|
@@ -2792,25 +2792,25 @@ const Js = pt(vt((e, t) => {
|
|
|
2792
2792
|
const n = { ...e }, r = t?.getNormal().getFont(), l = r?.toCSS(), o = { text: { fontFamily: l?.fontFamily, fontSize: r?.getSize() } }, i = n.body = ot.mergeContentful(e.body, o);
|
|
2793
2793
|
return n.body = ot.mergeContentful({ fill: "#fff", strokeFill: "#dad8d6", strokeWidth: 0.5, text: { fontWeight: "400", fontStyle: "normal", fill: "#040404" } }, i), n.buttonSurface = ot.mergeContentful({ fill: "#fff", text: { fill: "black" }, edgeStrokeFill: "black" }, n.buttonSurface), n.selection = { fill: "rgba(16, 124, 65, 0.1)", strokeFill: "#217346", strokeWidth: 2, ...e.selection }, n.selectionInactive = { ...n.selection, fill: "rgba(16, 124, 65, 0.1)", strokeFill: "#dad8d6", ...e.selectionInactive }, n.selectionRemove = { ...n.selection, fill: "rgba(200, 0, 0, 0.1)", strokeFill: "rgba(200, 0, 0, 1)", ...e.selectionRemove }, n.headerSelection = { ...n.selection, ...e.headerSelection }, n.headerSelectionInactive = { ...n.selectionInactive, ...e.headerSelectionInactive }, n.header = ot.mergeContentful(n.body, { edgeStrokeFill: "rgb(171, 171, 171)", fill: "#f0f0f0", strokeShadow: void 0, edgeStrokeWidth: 1 }, e.header), n.header = ot.mergeContentful(n.header, o), n.headerSelect = ot.mergeContentful(n.header, { fill: "rgba(16, 124, 65, 0.1)", text: { fill: n.headerSelection.strokeFill, fontWeight: "700" } }, e.headerSelect), n.headerSelect = ot.mergeContentful(n.headerSelect, o), n.headerSelectAll = ot.mergeContentful(n.headerSelect, {}, e.headerSelectAll), n.headerSelectAll = ot.mergeContentful(n.headerSelectAll, o), n;
|
|
2794
2794
|
}, fa = { fireOnModelChange: !1 }, Mr = {}, va = pt(vt((e, t) => {
|
|
2795
|
-
const { sheet: n, gridStyle: r = Mr, headersStyle: l = Mr, onSheetContextMenu: o, showColumnHeaders: i, columnHeaderProps: c, showRowHeaders: u, rowHeaderProps: s, showScrollbars: C = !0, scrollPaneProps: d, onViewportChange: g, commands: R, onRepeatCommandChange: b, onMoveCell: E, overlays: A, renderMovable: U, viewportComponent: P, onElementLoad: w, getCellEditor: N, onFocus: q, onBlur: v, style: S = it.EmptyCssProperties, notifier: L, onShowTooltip: M, onShowColumnTooltip: D, onShowRowTooltip:
|
|
2795
|
+
const { sheet: n, gridStyle: r = Mr, headersStyle: l = Mr, onSheetContextMenu: o, showColumnHeaders: i, columnHeaderProps: c, showRowHeaders: u, rowHeaderProps: s, showScrollbars: C = !0, scrollPaneProps: d, onViewportChange: g, commands: R, onRepeatCommandChange: b, onMoveCell: E, overlays: A, renderMovable: U, viewportComponent: P, onElementLoad: w, getCellEditor: N, onFocus: q, onBlur: v, style: S = it.EmptyCssProperties, notifier: L, onShowTooltip: M, onShowColumnTooltip: D, onShowRowTooltip: _, onCloseTooltip: $, gridProps: V, cellRenderProps: O, ...W } = e;
|
|
2796
2796
|
if (tt.useEffect(() => {
|
|
2797
2797
|
Yr._validate(!0);
|
|
2798
2798
|
}, []), !n) throw new Error("ISheet must be provided.");
|
|
2799
|
-
const [ee, I] = tt.useReducer((Y) => Y + 1, 0), [y, { width: B, height: te }] = an(), Se = ie(M, [M]), oe = ie(D, [D]),
|
|
2799
|
+
const [ee, I] = tt.useReducer((Y) => Y + 1, 0), [y, { width: B, height: te }] = an(), Se = ie(M, [M]), oe = ie(D, [D]), G = ie(_, [_]), ae = ie($, [$]), Ae = Te(!1);
|
|
2800
2800
|
Ot(() => {
|
|
2801
|
-
|
|
2801
|
+
Ae.current = !0;
|
|
2802
2802
|
}, [n]);
|
|
2803
|
-
const Fe = n?.getStyles(), fe = ye(() => Tr(r, Fe), [r, Fe]),
|
|
2803
|
+
const Fe = n?.getStyles(), fe = ye(() => Tr(r, Fe), [r, Fe]), _e = ye(() => Tr(l, Fe), [l, Fe]), { body: ve = {}, buttonSurface: Ge = {} } = fe, { header: De = {}, headerSelect: ge = {}, headerSelectAll: ce = {} } = _e, ke = Te(null), [de, xe] = ue(() => n?.getView()), Oe = (de?.getZoomScale() ?? 100) / 100, qe = ye(() => ({ vertical: de.isShowColumnGridlines() && Oe >= 0.4, horizontal: de.isShowRowGridlines() && Oe >= 0.4 }), [de?.isShowColumnGridlines(), de?.isShowRowGridlines(), Oe]), Le = ye(() => {
|
|
2804
2804
|
if (de?.getGridLineColor()) return { strokeDasharray: "1,1" };
|
|
2805
|
-
}, [de?.getGridLineColor(), fe]), We = i ?? de?.isShowColumnHeaders(),
|
|
2805
|
+
}, [de?.getGridLineColor(), fe]), We = i ?? de?.isShowColumnHeaders(), Ze = u ?? de?.isShowRowHeaders(), [m, Ke] = ue({ width: 0, height: 0 }), ct = ye(() => {
|
|
2806
2806
|
let Y = 40, Me = 20;
|
|
2807
|
-
const
|
|
2807
|
+
const Ie = n?.getStyles().getNormal().getFont();
|
|
2808
2808
|
if (m.width > 0 && m.height > 0) {
|
|
2809
|
-
const Xe =
|
|
2809
|
+
const Xe = Ie?.toCSS()?.fontFamily ?? fe.header.text.fontFamily, lt = Ie?.getSize() ?? fe.header.text.fontSize, ut = st.getSharedMeasurer()("" + m.height, Math.ceil(lt * st.getDeviceScale()), Xe);
|
|
2810
2810
|
Y = ut.width, Me = ut.lineHeight;
|
|
2811
2811
|
}
|
|
2812
2812
|
return { width: Math.round(Y + 5), height: Math.round(Me + 3) };
|
|
2813
|
-
}, [m, fe?.header.text, n]), Qe =
|
|
2813
|
+
}, [m, fe?.header.text, n]), Qe = Ze ? Oe * ct.width : De.edgeStrokeWidth, K = We ? Oe * ct.height : De.edgeStrokeWidth, Ne = Math.max(B, (n?.getColumnHeaders().getDefaultSize() ?? ct.width) + Qe + 1), je = Math.max(te, (n?.getRowHeaders().getDefaultSize() ?? ct.height) + K + 1), ze = Te(/* @__PURE__ */ new Map()), He = Te(null), Ve = () => ({ getColOffset: (Y) => n.getColumnHeaders().findOffset(Y), getColIndex: (Y) => n.getColumnHeaders().findIndex(Y), getRowOffset: (Y) => n.getRowHeaders().findOffset(Y), getRowIndex: (Y) => n.getRowHeaders().findIndex(Y) }), [x, ne] = ue(() => Ve()), [F, Z] = ue(!1), [a, k] = ue(null), T = !0, f = fe.selection?.strokeFill, z = Ye(() => _t.current, []), [h, H] = ue(), j = ie((Y) => {
|
|
2814
2814
|
H(Y), n && n.getView() && n.getView().setTopLeft(Y ? { left: Y.left, top: Y.top } : null), g?.(Y);
|
|
2815
2815
|
}, [n, g]), J = Te(null);
|
|
2816
2816
|
be(() => {
|
|
@@ -2824,8 +2824,8 @@ const Js = pt(vt((e, t) => {
|
|
|
2824
2824
|
const [re, le] = ue(() => n?.getView().getTopLeft()), se = ie((Y) => {
|
|
2825
2825
|
const Me = bt.cellToRange(Y);
|
|
2826
2826
|
if (n.isClosed()) return Me;
|
|
2827
|
-
const
|
|
2828
|
-
return
|
|
2827
|
+
const Ie = n.getRange(Me, { excludeHidden: !0 }).getMerges();
|
|
2828
|
+
return Ie.length === 0 ? Me : Ie[0];
|
|
2829
2829
|
}, [n]), Ce = (Y) => {
|
|
2830
2830
|
if (!Y || Y.coords.colIndex === 0 && Y.coords.rowIndex === 0) return null;
|
|
2831
2831
|
const Me = {};
|
|
@@ -2841,7 +2841,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2841
2841
|
}, [L, nt]), Bt = ye(() => {
|
|
2842
2842
|
const Y = Re.getMode();
|
|
2843
2843
|
return Y?.cursor ? Y.cursor : null;
|
|
2844
|
-
}, [Ht, Re]), [Lt, Mt] = ue(null), yt = Te(!1), [Yt, cn] = ue([]), kn = Te(null), [tn, Rn] = ue(Wn.EmptyTopLeft), [
|
|
2844
|
+
}, [Ht, Re]), [Lt, Mt] = ue(null), yt = Te(!1), [Yt, cn] = ue([]), kn = Te(null), [tn, Rn] = ue(Wn.EmptyTopLeft), [Gt, Xn] = ue(Wn.EmptyTopLeft);
|
|
2845
2845
|
be(() => {
|
|
2846
2846
|
Rn({ left: re?.left, top: 0 });
|
|
2847
2847
|
}, [re?.left]), be(() => {
|
|
@@ -2866,14 +2866,14 @@ const Js = pt(vt((e, t) => {
|
|
|
2866
2866
|
nn();
|
|
2867
2867
|
} }), gt(n, { onRequestScrollIntoView: async (Y, Me) => {
|
|
2868
2868
|
if (!Me) return;
|
|
2869
|
-
const
|
|
2870
|
-
return await ke.current?.scrollCellCoordsIntoView(
|
|
2871
|
-
}, onRequestFocus: () => ot.whenFocus(
|
|
2869
|
+
const Ie = { colIndex: Me?.coords.colStart, rowIndex: Me?.coords.rowStart };
|
|
2870
|
+
return await ke.current?.scrollCellCoordsIntoView(Ie, Me?.scroll), !0;
|
|
2871
|
+
}, onRequestFocus: () => ot.whenFocus(_t.current) }, fa);
|
|
2872
2872
|
const Yn = ye(() => {
|
|
2873
|
-
const Y = (
|
|
2873
|
+
const Y = (Ie, Xe) => {
|
|
2874
2874
|
yt.current = !0, Mt([(lt) => {
|
|
2875
|
-
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: 0, rowEnd: m.height, colStart:
|
|
2876
|
-
const ut = lt.getLayout(), mt = Math.max(0, ut.getColOffset(
|
|
2875
|
+
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: 0, rowEnd: m.height, colStart: Ie, colEnd: Ie }))) return;
|
|
2876
|
+
const ut = lt.getLayout(), mt = Math.max(0, ut.getColOffset(Ie)), dt = lt.getBounds(), St = Math.min(dt.x + dt.width, ut.getColOffset(Ie + 1)), Et = lt.getAnchor();
|
|
2877
2877
|
if (Xe !== null && (Et === wt.Left || Et === wt.Center || Et === wt.Right)) {
|
|
2878
2878
|
const zo = ot.roundAccurately(Xe * ot.getDPI(), 0), no = ot.roundAccurately(n?.getColumnWidthAsFontUnit(Xe / Oe), 2).toFixed(2), Fo = "Width: " + (Xe ? no + " (" + zo + " pixels)" : "Hidden"), In = mn.current.getGridElement().getRelativePointFromClient(0, 0), pn = 0 - In.y, oo = 0 - In.y + K, No = { x: mt - (In.x - dt.x), y: pn, width: St - mt, height: oo - pn };
|
|
2879
2879
|
requestAnimationFrame(() => {
|
|
@@ -2885,26 +2885,26 @@ const Js = pt(vt((e, t) => {
|
|
|
2885
2885
|
}]);
|
|
2886
2886
|
};
|
|
2887
2887
|
let Me = null;
|
|
2888
|
-
return { onResizeHeadersStart: (
|
|
2889
|
-
Me = n.beginCommit(lt), Y(
|
|
2890
|
-
}, onResizeHeaders: (
|
|
2891
|
-
Y(
|
|
2892
|
-
}, onResizeHeadersDown: (
|
|
2893
|
-
Y(
|
|
2894
|
-
}, onResizeHeadersEnd: (
|
|
2888
|
+
return { onResizeHeadersStart: (Ie, Xe, lt) => {
|
|
2889
|
+
Me = n.beginCommit(lt), Y(Ie, Xe);
|
|
2890
|
+
}, onResizeHeaders: (Ie, Xe, lt) => {
|
|
2891
|
+
Y(Ie, Xe);
|
|
2892
|
+
}, onResizeHeadersDown: (Ie, Xe) => {
|
|
2893
|
+
Y(Ie, Xe);
|
|
2894
|
+
}, onResizeHeadersEnd: (Ie, Xe, lt) => {
|
|
2895
2895
|
Me?.commit({ description: lt }), Me = null, requestAnimationFrame(() => ae?.()), yt.current = !1, Mt(null);
|
|
2896
|
-
}, onResizeHeadersUp: (
|
|
2896
|
+
}, onResizeHeadersUp: (Ie) => {
|
|
2897
2897
|
requestAnimationFrame(() => ae?.()), yt.current = !1, Mt(null);
|
|
2898
2898
|
}, ...c };
|
|
2899
2899
|
}, [n, c, K, Lt]), un = ye(() => {
|
|
2900
|
-
const Y = (
|
|
2900
|
+
const Y = (Ie, Xe) => {
|
|
2901
2901
|
yt.current = !0, Mt([(lt) => {
|
|
2902
|
-
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart:
|
|
2903
|
-
const ut = lt.getLayout(), mt = Math.max(0, ut.getRowOffset(
|
|
2902
|
+
if (!lt.toClipBounds(lt.getRangeCoordsBounds({ rowStart: Ie, rowEnd: Ie, colStart: 0, colEnd: m.width }))) return;
|
|
2903
|
+
const ut = lt.getLayout(), mt = Math.max(0, ut.getRowOffset(Ie)), dt = lt.getBounds(), St = Math.min(dt.y + dt.height, ut.getRowOffset(Ie + 1)), Et = lt.getAnchor();
|
|
2904
2904
|
if (Xe !== null && (Et === wt.Top || Et === wt.Center || Et === wt.Bottom)) {
|
|
2905
2905
|
const zo = Math.floor(10 * ot.getDPI()) / 10, no = ot.roundAccurately(Xe * zo, 0), Fo = ot.roundAccurately(no / Oe / (n?.getRowHeaders().getScaleFactor() * ot.getDPI()), 2).toFixed(2), In = "Height: " + (Xe ? Fo + " (" + no + " pixels)" : "Hidden"), pn = En.current.getGridElement().getRelativePointFromClient(0, 0), oo = 0 - pn.x, No = 0 - pn.x + Qe, Kl = { x: oo, y: mt - (pn.y - dt.y), width: No - oo, height: St - mt };
|
|
2906
2906
|
requestAnimationFrame(() => {
|
|
2907
|
-
yt.current &&
|
|
2907
|
+
yt.current && G?.({ anchor: Kl, display: In });
|
|
2908
2908
|
});
|
|
2909
2909
|
}
|
|
2910
2910
|
const Jt = [0, 0, dt.width, 0], An = { style: { boxShadow: `0px 0.5px 0px 0px ${r?.body?.fill}` }, pathProps: { stroke: f } }, Eo = { x: 0, y: mt - 1, width: dt.width, height: 1 }, Ao = { style: { boxShadow: `0px -0.5px 0px 0px ${r?.body?.fill}` }, pathProps: { stroke: f } }, Io = { x: 0, y: St - 1, width: dt.width, height: 1 };
|
|
@@ -2912,47 +2912,47 @@ const Js = pt(vt((e, t) => {
|
|
|
2912
2912
|
}]);
|
|
2913
2913
|
};
|
|
2914
2914
|
let Me = null;
|
|
2915
|
-
return { onResizeHeadersStart: (
|
|
2916
|
-
Me = n.beginCommit(lt), Y(
|
|
2917
|
-
}, onResizeHeaders: (
|
|
2918
|
-
Y(
|
|
2919
|
-
}, onResizeHeadersDown: (
|
|
2920
|
-
Y(
|
|
2921
|
-
}, onResizeHeadersEnd: (
|
|
2915
|
+
return { onResizeHeadersStart: (Ie, Xe, lt) => {
|
|
2916
|
+
Me = n.beginCommit(lt), Y(Ie, Xe);
|
|
2917
|
+
}, onResizeHeaders: (Ie, Xe, lt) => {
|
|
2918
|
+
Y(Ie, Xe);
|
|
2919
|
+
}, onResizeHeadersDown: (Ie, Xe) => {
|
|
2920
|
+
Y(Ie, Xe);
|
|
2921
|
+
}, onResizeHeadersEnd: (Ie, Xe, lt) => {
|
|
2922
2922
|
Me?.commit({ description: lt }), Me = null, requestAnimationFrame(() => ae?.()), yt.current = !1, Mt(null);
|
|
2923
|
-
}, onResizeHeadersUp: (
|
|
2923
|
+
}, onResizeHeadersUp: (Ie) => {
|
|
2924
2924
|
requestAnimationFrame(() => ae?.()), yt.current = !1, Mt(null);
|
|
2925
2925
|
}, ...s };
|
|
2926
|
-
}, [n, s, Qe]),
|
|
2927
|
-
const Y = (
|
|
2928
|
-
n?.getView() && n.getView().selectMovables([]), He.current = null, ke?.current?.focus(
|
|
2929
|
-
}, Me = async (
|
|
2930
|
-
if (
|
|
2931
|
-
const Xe =
|
|
2926
|
+
}, [n, s, Qe]), _t = jt(t, () => {
|
|
2927
|
+
const Y = (Ie) => {
|
|
2928
|
+
n?.getView() && n.getView().selectMovables([]), He.current = null, ke?.current?.focus(Ie);
|
|
2929
|
+
}, Me = async (Ie = null) => {
|
|
2930
|
+
if (Ie || (Ie = n?.getView().getMovableSelection()[0]), !Ie) return !1;
|
|
2931
|
+
const Xe = Ie.getAnchorCoords();
|
|
2932
2932
|
if (!Xe) return !1;
|
|
2933
2933
|
const lt = ke.current?.getViewFromCellCoords({ colIndex: Xe.colStart, rowIndex: Xe.rowStart });
|
|
2934
2934
|
if (!lt) return !1;
|
|
2935
2935
|
const ut = lt.getAnchor();
|
|
2936
|
-
n?.getView().getMovableSelection().indexOf(
|
|
2936
|
+
n?.getView().getMovableSelection().indexOf(Ie) === -1 && n?.getView().selectMovables([Ie]);
|
|
2937
2937
|
let mt = ze.current?.get(ut);
|
|
2938
|
-
return mt?.current ? (await mt.current.focusMovable(
|
|
2938
|
+
return mt?.current ? (await mt.current.focusMovable(Ie), !0) : (He.current = { movable: Ie, anchor: ut }, !0);
|
|
2939
2939
|
};
|
|
2940
2940
|
return { getGridElement: () => ke.current, getRowHeaderElement: () => En.current, getColumnHeaderElement: () => mn.current, rowHeaderHeight: () => K, colHeaderWidth: () => Qe, startEdit: Be, submitEdit: () => {
|
|
2941
|
-
Re.setMode((
|
|
2941
|
+
Re.setMode((Ie) => Ie?.key !== "edit" ? Ie : { key: "edit", args: { stateAndCoords: null, submit: !0 } });
|
|
2942
2942
|
}, cancelEdit: () => {
|
|
2943
|
-
Re.setMode((
|
|
2944
|
-
}, isEditing: a !== null, focus: (
|
|
2945
|
-
n?.getView().getMovableSelection().length > 0 && Me() || Y(
|
|
2946
|
-
}, focusSheet: Y, focusMovable: Me, contains: (
|
|
2943
|
+
Re.setMode((Ie) => Ie?.key !== "edit" ? Ie : { key: "edit", args: { stateAndCoords: null, cancel: !0 } });
|
|
2944
|
+
}, isEditing: a !== null, focus: (Ie) => {
|
|
2945
|
+
n?.getView().getMovableSelection().length > 0 && Me() || Y(Ie);
|
|
2946
|
+
}, focusSheet: Y, focusMovable: Me, contains: (Ie) => ke?.current?.contains?.(Ie), invalidate: nn, isSheetElement: () => !0, getSheet: () => n };
|
|
2947
2947
|
}, [n]), nn = Ye((Y) => {
|
|
2948
|
-
|
|
2948
|
+
Ae.current || (ke?.current?.invalidate(Y), I?.());
|
|
2949
2949
|
}, []);
|
|
2950
2950
|
be(() => {
|
|
2951
2951
|
nn();
|
|
2952
2952
|
}, [fe]);
|
|
2953
2953
|
const Tn = Ee ? ce.edgeStrokeFill : De.fill, ko = Ee ? ge.fill : typeof fe.headerHover == "function" ? fe.headerHover(De)?.fill : De.fill, ht = ye(() => P ? p("div", { className: Vt("sheetxl-viewport-overlay", Li), style: { width: "100%", height: "100%", boxSizing: "border-box", position: "absolute" }, children: P }) : p(bn, {}), [P]);
|
|
2954
2954
|
let Mn = null;
|
|
2955
|
-
We &&
|
|
2955
|
+
We && Ze && (Mn = Je("div", { tabIndex: -1, className: "top-left-corner", style: { padding: "2 2", position: "absolute", height: `${K}px`, width: `${Qe}px`, zIndex: 1, boxSizing: "border-box", cursor: "cell" }, onMouseDown: (Y) => {
|
|
2956
2956
|
let Me = !Y.ctrlKey;
|
|
2957
2957
|
$e?.getCommand("selectAll")?.execute(!Me || Y.button !== 0), Y.nativeEvent.which === tl.Right ? o?.({ originalEvent: Y, clientX: Y.clientX, clientY: Y.clientY, rowIndex: -1, colIndex: -1 }) : ke.current?.focus();
|
|
2958
2958
|
}, children: [p("div", { style: { height: K - 5 + "px", width: K - 5 + "px", clipPath: `path('M${K - 5} 0 L0 ${K - 5} L${K - 5} ${K - 5} L${K - 5} 0 Z')`, borderRight: `2px solid ${Tn}`, borderBottom: `2px solid ${Tn}`, background: `${ko}`, boxSizing: "border-box", position: "absolute", right: "2px", bottom: "2px" } }), p("div", { style: { position: "absolute", height: `${K}px`, width: `${Qe}px`, boxSizing: "border-box", borderRight: `solid 1px ${De.strokeFill}`, borderBottom: `solid 1px ${De.strokeFill}`, right: "-1px", bottom: "-1px" } })] }));
|
|
@@ -2974,7 +2974,7 @@ const Js = pt(vt((e, t) => {
|
|
|
2974
2974
|
const Dt = ie((Y) => {
|
|
2975
2975
|
const Me = Y.getVisibleRangeCoords();
|
|
2976
2976
|
if (!Me) return null;
|
|
2977
|
-
const
|
|
2977
|
+
const Ie = [];
|
|
2978
2978
|
return n.getRange(Me).forEach((Xe, lt) => {
|
|
2979
2979
|
const ut = lt.getCoords(), mt = lt.getCell();
|
|
2980
2980
|
((dt) => {
|
|
@@ -2983,8 +2983,8 @@ const Js = pt(vt((e, t) => {
|
|
|
2983
2983
|
if (St.width > 1 || St.height > 1 || dt.getStyle().hasVisibleStyling() || de.isShowFormulas() && dt.getFormula() !== null) return !0;
|
|
2984
2984
|
const Et = dt.getValue();
|
|
2985
2985
|
return Et !== null && !(!de.isShowZeros() && Et === 0 && dt.getType() === Pn.Number);
|
|
2986
|
-
})(mt) &&
|
|
2987
|
-
}, { excludeHidden: !0, includeMergeOverflow: !0 }),
|
|
2986
|
+
})(mt) && Ie.push({ coords: ut, value: mt, range: de.isShowFormulas() ? null : mt.getExtrusions() });
|
|
2987
|
+
}, { excludeHidden: !0, includeMergeOverflow: !0 }), Ie;
|
|
2988
2988
|
}, [n, de.isShowZeros(), de.isShowFormulas(), a]);
|
|
2989
2989
|
be(() => {
|
|
2990
2990
|
const Y = [];
|
|
@@ -2998,8 +2998,8 @@ const Js = pt(vt((e, t) => {
|
|
|
2998
2998
|
}, [Re]), Ro = ie(async (Y) => {
|
|
2999
2999
|
const Me = Re.getMode();
|
|
3000
3000
|
return Y.keyCode === It.Escape && Me ? (Y.preventDefault(), void Re.setMode(null)) : Y.keyCode === It.Enter && hn ? (Y.preventDefault(), await $e?.getCommand("paste")?.execute(), void Re.setMode(null)) : void $e?.dispatchToFocusedCommand(Y);
|
|
3001
|
-
}, [$e, Re]), En = Te(null), eo = ye(() => p("div", { tabIndex: -1, style: { position: "relative", flex: "0", top: `${K + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${K}px)`, boxSizing: "border-box", zIndex: "2" }, children: p(Sr, { ref: En, sheetElement:
|
|
3002
|
-
const { value: Me, key:
|
|
3001
|
+
}, [$e, Re]), En = Te(null), eo = ye(() => p("div", { tabIndex: -1, style: { position: "relative", flex: "0", top: `${K + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${K}px)`, boxSizing: "border-box", zIndex: "2" }, children: p(Sr, { ref: En, sheetElement: _t.current, gridRef: ke, freezeStart: he?.[wt.Top], oppositeSize: Qe, containerWidth: Qe, containerHeight: je, sheetHeader: n.getRowHeaders(), gridStyle: _e, verticalPadding: Math.max(0, Math.floor(n.getStyles().getNormal().getFont().getSize() / 10)), scrollPoint: Gt, onSheetContextMenu: o, tabIndex: -1, style: { position: "relative", flex: "0", top: `${K + 1}px`, width: `${Qe + De.edgeStrokeWidth}px`, minWidth: `${Qe + De.edgeStrokeWidth}px`, borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, height: `calc(100% - ${K}px)`, boxSizing: "border-box", zIndex: "2", ...un?.style }, ...un }) }), [Qe, K, je, n, Gt, he?.[wt.Top], fe, T, o, De.fill, s]), mn = Te(null), to = ye(() => p("div", { tabIndex: -1, style: { position: "relative", left: "0px", width: "100%", height: `${K + De.edgeStrokeWidth}px`, minHeight: `${K + De.edgeStrokeWidth}px`, borderBottom: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" }, children: p(Sr, { ref: mn, sheetElement: _t.current, gridRef: ke, freezeStart: he?.[wt.Left], oppositeSize: K, containerWidth: Ne, containerHeight: K, sheetHeader: n.getColumnHeaders(), gridStyle: _e, scrollPoint: tn, onSheetContextMenu: o, ...Yn, style: { ...Yn?.style, position: "relative", left: "0px", width: "100%", height: `${K + De.edgeStrokeWidth}px`, minHeight: `${K + De.edgeStrokeWidth}px`, borderBottom: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, boxSizing: "border-box", zIndex: "1" } }) }), [K, Ne, n, tn, he?.[wt.Left], fe, De.fill, T, o, c]), $l = ie((Y) => {
|
|
3002
|
+
const { value: Me, key: Ie, ...Xe } = Y;
|
|
3003
3003
|
let lt = Me, ut = a;
|
|
3004
3004
|
if (!ut || ut.colIndex === Y.coords.colIndex && ut.rowIndex === Y.coords.rowIndex || (ut = null), !lt) {
|
|
3005
3005
|
const St = Y.range;
|
|
@@ -3017,41 +3017,41 @@ const Js = pt(vt((e, t) => {
|
|
|
3017
3017
|
}
|
|
3018
3018
|
}), ut && ut.colIndex === Y.range.colStart && ut.rowIndex === Y.range.rowStart && (lt = lt.createTemporaryCell({ value: null }));
|
|
3019
3019
|
const dt = n.getStyles();
|
|
3020
|
-
return gi(Ci, { ...Xe, key:
|
|
3020
|
+
return gi(Ci, { ...Xe, key: Ie, bodyStyle: ve, docTheme: dt.getTheme(), normalStyle: dt.getNormal(), showFormulas: de.isShowFormulas(), showZeros: de.isShowZeros(), onLinkMouseDown: mt, ...O, value: lt });
|
|
3021
3021
|
}, [n, x, ve, a, de?.isShowFormulas(), de.isShowZeros()]), Ul = Ye((Y, Me) => {
|
|
3022
|
-
const { key:
|
|
3023
|
-
return [p(Pi, { ref: Me, getVisibleCells: Dt, sheet: n, gridStyle: fe, ...Xe }, `border-${
|
|
3024
|
-
|
|
3025
|
-
} }, ...Xe }, `movable-${
|
|
3026
|
-
}, [n, ke.current, fe, N, $e, L]), [ir,
|
|
3027
|
-
if (Ne === 0 ||
|
|
3028
|
-
const Y = n.getStyles().getNormal(), Me = Y.getFont(),
|
|
3022
|
+
const { key: Ie, ...Xe } = Y;
|
|
3023
|
+
return [p(Pi, { ref: Me, getVisibleCells: Dt, sheet: n, gridStyle: fe, ...Xe }, `border-${Ie}`), p(ha, { ref: Me, sheet: n, commands: $e, ...Xe }, `table-${Ie}`), p(ma, { ref: Me, sheet: n, ...Xe }, `spill-${Ie}`), p(oa, { ref: Me, sheet: n, commands: $e, notifier: L, onShowTooltip: Se, onCloseTooltip: ae, gridStyle: fe, gridRef: ke, editingCoords: a, isActive: T, ...Xe }, `selection-${Ie}`), p(Xi, { ref: Me, sheet: n, commands: $e, gridStyle: fe, element: z, notifier: L, ...Xe }, `copy-paste-${Ie}`), p(da, { ref: Me, sheet: n, commands: $e, target: Pe, notifier: L, renderMovable: U, movableProps: { onUnFocus: () => {
|
|
3024
|
+
_t.current.focus();
|
|
3025
|
+
} }, ...Xe }, `movable-${Ie}`), p(ca, { ref: Me, sheet: n, commands: $e, notifier: L, gridStyle: fe, getCellEditor: N, showProtectedError: Nt, setEditingCoords: k, ...Xe }, `editor-${Ie}`)];
|
|
3026
|
+
}, [n, ke.current, fe, N, $e, L]), [ir, _l] = ue(!1), jl = ye(() => {
|
|
3027
|
+
if (Ne === 0 || je === 0) return null;
|
|
3028
|
+
const Y = n.getStyles().getNormal(), Me = Y.getFont(), Ie = Y.getFill(), Xe = Y.getBorder(), lt = Y.getFill().getType() === co.Type.None;
|
|
3029
3029
|
let ut = Le, mt = Le;
|
|
3030
3030
|
const dt = (Et, Jt, An) => An ? { stroke: Xe.getBottom().isNone() ? "none" : Et.getColor().toRGBA(ve.darkMode).toString(), ...Jt } : Jt;
|
|
3031
3031
|
mt = dt(Xe.getBottom(), mt, !Xe.getBottom().isNone()), mt = dt(Xe.getTop(), mt, !Xe.getTop().isNone()), ut = dt(Xe.getRight(), ut, !Xe.getRight().isNone()), ut = dt(Xe.getLeft(), ut, !Xe.getLeft().isNone());
|
|
3032
3032
|
let St = de?.getGridLineColor()?.toRGBA(ve.darkMode).toString() ?? ve.strokeFill;
|
|
3033
|
-
return lt || (mt = dt(Xe.getBottom(), mt, !0), mt = dt(Xe.getTop(), mt, !0), ut = dt(Xe.getRight(), ut, !0), ut = dt(Xe.getLeft(), ut, !0)), p(rl, { className: "sheetxl-sheet-primary", style: { ...pa, ...
|
|
3034
|
-
|
|
3035
|
-
}, showGridLines: qe, gridLineColor: St, gridLineColumnsProps: ut, gridLineRowsProps: mt, freezeLeft: he?.[wt.Left], freezeLeftProps: Dn, freezeTop: he?.[wt.Top], freezeTopProps: Dn, width: Ne, height:
|
|
3033
|
+
return lt || (mt = dt(Xe.getBottom(), mt, !0), mt = dt(Xe.getTop(), mt, !0), ut = dt(Xe.getRight(), ut, !0), ut = dt(Xe.getLeft(), ut, !0)), p(rl, { className: "sheetxl-sheet-primary", style: { ...pa, ...Ie.toCSS(ve.darkMode), ...Me.toCSS(ve.darkMode, Oe), "--sxl-app-color-background": ve.fill, "--sxl-app-color-shadow": fe.colorShadow, "--sxl-app-color-grey": fe.colorGrey, "--sxl-app-color-button-fill": Ge.fill, "--sxl-app-color-button-text": Ge.text?.fill, "--sxl-app-color-button-border": Ge.edgeStrokeFill, "--sxl-app-color-primary-dark": fe.selection.strokeFill }, ref: ke, zoom: Oe, ...V, onFirstRender: (Et) => {
|
|
3034
|
+
_l(!0), V?.onFirstRender?.(Et), $e?.activate();
|
|
3035
|
+
}, showGridLines: qe, gridLineColor: St, gridLineColumnsProps: ut, gridLineRowsProps: mt, freezeLeft: he?.[wt.Left], freezeLeftProps: Dn, freezeTop: he?.[wt.Top], freezeTopProps: Dn, width: Ne, height: je, columnCount: m.width, rowCount: m.height, cursor: Bt ?? Ht ?? "cell", clipCells: !0, layout: x, cellRenderer: $l, overlayRenderer: Ul, getCellCoordsAsRangeCoords: se, getVisibleCells: Dt, onWheelScroll: xt, onPointerDown: Qn, onKeyDown: Ro, onViewportChange: j, onImmediateScroll: gn, scrollPoint: re, stageProps: { onFocus: () => {
|
|
3036
3036
|
$e?.activate();
|
|
3037
3037
|
} }, overlays: Yt });
|
|
3038
3038
|
}, [ee]);
|
|
3039
3039
|
be(() => {
|
|
3040
|
-
|
|
3041
|
-
}, [x, he, Oe, $e, re?.left, re?.top, ve, V, Ne,
|
|
3040
|
+
Ae.current || I();
|
|
3041
|
+
}, [x, he, Oe, $e, re?.left, re?.top, ve, V, Ne, je, Bt, Yt, T, Ht]);
|
|
3042
3042
|
let To = { flex: "1 1 100%", display: "flex", alignContent: "stretch", position: "relative" };
|
|
3043
3043
|
C || (To = { ...To, ...S });
|
|
3044
|
-
const
|
|
3045
|
-
const Y = n.getStyles().getTheme(), Me = Y.getColorScheme(),
|
|
3046
|
-
return { "--sxl-doc-color-dk1": Me.getDk1().toCSS(ve.darkMode), "--sxl-doc-color-dk2": Me.getDk2().toCSS(ve.darkMode), "--sxl-doc-color-lt1": Me.getLt1().toCSS(ve.darkMode), "--sxl-doc-color-lt2": Me.getLt2().toCSS(ve.darkMode), "--sxl-doc-color-accent1": Me.getAccent1().toCSS(ve.darkMode), "--sxl-doc-color-accent2": Me.getAccent2().toCSS(ve.darkMode), "--sxl-doc-color-accent3": Me.getAccent3().toCSS(ve.darkMode), "--sxl-doc-color-accent4": Me.getAccent4().toCSS(ve.darkMode), "--sxl-doc-color-accent5": Me.getAccent5().toCSS(ve.darkMode), "--sxl-doc-color-accent6": Me.getAccent6().toCSS(ve.darkMode), "--sxl-doc-color-hlink": Me.getHlink().toCSS(ve.darkMode), "--sxl-doc-color-fol-hlink": Me.getFolHlink().toCSS(ve.darkMode), "--sxl-doc-font-major":
|
|
3044
|
+
const Gl = ye(() => {
|
|
3045
|
+
const Y = n.getStyles().getTheme(), Me = Y.getColorScheme(), Ie = Y.getFontScheme();
|
|
3046
|
+
return { "--sxl-doc-color-dk1": Me.getDk1().toCSS(ve.darkMode), "--sxl-doc-color-dk2": Me.getDk2().toCSS(ve.darkMode), "--sxl-doc-color-lt1": Me.getLt1().toCSS(ve.darkMode), "--sxl-doc-color-lt2": Me.getLt2().toCSS(ve.darkMode), "--sxl-doc-color-accent1": Me.getAccent1().toCSS(ve.darkMode), "--sxl-doc-color-accent2": Me.getAccent2().toCSS(ve.darkMode), "--sxl-doc-color-accent3": Me.getAccent3().toCSS(ve.darkMode), "--sxl-doc-color-accent4": Me.getAccent4().toCSS(ve.darkMode), "--sxl-doc-color-accent5": Me.getAccent5().toCSS(ve.darkMode), "--sxl-doc-color-accent6": Me.getAccent6().toCSS(ve.darkMode), "--sxl-doc-color-hlink": Me.getHlink().toCSS(ve.darkMode), "--sxl-doc-color-fol-hlink": Me.getFolHlink().toCSS(ve.darkMode), "--sxl-doc-font-major": Ie.getMajorFont(), "--sxl-doc-font-minor": Ie.getMinorFont() };
|
|
3047
3047
|
}, [n.getStyles().getTheme()]);
|
|
3048
3048
|
let Mo = p("div", { style: To, onTouchStart: () => {
|
|
3049
3049
|
ar();
|
|
3050
3050
|
}, onFocus: (Y) => {
|
|
3051
|
-
|
|
3051
|
+
Z(!0), q?.(Y);
|
|
3052
3052
|
}, onBlur: (Y) => {
|
|
3053
|
-
|
|
3054
|
-
}, ref:
|
|
3053
|
+
Z(!1), v?.(Y);
|
|
3054
|
+
}, ref: _t, ...W, children: p("div", { className: Vt("sheetxl-sheet", Ni), style: { position: "absolute", width: "100%", height: "100%", boxSizing: "border-box", display: "flex", flexDirection: "column", flex: "1 1 100%", zIndex: "0", ...Gl }, children: Je("div", { style: { display: "flex", flexDirection: "row", flex: "1 1 100%" }, children: [Mn, eo, Je("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", overflow: "hidden", position: "relative" }, children: [to, Je("div", { style: { display: "flex", flexDirection: "column", flex: "1 1 100%", position: "relative", borderRight: `solid ${De.edgeStrokeWidth}px ${De.edgeStrokeFill}`, backgroundColor: ve.fill }, ref: y, onContextMenu: Jn, children: [jl, ht, p(Vi, { style: { position: "absolute", right: 24, bottom: 4 }, colorLicensee: fe?.selection?.strokeFill, colorCredits: fe?.body?.text?.fill })] })] })] }) }) });
|
|
3055
3055
|
if (C) {
|
|
3056
3056
|
const Y = (Me) => p(ul, { ...Me, sheet: n });
|
|
3057
3057
|
Mo = p(ii, { style: { flex: "1 1 100%", overflow: "hidden", background: `${De.fill}`, minHeight: 2 * ct.height, minWidth: 2 * ct.width, ...S }, viewport: h, touchElement: ke.current?.stage, disableTouch: Ft, onScrollViewport: (Me) => {
|
|
@@ -3059,10 +3059,10 @@ const Js = pt(vt((e, t) => {
|
|
|
3059
3059
|
}, createHorizontalScrollbar: Y, createVerticalScrollbar: Y, ...d, children: Mo });
|
|
3060
3060
|
}
|
|
3061
3061
|
be(() => {
|
|
3062
|
-
|
|
3062
|
+
Ae.current = !1, I?.(), F && _t.current?.focus();
|
|
3063
3063
|
}, [n]);
|
|
3064
|
-
const [Do,
|
|
3065
|
-
Do ||
|
|
3064
|
+
const [Do, Zl] = ue(!1), ar = ie(() => {
|
|
3065
|
+
Do || Zl(!0);
|
|
3066
3066
|
}, [Do]);
|
|
3067
3067
|
return be(() => {
|
|
3068
3068
|
if (ir) return typeof w == "function" && w(), it.detectIt().primaryInput === "touch" && ar(), () => {
|
|
@@ -3079,7 +3079,7 @@ const Qs = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStr
|
|
|
3079
3079
|
console.warn(D), U(!0), q(Dr), S(null);
|
|
3080
3080
|
});
|
|
3081
3081
|
}, [o]);
|
|
3082
|
-
const L =
|
|
3082
|
+
const L = jt(t, () => ({ isPictureEditor: () => !0 }), []), M = ye(() => {
|
|
3083
3083
|
if (N || v) return p("img", { style: { flex: "1", width: "100%", height: "100%", border: A ? "var(--sxl-app-color-grey, grey) solid 1px" : void 0, backgroundColor: A ? "var(--sxl-app-color-background, white)" : void 0, boxShadow: A ? "0px 0px 3px var(--sxl-app-color-error, red)" : void 0, objectFit: A ? "contain" : void 0, opacity: P ? 1 : 0, filter: "var(--sxl-app-filter-dark-invert)" }, draggable: !1, src: N, onLoad: () => {
|
|
3084
3084
|
w(!0);
|
|
3085
3085
|
}, onError: ({ currentTarget: D }) => {
|
|
@@ -3095,9 +3095,9 @@ const ed = pt(vt((e, t) => {
|
|
|
3095
3095
|
const { children: n, disabled: r, chart: l, view: o, isDragging: i, onHide: c, onShow: u, ...s } = e;
|
|
3096
3096
|
be(() => {
|
|
3097
3097
|
}, [l]);
|
|
3098
|
-
const C =
|
|
3098
|
+
const C = jt(t, () => ({ isChartEditor: () => !0 }), []), [d, { height: g, width: R }] = an();
|
|
3099
3099
|
if (!l.isClosed()) return p("div", { ...s, ref: Cn([C, d]), children: p("div", { className: "chart-editor", style: { width: "100%", height: "100%", backgroundColor: "var(--sxl-app-color-background, white)", backgroundImage: "var(--sxl-app-image-background)", alignItems: "center", justifyContent: "center", zoom: o.getZoom(), display: "flex", position: "relative", border: "var(--sxl-app-color-grey, grey) solid 1px", filter: r ? "blur(1px)" : void 0, boxShadow: i ? "1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))" : void 0 }, children: p("div", { style: { textAlign: "center" }, children: l.getDescription() }) }) });
|
|
3100
|
-
})), ya = "_editable-
|
|
3100
|
+
})), ya = "_editable-input_w34rk_11", ba = (e) => p("input", { ...e }), qa = pt(vt((e, t) => {
|
|
3101
3101
|
const { style: n = {}, className: r, value: l = "", onSubmit: o, onChange: i, onCancel: c, createInput: u = ba, notifier: s, styleHover: C = {}, dragging: d, maxLength: g, disabled: R = !1, readOnly: b = !1, ...E } = e, [A, U] = ue(!1), [P, w] = ue(!1), [N, q] = ue(l);
|
|
3102
3102
|
be(() => {
|
|
3103
3103
|
q(l);
|
|
@@ -3115,7 +3115,7 @@ const ed = pt(vt((e, t) => {
|
|
|
3115
3115
|
return I ? (v.current = null, w(!1), q(ee), I) : (setTimeout(() => {
|
|
3116
3116
|
v.current?.focus();
|
|
3117
3117
|
}, 0), I);
|
|
3118
|
-
}, [o]),
|
|
3118
|
+
}, [o]), _ = ie(() => {
|
|
3119
3119
|
q(l), v.current = null, w(!1), c?.();
|
|
3120
3120
|
}, [c, l]), $ = ye(() => {
|
|
3121
3121
|
if (!P) return null;
|
|
@@ -3127,19 +3127,19 @@ const ed = pt(vt((e, t) => {
|
|
|
3127
3127
|
v.current && D(N);
|
|
3128
3128
|
}, onChange: (I) => {
|
|
3129
3129
|
P && q(I.target.value);
|
|
3130
|
-
}, onMouseDown: (I) => I.stopPropagation(), onKeyDown: (I) => I.code === "Escape" ? (I.preventDefault(), void
|
|
3130
|
+
}, onMouseDown: (I) => I.stopPropagation(), onKeyDown: (I) => I.code === "Escape" ? (I.preventDefault(), void _()) : I.code === "Enter" ? (I.preventDefault(), void D(I.target.value)) : void (I.code !== "Tab" ? I.stopPropagation() : D(I.target.value)) };
|
|
3131
3131
|
return p(bn, { children: u(ee) });
|
|
3132
|
-
}, [P, N, D,
|
|
3132
|
+
}, [P, N, D, _, u, R]), [V, O] = ue();
|
|
3133
3133
|
Ot(() => {
|
|
3134
3134
|
let ee = Object.assign({}, n);
|
|
3135
3135
|
(d || A) && (ee = Object.assign(ee, C)), O(ee);
|
|
3136
3136
|
}, [d, A, C, n]), be(() => {
|
|
3137
3137
|
$ && i?.(N);
|
|
3138
3138
|
}, [$, i, N]);
|
|
3139
|
-
const W =
|
|
3139
|
+
const W = jt(t, () => ({ startEdit() {
|
|
3140
3140
|
R || b || w(!0);
|
|
3141
3141
|
}, cancel() {
|
|
3142
|
-
|
|
3142
|
+
_();
|
|
3143
3143
|
} }), []);
|
|
3144
3144
|
return Je("div", { ...E, ref: W, style: { flexDirection: "column", display: "flex", ...V }, className: Vt(r), children: [Je("div", { style: { position: "relative", boxSizing: "content-box", whiteSpace: "pre", userSelect: "none", display: "flex", justifyContent: "center" }, onDoubleClick: () => {
|
|
3145
3145
|
R || b || w(!0);
|
|
@@ -3160,14 +3160,14 @@ function er(e) {
|
|
|
3160
3160
|
const { Document: t } = zt(e);
|
|
3161
3161
|
return e instanceof t;
|
|
3162
3162
|
}
|
|
3163
|
-
function
|
|
3163
|
+
function Gn(e) {
|
|
3164
3164
|
return !xn(e) && e instanceof zt(e).HTMLElement;
|
|
3165
3165
|
}
|
|
3166
3166
|
function ml(e) {
|
|
3167
3167
|
return e instanceof zt(e).SVGElement;
|
|
3168
3168
|
}
|
|
3169
3169
|
function yn(e) {
|
|
3170
|
-
return e ? xn(e) ? e.document : Qo(e) ? er(e) ? e :
|
|
3170
|
+
return e ? xn(e) ? e.document : Qo(e) ? er(e) ? e : Gn(e) || ml(e) ? e.ownerDocument : document : document : document;
|
|
3171
3171
|
}
|
|
3172
3172
|
const $t = bo ? Ot : be;
|
|
3173
3173
|
function qo(e) {
|
|
@@ -3206,7 +3206,7 @@ function ho(e) {
|
|
|
3206
3206
|
}, [e]), t.current;
|
|
3207
3207
|
}
|
|
3208
3208
|
let Vo = {};
|
|
3209
|
-
function
|
|
3209
|
+
function Zn(e, t) {
|
|
3210
3210
|
return ye(() => {
|
|
3211
3211
|
if (t) return t;
|
|
3212
3212
|
const n = Vo[e] == null ? 0 : Vo[e] + 1;
|
|
@@ -3226,7 +3226,7 @@ function pl(e) {
|
|
|
3226
3226
|
}, { ...t });
|
|
3227
3227
|
};
|
|
3228
3228
|
}
|
|
3229
|
-
const wn = pl(1),
|
|
3229
|
+
const wn = pl(1), _n = pl(-1);
|
|
3230
3230
|
function Co(e) {
|
|
3231
3231
|
if (!e) return !1;
|
|
3232
3232
|
const { KeyboardEvent: t } = zt(e.target);
|
|
@@ -3301,7 +3301,7 @@ function Ma(e) {
|
|
|
3301
3301
|
return { announce: Ye((R) => {
|
|
3302
3302
|
R != null && g(R);
|
|
3303
3303
|
}, []), announcement: d };
|
|
3304
|
-
}(), c =
|
|
3304
|
+
}(), c = Zn("DndLiveRegion"), [u, s] = ue(!1);
|
|
3305
3305
|
if (be(() => {
|
|
3306
3306
|
s(!0);
|
|
3307
3307
|
}, []), function(d) {
|
|
@@ -3443,7 +3443,7 @@ function xo(e, t) {
|
|
|
3443
3443
|
return e ? function r(l) {
|
|
3444
3444
|
if (t != null && n.length >= t || !l) return n;
|
|
3445
3445
|
if (er(l) && l.scrollingElement != null && !n.includes(l.scrollingElement)) return n.push(l.scrollingElement), n;
|
|
3446
|
-
if (!
|
|
3446
|
+
if (!Gn(l) || ml(l) || n.includes(l)) return n;
|
|
3447
3447
|
const o = zt(e).getComputedStyle(l);
|
|
3448
3448
|
return l !== e && function(i, c) {
|
|
3449
3449
|
c === void 0 && (c = zt(i).getComputedStyle(i));
|
|
@@ -3462,7 +3462,7 @@ function ql(e) {
|
|
|
3462
3462
|
return t ?? null;
|
|
3463
3463
|
}
|
|
3464
3464
|
function Ho(e) {
|
|
3465
|
-
return bo && e ? xn(e) ? e : Qo(e) ? er(e) || e === yn(e).scrollingElement ? window :
|
|
3465
|
+
return bo && e ? xn(e) ? e : Qo(e) ? er(e) || e === yn(e).scrollingElement ? window : Gn(e) ? e : null : null : null;
|
|
3466
3466
|
}
|
|
3467
3467
|
function Cl(e) {
|
|
3468
3468
|
return xn(e) ? e.scrollX : e.scrollLeft;
|
|
@@ -3470,7 +3470,7 @@ function Cl(e) {
|
|
|
3470
3470
|
function xl(e) {
|
|
3471
3471
|
return xn(e) ? e.scrollY : e.scrollTop;
|
|
3472
3472
|
}
|
|
3473
|
-
function
|
|
3473
|
+
function _o(e) {
|
|
3474
3474
|
return { x: Cl(e), y: xl(e) };
|
|
3475
3475
|
}
|
|
3476
3476
|
var Tt;
|
|
@@ -3500,7 +3500,7 @@ function Ba(e) {
|
|
|
3500
3500
|
return { top: t, left: n, right: r, bottom: l, width: e.clientWidth, height: e.clientHeight };
|
|
3501
3501
|
}
|
|
3502
3502
|
function Rl(e) {
|
|
3503
|
-
return e.reduce((t, n) => wn(t,
|
|
3503
|
+
return e.reduce((t, n) => wn(t, _o(n)), Ut);
|
|
3504
3504
|
}
|
|
3505
3505
|
function Tl(e, t) {
|
|
3506
3506
|
if (t === void 0 && (t = Sn), !e) return;
|
|
@@ -3512,7 +3512,7 @@ const Ha = [["x", ["left", "right"], function(e) {
|
|
|
3512
3512
|
}], ["y", ["top", "bottom"], function(e) {
|
|
3513
3513
|
return e.reduce((t, n) => t + xl(n), 0);
|
|
3514
3514
|
}]];
|
|
3515
|
-
class
|
|
3515
|
+
class jo {
|
|
3516
3516
|
constructor(t, n) {
|
|
3517
3517
|
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
|
|
3518
3518
|
const r = xo(n), l = Rl(r);
|
|
@@ -3589,23 +3589,23 @@ class tr {
|
|
|
3589
3589
|
this.referenceCoordinates || (this.referenceCoordinates = C);
|
|
3590
3590
|
const d = i(t, { active: n, context: r.current, currentCoordinates: C });
|
|
3591
3591
|
if (d) {
|
|
3592
|
-
const g =
|
|
3592
|
+
const g = _n(d, C), R = { x: 0, y: 0 }, { scrollableAncestors: b } = r.current;
|
|
3593
3593
|
for (const E of b) {
|
|
3594
3594
|
const A = t.code, { isTop: U, isRight: P, isLeft: w, isBottom: N, maxScroll: q, minScroll: v } = kl(E), S = Ba(E), L = { x: Math.min(A === at.Right ? S.right - S.width / 2 : S.right, Math.max(A === at.Right ? S.left : S.left + S.width / 2, d.x)), y: Math.min(A === at.Down ? S.bottom - S.height / 2 : S.bottom, Math.max(A === at.Down ? S.top : S.top + S.height / 2, d.y)) }, M = A === at.Right && !P || A === at.Left && !w, D = A === at.Down && !N || A === at.Up && !U;
|
|
3595
3595
|
if (M && L.x !== d.x) {
|
|
3596
|
-
const
|
|
3597
|
-
if ($ && !g.y) return void E.scrollTo({ left:
|
|
3598
|
-
R.x = $ ? E.scrollLeft -
|
|
3596
|
+
const _ = E.scrollLeft + g.x, $ = A === at.Right && _ <= q.x || A === at.Left && _ >= v.x;
|
|
3597
|
+
if ($ && !g.y) return void E.scrollTo({ left: _, behavior: c });
|
|
3598
|
+
R.x = $ ? E.scrollLeft - _ : A === at.Right ? E.scrollLeft - q.x : E.scrollLeft - v.x, R.x && E.scrollBy({ left: -R.x, behavior: c });
|
|
3599
3599
|
break;
|
|
3600
3600
|
}
|
|
3601
3601
|
if (D && L.y !== d.y) {
|
|
3602
|
-
const
|
|
3603
|
-
if ($ && !g.x) return void E.scrollTo({ top:
|
|
3604
|
-
R.y = $ ? E.scrollTop -
|
|
3602
|
+
const _ = E.scrollTop + g.y, $ = A === at.Down && _ <= q.y || A === at.Up && _ >= v.y;
|
|
3603
|
+
if ($ && !g.x) return void E.scrollTo({ top: _, behavior: c });
|
|
3604
|
+
R.y = $ ? E.scrollTop - _ : A === at.Down ? E.scrollTop - q.y : E.scrollTop - v.y, R.y && E.scrollBy({ top: -R.y, behavior: c });
|
|
3605
3605
|
break;
|
|
3606
3606
|
}
|
|
3607
3607
|
}
|
|
3608
|
-
this.handleMove(t, wn(
|
|
3608
|
+
this.handleMove(t, wn(_n(d, this.referenceCoordinates), R));
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
3611
|
}
|
|
@@ -3674,7 +3674,7 @@ class nr {
|
|
|
3674
3674
|
var n;
|
|
3675
3675
|
const { activated: r, initialCoordinates: l, props: o } = this, { onMove: i, options: { activationConstraint: c } } = o;
|
|
3676
3676
|
if (!l) return;
|
|
3677
|
-
const u = (n = mo(t)) != null ? n : Ut, s =
|
|
3677
|
+
const u = (n = mo(t)) != null ? n : Ut, s = _n(l, u);
|
|
3678
3678
|
if (!r && c) {
|
|
3679
3679
|
if (Lr(c)) {
|
|
3680
3680
|
if (c.tolerance != null && Po(s, c.tolerance)) return this.handleCancel();
|
|
@@ -3712,10 +3712,10 @@ Dl.activators = [{ eventName: "onPointerDown", handler: (e, t) => {
|
|
|
3712
3712
|
return !(!n.isPrimary || n.button !== 0) && (r?.({ event: n }), !0);
|
|
3713
3713
|
} }];
|
|
3714
3714
|
const Ua = { move: { name: "mousemove" }, end: { name: "mouseup" } };
|
|
3715
|
-
var
|
|
3715
|
+
var Go;
|
|
3716
3716
|
(function(e) {
|
|
3717
3717
|
e[e.RightClick = 2] = "RightClick";
|
|
3718
|
-
})(
|
|
3718
|
+
})(Go || (Go = {}));
|
|
3719
3719
|
class El extends nr {
|
|
3720
3720
|
constructor(t) {
|
|
3721
3721
|
super(t, Ua, yn(t.event.target));
|
|
@@ -3723,7 +3723,7 @@ class El extends nr {
|
|
|
3723
3723
|
}
|
|
3724
3724
|
El.activators = [{ eventName: "onMouseDown", handler: (e, t) => {
|
|
3725
3725
|
let { nativeEvent: n } = e, { onActivation: r } = t;
|
|
3726
|
-
return n.button !==
|
|
3726
|
+
return n.button !== Go.RightClick && (r?.({ event: n }), !0);
|
|
3727
3727
|
} }];
|
|
3728
3728
|
const Wo = { cancel: { name: "touchcancel" }, move: { name: "touchmove" }, end: { name: "touchend" } };
|
|
3729
3729
|
class Al extends nr {
|
|
@@ -3739,15 +3739,15 @@ class Al extends nr {
|
|
|
3739
3739
|
}
|
|
3740
3740
|
}
|
|
3741
3741
|
var Bn, fo;
|
|
3742
|
-
function
|
|
3742
|
+
function _a(e) {
|
|
3743
3743
|
let { acceleration: t, activator: n = Bn.Pointer, canScroll: r, draggingRect: l, enabled: o, interval: i = 5, order: c = fo.TreeOrder, pointerCoordinates: u, scrollableAncestors: s, scrollableAncestorRects: C, delta: d, threshold: g } = e;
|
|
3744
3744
|
const R = function(v) {
|
|
3745
3745
|
let { delta: S, disabled: L } = v;
|
|
3746
3746
|
const M = ho(S);
|
|
3747
3747
|
return On((D) => {
|
|
3748
|
-
if (L || !M || !D) return
|
|
3749
|
-
const
|
|
3750
|
-
return { x: { [Tt.Backward]: D.x[Tt.Backward] ||
|
|
3748
|
+
if (L || !M || !D) return ja;
|
|
3749
|
+
const _ = { x: Math.sign(S.x - M.x), y: Math.sign(S.y - M.y) };
|
|
3750
|
+
return { x: { [Tt.Backward]: D.x[Tt.Backward] || _.x === -1, [Tt.Forward]: D.x[Tt.Forward] || _.x === 1 }, y: { [Tt.Backward]: D.y[Tt.Backward] || _.y === -1, [Tt.Forward]: D.y[Tt.Forward] || _.y === 1 } };
|
|
3751
3751
|
}, [L, S, M]);
|
|
3752
3752
|
}({ delta: d, disabled: !o }), [b, E] = function() {
|
|
3753
3753
|
const v = Te(null);
|
|
@@ -3776,7 +3776,7 @@ function Ga(e) {
|
|
|
3776
3776
|
const S = s.indexOf(v), L = C[S];
|
|
3777
3777
|
if (!L) continue;
|
|
3778
3778
|
const { direction: M, speed: D } = Va(v, L, P, t, g);
|
|
3779
|
-
for (const
|
|
3779
|
+
for (const _ of ["x", "y"]) R[_][M[_]] || (D[_] = 0, M[_] = 0);
|
|
3780
3780
|
if (D.x > 0 || D.y > 0) return E(), w.current = v, b(N, i), A.current = D, void (U.current = M);
|
|
3781
3781
|
}
|
|
3782
3782
|
A.current = { x: 0, y: 0 }, U.current = { x: 0, y: 0 }, E();
|
|
@@ -3792,13 +3792,13 @@ Al.activators = [{ eventName: "onTouchStart", handler: (e, t) => {
|
|
|
3792
3792
|
}(Bn || (Bn = {})), function(e) {
|
|
3793
3793
|
e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
3794
3794
|
}(fo || (fo = {}));
|
|
3795
|
-
const
|
|
3796
|
-
var
|
|
3795
|
+
const ja = { x: { [Tt.Backward]: !1, [Tt.Forward]: !1 }, y: { [Tt.Backward]: !1, [Tt.Forward]: !1 } };
|
|
3796
|
+
var jn, Zo;
|
|
3797
3797
|
(function(e) {
|
|
3798
3798
|
e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
|
|
3799
|
-
})(
|
|
3799
|
+
})(jn || (jn = {})), function(e) {
|
|
3800
3800
|
e.Optimized = "optimized";
|
|
3801
|
-
}(
|
|
3801
|
+
}(Zo || (Zo = {}));
|
|
3802
3802
|
const Vr = /* @__PURE__ */ new Map();
|
|
3803
3803
|
function Ko(e, t) {
|
|
3804
3804
|
return On((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
@@ -3812,11 +3812,11 @@ function vo(e) {
|
|
|
3812
3812
|
}, [n]);
|
|
3813
3813
|
return be(() => () => l?.disconnect(), [l]), l;
|
|
3814
3814
|
}
|
|
3815
|
-
function
|
|
3816
|
-
return new
|
|
3815
|
+
function Ga(e) {
|
|
3816
|
+
return new jo(Sn(e), e);
|
|
3817
3817
|
}
|
|
3818
3818
|
function Br(e, t, n) {
|
|
3819
|
-
t === void 0 && (t =
|
|
3819
|
+
t === void 0 && (t = Ga);
|
|
3820
3820
|
const [r, l] = ue(null);
|
|
3821
3821
|
function o() {
|
|
3822
3822
|
l((u) => {
|
|
@@ -3857,7 +3857,7 @@ function Pr(e, t) {
|
|
|
3857
3857
|
}, t), be(() => {
|
|
3858
3858
|
const r = e !== Ut;
|
|
3859
3859
|
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
3860
|
-
}, [e]), n.current ?
|
|
3860
|
+
}, [e]), n.current ? _n(e, n.current) : Ut;
|
|
3861
3861
|
}
|
|
3862
3862
|
function Wr(e) {
|
|
3863
3863
|
return ye(() => e ? function(t) {
|
|
@@ -3870,9 +3870,9 @@ function Il(e) {
|
|
|
3870
3870
|
if (!e) return null;
|
|
3871
3871
|
if (e.children.length > 1) return e;
|
|
3872
3872
|
const t = e.children[0];
|
|
3873
|
-
return
|
|
3873
|
+
return Gn(t) ? t : e;
|
|
3874
3874
|
}
|
|
3875
|
-
const
|
|
3875
|
+
const Za = [{ sensor: Dl, options: {} }, { sensor: tr, options: {} }], Ka = { current: {} }, uo = { draggable: { measure: Fr }, droppable: { measure: Fr, strategy: jn.WhileDragging, frequency: Zo.Optimized }, dragOverlay: { measure: Sn } };
|
|
3876
3876
|
class Hn extends Map {
|
|
3877
3877
|
get(t) {
|
|
3878
3878
|
var n;
|
|
@@ -3959,36 +3959,36 @@ var en;
|
|
|
3959
3959
|
})(en || (en = {}));
|
|
3960
3960
|
const es = pt(function(e) {
|
|
3961
3961
|
var t, n, r, l;
|
|
3962
|
-
let { id: o, accessibility: i, autoScroll: c = !0, children: u, sensors: s =
|
|
3962
|
+
let { id: o, accessibility: i, autoScroll: c = !0, children: u, sensors: s = Za, collisionDetection: C = za, measuring: d, modifiers: g, ...R } = e;
|
|
3963
3963
|
const b = ln(Ja, void 0, Ya), [E, A] = b, [U, P] = function() {
|
|
3964
|
-
const [h] = ue(() => /* @__PURE__ */ new Set()), H = Ye((
|
|
3965
|
-
return [Ye((
|
|
3966
|
-
let { type: J, event: re } =
|
|
3964
|
+
const [h] = ue(() => /* @__PURE__ */ new Set()), H = Ye((j) => (h.add(j), () => h.delete(j)), [h]);
|
|
3965
|
+
return [Ye((j) => {
|
|
3966
|
+
let { type: J, event: re } = j;
|
|
3967
3967
|
h.forEach((le) => {
|
|
3968
3968
|
var se;
|
|
3969
3969
|
return (se = le[J]) == null ? void 0 : se.call(le, re);
|
|
3970
3970
|
});
|
|
3971
3971
|
}, [h]), H];
|
|
3972
|
-
}(), [w, N] = ue(en.Uninitialized), q = w === en.Initialized, { draggable: { active: v, nodes: S, translate: L }, droppable: { containers: M } } = E, D = v != null ? S.get(v) : null,
|
|
3972
|
+
}(), [w, N] = ue(en.Uninitialized), q = w === en.Initialized, { draggable: { active: v, nodes: S, translate: L }, droppable: { containers: M } } = E, D = v != null ? S.get(v) : null, _ = Te({ initial: null, translated: null }), $ = ye(() => {
|
|
3973
3973
|
var h;
|
|
3974
|
-
return v != null ? { id: v, data: (h = D?.data) != null ? h : Ka, rect:
|
|
3975
|
-
}, [v, D]), V = Te(null), [O, W] = ue(null), [ee, I] = ue(null), y = Un(R, Object.values(R)), B =
|
|
3974
|
+
return v != null ? { id: v, data: (h = D?.data) != null ? h : Ka, rect: _ } : null;
|
|
3975
|
+
}, [v, D]), V = Te(null), [O, W] = ue(null), [ee, I] = ue(null), y = Un(R, Object.values(R)), B = Zn("DndDescribedBy", o), te = ye(() => M.getEnabled(), [M]), Se = ye(() => ({ draggable: { ...uo.draggable, ...oe?.draggable }, droppable: { ...uo.droppable, ...oe?.droppable }, dragOverlay: { ...uo.dragOverlay, ...oe?.dragOverlay } }), [(oe = d) == null ? void 0 : oe.draggable, oe?.droppable, oe?.dragOverlay]);
|
|
3976
3976
|
var oe;
|
|
3977
|
-
const { droppableRects:
|
|
3978
|
-
let { dragging:
|
|
3977
|
+
const { droppableRects: G, measureDroppableContainers: ae, measuringScheduled: Ae } = function(h, H) {
|
|
3978
|
+
let { dragging: j, dependencies: J, config: re } = H;
|
|
3979
3979
|
const [le, se] = ue(null), { frequency: Ce, measure: he, strategy: me } = re, Re = Te(h), Pe = function() {
|
|
3980
3980
|
switch (me) {
|
|
3981
|
-
case
|
|
3981
|
+
case jn.Always:
|
|
3982
3982
|
return !1;
|
|
3983
|
-
case
|
|
3984
|
-
return
|
|
3983
|
+
case jn.BeforeDragging:
|
|
3984
|
+
return j;
|
|
3985
3985
|
default:
|
|
3986
|
-
return !
|
|
3986
|
+
return !j;
|
|
3987
3987
|
}
|
|
3988
3988
|
}(), Be = Un(Pe), et = Ye(function(rt) {
|
|
3989
3989
|
rt === void 0 && (rt = []), Be.current || se((qt) => qt === null ? rt : qt.concat(rt.filter((Ct) => !qt.includes(Ct))));
|
|
3990
3990
|
}, [Be]), $e = Te(null), Ee = On((rt) => {
|
|
3991
|
-
if (Pe && !
|
|
3991
|
+
if (Pe && !j) return Vr;
|
|
3992
3992
|
if (!rt || rt === Vr || Re.current !== h || le != null) {
|
|
3993
3993
|
const qt = /* @__PURE__ */ new Map();
|
|
3994
3994
|
for (let Ct of h) {
|
|
@@ -3997,18 +3997,18 @@ const es = pt(function(e) {
|
|
|
3997
3997
|
qt.set(Ct.id, Ct.rect.current);
|
|
3998
3998
|
continue;
|
|
3999
3999
|
}
|
|
4000
|
-
const Ft = Ct.node.current, Ht = Ft ? new
|
|
4000
|
+
const Ft = Ct.node.current, Ht = Ft ? new jo(he(Ft), Ft) : null;
|
|
4001
4001
|
Ct.rect.current = Ht, Ht && qt.set(Ct.id, Ht);
|
|
4002
4002
|
}
|
|
4003
4003
|
return qt;
|
|
4004
4004
|
}
|
|
4005
4005
|
return rt;
|
|
4006
|
-
}, [h, le,
|
|
4006
|
+
}, [h, le, j, Pe, he]);
|
|
4007
4007
|
return be(() => {
|
|
4008
4008
|
Re.current = h;
|
|
4009
4009
|
}, [h]), be(() => {
|
|
4010
4010
|
Pe || et();
|
|
4011
|
-
}, [
|
|
4011
|
+
}, [j, Pe]), be(() => {
|
|
4012
4012
|
le && le.length > 0 && se(null);
|
|
4013
4013
|
}, [JSON.stringify(le)]), be(() => {
|
|
4014
4014
|
Pe || typeof Ce != "number" || $e.current !== null || ($e.current = setTimeout(() => {
|
|
@@ -4016,36 +4016,36 @@ const es = pt(function(e) {
|
|
|
4016
4016
|
}, Ce));
|
|
4017
4017
|
}, [Ce, Pe, et, ...J]), { droppableRects: Ee, measureDroppableContainers: et, measuringScheduled: le != null };
|
|
4018
4018
|
}(te, { dragging: q, dependencies: [L.x, L.y], config: Se.droppable }), Fe = function(h, H) {
|
|
4019
|
-
const
|
|
4019
|
+
const j = H != null ? h.get(H) : void 0, J = j ? j.node.current : null;
|
|
4020
4020
|
return On((re) => {
|
|
4021
4021
|
var le;
|
|
4022
4022
|
return H == null ? null : (le = J ?? re) != null ? le : null;
|
|
4023
4023
|
}, [J, H]);
|
|
4024
|
-
}(S, v), fe = ye(() => ee ? mo(ee) : null, [ee]),
|
|
4025
|
-
const h = O?.autoScrollEnabled === !1, H = typeof c == "object" ? c.enabled === !1 : c === !1,
|
|
4026
|
-
return typeof c == "object" ? { ...c, enabled:
|
|
4024
|
+
}(S, v), fe = ye(() => ee ? mo(ee) : null, [ee]), _e = function() {
|
|
4025
|
+
const h = O?.autoScrollEnabled === !1, H = typeof c == "object" ? c.enabled === !1 : c === !1, j = q && !h && !H;
|
|
4026
|
+
return typeof c == "object" ? { ...c, enabled: j } : { enabled: j };
|
|
4027
4027
|
}(), ve = function(h, H) {
|
|
4028
4028
|
return Ko(h, H);
|
|
4029
4029
|
}(Fe, Se.draggable.measure);
|
|
4030
4030
|
(function(h) {
|
|
4031
|
-
let { activeNode: H, measure:
|
|
4031
|
+
let { activeNode: H, measure: j, initialRect: J, config: re = !0 } = h;
|
|
4032
4032
|
const le = Te(!1), { x: se, y: Ce } = typeof re == "boolean" ? { x: re, y: re } : re;
|
|
4033
4033
|
$t(() => {
|
|
4034
4034
|
if (!se && !Ce || !H) return void (le.current = !1);
|
|
4035
4035
|
if (le.current || !J) return;
|
|
4036
4036
|
const he = H?.node.current;
|
|
4037
4037
|
if (!he || he.isConnected === !1) return;
|
|
4038
|
-
const me = zr(
|
|
4038
|
+
const me = zr(j(he), J);
|
|
4039
4039
|
if (se || (me.x = 0), Ce || (me.y = 0), le.current = !0, Math.abs(me.x) > 0 || Math.abs(me.y) > 0) {
|
|
4040
4040
|
const Re = ql(he);
|
|
4041
4041
|
Re && Re.scrollBy({ top: me.y, left: me.x });
|
|
4042
4042
|
}
|
|
4043
|
-
}, [H, se, Ce, J,
|
|
4044
|
-
})({ activeNode: v != null ? S.get(v) : null, config:
|
|
4045
|
-
const
|
|
4043
|
+
}, [H, se, Ce, J, j]);
|
|
4044
|
+
})({ activeNode: v != null ? S.get(v) : null, config: _e.layoutShiftCompensation, initialRect: ve, measure: Se.draggable.measure });
|
|
4045
|
+
const Ge = Br(Fe, Se.draggable.measure, ve), De = Br(Fe ? Fe.parentElement : null), ge = Te({ activatorEvent: null, active: null, activeNode: Fe, collisionRect: null, collisions: null, droppableRects: G, draggableNodes: S, draggingNode: null, draggingNodeRect: null, droppableContainers: M, over: null, scrollableAncestors: [], scrollAdjustedTranslate: null }), ce = M.getNodeFor((t = ge.current.over) == null ? void 0 : t.id), ke = function(h) {
|
|
4046
4046
|
let { measure: H } = h;
|
|
4047
|
-
const [
|
|
4048
|
-
for (const { target: me } of he) if (
|
|
4047
|
+
const [j, J] = ue(null), re = vo({ callback: Ye((he) => {
|
|
4048
|
+
for (const { target: me } of he) if (Gn(me)) {
|
|
4049
4049
|
J((Re) => {
|
|
4050
4050
|
const Pe = H(me);
|
|
4051
4051
|
return Re ? { ...Re, width: Pe.width, height: Pe.height } : Pe;
|
|
@@ -4056,28 +4056,28 @@ const es = pt(function(e) {
|
|
|
4056
4056
|
const me = Il(he);
|
|
4057
4057
|
re?.disconnect(), me && re?.observe(me), J(me ? H(me) : null);
|
|
4058
4058
|
}, [H, re]), [se, Ce] = go(le);
|
|
4059
|
-
return ye(() => ({ nodeRef: se, rect:
|
|
4060
|
-
}({ measure: Se.dragOverlay.measure }), de = (n = ke.nodeRef.current) != null ? n : Fe, xe = q ? (r = ke.rect) != null ? r :
|
|
4059
|
+
return ye(() => ({ nodeRef: se, rect: j, setRef: Ce }), [j, se, Ce]);
|
|
4060
|
+
}({ measure: Se.dragOverlay.measure }), de = (n = ke.nodeRef.current) != null ? n : Fe, xe = q ? (r = ke.rect) != null ? r : Ge : null, Oe = !!(ke.nodeRef.current && ke.rect), qe = zr(Le = Oe ? null : Ge, Ko(Le));
|
|
4061
4061
|
var Le;
|
|
4062
|
-
const We = Wr(de ? zt(de) : null),
|
|
4063
|
-
const H = Te(h),
|
|
4062
|
+
const We = Wr(de ? zt(de) : null), Ze = function(h) {
|
|
4063
|
+
const H = Te(h), j = On((J) => h ? J && J !== Hr && h && H.current && h.parentNode === H.current.parentNode ? J : xo(h) : Hr, [h]);
|
|
4064
4064
|
return be(() => {
|
|
4065
4065
|
H.current = h;
|
|
4066
|
-
}, [h]),
|
|
4066
|
+
}, [h]), j;
|
|
4067
4067
|
}(q ? ce ?? Fe : null), m = function(h, H) {
|
|
4068
4068
|
H === void 0 && (H = Sn);
|
|
4069
|
-
const [
|
|
4069
|
+
const [j] = h, J = Wr(j ? zt(j) : null), [re, le] = ue($r);
|
|
4070
4070
|
function se() {
|
|
4071
|
-
le(() => h.length ? h.map((he) => Sl(he) ? J : new
|
|
4071
|
+
le(() => h.length ? h.map((he) => Sl(he) ? J : new jo(H(he), he)) : $r);
|
|
4072
4072
|
}
|
|
4073
4073
|
const Ce = vo({ callback: se });
|
|
4074
4074
|
return $t(() => {
|
|
4075
4075
|
Ce?.disconnect(), se(), h.forEach((he) => Ce?.observe(he));
|
|
4076
4076
|
}, [h]), re;
|
|
4077
|
-
}(
|
|
4078
|
-
const [H,
|
|
4077
|
+
}(Ze), Ke = Nl(g, { transform: { x: L.x - qe.x, y: L.y - qe.y, scaleX: 1, scaleY: 1 }, activatorEvent: ee, active: $, activeNodeRect: Ge, containerNodeRect: De, draggingNodeRect: xe, over: ge.current.over, overlayNodeRect: ke.rect, scrollableAncestors: Ze, scrollableAncestorRects: m, windowRect: We }), ct = fe ? wn(fe, L) : null, Qe = function(h) {
|
|
4078
|
+
const [H, j] = ue(null), J = Te(h), re = Ye((le) => {
|
|
4079
4079
|
const se = Ho(le.target);
|
|
4080
|
-
se &&
|
|
4080
|
+
se && j((Ce) => Ce ? (Ce.set(se, _o(se)), new Map(Ce)) : null);
|
|
4081
4081
|
}, []);
|
|
4082
4082
|
return be(() => {
|
|
4083
4083
|
const le = J.current;
|
|
@@ -4085,9 +4085,9 @@ const es = pt(function(e) {
|
|
|
4085
4085
|
se(le);
|
|
4086
4086
|
const Ce = h.map((he) => {
|
|
4087
4087
|
const me = Ho(he);
|
|
4088
|
-
return me ? (me.addEventListener("scroll", re, { passive: !0 }), [me,
|
|
4088
|
+
return me ? (me.addEventListener("scroll", re, { passive: !0 }), [me, _o(me)]) : null;
|
|
4089
4089
|
}).filter((he) => he != null);
|
|
4090
|
-
|
|
4090
|
+
j(Ce.length ? new Map(Ce) : null), J.current = h;
|
|
4091
4091
|
}
|
|
4092
4092
|
return () => {
|
|
4093
4093
|
se(h), se(le);
|
|
@@ -4099,14 +4099,14 @@ const es = pt(function(e) {
|
|
|
4099
4099
|
});
|
|
4100
4100
|
}
|
|
4101
4101
|
}, [re, h]), ye(() => h.length ? H ? Array.from(H.values()).reduce((le, se) => wn(le, se), Ut) : Rl(h) : Ut, [h, H]);
|
|
4102
|
-
}(
|
|
4103
|
-
return { ...h, scaleX: H &&
|
|
4104
|
-
}(Oe ? Ke : wn(Ke, Ne), (l = x?.rect) != null ? l : null,
|
|
4105
|
-
let { sensor:
|
|
4102
|
+
}(Ze), K = Pr(Qe), Ne = Pr(Qe, [Ge]), je = wn(Ke, K), ze = xe ? Na(xe, Ke) : null, He = $ && ze ? C({ active: $, collisionRect: ze, droppableRects: G, droppableContainers: te, pointerCoordinates: ct }) : null, Ve = yl(He, "id"), [x, ne] = ue(null), F = function(h, H, j) {
|
|
4103
|
+
return { ...h, scaleX: H && j ? H.width / j.width : 1, scaleY: H && j ? H.height / j.height : 1 };
|
|
4104
|
+
}(Oe ? Ke : wn(Ke, Ne), (l = x?.rect) != null ? l : null, Ge), Z = Te(null), a = Ye((h, H) => {
|
|
4105
|
+
let { sensor: j, options: J } = H;
|
|
4106
4106
|
if (V.current == null) return;
|
|
4107
4107
|
const re = S.get(V.current);
|
|
4108
4108
|
if (!re) return;
|
|
4109
|
-
const le = h.nativeEvent, se = new
|
|
4109
|
+
const le = h.nativeEvent, se = new j({ active: V.current, activeNode: re, event: le, options: J, context: ge, onAbort(he) {
|
|
4110
4110
|
if (!S.get(he)) return;
|
|
4111
4111
|
const { onDragAbort: me } = y.current, Re = { id: he };
|
|
4112
4112
|
me?.(Re), U({ type: "onDragAbort", event: Re });
|
|
@@ -4119,9 +4119,9 @@ const es = pt(function(e) {
|
|
|
4119
4119
|
if (me == null) return;
|
|
4120
4120
|
const Re = S.get(me);
|
|
4121
4121
|
if (!Re) return;
|
|
4122
|
-
const { onDragStart: Pe } = y.current, Be = { activatorEvent: le, active: { id: me, data: Re.data, rect:
|
|
4122
|
+
const { onDragStart: Pe } = y.current, Be = { activatorEvent: le, active: { id: me, data: Re.data, rect: _ } };
|
|
4123
4123
|
Nn(() => {
|
|
4124
|
-
Pe?.(Be), N(en.Initializing), A({ type: kt.DragStart, initialCoordinates: he, active: me }), U({ type: "onDragStart", event: Be }), W(
|
|
4124
|
+
Pe?.(Be), N(en.Initializing), A({ type: kt.DragStart, initialCoordinates: he, active: me }), U({ type: "onDragStart", event: Be }), W(Z.current), I(le);
|
|
4125
4125
|
});
|
|
4126
4126
|
}, onMove(he) {
|
|
4127
4127
|
A({ type: kt.DragMove, coordinates: he });
|
|
@@ -4135,7 +4135,7 @@ const es = pt(function(e) {
|
|
|
4135
4135
|
et = { activatorEvent: le, active: me, collisions: Re, delta: Be, over: Pe }, he === kt.DragEnd && typeof $e == "function" && await Promise.resolve($e(et)) && (he = kt.DragCancel);
|
|
4136
4136
|
}
|
|
4137
4137
|
V.current = null, Nn(() => {
|
|
4138
|
-
A({ type: he }), N(en.Uninitialized), ne(null), W(null), I(null),
|
|
4138
|
+
A({ type: he }), N(en.Uninitialized), ne(null), W(null), I(null), Z.current = null;
|
|
4139
4139
|
const $e = he === kt.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
4140
4140
|
if (et) {
|
|
4141
4141
|
const Ee = y.current[$e];
|
|
@@ -4144,59 +4144,59 @@ const es = pt(function(e) {
|
|
|
4144
4144
|
});
|
|
4145
4145
|
};
|
|
4146
4146
|
}
|
|
4147
|
-
|
|
4148
|
-
}, [S]), k = Ye((h, H) => (
|
|
4149
|
-
const re =
|
|
4147
|
+
Z.current = se;
|
|
4148
|
+
}, [S]), k = Ye((h, H) => (j, J) => {
|
|
4149
|
+
const re = j.nativeEvent, le = S.get(J);
|
|
4150
4150
|
if (V.current !== null || !le || re.dndKit || re.defaultPrevented) return;
|
|
4151
4151
|
const se = { active: le };
|
|
4152
|
-
h(
|
|
4152
|
+
h(j, H.options, se) === !0 && (re.dndKit = { capturedBy: H.sensor }, V.current = J, a(j, H));
|
|
4153
4153
|
}, [S, a]), T = function(h, H) {
|
|
4154
|
-
return ye(() => h.reduce((
|
|
4154
|
+
return ye(() => h.reduce((j, J) => {
|
|
4155
4155
|
const { sensor: re } = J;
|
|
4156
|
-
return [...
|
|
4156
|
+
return [...j, ...re.activators.map((le) => ({ eventName: le.eventName, handler: H(le.handler, J) }))];
|
|
4157
4157
|
}, []), [h, H]);
|
|
4158
4158
|
}(s, k);
|
|
4159
4159
|
(function(h) {
|
|
4160
4160
|
be(() => {
|
|
4161
4161
|
if (!bo) return;
|
|
4162
|
-
const H = h.map((
|
|
4163
|
-
let { sensor: J } =
|
|
4162
|
+
const H = h.map((j) => {
|
|
4163
|
+
let { sensor: J } = j;
|
|
4164
4164
|
return J.setup == null ? void 0 : J.setup();
|
|
4165
4165
|
});
|
|
4166
4166
|
return () => {
|
|
4167
|
-
for (const
|
|
4167
|
+
for (const j of H) j?.();
|
|
4168
4168
|
};
|
|
4169
4169
|
}, h.map((H) => {
|
|
4170
|
-
let { sensor:
|
|
4171
|
-
return
|
|
4170
|
+
let { sensor: j } = H;
|
|
4171
|
+
return j;
|
|
4172
4172
|
}));
|
|
4173
4173
|
})(s), $t(() => {
|
|
4174
|
-
|
|
4175
|
-
}, [
|
|
4176
|
-
const { onDragMove: h } = y.current, { active: H, activatorEvent:
|
|
4177
|
-
if (!H || !
|
|
4178
|
-
const le = { active: H, activatorEvent:
|
|
4174
|
+
Ge && w === en.Initializing && N(en.Initialized);
|
|
4175
|
+
}, [Ge, w]), be(() => {
|
|
4176
|
+
const { onDragMove: h } = y.current, { active: H, activatorEvent: j, collisions: J, over: re } = ge.current;
|
|
4177
|
+
if (!H || !j) return;
|
|
4178
|
+
const le = { active: H, activatorEvent: j, collisions: J, delta: { x: je.x, y: je.y }, over: re };
|
|
4179
4179
|
Nn(() => {
|
|
4180
4180
|
h?.(le), U({ type: "onDragMove", event: le });
|
|
4181
4181
|
});
|
|
4182
|
-
}, [
|
|
4183
|
-
const { active: h, activatorEvent: H, collisions:
|
|
4182
|
+
}, [je.x, je.y]), be(() => {
|
|
4183
|
+
const { active: h, activatorEvent: H, collisions: j, droppableContainers: J, scrollAdjustedTranslate: re } = ge.current;
|
|
4184
4184
|
if (!h || V.current == null || !H || !re) return;
|
|
4185
|
-
const { onDragOver: le } = y.current, se = J.get(Ve), Ce = se && se.rect.current ? { id: se.id, rect: se.rect.current, data: se.data, disabled: se.disabled } : null, he = { active: h, activatorEvent: H, collisions:
|
|
4185
|
+
const { onDragOver: le } = y.current, se = J.get(Ve), Ce = se && se.rect.current ? { id: se.id, rect: se.rect.current, data: se.data, disabled: se.disabled } : null, he = { active: h, activatorEvent: H, collisions: j, delta: { x: re.x, y: re.y }, over: Ce };
|
|
4186
4186
|
Nn(() => {
|
|
4187
4187
|
ne(Ce), le?.(he), U({ type: "onDragOver", event: he });
|
|
4188
4188
|
});
|
|
4189
4189
|
}, [Ve]), $t(() => {
|
|
4190
|
-
ge.current = { activatorEvent: ee, active: $, activeNode: Fe, collisionRect: ze, collisions: He, droppableRects:
|
|
4191
|
-
}, [$, Fe, He, ze, S, de, xe,
|
|
4192
|
-
const f = ye(() => ({ active: $, activeNode: Fe, activeNodeRect:
|
|
4190
|
+
ge.current = { activatorEvent: ee, active: $, activeNode: Fe, collisionRect: ze, collisions: He, droppableRects: G, draggableNodes: S, draggingNode: de, draggingNodeRect: xe, droppableContainers: M, over: x, scrollableAncestors: Ze, scrollAdjustedTranslate: je }, _.current = { initial: xe, translated: ze };
|
|
4191
|
+
}, [$, Fe, He, ze, S, de, xe, G, M, x, Ze, je]), _a({ ..._e, delta: L, draggingRect: ze, pointerCoordinates: ct, scrollableAncestors: Ze, scrollableAncestorRects: m });
|
|
4192
|
+
const f = ye(() => ({ active: $, activeNode: Fe, activeNodeRect: Ge, activatorEvent: ee, collisions: He, containerNodeRect: De, dragOverlay: ke, draggableNodes: S, droppableContainers: M, droppableRects: G, over: x, measureDroppableContainers: ae, scrollableAncestors: Ze, scrollableAncestorRects: m, measuringConfiguration: Se, measuringScheduled: Ae, windowRect: We }), [$, Fe, Ge, ee, He, De, ke, S, M, G, x, ae, Ze, m, Se, Ae, We]), z = ye(() => ({ activatorEvent: ee, activators: T, active: $, activeNodeRect: Ge, ariaDescribedById: { draggable: B }, dispatch: A, draggableNodes: S, over: x, measureDroppableContainers: ae }), [ee, T, $, Ge, A, B, S, x, ae]);
|
|
4193
4193
|
return tt.createElement(fl.Provider, { value: P }, tt.createElement(Kn.Provider, { value: z }, tt.createElement(Fl.Provider, { value: f }, tt.createElement(So.Provider, { value: F }, u)), tt.createElement(Qa, { disabled: i?.restoreFocus === !1 })), tt.createElement(Ma, { ...i, hiddenTextDescribedById: B }));
|
|
4194
4194
|
}), ts = qn(null), Ur = "button";
|
|
4195
4195
|
function ns(e) {
|
|
4196
4196
|
let { id: t, data: n, disabled: r = !1, attributes: l } = e;
|
|
4197
|
-
const o =
|
|
4198
|
-
return ye(() => L.reduce((D,
|
|
4199
|
-
let { eventName: $, handler: V } =
|
|
4197
|
+
const o = Zn("Draggable"), { activators: i, activatorEvent: c, active: u, activeNodeRect: s, ariaDescribedById: C, draggableNodes: d, over: g } = Xt(Kn), { role: R = Ur, roleDescription: b = "draggable", tabIndex: E = 0 } = l ?? {}, A = u?.id === t, U = Xt(A ? So : ts), [P, w] = go(), [N, q] = go(), v = function(L, M) {
|
|
4198
|
+
return ye(() => L.reduce((D, _) => {
|
|
4199
|
+
let { eventName: $, handler: V } = _;
|
|
4200
4200
|
return D[$] = (O) => {
|
|
4201
4201
|
V(O, M);
|
|
4202
4202
|
}, D;
|
|
@@ -4262,8 +4262,8 @@ function us(e) {
|
|
|
4262
4262
|
return (P) => {
|
|
4263
4263
|
let { active: w, dragOverlay: N, transform: q, ...v } = P;
|
|
4264
4264
|
if (!b) return;
|
|
4265
|
-
const S = { x: N.rect.left - w.rect.left, y: N.rect.top - w.rect.top }, L = { scaleX: q.scaleX !== 1 ? w.rect.width * q.scaleX / N.rect.width : 1, scaleY: q.scaleY !== 1 ? w.rect.height * q.scaleY / N.rect.height : 1 }, M = { x: q.x - S.x, y: q.y - S.y, ...L }, D = U({ ...v, active: w, dragOverlay: N, transform: { initial: q, final: M } }), [
|
|
4266
|
-
if (JSON.stringify(
|
|
4265
|
+
const S = { x: N.rect.left - w.rect.left, y: N.rect.top - w.rect.top }, L = { scaleX: q.scaleX !== 1 ? w.rect.width * q.scaleX / N.rect.width : 1, scaleY: q.scaleY !== 1 ? w.rect.height * q.scaleY / N.rect.height : 1 }, M = { x: q.x - S.x, y: q.y - S.y, ...L }, D = U({ ...v, active: w, dragOverlay: N, transform: { initial: q, final: M } }), [_] = D, $ = D[D.length - 1];
|
|
4266
|
+
if (JSON.stringify(_) === JSON.stringify($)) return;
|
|
4267
4267
|
const V = A?.({ active: w, dragOverlay: N, ...v }), O = N.node.animate(D, { duration: b, easing: E, fill: "forwards" });
|
|
4268
4268
|
return new Promise((W) => {
|
|
4269
4269
|
O.onfinish = () => {
|
|
@@ -4275,16 +4275,16 @@ function us(e) {
|
|
|
4275
4275
|
return Tl(u, l.draggable.measure), g({ active: { id: o, data: c.data, node: u, rect: l.draggable.measure(u) }, draggableNodes: n, dragOverlay: { node: i, rect: l.dragOverlay.measure(s) }, droppableContainers: r, measuringConfiguration: l, transform: d });
|
|
4276
4276
|
});
|
|
4277
4277
|
}
|
|
4278
|
-
let
|
|
4278
|
+
let _r = 0;
|
|
4279
4279
|
function gs(e) {
|
|
4280
4280
|
return ye(() => {
|
|
4281
|
-
if (e != null) return
|
|
4281
|
+
if (e != null) return _r++, _r;
|
|
4282
4282
|
}, [e]);
|
|
4283
4283
|
}
|
|
4284
4284
|
const hs = tt.memo((e) => {
|
|
4285
4285
|
let { adjustScale: t = !1, children: n, dropAnimation: r, style: l, transition: o, modifiers: i, wrapperElement: c = "div", className: u, zIndex: s = 999 } = e;
|
|
4286
|
-
const { activatorEvent: C, active: d, activeNodeRect: g, containerNodeRect: R, draggableNodes: b, droppableContainers: E, dragOverlay: A, over: U, measuringConfiguration: P, scrollableAncestors: w, scrollableAncestorRects: N, windowRect: q } = Ll(), v = Xt(So), S = gs(d?.id), L = Nl(i, { activatorEvent: C, active: d, activeNodeRect: g, containerNodeRect: R, draggingNodeRect: A.rect, over: U, overlayNodeRect: A.rect, scrollableAncestors: w, scrollableAncestorRects: N, transform: v, windowRect: q }), M = Ko(g), D = us({ config: r, draggableNodes: b, droppableContainers: E, measuringConfiguration: P }),
|
|
4287
|
-
return tt.createElement(is, null, tt.createElement(rs, { animation: D }, d && S ? tt.createElement(ds, { key: S, id: d.id, ref:
|
|
4286
|
+
const { activatorEvent: C, active: d, activeNodeRect: g, containerNodeRect: R, draggableNodes: b, droppableContainers: E, dragOverlay: A, over: U, measuringConfiguration: P, scrollableAncestors: w, scrollableAncestorRects: N, windowRect: q } = Ll(), v = Xt(So), S = gs(d?.id), L = Nl(i, { activatorEvent: C, active: d, activeNodeRect: g, containerNodeRect: R, draggingNodeRect: A.rect, over: U, overlayNodeRect: A.rect, scrollableAncestors: w, scrollableAncestorRects: N, transform: v, windowRect: q }), M = Ko(g), D = us({ config: r, draggableNodes: b, droppableContainers: E, measuringConfiguration: P }), _ = M ? A.setRef : void 0;
|
|
4287
|
+
return tt.createElement(is, null, tt.createElement(rs, { animation: D }, d && S ? tt.createElement(ds, { key: S, id: d.id, ref: _, as: c, activatorEvent: C, adjustScale: t, className: u, transition: o, rect: M, style: { zIndex: s, ...l }, transform: L }, n) : null));
|
|
4288
4288
|
});
|
|
4289
4289
|
function or(e, t, n) {
|
|
4290
4290
|
const r = e.slice();
|
|
@@ -4320,7 +4320,7 @@ const so = { scaleX: 1, scaleY: 1 }, ps = (e) => {
|
|
|
4320
4320
|
}, Vl = "Sortable", Bl = tt.createContext({ activeIndex: -1, containerId: Vl, disableTransforms: !1, items: [], overIndex: -1, useDragOverlay: !1, sortedRects: [], strategy: rr, disabled: { draggable: !1, droppable: !1 } });
|
|
4321
4321
|
function fs(e) {
|
|
4322
4322
|
let { children: t, id: n, items: r, strategy: l = rr, disabled: o = !1 } = e;
|
|
4323
|
-
const { active: i, dragOverlay: c, droppableRects: u, over: s, measureDroppableContainers: C } = Ll(), d =
|
|
4323
|
+
const { active: i, dragOverlay: c, droppableRects: u, over: s, measureDroppableContainers: C } = Ll(), d = Zn(Vl, n), g = c.rect !== null, R = ye(() => r.map((v) => typeof v == "object" && "id" in v ? v.id : v), [r]), b = i != null, E = i ? R.indexOf(i.id) : -1, A = s ? R.indexOf(s.id) : -1, U = Te(R), P = !function(v, S) {
|
|
4324
4324
|
if (v === S) return !0;
|
|
4325
4325
|
if (v.length !== S.length) return !1;
|
|
4326
4326
|
for (let L = 0; L < v.length; L++) if (v[L] !== S[L]) return !1;
|
|
@@ -4350,31 +4350,31 @@ function Cs(e) {
|
|
|
4350
4350
|
return typeof ce == "boolean" ? { draggable: ce, droppable: !1 } : { draggable: (de = ce?.draggable) != null ? de : ke.draggable, droppable: (xe = ce?.droppable) != null ? xe : ke.droppable };
|
|
4351
4351
|
}(r, R), N = C.indexOf(i), q = ye(() => ({ sortable: { containerId: d, index: N, items: C }, ...l }), [d, l, N, C]), v = ye(() => C.slice(C.indexOf(i)), [C, i]), { rect: S, node: L, isOver: M, setNodeRef: D } = function(ce) {
|
|
4352
4352
|
let { data: ke, disabled: de = !1, id: xe, resizeObserverConfig: Oe } = ce;
|
|
4353
|
-
const qe =
|
|
4353
|
+
const qe = Zn("Droppable"), { active: Le, dispatch: We, over: Ze, measureDroppableContainers: m } = Xt(Kn), Ke = Te({ disabled: de }), ct = Te(!1), Qe = Te(null), K = Te(null), { disabled: Ne, updateMeasurementsFor: je, timeout: ze } = { ...os, ...Oe }, He = Un(je ?? xe), Ve = vo({ callback: Ye(() => {
|
|
4354
4354
|
ct.current ? (K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
4355
4355
|
m(Array.isArray(He.current) ? He.current : [He.current]), K.current = null;
|
|
4356
4356
|
}, ze)) : ct.current = !0;
|
|
4357
4357
|
}, [ze]), disabled: Ne || !Le }), x = Ye((a, k) => {
|
|
4358
4358
|
Ve && (k && (Ve.unobserve(k), ct.current = !1), a && Ve.observe(a));
|
|
4359
|
-
}, [Ve]), [ne, F] = go(x),
|
|
4359
|
+
}, [Ve]), [ne, F] = go(x), Z = Un(ke);
|
|
4360
4360
|
return be(() => {
|
|
4361
4361
|
Ve && ne.current && (Ve.disconnect(), ct.current = !1, Ve.observe(ne.current));
|
|
4362
|
-
}, [ne, Ve]), be(() => (We({ type: kt.RegisterDroppable, element: { id: xe, key: qe, disabled: de, node: ne, rect: Qe, data:
|
|
4362
|
+
}, [ne, Ve]), be(() => (We({ type: kt.RegisterDroppable, element: { id: xe, key: qe, disabled: de, node: ne, rect: Qe, data: Z } }), () => We({ type: kt.UnregisterDroppable, key: qe, id: xe })), [xe]), be(() => {
|
|
4363
4363
|
de !== Ke.current.disabled && (We({ type: kt.SetDroppableDisabled, id: xe, key: qe, disabled: de }), Ke.current.disabled = de);
|
|
4364
|
-
}, [xe, qe, de, We]), { active: Le, rect: Qe, isOver:
|
|
4365
|
-
}({ id: i, data: q, disabled: w.droppable, resizeObserverConfig: { updateMeasurementsFor: v, ...u } }), { active:
|
|
4364
|
+
}, [xe, qe, de, We]), { active: Le, rect: Qe, isOver: Ze?.id === xe, node: ne, over: Ze, setNodeRef: F };
|
|
4365
|
+
}({ id: i, data: q, disabled: w.droppable, resizeObserverConfig: { updateMeasurementsFor: v, ...u } }), { active: _, activatorEvent: $, activeNodeRect: V, attributes: O, setNodeRef: W, listeners: ee, isDragging: I, over: y, setActivatorNodeRef: B, transform: te } = ns({ id: i, data: q, attributes: { ...qs, ...n }, disabled: w.draggable }), Se = function() {
|
|
4366
4366
|
for (var ce = arguments.length, ke = new Array(ce), de = 0; de < ce; de++) ke[de] = arguments[de];
|
|
4367
4367
|
return ye(() => (xe) => {
|
|
4368
4368
|
ke.forEach((Oe) => Oe(xe));
|
|
4369
4369
|
}, ke);
|
|
4370
|
-
}(D, W), oe = !!
|
|
4370
|
+
}(D, W), oe = !!_, G = oe && !b && ao(g) && ao(A), ae = !U && I, Ae = ae && G ? te : null, Fe = G ? Ae ?? (c ?? P)({ rects: E, activeNodeRect: V, activeIndex: g, overIndex: A, index: N }) : null, fe = ao(g) && ao(A) ? o({ id: i, items: C, activeIndex: g, overIndex: A }) : N, _e = _?.id, ve = Te({ activeId: _e, items: C, newIndex: fe, containerId: d }), Ge = C !== ve.current.items, De = t({ active: _, containerId: d, isDragging: I, isSorting: oe, id: i, index: N, items: C, newIndex: ve.current.newIndex, previousItems: ve.current.items, previousContainerId: ve.current.containerId, transition: s, wasDragging: ve.current.activeId != null }), ge = function(ce) {
|
|
4371
4371
|
let { disabled: ke, index: de, node: xe, rect: Oe } = ce;
|
|
4372
4372
|
const [qe, Le] = ue(null), We = Te(de);
|
|
4373
4373
|
return $t(() => {
|
|
4374
4374
|
if (!ke && de !== We.current && xe.current) {
|
|
4375
|
-
const
|
|
4376
|
-
if (
|
|
4377
|
-
const m = Sn(xe.current, { ignoreTransform: !0 }), Ke = { x:
|
|
4375
|
+
const Ze = Oe.current;
|
|
4376
|
+
if (Ze) {
|
|
4377
|
+
const m = Sn(xe.current, { ignoreTransform: !0 }), Ke = { x: Ze.left - m.left, y: Ze.top - m.top, scaleX: Ze.width / m.width, scaleY: Ze.height / m.height };
|
|
4378
4378
|
(Ke.x || Ke.y) && Le(Ke);
|
|
4379
4379
|
}
|
|
4380
4380
|
}
|
|
@@ -4386,14 +4386,14 @@ function Cs(e) {
|
|
|
4386
4386
|
return be(() => {
|
|
4387
4387
|
oe && ve.current.newIndex !== fe && (ve.current.newIndex = fe), d !== ve.current.containerId && (ve.current.containerId = d), C !== ve.current.items && (ve.current.items = C);
|
|
4388
4388
|
}, [oe, fe, d, C]), be(() => {
|
|
4389
|
-
if (
|
|
4390
|
-
if (
|
|
4389
|
+
if (_e === ve.current.activeId) return;
|
|
4390
|
+
if (_e != null && ve.current.activeId == null) return void (ve.current.activeId = _e);
|
|
4391
4391
|
const ce = setTimeout(() => {
|
|
4392
|
-
ve.current.activeId =
|
|
4392
|
+
ve.current.activeId = _e;
|
|
4393
4393
|
}, 50);
|
|
4394
4394
|
return () => clearTimeout(ce);
|
|
4395
|
-
}, [
|
|
4396
|
-
if (ge ||
|
|
4395
|
+
}, [_e]), { active: _, activeIndex: g, attributes: O, data: q, rect: S, index: N, newIndex: fe, items: C, isOver: M, isSorting: oe, isDragging: I, listeners: ee, node: L, overIndex: A, over: y, setNodeRef: Se, setActivatorNodeRef: B, setDroppableNodeRef: D, setDraggableNodeRef: W, transform: ge ?? Fe, transition: function() {
|
|
4396
|
+
if (ge || Ge && ve.current.newIndex === N) return bs;
|
|
4397
4397
|
if (!(ae && !Co($) || !s) && (oe || De))
|
|
4398
4398
|
return sn.Transition.toString({ ...s, property: Hl });
|
|
4399
4399
|
}() };
|
|
@@ -4441,15 +4441,15 @@ const xs = [at.Down, at.Right, at.Up, at.Left], Ss = (e, t) => {
|
|
|
4441
4441
|
if (C === i?.id && s.length > 1 && (C = s[1].id), C != null) {
|
|
4442
4442
|
const d = o.get(n.id), g = o.get(C), R = g ? l.get(g.id) : null, b = g?.node.current;
|
|
4443
4443
|
if (b && R && d && g) {
|
|
4444
|
-
const E = xo(b).some((N, q) => c[q] !== N), A =
|
|
4445
|
-
return !wo(N) || !wo(q) || !
|
|
4444
|
+
const E = xo(b).some((N, q) => c[q] !== N), A = jr(d, g), U = function(N, q) {
|
|
4445
|
+
return !wo(N) || !wo(q) || !jr(N, q) ? !1 : N.data.current.sortable.index < q.data.current.sortable.index;
|
|
4446
4446
|
}(d, g), P = E || !A ? { x: 0, y: 0 } : { x: U ? r.width - R.width : 0, y: U ? r.height - R.height : 0 }, w = { x: R.left, y: R.top };
|
|
4447
|
-
return P.x && P.y ? w :
|
|
4447
|
+
return P.x && P.y ? w : _n(w, P);
|
|
4448
4448
|
}
|
|
4449
4449
|
}
|
|
4450
4450
|
}
|
|
4451
4451
|
};
|
|
4452
|
-
function
|
|
4452
|
+
function jr(e, t) {
|
|
4453
4453
|
return !(!wo(e) || !wo(t)) && e.data.current.sortable.containerId === t.data.current.sortable.containerId;
|
|
4454
4454
|
}
|
|
4455
4455
|
const ks = (e) => {
|
|
@@ -4458,7 +4458,7 @@ const ks = (e) => {
|
|
|
4458
4458
|
}, Rs = pt(vt((e, t) => {
|
|
4459
4459
|
const { children: n, style: r, className: l, index: o, editing: i, editable: c, selectedIndex: u, background: s, activeColor: C, borderColor: d, borderWidth: g, dragging: R, ...b } = e;
|
|
4460
4460
|
return Je("div", { ref: t, className: Vt(l), style: { ...r, display: "flex", flexDirection: "column", background: u === o ? "white" : s, minHeight: "0px", fontFamily: "inherit", fontSize: "16px", fontWeight: u === o ? "700" : "400", lineHeight: "1", letterSpacing: "0px", textTransform: "none", minWidth: "unset" }, ...b, children: [Je("div", { style: { flex: "1 1 100%", display: "flex", flexDirection: "row" }, children: [p("div", { style: { marginLeft: u === o ? "0px" : "-1px", marginTop: u === o ? "0px" : "4px", marginBottom: "0px", background: "grey", minWidth: "1px" } }), n, u === o ? p("div", { style: { marginLeft: "0px", marginTop: "0px", marginBottom: "0px", background: "grey", minWidth: "1px" } }) : p(bn, {})] }), p("div", { style: { flex: "1 1 100%", background: u === o && C ? C?.toCSS() : "none", minHeight: "2px" } })] });
|
|
4461
|
-
})), Wt = { Wrapper: "
|
|
4461
|
+
})), Wt = { Wrapper: "_Wrapper_6tyma_49", fadeIn: "_fadeIn_6tyma_65", dragOverlay: "_dragOverlay_6tyma_73", Item: "_Item_6tyma_93", withHandle: "_withHandle_6tyma_121", dragging: "_dragging_6tyma_131", disabled: "_disabled_6tyma_147" }, Pl = tt.memo(tt.forwardRef(({ color: e, dragOverlay: t, dragging: n, disabled: r, fadeIn: l, handle: o, height: i, index: c, listeners: u, onRemove: s, renderItem: C, sorting: d, style: g, transition: R, transform: b, value: E, wrapperStyle: A, ...U }, P) => {
|
|
4462
4462
|
be(() => {
|
|
4463
4463
|
if (t) return document.body.style.cursor = "grabbing", () => {
|
|
4464
4464
|
document.body.style.cursor = "";
|
|
@@ -4466,15 +4466,15 @@ const ks = (e) => {
|
|
|
4466
4466
|
}, [t]);
|
|
4467
4467
|
const w = C ? C({ dragOverlay: !!t, dragging: !!n, sorting: !!d, index: c, fadeIn: !!l, listeners: u, ref: P, style: g, transform: b, transition: R, value: E }) : p(bn, { children: E });
|
|
4468
4468
|
return p("div", { className: Vt("tab-item", Wt.Wrapper, l && Wt.fadeIn, d && Wt.sorting, t && Wt.dragOverlay), style: { ...A, transition: [R, A?.transition].filter(Boolean).join(", "), "--translate-x": b ? `${Math.round(b.x)}px` : void 0, "--translate-y": b ? `${Math.round(b.y)}px` : void 0, "--scale-x": b?.scaleX ? `${b.scaleX}` : void 0, "--scale-y": b?.scaleY ? `${b.scaleY}` : void 0, "--index": c }, ref: P, children: p("div", { className: Vt(Wt.Item, n && Wt.dragging, o && Wt.withHandle, t && Wt.dragOverlay, r && Wt.disabled, e && Wt.color, "dragging"), style: g, "data-cypress": "draggable-item", ...o ? void 0 : u, ...U, tabIndex: o ? void 0 : -1, children: w }) });
|
|
4469
|
-
})),
|
|
4469
|
+
})), Gr = { Row: "_Row_11qr0_1" }, Ts = pt(vt(({ children: e, horizontal: t, style: n }, r) => p("div", { ref: r, style: { ...n }, className: Vt(Gr.Row, t && Gr.horizontal), children: e }))), Ms = { ...Ol }, Ds = pt(vt((e, t) => {
|
|
4470
4470
|
const { className: n, activationConstraint: r, animateLayoutChanges: l, adjustScale: o = !1, collisionDetection: i = Aa, coordinateGetter: c = Ss, dropAnimation: u = Ms, getItemStyles: s = () => ({}), getNewIndex: C, handle: d = !1, items: g, onMove: R, isDisabled: b = () => !1, measuring: E, modifiers: A, renderItem: U, renderDivider: P, reorderItems: w = or, strategy: N = rr, style: q, useDragOverlay: v = !0, onDragStart: S, wrapperStyle: L = () => ({}) } = e, [M, D] = ue(() => g);
|
|
4471
4471
|
be(() => {
|
|
4472
4472
|
D(g);
|
|
4473
4473
|
}, [g]);
|
|
4474
|
-
const [
|
|
4474
|
+
const [_, $] = ue(null), V = function() {
|
|
4475
4475
|
for (var y = arguments.length, B = new Array(y), te = 0; te < y; te++) B[te] = arguments[te];
|
|
4476
4476
|
return ye(() => [...B].filter((Se) => Se != null), [...B]);
|
|
4477
|
-
}(Bo(El, { activationConstraint: r }), Bo(Al, { activationConstraint: r }), Bo(tr, { scrollBehavior: "Cypress" in window ? "auto" : void 0, coordinateGetter: c })), O = M.indexOf.bind(M), W =
|
|
4477
|
+
}(Bo(El, { activationConstraint: r }), Bo(Al, { activationConstraint: r }), Bo(tr, { scrollBehavior: "Cypress" in window ? "auto" : void 0, coordinateGetter: c })), O = M.indexOf.bind(M), W = _ ? O(_) : -1, ee = [];
|
|
4478
4478
|
M.map((y, B) => {
|
|
4479
4479
|
ee.push(p(Es, { id: y, handle: d, index: B, style: s, wrapperStyle: L, disabled: b(y), renderItem: U, animateLayoutChanges: l, useDragOverlay: v, getNewIndex: C }, y + "-" + B));
|
|
4480
4480
|
const te = P?.({ key: "divider-" + B });
|
|
@@ -4491,13 +4491,13 @@ const ks = (e) => {
|
|
|
4491
4491
|
}
|
|
4492
4492
|
}, onDragCancel: () => {
|
|
4493
4493
|
$(null);
|
|
4494
|
-
}, measuring: E, modifiers: A, children: [p("div", { style: { display: "flex", justifyContent: "flex-start", boxSizing: "border-box", ...q }, className: Vt(n, Wt.Wrapper), children: p(fs, { items: M, strategy: N, children: p(Ts, { ref: t, children: ee }) }) }), v ? il(p(hs, { adjustScale: o, dropAnimation: u, children:
|
|
4494
|
+
}, measuring: E, modifiers: A, children: [p("div", { style: { display: "flex", justifyContent: "flex-start", boxSizing: "border-box", ...q }, className: Vt(n, Wt.Wrapper), children: p(fs, { items: M, strategy: N, children: p(Ts, { ref: t, children: ee }) }) }), v ? il(p(hs, { adjustScale: o, dropAnimation: u, children: _ ? p(Pl, { value: M[W], handle: d, renderItem: U, wrapperStyle: L({ index: W, isDragging: !0, id: M[W] }), index: W, dragging: !0, style: s({ id: M[W], index: W, isSorting: _ !== null, isDragging: !0, overIndex: -1, isDragOverlay: !0 }), dragOverlay: !0 }) : null }), I()) : null] });
|
|
4495
4495
|
}));
|
|
4496
4496
|
function Es({ disabled: e, animateLayoutChanges: t, getNewIndex: n, handle: r, id: l, index: o, onRemove: i, style: c, renderItem: u, useDragOverlay: s, wrapperStyle: C }) {
|
|
4497
4497
|
const { attributes: d, isDragging: g, isSorting: R, listeners: b, overIndex: E, setNodeRef: A, transform: U, transition: P } = Cs({ id: l, animateLayoutChanges: t, disabled: e, getNewIndex: n });
|
|
4498
4498
|
return p(Pl, { ref: A, value: l, disabled: e, dragging: g, sorting: R, handle: r, renderItem: u, index: o, style: c({ index: o, id: l, isDragging: g, isSorting: R, overIndex: E }), onRemove: i ? () => i(l) : void 0, transform: U, transition: P, wrapperStyle: C({ index: o, isDragging: g, id: l }), listeners: b, "data-index": o, "data-id": l, dragOverlay: !s && g, ...d });
|
|
4499
4499
|
}
|
|
4500
|
-
const As = "
|
|
4500
|
+
const As = "_TabStrip_nciwy_1", Is = new Jr("rgb(33, 115, 70)"), zs = "#eee", Fs = (e) => p(Rs, { ...e }), Ns = pt(vt((e, t) => {
|
|
4501
4501
|
const { children: n, style: r, className: l, selectedTabIndex: o = 0, tabNames: i = [], onSelectedTabIndexChange: c, onTabNameChange: u, onTabMove: s, createScrollStartButton: C = si, createScrollEndButton: d = di, createScrollEdgeButton: g = ci, createTabButton: R = Fs, createTabDivider: b, editLabelProps: E, disabled: A = !1, disableDrag: U = !1, background: P = "white", activeColor: w = Is, borderColor: N = zs, borderWidth: q = 1 } = e, [v, S] = ue(o), [L, M] = ue(i), D = Ye((qe) => {
|
|
4502
4502
|
const Le = I.current?.[qe]?.closest(".tab-item") ?? I.current?.[qe];
|
|
4503
4503
|
Le && ae.current?.scrollTo({ top: Le.offsetTop, left: Le.offsetLeft, behavior: "smooth" });
|
|
@@ -4505,7 +4505,7 @@ const As = "_TabStrip_3x0dp_1", Is = new Jr("rgb(33, 115, 70)"), zs = "#eee", Fs
|
|
|
4505
4505
|
be(() => {
|
|
4506
4506
|
D(o);
|
|
4507
4507
|
}, [o]);
|
|
4508
|
-
const
|
|
4508
|
+
const _ = Ye((qe, Le) => {
|
|
4509
4509
|
Le !== v && (S(Le), c?.(Le)), D(Le);
|
|
4510
4510
|
}, [c, v]), $ = Ye((qe, Le) => {
|
|
4511
4511
|
s?.(qe, Le);
|
|
@@ -4524,37 +4524,37 @@ const As = "_TabStrip_3x0dp_1", Is = new Jr("rgb(33, 115, 70)"), zs = "#eee", Fs
|
|
|
4524
4524
|
I.current?.[qe]?.cancel();
|
|
4525
4525
|
} }, y.current), [v, O]);
|
|
4526
4526
|
const B = Ye(({ value: qe, index: Le, dragging: We }) => {
|
|
4527
|
-
const { style:
|
|
4527
|
+
const { style: Ze, maxLength: m, ...Ke } = E || {}, ct = p(qa, { ref: (Qe) => {
|
|
4528
4528
|
I.current[Le] = Qe;
|
|
4529
|
-
}, value: qe, disabled: A, maxLength: m, style: { color: v === Le && w ? w?.toRGBA().toString() : "inherit", flex: "1 1 100%", paddingTop: "1px", paddingBottom: "1px", ...
|
|
4529
|
+
}, value: qe, disabled: A, maxLength: m, style: { color: v === Le && w ? w?.toRGBA().toString() : "inherit", flex: "1 1 100%", paddingTop: "1px", paddingBottom: "1px", ...Ze }, styleHover: {}, onSubmit: (Qe) => (V.current = !1, W(-1), ee(Le, Qe)), onCancel: () => {
|
|
4530
4530
|
V.current = !1, W(-1);
|
|
4531
4531
|
}, onChange: (Qe) => {
|
|
4532
4532
|
V.current = !0, W(Le);
|
|
4533
4533
|
}, ...Ke });
|
|
4534
|
-
return R({ onClick: (Qe) =>
|
|
4535
|
-
}, [v, ee,
|
|
4534
|
+
return R({ onClick: (Qe) => _(Qe, Le), value: qe, index: Le, editing: O === Le && V.current, editable: !0, disabled: A, selectedIndex: v, background: P, activeColor: w, borderColor: N, borderWidth: q, dragging: We, children: ct });
|
|
4535
|
+
}, [v, ee, _, E, A, O, R]), [te, { width: Se }] = an(), [oe, { width: G }] = an(), ae = Te(null), [Ae, Fe] = ue({ left: 0, top: 0, width: 0, height: 0 }), [fe, _e] = ue(null);
|
|
4536
4536
|
be(() => {
|
|
4537
4537
|
fe !== null && ae.current && ae.current.scrollTo({ left: fe, behavior: "smooth" });
|
|
4538
4538
|
}, [fe]);
|
|
4539
4539
|
const ve = Ye((qe, Le = !1) => {
|
|
4540
4540
|
if (!ae.current) return 0;
|
|
4541
|
-
let We = ae.current.firstChild.getBoundingClientRect(),
|
|
4542
|
-
return m = Le ? 0 : sr.getScrollTo(qe, We.left,
|
|
4543
|
-
}, []),
|
|
4541
|
+
let We = ae.current.firstChild.getBoundingClientRect(), Ze = ae.current.firstChild.firstChild.children, m = 0;
|
|
4542
|
+
return m = Le ? 0 : sr.getScrollTo(qe, We.left, Ze, !0, Math.max(0, qe - 200)), _e(m), Math.max(0, m);
|
|
4543
|
+
}, []), Ge = Ye((qe, Le = !1) => {
|
|
4544
4544
|
if (!ae.current) return 0;
|
|
4545
|
-
let We = ae.current.firstChild.getBoundingClientRect(),
|
|
4546
|
-
const Ke = Math.ceil(
|
|
4547
|
-
return m = Le ? Ke : sr.getScrollTo(qe, We.left,
|
|
4548
|
-
}, [
|
|
4545
|
+
let We = ae.current.firstChild.getBoundingClientRect(), Ze = ae.current.firstChild.firstChild.children, m = 0;
|
|
4546
|
+
const Ke = Math.ceil(G - Se);
|
|
4547
|
+
return m = Le ? Ke : sr.getScrollTo(qe, We.left, Ze, !1, Math.max(0, qe + 200)), _e(m), Math.min(Ke, m);
|
|
4548
|
+
}, [G, Se]), De = Te(null), ge = Te(null), ce = Ye(() => {
|
|
4549
4549
|
ge.current && (clearTimeout(ge.current), ge.current = null, De.current = null);
|
|
4550
4550
|
}, []), ke = Ye((qe, Le, We = 260) => {
|
|
4551
4551
|
De.current = qe, ge.current = setTimeout(() => {
|
|
4552
|
-
const
|
|
4553
|
-
|
|
4552
|
+
const Ze = Le ? ve(De.current || qe) : Ge(De.current || qe);
|
|
4553
|
+
Ze !== De.current ? ke(Ze, Le, 120) : ce();
|
|
4554
4554
|
}, We);
|
|
4555
|
-
}, [ve,
|
|
4555
|
+
}, [ve, Ge, ce]);
|
|
4556
4556
|
be(() => () => ce(), [ce]);
|
|
4557
|
-
const de = ye(() => ({ style: { marginLeft: "4px", marginRight: "6px" }, disabled: Math.floor(
|
|
4557
|
+
const de = ye(() => ({ style: { marginLeft: "4px", marginRight: "6px" }, disabled: Math.floor(Ae.left) <= 0 || Math.floor(G - Se) === 0, orientation: rn.Horizontal, onMouseUp: ce, onMouseLeave: ce, onMouseDown: () => ke(ae.current.scrollLeft, !0), onClick: (qe) => ve(Math.min(ae.current.scrollLeft, fe ?? Number.MAX_SAFE_INTEGER), qe.ctrlKey) }), [Ae, fe, G, Se]), xe = ye(() => ({ style: { marginLeft: "6px", marginRight: "4px" }, disabled: Math.floor(G - Se) <= Math.ceil(Ae.left), orientation: rn.Horizontal, onMouseUp: ce, onMouseLeave: ce, onMouseDown: () => ke(ae.current.scrollLeft, !1), onClick: (qe) => Ge(Math.max(ae.current.scrollLeft, fe ?? 0), qe.ctrlKey) }), [Ae, fe, G, Se]), Oe = ye(() => Je(bn, { children: [p("div", { style: { minWidth: "16px" } }), n, g?.(de)] }), [de, xe, C, d, n, g]);
|
|
4558
4558
|
return Je("div", { style: { ...r, display: "flex", alignItems: "stretch" }, className: Vt(As, l), ref: y, children: [p("div", { style: { borderTop: `solid ${N} ${q}px`, position: "absolute", width: "100%" } }), p("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: Oe }), p("div", { className: "Tabs", ref: te, style: { flex: "1 1 100%", display: "flex", position: "relative", overflow: "hidden" }, children: p("div", { style: { position: "relative", overflowY: "hidden", overflowX: "hidden", marginBottom: "3px" }, ref: ae, onScroll: (qe) => {
|
|
4559
4559
|
Fe({ left: qe.target.scrollLeft, top: qe.target.scrollTop, width: qe.target.scrollWidth, height: qe.target.scrollHeight });
|
|
4560
4560
|
}, children: p(Ds, { isDisabled: (qe) => A || U, items: L, strategy: ps, modifiers: [ks], ref: oe, renderItem: B, renderDivider: b, onMove: $, activationConstraint: { distance: 15 } }) }) }), p("div", { style: { flex: "none", display: "flex", alignItems: "center" }, children: g(xe) })] });
|
|
@@ -4566,7 +4566,7 @@ const td = (e) => Je("svg", { ...e, viewBox: "0 0 48 48", children: [p("path", {
|
|
|
4566
4566
|
}, Td = () => {
|
|
4567
4567
|
const e = Xt(Wl), [t] = ue(() => new ti());
|
|
4568
4568
|
return ye(() => e || t, [e]);
|
|
4569
|
-
}, Ls = "_script-
|
|
4569
|
+
}, Ls = "_script-editor_faoxm_9", Os = tt.lazy(() => import("./Dd5Hw20mgcqmSzz-.mjs")), Vs = { 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" }, Zr = `
|
|
4570
4570
|
/**
|
|
4571
4571
|
* Placeholder for SheetXL scripting types.
|
|
4572
4572
|
*/
|
|
@@ -4698,14 +4698,14 @@ const Md = pt(vt((e, t) => {
|
|
|
4698
4698
|
if (!g.current) return null;
|
|
4699
4699
|
const y = g.current, B = y.editor;
|
|
4700
4700
|
if (!B) return null;
|
|
4701
|
-
const te = y.monaco, Se = await (async (oe,
|
|
4702
|
-
const
|
|
4703
|
-
if (!
|
|
4704
|
-
const Fe = await
|
|
4705
|
-
let ve = null,
|
|
4706
|
-
const De =
|
|
4707
|
-
for (let ge =
|
|
4708
|
-
const ce = lr(
|
|
4701
|
+
const te = y.monaco, Se = await (async (oe, G, ae = "export") => {
|
|
4702
|
+
const Ae = oe.getModel();
|
|
4703
|
+
if (!Ae) return null;
|
|
4704
|
+
const Fe = await G.languages.typescript.getTypeScriptWorker(), fe = await Fe(Ae.uri), _e = await fe.getNavigationTree(Ae.uri.toString());
|
|
4705
|
+
let ve = null, Ge = oe.getSelection();
|
|
4706
|
+
const De = Ge.startLineNumber === Ge.endLineNumber && Ge.startColumn === Ge.endColumn ? Ae.getLineCount() : Math.min(Ge.endLineNumber, Ae.getLineCount());
|
|
4707
|
+
for (let ge = Ge.startLineNumber; !ve && ge <= De; ge++) {
|
|
4708
|
+
const ce = lr(_e, Ae.getOffsetAt({ lineNumber: ge, column: 1 }), "function", ae);
|
|
4709
4709
|
ce && (ve = ce.text);
|
|
4710
4710
|
}
|
|
4711
4711
|
return ve;
|
|
@@ -4713,21 +4713,21 @@ const Md = pt(vt((e, t) => {
|
|
|
4713
4713
|
return C?.({ message: (Se ?? "").toUpperCase() }), Se ? { source: B.getValue(), name: Se } : null;
|
|
4714
4714
|
}, [C]), M = ie(async (y, B, te) => {
|
|
4715
4715
|
const Se = await w.getScripts().createModule({ source: te?.getValue(), declarationsOnly: !0 }), oe = Se ? Se.getFunctions().search() : ot.EmptyArray;
|
|
4716
|
-
Se && (async function(
|
|
4717
|
-
const
|
|
4718
|
-
for (let Fe = 1; Fe <
|
|
4719
|
-
const fe = { startLineNumber: Fe, startColumn: 1, endLineNumber: Fe, endColumn:
|
|
4720
|
-
|
|
4716
|
+
Se && (async function(G, ae) {
|
|
4717
|
+
const Ae = [];
|
|
4718
|
+
for (let Fe = 1; Fe < G.getLineCount() + 1; Fe++) {
|
|
4719
|
+
const fe = { startLineNumber: Fe, startColumn: 1, endLineNumber: Fe, endColumn: G.getLineLength(Fe) + 1 }, _e = G.getValueInRange(fe).indexOf("modelt");
|
|
4720
|
+
_e !== -1 && Ae.push({ message: "found 'modelt'", resource: "https://www.sheetxl.com", severity: ae.MarkerSeverity.Hint, startLineNumber: fe.startLineNumber, startColumn: _e + 1, endLineNumber: fe.startLineNumber, endColumn: _e + 5 });
|
|
4721
4721
|
}
|
|
4722
|
-
ae.editor.setModelMarkers(
|
|
4723
|
-
}(y, B), async function(
|
|
4724
|
-
const fe = await ae.languages.typescript.getTypeScriptWorker(),
|
|
4722
|
+
ae.editor.setModelMarkers(G, "owner", Ae);
|
|
4723
|
+
}(y, B), async function(G, ae, Ae, Fe) {
|
|
4724
|
+
const fe = await ae.languages.typescript.getTypeScriptWorker(), _e = await fe(G.uri), ve = await _e.getNavigationTree(G.uri.toString()), Ge = Xo(G, ae, Fe, ve).map((De) => {
|
|
4725
4725
|
let ge = null, ce = null;
|
|
4726
4726
|
return De.type === "formula" ? (ge = "formula.margin-icon", ce = "Formula") : De.type === "macro" ? (ge = "macro.margin-icon", ce = "Macro") : De.type === "autoRun" && (ge = "autorun.margin-icon", ce = "Auto Run"), { range: new ae.Range(De.lineNumber, 1, De.lineNumber, 1), options: { isWholeLine: !1, glyphMarginClassName: ge, glyphMarginHoverMessage: ce, stickiness: ae.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } };
|
|
4727
4727
|
});
|
|
4728
|
-
V.current && V.current.clear(), V.current =
|
|
4728
|
+
V.current && V.current.clear(), V.current = Ae.createDecorationsCollection(Ge);
|
|
4729
4729
|
}(y, B, te, oe));
|
|
4730
|
-
}, [w]), D = ie(ot.debounce(M, 580), []),
|
|
4730
|
+
}, [w]), D = ie(ot.debounce(M, 580), []), _ = ie(async (y = void 0) => {
|
|
4731
4731
|
if (!g.current || !w) return;
|
|
4732
4732
|
const B = g.current.editor.getPosition(), te = { cursor: B ? B.toString() : "" };
|
|
4733
4733
|
y !== void 0 && (te.message = y), C?.(te);
|
|
@@ -4742,10 +4742,10 @@ const Md = pt(vt((e, t) => {
|
|
|
4742
4742
|
w.setEditor(y), w.setSelectedFunction(L());
|
|
4743
4743
|
const B = w.addContainerListener({ onBeforeSave: async () => {
|
|
4744
4744
|
if (!g.current?.editor || !w) return;
|
|
4745
|
-
const te = g.current.editor, Se = w?.getScripts().getModules().getByName("scripting"), oe = Se?.getSource(),
|
|
4746
|
-
if (!((oe?.length ?? 0) !==
|
|
4745
|
+
const te = g.current.editor, Se = w?.getScripts().getModules().getByName("scripting"), oe = Se?.getSource(), G = te.getValue();
|
|
4746
|
+
if (!((oe?.length ?? 0) !== G.length || oe !== G)) return;
|
|
4747
4747
|
await w.saveSource(te.getValue());
|
|
4748
|
-
const ae = (oe?.length ?? 0) !==
|
|
4748
|
+
const ae = (oe?.length ?? 0) !== G.length || oe !== G;
|
|
4749
4749
|
C?.({ dirty: ae });
|
|
4750
4750
|
}, onReadonlyChange() {
|
|
4751
4751
|
}, onScriptChange: async () => {
|
|
@@ -4767,33 +4767,33 @@ const Md = pt(vt((e, t) => {
|
|
|
4767
4767
|
const te = B.editor;
|
|
4768
4768
|
return !!te && (te.focus(), !0);
|
|
4769
4769
|
}, []), V = Te(null), O = ie((y, B) => {
|
|
4770
|
-
g.current = { monaco: B, editor: y }, S(!0),
|
|
4770
|
+
g.current = { monaco: B, editor: y }, S(!0), _("Loading Types");
|
|
4771
4771
|
const te = w.getScripts().getModules().search()[0]?.getSource() ?? "";
|
|
4772
|
-
y.setValue(te), import("./
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
} }).then(async (
|
|
4772
|
+
y.setValue(te), import("./EDdXuzJXIj6ZJJDu.mjs").then((oe) => oe.c).then((oe) => {
|
|
4773
|
+
_(""), oe.AutoTypings.create(y, { shareCache: !0, monaco: B, onError: (G) => {
|
|
4774
|
+
G === "Not implemented yet" && (G = "Compile Errors"), console.warn("Error compiling types", G);
|
|
4775
|
+
} }).then(async (G) => {
|
|
4776
4776
|
const ae = y.getModel();
|
|
4777
4777
|
D(ae, B, y);
|
|
4778
4778
|
});
|
|
4779
|
-
}), y.addCommand("executeScript", function(oe, ...
|
|
4780
|
-
|
|
4779
|
+
}), y.addCommand("executeScript", function(oe, ...G) {
|
|
4780
|
+
G?.[0] && N({ functionName: G?.[0] });
|
|
4781
4781
|
}, ""), y.addAction({ id: "executeScript", label: "Execute", keybindings: [B.KeyCode.F8], run: async (oe) => {
|
|
4782
|
-
const
|
|
4783
|
-
w.setSelectedFunction(
|
|
4784
|
-
const ae = await
|
|
4782
|
+
const G = L();
|
|
4783
|
+
w.setSelectedFunction(G);
|
|
4784
|
+
const ae = await G;
|
|
4785
4785
|
N(ae);
|
|
4786
4786
|
} }), y.addAction({ id: "saveScript", label: "Save Script", keybindings: [B.KeyMod.CtrlCmd | B.KeyCode.KeyS], run: (oe) => {
|
|
4787
4787
|
w?.saveSource(y.getValue()).then(() => {
|
|
4788
|
-
const
|
|
4788
|
+
const G = w?.getScripts().getModules().getByName("scripting"), ae = G?.getSource(), Ae = y.getValue(), Fe = (ae?.length ?? 0) !== Ae.length || ae !== Ae;
|
|
4789
4789
|
C?.({ dirty: Fe });
|
|
4790
4790
|
});
|
|
4791
4791
|
} }), y.onMouseDown(async (oe) => {
|
|
4792
4792
|
if (oe.target.type === B.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
4793
|
-
const
|
|
4793
|
+
const G = oe.target.position.lineNumber, ae = await B.languages.typescript.getTypeScriptWorker(), Ae = await ae(Se.uri), Fe = await Ae.getNavigationTree(Se.uri.toString()), fe = y?.getValue(), _e = (await w?.saveSource(fe)).getFunctions().search(), ve = Xo(Se, B, _e, Fe).find((Ge) => Ge.lineNumber === G);
|
|
4794
4794
|
if (ve) {
|
|
4795
|
-
const
|
|
4796
|
-
|
|
4795
|
+
const Ge = oe.event.browserEvent.button;
|
|
4796
|
+
Ge === 0 ? ve.type === "macro" || ve.type === "autoRun" ? N({ functionName: ve.name }) : ve.type === "formula" && w.quickInsertFunction?.(ve.name) : Ge === 2 && (console.log("Context menu for function:", ve.name), oe.event.browserEvent.preventDefault());
|
|
4797
4797
|
}
|
|
4798
4798
|
}
|
|
4799
4799
|
}), y.onDidChangeModelContent(() => {
|
|
@@ -4801,21 +4801,21 @@ const Md = pt(vt((e, t) => {
|
|
|
4801
4801
|
D(oe, B, y);
|
|
4802
4802
|
});
|
|
4803
4803
|
const Se = y.getModel();
|
|
4804
|
-
(function(oe,
|
|
4805
|
-
|
|
4804
|
+
(function(oe, G) {
|
|
4805
|
+
G.languages.registerInlayHintsProvider("typescript", { provideInlayHints(ae, Ae, Fe) {
|
|
4806
4806
|
const fe = [];
|
|
4807
|
-
for (let
|
|
4808
|
-
const ve = { startLineNumber:
|
|
4809
|
-
De !== -1 && fe.push({ kind:
|
|
4807
|
+
for (let _e = 1; _e < ae.getLineCount() + 1; _e++) {
|
|
4808
|
+
const ve = { startLineNumber: _e, startColumn: 1, endLineNumber: _e, endColumn: ae.getLineLength(_e) + 1 }, Ge = "hint", De = ae.getValueInRange(ve).indexOf("hint");
|
|
4809
|
+
De !== -1 && fe.push({ kind: G.languages.InlayHintKind.Type, position: { lineNumber: ve.startLineNumber, column: De + Ge.length + 1 }, label: "[hint]" });
|
|
4810
4810
|
}
|
|
4811
4811
|
return { hints: fe, dispose: () => {
|
|
4812
4812
|
} };
|
|
4813
4813
|
} });
|
|
4814
4814
|
})(0, B), Se.onDidChangeContent((oe) => {
|
|
4815
|
-
const
|
|
4815
|
+
const G = w?.getScripts().getModules().getByName("scripting"), ae = G?.getSource(), Ae = y.getValue(), Fe = (ae?.length ?? 0) !== Ae.length || ae !== Ae;
|
|
4816
4816
|
C?.({ dirty: Fe });
|
|
4817
4817
|
}), y.onDidChangeCursorPosition((oe) => {
|
|
4818
|
-
|
|
4818
|
+
_();
|
|
4819
4819
|
});
|
|
4820
4820
|
}, [w, C]), W = ye(() => v ? null : u || p("div", { style: { position: "absolute", width: "100%", height: "100%" }, children: "Loading..." }), [v, u]), ee = ye(() => {
|
|
4821
4821
|
const y = w?.getScripts().getModules().getByName("scripting")?.getSource() ?? "";
|
|
@@ -4828,16 +4828,16 @@ const Md = pt(vt((e, t) => {
|
|
|
4828
4828
|
try {
|
|
4829
4829
|
const oe = await (async () => {
|
|
4830
4830
|
try {
|
|
4831
|
-
return await (await fetch("
|
|
4832
|
-
} catch {
|
|
4833
|
-
return console.warn("Fallback to global types"),
|
|
4831
|
+
return await (await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/index.d.ts")).text();
|
|
4832
|
+
} catch (Ae) {
|
|
4833
|
+
return console.warn("Fallback to global types for:", "production", Ae), Zr;
|
|
4834
4834
|
}
|
|
4835
|
-
})(),
|
|
4835
|
+
})(), G = B.Uri.parse('inmemory://model/"sheetxl-models".d.ts'), ae = B.editor.createModel(oe, "typescript", G);
|
|
4836
4836
|
B.editor.setModelMarkers(ae, "default", []), te = !0;
|
|
4837
4837
|
} catch (oe) {
|
|
4838
4838
|
console.warn("cant load types", oe);
|
|
4839
4839
|
}
|
|
4840
|
-
te && (B.languages.typescript.typescriptDefaults.addExtraLib(
|
|
4840
|
+
te && (B.languages.typescript.typescriptDefaults.addExtraLib(Zr, "global.d.ts"), B.languages.typescript.typescriptDefaults.addExtraLib(`
|
|
4841
4841
|
declare module '@sheetxl/primitives' {
|
|
4842
4842
|
/** Interface defining the methods available on the formula context. */
|
|
4843
4843
|
|
|
@@ -4888,14 +4888,14 @@ declare module '@sheetxl/primitives' {
|
|
|
4888
4888
|
export type FormulaError = any;
|
|
4889
4889
|
|
|
4890
4890
|
} // End declare module
|
|
4891
|
-
`, "primitives.d.ts")), B.languages.registerLinkProvider("*", { provideLinks: (oe,
|
|
4892
|
-
const ae = [],
|
|
4891
|
+
`, "primitives.d.ts")), B.languages.registerLinkProvider("*", { provideLinks: (oe, G) => {
|
|
4892
|
+
const ae = [], Ae = { links: ae }, Fe = oe.getLinesContent();
|
|
4893
4893
|
for (let fe = 1; fe <= Fe.length; fe++) {
|
|
4894
|
-
const
|
|
4895
|
-
for (let
|
|
4896
|
-
const De = ve[0]?.[
|
|
4894
|
+
const _e = Fe[fe - 1], ve = B.editor.tokenize(_e, "typescript");
|
|
4895
|
+
for (let Ge = 0; Ge < ve[0].length; Ge++) {
|
|
4896
|
+
const De = ve[0]?.[Ge];
|
|
4897
4897
|
if (De && De.type.startsWith("string")) {
|
|
4898
|
-
let ge = De.offset, ce = ve[0]?.[
|
|
4898
|
+
let ge = De.offset, ce = ve[0]?.[Ge + 1]?.offset ?? _e.length, ke = new B.Range(fe, ge + 1, fe, ce + 1), de = oe.getValueInRange(ke);
|
|
4899
4899
|
const xe = de[0];
|
|
4900
4900
|
xe !== "`" && xe !== "'" && xe !== '"' || (ge++, de = de.substring(1));
|
|
4901
4901
|
const Oe = de[de.length - 1];
|
|
@@ -4908,13 +4908,13 @@ declare module '@sheetxl/primitives' {
|
|
|
4908
4908
|
}
|
|
4909
4909
|
}
|
|
4910
4910
|
}
|
|
4911
|
-
return
|
|
4911
|
+
return Ae;
|
|
4912
4912
|
} }), B.editor.registerLinkOpener({ open(oe) {
|
|
4913
4913
|
if (oe?.path?.startsWith("/range/")) {
|
|
4914
4914
|
try {
|
|
4915
4915
|
w.getRanges(oe.path.substring(7))?.select();
|
|
4916
|
-
} catch (
|
|
4917
|
-
console.warn("invalid range",
|
|
4916
|
+
} catch (G) {
|
|
4917
|
+
console.warn("invalid range", G);
|
|
4918
4918
|
}
|
|
4919
4919
|
return !0;
|
|
4920
4920
|
}
|
|
@@ -4926,7 +4926,7 @@ declare module '@sheetxl/primitives' {
|
|
|
4926
4926
|
}), B.languages.typescript.typescriptDefaults.setDiagnosticsOptions({ noSemanticValidation: !1, noSyntaxValidation: !1 }), S(!0);
|
|
4927
4927
|
})();
|
|
4928
4928
|
}, onMount: O }) }), W] });
|
|
4929
|
-
}, [w, U, o, W, c]), I =
|
|
4929
|
+
}, [w, U, o, W, c]), I = jt(t, () => ({ isScriptEditorElement: () => !0, focus: (y) => {
|
|
4930
4930
|
$(y);
|
|
4931
4931
|
}, close: () => {
|
|
4932
4932
|
R?.();
|
|
@@ -4967,7 +4967,7 @@ export {
|
|
|
4967
4967
|
yd as ChartScatterMarkersIcon,
|
|
4968
4968
|
Qs as CommandContext,
|
|
4969
4969
|
dr as CornerTriangle,
|
|
4970
|
-
|
|
4970
|
+
Zs as DateUtils,
|
|
4971
4971
|
Wl as DocThemesContext,
|
|
4972
4972
|
Rd as DocThemesProvider,
|
|
4973
4973
|
qa as EditableLabel,
|