@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
package/dist/install.js CHANGED
@@ -1,17 +1,18 @@
1
- import { exportGrid, copyExportToClipboard, } from './export';
2
- import { printGrid } from './print';
3
- import { importData } from './import';
4
- import { isLicenseKeySet } from './license';
5
- import { emitUnlicensedNudge } from './watermark';
1
+ import { exportGrid, copyExportToClipboard, } from './export.js';
2
+ import { printGrid } from './print.js';
3
+ import { importData } from './import.js';
4
+ import { isLicenseKeySet } from './license.js';
5
+ import { emitUnlicensedNudge } from './watermark.js';
6
6
  // AI helpers are built-in + free in @svgrid/grid now; enterprise just wires them
7
7
  // into the Pro API and registers its export engine so AI exports can write xlsx/pdf.
8
8
  import { aiFilter, aiSmartFill, aiSummarize, aiClassify, aiExport, aiFindAnomalies, aiChart, enableAiCharting, registerExportProvider, } from '@svgrid/grid';
9
- import { createPivotModel, } from './pivot';
10
- import { enableSchedulerView } from './scheduler';
11
- import { enableBoardView } from './board';
12
- import { enableSelectionBar } from './selection-bar';
13
- import { enableAdvancedFilter } from './advanced-filter-enable';
14
- import { enablePivot } from './pivot-enable';
9
+ import { createPivotModel, } from './pivot.js';
10
+ import { enableSchedulerView } from './scheduler.js';
11
+ import { enableBoardView } from './board.js';
12
+ import { enableSelectionBar } from './selection-bar.js';
13
+ import { enableAdvancedFilter } from './advanced-filter-enable.js';
14
+ import { enablePivot } from './pivot-enable.js';
15
+ import { enableSheet } from './sheet-enable.js';
15
16
  /**
16
17
  * Augment a SvGridApi instance with Pro methods (`exportData`, `print`,
17
18
  * `ai.*`). Mutates and returns the same object so existing references
@@ -49,6 +50,10 @@ export function installEnterprise(api) {
49
50
  registerExportProvider(exportGrid);
50
51
  enablePivot();
51
52
  enableAdvancedFilter();
53
+ // Register the Excel keymap (Ctrl+Arrow, Ctrl+D, Ctrl+A and the rest). The
54
+ // grid interprets a key itself only when nothing claims it, so a free grid
55
+ // is unaffected.
56
+ enableSheet();
52
57
  pro.pivot = {
53
58
  build: (config) => createPivotModel(pro.getData(), config),
54
59
  buildFrom: (data, config) =>
package/dist/license.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { type EnterpriseFeatureLabel } from './upgrade-prompt';
2
- export { checkLicenseKey, type LicenseInfo, type LicenseStatus } from './license-core';
1
+ import { type EnterpriseFeatureLabel } from './upgrade-prompt.js';
2
+ export { checkLicenseKey, type LicenseInfo, type LicenseStatus } from './license-core.js';
3
+ export { dismissUnlicensedNudge } from './watermark.js';
3
4
  export declare function setLicenseKey(key: string): void;
4
5
  export declare function clearLicenseKey(): void;
5
6
  export declare function getLicenseKey(): string | null;
package/dist/license.js CHANGED
@@ -18,10 +18,15 @@
18
18
  // + the upgrade card. Stays a soft gate
19
19
  // so a trial ending cannot break a build.
20
20
  // any other "SVENTERPRISE-..." -> works silently (paid production)
21
- import { checkLicenseKey, VALID_PREFIX } from './license-core';
22
- import { emitUnlicensedNudge } from './watermark';
23
- import { showUpgradePrompt } from './upgrade-prompt';
24
- export { checkLicenseKey } from './license-core';
21
+ import { checkLicenseKey, VALID_PREFIX } from './license-core.js';
22
+ import { emitUnlicensedNudge } from './watermark.js';
23
+ import { showUpgradePrompt } from './upgrade-prompt.js';
24
+ export { checkLicenseKey } from './license-core.js';
25
+ // The nudge the key silences, on the same subpath as the key: an app that only
26
+ // wants to set its licence imports `@svgrid/enterprise/license` and never
27
+ // pulls the component barrel (the package has no `sideEffects` flag, so a
28
+ // barrel import carries every module it reaches into the importer's chunk).
29
+ export { dismissUnlicensedNudge } from './watermark.js';
25
30
  let currentKey = null;
26
31
  let noticedDev = false;
27
32
  let noticedExpired = false;
@@ -1,5 +1,4 @@
1
1
  import { defaultThemePreset, getThemePreset, resolveThemeTokens as resolveThemeTokens$1, themePresets } from "@svgrid/grid/themes";
2
- import { isRangeOperator, isSetOperator, isValuelessOperator } from "@svgrid/grid/filtering";
3
2
  //#region src/schema.ts
4
3
  /** `first_name` / `firstName` / `first-name` -> `First Name`. */
