@svgrid/enterprise 3.0.1 → 3.0.3

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.
Files changed (445) hide show
  1. package/LICENSE +94 -24
  2. package/README.md +36 -4
  3. package/dist/SvAdvancedFilter.svelte +1 -1
  4. package/dist/SvAlertsManager.svelte +2 -1
  5. package/dist/SvBoard.svelte +2 -1
  6. package/dist/SvExportMenu.svelte +4 -1
  7. package/dist/SvExportMenu.svelte.d.ts +0 -13
  8. package/dist/SvExpressionEditor.svelte +3 -3
  9. package/dist/SvFormulaBar.svelte +680 -0
  10. package/dist/SvFormulaBar.svelte.d.ts +69 -0
  11. package/dist/SvGridAlerts.svelte +49 -9
  12. package/dist/SvGridBoard.svelte +13 -8
  13. package/dist/SvGridBulkEditDrawer.svelte +26 -2
  14. package/dist/SvGridEditPanel.svelte +3 -0
  15. package/dist/SvGridScheduler.svelte +69 -40
  16. package/dist/SvGridSelectionBar.svelte +10 -3
  17. package/dist/SvPivotDesigner.svelte +263 -54
  18. package/dist/SvPivotDesigner.svelte.d.ts +27 -20
  19. package/dist/SvRibbonIcon.svelte +46 -0
  20. package/dist/SvRibbonIcon.svelte.d.ts +17 -0
  21. package/dist/SvSchemaChart.svelte +4 -2
  22. package/dist/SvSheet.svelte +7914 -0
  23. package/dist/SvSheet.svelte.d.ts +215 -0
  24. package/dist/SvSheetChartSetup.svelte +151 -0
  25. package/dist/SvSheetChartSetup.svelte.d.ts +18 -0
  26. package/dist/SvSheetComment.svelte +283 -0
  27. package/dist/SvSheetComment.svelte.d.ts +22 -0
  28. package/dist/SvSheetConditionalFormat.svelte +159 -0
  29. package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
  30. package/dist/SvSheetDataValidation.svelte +273 -0
  31. package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
  32. package/dist/SvSheetEditRanges.svelte +217 -0
  33. package/dist/SvSheetEditRanges.svelte.d.ts +15 -0
  34. package/dist/SvSheetErrors.svelte +125 -0
  35. package/dist/SvSheetErrors.svelte.d.ts +20 -0
  36. package/dist/SvSheetEvaluate.svelte +133 -0
  37. package/dist/SvSheetEvaluate.svelte.d.ts +15 -0
  38. package/dist/SvSheetFilterMenu.svelte +320 -0
  39. package/dist/SvSheetFilterMenu.svelte.d.ts +22 -0
  40. package/dist/SvSheetFindReplace.svelte +132 -0
  41. package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
  42. package/dist/SvSheetFormatCells.svelte +465 -0
  43. package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
  44. package/dist/SvSheetGoalSeek.svelte +145 -0
  45. package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
  46. package/dist/SvSheetInsertFunction.svelte +149 -0
  47. package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
  48. package/dist/SvSheetIteration.svelte +81 -0
  49. package/dist/SvSheetIteration.svelte.d.ts +10 -0
  50. package/dist/SvSheetLink.svelte +99 -0
  51. package/dist/SvSheetLink.svelte.d.ts +17 -0
  52. package/dist/SvSheetListPicker.svelte +91 -0
  53. package/dist/SvSheetListPicker.svelte.d.ts +10 -0
  54. package/dist/SvSheetManageRules.svelte +187 -0
  55. package/dist/SvSheetManageRules.svelte.d.ts +16 -0
  56. package/dist/SvSheetNameManager.svelte +227 -0
  57. package/dist/SvSheetNameManager.svelte.d.ts +11 -0
  58. package/dist/SvSheetPageSetup.svelte +159 -0
  59. package/dist/SvSheetPageSetup.svelte.d.ts +13 -0
  60. package/dist/SvSheetPasteSpecial.svelte +107 -0
  61. package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
  62. package/dist/SvSheetPivot.svelte +220 -0
  63. package/dist/SvSheetPivot.svelte.d.ts +21 -0
  64. package/dist/SvSheetProtectSheet.svelte +81 -0
  65. package/dist/SvSheetProtectSheet.svelte.d.ts +11 -0
  66. package/dist/SvSheetRemoveDuplicates.svelte +152 -0
  67. package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
  68. package/dist/SvSheetRibbon.svelte +1254 -0
  69. package/dist/SvSheetRibbon.svelte.d.ts +34 -0
  70. package/dist/SvSheetSizeDialog.svelte +60 -0
  71. package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
  72. package/dist/SvSheetSort.svelte +218 -0
  73. package/dist/SvSheetSort.svelte.d.ts +28 -0
  74. package/dist/SvSheetSparklines.svelte +135 -0
  75. package/dist/SvSheetSparklines.svelte.d.ts +14 -0
  76. package/dist/SvSheetTable.svelte +160 -0
  77. package/dist/SvSheetTable.svelte.d.ts +24 -0
  78. package/dist/SvSheetTabs.svelte +571 -0
  79. package/dist/SvSheetTabs.svelte.d.ts +50 -0
  80. package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
  81. package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
  82. package/dist/SvSheetTextToColumns.svelte +172 -0
  83. package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
  84. package/dist/SvSheetValidationAlert.svelte +85 -0
  85. package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
  86. package/dist/advanced-filter-enable.js +1 -1
  87. package/dist/alerts/alert-engine.d.ts +6 -0
  88. package/dist/alerts/alert-engine.js +21 -4
  89. package/dist/alerts/alert-formats.js +2 -0
  90. package/dist/alerts/alert-types.d.ts +1 -1
  91. package/dist/alerts.d.ts +1 -1
  92. package/dist/alerts.js +2 -2
  93. package/dist/board.js +2 -2
  94. package/dist/bulk-edit.d.ts +3 -1
  95. package/dist/bulk-edit.js +1 -1
  96. package/dist/cdn/svgrid-enterprise.svelte-external.js +43538 -6539
  97. package/dist/designer/assets/GridMenus-8gTNssgV.js +8 -0
  98. package/dist/designer/assets/SvChartMenu-BDoeqGz6.js +1 -0
  99. package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
  100. package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
  101. package/dist/designer/assets/SvDateTimePicker-DCPg7WGN.js +1 -0
  102. package/dist/designer/assets/SvGridCellEditor-DMoWJjEI.js +4 -0
  103. package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
  104. package/dist/designer/assets/SvGridChart-Cy1ATrWh.js +3 -0
  105. package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
  106. package/dist/designer/assets/SvGridChartBuilder-eQ3mn0L9.js +1 -0
  107. package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
  108. package/dist/designer/assets/SvGridChartPanel-CATdVc9X.js +4 -0
  109. package/dist/designer/assets/{SvGridChartView-DUc-1RUf.css → SvGridChartView-7msfnWZT.css} +1 -1
  110. package/dist/designer/assets/SvGridChartView-CmsZtCED.js +1 -0
  111. package/dist/designer/assets/SvGridDropdown-Cjz0H-fI.js +1 -0
  112. package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
  113. package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
  114. package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
  115. package/dist/designer/assets/SvTabs-2mHC6oaz.js +1 -0
  116. package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
  117. package/dist/designer/assets/cell-formatting-BbubJTVz.js +1 -0
  118. package/dist/designer/assets/chart-Cn7MnNqA.js +1 -0
  119. package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
  120. package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
  121. package/dist/designer/assets/chart-panel-messages-Dz7PTIqT.js +1 -0
  122. package/dist/designer/assets/chart-summary-BD1qYB2R.js +1 -0
  123. package/dist/designer/assets/chart-trend-B8xr5LuD.js +1 -0
  124. package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
  125. package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
  126. package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
  127. package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
  128. package/dist/designer/assets/{dismissable-BO547MH9.js → dismissable-ChWRPkoa.js} +1 -1
  129. package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
  130. package/dist/designer/assets/{export-format-D-eP4b2l.js → export-format-DGckmgKr.js} +1 -1
  131. package/dist/designer/assets/focus-trap-V2-6Fy9I.js +1 -0
  132. package/dist/designer/assets/{index-C_a9Cj8Y.js → index-D5bVbuzI.js} +318 -315
  133. package/dist/designer/assets/index-_JVFxt02.css +1 -0
  134. package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
  135. package/dist/designer/assets/row-resize-BInFWCpr.js +1 -0
  136. package/dist/designer/assets/server-block-cache-CXJKkJpy.js +1 -0
  137. package/dist/designer/assets/src-CITpcm6b.js +1 -0
  138. package/dist/designer/assets/src-DUQ4xE3x.js +58 -0
  139. package/dist/designer/assets/validate-C3B8QKsM.js +1 -0
  140. package/dist/designer/index.html +29 -19
  141. package/dist/export-pdf.d.ts +164 -0
  142. package/dist/export-pdf.js +346 -15
  143. package/dist/export.js +25 -10
  144. package/dist/gantt/SvGridGantt.svelte +2890 -0
  145. package/dist/gantt/SvGridGantt.svelte.d.ts +30 -0
  146. package/dist/gantt/gantt-config.d.ts +73 -0
  147. package/dist/gantt/gantt-config.js +1 -0
  148. package/dist/gantt/gantt-critical-path.d.ts +67 -0
  149. package/dist/gantt/gantt-critical-path.js +207 -0
  150. package/dist/gantt/gantt-model.d.ts +257 -0
  151. package/dist/gantt/gantt-model.js +651 -0
  152. package/dist/gantt/gantt-resources.d.ts +59 -0
  153. package/dist/gantt/gantt-resources.js +71 -0
  154. package/dist/gantt/gantt.d.ts +7 -0
  155. package/dist/gantt/gantt.js +36 -0
  156. package/dist/gantt/index.d.ts +15 -0
  157. package/dist/gantt/index.js +22 -0
  158. package/dist/gantt/timeline-arrows.d.ts +102 -0
  159. package/dist/gantt/timeline-arrows.js +181 -0
  160. package/dist/import.d.ts +2 -2
  161. package/dist/import.js +1 -1
  162. package/dist/index.d.ts +93 -3
  163. package/dist/index.js +107 -3
  164. package/dist/install.js +13 -1
  165. package/dist/license-core.d.ts +17 -1
  166. package/dist/license-core.js +16 -5
  167. package/dist/license.d.ts +18 -2
  168. package/dist/license.js +71 -6
  169. package/dist/node/studio.js +203 -9
  170. package/dist/pivot-chart.d.ts +25 -1
  171. package/dist/pivot-chart.js +25 -69
  172. package/dist/pivot-enable.js +2 -2
  173. package/dist/scheduler-dependencies.d.ts +35 -0
  174. package/dist/scheduler-dependencies.js +36 -1
  175. package/dist/scheduler.js +2 -2
  176. package/dist/selection-bar.js +2 -2
  177. package/dist/server/SvGroupCell.svelte +213 -0
  178. package/dist/server/SvGroupCell.svelte.d.ts +62 -0
  179. package/dist/server/SvRowGroupPanel.svelte +322 -0
  180. package/dist/server/SvRowGroupPanel.svelte.d.ts +37 -0
  181. package/dist/server/enable.d.ts +17 -0
  182. package/dist/server/enable.js +49 -0
  183. package/dist/server/index.d.ts +22 -0
  184. package/dist/server/index.js +24 -0
  185. package/dist/server/messages.d.ts +45 -0
  186. package/dist/server/messages.js +35 -0
  187. package/dist/server/server-group-model.d.ts +104 -0
  188. package/dist/server/server-group-model.js +272 -0
  189. package/dist/server/server-pivot.d.ts +46 -0
  190. package/dist/server/server-pivot.js +57 -0
  191. package/dist/server/server-row-model.d.ts +547 -0
  192. package/dist/server/server-row-model.js +1551 -0
  193. package/dist/server/server-selection.d.ts +99 -0
  194. package/dist/server/server-selection.js +215 -0
  195. package/dist/server/svgrid-adapter.d.ts +155 -0
  196. package/dist/server/svgrid-adapter.js +202 -0
  197. package/dist/sheet/address.d.ts +43 -0
  198. package/dist/sheet/address.js +81 -0
  199. package/dist/sheet/ast.d.ts +138 -0
  200. package/dist/sheet/ast.js +70 -0
  201. package/dist/sheet/auto-filter.d.ts +120 -0
  202. package/dist/sheet/auto-filter.js +295 -0
  203. package/dist/sheet/autocomplete.d.ts +51 -0
  204. package/dist/sheet/autocomplete.js +248 -0
  205. package/dist/sheet/cell-images.d.ts +39 -0
  206. package/dist/sheet/cell-images.js +90 -0
  207. package/dist/sheet/cell-types.d.ts +58 -0
  208. package/dist/sheet/cell-types.js +96 -0
  209. package/dist/sheet/coerce.d.ts +71 -0
  210. package/dist/sheet/coerce.js +289 -0
  211. package/dist/sheet/commands.d.ts +89 -0
  212. package/dist/sheet/commands.js +230 -0
  213. package/dist/sheet/comments.d.ts +63 -0
  214. package/dist/sheet/comments.js +131 -0
  215. package/dist/sheet/conditional-formats.d.ts +167 -0
  216. package/dist/sheet/conditional-formats.js +341 -0
  217. package/dist/sheet/csv.d.ts +32 -0
  218. package/dist/sheet/csv.js +158 -0
  219. package/dist/sheet/culture.d.ts +87 -0
  220. package/dist/sheet/culture.js +247 -0
  221. package/dist/sheet/delta.d.ts +102 -0
  222. package/dist/sheet/delta.js +203 -0
  223. package/dist/sheet/deps.d.ts +104 -0
  224. package/dist/sheet/deps.js +274 -0
  225. package/dist/sheet/document.d.ts +252 -0
  226. package/dist/sheet/document.js +465 -0
  227. package/dist/sheet/edit-keys.d.ts +14 -0
  228. package/dist/sheet/edit-keys.js +40 -0
  229. package/dist/sheet/engine.d.ts +67 -0
  230. package/dist/sheet/engine.js +19 -0
  231. package/dist/sheet/entry.d.ts +35 -0
  232. package/dist/sheet/entry.js +226 -0
  233. package/dist/sheet/error-check.d.ts +49 -0
  234. package/dist/sheet/error-check.js +83 -0
  235. package/dist/sheet/evaluate-steps.d.ts +48 -0
  236. package/dist/sheet/evaluate-steps.js +196 -0
  237. package/dist/sheet/evaluate.d.ts +128 -0
  238. package/dist/sheet/evaluate.js +1049 -0
  239. package/dist/sheet/filter-files.d.ts +37 -0
  240. package/dist/sheet/filter-files.js +465 -0
  241. package/dist/sheet/find-replace.d.ts +62 -0
  242. package/dist/sheet/find-replace.js +152 -0
  243. package/dist/sheet/format-store.d.ts +114 -0
  244. package/dist/sheet/format-store.js +243 -0
  245. package/dist/sheet/freeze.d.ts +54 -0
  246. package/dist/sheet/freeze.js +58 -0
  247. package/dist/sheet/from-rows.d.ts +14 -0
  248. package/dist/sheet/from-rows.js +50 -0
  249. package/dist/sheet/function-catalog.d.ts +10 -0
  250. package/dist/sheet/function-catalog.js +385 -0
  251. package/dist/sheet/functions.d.ts +28 -0
  252. package/dist/sheet/functions.js +634 -0
  253. package/dist/sheet/goal-seek.d.ts +73 -0
  254. package/dist/sheet/goal-seek.js +153 -0
  255. package/dist/sheet/index.d.ts +80 -0
  256. package/dist/sheet/index.js +80 -0
  257. package/dist/sheet/links.d.ts +57 -0
  258. package/dist/sheet/links.js +174 -0
  259. package/dist/sheet/merges.d.ts +71 -0
  260. package/dist/sheet/merges.js +137 -0
  261. package/dist/sheet/messages.d.ts +778 -0
  262. package/dist/sheet/messages.js +806 -0
  263. package/dist/sheet/names.d.ts +31 -0
  264. package/dist/sheet/names.js +87 -0
  265. package/dist/sheet/navigate.d.ts +52 -0
  266. package/dist/sheet/navigate.js +135 -0
  267. package/dist/sheet/number-format.d.ts +110 -0
  268. package/dist/sheet/number-format.js +905 -0
  269. package/dist/sheet/objects.d.ts +106 -0
  270. package/dist/sheet/objects.js +149 -0
  271. package/dist/sheet/ods-document.d.ts +44 -0
  272. package/dist/sheet/ods-document.js +1275 -0
  273. package/dist/sheet/open-file.d.ts +26 -0
  274. package/dist/sheet/open-file.js +56 -0
  275. package/dist/sheet/outline.d.ts +82 -0
  276. package/dist/sheet/outline.js +228 -0
  277. package/dist/sheet/packs/array.d.ts +16 -0
  278. package/dist/sheet/packs/array.js +172 -0
  279. package/dist/sheet/packs/database.d.ts +42 -0
  280. package/dist/sheet/packs/database.js +142 -0
  281. package/dist/sheet/packs/engineering.d.ts +2 -0
  282. package/dist/sheet/packs/engineering.js +296 -0
  283. package/dist/sheet/packs/financial.d.ts +5 -0
  284. package/dist/sheet/packs/financial.js +220 -0
  285. package/dist/sheet/packs/math-stats.d.ts +2 -0
  286. package/dist/sheet/packs/math-stats.js +372 -0
  287. package/dist/sheet/packs/special.d.ts +44 -0
  288. package/dist/sheet/packs/special.js +187 -0
  289. package/dist/sheet/packs/stats-dist.d.ts +2 -0
  290. package/dist/sheet/packs/stats-dist.js +785 -0
  291. package/dist/sheet/packs/text-date.d.ts +2 -0
  292. package/dist/sheet/packs/text-date.js +332 -0
  293. package/dist/sheet/packs/trig.d.ts +2 -0
  294. package/dist/sheet/packs/trig.js +73 -0
  295. package/dist/sheet/page-setup.d.ts +73 -0
  296. package/dist/sheet/page-setup.js +73 -0
  297. package/dist/sheet/palette.d.ts +19 -0
  298. package/dist/sheet/palette.js +84 -0
  299. package/dist/sheet/parse.d.ts +13 -0
  300. package/dist/sheet/parse.js +140 -0
  301. package/dist/sheet/paste-special.d.ts +186 -0
  302. package/dist/sheet/paste-special.js +601 -0
  303. package/dist/sheet/pivot-range.d.ts +160 -0
  304. package/dist/sheet/pivot-range.js +333 -0
  305. package/dist/sheet/presence.d.ts +73 -0
  306. package/dist/sheet/presence.js +79 -0
  307. package/dist/sheet/print.d.ts +104 -0
  308. package/dist/sheet/print.js +169 -0
  309. package/dist/sheet/protection.d.ts +75 -0
  310. package/dist/sheet/protection.js +101 -0
  311. package/dist/sheet/rects.d.ts +45 -0
  312. package/dist/sheet/rects.js +112 -0
  313. package/dist/sheet/refs.d.ts +130 -0
  314. package/dist/sheet/refs.js +413 -0
  315. package/dist/sheet/ribbon-icons.d.ts +31 -0
  316. package/dist/sheet/ribbon-icons.js +536 -0
  317. package/dist/sheet/ribbon.d.ts +173 -0
  318. package/dist/sheet/ribbon.js +1054 -0
  319. package/dist/sheet/sheet-kinds.d.ts +74 -0
  320. package/dist/sheet/sheet-kinds.js +91 -0
  321. package/dist/sheet/shortcuts.d.ts +174 -0
  322. package/dist/sheet/shortcuts.js +674 -0
  323. package/dist/sheet/sort.d.ts +51 -0
  324. package/dist/sheet/sort.js +107 -0
  325. package/dist/sheet/sparklines.d.ts +111 -0
  326. package/dist/sheet/sparklines.js +204 -0
  327. package/dist/sheet/structure.d.ts +87 -0
  328. package/dist/sheet/structure.js +166 -0
  329. package/dist/sheet/table-styles.d.ts +74 -0
  330. package/dist/sheet/table-styles.js +152 -0
  331. package/dist/sheet/tables.d.ts +89 -0
  332. package/dist/sheet/tables.js +178 -0
  333. package/dist/sheet/tokenize.d.ts +71 -0
  334. package/dist/sheet/tokenize.js +355 -0
  335. package/dist/sheet/transforms.d.ts +76 -0
  336. package/dist/sheet/transforms.js +154 -0
  337. package/dist/sheet/validation.d.ts +108 -0
  338. package/dist/sheet/validation.js +278 -0
  339. package/dist/sheet/workbook.d.ts +217 -0
  340. package/dist/sheet/workbook.js +1120 -0
  341. package/dist/sheet/xls-cfb.d.ts +32 -0
  342. package/dist/sheet/xls-cfb.js +290 -0
  343. package/dist/sheet/xls-document.d.ts +10 -0
  344. package/dist/sheet/xls-document.js +1243 -0
  345. package/dist/sheet/xls-formula.d.ts +40 -0
  346. package/dist/sheet/xls-formula.js +569 -0
  347. package/dist/sheet/xlsx-document.d.ts +108 -0
  348. package/dist/sheet/xlsx-document.js +1849 -0
  349. package/dist/sheet/xlsx-drawing.d.ts +99 -0
  350. package/dist/sheet/xlsx-drawing.js +420 -0
  351. package/dist/sheet-enable.d.ts +6 -0
  352. package/dist/sheet-enable.js +45 -0
  353. package/dist/sheet-text.d.ts +7 -0
  354. package/dist/sheet-text.js +29 -0
  355. package/dist/sources/auth-supabase.js +2 -2
  356. package/dist/sources/realtime-supabase.js +2 -2
  357. package/dist/sources/rest.d.ts +6 -2
  358. package/dist/sources/rest.js +42 -7
  359. package/dist/sources/supabase.d.ts +10 -1
  360. package/dist/sources/supabase.js +73 -40
  361. package/dist/studio/emit-project.js +14 -1
  362. package/dist/studio/index.js +1 -1
  363. package/dist/studio/project.d.ts +11 -2
  364. package/dist/studio/project.js +5 -2
  365. package/dist/studio/ui-components.generated.js +170 -3
  366. package/dist/sveltekit/in-memory.d.ts +2 -2
  367. package/dist/sveltekit/in-memory.js +125 -4
  368. package/dist/sveltekit/index.d.ts +1 -1
  369. package/dist/sveltekit/index.js +1 -1
  370. package/dist/sveltekit/query-plan.d.ts +50 -4
  371. package/dist/sveltekit/query-plan.js +25 -3
  372. package/dist/sveltekit/sql-source.d.ts +6 -0
  373. package/dist/sveltekit/sql-source.js +34 -6
  374. package/dist/sveltekit/sql.d.ts +31 -0
  375. package/dist/sveltekit/sql.js +135 -25
  376. package/dist/sveltekit/transport.d.ts +10 -2
  377. package/dist/sveltekit/transport.js +30 -6
  378. package/dist/upgrade-prompt.d.ts +1 -1
  379. package/dist/version.d.ts +1 -1
  380. package/dist/version.js +1 -1
  381. package/dist/watermark.js +35 -2
  382. package/dist/wc/GridMenus-By9vPuq0.js +1088 -0
  383. package/dist/wc/SvChartMenu-CQNrQGT2.js +308 -0
  384. package/dist/wc/SvDateRangeInput-DR6m7bSM.js +199 -0
  385. package/dist/wc/SvDateTimePicker-D-vRnaMo.js +771 -0
  386. package/dist/wc/SvField-B_kurx_P.js +149 -0
  387. package/dist/wc/SvGrid.helpers-BdVDtjUm.js +135 -0
  388. package/dist/wc/SvGridCellEditor-Bnf1Kr5C.js +560 -0
  389. package/dist/wc/SvGridChart-BqUJh2pG.js +3572 -0
  390. package/dist/wc/SvGridChartBuilder-CGycC5cn.js +988 -0
  391. package/dist/wc/SvGridChartPanel-CRnizsHD.js +1746 -0
  392. package/dist/wc/SvGridChartView-D1pa_xMy.js +47 -0
  393. package/dist/wc/SvGridDropdown-45WsObLL.js +259 -0
  394. package/dist/wc/SvModal-DrfOYYyX.js +189 -0
  395. package/dist/wc/cell-formatting-CBfgahv1.js +86 -0
  396. package/dist/wc/chart-6OXlybVT.js +4341 -0
  397. package/dist/wc/chart-export-CeSADGfi.js +135 -0
  398. package/dist/wc/chart-export-pdf-BGko7MER.js +104 -0
  399. package/dist/wc/chart-summary-2m3ia1-n.js +137 -0
  400. package/dist/wc/chart-trend-CQOQtTMl.js +50 -0
  401. package/dist/wc/chart-validate-CD6ptiwg.js +180 -0
  402. package/dist/wc/client-DQIzjDBG.js +3064 -0
  403. package/dist/wc/column-resize-DUPgynvc.js +101 -0
  404. package/dist/wc/date-format-DS-z_h9v.js +1130 -0
  405. package/dist/wc/dismissable-CQ6XFXsk.js +45 -0
  406. package/dist/wc/editor-contract-peBDxir_.js +22 -0
  407. package/dist/wc/editor-registry-DxGKqcvx.js +24 -0
  408. package/dist/wc/focus-trap-Dbb2tJxb.js +65 -0
  409. package/dist/wc/list-option-DrRyivWp.js +82 -0
  410. package/dist/wc/popover-WsGlvtQv.js +69 -0
  411. package/dist/wc/positioning-BiKLfu1E.js +112 -0
  412. package/dist/wc/react.d.ts +41 -0
  413. package/dist/wc/react.js +90 -0
  414. package/dist/wc/rolldown-runtime-Dy4uBu1J.js +11 -0
  415. package/dist/wc/row-drag-touch-CycRR65n.js +93 -0
  416. package/dist/wc/row-resize-limG_N1z.js +111 -0
  417. package/dist/wc/sv-sheet-element.d.ts +97 -0
  418. package/dist/wc/sv-sheet-element.js +44213 -0
  419. package/dist/wc/svelte-virtualizer.svelte-CXtQy2TQ.js +530 -0
  420. package/dist/wc/validate-BqDthkNr.js +88 -0
  421. package/dist/wc/vue.d.ts +31 -0
  422. package/dist/wc/vue.js +75 -0
  423. package/package.json +36 -6
  424. package/dist/designer/assets/GridMenus-B1JtIN21.js +0 -8
  425. package/dist/designer/assets/SvDateRangeInput-CjO7nn_x.js +0 -1
  426. package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +0 -1
  427. package/dist/designer/assets/SvField-YDLipR6O.css +0 -1
  428. package/dist/designer/assets/SvField-cj1PFNgZ.js +0 -1
  429. package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +0 -2
  430. package/dist/designer/assets/SvGridChart-DBOR4xcz.js +0 -2
  431. package/dist/designer/assets/SvGridChart-fkMWeh1J.css +0 -1
  432. package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +0 -11
  433. package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +0 -1
  434. package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +0 -1
  435. package/dist/designer/assets/SvListBox-1oUF6Iav.js +0 -110
  436. package/dist/designer/assets/cell-formatting-wr5wm7US.js +0 -1
  437. package/dist/designer/assets/chart-DXFganU8.js +0 -1
  438. package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
  439. package/dist/designer/assets/date-format-DGagAqRc.css +0 -1
  440. package/dist/designer/assets/date-format-onlYDsrY.js +0 -1
  441. package/dist/designer/assets/easing-zaypKrr0.js +0 -3
  442. package/dist/designer/assets/index-k2stW6L8.css +0 -1
  443. package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
  444. package/dist/designer/assets/src-D9p27OGC.js +0 -58
  445. package/dist/designer/assets/validate-h-aslRV9.js +0 -1
