@svgrid/enterprise 3.0.0 → 3.0.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.
Files changed (390) hide show
  1. package/README.md +95 -95
  2. package/dist/ExpressionEditorHarness.svelte.d.ts +2 -2
  3. package/dist/SvAdvancedFilter.svelte.d.ts +2 -2
  4. package/dist/SvAlertRuleEditor.svelte.d.ts +2 -2
  5. package/dist/SvAlertsManager.svelte.d.ts +3 -3
  6. package/dist/SvAlertsPanel.svelte.d.ts +1 -1
  7. package/dist/SvAuthGate.svelte +115 -115
  8. package/dist/SvAuthGate.svelte.d.ts +1 -1
  9. package/dist/SvBoard.svelte.d.ts +1 -1
  10. package/dist/SvExportMenu.svelte +553 -553
  11. package/dist/SvExportMenu.svelte.d.ts +2 -2
  12. package/dist/SvExpressionEditor.svelte.d.ts +2 -2
  13. package/dist/SvFileInput.svelte +113 -113
  14. package/dist/SvFormulaBar.svelte +606 -0
  15. package/dist/SvFormulaBar.svelte.d.ts +62 -0
  16. package/dist/SvGridAlerts.svelte.d.ts +2 -2
  17. package/dist/SvGridBoard.svelte +2358 -2358
  18. package/dist/SvGridBulkEditDrawer.svelte.d.ts +1 -1
  19. package/dist/SvGridEditPanel.svelte +1157 -1157
  20. package/dist/SvGridEditPanel.svelte.d.ts +3 -3
  21. package/dist/SvGridMasterDetail.svelte +116 -116
  22. package/dist/SvGridMasterDetail.svelte.d.ts +1 -1
  23. package/dist/SvGridScheduler.svelte +5358 -5358
  24. package/dist/SvImportDialog.svelte +1020 -1020
  25. package/dist/SvImportDialog.svelte.d.ts +2 -2
  26. package/dist/SvLookupInput.svelte +180 -180
  27. package/dist/SvLookupInput.svelte.d.ts +1 -1
  28. package/dist/SvPivotDesigner.svelte +2041 -1990
  29. package/dist/SvPivotDesigner.svelte.d.ts +2 -2
  30. package/dist/SvRecordDetail.svelte.d.ts +1 -1
  31. package/dist/SvRibbonIcon.svelte +46 -0
  32. package/dist/SvRibbonIcon.svelte.d.ts +17 -0
  33. package/dist/SvSchedule.svelte.d.ts +1 -1
  34. package/dist/SvSchemaChart.svelte +236 -234
  35. package/dist/SvSchemaChart.svelte.d.ts +2 -2
  36. package/dist/SvSchemaDashboard.svelte +130 -130
  37. package/dist/SvSchemaDashboard.svelte.d.ts +3 -3
  38. package/dist/SvSheet.svelte +4114 -0
  39. package/dist/SvSheet.svelte.d.ts +142 -0
  40. package/dist/SvSheetComment.svelte +98 -0
  41. package/dist/SvSheetComment.svelte.d.ts +22 -0
  42. package/dist/SvSheetConditionalFormat.svelte +162 -0
  43. package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
  44. package/dist/SvSheetDataValidation.svelte +249 -0
  45. package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
  46. package/dist/SvSheetFilterMenu.svelte +217 -0
  47. package/dist/SvSheetFilterMenu.svelte.d.ts +17 -0
  48. package/dist/SvSheetFindReplace.svelte +132 -0
  49. package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
  50. package/dist/SvSheetFormatCells.svelte +421 -0
  51. package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
  52. package/dist/SvSheetGoalSeek.svelte +144 -0
  53. package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
  54. package/dist/SvSheetInsertFunction.svelte +147 -0
  55. package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
  56. package/dist/SvSheetListPicker.svelte +89 -0
  57. package/dist/SvSheetListPicker.svelte.d.ts +16 -0
  58. package/dist/SvSheetManageRules.svelte +185 -0
  59. package/dist/SvSheetManageRules.svelte.d.ts +16 -0
  60. package/dist/SvSheetNameManager.svelte +225 -0
  61. package/dist/SvSheetNameManager.svelte.d.ts +11 -0
  62. package/dist/SvSheetPasteSpecial.svelte +105 -0
  63. package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
  64. package/dist/SvSheetRemoveDuplicates.svelte +149 -0
  65. package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
  66. package/dist/SvSheetRibbon.svelte +1201 -0
  67. package/dist/SvSheetRibbon.svelte.d.ts +34 -0
  68. package/dist/SvSheetSizeDialog.svelte +58 -0
  69. package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
  70. package/dist/SvSheetTabs.svelte +441 -0
  71. package/dist/SvSheetTabs.svelte.d.ts +36 -0
  72. package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
  73. package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
  74. package/dist/SvSheetTextToColumns.svelte +172 -0
  75. package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
  76. package/dist/SvSheetValidationAlert.svelte +83 -0
  77. package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
  78. package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -1
  79. package/dist/advanced-filter-enable.js +3 -3
  80. package/dist/alerts/alert-engine-attach.d.ts +2 -2
  81. package/dist/alerts/alert-engine-attach.js +3 -3
  82. package/dist/alerts/alert-engine.d.ts +1 -1
  83. package/dist/alerts/alert-engine.js +2 -2
  84. package/dist/alerts/alert-formats.d.ts +1 -1
  85. package/dist/alerts/alert-formats.js +1 -1
  86. package/dist/alerts/alert-observer.d.ts +3 -3
  87. package/dist/alerts/alert-observer.js +1 -1
  88. package/dist/alerts/alert-storage.d.ts +1 -1
  89. package/dist/alerts/alert-store.svelte.d.ts +1 -1
  90. package/dist/alerts/alert-types.d.ts +2 -2
  91. package/dist/alerts.js +2 -2
  92. package/dist/board.js +2 -2
  93. package/dist/cdn/svgrid-enterprise.svelte-external.js +19046 -5428
  94. package/dist/designer/assets/GridMenus-BlsvL_aU.js +8 -0
  95. package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
  96. package/dist/designer/assets/SvChartMenu-D9hEeHar.js +1 -0
  97. package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
  98. package/dist/designer/assets/SvDateRangeInput-C0iCCZ8o.css +1 -0
  99. package/dist/designer/assets/SvDateTimePicker-DARvKUL2.js +1 -0
  100. package/dist/designer/assets/SvDateTimePicker-DPv09DIT.css +1 -0
  101. package/dist/designer/assets/{preload-helper-CG0n22O7.js → SvGrid.helpers-BgT-gnCo.js} +1 -1
  102. package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +4 -0
  103. package/dist/designer/assets/SvGridChart-B8j1SSy3.js +3 -0
  104. package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
  105. package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
  106. package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +1 -0
  107. package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
  108. package/dist/designer/assets/SvGridChartPanel-pT6ITc2P.js +4 -0
  109. package/dist/designer/assets/SvGridChartView-7msfnWZT.css +1 -0
  110. package/dist/designer/assets/SvGridChartView-bg281UA1.js +1 -0
  111. package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +1 -0
  112. package/dist/designer/assets/SvGridDropdown-CcidB3rm.css +1 -0
  113. package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
  114. package/dist/designer/assets/SvListBox-BXfyqy4a.css +1 -0
  115. package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
  116. package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
  117. package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
  118. package/dist/designer/assets/SvTabs-UFCMTHXS.js +1 -0
  119. package/dist/designer/assets/cell-formatting-wr5wm7US.js +1 -0
  120. package/dist/designer/assets/chart-cIPUsbM5.js +1 -0
  121. package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
  122. package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
  123. package/dist/designer/assets/chart-panel-messages-DtTxpBUU.js +1 -0
  124. package/dist/designer/assets/chart-summary-Czu_5epb.js +1 -0
  125. package/dist/designer/assets/chart-trend-D5I5VEe8.js +1 -0
  126. package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
  127. package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
  128. package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
  129. package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
  130. package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
  131. package/dist/designer/assets/export-format-D-eP4b2l.js +6 -0
  132. package/dist/designer/assets/focus-trap-CAreAhlU.js +1 -0
  133. package/dist/designer/assets/index-CMFgAoVV.css +1 -0
  134. package/dist/designer/assets/{index-zUBix-JQ.js → index-DwU7CAMm.js} +2985 -141
  135. package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
  136. package/dist/designer/assets/preload-helper-HclGiUj8.js +1 -0
  137. package/dist/designer/assets/row-resize-DLktcqUK.js +1 -0
  138. package/dist/designer/assets/src-CITpcm6b.js +1 -0
  139. package/dist/designer/assets/src-EdI3Xqds.js +58 -0
  140. package/dist/designer/index.html +32 -23
  141. package/dist/export-conditional.d.ts +1 -1
  142. package/dist/export-pdf.d.ts +89 -0
  143. package/dist/export-pdf.js +130 -0
  144. package/dist/export-print.js +19 -19
  145. package/dist/export-xls.d.ts +2 -2
  146. package/dist/export.d.ts +2 -2
  147. package/dist/export.js +23 -16
  148. package/dist/expressions/builder-tree.d.ts +2 -2
  149. package/dist/expressions/builder-tree.js +1 -1
  150. package/dist/expressions/compile.d.ts +1 -1
  151. package/dist/import.js +1 -1
  152. package/dist/index.d.ts +116 -53
  153. package/dist/index.js +117 -50
  154. package/dist/install.d.ts +4 -4
  155. package/dist/install.js +16 -11
  156. package/dist/license.d.ts +3 -2
  157. package/dist/license.js +9 -4
  158. package/dist/node/studio.js +187 -116
  159. package/dist/pivot-chart.d.ts +26 -2
  160. package/dist/pivot-chart.js +25 -69
  161. package/dist/pivot-designer.d.ts +1 -1
  162. package/dist/pivot-enable.js +3 -3
  163. package/dist/print.d.ts +1 -1
  164. package/dist/print.js +4 -4
  165. package/dist/scheduler-config.d.ts +5 -5
  166. package/dist/scheduler-freebusy.d.ts +1 -1
  167. package/dist/scheduler-freebusy.js +1 -1
  168. package/dist/scheduler.js +2 -2
  169. package/dist/schema-designer.d.ts +1 -1
  170. package/dist/schema-designer.js +2 -2
  171. package/dist/selection-bar.js +2 -2
  172. package/dist/sheet/address.d.ts +43 -0
  173. package/dist/sheet/address.js +81 -0
  174. package/dist/sheet/ast.d.ts +94 -0
  175. package/dist/sheet/ast.js +56 -0
  176. package/dist/sheet/auto-filter.d.ts +66 -0
  177. package/dist/sheet/auto-filter.js +147 -0
  178. package/dist/sheet/autocomplete.d.ts +42 -0
  179. package/dist/sheet/autocomplete.js +162 -0
  180. package/dist/sheet/coerce.d.ts +31 -0
  181. package/dist/sheet/coerce.js +122 -0
  182. package/dist/sheet/commands.d.ts +89 -0
  183. package/dist/sheet/commands.js +230 -0
  184. package/dist/sheet/comments.d.ts +29 -0
  185. package/dist/sheet/comments.js +73 -0
  186. package/dist/sheet/conditional-formats.d.ts +144 -0
  187. package/dist/sheet/conditional-formats.js +316 -0
  188. package/dist/sheet/deps.d.ts +60 -0
  189. package/dist/sheet/deps.js +199 -0
  190. package/dist/sheet/document.d.ts +150 -0
  191. package/dist/sheet/document.js +264 -0
  192. package/dist/sheet/edit-keys.d.ts +14 -0
  193. package/dist/sheet/edit-keys.js +40 -0
  194. package/dist/sheet/entry.d.ts +31 -0
  195. package/dist/sheet/entry.js +76 -0
  196. package/dist/sheet/evaluate.d.ts +61 -0
  197. package/dist/sheet/evaluate.js +337 -0
  198. package/dist/sheet/find-replace.d.ts +62 -0
  199. package/dist/sheet/find-replace.js +152 -0
  200. package/dist/sheet/format-store.d.ts +99 -0
  201. package/dist/sheet/format-store.js +233 -0
  202. package/dist/sheet/freeze.d.ts +54 -0
  203. package/dist/sheet/freeze.js +58 -0
  204. package/dist/sheet/function-catalog.d.ts +10 -0
  205. package/dist/sheet/function-catalog.js +94 -0
  206. package/dist/sheet/functions.d.ts +28 -0
  207. package/dist/sheet/functions.js +362 -0
  208. package/dist/sheet/goal-seek.d.ts +73 -0
  209. package/dist/sheet/goal-seek.js +153 -0
  210. package/dist/sheet/index.d.ts +53 -0
  211. package/dist/sheet/index.js +53 -0
  212. package/dist/sheet/merges.d.ts +71 -0
  213. package/dist/sheet/merges.js +137 -0
  214. package/dist/sheet/names.d.ts +31 -0
  215. package/dist/sheet/names.js +87 -0
  216. package/dist/sheet/navigate.d.ts +52 -0
  217. package/dist/sheet/navigate.js +135 -0
  218. package/dist/sheet/number-format.d.ts +63 -0
  219. package/dist/sheet/number-format.js +508 -0
  220. package/dist/sheet/palette.d.ts +19 -0
  221. package/dist/sheet/palette.js +84 -0
  222. package/dist/sheet/parse.d.ts +13 -0
  223. package/dist/sheet/parse.js +108 -0
  224. package/dist/sheet/paste-special.d.ts +164 -0
  225. package/dist/sheet/paste-special.js +592 -0
  226. package/dist/sheet/protection.d.ts +21 -0
  227. package/dist/sheet/protection.js +48 -0
  228. package/dist/sheet/rects.d.ts +45 -0
  229. package/dist/sheet/rects.js +112 -0
  230. package/dist/sheet/refs.d.ts +82 -0
  231. package/dist/sheet/refs.js +266 -0
  232. package/dist/sheet/ribbon-icons.d.ts +31 -0
  233. package/dist/sheet/ribbon-icons.js +350 -0
  234. package/dist/sheet/ribbon.d.ts +173 -0
  235. package/dist/sheet/ribbon.js +753 -0
  236. package/dist/sheet/shortcuts.d.ts +164 -0
  237. package/dist/sheet/shortcuts.js +623 -0
  238. package/dist/sheet/structure.d.ts +87 -0
  239. package/dist/sheet/structure.js +166 -0
  240. package/dist/sheet/tables.d.ts +70 -0
  241. package/dist/sheet/tables.js +147 -0
  242. package/dist/sheet/tokenize.d.ts +54 -0
  243. package/dist/sheet/tokenize.js +304 -0
  244. package/dist/sheet/transforms.d.ts +76 -0
  245. package/dist/sheet/transforms.js +154 -0
  246. package/dist/sheet/validation.d.ts +92 -0
  247. package/dist/sheet/validation.js +241 -0
  248. package/dist/sheet/workbook.d.ts +72 -0
  249. package/dist/sheet/workbook.js +409 -0
  250. package/dist/sheet-enable.d.ts +6 -0
  251. package/dist/sheet-enable.js +46 -0
  252. package/dist/sources/aggregate.d.ts +1 -1
  253. package/dist/sources/auth-supabase.js +1 -1
  254. package/dist/sources/dashboard.d.ts +2 -2
  255. package/dist/sources/dashboard.js +1 -1
  256. package/dist/sources/index.d.ts +13 -13
  257. package/dist/sources/index.js +13 -13
  258. package/dist/sources/realtime-supabase.js +1 -1
  259. package/dist/sources/relation-lookup.d.ts +1 -1
  260. package/dist/sources/relation-lookup.js +1 -1
  261. package/dist/sources/rest-adapters.d.ts +1 -1
  262. package/dist/sources/rest-adapters.js +1 -1
  263. package/dist/sources/rest.d.ts +2 -2
  264. package/dist/sources/rest.js +3 -3
  265. package/dist/sources/supabase.d.ts +2 -2
  266. package/dist/sources/supabase.js +3 -3
  267. package/dist/sources/with-entity-rules.d.ts +1 -1
  268. package/dist/sources/with-entity-rules.js +1 -1
  269. package/dist/sources/with-relation-labels.d.ts +1 -1
  270. package/dist/studio/emit-project.js +2161 -2127
  271. package/dist/studio/emit-schema.js +369 -369
  272. package/dist/studio/index.d.ts +1 -1
  273. package/dist/studio/index.js +1 -1
  274. package/dist/studio/introspect-db.js +45 -45
  275. package/dist/studio/project.d.ts +10 -0
  276. package/dist/studio/samples/crm.js +6 -6
  277. package/dist/studio/samples/fleet.js +7 -7
  278. package/dist/studio/samples/insurance.js +9 -9
  279. package/dist/studio/samples/inventory.js +12 -12
  280. package/dist/studio/samples/projects.js +5 -5
  281. package/dist/studio/samples/support.js +8 -8
  282. package/dist/studio/scaffold-app.js +104 -104
  283. package/dist/studio/scaffold.js +151 -151
  284. package/dist/studio/ui-components.d.ts +7 -0
  285. package/dist/studio/ui-components.generated.js +63 -1
  286. package/dist/studio/ui-components.js +35 -0
  287. package/dist/sveltekit/in-memory.d.ts +3 -3
  288. package/dist/sveltekit/in-memory.js +4 -4
  289. package/dist/sveltekit/index.d.ts +6 -6
  290. package/dist/sveltekit/index.js +5 -5
  291. package/dist/sveltekit/query-plan.d.ts +1 -1
  292. package/dist/sveltekit/sql-source.d.ts +4 -4
  293. package/dist/sveltekit/sql-source.js +4 -4
  294. package/dist/sveltekit/sql.d.ts +1 -1
  295. package/dist/sveltekit/transport.d.ts +2 -2
  296. package/dist/sveltekit/transport.js +1 -1
  297. package/dist/upgrade-prompt.js +25 -25
  298. package/dist/version.d.ts +1 -1
  299. package/dist/version.js +1 -1
  300. package/package.json +12 -4
  301. package/dist/designer/assets/GridMenus-Cgilexpk.js +0 -8
  302. package/dist/designer/assets/SvDateRangeInput-BV5OXYQ2.css +0 -1
  303. package/dist/designer/assets/SvDateRangeInput-CVn-yqrQ.js +0 -1
  304. package/dist/designer/assets/SvDateTimePicker-BdioTrJQ.js +0 -1
  305. package/dist/designer/assets/SvDateTimePicker-CY8TK4BT.css +0 -1
  306. package/dist/designer/assets/SvField-BF-9TJSd.css +0 -1
  307. package/dist/designer/assets/SvField-BsqiA5me.js +0 -1
  308. package/dist/designer/assets/SvGridCellEditor-dLY7_kk9.js +0 -2
  309. package/dist/designer/assets/SvGridChart-BEDNTdc5.js +0 -2
  310. package/dist/designer/assets/SvGridChart-Vu4Nvjiv.css +0 -1
  311. package/dist/designer/assets/SvGridChartPanel-x3lzSxuf.js +0 -10
  312. package/dist/designer/assets/SvGridChartView-CAKhPELi.js +0 -1
  313. package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +0 -1
  314. package/dist/designer/assets/SvGridDropdown-CAYG7Y-O.js +0 -1
  315. package/dist/designer/assets/SvGridDropdown-Crwb2P3Q.css +0 -1
  316. package/dist/designer/assets/SvListBox-CVYQcLX9.js +0 -1
  317. package/dist/designer/assets/SvListBox-DgN8kvjt.css +0 -1
  318. package/dist/designer/assets/chart-DHEgt4lN.js +0 -1
  319. package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
  320. package/dist/designer/assets/date-format-4DJvNtG2.js +0 -1
  321. package/dist/designer/assets/date-format-Dzy4mTGh.css +0 -1
  322. package/dist/designer/assets/easing-zaypKrr0.js +0 -3
  323. package/dist/designer/assets/export-format-DwjuTfrQ.js +0 -6
  324. package/dist/designer/assets/index-Cp7fDJ3b.css +0 -1
  325. package/dist/designer/assets/js-scroller.svelte-Bhxqb3-c.js +0 -110
  326. package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
  327. package/dist/designer/assets/src-B7DNcoQK.css +0 -1
  328. package/dist/designer/assets/src-BoYyigAC.js +0 -2896
  329. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
  330. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
  331. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -3875
  332. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -1
  333. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -21
  334. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -1
  335. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -1938
  336. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -1
  337. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -205
  338. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -1
  339. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -18
  340. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -1
  341. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -264
  342. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -1
  343. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -697
  344. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -1
  345. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
  346. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
  347. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
  348. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
  349. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
  350. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
  351. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
  352. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
  353. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
  354. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
  355. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
  356. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
  357. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
  358. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
  359. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
  360. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
  361. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
  362. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
  363. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
  364. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
  365. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
  366. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
  367. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
  368. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
  369. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
  370. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
  371. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
  372. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
  373. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
  374. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
  375. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
  376. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
  377. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
  378. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
  379. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
  380. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
  381. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -4938
  382. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -1
  383. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -495
  384. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -1
  385. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -190
  386. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -1
  387. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -8
  388. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -1
  389. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -138
  390. package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -1
