@svgrid/enterprise 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/LICENSE +94 -24
  2. package/README.md +36 -4
  3. package/dist/SvAdvancedFilter.svelte +1 -1
  4. package/dist/SvAlertsManager.svelte +2 -1
  5. package/dist/SvBoard.svelte +2 -1
  6. package/dist/SvExportMenu.svelte +4 -1
  7. package/dist/SvExportMenu.svelte.d.ts +0 -13
  8. package/dist/SvExpressionEditor.svelte +3 -3
  9. package/dist/SvFormulaBar.svelte +680 -0
  10. package/dist/SvFormulaBar.svelte.d.ts +69 -0
  11. package/dist/SvGridAlerts.svelte +49 -9
  12. package/dist/SvGridBoard.svelte +13 -8
  13. package/dist/SvGridBulkEditDrawer.svelte +26 -2
  14. package/dist/SvGridEditPanel.svelte +3 -0
  15. package/dist/SvGridScheduler.svelte +69 -40
  16. package/dist/SvGridSelectionBar.svelte +10 -3
  17. package/dist/SvPivotDesigner.svelte +263 -54
  18. package/dist/SvPivotDesigner.svelte.d.ts +27 -20
  19. package/dist/SvRibbonIcon.svelte +46 -0
  20. package/dist/SvRibbonIcon.svelte.d.ts +17 -0
  21. package/dist/SvSchemaChart.svelte +4 -2
  22. package/dist/SvSheet.svelte +7914 -0
  23. package/dist/SvSheet.svelte.d.ts +215 -0
  24. package/dist/SvSheetChartSetup.svelte +151 -0
  25. package/dist/SvSheetChartSetup.svelte.d.ts +18 -0
  26. package/dist/SvSheetComment.svelte +283 -0
  27. package/dist/SvSheetComment.svelte.d.ts +22 -0
  28. package/dist/SvSheetConditionalFormat.svelte +159 -0
  29. package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
  30. package/dist/SvSheetDataValidation.svelte +273 -0
  31. package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
  32. package/dist/SvSheetEditRanges.svelte +217 -0
  33. package/dist/SvSheetEditRanges.svelte.d.ts +15 -0
  34. package/dist/SvSheetErrors.svelte +125 -0
  35. package/dist/SvSheetErrors.svelte.d.ts +20 -0
  36. package/dist/SvSheetEvaluate.svelte +133 -0
  37. package/dist/SvSheetEvaluate.svelte.d.ts +15 -0
  38. package/dist/SvSheetFilterMenu.svelte +320 -0
  39. package/dist/SvSheetFilterMenu.svelte.d.ts +22 -0
  40. package/dist/SvSheetFindReplace.svelte +132 -0
  41. package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
  42. package/dist/SvSheetFormatCells.svelte +465 -0
  43. package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
  44. package/dist/SvSheetGoalSeek.svelte +145 -0
  45. package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
  46. package/dist/SvSheetInsertFunction.svelte +149 -0
  47. package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
  48. package/dist/SvSheetIteration.svelte +81 -0
  49. package/dist/SvSheetIteration.svelte.d.ts +10 -0
  50. package/dist/SvSheetLink.svelte +99 -0
  51. package/dist/SvSheetLink.svelte.d.ts +17 -0
  52. package/dist/SvSheetListPicker.svelte +91 -0
  53. package/dist/SvSheetListPicker.svelte.d.ts +10 -0
  54. package/dist/SvSheetManageRules.svelte +187 -0
  55. package/dist/SvSheetManageRules.svelte.d.ts +16 -0
  56. package/dist/SvSheetNameManager.svelte +227 -0
  57. package/dist/SvSheetNameManager.svelte.d.ts +11 -0
  58. package/dist/SvSheetPageSetup.svelte +159 -0
  59. package/dist/SvSheetPageSetup.svelte.d.ts +13 -0
  60. package/dist/SvSheetPasteSpecial.svelte +107 -0
  61. package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
  62. package/dist/SvSheetPivot.svelte +220 -0
  63. package/dist/SvSheetPivot.svelte.d.ts +21 -0
  64. package/dist/SvSheetProtectSheet.svelte +81 -0
  65. package/dist/SvSheetProtectSheet.svelte.d.ts +11 -0
  66. package/dist/SvSheetRemoveDuplicates.svelte +152 -0
  67. package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
  68. package/dist/SvSheetRibbon.svelte +1254 -0
  69. package/dist/SvSheetRibbon.svelte.d.ts +34 -0
  70. package/dist/SvSheetSizeDialog.svelte +60 -0
  71. package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
  72. package/dist/SvSheetSort.svelte +218 -0
  73. package/dist/SvSheetSort.svelte.d.ts +28 -0
  74. package/dist/SvSheetSparklines.svelte +135 -0
  75. package/dist/SvSheetSparklines.svelte.d.ts +14 -0
  76. package/dist/SvSheetTable.svelte +160 -0
  77. package/dist/SvSheetTable.svelte.d.ts +24 -0
  78. package/dist/SvSheetTabs.svelte +571 -0
  79. package/dist/SvSheetTabs.svelte.d.ts +50 -0
  80. package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
  81. package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
  82. package/dist/SvSheetTextToColumns.svelte +172 -0
  83. package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
  84. package/dist/SvSheetValidationAlert.svelte +85 -0
  85. package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
  86. package/dist/advanced-filter-enable.js +1 -1
  87. package/dist/alerts/alert-engine.d.ts +6 -0
  88. package/dist/alerts/alert-engine.js +21 -4
  89. package/dist/alerts/alert-formats.js +2 -0
  90. package/dist/alerts/alert-types.d.ts +1 -1
  91. package/dist/alerts.d.ts +1 -1
  92. package/dist/alerts.js +2 -2
  93. package/dist/board.js +2 -2
  94. package/dist/bulk-edit.d.ts +3 -1
  95. package/dist/bulk-edit.js +1 -1
  96. package/dist/cdn/svgrid-enterprise.svelte-external.js +43538 -6539
  97. package/dist/designer/assets/GridMenus-8gTNssgV.js +8 -0
  98. package/dist/designer/assets/SvChartMenu-BDoeqGz6.js +1 -0
  99. package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
  100. package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
  101. package/dist/designer/assets/SvDateTimePicker-DCPg7WGN.js +1 -0
  102. package/dist/designer/assets/SvGridCellEditor-DMoWJjEI.js +4 -0
  103. package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
  104. package/dist/designer/assets/SvGridChart-Cy1ATrWh.js +3 -0
  105. package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
  106. package/dist/designer/assets/SvGridChartBuilder-eQ3mn0L9.js +1 -0
  107. package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
  108. package/dist/designer/assets/SvGridChartPanel-CATdVc9X.js +4 -0
  109. package/dist/designer/assets/{SvGridChartView-DUc-1RUf.css → SvGridChartView-7msfnWZT.css} +1 -1
  110. package/dist/designer/assets/SvGridChartView-CmsZtCED.js +1 -0
  111. package/dist/designer/assets/SvGridDropdown-Cjz0H-fI.js +1 -0
  112. package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
  113. package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
  114. package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
  115. package/dist/designer/assets/SvTabs-2mHC6oaz.js +1 -0
  116. package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
  117. package/dist/designer/assets/cell-formatting-BbubJTVz.js +1 -0
  118. package/dist/designer/assets/chart-Cn7MnNqA.js +1 -0
  119. package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
  120. package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
  121. package/dist/designer/assets/chart-panel-messages-Dz7PTIqT.js +1 -0
  122. package/dist/designer/assets/chart-summary-BD1qYB2R.js +1 -0
  123. package/dist/designer/assets/chart-trend-B8xr5LuD.js +1 -0
  124. package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
  125. package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
  126. package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
  127. package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
  128. package/dist/designer/assets/{dismissable-BO547MH9.js → dismissable-ChWRPkoa.js} +1 -1
  129. package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
  130. package/dist/designer/assets/{export-format-D-eP4b2l.js → export-format-DGckmgKr.js} +1 -1
  131. package/dist/designer/assets/focus-trap-V2-6Fy9I.js +1 -0
  132. package/dist/designer/assets/{index-C_a9Cj8Y.js → index-D5bVbuzI.js} +318 -315
  133. package/dist/designer/assets/index-_JVFxt02.css +1 -0
  134. package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
  135. package/dist/designer/assets/row-resize-BInFWCpr.js +1 -0
  136. package/dist/designer/assets/server-block-cache-CXJKkJpy.js +1 -0
  137. package/dist/designer/assets/src-CITpcm6b.js +1 -0
  138. package/dist/designer/assets/src-DUQ4xE3x.js +58 -0
  139. package/dist/designer/assets/validate-C3B8QKsM.js +1 -0
  140. package/dist/designer/index.html +29 -19
  141. package/dist/export-pdf.d.ts +164 -0
  142. package/dist/export-pdf.js +346 -15
  143. package/dist/export.js +25 -10
  144. package/dist/gantt/SvGridGantt.svelte +2890 -0
  145. package/dist/gantt/SvGridGantt.svelte.d.ts +30 -0
  146. package/dist/gantt/gantt-config.d.ts +73 -0
  147. package/dist/gantt/gantt-config.js +1 -0
  148. package/dist/gantt/gantt-critical-path.d.ts +67 -0
  149. package/dist/gantt/gantt-critical-path.js +207 -0
  150. package/dist/gantt/gantt-model.d.ts +257 -0
  151. package/dist/gantt/gantt-model.js +651 -0
  152. package/dist/gantt/gantt-resources.d.ts +59 -0
  153. package/dist/gantt/gantt-resources.js +71 -0
  154. package/dist/gantt/gantt.d.ts +7 -0
  155. package/dist/gantt/gantt.js +36 -0
  156. package/dist/gantt/index.d.ts +15 -0
  157. package/dist/gantt/index.js +22 -0
  158. package/dist/gantt/timeline-arrows.d.ts +102 -0
  159. package/dist/gantt/timeline-arrows.js +181 -0
  160. package/dist/import.d.ts +2 -2
  161. package/dist/import.js +1 -1
  162. package/dist/index.d.ts +93 -3
  163. package/dist/index.js +107 -3
  164. package/dist/install.js +13 -1
  165. package/dist/license-core.d.ts +17 -1
  166. package/dist/license-core.js +16 -5
  167. package/dist/license.d.ts +18 -2
  168. package/dist/license.js +71 -6
  169. package/dist/node/studio.js +203 -9
  170. package/dist/pivot-chart.d.ts +25 -1
  171. package/dist/pivot-chart.js +25 -69
  172. package/dist/pivot-enable.js +2 -2
  173. package/dist/scheduler-dependencies.d.ts +35 -0
  174. package/dist/scheduler-dependencies.js +36 -1
  175. package/dist/scheduler.js +2 -2
  176. package/dist/selection-bar.js +2 -2
  177. package/dist/server/SvGroupCell.svelte +213 -0
  178. package/dist/server/SvGroupCell.svelte.d.ts +62 -0
  179. package/dist/server/SvRowGroupPanel.svelte +322 -0
  180. package/dist/server/SvRowGroupPanel.svelte.d.ts +37 -0
  181. package/dist/server/enable.d.ts +17 -0
  182. package/dist/server/enable.js +49 -0
  183. package/dist/server/index.d.ts +22 -0
  184. package/dist/server/index.js +24 -0
  185. package/dist/server/messages.d.ts +45 -0
  186. package/dist/server/messages.js +35 -0
  187. package/dist/server/server-group-model.d.ts +104 -0
  188. package/dist/server/server-group-model.js +272 -0
  189. package/dist/server/server-pivot.d.ts +46 -0
  190. package/dist/server/server-pivot.js +57 -0
  191. package/dist/server/server-row-model.d.ts +547 -0
  192. package/dist/server/server-row-model.js +1551 -0
  193. package/dist/server/server-selection.d.ts +99 -0
  194. package/dist/server/server-selection.js +215 -0
  195. package/dist/server/svgrid-adapter.d.ts +155 -0
  196. package/dist/server/svgrid-adapter.js +202 -0
  197. package/dist/sheet/address.d.ts +43 -0
  198. package/dist/sheet/address.js +81 -0
  199. package/dist/sheet/ast.d.ts +138 -0
  200. package/dist/sheet/ast.js +70 -0
  201. package/dist/sheet/auto-filter.d.ts +120 -0
  202. package/dist/sheet/auto-filter.js +295 -0
  203. package/dist/sheet/autocomplete.d.ts +51 -0
  204. package/dist/sheet/autocomplete.js +248 -0
  205. package/dist/sheet/cell-images.d.ts +39 -0
  206. package/dist/sheet/cell-images.js +90 -0
  207. package/dist/sheet/cell-types.d.ts +58 -0
  208. package/dist/sheet/cell-types.js +96 -0
  209. package/dist/sheet/coerce.d.ts +71 -0
  210. package/dist/sheet/coerce.js +289 -0
  211. package/dist/sheet/commands.d.ts +89 -0
  212. package/dist/sheet/commands.js +230 -0
  213. package/dist/sheet/comments.d.ts +63 -0
  214. package/dist/sheet/comments.js +131 -0
  215. package/dist/sheet/conditional-formats.d.ts +167 -0
  216. package/dist/sheet/conditional-formats.js +341 -0
  217. package/dist/sheet/csv.d.ts +32 -0
  218. package/dist/sheet/csv.js +158 -0
  219. package/dist/sheet/culture.d.ts +87 -0
  220. package/dist/sheet/culture.js +247 -0
  221. package/dist/sheet/delta.d.ts +102 -0
  222. package/dist/sheet/delta.js +203 -0
  223. package/dist/sheet/deps.d.ts +104 -0
  224. package/dist/sheet/deps.js +274 -0
  225. package/dist/sheet/document.d.ts +252 -0
  226. package/dist/sheet/document.js +465 -0
  227. package/dist/sheet/edit-keys.d.ts +14 -0
  228. package/dist/sheet/edit-keys.js +40 -0
  229. package/dist/sheet/engine.d.ts +67 -0
  230. package/dist/sheet/engine.js +19 -0
  231. package/dist/sheet/entry.d.ts +35 -0
  232. package/dist/sheet/entry.js +226 -0
  233. package/dist/sheet/error-check.d.ts +49 -0
  234. package/dist/sheet/error-check.js +83 -0
  235. package/dist/sheet/evaluate-steps.d.ts +48 -0
  236. package/dist/sheet/evaluate-steps.js +196 -0
  237. package/dist/sheet/evaluate.d.ts +128 -0
  238. package/dist/sheet/evaluate.js +1049 -0
  239. package/dist/sheet/filter-files.d.ts +37 -0
  240. package/dist/sheet/filter-files.js +465 -0
  241. package/dist/sheet/find-replace.d.ts +62 -0
  242. package/dist/sheet/find-replace.js +152 -0
  243. package/dist/sheet/format-store.d.ts +114 -0
  244. package/dist/sheet/format-store.js +243 -0
  245. package/dist/sheet/freeze.d.ts +54 -0
  246. package/dist/sheet/freeze.js +58 -0
  247. package/dist/sheet/from-rows.d.ts +14 -0
  248. package/dist/sheet/from-rows.js +50 -0
  249. package/dist/sheet/function-catalog.d.ts +10 -0
  250. package/dist/sheet/function-catalog.js +385 -0
  251. package/dist/sheet/functions.d.ts +28 -0
  252. package/dist/sheet/functions.js +634 -0
  253. package/dist/sheet/goal-seek.d.ts +73 -0
  254. package/dist/sheet/goal-seek.js +153 -0
  255. package/dist/sheet/index.d.ts +80 -0
  256. package/dist/sheet/index.js +80 -0
  257. package/dist/sheet/links.d.ts +57 -0
  258. package/dist/sheet/links.js +174 -0
  259. package/dist/sheet/merges.d.ts +71 -0
  260. package/dist/sheet/merges.js +137 -0
  261. package/dist/sheet/messages.d.ts +778 -0
  262. package/dist/sheet/messages.js +806 -0
  263. package/dist/sheet/names.d.ts +31 -0
  264. package/dist/sheet/names.js +87 -0
  265. package/dist/sheet/navigate.d.ts +52 -0
  266. package/dist/sheet/navigate.js +135 -0
  267. package/dist/sheet/number-format.d.ts +110 -0
  268. package/dist/sheet/number-format.js +905 -0
  269. package/dist/sheet/objects.d.ts +106 -0
  270. package/dist/sheet/objects.js +149 -0
  271. package/dist/sheet/ods-document.d.ts +44 -0
  272. package/dist/sheet/ods-document.js +1275 -0
  273. package/dist/sheet/open-file.d.ts +26 -0
  274. package/dist/sheet/open-file.js +56 -0
  275. package/dist/sheet/outline.d.ts +82 -0
  276. package/dist/sheet/outline.js +228 -0
  277. package/dist/sheet/packs/array.d.ts +16 -0
  278. package/dist/sheet/packs/array.js +172 -0
  279. package/dist/sheet/packs/database.d.ts +42 -0
  280. package/dist/sheet/packs/database.js +142 -0
  281. package/dist/sheet/packs/engineering.d.ts +2 -0
  282. package/dist/sheet/packs/engineering.js +296 -0
  283. package/dist/sheet/packs/financial.d.ts +5 -0
  284. package/dist/sheet/packs/financial.js +220 -0
  285. package/dist/sheet/packs/math-stats.d.ts +2 -0
  286. package/dist/sheet/packs/math-stats.js +372 -0
  287. package/dist/sheet/packs/special.d.ts +44 -0
  288. package/dist/sheet/packs/special.js +187 -0
  289. package/dist/sheet/packs/stats-dist.d.ts +2 -0
  290. package/dist/sheet/packs/stats-dist.js +785 -0
  291. package/dist/sheet/packs/text-date.d.ts +2 -0
  292. package/dist/sheet/packs/text-date.js +332 -0
  293. package/dist/sheet/packs/trig.d.ts +2 -0
  294. package/dist/sheet/packs/trig.js +73 -0
  295. package/dist/sheet/page-setup.d.ts +73 -0
  296. package/dist/sheet/page-setup.js +73 -0
  297. package/dist/sheet/palette.d.ts +19 -0
  298. package/dist/sheet/palette.js +84 -0
  299. package/dist/sheet/parse.d.ts +13 -0
  300. package/dist/sheet/parse.js +140 -0
  301. package/dist/sheet/paste-special.d.ts +186 -0
  302. package/dist/sheet/paste-special.js +601 -0
  303. package/dist/sheet/pivot-range.d.ts +160 -0
  304. package/dist/sheet/pivot-range.js +333 -0
  305. package/dist/sheet/presence.d.ts +73 -0
  306. package/dist/sheet/presence.js +79 -0
  307. package/dist/sheet/print.d.ts +104 -0
  308. package/dist/sheet/print.js +169 -0
  309. package/dist/sheet/protection.d.ts +75 -0
  310. package/dist/sheet/protection.js +101 -0
  311. package/dist/sheet/rects.d.ts +45 -0
  312. package/dist/sheet/rects.js +112 -0
  313. package/dist/sheet/refs.d.ts +130 -0
  314. package/dist/sheet/refs.js +413 -0
  315. package/dist/sheet/ribbon-icons.d.ts +31 -0
  316. package/dist/sheet/ribbon-icons.js +536 -0
  317. package/dist/sheet/ribbon.d.ts +173 -0
  318. package/dist/sheet/ribbon.js +1054 -0
  319. package/dist/sheet/sheet-kinds.d.ts +74 -0
  320. package/dist/sheet/sheet-kinds.js +91 -0
  321. package/dist/sheet/shortcuts.d.ts +174 -0
  322. package/dist/sheet/shortcuts.js +674 -0
  323. package/dist/sheet/sort.d.ts +51 -0
  324. package/dist/sheet/sort.js +107 -0
  325. package/dist/sheet/sparklines.d.ts +111 -0
  326. package/dist/sheet/sparklines.js +204 -0
  327. package/dist/sheet/structure.d.ts +87 -0
  328. package/dist/sheet/structure.js +166 -0
  329. package/dist/sheet/table-styles.d.ts +74 -0
  330. package/dist/sheet/table-styles.js +152 -0
  331. package/dist/sheet/tables.d.ts +89 -0
  332. package/dist/sheet/tables.js +178 -0
  333. package/dist/sheet/tokenize.d.ts +71 -0
  334. package/dist/sheet/tokenize.js +355 -0
  335. package/dist/sheet/transforms.d.ts +76 -0
  336. package/dist/sheet/transforms.js +154 -0
  337. package/dist/sheet/validation.d.ts +108 -0
  338. package/dist/sheet/validation.js +278 -0
  339. package/dist/sheet/workbook.d.ts +217 -0
  340. package/dist/sheet/workbook.js +1120 -0
  341. package/dist/sheet/xls-cfb.d.ts +32 -0
  342. package/dist/sheet/xls-cfb.js +290 -0
  343. package/dist/sheet/xls-document.d.ts +10 -0
  344. package/dist/sheet/xls-document.js +1243 -0
  345. package/dist/sheet/xls-formula.d.ts +40 -0
  346. package/dist/sheet/xls-formula.js +569 -0
  347. package/dist/sheet/xlsx-document.d.ts +108 -0
  348. package/dist/sheet/xlsx-document.js +1849 -0
  349. package/dist/sheet/xlsx-drawing.d.ts +99 -0
  350. package/dist/sheet/xlsx-drawing.js +420 -0
  351. package/dist/sheet-enable.d.ts +6 -0
  352. package/dist/sheet-enable.js +45 -0
  353. package/dist/sheet-text.d.ts +7 -0
  354. package/dist/sheet-text.js +29 -0
  355. package/dist/sources/auth-supabase.js +2 -2
  356. package/dist/sources/realtime-supabase.js +2 -2
  357. package/dist/sources/rest.d.ts +6 -2
  358. package/dist/sources/rest.js +42 -7
  359. package/dist/sources/supabase.d.ts +10 -1
  360. package/dist/sources/supabase.js +73 -40
  361. package/dist/studio/emit-project.js +14 -1
  362. package/dist/studio/index.js +1 -1
  363. package/dist/studio/project.d.ts +11 -2
  364. package/dist/studio/project.js +5 -2
  365. package/dist/studio/ui-components.generated.js +170 -3
  366. package/dist/sveltekit/in-memory.d.ts +2 -2
  367. package/dist/sveltekit/in-memory.js +125 -4
  368. package/dist/sveltekit/index.d.ts +1 -1
  369. package/dist/sveltekit/index.js +1 -1
  370. package/dist/sveltekit/query-plan.d.ts +50 -4
  371. package/dist/sveltekit/query-plan.js +25 -3
  372. package/dist/sveltekit/sql-source.d.ts +6 -0
  373. package/dist/sveltekit/sql-source.js +34 -6
  374. package/dist/sveltekit/sql.d.ts +31 -0
  375. package/dist/sveltekit/sql.js +135 -25
  376. package/dist/sveltekit/transport.d.ts +10 -2
  377. package/dist/sveltekit/transport.js +30 -6
  378. package/dist/upgrade-prompt.d.ts +1 -1
  379. package/dist/version.d.ts +1 -1
  380. package/dist/version.js +1 -1
  381. package/dist/watermark.js +35 -2
  382. package/dist/wc/GridMenus-By9vPuq0.js +1088 -0
  383. package/dist/wc/SvChartMenu-CQNrQGT2.js +308 -0
  384. package/dist/wc/SvDateRangeInput-DR6m7bSM.js +199 -0
  385. package/dist/wc/SvDateTimePicker-D-vRnaMo.js +771 -0
  386. package/dist/wc/SvField-B_kurx_P.js +149 -0
  387. package/dist/wc/SvGrid.helpers-BdVDtjUm.js +135 -0
  388. package/dist/wc/SvGridCellEditor-Bnf1Kr5C.js +560 -0
  389. package/dist/wc/SvGridChart-BqUJh2pG.js +3572 -0
  390. package/dist/wc/SvGridChartBuilder-CGycC5cn.js +988 -0
  391. package/dist/wc/SvGridChartPanel-CRnizsHD.js +1746 -0
  392. package/dist/wc/SvGridChartView-D1pa_xMy.js +47 -0
  393. package/dist/wc/SvGridDropdown-45WsObLL.js +259 -0
  394. package/dist/wc/SvModal-DrfOYYyX.js +189 -0
  395. package/dist/wc/cell-formatting-CBfgahv1.js +86 -0
  396. package/dist/wc/chart-6OXlybVT.js +4341 -0
  397. package/dist/wc/chart-export-CeSADGfi.js +135 -0
  398. package/dist/wc/chart-export-pdf-BGko7MER.js +104 -0
  399. package/dist/wc/chart-summary-2m3ia1-n.js +137 -0
  400. package/dist/wc/chart-trend-CQOQtTMl.js +50 -0
  401. package/dist/wc/chart-validate-CD6ptiwg.js +180 -0
  402. package/dist/wc/client-DQIzjDBG.js +3064 -0
  403. package/dist/wc/column-resize-DUPgynvc.js +101 -0
  404. package/dist/wc/date-format-DS-z_h9v.js +1130 -0
  405. package/dist/wc/dismissable-CQ6XFXsk.js +45 -0
  406. package/dist/wc/editor-contract-peBDxir_.js +22 -0
  407. package/dist/wc/editor-registry-DxGKqcvx.js +24 -0
  408. package/dist/wc/focus-trap-Dbb2tJxb.js +65 -0
  409. package/dist/wc/list-option-DrRyivWp.js +82 -0
  410. package/dist/wc/popover-WsGlvtQv.js +69 -0
  411. package/dist/wc/positioning-BiKLfu1E.js +112 -0
  412. package/dist/wc/react.d.ts +41 -0
  413. package/dist/wc/react.js +90 -0
  414. package/dist/wc/rolldown-runtime-Dy4uBu1J.js +11 -0
  415. package/dist/wc/row-drag-touch-CycRR65n.js +93 -0
  416. package/dist/wc/row-resize-limG_N1z.js +111 -0
  417. package/dist/wc/sv-sheet-element.d.ts +97 -0
  418. package/dist/wc/sv-sheet-element.js +44213 -0
  419. package/dist/wc/svelte-virtualizer.svelte-CXtQy2TQ.js +530 -0
  420. package/dist/wc/validate-BqDthkNr.js +88 -0
  421. package/dist/wc/vue.d.ts +31 -0
  422. package/dist/wc/vue.js +75 -0
  423. package/package.json +36 -6
  424. package/dist/designer/assets/GridMenus-B1JtIN21.js +0 -8
  425. package/dist/designer/assets/SvDateRangeInput-CjO7nn_x.js +0 -1
  426. package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +0 -1
  427. package/dist/designer/assets/SvField-YDLipR6O.css +0 -1
  428. package/dist/designer/assets/SvField-cj1PFNgZ.js +0 -1
  429. package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +0 -2
  430. package/dist/designer/assets/SvGridChart-DBOR4xcz.js +0 -2
  431. package/dist/designer/assets/SvGridChart-fkMWeh1J.css +0 -1
  432. package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +0 -11
  433. package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +0 -1
  434. package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +0 -1
  435. package/dist/designer/assets/SvListBox-1oUF6Iav.js +0 -110
  436. package/dist/designer/assets/cell-formatting-wr5wm7US.js +0 -1
  437. package/dist/designer/assets/chart-DXFganU8.js +0 -1
  438. package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
  439. package/dist/designer/assets/date-format-DGagAqRc.css +0 -1
  440. package/dist/designer/assets/date-format-onlYDsrY.js +0 -1
  441. package/dist/designer/assets/easing-zaypKrr0.js +0 -3
  442. package/dist/designer/assets/index-k2stW6L8.css +0 -1
  443. package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
  444. package/dist/designer/assets/src-D9p27OGC.js +0 -58
  445. package/dist/designer/assets/validate-h-aslRV9.js +0 -1