@@ -0,0 +1,2 @@
1
+ import type { SheetFunction } from '../functions.js';
2
+ export declare const TEXT_DATE_FUNCTIONS: Record<string, SheetFunction>;
@@ -0,0 +1,332 @@
1
+ /**
2
+ * More of Excel's text and date functions.
3
+ *
4
+ * Dates in this engine are the `yyyy-mm-dd` text the DATE family already
5
+ * hands back, or a serial number; `toDate` reads either. The functions that
6
+ * produce a date produce the text form, the ones that produce a time
7
+ * produce a serial fraction of a day, which the `h:mm` number formats show.
8
+ */
9
+ import { FormulaError, err } from '../ast.js';
10
+ import { toNumber, toText, isBlank, toDate, isoDate, dateSerial } from '../coerce.js';
11
+ const first = (a) => a.flat[0] ?? '';
12
+ const nth = (a, i) => a.args[i]?.[0] ?? '';
13
+ const num = (a, i) => toNumber(nth(a, i));
14
+ function opt(a, i, fallback) {
15
+ const v = a.args[i]?.[0];
16
+ return v === undefined || v === '' ? fallback : toNumber(v);
17
+ }
18
+ const DAY_MS = 86400000;
19
+ /** Hours, minutes and seconds out of a value: a serial's fraction, a
20
+ * `hh:mm[:ss] [AM|PM]` text (with or without a date before it), or a
21
+ * date-time `toDate` can read. */
22
+ function timeOf(v) {
23
+ if (typeof v === 'number') {
24
+ const secs = Math.round((v - Math.floor(v)) * 86400) % 86400;
25
+ return { h: Math.floor(secs / 3600), m: Math.floor((secs % 3600) / 60), s: secs % 60 };
26
+ }
27
+ const text = toText(v).trim();
28
+ const m = /(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM|am|pm)?\s*$/.exec(text);
29
+ if (m) {
30
+ let h = Number(m[1]);
31
+ const meridian = m[4]?.toUpperCase();
32
+ if (meridian === 'PM' && h < 12)
33
+ h += 12;
34
+ if (meridian === 'AM' && h === 12)
35
+ h = 0;
36
+ if (h > 23 || Number(m[2]) > 59 || Number(m[3] ?? 0) > 59)
37
+ throw new FormulaError('#VALUE!');
38
+ return { h, m: Number(m[2]), s: Number(m[3] ?? 0) };
39
+ }
40
+ const d = toDate(v);
41
+ return { h: d.getUTCHours(), m: d.getUTCMinutes(), s: d.getUTCSeconds() };
42
+ }
43
+ const isWeekend = (d) => d.getUTCDay() === 0 || d.getUTCDay() === 6;
44
+ const daySerial = (d) => Math.floor(dateSerial(d));
45
+ /** The holidays argument of NETWORKDAYS / WORKDAY as a set of day serials. */
46
+ function holidaySet(values) {
47
+ const out = new Set();
48
+ for (const v of values ?? []) {
49
+ if (isBlank(v))
50
+ continue;
51
+ out.add(daySerial(toDate(v)));
52
+ }
53
+ return out;
54
+ }
55
+ const isLetter = (ch) => ch.toLowerCase() !== ch.toUpperCase();
56
+ const lastOfMonth = (d) => new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + 1, 0)).getUTCDate();
57
+ /** Days between two dates on a 360-day year, the US (NASD) method Excel
58
+ * defaults to. */
59
+ function days360(s, e) {
60
+ let d1 = s.getUTCDate();
61
+ let d2 = e.getUTCDate();
62
+ if (d1 === 31 || (s.getUTCMonth() === 1 && d1 === lastOfMonth(s)))
63
+ d1 = 30;
64
+ if (d2 === 31 && d1 === 30)
65
+ d2 = 30;
66
+ return (e.getUTCFullYear() - s.getUTCFullYear()) * 360 + (e.getUTCMonth() - s.getUTCMonth()) * 30 + (d2 - d1);
67
+ }
68
+ const isLeap = (y) => (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
69
+ export const TEXT_DATE_FUNCTIONS = {
70
+ // ---- Text ------------------------------------------------------------
71
+ // Excel capitalises a letter that follows anything but a letter, so
72
+ // "76BudGet" is "76Budget" and "2-way" is "2-Way".
73
+ PROPER: (a) => {
74
+ const s = toText(first(a));
75
+ let out = '';
76
+ let afterLetter = false;
77
+ for (const ch of s) {
78
+ if (isLetter(ch)) {
79
+ out += afterLetter ? ch.toLowerCase() : ch.toUpperCase();
80
+ afterLetter = true;
81
+ }
82
+ else {
83
+ out += ch;
84
+ afterLetter = false;
85
+ }
86
+ }
87
+ return out;
88
+ },
89
+ REPT: (a) => {
90
+ const n = Math.trunc(num(a, 1));
91
+ if (n < 0)
92
+ return err('#VALUE!');
93
+ return toText(nth(a, 0)).repeat(n);
94
+ },
95
+ // VALUE reads what a typed entry would: a plain number, a currency or
96
+ // grouped one, a percentage, a time or a date.
97
+ VALUE: (a) => {
98
+ const v = first(a);
99
+ if (typeof v === 'number')
100
+ return v;
101
+ if (typeof v === 'boolean')
102
+ return err('#VALUE!');
103
+ const text = toText(v).trim();
104
+ if (text === '')
105
+ return err('#VALUE!');
106
+ const cleaned = text.replace(/[$,]/g, '');
107
+ if (/^-?\d*\.?\d+(e[+-]?\d+)?%$/i.test(cleaned))
108
+ return Number(cleaned.slice(0, -1)) / 100;
109
+ const n = Number(cleaned);
110
+ if (cleaned !== '' && Number.isFinite(n))
111
+ return n;
112
+ if (/^\d{1,2}:\d{2}(:\d{2})?\s*(AM|PM)?$/i.test(text)) {
113
+ const t = timeOf(text);
114
+ return (t.h * 3600 + t.m * 60 + t.s) / 86400;
115
+ }
116
+ try {
117
+ return dateSerial(toDate(text));
118
+ }
119
+ catch {
120
+ return err('#VALUE!');
121
+ }
122
+ },
123
+ /**
124
+ * NUMBERVALUE(text, [decimal], [group]): VALUE for a number written the
125
+ * way another country writes one. The separators are given rather than
126
+ * guessed, which is the whole point of it: "1.234,56" is a thousand two
127
+ * hundred in Germany and one point two in Britain, and only the caller
128
+ * knows which.
129
+ */
130
+ NUMBERVALUE: (a) => {
131
+ const v = first(a);
132
+ if (typeof v === 'number')
133
+ return v;
134
+ if (typeof v === 'boolean')
135
+ return err('#VALUE!');
136
+ const decimal = (toText(nth(a, 1)) || '.').trim().slice(0, 1) || '.';
137
+ const group = (toText(nth(a, 2)) || ',').trim().slice(0, 1);
138
+ if (decimal === group)
139
+ return err('#VALUE!');
140
+ let text = toText(v).trim();
141
+ if (text === '')
142
+ return 0;
143
+ // Trailing percent signs each divide by a hundred, as Excel's do.
144
+ let percents = 0;
145
+ while (text.endsWith('%')) {
146
+ percents += 1;
147
+ text = text.slice(0, -1).trim();
148
+ }
149
+ // Excel reads the group separator as a thousands mark, so one AFTER the
150
+ // decimal separator is not a number written another way, it is a typo:
151
+ // "1.5,5" is #VALUE! rather than fifteen and a half.
152
+ const point = text.indexOf(decimal);
153
+ if (group !== '' && point >= 0 && text.indexOf(group, point) > point)
154
+ return err('#VALUE!');
155
+ // The group separator is dropped and the decimal one becomes a point;
156
+ // spaces are dropped too, since a space is a group separator in half of
157
+ // Europe whatever was asked for.
158
+ const stripped = text
159
+ .split('').filter((ch) => ch !== group && !/\s/.test(ch)).join('')
160
+ .replace(decimal, '.');
161
+ if (stripped === '' || /[^0-9.+-]/.test(stripped))
162
+ return err('#VALUE!');
163
+ const n = Number(stripped);
164
+ if (!Number.isFinite(n))
165
+ return err('#VALUE!');
166
+ return n / 100 ** percents;
167
+ },
168
+ CHAR: (a) => {
169
+ const n = Math.trunc(num(a, 0));
170
+ if (n < 1 || n > 255)
171
+ return err('#VALUE!');
172
+ return String.fromCharCode(n);
173
+ },
174
+ CODE: (a) => {
175
+ const s = toText(first(a));
176
+ return s === '' ? err('#VALUE!') : s.charCodeAt(0);
177
+ },
178
+ UNICHAR: (a) => {
179
+ const n = Math.trunc(num(a, 0));
180
+ if (n < 1 || n > 0x10ffff)
181
+ return err('#VALUE!');
182
+ return String.fromCodePoint(n);
183
+ },
184
+ UNICODE: (a) => {
185
+ const s = toText(first(a));
186
+ return s === '' ? err('#VALUE!') : s.codePointAt(0);
187
+ },
188
+ EXACT: (a) => toText(nth(a, 0)) === toText(nth(a, 1)),
189
+ CLEAN: (a) => {
190
+ let out = '';
191
+ for (const ch of toText(first(a)))
192
+ if (ch.charCodeAt(0) >= 32)
193
+ out += ch;
194
+ return out;
195
+ },
196
+ REPLACE: (a) => {
197
+ const s = toText(nth(a, 0));
198
+ const start = Math.trunc(num(a, 1));
199
+ const count = Math.trunc(num(a, 2));
200
+ if (start < 1 || count < 0)
201
+ return err('#VALUE!');
202
+ return s.slice(0, start - 1) + toText(nth(a, 3)) + s.slice(start - 1 + count);
203
+ },
204
+ T: (a) => (typeof first(a) === 'string' ? first(a) : ''),
205
+ N: (a) => {
206
+ const v = first(a);
207
+ return typeof v === 'number' ? v : typeof v === 'boolean' ? (v ? 1 : 0) : 0;
208
+ },
209
+ // ---- Date and time ---------------------------------------------------
210
+ // WEEKDAY(date, [type]): 1 counts Sunday as 1, 2 counts Monday as 1, 3
211
+ // counts Monday as 0; 11 to 17 count from Monday to Sunday as 1.
212
+ WEEKDAY: (a) => {
213
+ const day = toDate(nth(a, 0)).getUTCDay();
214
+ const type = opt(a, 1, 1);
215
+ if (type === 1)
216
+ return day + 1;
217
+ if (type === 2)
218
+ return ((day + 6) % 7) + 1;
219
+ if (type === 3)
220
+ return (day + 6) % 7;
221
+ if (type >= 11 && type <= 17) {
222
+ const start = (type - 10) % 7;
223
+ return ((day - start + 7) % 7) + 1;
224
+ }
225
+ return err('#NUM!');
226
+ },
227
+ // EDATE(date, months): the same day `months` on, clamped to the end of a
228
+ // shorter month, so a 31st in January lands on the 28th or 29th.
229
+ EDATE: (a) => {
230
+ const d = toDate(nth(a, 0));
231
+ const months = Math.trunc(num(a, 1));
232
+ const y = d.getUTCFullYear();
233
+ const m = d.getUTCMonth() + months;
234
+ const last = new Date(Date.UTC(y, m + 1, 0)).getUTCDate();
235
+ return isoDate(new Date(Date.UTC(y, m, Math.min(d.getUTCDate(), last))));
236
+ },
237
+ NETWORKDAYS: (a) => {
238
+ const start = daySerial(toDate(nth(a, 0)));
239
+ const end = daySerial(toDate(nth(a, 1)));
240
+ const holidays = holidaySet(a.args[2]);
241
+ const from = Math.min(start, end);
242
+ const to = Math.max(start, end);
243
+ let count = 0;
244
+ for (let s = from; s <= to; s += 1) {
245
+ if (!isWeekend(toDate(s)) && !holidays.has(s))
246
+ count += 1;
247
+ }
248
+ return end < start ? -count : count;
249
+ },
250
+ WORKDAY: (a) => {
251
+ let s = daySerial(toDate(nth(a, 0)));
252
+ let left = Math.trunc(num(a, 1));
253
+ const holidays = holidaySet(a.args[2]);
254
+ const step = left < 0 ? -1 : 1;
255
+ while (left !== 0) {
256
+ s += step;
257
+ if (isWeekend(toDate(s)) || holidays.has(s))
258
+ continue;
259
+ left -= step;
260
+ }
261
+ return isoDate(toDate(s));
262
+ },
263
+ // WEEKNUM(date, [type]): 1 and 2 make the week holding January 1 week 1,
264
+ // starting Sunday or Monday; 11 to 17 start on Monday to Sunday; 21 is
265
+ // the ISO week.
266
+ WEEKNUM: (a) => {
267
+ const d = toDate(nth(a, 0));
268
+ const type = opt(a, 1, 1);
269
+ if (type === 21) {
270
+ const t = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));
271
+ // Move to the Thursday of this week; its year is the ISO year.
272
+ t.setUTCDate(t.getUTCDate() - ((t.getUTCDay() + 6) % 7) + 3);
273
+ const jan4 = new Date(Date.UTC(t.getUTCFullYear(), 0, 4));
274
+ const firstThursday = new Date(jan4.getTime());
275
+ firstThursday.setUTCDate(jan4.getUTCDate() - ((jan4.getUTCDay() + 6) % 7) + 3);
276
+ return 1 + Math.round((t.getTime() - firstThursday.getTime()) / (7 * DAY_MS));
277
+ }
278
+ const startDay = type === 1 ? 0 : type === 2 ? 1 : type >= 11 && type <= 17 ? (type - 10) % 7 : -1;
279
+ if (startDay < 0)
280
+ return err('#NUM!');
281
+ const jan1 = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
282
+ const offset = (jan1.getUTCDay() - startDay + 7) % 7;
283
+ const dayOfYear = Math.floor((Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) - jan1.getTime()) / DAY_MS);
284
+ return Math.floor((dayOfYear + offset) / 7) + 1;
285
+ },
286
+ HOUR: (a) => timeOf(first(a)).h,
287
+ MINUTE: (a) => timeOf(first(a)).m,
288
+ SECOND: (a) => timeOf(first(a)).s,
289
+ // TIME(hour, minute, second): a fraction of a day, wrapping past 24 hours.
290
+ TIME: (a) => {
291
+ const secs = Math.trunc(num(a, 0)) * 3600 + Math.trunc(num(a, 1)) * 60 + Math.trunc(num(a, 2));
292
+ if (secs < 0)
293
+ return err('#NUM!');
294
+ return (secs % 86400) / 86400;
295
+ },
296
+ DATEVALUE: (a) => {
297
+ const v = first(a);
298
+ if (typeof v === 'number')
299
+ return err('#VALUE!');
300
+ return daySerial(toDate(v));
301
+ },
302
+ TIMEVALUE: (a) => {
303
+ const t = timeOf(first(a));
304
+ return (t.h * 3600 + t.m * 60 + t.s) / 86400;
305
+ },
306
+ DAYS360: (a) => days360(toDate(nth(a, 0)), toDate(nth(a, 1))),
307
+ // YEARFRAC(start, end, [basis]): 0 is US 30/360, 1 actual/actual, 2
308
+ // actual/360, 3 actual/365, 4 European 30/360 (read as US here).
309
+ YEARFRAC: (a) => {
310
+ const s = toDate(nth(a, 0));
311
+ const e = toDate(nth(a, 1));
312
+ const basis = Math.trunc(opt(a, 2, 0));
313
+ const from = s.getTime() <= e.getTime() ? s : e;
314
+ const to = s.getTime() <= e.getTime() ? e : s;
315
+ if (basis === 0 || basis === 4)
316
+ return days360(from, to) / 360;
317
+ const days = daySerial(to) - daySerial(from);
318
+ if (basis === 2)
319
+ return days / 360;
320
+ if (basis === 3)
321
+ return days / 365;
322
+ if (basis !== 1)
323
+ return err('#NUM!');
324
+ // Actual/actual: the average year length across the span.
325
+ const y1 = from.getUTCFullYear();
326
+ const y2 = to.getUTCFullYear();
327
+ let total = 0;
328
+ for (let y = y1; y <= y2; y += 1)
329
+ total += isLeap(y) ? 366 : 365;
330
+ return days / (total / (y2 - y1 + 1));
331
+ },
332
+ };
@@ -0,0 +1,2 @@
1
+ import type { SheetFunction } from '../functions.js';
2
+ export declare const TRIG_FUNCTIONS: Record<string, SheetFunction>;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Excel's Math and Trigonometry family: the circular functions, their
3
+ * inverses, the hyperbolic set, and the two that turn one angle measure
4
+ * into the other.
5
+ *
6
+ * Two traps live here, both of which read as a bug in a model rather than
7
+ * as a difference of convention:
8
+ *
9
+ * - `ATAN2` takes its arguments x first, y second, which is the opposite
10
+ * order from every C-family `atan2`. `=ATAN2(-1, 1)` is 3/4 pi in
11
+ * Excel; handing the pair straight to `Math.atan2` gives -1/4 pi.
12
+ * - The reciprocal functions are undefined where their partner is zero,
13
+ * and Excel reports that as `#DIV/0!` rather than as infinity.
14
+ *
15
+ * Domain errors are `#NUM!`, as Excel reports them: ASIN past 1, ACOSH
16
+ * below 1, ATANH at 1.
17
+ */
18
+ import { err } from '../ast.js';
19
+ import { toNumber } from '../coerce.js';
20
+ const nth = (a, i) => a.args[i]?.[0] ?? '';
21
+ const num = (a, i) => toNumber(nth(a, i));
22
+ /** A result that has to lie in a domain, with Excel's error when it does not. */
23
+ const guard = (ok, value) => (ok ? value() : err('#NUM!'));
24
+ /**
25
+ * A reciprocal of a circular function. Excel calls the pole `#DIV/0!`, and
26
+ * a pole is where the partner function is zero. Comparing against an exact
27
+ * zero is right for COT(0) and CSC(0), which is what people actually type;
28
+ * at pi the partner is only near zero in binary floating point, and Excel
29
+ * answers with the same large number JavaScript does, so nothing is snapped.
30
+ */
31
+ const reciprocal = (partner) => (partner === 0 ? err('#DIV/0!') : 1 / partner);
32
+ export const TRIG_FUNCTIONS = {
33
+ // ---- Circular --------------------------------------------------------
34
+ SIN: (a) => Math.sin(num(a, 0)),
35
+ COS: (a) => Math.cos(num(a, 0)),
36
+ TAN: (a) => Math.tan(num(a, 0)),
37
+ COT: (a) => reciprocal(Math.tan(num(a, 0))),
38
+ SEC: (a) => reciprocal(Math.cos(num(a, 0))),
39
+ CSC: (a) => reciprocal(Math.sin(num(a, 0))),
40
+ // ---- Inverse circular ------------------------------------------------
41
+ ASIN: (a) => { const x = num(a, 0); return guard(x >= -1 && x <= 1, () => Math.asin(x)); },
42
+ ACOS: (a) => { const x = num(a, 0); return guard(x >= -1 && x <= 1, () => Math.acos(x)); },
43
+ ATAN: (a) => Math.atan(num(a, 0)),
44
+ // Excel's argument order is (x, y); Math.atan2 wants (y, x).
45
+ ATAN2: (a) => {
46
+ const x = num(a, 0);
47
+ const y = num(a, 1);
48
+ return x === 0 && y === 0 ? err('#DIV/0!') : Math.atan2(y, x);
49
+ },
50
+ // ACOT is the angle in (0, pi), which is what pi/2 minus ATAN gives for
51
+ // every real argument, zero included.
52
+ ACOT: (a) => Math.PI / 2 - Math.atan(num(a, 0)),
53
+ // ---- Hyperbolic ------------------------------------------------------
54
+ SINH: (a) => Math.sinh(num(a, 0)),
55
+ COSH: (a) => Math.cosh(num(a, 0)),
56
+ TANH: (a) => Math.tanh(num(a, 0)),
57
+ COTH: (a) => reciprocal(Math.tanh(num(a, 0))),
58
+ SECH: (a) => reciprocal(Math.cosh(num(a, 0))),
59
+ CSCH: (a) => reciprocal(Math.sinh(num(a, 0))),
60
+ // ---- Inverse hyperbolic ---------------------------------------------
61
+ ASINH: (a) => Math.asinh(num(a, 0)),
62
+ ACOSH: (a) => { const x = num(a, 0); return guard(x >= 1, () => Math.acosh(x)); },
63
+ ATANH: (a) => { const x = num(a, 0); return guard(x > -1 && x < 1, () => Math.atanh(x)); },
64
+ // ACOTH is defined outside [-1, 1]; at the ends it is a pole.
65
+ ACOTH: (a) => {
66
+ const x = num(a, 0);
67
+ return guard(Math.abs(x) > 1, () => 0.5 * Math.log((x + 1) / (x - 1)));
68
+ },
69
+ // ---- Angle measure and the odd one out -------------------------------
70
+ DEGREES: (a) => (num(a, 0) * 180) / Math.PI,
71
+ RADIANS: (a) => (num(a, 0) * Math.PI) / 180,
72
+ SQRTPI: (a) => { const x = num(a, 0); return guard(x >= 0, () => Math.sqrt(x * Math.PI)); },
73
+ };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Excel's Page Setup, per sheet: what the Page Layout tab sets and File >
3
+ * Print reads. Orientation, paper, margins, the print area, the rows that
4
+ * repeat at the top of every page, whether gridlines and headings print,
5
+ * and the scale. Margins are in inches, the unit the file keeps them in.
6
+ * Nothing here touches the DOM; `print.ts` turns a sheet and its setup
7
+ * into the page.
8
+ */
9
+ import type { Rect } from './rects.js';
10
+ import type { StructuralEdit } from './refs.js';
11
+ export type PageOrientation = 'portrait' | 'landscape';
12
+ /** The papers Excel's list starts with, with their OOXML `paperSize` codes. */
13
+ export declare const PAPER_SIZES: {
14
+ readonly Letter: {
15
+ readonly code: 1;
16
+ readonly css: "letter";
17
+ };
18
+ readonly Tabloid: {
19
+ readonly code: 3;
20
+ readonly css: "11in 17in";
21
+ };
22
+ readonly Legal: {
23
+ readonly code: 5;
24
+ readonly css: "legal";
25
+ };
26
+ readonly A3: {
27
+ readonly code: 8;
28
+ readonly css: "A3";
29
+ };
30
+ readonly A4: {
31
+ readonly code: 9;
32
+ readonly css: "A4";
33
+ };
34
+ readonly A5: {
35
+ readonly code: 11;
36
+ readonly css: "A5";
37
+ };
38
+ };
39
+ export type PaperSize = keyof typeof PAPER_SIZES;
40
+ /** Inches, as the file keeps them: page edges, and the header and footer bands. */
41
+ export type PageMargins = {
42
+ top: number;
43
+ bottom: number;
44
+ left: number;
45
+ right: number;
46
+ header: number;
47
+ footer: number;
48
+ };
49
+ /** Excel's Margins dropdown. */
50
+ export declare const MARGIN_PRESETS: Record<'normal' | 'narrow' | 'wide', PageMargins>;
51
+ export type MarginPreset = keyof typeof MARGIN_PRESETS;
52
+ export type PageSetup = {
53
+ orientation: PageOrientation;
54
+ paper: PaperSize;
55
+ margins: PageMargins;
56
+ /** The cells that print, or null for everything the sheet holds. */
57
+ printArea: Rect[] | null;
58
+ /** Rows repeated at the top of every page, `[first, last]` 0-based, or null. */
59
+ printTitleRows: [number, number] | null;
60
+ gridlines: boolean;
61
+ headings: boolean;
62
+ /** Percent; 100 prints at size. */
63
+ scale: number;
64
+ };
65
+ export declare const defaultPageSetup: () => PageSetup;
66
+ /** A copy safe to hand out or save. */
67
+ export declare function copyPageSetup(setup: PageSetup): PageSetup;
68
+ /** Which preset the margins are, if any, for the dropdown's lit entry. */
69
+ export declare function marginPresetOf(margins: PageMargins): MarginPreset | null;
70
+ /** The setup after an insert or delete: the print area and the title rows move with their lines. */
71
+ export declare function shiftPageSetup(setup: PageSetup, edit: StructuralEdit): PageSetup;
72
+ /** `@page` margins from inches, the order CSS wants. */
73
+ export declare function marginsCss(margins: PageMargins): string;
@@ -0,0 +1,73 @@
1
+ import { shiftRect, lineShift } from './rects.js';
2
+ /** The papers Excel's list starts with, with their OOXML `paperSize` codes. */
3
+ export const PAPER_SIZES = {
4
+ Letter: { code: 1, css: 'letter' },
5
+ Tabloid: { code: 3, css: '11in 17in' },
6
+ Legal: { code: 5, css: 'legal' },
7
+ A3: { code: 8, css: 'A3' },
8
+ A4: { code: 9, css: 'A4' },
9
+ A5: { code: 11, css: 'A5' },
10
+ };
11
+ /** Excel's Margins dropdown. */
12
+ export const MARGIN_PRESETS = {
13
+ normal: { top: 0.75, bottom: 0.75, left: 0.7, right: 0.7, header: 0.3, footer: 0.3 },
14
+ narrow: { top: 0.75, bottom: 0.75, left: 0.25, right: 0.25, header: 0.3, footer: 0.3 },
15
+ wide: { top: 1, bottom: 1, left: 1, right: 1, header: 0.5, footer: 0.5 },
16
+ };
17
+ export const defaultPageSetup = () => ({
18
+ orientation: 'portrait',
19
+ paper: 'A4',
20
+ margins: { ...MARGIN_PRESETS.normal },
21
+ printArea: null,
22
+ printTitleRows: null,
23
+ gridlines: false,
24
+ headings: false,
25
+ scale: 100,
26
+ });
27
+ /** A copy safe to hand out or save. */
28
+ export function copyPageSetup(setup) {
29
+ return {
30
+ ...setup,
31
+ margins: { ...setup.margins },
32
+ printArea: setup.printArea ? setup.printArea.map(([r1, c1, r2, c2]) => [r1, c1, r2, c2]) : null,
33
+ printTitleRows: setup.printTitleRows ? [setup.printTitleRows[0], setup.printTitleRows[1]] : null,
34
+ };
35
+ }
36
+ /** Which preset the margins are, if any, for the dropdown's lit entry. */
37
+ export function marginPresetOf(margins) {
38
+ for (const [name, preset] of Object.entries(MARGIN_PRESETS)) {
39
+ if (Object.keys(preset).every((k) => Math.abs(preset[k] - margins[k]) < 1e-6))
40
+ return name;
41
+ }
42
+ return null;
43
+ }
44
+ /** The setup after an insert or delete: the print area and the title rows move with their lines. */
45
+ export function shiftPageSetup(setup, edit) {
46
+ const out = copyPageSetup(setup);
47
+ if (out.printArea) {
48
+ const moved = out.printArea.map((r) => shiftRect(r, edit)).filter((r) => r !== null);
49
+ out.printArea = moved.length ? moved : null;
50
+ }
51
+ if (out.printTitleRows && (edit.kind === 'insertRows' || edit.kind === 'deleteRows')) {
52
+ const shift = lineShift(edit);
53
+ const [a, b] = out.printTitleRows;
54
+ if (edit.kind === 'insertRows') {
55
+ out.printTitleRows = [shift(a), shift(b)];
56
+ }
57
+ else {
58
+ const rows = [];
59
+ for (let r = a; r <= b; r += 1) {
60
+ const next = shift(r);
61
+ if (next !== null)
62
+ rows.push(next);
63
+ }
64
+ out.printTitleRows = rows.length ? [rows[0], rows[rows.length - 1]] : null;
65
+ }
66
+ }
67
+ return out;
68
+ }
69
+ /** `@page` margins from inches, the order CSS wants. */
70
+ export function marginsCss(margins) {
71
+ const inch = (n) => `${Math.round(n * 100) / 100}in`;
72
+ return `${inch(margins.top)} ${inch(margins.right)} ${inch(margins.bottom)} ${inch(margins.left)}`;
73
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Excel's colour picker, as data: the ten theme colours with five tints and
3
+ * shades each, then the ten standard colours. These are the values a
4
+ * spreadsheet user expects to find under Fill Colour and Font Colour, and
5
+ * they are cell DATA (a fill the document carries) rather than chrome, which
6
+ * is why they are literal hex here and not theme tokens.
7
+ */
8
+ export type PaletteColour = {
9
+ value: string;
10
+ label: string;
11
+ };
12
+ export declare const STANDARD_COLOURS: ReadonlyArray<PaletteColour>;
13
+ /** Mix `hex` toward white (`amount` > 0) or black (`amount` < 0). */
14
+ export declare function tint(hex: string, amount: number): string;
15
+ export type PaletteRow = ReadonlyArray<PaletteColour>;
16
+ /** Ten columns by six rows: the base row, then five variations per column. */
17
+ export declare const THEME_COLOURS: ReadonlyArray<PaletteRow>;
18
+ /** The whole picker flattened, for a `select` fallback and for tests. */
19
+ export declare const ALL_COLOURS: ReadonlyArray<PaletteColour>;
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Excel's colour picker, as data: the ten theme colours with five tints and
3
+ * shades each, then the ten standard colours. These are the values a
4
+ * spreadsheet user expects to find under Fill Colour and Font Colour, and
5
+ * they are cell DATA (a fill the document carries) rather than chrome, which
6
+ * is why they are literal hex here and not theme tokens.
7
+ */
8
+ /** The Office theme's base row: white, black, two greys, then six accents. */
9
+ const THEME_BASE = [
10
+ { value: '#FFFFFF', label: 'White, Background 1' },
11
+ { value: '#000000', label: 'Black, Text 1' },
12
+ { value: '#E7E6E6', label: 'Light Gray, Background 2' },
13
+ { value: '#44546A', label: 'Blue-Gray, Text 2' },
14
+ { value: '#4472C4', label: 'Blue, Accent 1' },
15
+ { value: '#ED7D31', label: 'Orange, Accent 2' },
16
+ { value: '#A5A5A5', label: 'Gray, Accent 3' },
17
+ { value: '#FFC000', label: 'Gold, Accent 4' },
18
+ { value: '#5B9BD5', label: 'Blue, Accent 5' },
19
+ { value: '#70AD47', label: 'Green, Accent 6' },
20
+ ];
21
+ export const STANDARD_COLOURS = [
22
+ { value: '#C00000', label: 'Dark Red' },
23
+ { value: '#FF0000', label: 'Red' },
24
+ { value: '#FFC000', label: 'Orange' },
25
+ { value: '#FFFF00', label: 'Yellow' },
26
+ { value: '#92D050', label: 'Light Green' },
27
+ { value: '#00B050', label: 'Green' },
28
+ { value: '#00B0F0', label: 'Light Blue' },
29
+ { value: '#0070C0', label: 'Blue' },
30
+ { value: '#002060', label: 'Dark Blue' },
31
+ { value: '#7030A0', label: 'Purple' },
32
+ ];
33
+ function hexToRgb(hex) {
34
+ const n = parseInt(hex.slice(1), 16);
35
+ return [(n >> 16) & 255, (n >> 8) & 255, n & 255];
36
+ }
37
+ function rgbToHex([r, g, b]) {
38
+ const part = (v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, '0').toUpperCase();
39
+ return `#${part(r)}${part(g)}${part(b)}`;
40
+ }
41
+ /** Mix `hex` toward white (`amount` > 0) or black (`amount` < 0). */
42
+ export function tint(hex, amount) {
43
+ const [r, g, b] = hexToRgb(hex);
44
+ const target = amount > 0 ? 255 : 0;
45
+ const t = Math.abs(amount);
46
+ return rgbToHex([r + (target - r) * t, g + (target - g) * t, b + (target - b) * t]);
47
+ }
48
+ /**
49
+ * Excel's five variations under each theme colour. Lighter 80/60/40 % for
50
+ * the accents; the white and black columns run the other way, as they do in
51
+ * Excel, so white gets greys and black gets lighter greys rather than five
52
+ * identical swatches.
53
+ */
54
+ const STEPS = [
55
+ { amount: 0.8, label: 'Lighter 80%' },
56
+ { amount: 0.6, label: 'Lighter 60%' },
57
+ { amount: 0.4, label: 'Lighter 40%' },
58
+ { amount: -0.25, label: 'Darker 25%' },
59
+ { amount: -0.5, label: 'Darker 50%' },
60
+ ];
61
+ const WHITE_STEPS = [-0.05, -0.15, -0.25, -0.35, -0.5];
62
+ const BLACK_STEPS = [0.5, 0.35, 0.25, 0.15, 0.05];
63
+ /** Ten columns by six rows: the base row, then five variations per column. */
64
+ export const THEME_COLOURS = (() => {
65
+ const rows = [THEME_BASE.map((c) => ({ ...c }))];
66
+ for (let step = 0; step < 5; step += 1) {
67
+ rows.push(THEME_BASE.map((base, col) => {
68
+ const amount = col === 0 ? WHITE_STEPS[step] : col === 1 ? BLACK_STEPS[step] : STEPS[step].amount;
69
+ const name = base.label.split(',')[0];
70
+ const how = col === 0
71
+ ? `Darker ${Math.round(Math.abs(amount) * 100)}%`
72
+ : col === 1
73
+ ? `Lighter ${Math.round(amount * 100)}%`
74
+ : STEPS[step].label;
75
+ return { value: tint(base.value, amount), label: `${name}, ${how}` };
76
+ }));
77
+ }
78
+ return rows;
79
+ })();
80
+ /** The whole picker flattened, for a `select` fallback and for tests. */
81
+ export const ALL_COLOURS = [
82
+ ...THEME_COLOURS.flat(),
83
+ ...STANDARD_COLOURS,
84
+ ];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Precedence-climbing parser over the token stream.
3
+ *
4
+ * One structural choice worth naming: a whole-column reference like `A:A`
5
+ * lexes as a range whose `to.row` is null, and the evaluator fills that in
6
+ * from the sheet's last used row. Resolving it here instead would bake the
7
+ * row count into the AST, and the AST is cached across edits that change it.
8
+ */
9
+ import { type Node } from './ast.js';
10
+ import { type Token } from './tokenize.js';
11
+ export declare function parse(tokens: ReadonlyArray<Token>): Node;
12
+ /** Tokenize and parse one formula. Accepts the leading `=` or not. */
13
+ export declare function parseFormula(src: string): Node;