@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,152 @@
1
+ let target = null;
2
+ export function setFindTarget(next) {
3
+ target = next;
4
+ }
5
+ export function getFindTarget() {
6
+ return target;
7
+ }
8
+ function textOf(t, r, c, lookIn) {
9
+ if (lookIn === 'formulas')
10
+ return t.getRaw(r, c);
11
+ return t.getDisplay ? t.getDisplay(r, c) : t.getRaw(r, c);
12
+ }
13
+ /** Does `haystack` match `needle` under these options? */
14
+ export function cellMatches(haystack, needle, opts = {}) {
15
+ if (needle === '')
16
+ return false;
17
+ const a = opts.matchCase ? haystack : haystack.toLowerCase();
18
+ const b = opts.matchCase ? needle : needle.toLowerCase();
19
+ return opts.matchEntireCell ? a === b : a.includes(b);
20
+ }
21
+ /** Every cell matching, in reading order. */
22
+ export function findAll(cmd, needle, opts = {}) {
23
+ const t = target;
24
+ if (!t || needle === '')
25
+ return [];
26
+ const lookIn = opts.lookIn ?? 'values';
27
+ const bounds = opts.scope === 'selection' ? cmd.ranges : null;
28
+ const hits = [];
29
+ const inScope = (r, c) => {
30
+ if (!bounds)
31
+ return true;
32
+ return bounds.some(([minRow, minCol, maxRow, maxCol]) => r >= minRow && r <= maxRow && c >= minCol && c <= maxCol);
33
+ };
34
+ for (let r = 0; r < cmd.rowCount; r += 1) {
35
+ for (let c = 0; c < cmd.colCount; c += 1) {
36
+ if (!inScope(r, c))
37
+ continue;
38
+ if (cellMatches(textOf(t, r, c, lookIn), needle, opts))
39
+ hits.push({ rowIndex: r, colIndex: c });
40
+ }
41
+ }
42
+ return hits;
43
+ }
44
+ /** The next hit after the active cell, wrapping. Null when there are none. */
45
+ export function findNext(cmd, needle, opts = {}, direction = 1) {
46
+ const hits = findAll(cmd, needle, opts);
47
+ if (hits.length === 0)
48
+ return null;
49
+ const active = cmd.activeCell;
50
+ if (!active)
51
+ return hits[0];
52
+ const key = (h) => h.rowIndex * cmd.colCount + h.colIndex;
53
+ const here = active.rowIndex * cmd.colCount + active.colIndex;
54
+ if (direction === 1) {
55
+ return hits.find((h) => key(h) > here) ?? hits[0];
56
+ }
57
+ // Reverse: the last hit strictly before the active cell, else wrap to the end.
58
+ for (let i = hits.length - 1; i >= 0; i -= 1) {
59
+ if (key(hits[i]) < here)
60
+ return hits[i];
61
+ }
62
+ return hits[hits.length - 1];
63
+ }
64
+ /** Replace inside one string, honouring case sensitivity and whole-cell. */
65
+ export function replaceInText(haystack, needle, replacement, opts = {}) {
66
+ if (needle === '')
67
+ return haystack;
68
+ if (opts.matchEntireCell) {
69
+ return cellMatches(haystack, needle, opts) ? replacement : haystack;
70
+ }
71
+ if (opts.matchCase)
72
+ return haystack.split(needle).join(replacement);
73
+ // Case-insensitive substring replace, without a regex: the needle is user
74
+ // input and escaping it correctly is more code than scanning for it.
75
+ const lowerHay = haystack.toLowerCase();
76
+ const lowerNeedle = needle.toLowerCase();
77
+ let out = '';
78
+ let i = 0;
79
+ for (;;) {
80
+ const at = lowerHay.indexOf(lowerNeedle, i);
81
+ if (at < 0) {
82
+ out += haystack.slice(i);
83
+ break;
84
+ }
85
+ out += haystack.slice(i, at) + replacement;
86
+ i = at + needle.length;
87
+ }
88
+ return out;
89
+ }
90
+ /**
91
+ * Replace the active cell if it matches, then move to the next hit. Returns
92
+ * whether anything was written.
93
+ */
94
+ export function replaceOne(cmd, needle, replacement, opts = {}) {
95
+ const t = target;
96
+ const active = cmd.activeCell;
97
+ if (!t || !active || needle === '')
98
+ return false;
99
+ const { rowIndex: r, colIndex: c } = active;
100
+ const lookIn = opts.lookIn ?? 'values';
101
+ const editable = t.isEditable?.(r, c) ?? true;
102
+ let wrote = false;
103
+ if (editable && cellMatches(textOf(t, r, c, lookIn), needle, opts)) {
104
+ // Always write through the RAW text: replacing inside a displayed value
105
+ // would overwrite a formula with its own result.
106
+ const raw = t.getRaw(r, c);
107
+ const next = replaceInText(raw, needle, replacement, opts);
108
+ if (next !== raw) {
109
+ t.setRaw(r, c, next);
110
+ t.onChange?.();
111
+ wrote = true;
112
+ }
113
+ }
114
+ const following = findNext(cmd, needle, opts);
115
+ if (following) {
116
+ cmd.setActiveCell(following.rowIndex, following.colIndex);
117
+ cmd.setSelection(following.rowIndex, following.colIndex);
118
+ cmd.scrollIntoView(following.rowIndex, following.colIndex);
119
+ }
120
+ return wrote;
121
+ }
122
+ /**
123
+ * Replace every match. Returns how many cells changed.
124
+ *
125
+ * Runs inside `cmd.batch`, so a hundred replacements are ONE Ctrl+Z. Without
126
+ * that this would be the single worst thing in the feature set for undo: it is
127
+ * the one command that routinely writes more cells than the history can hold.
128
+ */
129
+ export function replaceAll(cmd, needle, replacement, opts = {}) {
130
+ const t = target;
131
+ if (!t || needle === '')
132
+ return 0;
133
+ const hits = findAll(cmd, needle, opts);
134
+ if (hits.length === 0)
135
+ return 0;
136
+ return cmd.batch(() => {
137
+ let changed = 0;
138
+ for (const { rowIndex: r, colIndex: c } of hits) {
139
+ if (!(t.isEditable?.(r, c) ?? true))
140
+ continue;
141
+ const raw = t.getRaw(r, c);
142
+ const next = replaceInText(raw, needle, replacement, opts);
143
+ if (next === raw)
144
+ continue;
145
+ t.setRaw(r, c, next);
146
+ changed += 1;
147
+ }
148
+ if (changed > 0)
149
+ t.onChange?.();
150
+ return changed;
151
+ });
152
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Per-cell formats and styles, keyed so they survive the grid moving rows
3
+ * around.
4
+ *
5
+ * Demo 27 keys its format map by DISPLAY row index. Sort the grid and every
6
+ * bold cell moves to whatever row now sits at that index, which is the kind of
7
+ * bug that looks like a rendering glitch and is actually lost data. This keys
8
+ * by `rowId:columnId`, the same shape the grid already uses for `notes`, so
9
+ * sorting, filtering, column reordering and pagination all leave it alone.
10
+ *
11
+ * Storage is sparse: a sheet of ten thousand cells with three bold ones holds
12
+ * three entries. Most cells have no entry at all and cost nothing.
13
+ */
14
+ import type { BorderSpec } from '@svgrid/grid';
15
+ /** One cell's formatting. Every field optional; absent means inherit. */
16
+ /** The boolean fields `toggle` can flip. Every one of them is a plain
17
+ * on/off attribute of a cell, which is what makes Excel's all-on-turns-off
18
+ * rule the right one for all of them. */
19
+ export type ToggleableField = 'bold' | 'italic' | 'underline' | 'strike' | 'wrap';
20
+ export type CellFormatEntry = {
21
+ /** Excel number-format string, e.g. '#,##0.00'. */
22
+ numFmt?: string;
23
+ bold?: boolean;
24
+ italic?: boolean;
25
+ underline?: boolean;
26
+ strike?: boolean;
27
+ /** Text colour, any CSS colour. */
28
+ color?: string;
29
+ /** Background fill. */
30
+ fill?: string;
31
+ align?: 'left' | 'center' | 'right';
32
+ fontFamily?: string;
33
+ fontSize?: number;
34
+ wrap?: boolean;
35
+ indent?: number;
36
+ border?: {
37
+ top?: BorderSpec;
38
+ right?: BorderSpec;
39
+ bottom?: BorderSpec;
40
+ left?: BorderSpec;
41
+ };
42
+ /**
43
+ * Excel's Locked flag from Format Cells > Protection. Every cell is locked
44
+ * unless told otherwise, so only `false` is ever stored; the flag means
45
+ * nothing until the sheet is protected, when a locked cell refuses edits.
46
+ */
47
+ locked?: boolean;
48
+ };
49
+ export type Rect = readonly [minRow: number, minCol: number, maxRow: number, maxCol: number];
50
+ /** Translates a display position to the stable ids the store keys on. */
51
+ export type CellAddressLookup = {
52
+ rowIdAt(rowIndex: number): string | null;
53
+ columnIdAt(colIndex: number): string | null;
54
+ };
55
+ export type SheetFormatStore = {
56
+ get(rowId: string, columnId: string): CellFormatEntry | undefined;
57
+ /** Merge `patch` into every cell of every rect. A field set to `undefined`
58
+ * is REMOVED, which is how you clear one attribute without clearing the
59
+ * cell; `clear` removes the whole entry. An entry left with no fields is
60
+ * dropped rather than kept as an empty object. */
61
+ set(rects: ReadonlyArray<Rect>, patch: CellFormatEntry, at: CellAddressLookup): void;
62
+ /** Remove all formatting from every cell of every rect. */
63
+ clear(rects: ReadonlyArray<Rect>, at: CellAddressLookup): void;
64
+ /** Toggle one boolean field across a range. Excel's rule: if EVERY cell in
65
+ * the range already has it, turn it off; otherwise turn it on. */
66
+ toggle(rects: ReadonlyArray<Rect>, field: ToggleableField, at: CellAddressLookup): void;
67
+ /** Drop every entry for a row. Call when a row is deleted, or the store
68
+ * leaks an entry per removed row for the life of the session. */
69
+ forgetRow(rowId: string): void;
70
+ forgetColumn(columnId: string): void;
71
+ /** How many cells carry formatting. For tests and diagnostics. */
72
+ readonly size: number;
73
+ serialize(): Record<string, CellFormatEntry>;
74
+ hydrate(entries: Record<string, CellFormatEntry>): void;
75
+ clearAll(): void;
76
+ /**
77
+ * Rename every row id at once; `fn` returns the new id, or null to drop
78
+ * the row's entries. For a store keyed on record ids this is never
79
+ * needed - an id travels with its record - but a SHEET keys rows by
80
+ * position (`r4` is the fifth row and nothing else), so inserting a row
81
+ * above the fifth has to move its formats to `r5`, or the band stays on
82
+ * row five while the cells it belonged to move down.
83
+ */
84
+ remapRows(fn: (rowId: string) => string | null): void;
85
+ /** The same for column ids. */
86
+ remapColumns(fn: (columnId: string) => string | null): void;
87
+ };
88
+ export declare function createFormatStore(initial?: Record<string, CellFormatEntry>): SheetFormatStore;
89
+ /** Turn an entry into inline style text for a cell renderer. */
90
+ export declare function entryToStyle(entry: CellFormatEntry | undefined): string;
91
+ /**
92
+ * Cell borders as inset shadows, one per side.
93
+ *
94
+ * The cell span fills its td edge to edge, so an inset shadow along one
95
+ * edge is a border that costs no layout: a real border would push the text
96
+ * and change the cell's size, and a bordered cell next to a plain one would
97
+ * misalign. Shadows stack, so a cell can carry any combination of sides.
98
+ */
99
+ export declare function borderShadows(border: CellFormatEntry['border']): string;
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Keys are "rowId columnId" with each half percent-encoded.
3
+ *
4
+ * Encoding is what makes the key reversible. Ids come from the grid and may
5
+ * contain spaces, so a plain join cannot be split back apart - and `hydrate`
6
+ * has to split it, or the row and column indexes come back empty and
7
+ * `forgetRow` / `forgetColumn` become silent no-ops on a restored store.
8
+ */
9
+ function keyOf(rowId, columnId) {
10
+ return `${encodeURIComponent(rowId)} ${encodeURIComponent(columnId)}`;
11
+ }
12
+ function splitKey(key) {
13
+ const gap = key.indexOf(' ');
14
+ if (gap < 0)
15
+ return null;
16
+ try {
17
+ return {
18
+ rowId: decodeURIComponent(key.slice(0, gap)),
19
+ columnId: decodeURIComponent(key.slice(gap + 1)),
20
+ };
21
+ }
22
+ catch {
23
+ return null;
24
+ }
25
+ }
26
+ export function createFormatStore(initial) {
27
+ const cells = new Map();
28
+ const rowsIndex = new Map();
29
+ const colsIndex = new Map();
30
+ function remember(rowId, columnId, key) {
31
+ let byRow = rowsIndex.get(rowId);
32
+ if (!byRow) {
33
+ byRow = new Set();
34
+ rowsIndex.set(rowId, byRow);
35
+ }
36
+ byRow.add(key);
37
+ let byCol = colsIndex.get(columnId);
38
+ if (!byCol) {
39
+ byCol = new Set();
40
+ colsIndex.set(columnId, byCol);
41
+ }
42
+ byCol.add(key);
43
+ }
44
+ function eachCell(rects, at, fn) {
45
+ const seen = new Set();
46
+ for (const [minRow, minCol, maxRow, maxCol] of rects) {
47
+ for (let r = minRow; r <= maxRow; r += 1) {
48
+ const rowId = at.rowIdAt(r);
49
+ if (rowId === null)
50
+ continue;
51
+ for (let c = minCol; c <= maxCol; c += 1) {
52
+ const columnId = at.columnIdAt(c);
53
+ if (columnId === null)
54
+ continue;
55
+ // Overlapping ranges must not apply a toggle twice.
56
+ const key = keyOf(rowId, columnId);
57
+ if (seen.has(key))
58
+ continue;
59
+ seen.add(key);
60
+ fn(rowId, columnId);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ const store = {
66
+ get(rowId, columnId) {
67
+ return cells.get(keyOf(rowId, columnId));
68
+ },
69
+ set(rects, patch, at) {
70
+ eachCell(rects, at, (rowId, columnId) => {
71
+ const key = keyOf(rowId, columnId);
72
+ const next = { ...(cells.get(key) ?? {}), ...patch };
73
+ // Strip keys explicitly set to undefined so an entry does not grow
74
+ // a field that means nothing.
75
+ for (const [k, v] of Object.entries(next)) {
76
+ if (v === undefined)
77
+ delete next[k];
78
+ }
79
+ if (Object.keys(next).length === 0) {
80
+ cells.delete(key);
81
+ return;
82
+ }
83
+ cells.set(key, next);
84
+ remember(rowId, columnId, key);
85
+ });
86
+ },
87
+ clear(rects, at) {
88
+ eachCell(rects, at, (rowId, columnId) => {
89
+ cells.delete(keyOf(rowId, columnId));
90
+ });
91
+ },
92
+ toggle(rects, field, at) {
93
+ // Excel's rule, and the one users expect: a mixed selection turns ON.
94
+ let all = true;
95
+ eachCell(rects, at, (rowId, columnId) => {
96
+ if (!cells.get(keyOf(rowId, columnId))?.[field])
97
+ all = false;
98
+ });
99
+ // `set` treats undefined as "remove this field", so one pass does both
100
+ // directions.
101
+ store.set(rects, { [field]: all ? undefined : true }, at);
102
+ },
103
+ forgetRow(rowId) {
104
+ for (const key of rowsIndex.get(rowId) ?? [])
105
+ cells.delete(key);
106
+ rowsIndex.delete(rowId);
107
+ },
108
+ forgetColumn(columnId) {
109
+ for (const key of colsIndex.get(columnId) ?? [])
110
+ cells.delete(key);
111
+ colsIndex.delete(columnId);
112
+ },
113
+ get size() {
114
+ return cells.size;
115
+ },
116
+ serialize() {
117
+ return Object.fromEntries(cells);
118
+ },
119
+ hydrate(entries) {
120
+ cells.clear();
121
+ rowsIndex.clear();
122
+ colsIndex.clear();
123
+ for (const [key, entry] of Object.entries(entries)) {
124
+ cells.set(key, entry);
125
+ // Rebuild the indexes, or forgetRow / forgetColumn do nothing on a
126
+ // store that came back from storage.
127
+ const parts = splitKey(key);
128
+ if (parts)
129
+ remember(parts.rowId, parts.columnId, key);
130
+ }
131
+ },
132
+ clearAll() {
133
+ cells.clear();
134
+ rowsIndex.clear();
135
+ colsIndex.clear();
136
+ },
137
+ remapRows(fn) {
138
+ const next = {};
139
+ for (const [key, entry] of cells) {
140
+ const parts = splitKey(key);
141
+ if (!parts)
142
+ continue;
143
+ const rowId = fn(parts.rowId);
144
+ if (rowId !== null)
145
+ next[keyOf(rowId, parts.columnId)] = entry;
146
+ }
147
+ store.hydrate(next);
148
+ },
149
+ remapColumns(fn) {
150
+ const next = {};
151
+ for (const [key, entry] of cells) {
152
+ const parts = splitKey(key);
153
+ if (!parts)
154
+ continue;
155
+ const columnId = fn(parts.columnId);
156
+ if (columnId !== null)
157
+ next[keyOf(parts.rowId, columnId)] = entry;
158
+ }
159
+ store.hydrate(next);
160
+ },
161
+ };
162
+ if (initial)
163
+ store.hydrate(initial);
164
+ return store;
165
+ }
166
+ /** Turn an entry into inline style text for a cell renderer. */
167
+ export function entryToStyle(entry) {
168
+ if (!entry)
169
+ return '';
170
+ const parts = [];
171
+ if (entry.bold)
172
+ parts.push('font-weight:700');
173
+ if (entry.italic)
174
+ parts.push('font-style:italic');
175
+ if (entry.underline && entry.strike)
176
+ parts.push('text-decoration:underline line-through');
177
+ else if (entry.underline)
178
+ parts.push('text-decoration:underline');
179
+ else if (entry.strike)
180
+ parts.push('text-decoration:line-through');
181
+ if (entry.color)
182
+ parts.push(`color:${entry.color}`);
183
+ if (entry.fill)
184
+ parts.push(`background:${entry.fill}`);
185
+ if (entry.align)
186
+ parts.push(`text-align:${entry.align}`);
187
+ if (entry.fontFamily)
188
+ parts.push(`font-family:${entry.fontFamily}`);
189
+ if (entry.fontSize)
190
+ parts.push(`font-size:${entry.fontSize}px`);
191
+ if (entry.wrap)
192
+ parts.push('white-space:pre-wrap');
193
+ if (entry.indent)
194
+ parts.push(`padding-left:${entry.indent * 12}px`);
195
+ const borders = borderShadows(entry.border);
196
+ if (borders)
197
+ parts.push(`box-shadow:${borders}`);
198
+ return parts.join(';');
199
+ }
200
+ /**
201
+ * Cell borders as inset shadows, one per side.
202
+ *
203
+ * The cell span fills its td edge to edge, so an inset shadow along one
204
+ * edge is a border that costs no layout: a real border would push the text
205
+ * and change the cell's size, and a bordered cell next to a plain one would
206
+ * misalign. Shadows stack, so a cell can carry any combination of sides.
207
+ */
208
+ export function borderShadows(border) {
209
+ if (!border)
210
+ return '';
211
+ const parts = [];
212
+ const line = (spec) => ({
213
+ w: spec?.width ?? 1,
214
+ c: spec?.color ?? 'currentColor',
215
+ });
216
+ if (border.top) {
217
+ const { w, c } = line(border.top);
218
+ parts.push(`inset 0 ${w}px 0 0 ${c}`);
219
+ }
220
+ if (border.bottom) {
221
+ const { w, c } = line(border.bottom);
222
+ parts.push(`inset 0 -${w}px 0 0 ${c}`);
223
+ }
224
+ if (border.left) {
225
+ const { w, c } = line(border.left);
226
+ parts.push(`inset ${w}px 0 0 0 ${c}`);
227
+ }
228
+ if (border.right) {
229
+ const { w, c } = line(border.right);
230
+ parts.push(`inset -${w}px 0 0 0 ${c}`);
231
+ }
232
+ return parts.join(',');
233
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Freeze panes, over what the grid already has.
3
+ *
4
+ * Columns freeze through `api.setColumnPinning({ left: [...] })`, which
5
+ * makes them sticky and excludes them from the horizontal scroll, and rows
6
+ * through the grid's `frozenRows` prop, set here with `api.setOption`: the
7
+ * first N rows stay under the header, still the grid's own rows, editable
8
+ * and numbered, while the virtualized body scrolls beneath them. Both halves
9
+ * go through the api, so Freeze Panes is one call for any consumer.
10
+ *
11
+ * `splitFrozenRows` stays for a grid that renders its own pinned band from
12
+ * `pinnedTopRows` instead.
13
+ */
14
+ import type { GridCommandContext } from '@svgrid/grid/shortcuts';
15
+ export type FreezeState = {
16
+ /** How many leading rows should be pinned. */
17
+ rows: number;
18
+ /** How many leading columns should be pinned. */
19
+ cols: number;
20
+ };
21
+ export type FreezeSplit<TData> = {
22
+ /** Pass as `pinnedTopRows`. */
23
+ pinnedTopRows: ReadonlyArray<TData>;
24
+ /** Pass as `data`. The pinned rows are REMOVED, so nothing renders twice. */
25
+ bodyRows: ReadonlyArray<TData>;
26
+ };
27
+ /**
28
+ * Split a row array for a frozen-row count.
29
+ *
30
+ * ```svelte
31
+ * {@const split = splitFrozenRows(rows, freeze.rows)}
32
+ * <SvGrid data={split.bodyRows} pinnedTopRows={split.pinnedTopRows} ... />
33
+ * ```
34
+ */
35
+ export declare function splitFrozenRows<TData>(rows: ReadonlyArray<TData>, count: number): FreezeSplit<TData>;
36
+ /** Column ids left of `cols`, which is what column pinning takes. */
37
+ export declare function frozenColumnIds(cmd: GridCommandContext, cols: number): string[];
38
+ /**
39
+ * Apply both halves through the api and report the state: the columns pin,
40
+ * the rows freeze. Zero rows clears the row half.
41
+ */
42
+ export declare function applyFreeze(cmd: GridCommandContext, state: FreezeState): FreezeState;
43
+ /**
44
+ * Excel's Freeze Panes: everything above and to the left of the active cell
45
+ * freezes. With the cursor on B3 you get two frozen rows and one frozen
46
+ * column.
47
+ */
48
+ export declare function freezeAtActiveCell(cmd: GridCommandContext): FreezeState;
49
+ /** Freeze Top Row. */
50
+ export declare function freezeTopRow(cmd: GridCommandContext): FreezeState;
51
+ /** Freeze First Column. */
52
+ export declare function freezeFirstColumn(cmd: GridCommandContext): FreezeState;
53
+ /** Unfreeze everything. */
54
+ export declare function unfreeze(cmd: GridCommandContext): FreezeState;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Split a row array for a frozen-row count.
3
+ *
4
+ * ```svelte
5
+ * {@const split = splitFrozenRows(rows, freeze.rows)}
6
+ * <SvGrid data={split.bodyRows} pinnedTopRows={split.pinnedTopRows} ... />
7
+ * ```
8
+ */
9
+ export function splitFrozenRows(rows, count) {
10
+ const n = Math.max(0, Math.min(Math.floor(count), rows.length));
11
+ if (n === 0)
12
+ return { pinnedTopRows: [], bodyRows: rows };
13
+ return { pinnedTopRows: rows.slice(0, n), bodyRows: rows.slice(n) };
14
+ }
15
+ /** Column ids left of `cols`, which is what column pinning takes. */
16
+ export function frozenColumnIds(cmd, cols) {
17
+ const out = [];
18
+ for (let c = 0; c < Math.min(cols, cmd.colCount); c += 1) {
19
+ const id = cmd.columnIdAt(c);
20
+ if (id !== null)
21
+ out.push(id);
22
+ }
23
+ return out;
24
+ }
25
+ /**
26
+ * Apply both halves through the api and report the state: the columns pin,
27
+ * the rows freeze. Zero rows clears the row half.
28
+ */
29
+ export function applyFreeze(cmd, state) {
30
+ const api = cmd.api;
31
+ api.setColumnPinning?.({ left: frozenColumnIds(cmd, state.cols) });
32
+ api.setOption?.('frozenRows', state.rows > 0 ? state.rows : undefined);
33
+ return state;
34
+ }
35
+ /**
36
+ * Excel's Freeze Panes: everything above and to the left of the active cell
37
+ * freezes. With the cursor on B3 you get two frozen rows and one frozen
38
+ * column.
39
+ */
40
+ export function freezeAtActiveCell(cmd) {
41
+ const active = cmd.activeCell;
42
+ const state = active
43
+ ? { rows: active.rowIndex, cols: active.colIndex }
44
+ : { rows: 0, cols: 0 };
45
+ return applyFreeze(cmd, state);
46
+ }
47
+ /** Freeze Top Row. */
48
+ export function freezeTopRow(cmd) {
49
+ return applyFreeze(cmd, { rows: 1, cols: 0 });
50
+ }
51
+ /** Freeze First Column. */
52
+ export function freezeFirstColumn(cmd) {
53
+ return applyFreeze(cmd, { rows: 0, cols: 1 });
54
+ }
55
+ /** Unfreeze everything. */
56
+ export function unfreeze(cmd) {
57
+ return applyFreeze(cmd, { rows: 0, cols: 0 });
58
+ }
@@ -0,0 +1,10 @@
1
+ export type FunctionGroup = 'Math' | 'Statistical' | 'Logical' | 'Information' | 'Text' | 'Date & Time' | 'Lookup & Reference' | 'Other';
2
+ export type FunctionInfo = {
3
+ name: string;
4
+ group: FunctionGroup;
5
+ signature: string;
6
+ description: string;
7
+ };
8
+ export declare const FUNCTION_GROUPS: ReadonlyArray<FunctionGroup>;
9
+ /** Every function the engine knows, described, alphabetical. */
10
+ export declare function functionCatalog(): FunctionInfo[];