5
4
  function titleCase$2(field) {
@@ -1130,7 +1129,7 @@ function introspectOpenApi(specText) {
1130
1129
  }
1131
1130
  //#endregion
1132
1131
  //#region src/studio/introspect-db.ts
1133
- function truthy$1(v) {
1132
+ function truthy(v) {
1134
1133
  return v === 1 || v === "1" || v === true;
1135
1134
  }
1136
1135
  function identQuote(name) {
@@ -1165,7 +1164,7 @@ function fieldFrom(name, rawType, pk, notNull) {
1165
1164
  }
1166
1165
  /** Map catalog rows (aliased name/type/nullable/pk) from information_schema dialects. */
1167
1166
  function infoSchemaFields(rows) {
1168
- return rows.map((r) => fieldFrom(String(r.name), String(r.type ?? ""), truthy$1(r.pk), !truthy$1(r.nullable)));
1167
+ return rows.map((r) => fieldFrom(String(r.name), String(r.type ?? ""), truthy(r.pk), !truthy(r.nullable)));
1169
1168
  }
1170
1169
  /** Map SQLite `PRAGMA table_info` rows (name/type/notnull/pk-as-index). */
1171
1170
  function sqliteFields(rows) {
@@ -2011,112 +2010,6 @@ function scaffoldApp(schemas, options = {}) {
2011
2010
  return { files };
2012
2011
  }
2013
2012
  //#endregion
2014
- //#region src/expressions/expression-columns.ts
2015
- /**
2016
- * Column metadata for the expression layer - the small, self-contained operator
2017
- * catalogue the editor draws from, plus name <-> id resolution for the
2018
- * `[Bracketed Name]` reference syntax.
2019
- *
2020
- * The operator set mirrors the grid's own filter row (text / number / date),
2021
- * so an expression's operators line up with what a user already knows from the
2022
- * column menu.
2023
- *
2024
- * Identity and input-shape semantics come from the grid's shared catalogue, so
2025
- * the two surfaces cannot disagree about which operators exist or which need a
2026
- * chip input / no input / a second value. Labels and ordering stay local on
2027
- * purpose: the editor leads with `Equals` where the filter menu leads with
2028
- * `Contains`, and each is right for its context.
2029
- */
2030
- var TEXT = ["text"];
2031
- var NUM = ["number"];
2032
- var DATES = ["date", "datetime"];
2033
- var ALL = [
2034
- "text",
2035
- "number",
2036
- "date",
2037
- "datetime",
2038
- "boolean"
2039
- ];
2040
- /** The full operator catalogue, ordered as the editor should present it. */
2041
- var OPERATORS = [
2042
- {
2043
- value: "equals",
2044
- label: "Equals",
2045
- types: ALL
2046
- },
2047
- {
2048
- value: "notEquals",
2049
- label: "Not equals",
2050
- types: ALL
2051
- },
2052
- {
2053
- value: "contains",
2054
- label: "Contains",
2055
- types: TEXT
2056
- },
2057
- {
2058
- value: "notContains",
2059
- label: "Not contains",
2060
- types: TEXT
2061
- },
2062
- {
2063
- value: "startsWith",
2064
- label: "Starts with",
2065
- types: TEXT
2066
- },
2067
- {
2068
- value: "endsWith",
2069
- label: "Ends with",
2070
- types: TEXT
2071
- },
2072
- {
2073
- value: "regex",
2074
- label: "Matches regex",
2075
- types: TEXT
2076
- },
2077
- {
2078
- value: "greaterThan",
2079
- label: "Greater than",
2080
- types: [...NUM, ...DATES]
2081
- },
2082
- {
2083
- value: "lessThan",
2084
- label: "Less than",
2085
- types: [...NUM, ...DATES]
2086
- },
2087
- {
2088
- value: "between",
2089
- label: "Between",
2090
- types: [...NUM, ...DATES]
2091
- },
2092
- {
2093
- value: "in",
2094
- label: "In",
2095
- types: ["text", "number"]
2096
- },
2097
- {
2098
- value: "notIn",
2099
- label: "Not in",
2100
- types: ["text", "number"]
2101
- },
2102
- {
2103
- value: "isBlank",
2104
- label: "Is blank",
2105
- types: ALL
2106
- },
2107
- {
2108
- value: "isNotBlank",
2109
- label: "Is not blank",
2110
- types: ALL
2111
- }
2112
- ].map((op) => ({
2113
- ...op,
2114
- ...isValuelessOperator(op.value) ? { valueless: true } : {},
2115
- ...isSetOperator(op.value) ? { set: true } : {},
2116
- ...isRangeOperator(op.value) ? { range: true } : {}
2117
- }));
2118
- new Map(OPERATORS.map((op) => [op.value, op]));
2119
- //#endregion
2120
2013
  //#region src/expressions/parse.ts
2121
2014
  /** Every column id referenced anywhere in a predicate (deduped, in order). */
2122
2015
  function collectColumnRefs(expr) {
@@ -9056,11 +8949,34 @@ var GENERATED_UI_SURFACE = {
9056
8949
  "description": "Prepend a header row (the column labels) to copied cell ranges, so pasting into Excel / Sheets includes the headers. Applies per copied range.",
9057
8950
  "group": "common"
9058
8951
  },
8952
+ {
8953
+ "key": "processCellForFill",
8954
+ "label": "Process Cell For Fill",
8955
+ "type": "json",
8956
+ "description": "Decide what the fill handle writes into one cell, ahead of the grid's own pattern rules (series, weekdays, \"Item 1\"). Receives the source cell's value and how far the target sits from it; return the value to write, or `undefined` to let the pattern decide. A spreadsheet uses it to move a formula's references by the distance filled, which the pattern rules would otherwise mangle (\"=A1+B1\" reads as \"Item 1\").",
8957
+ "code": true,
8958
+ "group": "advanced"
8959
+ },
9059
8960
  {
9060
8961
  "key": "processCellForClipboard",
9061
8962
  "label": "Process Cell For Clipboard",
9062
8963
  "type": "json",
9063
- "description": "Transform each cell value on its way to the clipboard - e.g. strip currency symbols, expand codes to labels, or redact. Receives the display value plus the row/column context; return the string (or value) to copy.",
8964
+ "code": true,
8965
+ "group": "advanced"
8966
+ },
8967
+ {
8968
+ "key": "clipboardHtml",
8969
+ "label": "Clipboard Html",
8970
+ "type": "json",
8971
+ "description": "An HTML rendering of what Ctrl+C copies, written to the clipboard as `text/html` beside the TSV. Excel and Google Sheets read the HTML first, so a table with inline styles pastes into them with its formats, and the same markup can carry what the text cannot (a formula in a `data-` attribute) for a round trip back into a grid that reads it. Called after every cell has been through `processCellForClipboard`, with the rectangles copied and the text about to be written. Return nothing to write text alone. Runs synchronously inside the key press, which is what the clipboard needs.",
8972
+ "code": true,
8973
+ "group": "advanced"
8974
+ },
8975
+ {
8976
+ "key": "processCellFromClipboard",
8977
+ "label": "Process Cell From Clipboard",
8978
+ "type": "json",
8979
+ "description": "Transform each cell on its way IN from the clipboard, before the grid coerces it for the column's editor. Symmetric with `processCellForClipboard`: the pair is what lets a round trip survive. Receives the raw clipboard text for the cell plus where it is landing. Return the value to write, or `undefined` to leave the cell untouched. This is also the seam a feature pack uses to take over a paste entirely: `@svgrid/enterprise`'s paste-special reads the clipboard's `text/html` for formats and formulas and writes through here.",
9064
8980
  "code": true,
9065
8981
  "group": "advanced"
9066
8982
  },
@@ -9071,6 +8987,13 @@ var GENERATED_UI_SURFACE = {
9071
8987
  "description": "Inline cell editing: F2 or double-click opens an editor in the active cell, Enter commits, Esc cancels. Off by default. A column still needs an `editorType` to pick its editor (text, number, date, checkbox, list, ...); without one it gets a plain text editor. `editable` is the shortcut alias and wins over this.",
9072
8988
  "group": "common"
9073
8989
  },
8990
+ {
8991
+ "key": "editOnSecondClick",
8992
+ "label": "Edit On Second Click",
8993
+ "type": "boolean",
8994
+ "description": "A click on the cell that is already active opens its editor, the way a second click on a selected file name starts renaming it. On by default. A spreadsheet turns it off: Excel edits on double-click or F2 only, and a user clicking the cell they are on to get back to it after a dialog would otherwise find the next shortcut typed into an editor.",
8995
+ "group": "common"
8996
+ },
9074
8997
  {
9075
8998
  "key": "fullRowEditing",
9076
8999
  "label": "Full Row Editing",
@@ -9276,6 +9199,20 @@ var GENERATED_UI_SURFACE = {
9276
9199
  "description": "Rows to pin to the TOP of the grid - rendered above the regular rows and sticky-positioned so they stay visible while the user scrolls. Typical use: a \"totals\" or \"headline\" row that should always be in view. Rows are read-only (no inline editing, no row-selection checkbox). They share the column schema with the main grid; field/format/cell/cellClass all apply.",
9277
9200
  "group": "common"
9278
9201
  },
9202
+ {
9203
+ "key": "frozenRows",
9204
+ "label": "Frozen Rows",
9205
+ "type": "number",
9206
+ "description": "Freeze the first N rows: they stay under the header while the body scrolls, and unlike `pinnedTopRows` they are the grid's own rows, still editable, selectable and numbered as rows 1..N. Excel's Freeze Panes, for the row half; the column half is `columnPinning`. Under `virtualization` the frozen rows are always rendered and the window skips them.",
9207
+ "group": "common"
9208
+ },
9209
+ {
9210
+ "key": "mergedCells",
9211
+ "label": "Merged Cells",
9212
+ "type": "json",
9213
+ "description": "Merged cells: rectangles drawn as one cell, a spreadsheet's Merge & Center. Each entry is the top-left cell (display indices) and how many rows and columns it covers. The origin's td takes the span and shows the origin's value; the covered cells are not drawn, a selection grows to whole merges, the active cell inside a merge is its origin, and the arrow keys step over a merge as one cell. A merge that crosses the frozen boundary or the rendered window is drawn in parts, one per band. The grid does not write into covered cells on its own; a consumer that merges cells keeps them empty or marks them read-only through the column's `editable`.",
9214
+ "group": "common"
9215
+ },
9279
9216
  {
9280
9217
  "key": "pinnedBottomRows",
9281
9218
  "label": "Pinned Bottom Rows",
@@ -9352,6 +9289,24 @@ var GENERATED_UI_SURFACE = {
9352
9289
  "prop": "onPaginationChange",
9353
9290
  "description": "Fires when the user changes page or page size while `externalPagination` is on. Fetch that page and update `data` / `rowCount` / `pageIndex`."
9354
9291
  },
9292
+ {
9293
+ "key": "columnResize",
9294
+ "label": "Column Resize",
9295
+ "prop": "onColumnResize",
9296
+ "description": "The user dragged a column's edge (or double-clicked it to autosize). Programmatic `api.setColumnWidth` does not fire it."
9297
+ },
9298
+ {
9299
+ "key": "rowResize",
9300
+ "label": "Row Resize",
9301
+ "prop": "onRowResize",
9302
+ "description": "The user dragged a row's edge, or double-clicked it: `height` is then `null`, the row back at its declared height. Programmatic `api.setRowHeight` does not fire it."
9303
+ },
9304
+ {
9305
+ "key": "pasteClipboard",
9306
+ "label": "Paste Clipboard",
9307
+ "prop": "onPasteClipboard",
9308
+ "description": "Take over a paste. Receives the clipboard's `text/plain` and, when the source put one there, its `text/html` (Excel's carries formats and formulas; a grid's own `clipboardHtml` carries whatever it chose to). Return `true` to say the paste was applied; anything else lets the grid paste the text as it always has. Runs inside one history group, so every `setCellValue` and `recordUndo` the handler makes is one Ctrl+Z. With this set, Ctrl+V lets the browser's own `paste` event through (that is where the unsanitised HTML is), and the async Clipboard API is the fallback for a browser that does not deliver it. `source` says which path the payload came by."
9309
+ },
9355
9310
  {
9356
9311
  "key": "apiReady",
9357
9312
  "label": "Api Ready",
@@ -11408,7 +11363,8 @@ var GRID_CURATED_PROPS = /* @__PURE__ */ new Set([
11408
11363
  "conditionalFormats",
11409
11364
  "features",
11410
11365
  "editable",
11411
- "enableInlineEditing"
11366
+ "enableInlineEditing",
11367
+ "icons"
11412
11368
  ]);
11413
11369
  /** The Grid's raw prop surface for the "All properties" panel: every extracted SvGrid
11414
11370
  * prop the curated controls do NOT already manage. Sorted by group then label. */
@@ -11423,6 +11379,83 @@ function gridPropSurface() {
11423
11379
  };
11424
11380
  return g.props.filter((p) => !GRID_CURATED_PROPS.has(p.key)).map((p) => ({ ...p })).sort((a, b) => order[a.group ?? "common"] - order[b.group ?? "common"] || a.label.localeCompare(b.label));
11425
11381
  }
11382
+ var GRID_ICON_GROUP_RULES = [
11383
+ {
11384
+ label: "Header + column menu",
11385
+ match: (n) => [
11386
+ "sort",
11387
+ "sort-asc",
11388
+ "sort-desc",
11389
+ "filter",
11390
+ "menu",
11391
+ "chevron-down",
11392
+ "chevron-right",
11393
+ "autosize",
11394
+ "columns",
11395
+ "reset"
11396
+ ].includes(n)
11397
+ },
11398
+ {
11399
+ label: "Filter operators",
11400
+ match: (n) => n.startsWith("op-")
11401
+ },
11402
+ {
11403
+ label: "Pinning",
11404
+ match: (n) => n === "pin-left" || n === "pin-right" || n === "unpin"
11405
+ },
11406
+ {
11407
+ label: "Rows + grouping",
11408
+ match: (n) => [
11409
+ "group",
11410
+ "group-add",
11411
+ "row-number",
11412
+ "pinned-row-top",
11413
+ "pinned-row-bottom",
11414
+ "drag-handle",
11415
+ "breadcrumb-separator"
11416
+ ].includes(n)
11417
+ },
11418
+ {
11419
+ label: "Toolbar + overlays",
11420
+ match: (n) => [
11421
+ "search",
11422
+ "tool-panel",
11423
+ "chart",
11424
+ "advanced-filter",
11425
+ "column-group-caret"
11426
+ ].includes(n)
11427
+ },
11428
+ {
11429
+ label: "Pager",
11430
+ match: (n) => n.startsWith("page-")
11431
+ },
11432
+ {
11433
+ label: "Find + move",
11434
+ match: (n) => n.startsWith("find-") || n.startsWith("move-")
11435
+ },
11436
+ {
11437
+ label: "Close + clear",
11438
+ match: (n) => [
11439
+ "x",
11440
+ "close",
11441
+ "clear",
11442
+ "remove"
11443
+ ].includes(n)
11444
+ },
11445
+ {
11446
+ label: "Other",
11447
+ match: () => true
11448
+ }
11449
+ ];
11450
+ /** Split the grid's icon catalogue into the picker's display groups, in order,
11451
+ * dropping any that came out empty. Takes the names rather than importing them so
11452
+ * the studio metadata module stays free of a runtime dependency on the grid. */
11453
+ function gridIconGroups(names) {
11454
+ return GRID_ICON_GROUP_RULES.map((rule, i) => ({
11455
+ label: rule.label,
11456
+ names: names.filter((n) => GRID_ICON_GROUP_RULES.findIndex((c) => c.match(n)) === i)
11457
+ })).filter((g) => g.names.length);
11458
+ }
11426
11459
  var GRID_API_UNSETTABLE = /* @__PURE__ */ new Set([
11427
11460
  "data",
11428
11461
  "columns",
@@ -15880,7 +15913,7 @@ function hasFieldConditions(schema) {
15880
15913
  *
15881
15914
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
15882
15915
  */
15883
- var SVGRID_VERSION = "3.0.0";
15916
+ var SVGRID_VERSION = "3.0.2";
15884
15917
  //#endregion
15885
15918
  //#region src/studio/emit-project.ts
15886
15919
  var has = (blocks, kind) => blocks.some((b) => b.config.kind === kind);
@@ -16000,17 +16033,18 @@ function blockMarkup(entity, schemaVar, typeName, block, resolve, ctx = { hasRec
16000
16033
  const idSafe = block.id.replace(/-/g, "_");
16001
16034
  const colVar = `columns_${idSafe}`;
16002
16035
  const emptyMsg = `No ${(entity.label ?? entity.name).toLowerCase()} yet.`;
16036
+ const gridIcons = gridIconParts(cfg, idSafe);
16003
16037
  if (cfg.scheduler) {
16004
16038
  const schDisp = relationDisplayFields(ctx.rawEntity ?? entity, resolve);
16005
16039
  const schAsText = (f) => schDisp.get(f) ?? f;
16006
16040
  return ` <div ${span}${cls}>
16007
- <SvGrid
16041
+ ${gridIcons.decls} <SvGrid
16008
16042
  data={allRows}
16009
16043
  columns={${colVar}}
16010
16044
  getRowId={(r) => String((r as Record<string, unknown>)[idField])}
16011
16045
  loading={!allRowsReady}
16012
16046
  scheduler={${schedulerConfigExpr(cfg.scheduler, typeName, schAsText)}}
16013
- containerHeight=${ctx.pane ? "\"100%\"" : `{${block.height ?? 640}}`}
16047
+ ${gridIcons.attr ? ` ${gridIcons.attr}\n` : ""} containerHeight=${ctx.pane ? "\"100%\"" : `{${block.height ?? 640}}`}
16014
16048
  />
16015
16049
  </div>`;
16016
16050
  }
@@ -16090,6 +16124,7 @@ function blockMarkup(entity, schemaVar, typeName, block, resolve, ctx = { hasRec
16090
16124
  if (apiBody.length === 1 && ctx.captureApi && !grouped) lines.push(`onApiReady={(a) => (${ctx.captureApi} = a)}`);
16091
16125
  else if (apiBody.length) lines.push(`onApiReady={(a) => { ${apiBody.join("; ")} }}`);
16092
16126
  lines.push(`containerHeight=${ctx.pane ? "\"100%\"" : `{${block.height ?? 360}}`}`);
16127
+ if (gridIcons.attr) lines.push(gridIcons.attr);
16093
16128
  if (cfg.props && Object.keys(cfg.props).length) {
16094
16129
  const emitted = new Set(lines.map((l) => l.split(/[=\s]/)[0]));
16095
16130
  for (const [k, v] of Object.entries(cfg.props)) {
@@ -16097,8 +16132,9 @@ function blockMarkup(entity, schemaVar, typeName, block, resolve, ctx = { hasRec
16097
16132
  lines.push(v === true ? k : `${k}={${JSON.stringify(v)}}`);
16098
16133
  }
16099
16134
  }
16135
+ const exportBar = gridHasExport(cfg) && ctx.captureApi ? exportToolbarMarkup(cfg.export, ctx.captureApi, entity.name) : "";
16100
16136
  return ` <div ${span}${cls}>
16101
- ${gridHasExport(cfg) && ctx.captureApi ? exportToolbarMarkup(cfg.export, ctx.captureApi, entity.name) : ""} <SvGrid
16137
+ ${gridIcons.decls}${exportBar} <SvGrid
16102
16138
  ${lines.join("\n ")}
16103
16139
  />
16104
16140
  </div>`;
@@ -16434,6 +16470,41 @@ function conditionalFormatsExpr(cfg) {
16434
16470
  }
16435
16471
  return entries.length ? `[${entries.join(", ")}]` : null;
16436
16472
  }
16473
+ /** Snippet declarations + the `icons={...}` attribute for a grid's no-code icon
16474
+ * overrides. SvGrid's `icons` prop takes a map of SNIPPETS, so each override has to
16475
+ * become a real snippet declared next to the grid; it cannot be a value the way
16476
+ * every other prop in the panel is. That is the whole reason icons get their own
16477
+ * config field instead of riding along in `props`, which is JSON.stringify'd.
16478
+ *
16479
+ * A value that reads as a tag is emitted as markup, so a user can paste an inline
16480
+ * `<svg>` or reference a component they imported in code-behind. Anything else goes
16481
+ * through an expression rather than as bare template text, so a glyph containing a
16482
+ * brace, a quote or an angle bracket cannot break the page it lands in. That last
16483
+ * case is not hypothetical: `<` and `>` are perfectly good pager arrows, which is
16484
+ * why this looks for a whole tag rather than just a leading bracket.
16485
+ *
16486
+ * Snippets are declared inside the block's own wrapper and prefixed with the block
16487
+ * id, so two grids on one screen can override the same icon differently. */
16488
+ function gridIconParts(cfg, idSafe) {
16489
+ const entries = Object.entries(cfg.icons ?? {}).filter(([name, v]) => name && typeof v === "string" && v.trim() !== "");
16490
+ if (!entries.length) return {
16491
+ decls: "",
16492
+ attr: ""
16493
+ };
16494
+ const decls = [];
16495
+ const pairs = [];
16496
+ for (const [name, glyph] of entries) {
16497
+ const snip = `icon_${idSafe}_${name.replace(/[^A-Za-z0-9]/g, "_")}`;
16498
+ const g = glyph.trim();
16499
+ const body = /^<[a-zA-Z][\s\S]*>$/.test(g) ? g : `{${jsStr(glyph)}}`;
16500
+ decls.push(` {#snippet ${snip}()}${body}{/snippet}`);
16501
+ pairs.push(`${jsStr(name)}: ${snip}`);
16502
+ }
16503
+ return {
16504
+ decls: decls.join("\n") + "\n",
16505
+ attr: `icons={{ ${pairs.join(", ")} }}`
16506
+ };
16507
+ }
16437
16508
  var fieldLabel = (f) => f.label ?? f.field;
16438
16509
  /** Stable per-block identifiers for a filter panel's state + apply function. */
16439
16510
  var facetNames = (block) => {
@@ -41586,4 +41657,4 @@ function checkLicenseKey(key, now = /* @__PURE__ */ new Date()) {
41586
41657
  };
41587
41658
  }
41588
41659
  //#endregion
41589
- export { CANVAS_COLS, CANVAS_GAP_PX, CANVAS_ROW_PX, CONTAINER_CHILD_KINDS, CONTAINER_DISPLAY_KINDS, CRUD_ACTIONS, DEFAULT_PORT, DRIVER_PACKAGE, FORM_SUBMIT, GRID_API_MEMBERS, GRID_CURATED_PROPS, GRID_EVENTS, GRID_PRESETS, MANAGED_END, MANAGED_START, ON_LOAD, PANE_LAYOUTS, STANDARD_UI_EVENTS, TAB_CHILD_KINDS, TRIGGER_EVENTS, UI_COMPONENT_REGISTRY, UserError, addAccordionBlock, addAccordionComponent, addAccordionSection, addBlock, addBlockAt, addComponentBlock, addCrudSuite, addEntity, addFormSection, addFreestandingScreen, addHandlerStep, addScreen, addScreenAction, addScreenFromTemplate, addStateVar, addTab, addTabBlock, addTabComponent, applyGridPreset, blockClassName, blockColumns, blockPalette, blockStyleCss, buildCanvasLayout, buildConnectionString, buildCopilotMessages, buildDockLayout, buildStudioBugReport, canvasOpts, canvasRectOf, changeSlot, checkLicenseKey, clickSlot, compileCondition, compileHandlerSteps, compileStep, compileTriggerStep, compileTriggerSteps, compileValue, componentHandleMembers, componentHandleName, componentHasBindings, countTableRows, createProject, crudAppFromSchemas, crudSuiteScreens, csvToEntity, ctxAmbientDts, ctxCompletions, dashScreen, defaultBlockConfig, defaultEntitySource, defaultScreenFor, defaultStudioTheme, deployCommands, detailScreen, detectDelimiter, disableScreenCode, dockOpts, dockPaneIds, dockPaneTitleOf, duplicateBlock, duplicateScreen, emitEntityModules, emitStudioApp, emitStudioAppBundle, emitStudioFragment, emitStudioProject, enableScreenCode, entityDataSource, entityOf, entityScreenPage, eventSlot, flattenBlocks, formControlSettings, formControlsFor, formPlan, formScreen, generateRows, generateValue, getLiveDataSample, getSampleApp, getStarterDataset, getStudioTheme, gridApiSettableProps, gridColumns, gridConfig, gridOpts, gridPresetLabel, gridPropSurface, inferType, insertBlock, introspectDatabase, introspectDrizzle, introspectDrizzleAll, introspectJson, introspectOpenApi, introspectPrisma, introspectPrismaAll, isDarkTheme, isFieldHidden, isFileDialect, isPaneLayout, isProjectValid, isTenantScoped, isUserError, linkRelationLabels, listDatabaseTables, listScreen, liveDataSamples, mapSqlType, mergeBlockStyle, mergeManaged, missingEnvKeys, moveBlock, moveFormField, moveFormFields, moveFormSection, moveHandlerStep, parseConnectionString, parseCsv, parseProject, parseSelection, pickLabelField, prepareEntities, probeConnection, projectFromModelText, reconcileDock, redactConnectionString, refineField, refineFields, removeAccordionBlock, removeAccordionSection, removeBlock, removeEntity, removeFormSection, removeScreen, removeScreenAction, removeStateVar, removeTab, removeTabBlock, renameAccordionSection, renameTab, reorderBlock, reorderScreen, reseedScreenDock, resolveDeployTarget, resolveIdField, resolveSchema, resolveSchemas, resolveThemeTokens, resolveThemeTokensFor, roleCanAction, roleCanScreen, rowSelectSlot, runStudioAdd, runStudioAddApp, runStudioInit, runtimeDeps, sampleApps, sanitizeClassName, sanitizeProject, sanitizeStudioProject, scaffold, scaffoldApp, schemaToColumns, schemaToFormFields, screenDataset, screenFromTemplate, screenHandles, screenLayoutOf, seedUsers, serializeProject, setAccordionMultiple, setAuth, setCanvasRect, setComponentBinding, setComponentName, setDataLayer, setDataSource, setDeployTarget, setDockPaneTitle, setEntityDataSource, setEntityForm, setFieldConditions, setFieldHidden, setFieldInput, setFormColumns, setHandlerBody, setHandlerSteps, setJob, setLayoutOpts, setScreenDock, setScreenHandlersSource, setScreenLayout, setScreenRenderGrid, setScreenRenderMode, setShell, setTenancy, setTheme, setThemePreset, setTrigger, skipUserOwned, splitOpts, ssrEligible, ssrScreenShape, stackOpts, starterDatasets, starterProject, stateInitExpr, stateTsType, statusPills, stepsToCode, studioDeployInfo, studioThemes, suggestFormSections, summarizeVerify, syncDockPanes, tenantField, themeStyleString, triggersOf, uiComponentSpec, updateBlock, updateEntity, updateEntityField, updateFormSection, updateHandlerStep, updateScreen, updateStateVar, validateProject, verifyScaffold, withSsrDefaults };
41660
+ export { CANVAS_COLS, CANVAS_GAP_PX, CANVAS_ROW_PX, CONTAINER_CHILD_KINDS, CONTAINER_DISPLAY_KINDS, CRUD_ACTIONS, DEFAULT_PORT, DRIVER_PACKAGE, FORM_SUBMIT, GRID_API_MEMBERS, GRID_CURATED_PROPS, GRID_EVENTS, GRID_PRESETS, MANAGED_END, MANAGED_START, ON_LOAD, PANE_LAYOUTS, STANDARD_UI_EVENTS, TAB_CHILD_KINDS, TRIGGER_EVENTS, UI_COMPONENT_REGISTRY, UserError, addAccordionBlock, addAccordionComponent, addAccordionSection, addBlock, addBlockAt, addComponentBlock, addCrudSuite, addEntity, addFormSection, addFreestandingScreen, addHandlerStep, addScreen, addScreenAction, addScreenFromTemplate, addStateVar, addTab, addTabBlock, addTabComponent, applyGridPreset, blockClassName, blockColumns, blockPalette, blockStyleCss, buildCanvasLayout, buildConnectionString, buildCopilotMessages, buildDockLayout, buildStudioBugReport, canvasOpts, canvasRectOf, changeSlot, checkLicenseKey, clickSlot, compileCondition, compileHandlerSteps, compileStep, compileTriggerStep, compileTriggerSteps, compileValue, componentHandleMembers, componentHandleName, componentHasBindings, countTableRows, createProject, crudAppFromSchemas, crudSuiteScreens, csvToEntity, ctxAmbientDts, ctxCompletions, dashScreen, defaultBlockConfig, defaultEntitySource, defaultScreenFor, defaultStudioTheme, deployCommands, detailScreen, detectDelimiter, disableScreenCode, dockOpts, dockPaneIds, dockPaneTitleOf, duplicateBlock, duplicateScreen, emitEntityModules, emitStudioApp, emitStudioAppBundle, emitStudioFragment, emitStudioProject, enableScreenCode, entityDataSource, entityOf, entityScreenPage, eventSlot, flattenBlocks, formControlSettings, formControlsFor, formPlan, formScreen, generateRows, generateValue, getLiveDataSample, getSampleApp, getStarterDataset, getStudioTheme, gridApiSettableProps, gridColumns, gridConfig, gridIconGroups, gridOpts, gridPresetLabel, gridPropSurface, inferType, insertBlock, introspectDatabase, introspectDrizzle, introspectDrizzleAll, introspectJson, introspectOpenApi, introspectPrisma, introspectPrismaAll, isDarkTheme, isFieldHidden, isFileDialect, isPaneLayout, isProjectValid, isTenantScoped, isUserError, linkRelationLabels, listDatabaseTables, listScreen, liveDataSamples, mapSqlType, mergeBlockStyle, mergeManaged, missingEnvKeys, moveBlock, moveFormField, moveFormFields, moveFormSection, moveHandlerStep, parseConnectionString, parseCsv, parseProject, parseSelection, pickLabelField, prepareEntities, probeConnection, projectFromModelText, reconcileDock, redactConnectionString, refineField, refineFields, removeAccordionBlock, removeAccordionSection, removeBlock, removeEntity, removeFormSection, removeScreen, removeScreenAction, removeStateVar, removeTab, removeTabBlock, renameAccordionSection, renameTab, reorderBlock, reorderScreen, reseedScreenDock, resolveDeployTarget, resolveIdField, resolveSchema, resolveSchemas, resolveThemeTokens, resolveThemeTokensFor, roleCanAction, roleCanScreen, rowSelectSlot, runStudioAdd, runStudioAddApp, runStudioInit, runtimeDeps, sampleApps, sanitizeClassName, sanitizeProject, sanitizeStudioProject, scaffold, scaffoldApp, schemaToColumns, schemaToFormFields, screenDataset, screenFromTemplate, screenHandles, screenLayoutOf, seedUsers, serializeProject, setAccordionMultiple, setAuth, setCanvasRect, setComponentBinding, setComponentName, setDataLayer, setDataSource, setDeployTarget, setDockPaneTitle, setEntityDataSource, setEntityForm, setFieldConditions, setFieldHidden, setFieldInput, setFormColumns, setHandlerBody, setHandlerSteps, setJob, setLayoutOpts, setScreenDock, setScreenHandlersSource, setScreenLayout, setScreenRenderGrid, setScreenRenderMode, setShell, setTenancy, setTheme, setThemePreset, setTrigger, skipUserOwned, splitOpts, ssrEligible, ssrScreenShape, stackOpts, starterDatasets, starterProject, stateInitExpr, stateTsType, statusPills, stepsToCode, studioDeployInfo, studioThemes, suggestFormSections, summarizeVerify, syncDockPanes, tenantField, themeStyleString, triggersOf, uiComponentSpec, updateBlock, updateEntity, updateEntityField, updateFormSection, updateHandlerStep, updateScreen, updateStateVar, validateProject, verifyScaffold, withSsrDefaults };
@@ -13,16 +13,40 @@
13
13
  * measure). The grand-total column is excluded unless `includeTotals`.
14
14
  * - values = each leaf row's aggregated cell for that series column.
15
15
  */
16
- import type { ChartSpec, ChartType, TableFeatures } from '@svgrid/grid';
17
- import type { PivotResult } from './pivot';
16
+ import { type CellFormatConfig, type ChartSpec, type ChartType, type TableFeatures } from '@svgrid/grid';
17
+ import type { PivotResult } from './pivot.js';
18
+ /** Options for {@link pivotToChartSpec}: the chart type and stacking, whether totals chart, a category cap, the measure's format and the value-axis name. */
18
19
  export type PivotChartOptions = {
19
20
  /** Chart type. Default `'bar'`. */
20
21
  type?: ChartType;
21
22
  /** Stack the series. Default false. */
22
23
  stacked?: boolean;
24
+ /** Stack to 100%. Implies `stacked`. Default false. */
25
+ stacked100?: boolean;
23
26
  /** Include the grand-total column / row as a series / category. Default false. */
24
27
  includeTotals?: boolean;
25
28
  /** Cap the number of categories (row leaves) charted. */
26
29
  maxCategories?: number;
30
+ /**
31
+ * The measure's cell format, carried to the chart as `valueFormat` (with
32
+ * `currency` and `locale`), so a cell the table shows as "$469,662" charts
33
+ * as "$470k" on the axis and "$469,662" in the tooltip rather than "470k".
34
+ * The designer passes the first value chip's format; with several
35
+ * measures in different formats, pass none and the chart formats plainly.
36
+ */
37
+ format?: CellFormatConfig;
38
+ /**
39
+ * Name the value axis. Default: the measure's label when the layout has
40
+ * one measure, nothing otherwise.
41
+ */
42
+ yAxisTitle?: string | null;
27
43
  };
44
+ /**
45
+ * A computed pivot as a `ChartSpec` for the free chart: row leaves become
46
+ * categories (nested rows a grouped axis), column leaves the series, totals
47
+ * left out unless asked for, the measure's format carried over and an empty
48
+ * cell read as a gap. The designer's Chart view is this function, and the
49
+ * grid's own Chart panel runs the same mapping (`pivotResultToChartSpec` in
50
+ * `@svgrid/grid`) in pivot mode.
51
+ */
28
52
  export declare function pivotToChartSpec<TFeatures extends TableFeatures>(result: PivotResult<TFeatures>, opts?: PivotChartOptions): ChartSpec;
@@ -1,71 +1,27 @@
1
+ /**
2
+ * Pivot -> chart bridge.
3
+ *
4
+ * Turns a computed {@link PivotResult} (the row/column/value matrix the pivot
5
+ * engine produces) into a core {@link ChartSpec} the free `SvGridChart` can
6
+ * render - so one pivot layout drives both a table and a chart (the Excel
7
+ * PivotTable <-> PivotChart pairing).
8
+ *
9
+ * Mapping:
10
+ * - categories = the row-axis LEAF rows (deepest grouping; subtotals and the
11
+ * grand-total row are skipped). With no row dims, the single total row.
12
+ * - series = the column-axis leaf value columns (one per col-path x
13
+ * measure). The grand-total column is excluded unless `includeTotals`.
14
+ * - values = each leaf row's aggregated cell for that series column.
15
+ */
16
+ import { pivotResultToChartSpec } from '@svgrid/grid';
17
+ /**
18
+ * A computed pivot as a `ChartSpec` for the free chart: row leaves become
19
+ * categories (nested rows a grouped axis), column leaves the series, totals
20
+ * left out unless asked for, the measure's format carried over and an empty
21
+ * cell read as a gap. The designer's Chart view is this function, and the
22
+ * grid's own Chart panel runs the same mapping (`pivotResultToChartSpec` in
23
+ * `@svgrid/grid`) in pivot mode.
24
+ */
1
25
  export function pivotToChartSpec(result, opts = {}) {
2
- const type = opts.type ?? 'bar';
3
- // Category rows: the row-axis leaves. Fall back to the grand-total (single
4
- // "All") row when no row dims are configured, then to every row.
5
- let catRows = result.rows.filter((r) => r.__pivotKind === 'leaf');
6
- if (!catRows.length)
7
- catRows = result.rows.filter((r) => r.__pivotKind === 'grandTotal');
8
- if (!catRows.length)
9
- catRows = result.rows.slice();
10
- if (opts.maxCategories && catRows.length > opts.maxCategories) {
11
- catRows = catRows.slice(0, opts.maxCategories);
12
- }
13
- // Categories are the leaf's OWN label; when rows are nested, emit a parent
14
- // tier (categoryGroups) so the axis reads "Americas | Canada · USA ..." as a
15
- // grouped axis rather than colliding on a bare repeated leaf label.
16
- const byId = new Map(result.rows.map((r) => [r.__pivotId, r]));
17
- const ownLabel = (r) => String(r.__pivotLabel ?? '').trim() || '(blank)';
18
- const categories = catRows.map(ownLabel);
19
- const parentOf = (r) => r.__pivotParentId ? byId.get(r.__pivotParentId) : undefined;
20
- const nested = catRows.length > 0 && catRows.every((r) => parentOf(r) !== undefined);
21
- let categoryGroups;
22
- if (nested) {
23
- categoryGroups = [];
24
- let prevId;
25
- for (const r of catRows) {
26
- const pid = r.__pivotParentId;
27
- const last = categoryGroups[categoryGroups.length - 1];
28
- if (last && pid === prevId)
29
- last.span += 1;
30
- else {
31
- categoryGroups.push({ label: ownLabel(parentOf(r)), span: 1 });
32
- prevId = pid;
33
- }
34
- }
35
- }
36
- const leaves = [];
37
- const walk = (cols, path) => {
38
- for (const c of cols ?? []) {
39
- if (!c || c.id === '__pivotRowHeader')
40
- continue;
41
- // Skip the grand-total column group (and its leaves) unless asked for.
42
- if (!opts.includeTotals && typeof c.id === 'string' && c.id.startsWith('pv_group__grand'))
43
- continue;
44
- if (Array.isArray(c.columns))
45
- walk(c.columns, [...path, String(c.header ?? '')]);
46
- else if (typeof c.id === 'string')
47
- leaves.push({ id: c.id, path, header: String(c.header ?? '') });
48
- }
49
- };
50
- walk(result.columns, []);
51
- const filtered = opts.includeTotals ? leaves : leaves.filter((l) => !l.id.includes('__total'));
52
- const uniqueHeaders = new Set(filtered.map((l) => l.header));
53
- const series = filtered.map((l) => ({
54
- label: l.path.length === 0
55
- ? l.header
56
- : uniqueHeaders.size > 1
57
- ? [...l.path, l.header].join(' · ')
58
- : l.path.join(' · '),
59
- values: catRows.map((r) => {
60
- const v = r[l.id];
61
- return typeof v === 'number' ? v : Number(v) || 0;
62
- }),
63
- }));
64
- return {
65
- type,
66
- categories,
67
- series,
68
- ...(categoryGroups && categoryGroups.length > 1 ? { categoryGroups } : {}),
69
- ...(opts.stacked ? { stacked: true } : {}),
70
- };
26
+ return pivotResultToChartSpec(result, opts);
71
27
  }
@@ -7,7 +7,7 @@
7
7
  * normalisation + serialisation without instantiating the component.
8
8
  */
9
9
  import type { CellFormatConfig } from '@svgrid/grid';
10
- import type { PivotAggregatorId } from './pivot';
10
+ import type { PivotAggregatorId } from './pivot.js';
11
11
  /** One field the designer offers in its left-rail picker.
12
12
  * Dimensions land in Rows by default; measures land in Values. */
13
13
  export type PivotField<T extends Record<string, unknown> = Record<string, unknown>> = {