@@ -0,0 +1,508 @@
1
+ /**
2
+ * Excel number-format strings, compiled once and applied many times.
3
+ *
4
+ * The grammar is small but full of traps, so this file is explicit about the
5
+ * ones that bite:
6
+ *
7
+ * - A pattern has up to four sections separated by `;`:
8
+ * positive;negative;zero;text. With two, the second covers negatives AND
9
+ * zero. With one, it covers everything. A negative rendered by section two
10
+ * uses its ABSOLUTE value, which is why `0.00;(0.00)` shows `(1.50)` and
11
+ * not `(-1.50)`.
12
+ * - `,` means two different things. Between placeholders it is a thousands
13
+ * separator; immediately before the decimal point (or at the end) it scales
14
+ * the number down by a thousand per comma.
15
+ * - `%` scales UP by 100 and prints a literal percent.
16
+ * - `0` prints a digit or a zero, `#` prints a digit or nothing, `?` prints a
17
+ * digit or a space. They can be mixed: `#,##0.0#` keeps one decimal always
18
+ * and a second only when it is there.
19
+ * - Anything in quotes, after a backslash, or in the set of always-literal
20
+ * characters is emitted as-is.
21
+ * - `[Red]` and friends set a colour rather than printing.
22
+ * - `@` is the text placeholder and only appears in the fourth section.
23
+ *
24
+ * Dates are detected rather than configured: a pattern containing date tokens
25
+ * outside quotes is a date pattern. `m` is minutes when it follows an hour
26
+ * token and months otherwise, which is the one piece of context the token
27
+ * scanner has to carry.
28
+ */
29
+ const COLORS = {
30
+ BLACK: '#000000', BLUE: '#0000ff', CYAN: '#00ffff', GREEN: '#008000',
31
+ MAGENTA: '#ff00ff', RED: '#ff0000', WHITE: '#ffffff', YELLOW: '#ffff00',
32
+ };
33
+ /** Split on `;` at the top level, ignoring separators inside quotes, brackets
34
+ * or escapes. A naive `pattern.split(';')` breaks `"a;b"` and `[<100]`. */
35
+ function splitSections(pattern) {
36
+ const out = [];
37
+ let current = '';
38
+ let inQuote = false;
39
+ let inBracket = false;
40
+ for (let i = 0; i < pattern.length; i += 1) {
41
+ const ch = pattern[i];
42
+ if (ch === '\\') {
43
+ current += ch + (pattern[i + 1] ?? '');
44
+ i += 1;
45
+ continue;
46
+ }
47
+ if (ch === '"') {
48
+ inQuote = !inQuote;
49
+ current += ch;
50
+ continue;
51
+ }
52
+ if (!inQuote && ch === '[') {
53
+ inBracket = true;
54
+ current += ch;
55
+ continue;
56
+ }
57
+ if (!inQuote && ch === ']') {
58
+ inBracket = false;
59
+ current += ch;
60
+ continue;
61
+ }
62
+ if (ch === ';' && !inQuote && !inBracket) {
63
+ out.push(current);
64
+ current = '';
65
+ continue;
66
+ }
67
+ current += ch;
68
+ }
69
+ out.push(current);
70
+ return out;
71
+ }
72
+ function parseSection(raw) {
73
+ let color;
74
+ let body = '';
75
+ // Walk rather than regex-replace: a pattern like `"[" @ "]"` has brackets
76
+ // INSIDE quoted literals, and a global /\[[^\]]*\]/ happily eats the text
77
+ // between them.
78
+ for (let i = 0; i < raw.length; i += 1) {
79
+ const ch = raw[i];
80
+ if (ch === '\\') {
81
+ body += ch + (raw[i + 1] ?? '');
82
+ i += 1;
83
+ continue;
84
+ }
85
+ if (ch === '"') {
86
+ const end = raw.indexOf('"', i + 1);
87
+ const stop = end < 0 ? raw.length : end;
88
+ body += raw.slice(i, stop + 1);
89
+ i = stop;
90
+ continue;
91
+ }
92
+ if (ch === '[') {
93
+ const end = raw.indexOf(']', i + 1);
94
+ if (end < 0) {
95
+ body += ch;
96
+ continue;
97
+ }
98
+ const inner = raw.slice(i + 1, end).trim().toUpperCase();
99
+ const named = COLORS[inner];
100
+ if (named)
101
+ color = named;
102
+ // Anything else (a condition like [<100]) is unsupported: drop it rather
103
+ // than print it.
104
+ i = end;
105
+ continue;
106
+ }
107
+ body += ch;
108
+ }
109
+ return { raw, color, body };
110
+ }
111
+ const DATE_TOKEN = /^(yyyy|yy|mmmm|mmm|mm|m|dddd|ddd|dd|d|hh|h|ss|s|AM\/PM|am\/pm|A\/P)/;
112
+ /** Does this section describe a date? Scans outside quotes and escapes. */
113
+ function looksLikeDate(body) {
114
+ for (let i = 0; i < body.length; i += 1) {
115
+ const ch = body[i];
116
+ if (ch === '\\') {
117
+ i += 1;
118
+ continue;
119
+ }
120
+ if (ch === '"') {
121
+ const end = body.indexOf('"', i + 1);
122
+ i = end < 0 ? body.length : end;
123
+ continue;
124
+ }
125
+ if (DATE_TOKEN.test(body.slice(i))) {
126
+ // `m` alone is ambiguous with the thousands/number grammar only in
127
+ // theory: a numeric pattern never contains a bare letter outside quotes.
128
+ return true;
129
+ }
130
+ }
131
+ return false;
132
+ }
133
+ const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June',
134
+ 'July', 'August', 'September', 'October', 'November', 'December'];
135
+ const DAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
136
+ const pad2 = (n) => String(n).padStart(2, '0');
137
+ function toDate(value) {
138
+ if (value instanceof Date)
139
+ return value;
140
+ if (typeof value === 'number') {
141
+ // Excel serial day, with the usual 1899-12-30 epoch. That is correct for
142
+ // every date from 1900-03-01 on, which is every date anyone stores. Excel
143
+ // itself is a day out below serial 61 because it counts a 1900-02-29 that
144
+ // never existed; matching that bug exactly would break real dates.
145
+ return new Date(Date.UTC(1899, 11, 30) + value * 86400000);
146
+ }
147
+ if (typeof value === 'string' && value.trim() !== '') {
148
+ const d = new Date(value);
149
+ return Number.isNaN(d.getTime()) ? null : d;
150
+ }
151
+ return null;
152
+ }
153
+ function renderDate(body, date) {
154
+ let out = '';
155
+ let sawHour = false;
156
+ for (let i = 0; i < body.length; i += 1) {
157
+ const ch = body[i];
158
+ if (ch === '\\') {
159
+ out += body[i + 1] ?? '';
160
+ i += 1;
161
+ continue;
162
+ }
163
+ if (ch === '"') {
164
+ const end = body.indexOf('"', i + 1);
165
+ out += body.slice(i + 1, end < 0 ? body.length : end);
166
+ i = end < 0 ? body.length : end;
167
+ continue;
168
+ }
169
+ const m = DATE_TOKEN.exec(body.slice(i));
170
+ if (!m) {
171
+ out += ch;
172
+ continue;
173
+ }
174
+ const token = m[1];
175
+ i += token.length - 1;
176
+ switch (token) {
177
+ case 'yyyy':
178
+ out += date.getUTCFullYear();
179
+ break;
180
+ case 'yy':
181
+ out += pad2(date.getUTCFullYear() % 100);
182
+ break;
183
+ case 'mmmm':
184
+ out += MONTHS[date.getUTCMonth()];
185
+ break;
186
+ case 'mmm':
187
+ out += MONTHS[date.getUTCMonth()].slice(0, 3);
188
+ break;
189
+ case 'dddd':
190
+ out += DAYS[date.getUTCDay()];
191
+ break;
192
+ case 'ddd':
193
+ out += DAYS[date.getUTCDay()].slice(0, 3);
194
+ break;
195
+ case 'dd':
196
+ out += pad2(date.getUTCDate());
197
+ break;
198
+ case 'd':
199
+ out += date.getUTCDate();
200
+ break;
201
+ case 'hh':
202
+ out += pad2(date.getUTCHours());
203
+ sawHour = true;
204
+ break;
205
+ case 'h':
206
+ out += date.getUTCHours();
207
+ sawHour = true;
208
+ break;
209
+ case 'ss':
210
+ out += pad2(date.getUTCSeconds());
211
+ break;
212
+ case 's':
213
+ out += date.getUTCSeconds();
214
+ break;
215
+ case 'AM/PM':
216
+ case 'am/pm':
217
+ case 'A/P':
218
+ out += date.getUTCHours() < 12 ? 'AM' : 'PM';
219
+ break;
220
+ // `m` and `mm` are MINUTES after an hour token, MONTHS otherwise. This
221
+ // is the one piece of context the scanner carries, and getting it wrong
222
+ // turns 09:05 into 09:09.
223
+ case 'mm':
224
+ out += sawHour ? pad2(date.getUTCMinutes()) : pad2(date.getUTCMonth() + 1);
225
+ break;
226
+ case 'm':
227
+ out += sawHour ? date.getUTCMinutes() : date.getUTCMonth() + 1;
228
+ break;
229
+ default: out += token;
230
+ }
231
+ }
232
+ return out;
233
+ }
234
+ /** Pull a numeric section apart into literal text and digit placeholders. */
235
+ function planNumeric(body) {
236
+ let prefix = '';
237
+ let suffix = '';
238
+ let intPlaceholders = '';
239
+ let fracPlaceholders = '';
240
+ let useGrouping = false;
241
+ let percent = false;
242
+ let scientific = false;
243
+ let expPlaceholders = '';
244
+ let scale = 1;
245
+ let seenPlaceholder = false;
246
+ let afterDecimal = false;
247
+ for (let i = 0; i < body.length; i += 1) {
248
+ const ch = body[i];
249
+ if (ch === '\\') {
250
+ const next = body[i + 1] ?? '';
251
+ if (seenPlaceholder)
252
+ suffix += next;
253
+ else
254
+ prefix += next;
255
+ i += 1;
256
+ continue;
257
+ }
258
+ if (ch === '"') {
259
+ const end = body.indexOf('"', i + 1);
260
+ const text = body.slice(i + 1, end < 0 ? body.length : end);
261
+ if (seenPlaceholder)
262
+ suffix += text;
263
+ else
264
+ prefix += text;
265
+ i = end < 0 ? body.length : end;
266
+ continue;
267
+ }
268
+ if (ch === '0' || ch === '#' || ch === '?') {
269
+ seenPlaceholder = true;
270
+ // After an E+ the placeholders size the EXPONENT, not the mantissa.
271
+ // Counting them as decimals turns 0.00E+00 into four decimal places.
272
+ if (scientific)
273
+ expPlaceholders += ch;
274
+ else if (afterDecimal)
275
+ fracPlaceholders += ch;
276
+ else
277
+ intPlaceholders += ch;
278
+ continue;
279
+ }
280
+ if (ch === '.') {
281
+ afterDecimal = true;
282
+ seenPlaceholder = true;
283
+ continue;
284
+ }
285
+ if (ch === ',') {
286
+ // A comma between placeholders groups; one trailing (before the decimal
287
+ // point or at the end of the pattern) scales by a thousand.
288
+ const rest = body.slice(i + 1);
289
+ if (/^[0#?]/.test(rest))
290
+ useGrouping = true;
291
+ else
292
+ scale *= 1000;
293
+ continue;
294
+ }
295
+ if (ch === '%') {
296
+ percent = true;
297
+ if (seenPlaceholder)
298
+ suffix += '%';
299
+ else
300
+ prefix += '%';
301
+ continue;
302
+ }
303
+ if ((ch === 'E' || ch === 'e') && /^[+-]/.test(body.slice(i + 1))) {
304
+ scientific = true;
305
+ i += 1;
306
+ continue;
307
+ }
308
+ if (seenPlaceholder)
309
+ suffix += ch;
310
+ else
311
+ prefix += ch;
312
+ }
313
+ return {
314
+ prefix, suffix, intPlaceholders, fracPlaceholders, expPlaceholders,
315
+ useGrouping, scale, percent, scientific,
316
+ };
317
+ }
318
+ function group(intText) {
319
+ return intText.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
320
+ }
321
+ function renderNumeric(plan, value) {
322
+ let n = value;
323
+ if (plan.percent)
324
+ n *= 100;
325
+ if (plan.scale !== 1)
326
+ n /= plan.scale;
327
+ if (plan.scientific) {
328
+ const text = n.toExponential(plan.fracPlaceholders.length);
329
+ // toExponential gives "1.23e+4"; Excel writes the exponent with at least
330
+ // as many digits as the pattern asked for.
331
+ const [mantissa = '', exponent = ''] = text.split('e');
332
+ const sign = exponent.startsWith('-') ? '-' : '+';
333
+ const digits = exponent.replace(/^[+-]/, '').padStart(plan.expPlaceholders.length || 1, '0');
334
+ return `${plan.prefix}${mantissa}E${sign}${digits}${plan.suffix}`;
335
+ }
336
+ const decimals = plan.fracPlaceholders.length;
337
+ const fixed = Math.abs(n).toFixed(decimals);
338
+ const [rawInt = '0', rawFrac = ''] = fixed.split('.');
339
+ // Pad the integer side out to the number of `0` placeholders, and drop a
340
+ // leading zero entirely when the pattern is all `#`.
341
+ const minInt = plan.intPlaceholders.split('').filter((c) => c === '0').length;
342
+ let intText = rawInt;
343
+ if (intText.length < minInt)
344
+ intText = intText.padStart(minInt, '0');
345
+ if (minInt === 0 && intText === '0' && plan.intPlaceholders.length > 0)
346
+ intText = '';
347
+ if (plan.useGrouping && intText !== '')
348
+ intText = group(intText);
349
+ // Trim optional decimals from the right: `0.0#` on 1.5 gives "1.5", not
350
+ // "1.50". A `0` placeholder is never trimmed, a `#` always may be, and a
351
+ // `?` becomes a space so columns line up.
352
+ let fracText = rawFrac;
353
+ for (let i = plan.fracPlaceholders.length - 1; i >= 0; i -= 1) {
354
+ const kind = plan.fracPlaceholders[i];
355
+ if (kind === '0')
356
+ break;
357
+ if (fracText[i] !== '0')
358
+ break;
359
+ fracText = kind === '?' ? `${fracText.slice(0, i)} ` : fracText.slice(0, i);
360
+ }
361
+ const body = fracText === '' ? intText : `${intText}.${fracText}`;
362
+ // `#` on zero prints nothing, which is how "hide zeros" patterns work. The
363
+ // fallback below is only for a pattern with no digit placeholders at all.
364
+ return plan.prefix + body + plan.suffix;
365
+ }
366
+ /** A section with no digit placeholders is pure literal text: `"-"` as the
367
+ * zero section must print `-`, not `-0`. */
368
+ function hasPlaceholders(plan) {
369
+ return plan.intPlaceholders !== '' || plan.fracPlaceholders !== '';
370
+ }
371
+ /** Excel's General: up to 11 significant digits, no trailing zeros. */
372
+ function general(value) {
373
+ if (typeof value === 'number') {
374
+ if (!Number.isFinite(value))
375
+ return String(value);
376
+ if (Number.isInteger(value))
377
+ return String(value);
378
+ return String(Number(value.toPrecision(11)));
379
+ }
380
+ if (typeof value === 'boolean')
381
+ return value ? 'TRUE' : 'FALSE';
382
+ return value === null || value === undefined ? '' : String(value);
383
+ }
384
+ /**
385
+ * Compile a format string. Compilation is cached per pattern, so a column of
386
+ * ten thousand cells sharing one format parses it once.
387
+ */
388
+ const cache = new Map();
389
+ export function compileNumberFormat(pattern) {
390
+ const hit = cache.get(pattern);
391
+ if (hit)
392
+ return hit;
393
+ const sections = splitSections(pattern).map(parseSection);
394
+ const positive = sections[0];
395
+ const negative = sections[1];
396
+ const zero = sections[2];
397
+ const text = sections[3];
398
+ // Plans are built once here, not per value.
399
+ const plans = new Map();
400
+ const dateFlags = new Map();
401
+ for (const s of sections) {
402
+ if (!s)
403
+ continue;
404
+ const isDate = looksLikeDate(s.body);
405
+ dateFlags.set(s, isDate);
406
+ if (!isDate)
407
+ plans.set(s, planNumeric(s.body));
408
+ }
409
+ const compiled = {
410
+ pattern,
411
+ format(value) {
412
+ if (pattern.trim() === '' || pattern.toUpperCase() === 'GENERAL') {
413
+ return { text: general(value) };
414
+ }
415
+ if (typeof value === 'string' && value !== '') {
416
+ const section = text ?? positive;
417
+ if (!section)
418
+ return { text: value };
419
+ // The text section substitutes @ for the value; without an @ the
420
+ // section's literal text is all you get.
421
+ const body = section.body.includes('@')
422
+ ? section.body.replace(/@/g, value).replace(/"/g, '')
423
+ : value;
424
+ return { text: body, color: section.color };
425
+ }
426
+ if (value === null || value === undefined || value === '')
427
+ return { text: '' };
428
+ if (typeof value === 'boolean')
429
+ return { text: value ? 'TRUE' : 'FALSE' };
430
+ const n = typeof value === 'number' ? value : Number(value);
431
+ if (!Number.isFinite(n)) {
432
+ const d = toDate(value);
433
+ if (d && positive && dateFlags.get(positive)) {
434
+ return { text: renderDate(positive.body, d), color: positive.color };
435
+ }
436
+ return { text: String(value) };
437
+ }
438
+ // Pick the section. Two sections means the second covers zero too.
439
+ let section = positive;
440
+ if (n < 0 && negative)
441
+ section = negative;
442
+ else if (n === 0 && zero)
443
+ section = zero;
444
+ if (!section)
445
+ return { text: general(value) };
446
+ if (dateFlags.get(section)) {
447
+ const d = toDate(value);
448
+ return d
449
+ ? { text: renderDate(section.body, d), color: section.color }
450
+ : { text: general(value) };
451
+ }
452
+ const plan = plans.get(section);
453
+ if (!hasPlaceholders(plan)) {
454
+ return { text: plan.prefix + plan.suffix, color: section.color };
455
+ }
456
+ // A negative shown by its own section renders its ABSOLUTE value: the
457
+ // section supplies the sign, usually as parentheses or a literal minus.
458
+ const usingNegativeSection = n < 0 && section === negative;
459
+ const magnitude = usingNegativeSection ? Math.abs(n) : n;
460
+ let out = renderNumeric(plan, magnitude);
461
+ // With no negative section, put the sign back on.
462
+ if (n < 0 && !usingNegativeSection && !out.startsWith('-'))
463
+ out = `-${out}`;
464
+ return { text: out, color: section.color };
465
+ },
466
+ };
467
+ cache.set(pattern, compiled);
468
+ return compiled;
469
+ }
470
+ /** Format one value against a pattern. Convenience over compile-then-call. */
471
+ export function formatWithPattern(value, pattern) {
472
+ return compileNumberFormat(pattern).format(value).text;
473
+ }
474
+ /** The presets behind Ctrl+Shift+1 through 6. */
475
+ export const FORMAT_PRESETS = {
476
+ general: 'General',
477
+ number: '#,##0.00',
478
+ time: 'h:mm AM/PM',
479
+ date: 'yyyy-mm-dd',
480
+ currency: '$#,##0.00;($#,##0.00)',
481
+ percent: '0.00%',
482
+ scientific: '0.00E+00',
483
+ };
484
+ /**
485
+ * Which of Excel's categories a pattern belongs to, with the decimals and
486
+ * separator it carries, so the ribbon's combo can say "Percentage" for a
487
+ * cell holding `0%` (a typed 12%) as well as for the preset's `0.00%`, and
488
+ * Format Cells can open on the right category. A pattern that is none of
489
+ * them is 'custom'.
490
+ */
491
+ export function formatCategory(fmt) {
492
+ if (!fmt || fmt === 'General')
493
+ return { category: 'general', decimals: 2, thousands: true };
494
+ const decimals = fmt.match(/\.(0+)/)?.[1]?.length ?? 0;
495
+ if (/E\+/i.test(fmt))
496
+ return { category: 'scientific', decimals, thousands: false };
497
+ if (/%$/.test(fmt))
498
+ return { category: 'percent', decimals, thousands: false };
499
+ if (/^\$/.test(fmt))
500
+ return { category: 'currency', decimals, thousands: true };
501
+ if (/[hs]:|AM\/PM/i.test(fmt))
502
+ return { category: 'time', decimals: 0, thousands: false };
503
+ if (/y|d/i.test(fmt) && !/[#0]/.test(fmt))
504
+ return { category: 'date', decimals: 0, thousands: false };
505
+ if (/^#?,?#*0(\.0+)?$/.test(fmt))
506
+ return { category: 'number', decimals, thousands: fmt.includes(',') };
507
+ return { category: 'custom', decimals, thousands: false };
508
+ }
@@ -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;