@@ -0,0 +1,132 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Excel's Find and Replace, the Replace tab: what to find, what to put in
4
+ * its place, whether case and the whole cell must match, and whether to
5
+ * look at what a cell shows or at the formula behind it. Find Next walks
6
+ * the sheet from the active cell and wraps; Replace changes the active
7
+ * cell when it matches and moves on; Replace All is one undo.
8
+ *
9
+ * The shell opens it for Ctrl+H, the ribbon's Find & Select and the
10
+ * `find-replace` action. It reads and writes through the find target the
11
+ * shell registers, so a replacement lands in the workbook and in the
12
+ * grid's history like a typed edit. Styled by the `.sv-sheet-dialog`
13
+ * rules the shell carries for all four of its dialogs.
14
+ */
15
+ import { useSheetText } from './sheet-text'
16
+ import { SvModal } from '@svgrid/grid'
17
+ import type { GridCommandContext } from '@svgrid/grid/shortcuts'
18
+ import { findAll, findNext, replaceOne, replaceAll, type FindOptions } from './sheet/find-replace'
19
+
20
+ type Props = {
21
+ open?: boolean
22
+ /** The command context to search with; null while the grid has no api. */
23
+ cmd: () => GridCommandContext | null
24
+ onClose?: () => void
25
+ }
26
+
27
+ let { open = $bindable(false), cmd, onClose }: Props = $props()
28
+ const t = useSheetText()
29
+
30
+ let findText = $state('')
31
+ let replaceText = $state('')
32
+ let matchCase = $state(false)
33
+ let entireCell = $state(false)
34
+ let lookIn = $state<'values' | 'formulas'>('values')
35
+ let status = $state('')
36
+ let findInput = $state<HTMLInputElement | null>(null)
37
+
38
+ const options = (): FindOptions => ({ matchCase, matchEntireCell: entireCell, lookIn })
39
+
40
+ // A fresh open starts with the caret in Find what, as Excel's does.
41
+ $effect(() => {
42
+ if (open) {
43
+ status = ''
44
+ queueMicrotask(() => findInput?.focus())
45
+ }
46
+ })
47
+
48
+ function land(hit: { rowIndex: number; colIndex: number } | null) {
49
+ const c = cmd()
50
+ if (!c) return
51
+ if (!hit) {
52
+ status = findText ? t('findReplace.notFound') : ''
53
+ return
54
+ }
55
+ c.setActiveCell(hit.rowIndex, hit.colIndex)
56
+ c.setSelection(hit.rowIndex, hit.colIndex)
57
+ c.scrollIntoView(hit.rowIndex, hit.colIndex)
58
+ status = ''
59
+ }
60
+
61
+ function next(direction: 1 | -1 = 1) {
62
+ const c = cmd()
63
+ if (!c || !findText) return
64
+ land(findNext(c, findText, options(), direction))
65
+ }
66
+
67
+ function countAll() {
68
+ const c = cmd()
69
+ if (!c || !findText) return
70
+ const n = findAll(c, findText, options()).length
71
+ status = n === 0 ? t('findReplace.notFound') : t(n === 1 ? 'findReplace.cellFound' : 'findReplace.cellsFound', { count: n })
72
+ }
73
+
74
+ function replace() {
75
+ const c = cmd()
76
+ if (!c || !findText) return
77
+ replaceOne(c, findText, replaceText, options())
78
+ }
79
+
80
+ function all() {
81
+ const c = cmd()
82
+ if (!c || !findText) return
83
+ const n = replaceAll(c, findText, replaceText, options())
84
+ status = n === 0 ? t('findReplace.nothingToReplace') : t(n === 1 ? 'findReplace.replacedOne' : 'findReplace.replacedMany', { count: n })
85
+ }
86
+
87
+ function close() {
88
+ open = false
89
+ onClose?.()
90
+ }
91
+
92
+ function onKey(event: KeyboardEvent) {
93
+ if (event.key === 'Enter') {
94
+ event.preventDefault()
95
+ next(event.shiftKey ? -1 : 1)
96
+ }
97
+ }
98
+ </script>
99
+
100
+ <SvModal bind:open onClose={onClose} title={t('findReplace.title')} size="sm">
101
+ <div class="sv-sheet-dialog" role="group" aria-label={t('findReplace.title')}>
102
+ <label class="field">
103
+ <span>{t('findReplace.findWhat')}</span>
104
+ <input bind:this={findInput} type="text" bind:value={findText} onkeydown={onKey} spellcheck="false" autocomplete="off" />
105
+ </label>
106
+ <label class="field">
107
+ <span>{t('findReplace.replaceWith')}</span>
108
+ <input type="text" bind:value={replaceText} onkeydown={onKey} spellcheck="false" autocomplete="off" />
109
+ </label>
110
+ <div class="checks">
111
+ <label class="check"><input type="checkbox" bind:checked={matchCase} /> {t('findReplace.matchCase')}</label>
112
+ <label class="check"><input type="checkbox" bind:checked={entireCell} /> {t('findReplace.entireCell')}</label>
113
+ <label class="field auto">
114
+ <span>{t('findReplace.lookIn')}</span>
115
+ <select bind:value={lookIn}>
116
+ <option value="values">{t('findReplace.values')}</option>
117
+ <option value="formulas">{t('findReplace.formulas')}</option>
118
+ </select>
119
+ </label>
120
+ </div>
121
+ <div class="status" role="status" aria-live="polite">{status}</div>
122
+ </div>
123
+ {#snippet footer()}
124
+ <div class="sv-sheet-dialog-buttons">
125
+ <button type="button" class="btn" onclick={all} disabled={!findText}>{t('findReplace.replaceAll')}</button>
126
+ <button type="button" class="btn" onclick={replace} disabled={!findText}>{t('findReplace.replace')}</button>
127
+ <button type="button" class="btn" onclick={countAll} disabled={!findText}>{t('findReplace.findAll')}</button>
128
+ <button type="button" class="btn primary" onclick={() => next(1)} disabled={!findText}>{t('findReplace.findNext')}</button>
129
+ <button type="button" class="btn" onclick={close}>{t('close')}</button>
130
+ </div>
131
+ {/snippet}
132
+ </SvModal>
@@ -0,0 +1,10 @@
1
+ import type { GridCommandContext } from '@svgrid/grid/shortcuts';
2
+ type Props = {
3
+ open?: boolean;
4
+ /** The command context to search with; null while the grid has no api. */
5
+ cmd: () => GridCommandContext | null;
6
+ onClose?: () => void;
7
+ };
8
+ declare const SvSheetFindReplace: import("svelte").Component<Props, {}, "open">;
9
+ type SvSheetFindReplace = ReturnType<typeof SvSheetFindReplace>;
10
+ export default SvSheetFindReplace;
@@ -0,0 +1,465 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Excel's Format Cells, the six tabs that have something behind them in
4
+ * the sheet: Number, Alignment, Font, Border, Fill, Protection. It opens on the active
5
+ * cell's format and, on OK, applies only what was changed to the whole
6
+ * selection, so setting a fill on a block with mixed fonts leaves the
7
+ * fonts as they were. One undo, through `applyFormat`.
8
+ *
9
+ * The shell opens it for Ctrl+1, the group launchers on the ribbon, the
10
+ * cell menu's Format Cells... and the `format-cells` action.
11
+ */
12
+ import { useSheetText } from './sheet-text'
13
+ import { SvModal } from '@svgrid/grid'
14
+ import type { CellFormatEntry } from './sheet/format-store'
15
+ import {
16
+ compileNumberFormat, FORMAT_PRESETS, SPECIAL_FORMATS, formatCategory, accountingPattern, accountingParts,
17
+ type SpecialFormatName,
18
+ } from './sheet/number-format'
19
+ import { FONT_FAMILIES, FONT_SIZES, type BorderPreset } from './sheet/ribbon'
20
+ import { ALL_COLOURS } from './sheet/palette'
21
+
22
+ type Props = {
23
+ open?: boolean
24
+ /** The active cell's format, what the dialog opens on. */
25
+ entry: CellFormatEntry | undefined
26
+ /** The active cell's value, for the Number tab's sample. */
27
+ sample: unknown
28
+ /** The selection holds locked and unlocked cells both: the Protection
29
+ * tab's box opens indeterminate and, left alone, changes nothing. */
30
+ mixedLocked?: boolean
31
+ onApply: (patch: CellFormatEntry, border: BorderPreset | null) => void
32
+ onClose?: () => void
33
+ }
34
+
35
+ let { open = $bindable(false), entry, sample, mixedLocked = false, onApply, onClose }: Props = $props()
36
+ const t = useSheetText()
37
+
38
+ type Tab = 'number' | 'alignment' | 'font' | 'border' | 'fill' | 'protection'
39
+ const TABS: ReadonlyArray<{ id: Tab; label: string }> = [
40
+ { id: 'number', label: 'formatCells.tab.number' },
41
+ { id: 'alignment', label: 'formatCells.tab.alignment' },
42
+ { id: 'font', label: 'formatCells.tab.font' },
43
+ { id: 'border', label: 'formatCells.tab.border' },
44
+ { id: 'fill', label: 'formatCells.tab.fill' },
45
+ { id: 'protection', label: 'formatCells.tab.protection' },
46
+ ]
47
+ let tab = $state<Tab>('number')
48
+
49
+ type Category = 'general' | 'number' | 'currency' | 'accounting' | 'percent' | 'date' | 'time' | 'scientific' | 'special' | 'custom'
50
+ const CATEGORIES: ReadonlyArray<{ id: Category; label: string }> = [
51
+ { id: 'general', label: 'formatCells.category.general' },
52
+ { id: 'number', label: 'formatCells.category.number' },
53
+ { id: 'currency', label: 'formatCells.category.currency' },
54
+ { id: 'accounting', label: 'formatCells.category.accounting' },
55
+ { id: 'percent', label: 'formatCells.category.percent' },
56
+ { id: 'date', label: 'formatCells.category.date' },
57
+ { id: 'time', label: 'formatCells.category.time' },
58
+ { id: 'scientific', label: 'formatCells.category.scientific' },
59
+ { id: 'special', label: 'formatCells.category.special' },
60
+ { id: 'custom', label: 'formatCells.category.custom' },
61
+ ]
62
+ /** Excel's symbol list, the short one. An empty value is its "None". */
63
+ const SYMBOLS: ReadonlyArray<{ value: string; label: string }> = [
64
+ { value: '$', label: '$' },
65
+ { value: '', label: 'formatCells.symbol.none' },
66
+ { value: '\u20ac', label: 'formatCells.symbol.euro' },
67
+ { value: '\u00a3', label: 'formatCells.symbol.pound' },
68
+ { value: '\u00a5', label: 'formatCells.symbol.yen' },
69
+ ]
70
+ const SPECIALS = Object.keys(SPECIAL_FORMATS) as SpecialFormatName[]
71
+
72
+ // Number
73
+ let category = $state<Category>('general')
74
+ let decimals = $state(2)
75
+ let thousands = $state(true)
76
+ let symbol = $state('$')
77
+ let special = $state<SpecialFormatName>('zip')
78
+ let custom = $state('')
79
+ // Alignment
80
+ let align = $state<'' | 'left' | 'center' | 'right'>('')
81
+ let valign = $state<'top' | 'center' | 'bottom'>('center')
82
+ let wrap = $state(false)
83
+ let indent = $state(0)
84
+ // Font
85
+ let fontFamily = $state('')
86
+ let fontSize = $state('')
87
+ let bold = $state(false)
88
+ let italic = $state(false)
89
+ let underline = $state(false)
90
+ let strike = $state(false)
91
+ let colorAuto = $state(true)
92
+ let color = $state('#000000')
93
+ // Border
94
+ let border = $state<BorderPreset | ''>('')
95
+ // Fill
96
+ let fill = $state<string | null>(null)
97
+ // Protection: null is the indeterminate box of a mixed selection.
98
+ let locked = $state<boolean | null>(true)
99
+
100
+ let initial: CellFormatEntry = {}
101
+ /** What the colour input opened on, so an untouched picker keeps a colour
102
+ * the input cannot show (a CSS name, an rgb()) rather than replacing it. */
103
+ let initialColor = '#000000'
104
+
105
+ /** Which category a pattern belongs to, so the dialog opens on it. */
106
+ const categoryOf = (fmt: string | undefined): { category: Category; decimals: number; thousands: boolean } =>
107
+ formatCategory(fmt)
108
+
109
+ const zeros = (n: number) => (n > 0 ? '.' + '0'.repeat(n) : '')
110
+
111
+ /** The pattern the Number tab's choices spell. */
112
+ const pattern = $derived.by<string | undefined>(() => {
113
+ switch (category) {
114
+ case 'general': return undefined
115
+ case 'number': return `${thousands ? '#,##' : ''}0${zeros(decimals)}`
116
+ case 'currency': return `$#,##0${zeros(decimals)};($#,##0${zeros(decimals)})`
117
+ case 'accounting': return accountingPattern(symbol, decimals)
118
+ case 'special': return SPECIAL_FORMATS[special].pattern
119
+ case 'percent': return `0${zeros(decimals)}%`
120
+ case 'date': return FORMAT_PRESETS.date
121
+ case 'time': return FORMAT_PRESETS.time
122
+ case 'scientific': return `0${zeros(decimals)}E+00`
123
+ case 'custom': return custom || undefined
124
+ }
125
+ })
126
+
127
+ const preview = $derived.by(() => {
128
+ if (sample === '' || sample == null) return ''
129
+ if (!pattern) return String(sample)
130
+ try { return compileNumberFormat(pattern).format(sample).text } catch { return String(sample) }
131
+ })
132
+
133
+ // Open on the active cell's format.
134
+ $effect(() => {
135
+ if (!open) return
136
+ initial = { ...(entry ?? {}) }
137
+ const num = categoryOf(initial.numFmt)
138
+ category = num.category
139
+ decimals = num.decimals
140
+ thousands = num.thousands
141
+ symbol = accountingParts(initial.numFmt)?.symbol ?? '$'
142
+ special = SPECIALS.find((id) => SPECIAL_FORMATS[id].pattern === initial.numFmt) ?? 'zip'
143
+ custom = initial.numFmt ?? ''
144
+ align = initial.align ?? ''
145
+ valign = initial.valign ?? 'center'
146
+ wrap = initial.wrap ?? false
147
+ indent = initial.indent ?? 0
148
+ fontFamily = initial.fontFamily ?? ''
149
+ fontSize = initial.fontSize ? String(initial.fontSize) : ''
150
+ bold = !!initial.bold
151
+ italic = !!initial.italic
152
+ underline = !!initial.underline
153
+ strike = !!initial.strike
154
+ colorAuto = !initial.color
155
+ color = /^#[0-9a-f]{6}$/i.test(initial.color ?? '') ? initial.color! : '#000000'
156
+ initialColor = color
157
+ border = ''
158
+ fill = initial.fill ?? null
159
+ locked = mixedLocked ? null : initial.locked !== false
160
+ })
161
+
162
+ function ok() {
163
+ // Only what changed goes into the patch; `undefined` clears a field.
164
+ const patch: CellFormatEntry = {}
165
+ const set = <K extends keyof CellFormatEntry>(key: K, next: CellFormatEntry[K]) => {
166
+ if (initial[key] !== next) patch[key] = next
167
+ }
168
+ set('numFmt', pattern)
169
+ set('align', align || undefined)
170
+ // Middle is the default the sheet already draws, so only top and bottom
171
+ // are stored, the way an unset field means "as it was".
172
+ set('valign', valign === 'center' ? undefined : valign)
173
+ set('wrap', wrap || undefined)
174
+ set('indent', indent > 0 ? indent : undefined)
175
+ set('fontFamily', fontFamily || undefined)
176
+ set('fontSize', fontSize ? Number(fontSize) : undefined)
177
+ set('bold', bold || undefined)
178
+ set('italic', italic || undefined)
179
+ set('underline', underline || undefined)
180
+ set('strike', strike || undefined)
181
+ set('color', colorAuto ? undefined : color === initialColor ? initial.color : color)
182
+ set('fill', fill ?? undefined)
183
+ // Locked is the default, so only "unlocked" is ever stored; a mixed
184
+ // selection left indeterminate stays as it was.
185
+ if (locked !== null) {
186
+ const next = locked ? undefined : false
187
+ if (mixedLocked || initial.locked !== next) patch.locked = next
188
+ }
189
+ onApply(patch, border || null)
190
+ open = false
191
+ onClose?.()
192
+ }
193
+
194
+ function close() {
195
+ open = false
196
+ onClose?.()
197
+ }
198
+
199
+ const BORDERS: ReadonlyArray<{ value: BorderPreset; label: string }> = [
200
+ { value: 'none', label: 'formatCells.border.none' },
201
+ { value: 'outside', label: 'formatCells.border.outside' },
202
+ { value: 'all', label: 'formatCells.border.all' },
203
+ { value: 'top', label: 'formatCells.border.top' },
204
+ { value: 'bottom', label: 'formatCells.border.bottom' },
205
+ { value: 'left', label: 'formatCells.border.left' },
206
+ { value: 'right', label: 'formatCells.border.right' },
207
+ { value: 'thick-bottom', label: 'formatCells.border.thick-bottom' },
208
+ ]
209
+ </script>
210
+
211
+ <SvModal bind:open onClose={onClose} title={t('formatCells.title')} size="md">
212
+ <div class="sv-sheet-dialog format" role="group" aria-label={t('formatCells.title')}>
213
+ <div class="tabs" role="tablist" aria-label={t('formatCells.tabs')}>
214
+ {#each TABS as tabEntry (tabEntry.id)}
215
+ <button
216
+ type="button"
217
+ role="tab"
218
+ class="tab"
219
+ class:on={tab === tabEntry.id}
220
+ aria-selected={tab === tabEntry.id}
221
+ onclick={() => (tab = tabEntry.id)}
222
+ >{t(tabEntry.label)}</button>
223
+ {/each}
224
+ </div>
225
+
226
+ <div class="panel" role="tabpanel">
227
+ {#if tab === 'number'}
228
+ <div class="number">
229
+ <div class="categories">
230
+ <div class="label">{t('formatCells.category')}</div>
231
+ <ul role="listbox" aria-label={t('formatCells.categoryList')}>
232
+ {#each CATEGORIES as c (c.id)}
233
+ <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions -->
234
+ <li role="option" aria-selected={category === c.id} class:selected={category === c.id} onclick={() => (category = c.id)}>{t(c.label)}</li>
235
+ {/each}
236
+ </ul>
237
+ </div>
238
+ <div class="settings">
239
+ <div class="sample">
240
+ <div class="label">{t('formatCells.sample')}</div>
241
+ <div class="sample-text">{preview}</div>
242
+ </div>
243
+ {#if category === 'number' || category === 'currency' || category === 'accounting' || category === 'percent' || category === 'scientific'}
244
+ <label class="field auto">
245
+ <span>{t('formatCells.decimalPlaces')}</span>
246
+ <input type="number" min="0" max="10" bind:value={decimals} />
247
+ </label>
248
+ {/if}
249
+ {#if category === 'number'}
250
+ <label class="check"><input type="checkbox" bind:checked={thousands} /> {t('formatCells.thousands')}</label>
251
+ {/if}
252
+ {#if category === 'accounting'}
253
+ <label class="field auto">
254
+ <span>{t('formatCells.symbol')}</span>
255
+ <select bind:value={symbol}>
256
+ {#each SYMBOLS as sy (sy.value)}<option value={sy.value}>{sy.value === '$' ? sy.label : t(sy.label)}</option>{/each}
257
+ </select>
258
+ </label>
259
+ {/if}
260
+ {#if category === 'special'}
261
+ <label class="field auto">
262
+ <span>{t('formatCells.type')}</span>
263
+ <select bind:value={special}>
264
+ {#each SPECIALS as id (id)}<option value={id}>{t(`formatCells.special.${id}`)}</option>{/each}
265
+ </select>
266
+ </label>
267
+ {/if}
268
+ {#if category === 'custom'}
269
+ <label class="field auto">
270
+ <span>{t('formatCells.type')}</span>
271
+ <input type="text" bind:value={custom} spellcheck="false" placeholder="#,##0.00" />
272
+ </label>
273
+ {/if}
274
+ <p class="hint">
275
+ {t(`formatCells.hint.${category}`)}
276
+ </p>
277
+ </div>
278
+ </div>
279
+ {:else if tab === 'alignment'}
280
+ <label class="field">
281
+ <span>{t('formatCells.horizontal')}</span>
282
+ <select bind:value={align}>
283
+ <option value="">{t('formatCells.align.general')}</option>
284
+ <option value="left">{t('formatCells.align.left')}</option>
285
+ <option value="center">{t('formatCells.align.center')}</option>
286
+ <option value="right">{t('formatCells.align.right')}</option>
287
+ </select>
288
+ </label>
289
+ <label class="field">
290
+ <span>{t('formatCells.vertical')}</span>
291
+ <select bind:value={valign}>
292
+ <option value="top">{t('formatCells.valign.top')}</option>
293
+ <option value="center">{t('formatCells.valign.center')}</option>
294
+ <option value="bottom">{t('formatCells.valign.bottom')}</option>
295
+ </select>
296
+ </label>
297
+ <label class="field">
298
+ <span>{t('formatCells.indent')}</span>
299
+ <input type="number" min="0" max="15" bind:value={indent} />
300
+ </label>
301
+ <div class="label">{t('formatCells.textControl')}</div>
302
+ <label class="check"><input type="checkbox" bind:checked={wrap} /> {t('formatCells.wrap')}</label>
303
+ {:else if tab === 'font'}
304
+ <label class="field">
305
+ <span>{t('formatCells.font')}</span>
306
+ <select bind:value={fontFamily}>
307
+ {#each FONT_FAMILIES as f (f.value)}
308
+ <option value={f.value}>{f.label}</option>
309
+ {/each}
310
+ </select>
311
+ </label>
312
+ <label class="field">
313
+ <span>{t('formatCells.size')}</span>
314
+ <select bind:value={fontSize}>
315
+ <option value="">{t('formatCells.sizeDefault')}</option>
316
+ {#each FONT_SIZES as s (s)}
317
+ <option value={String(s)}>{s}</option>
318
+ {/each}
319
+ </select>
320
+ </label>
321
+ <div class="label">{t('formatCells.fontStyle')}</div>
322
+ <div class="checks">
323
+ <label class="check"><input type="checkbox" bind:checked={bold} /> {t('formatCells.bold')}</label>
324
+ <label class="check"><input type="checkbox" bind:checked={italic} /> {t('formatCells.italic')}</label>
325
+ <label class="check"><input type="checkbox" bind:checked={underline} /> {t('formatCells.underline')}</label>
326
+ <label class="check"><input type="checkbox" bind:checked={strike} /> {t('formatCells.strikethrough')}</label>
327
+ </div>
328
+ <div class="label">{t('formatCells.color')}</div>
329
+ <div class="checks">
330
+ <label class="check"><input type="checkbox" bind:checked={colorAuto} /> {t('formatCells.automatic')}</label>
331
+ <input type="color" bind:value={color} disabled={colorAuto} aria-label={t('formatCells.fontColor')} />
332
+ </div>
333
+ <div class="font-preview" style:font-family={fontFamily || undefined} style:font-size={fontSize ? `${fontSize}px` : undefined} style:font-weight={bold ? 700 : 400} style:font-style={italic ? 'italic' : 'normal'} style:text-decoration={[underline ? 'underline' : '', strike ? 'line-through' : ''].join(' ').trim() || 'none'} style:color={colorAuto ? undefined : color}>AaBbCcYyZz</div>
334
+ {:else if tab === 'border'}
335
+ <div class="label">{t('formatCells.presets')}</div>
336
+ <div class="borders" role="radiogroup" aria-label={t('formatCells.borderGroup')}>
337
+ <label class="check"><input type="radio" name="sheet-border" value="" bind:group={border} /> {t('formatCells.keepAsIs')}</label>
338
+ {#each BORDERS as b (b.value)}
339
+ <label class="check"><input type="radio" name="sheet-border" value={b.value} bind:group={border} /> {t(b.label)}</label>
340
+ {/each}
341
+ </div>
342
+ <p class="hint">{t('formatCells.borderHint')}</p>
343
+ {:else if tab === 'fill'}
344
+ <div class="label">{t('formatCells.backgroundColor')}</div>
345
+ <div class="no-fill">
346
+ <button type="button" class="swatch none" class:on={fill === null} aria-label={t('formatCells.noColor')} title={t('formatCells.noColor')} onclick={() => (fill = null)}></button>
347
+ <span>{t('formatCells.noColor')}</span>
348
+ </div>
349
+ <div class="swatches" role="radiogroup" aria-label={t('formatCells.fillGroup')}>
350
+ {#each ALL_COLOURS as c, i (i)}
351
+ <button type="button" class="swatch" class:on={fill === c.value} style:background={c.value} aria-label={c.label} title={c.label} onclick={() => (fill = c.value)}></button>
352
+ {/each}
353
+ </div>
354
+ <div class="sample">
355
+ <div class="label">{t('formatCells.sample')}</div>
356
+ <div class="fill-sample" style:background={fill ?? 'transparent'}></div>
357
+ </div>
358
+ {:else if tab === 'protection'}
359
+ <label class="check">
360
+ <input
361
+ type="checkbox"
362
+ checked={locked === true}
363
+ indeterminate={locked === null}
364
+ onchange={(e) => (locked = (e.currentTarget as HTMLInputElement).checked)}
365
+ />
366
+ {t('formatCells.locked')}
367
+ </label>
368
+ <p class="hint">{t('formatCells.lockedHint')}</p>
369
+ {/if}
370
+ </div>
371
+ </div>
372
+ {#snippet footer()}
373
+ <div class="sv-sheet-dialog-buttons">
374
+ <button type="button" class="btn primary" onclick={ok}>{t('ok')}</button>
375
+ <button type="button" class="btn" onclick={close}>{t('cancel')}</button>
376
+ </div>
377
+ {/snippet}
378
+ </SvModal>
379
+
380
+ <style>
381
+ .tabs {
382
+ display: flex;
383
+ gap: 2px;
384
+ border-bottom: 1px solid var(--sg-border, #d1d1d1);
385
+ }
386
+ .tab {
387
+ padding: 5px 12px;
388
+ font: inherit;
389
+ font-size: 13px;
390
+ color: var(--sg-muted, #616161);
391
+ background: transparent;
392
+ border: 1px solid transparent;
393
+ border-bottom: 0;
394
+ border-radius: var(--sg-radius, 3px) var(--sg-radius, 3px) 0 0;
395
+ cursor: pointer;
396
+ }
397
+ .tab:hover { color: var(--sg-fg, #242424); }
398
+ .tab.on {
399
+ color: var(--sg-fg, #242424);
400
+ background: var(--sg-bg, #fff);
401
+ border-color: var(--sg-border, #d1d1d1);
402
+ margin-bottom: -1px;
403
+ }
404
+ .panel {
405
+ display: flex;
406
+ flex-direction: column;
407
+ gap: 10px;
408
+ min-height: 220px;
409
+ padding-top: 4px;
410
+ }
411
+ .label { font-weight: 600; }
412
+ .number {
413
+ display: grid;
414
+ grid-template-columns: 140px 1fr;
415
+ gap: 14px;
416
+ }
417
+ .categories ul {
418
+ height: 200px;
419
+ margin: 4px 0 0;
420
+ padding: 2px 0;
421
+ overflow-y: auto;
422
+ list-style: none;
423
+ background: var(--sg-bg, #fff);
424
+ border: 1px solid var(--sg-border, #d1d1d1);
425
+ border-radius: var(--sg-radius, 3px);
426
+ }
427
+ .categories li { padding: 2px 8px; cursor: default; }
428
+ .categories li:hover { background: var(--sg-row-hover-bg, #f5f5f5); }
429
+ .categories li.selected { color: var(--sg-on-accent, #fff); background: var(--sg-accent, #217346); }
430
+ .settings { display: flex; flex-direction: column; gap: 10px; }
431
+ .sample { display: flex; flex-direction: column; gap: 4px; }
432
+ .sample-text,
433
+ .font-preview,
434
+ .fill-sample {
435
+ min-height: 28px;
436
+ padding: 4px 8px;
437
+ background: var(--sg-bg, #fff);
438
+ border: 1px solid var(--sg-border, #d1d1d1);
439
+ border-radius: var(--sg-radius, 3px);
440
+ }
441
+ .font-preview { min-height: 44px; display: flex; align-items: center; }
442
+ .fill-sample { min-height: 44px; }
443
+ .hint { margin: 0; color: var(--sg-muted, #616161); }
444
+ .borders { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 16px; justify-content: start; }
445
+ .no-fill { display: flex; align-items: center; gap: 8px; }
446
+ .swatches {
447
+ display: grid;
448
+ grid-template-columns: repeat(10, 22px);
449
+ gap: 3px;
450
+ }
451
+ .swatch {
452
+ width: 22px;
453
+ height: 22px;
454
+ padding: 0;
455
+ border: 1px solid var(--sg-border, #d1d1d1);
456
+ border-radius: 2px;
457
+ cursor: pointer;
458
+ }
459
+ .swatch.none {
460
+ background:
461
+ linear-gradient(to top left, transparent calc(50% - 1px), var(--sg-danger, #c00) calc(50% - 1px), var(--sg-danger, #c00) calc(50% + 1px), transparent calc(50% + 1px)),
462
+ var(--sg-bg, #fff);
463
+ }
464
+ .swatch.on { outline: 2px solid var(--sg-accent, #217346); outline-offset: 1px; }
465
+ </style>
@@ -0,0 +1,17 @@
1
+ import type { CellFormatEntry } from './sheet/format-store.js';
2
+ import { type BorderPreset } from './sheet/ribbon.js';
3
+ type Props = {
4
+ open?: boolean;
5
+ /** The active cell's format, what the dialog opens on. */
6
+ entry: CellFormatEntry | undefined;
7
+ /** The active cell's value, for the Number tab's sample. */
8
+ sample: unknown;
9
+ /** The selection holds locked and unlocked cells both: the Protection
10
+ * tab's box opens indeterminate and, left alone, changes nothing. */
11
+ mixedLocked?: boolean;
12
+ onApply: (patch: CellFormatEntry, border: BorderPreset | null) => void;
13
+ onClose?: () => void;
14
+ };
15
+ declare const SvSheetFormatCells: import("svelte").Component<Props, {}, "open">;
16
+ type SvSheetFormatCells = ReturnType<typeof SvSheetFormatCells>;
17
+ export default SvSheetFormatCells;