@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.
- package/LICENSE +94 -24
- package/README.md +36 -4
- package/dist/SvAdvancedFilter.svelte +1 -1
- package/dist/SvAlertsManager.svelte +2 -1
- package/dist/SvBoard.svelte +2 -1
- package/dist/SvExportMenu.svelte +4 -1
- package/dist/SvExportMenu.svelte.d.ts +0 -13
- package/dist/SvExpressionEditor.svelte +3 -3
- package/dist/SvFormulaBar.svelte +680 -0
- package/dist/SvFormulaBar.svelte.d.ts +69 -0
- package/dist/SvGridAlerts.svelte +49 -9
- package/dist/SvGridBoard.svelte +13 -8
- package/dist/SvGridBulkEditDrawer.svelte +26 -2
- package/dist/SvGridEditPanel.svelte +3 -0
- package/dist/SvGridScheduler.svelte +69 -40
- package/dist/SvGridSelectionBar.svelte +10 -3
- package/dist/SvPivotDesigner.svelte +263 -54
- package/dist/SvPivotDesigner.svelte.d.ts +27 -20
- package/dist/SvRibbonIcon.svelte +46 -0
- package/dist/SvRibbonIcon.svelte.d.ts +17 -0
- package/dist/SvSchemaChart.svelte +4 -2
- package/dist/SvSheet.svelte +7914 -0
- package/dist/SvSheet.svelte.d.ts +215 -0
- package/dist/SvSheetChartSetup.svelte +151 -0
- package/dist/SvSheetChartSetup.svelte.d.ts +18 -0
- package/dist/SvSheetComment.svelte +283 -0
- package/dist/SvSheetComment.svelte.d.ts +22 -0
- package/dist/SvSheetConditionalFormat.svelte +159 -0
- package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
- package/dist/SvSheetDataValidation.svelte +273 -0
- package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
- package/dist/SvSheetEditRanges.svelte +217 -0
- package/dist/SvSheetEditRanges.svelte.d.ts +15 -0
- package/dist/SvSheetErrors.svelte +125 -0
- package/dist/SvSheetErrors.svelte.d.ts +20 -0
- package/dist/SvSheetEvaluate.svelte +133 -0
- package/dist/SvSheetEvaluate.svelte.d.ts +15 -0
- package/dist/SvSheetFilterMenu.svelte +320 -0
- package/dist/SvSheetFilterMenu.svelte.d.ts +22 -0
- package/dist/SvSheetFindReplace.svelte +132 -0
- package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
- package/dist/SvSheetFormatCells.svelte +465 -0
- package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
- package/dist/SvSheetGoalSeek.svelte +145 -0
- package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
- package/dist/SvSheetInsertFunction.svelte +149 -0
- package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
- package/dist/SvSheetIteration.svelte +81 -0
- package/dist/SvSheetIteration.svelte.d.ts +10 -0
- package/dist/SvSheetLink.svelte +99 -0
- package/dist/SvSheetLink.svelte.d.ts +17 -0
- package/dist/SvSheetListPicker.svelte +91 -0
- package/dist/SvSheetListPicker.svelte.d.ts +10 -0
- package/dist/SvSheetManageRules.svelte +187 -0
- package/dist/SvSheetManageRules.svelte.d.ts +16 -0
- package/dist/SvSheetNameManager.svelte +227 -0
- package/dist/SvSheetNameManager.svelte.d.ts +11 -0
- package/dist/SvSheetPageSetup.svelte +159 -0
- package/dist/SvSheetPageSetup.svelte.d.ts +13 -0
- package/dist/SvSheetPasteSpecial.svelte +107 -0
- package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
- package/dist/SvSheetPivot.svelte +220 -0
- package/dist/SvSheetPivot.svelte.d.ts +21 -0
- package/dist/SvSheetProtectSheet.svelte +81 -0
- package/dist/SvSheetProtectSheet.svelte.d.ts +11 -0
- package/dist/SvSheetRemoveDuplicates.svelte +152 -0
- package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
- package/dist/SvSheetRibbon.svelte +1254 -0
- package/dist/SvSheetRibbon.svelte.d.ts +34 -0
- package/dist/SvSheetSizeDialog.svelte +60 -0
- package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
- package/dist/SvSheetSort.svelte +218 -0
- package/dist/SvSheetSort.svelte.d.ts +28 -0
- package/dist/SvSheetSparklines.svelte +135 -0
- package/dist/SvSheetSparklines.svelte.d.ts +14 -0
- package/dist/SvSheetTable.svelte +160 -0
- package/dist/SvSheetTable.svelte.d.ts +24 -0
- package/dist/SvSheetTabs.svelte +571 -0
- package/dist/SvSheetTabs.svelte.d.ts +50 -0
- package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
- package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
- package/dist/SvSheetTextToColumns.svelte +172 -0
- package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
- package/dist/SvSheetValidationAlert.svelte +85 -0
- package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
- package/dist/advanced-filter-enable.js +1 -1
- package/dist/alerts/alert-engine.d.ts +6 -0
- package/dist/alerts/alert-engine.js +21 -4
- package/dist/alerts/alert-formats.js +2 -0
- package/dist/alerts/alert-types.d.ts +1 -1
- package/dist/alerts.d.ts +1 -1
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/bulk-edit.d.ts +3 -1
- package/dist/bulk-edit.js +1 -1
- package/dist/cdn/svgrid-enterprise.svelte-external.js +43538 -6539
- package/dist/designer/assets/GridMenus-8gTNssgV.js +8 -0
- package/dist/designer/assets/SvChartMenu-BDoeqGz6.js +1 -0
- package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
- package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-DCPg7WGN.js +1 -0
- package/dist/designer/assets/SvGridCellEditor-DMoWJjEI.js +4 -0
- package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
- package/dist/designer/assets/SvGridChart-Cy1ATrWh.js +3 -0
- package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-eQ3mn0L9.js +1 -0
- package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
- package/dist/designer/assets/SvGridChartPanel-CATdVc9X.js +4 -0
- package/dist/designer/assets/{SvGridChartView-DUc-1RUf.css → SvGridChartView-7msfnWZT.css} +1 -1
- package/dist/designer/assets/SvGridChartView-CmsZtCED.js +1 -0
- package/dist/designer/assets/SvGridDropdown-Cjz0H-fI.js +1 -0
- package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
- package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
- package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
- package/dist/designer/assets/SvTabs-2mHC6oaz.js +1 -0
- package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
- package/dist/designer/assets/cell-formatting-BbubJTVz.js +1 -0
- package/dist/designer/assets/chart-Cn7MnNqA.js +1 -0
- package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
- package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
- package/dist/designer/assets/chart-panel-messages-Dz7PTIqT.js +1 -0
- package/dist/designer/assets/chart-summary-BD1qYB2R.js +1 -0
- package/dist/designer/assets/chart-trend-B8xr5LuD.js +1 -0
- package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
- package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
- package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
- package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
- package/dist/designer/assets/{dismissable-BO547MH9.js → dismissable-ChWRPkoa.js} +1 -1
- package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
- package/dist/designer/assets/{export-format-D-eP4b2l.js → export-format-DGckmgKr.js} +1 -1
- package/dist/designer/assets/focus-trap-V2-6Fy9I.js +1 -0
- package/dist/designer/assets/{index-C_a9Cj8Y.js → index-D5bVbuzI.js} +318 -315
- package/dist/designer/assets/index-_JVFxt02.css +1 -0
- package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
- package/dist/designer/assets/row-resize-BInFWCpr.js +1 -0
- package/dist/designer/assets/server-block-cache-CXJKkJpy.js +1 -0
- package/dist/designer/assets/src-CITpcm6b.js +1 -0
- package/dist/designer/assets/src-DUQ4xE3x.js +58 -0
- package/dist/designer/assets/validate-C3B8QKsM.js +1 -0
- package/dist/designer/index.html +29 -19
- package/dist/export-pdf.d.ts +164 -0
- package/dist/export-pdf.js +346 -15
- package/dist/export.js +25 -10
- package/dist/gantt/SvGridGantt.svelte +2890 -0
- package/dist/gantt/SvGridGantt.svelte.d.ts +30 -0
- package/dist/gantt/gantt-config.d.ts +73 -0
- package/dist/gantt/gantt-config.js +1 -0
- package/dist/gantt/gantt-critical-path.d.ts +67 -0
- package/dist/gantt/gantt-critical-path.js +207 -0
- package/dist/gantt/gantt-model.d.ts +257 -0
- package/dist/gantt/gantt-model.js +651 -0
- package/dist/gantt/gantt-resources.d.ts +59 -0
- package/dist/gantt/gantt-resources.js +71 -0
- package/dist/gantt/gantt.d.ts +7 -0
- package/dist/gantt/gantt.js +36 -0
- package/dist/gantt/index.d.ts +15 -0
- package/dist/gantt/index.js +22 -0
- package/dist/gantt/timeline-arrows.d.ts +102 -0
- package/dist/gantt/timeline-arrows.js +181 -0
- package/dist/import.d.ts +2 -2
- package/dist/import.js +1 -1
- package/dist/index.d.ts +93 -3
- package/dist/index.js +107 -3
- package/dist/install.js +13 -1
- package/dist/license-core.d.ts +17 -1
- package/dist/license-core.js +16 -5
- package/dist/license.d.ts +18 -2
- package/dist/license.js +71 -6
- package/dist/node/studio.js +203 -9
- package/dist/pivot-chart.d.ts +25 -1
- package/dist/pivot-chart.js +25 -69
- package/dist/pivot-enable.js +2 -2
- package/dist/scheduler-dependencies.d.ts +35 -0
- package/dist/scheduler-dependencies.js +36 -1
- package/dist/scheduler.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/server/SvGroupCell.svelte +213 -0
- package/dist/server/SvGroupCell.svelte.d.ts +62 -0
- package/dist/server/SvRowGroupPanel.svelte +322 -0
- package/dist/server/SvRowGroupPanel.svelte.d.ts +37 -0
- package/dist/server/enable.d.ts +17 -0
- package/dist/server/enable.js +49 -0
- package/dist/server/index.d.ts +22 -0
- package/dist/server/index.js +24 -0
- package/dist/server/messages.d.ts +45 -0
- package/dist/server/messages.js +35 -0
- package/dist/server/server-group-model.d.ts +104 -0
- package/dist/server/server-group-model.js +272 -0
- package/dist/server/server-pivot.d.ts +46 -0
- package/dist/server/server-pivot.js +57 -0
- package/dist/server/server-row-model.d.ts +547 -0
- package/dist/server/server-row-model.js +1551 -0
- package/dist/server/server-selection.d.ts +99 -0
- package/dist/server/server-selection.js +215 -0
- package/dist/server/svgrid-adapter.d.ts +155 -0
- package/dist/server/svgrid-adapter.js +202 -0
- package/dist/sheet/address.d.ts +43 -0
- package/dist/sheet/address.js +81 -0
- package/dist/sheet/ast.d.ts +138 -0
- package/dist/sheet/ast.js +70 -0
- package/dist/sheet/auto-filter.d.ts +120 -0
- package/dist/sheet/auto-filter.js +295 -0
- package/dist/sheet/autocomplete.d.ts +51 -0
- package/dist/sheet/autocomplete.js +248 -0
- package/dist/sheet/cell-images.d.ts +39 -0
- package/dist/sheet/cell-images.js +90 -0
- package/dist/sheet/cell-types.d.ts +58 -0
- package/dist/sheet/cell-types.js +96 -0
- package/dist/sheet/coerce.d.ts +71 -0
- package/dist/sheet/coerce.js +289 -0
- package/dist/sheet/commands.d.ts +89 -0
- package/dist/sheet/commands.js +230 -0
- package/dist/sheet/comments.d.ts +63 -0
- package/dist/sheet/comments.js +131 -0
- package/dist/sheet/conditional-formats.d.ts +167 -0
- package/dist/sheet/conditional-formats.js +341 -0
- package/dist/sheet/csv.d.ts +32 -0
- package/dist/sheet/csv.js +158 -0
- package/dist/sheet/culture.d.ts +87 -0
- package/dist/sheet/culture.js +247 -0
- package/dist/sheet/delta.d.ts +102 -0
- package/dist/sheet/delta.js +203 -0
- package/dist/sheet/deps.d.ts +104 -0
- package/dist/sheet/deps.js +274 -0
- package/dist/sheet/document.d.ts +252 -0
- package/dist/sheet/document.js +465 -0
- package/dist/sheet/edit-keys.d.ts +14 -0
- package/dist/sheet/edit-keys.js +40 -0
- package/dist/sheet/engine.d.ts +67 -0
- package/dist/sheet/engine.js +19 -0
- package/dist/sheet/entry.d.ts +35 -0
- package/dist/sheet/entry.js +226 -0
- package/dist/sheet/error-check.d.ts +49 -0
- package/dist/sheet/error-check.js +83 -0
- package/dist/sheet/evaluate-steps.d.ts +48 -0
- package/dist/sheet/evaluate-steps.js +196 -0
- package/dist/sheet/evaluate.d.ts +128 -0
- package/dist/sheet/evaluate.js +1049 -0
- package/dist/sheet/filter-files.d.ts +37 -0
- package/dist/sheet/filter-files.js +465 -0
- package/dist/sheet/find-replace.d.ts +62 -0
- package/dist/sheet/find-replace.js +152 -0
- package/dist/sheet/format-store.d.ts +114 -0
- package/dist/sheet/format-store.js +243 -0
- package/dist/sheet/freeze.d.ts +54 -0
- package/dist/sheet/freeze.js +58 -0
- package/dist/sheet/from-rows.d.ts +14 -0
- package/dist/sheet/from-rows.js +50 -0
- package/dist/sheet/function-catalog.d.ts +10 -0
- package/dist/sheet/function-catalog.js +385 -0
- package/dist/sheet/functions.d.ts +28 -0
- package/dist/sheet/functions.js +634 -0
- package/dist/sheet/goal-seek.d.ts +73 -0
- package/dist/sheet/goal-seek.js +153 -0
- package/dist/sheet/index.d.ts +80 -0
- package/dist/sheet/index.js +80 -0
- package/dist/sheet/links.d.ts +57 -0
- package/dist/sheet/links.js +174 -0
- package/dist/sheet/merges.d.ts +71 -0
- package/dist/sheet/merges.js +137 -0
- package/dist/sheet/messages.d.ts +778 -0
- package/dist/sheet/messages.js +806 -0
- package/dist/sheet/names.d.ts +31 -0
- package/dist/sheet/names.js +87 -0
- package/dist/sheet/navigate.d.ts +52 -0
- package/dist/sheet/navigate.js +135 -0
- package/dist/sheet/number-format.d.ts +110 -0
- package/dist/sheet/number-format.js +905 -0
- package/dist/sheet/objects.d.ts +106 -0
- package/dist/sheet/objects.js +149 -0
- package/dist/sheet/ods-document.d.ts +44 -0
- package/dist/sheet/ods-document.js +1275 -0
- package/dist/sheet/open-file.d.ts +26 -0
- package/dist/sheet/open-file.js +56 -0
- package/dist/sheet/outline.d.ts +82 -0
- package/dist/sheet/outline.js +228 -0
- package/dist/sheet/packs/array.d.ts +16 -0
- package/dist/sheet/packs/array.js +172 -0
- package/dist/sheet/packs/database.d.ts +42 -0
- package/dist/sheet/packs/database.js +142 -0
- package/dist/sheet/packs/engineering.d.ts +2 -0
- package/dist/sheet/packs/engineering.js +296 -0
- package/dist/sheet/packs/financial.d.ts +5 -0
- package/dist/sheet/packs/financial.js +220 -0
- package/dist/sheet/packs/math-stats.d.ts +2 -0
- package/dist/sheet/packs/math-stats.js +372 -0
- package/dist/sheet/packs/special.d.ts +44 -0
- package/dist/sheet/packs/special.js +187 -0
- package/dist/sheet/packs/stats-dist.d.ts +2 -0
- package/dist/sheet/packs/stats-dist.js +785 -0
- package/dist/sheet/packs/text-date.d.ts +2 -0
- package/dist/sheet/packs/text-date.js +332 -0
- package/dist/sheet/packs/trig.d.ts +2 -0
- package/dist/sheet/packs/trig.js +73 -0
- package/dist/sheet/page-setup.d.ts +73 -0
- package/dist/sheet/page-setup.js +73 -0
- package/dist/sheet/palette.d.ts +19 -0
- package/dist/sheet/palette.js +84 -0
- package/dist/sheet/parse.d.ts +13 -0
- package/dist/sheet/parse.js +140 -0
- package/dist/sheet/paste-special.d.ts +186 -0
- package/dist/sheet/paste-special.js +601 -0
- package/dist/sheet/pivot-range.d.ts +160 -0
- package/dist/sheet/pivot-range.js +333 -0
- package/dist/sheet/presence.d.ts +73 -0
- package/dist/sheet/presence.js +79 -0
- package/dist/sheet/print.d.ts +104 -0
- package/dist/sheet/print.js +169 -0
- package/dist/sheet/protection.d.ts +75 -0
- package/dist/sheet/protection.js +101 -0
- package/dist/sheet/rects.d.ts +45 -0
- package/dist/sheet/rects.js +112 -0
- package/dist/sheet/refs.d.ts +130 -0
- package/dist/sheet/refs.js +413 -0
- package/dist/sheet/ribbon-icons.d.ts +31 -0
- package/dist/sheet/ribbon-icons.js +536 -0
- package/dist/sheet/ribbon.d.ts +173 -0
- package/dist/sheet/ribbon.js +1054 -0
- package/dist/sheet/sheet-kinds.d.ts +74 -0
- package/dist/sheet/sheet-kinds.js +91 -0
- package/dist/sheet/shortcuts.d.ts +174 -0
- package/dist/sheet/shortcuts.js +674 -0
- package/dist/sheet/sort.d.ts +51 -0
- package/dist/sheet/sort.js +107 -0
- package/dist/sheet/sparklines.d.ts +111 -0
- package/dist/sheet/sparklines.js +204 -0
- package/dist/sheet/structure.d.ts +87 -0
- package/dist/sheet/structure.js +166 -0
- package/dist/sheet/table-styles.d.ts +74 -0
- package/dist/sheet/table-styles.js +152 -0
- package/dist/sheet/tables.d.ts +89 -0
- package/dist/sheet/tables.js +178 -0
- package/dist/sheet/tokenize.d.ts +71 -0
- package/dist/sheet/tokenize.js +355 -0
- package/dist/sheet/transforms.d.ts +76 -0
- package/dist/sheet/transforms.js +154 -0
- package/dist/sheet/validation.d.ts +108 -0
- package/dist/sheet/validation.js +278 -0
- package/dist/sheet/workbook.d.ts +217 -0
- package/dist/sheet/workbook.js +1120 -0
- package/dist/sheet/xls-cfb.d.ts +32 -0
- package/dist/sheet/xls-cfb.js +290 -0
- package/dist/sheet/xls-document.d.ts +10 -0
- package/dist/sheet/xls-document.js +1243 -0
- package/dist/sheet/xls-formula.d.ts +40 -0
- package/dist/sheet/xls-formula.js +569 -0
- package/dist/sheet/xlsx-document.d.ts +108 -0
- package/dist/sheet/xlsx-document.js +1849 -0
- package/dist/sheet/xlsx-drawing.d.ts +99 -0
- package/dist/sheet/xlsx-drawing.js +420 -0
- package/dist/sheet-enable.d.ts +6 -0
- package/dist/sheet-enable.js +45 -0
- package/dist/sheet-text.d.ts +7 -0
- package/dist/sheet-text.js +29 -0
- package/dist/sources/auth-supabase.js +2 -2
- package/dist/sources/realtime-supabase.js +2 -2
- package/dist/sources/rest.d.ts +6 -2
- package/dist/sources/rest.js +42 -7
- package/dist/sources/supabase.d.ts +10 -1
- package/dist/sources/supabase.js +73 -40
- package/dist/studio/emit-project.js +14 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/project.d.ts +11 -2
- package/dist/studio/project.js +5 -2
- package/dist/studio/ui-components.generated.js +170 -3
- package/dist/sveltekit/in-memory.d.ts +2 -2
- package/dist/sveltekit/in-memory.js +125 -4
- package/dist/sveltekit/index.d.ts +1 -1
- package/dist/sveltekit/index.js +1 -1
- package/dist/sveltekit/query-plan.d.ts +50 -4
- package/dist/sveltekit/query-plan.js +25 -3
- package/dist/sveltekit/sql-source.d.ts +6 -0
- package/dist/sveltekit/sql-source.js +34 -6
- package/dist/sveltekit/sql.d.ts +31 -0
- package/dist/sveltekit/sql.js +135 -25
- package/dist/sveltekit/transport.d.ts +10 -2
- package/dist/sveltekit/transport.js +30 -6
- package/dist/upgrade-prompt.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watermark.js +35 -2
- package/dist/wc/GridMenus-By9vPuq0.js +1088 -0
- package/dist/wc/SvChartMenu-CQNrQGT2.js +308 -0
- package/dist/wc/SvDateRangeInput-DR6m7bSM.js +199 -0
- package/dist/wc/SvDateTimePicker-D-vRnaMo.js +771 -0
- package/dist/wc/SvField-B_kurx_P.js +149 -0
- package/dist/wc/SvGrid.helpers-BdVDtjUm.js +135 -0
- package/dist/wc/SvGridCellEditor-Bnf1Kr5C.js +560 -0
- package/dist/wc/SvGridChart-BqUJh2pG.js +3572 -0
- package/dist/wc/SvGridChartBuilder-CGycC5cn.js +988 -0
- package/dist/wc/SvGridChartPanel-CRnizsHD.js +1746 -0
- package/dist/wc/SvGridChartView-D1pa_xMy.js +47 -0
- package/dist/wc/SvGridDropdown-45WsObLL.js +259 -0
- package/dist/wc/SvModal-DrfOYYyX.js +189 -0
- package/dist/wc/cell-formatting-CBfgahv1.js +86 -0
- package/dist/wc/chart-6OXlybVT.js +4341 -0
- package/dist/wc/chart-export-CeSADGfi.js +135 -0
- package/dist/wc/chart-export-pdf-BGko7MER.js +104 -0
- package/dist/wc/chart-summary-2m3ia1-n.js +137 -0
- package/dist/wc/chart-trend-CQOQtTMl.js +50 -0
- package/dist/wc/chart-validate-CD6ptiwg.js +180 -0
- package/dist/wc/client-DQIzjDBG.js +3064 -0
- package/dist/wc/column-resize-DUPgynvc.js +101 -0
- package/dist/wc/date-format-DS-z_h9v.js +1130 -0
- package/dist/wc/dismissable-CQ6XFXsk.js +45 -0
- package/dist/wc/editor-contract-peBDxir_.js +22 -0
- package/dist/wc/editor-registry-DxGKqcvx.js +24 -0
- package/dist/wc/focus-trap-Dbb2tJxb.js +65 -0
- package/dist/wc/list-option-DrRyivWp.js +82 -0
- package/dist/wc/popover-WsGlvtQv.js +69 -0
- package/dist/wc/positioning-BiKLfu1E.js +112 -0
- package/dist/wc/react.d.ts +41 -0
- package/dist/wc/react.js +90 -0
- package/dist/wc/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/wc/row-drag-touch-CycRR65n.js +93 -0
- package/dist/wc/row-resize-limG_N1z.js +111 -0
- package/dist/wc/sv-sheet-element.d.ts +97 -0
- package/dist/wc/sv-sheet-element.js +44213 -0
- package/dist/wc/svelte-virtualizer.svelte-CXtQy2TQ.js +530 -0
- package/dist/wc/validate-BqDthkNr.js +88 -0
- package/dist/wc/vue.d.ts +31 -0
- package/dist/wc/vue.js +75 -0
- package/package.json +36 -6
- package/dist/designer/assets/GridMenus-B1JtIN21.js +0 -8
- package/dist/designer/assets/SvDateRangeInput-CjO7nn_x.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +0 -1
- package/dist/designer/assets/SvField-YDLipR6O.css +0 -1
- package/dist/designer/assets/SvField-cj1PFNgZ.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +0 -2
- package/dist/designer/assets/SvGridChart-DBOR4xcz.js +0 -2
- package/dist/designer/assets/SvGridChart-fkMWeh1J.css +0 -1
- package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +0 -11
- package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +0 -1
- package/dist/designer/assets/SvListBox-1oUF6Iav.js +0 -110
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +0 -1
- package/dist/designer/assets/chart-DXFganU8.js +0 -1
- package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
- package/dist/designer/assets/date-format-DGagAqRc.css +0 -1
- package/dist/designer/assets/date-format-onlYDsrY.js +0 -1
- package/dist/designer/assets/easing-zaypKrr0.js +0 -3
- package/dist/designer/assets/index-k2stW6L8.css +0 -1
- package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
- package/dist/designer/assets/src-D9p27OGC.js +0 -58
- package/dist/designer/assets/validate-h-aslRV9.js +0 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keyboard commands themselves, written against `GridCommandContext` so
|
|
3
|
+
* they stay testable without mounting a grid.
|
|
4
|
+
*
|
|
5
|
+
* Every one that writes more than one cell runs inside `cmd.batch()`, so the
|
|
6
|
+
* whole action is a single Ctrl+Z. That is the seam added in @svgrid/grid;
|
|
7
|
+
* without it a Ctrl+D down a hundred rows would take a hundred presses to undo
|
|
8
|
+
* and would evict the history behind it.
|
|
9
|
+
*
|
|
10
|
+
* Phase 1 fills VALUES. Excel also translates relative references as it fills,
|
|
11
|
+
* so `=A1*2` in the source row becomes `=A2*2` one row down; that needs the
|
|
12
|
+
* formula engine's AST and lands with it in phase 2. Until then a formula
|
|
13
|
+
* fills as literal text, which is wrong for formulas and right for everything
|
|
14
|
+
* else, and is why `fillDown` routes through one `translateForFill` hook
|
|
15
|
+
* rather than inlining the copy.
|
|
16
|
+
*/
|
|
17
|
+
import type { GridCommandContext } from '@svgrid/grid/shortcuts';
|
|
18
|
+
import { type Rect } from './navigate.js';
|
|
19
|
+
/**
|
|
20
|
+
* How a value copied from (srcRow, srcCol) to (dstRow, dstCol) is rewritten.
|
|
21
|
+
* Phase 1 is identity. Phase 2 swaps in the engine's `translateFormula`, which
|
|
22
|
+
* is why every fill path calls it rather than copying the value directly.
|
|
23
|
+
*/
|
|
24
|
+
export type FillTranslator = (value: unknown, delta: {
|
|
25
|
+
rows: number;
|
|
26
|
+
cols: number;
|
|
27
|
+
}) => unknown;
|
|
28
|
+
/** Install the formula-aware translator. The engine calls this in phase 2. */
|
|
29
|
+
export declare function setFillTranslator(fn: FillTranslator | null): void;
|
|
30
|
+
export declare function targetRect(cmd: GridCommandContext): Rect | null;
|
|
31
|
+
/**
|
|
32
|
+
* Ctrl+D. Copies the TOP row of the selection into every row below it.
|
|
33
|
+
*
|
|
34
|
+
* Excel has a second behaviour here: with only one cell selected it fills from
|
|
35
|
+
* the cell directly above instead, which is what makes Ctrl+D useful while
|
|
36
|
+
* typing down a column. Both are implemented.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fillDown(cmd: GridCommandContext): boolean;
|
|
39
|
+
/** Ctrl+R. The same shape as fillDown, across instead of down. */
|
|
40
|
+
export declare function fillRight(cmd: GridCommandContext): boolean;
|
|
41
|
+
/** Write one value into every cell of the selection. Excel's Ctrl+Enter. */
|
|
42
|
+
export declare function fillSelection(cmd: GridCommandContext, value: unknown): boolean;
|
|
43
|
+
/** Ctrl+; and Ctrl+Shift+;. ISO rather than locale-formatted, because the
|
|
44
|
+
* value goes into the data and a column's own `format` decides how it reads;
|
|
45
|
+
* stamping a localised string would put display text in the model. */
|
|
46
|
+
export declare function stampNow(kind: 'date' | 'time' | 'datetime', now?: Date): string;
|
|
47
|
+
export declare function stampDate(cmd: GridCommandContext, kind: 'date' | 'time' | 'datetime', now?: Date): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Ctrl+'. Copies the cell above VERBATIM - no reference translation, which is
|
|
50
|
+
* the whole point of the shortcut: it is how you get a copy of the formula
|
|
51
|
+
* above to edit, rather than one that has already shifted.
|
|
52
|
+
*/
|
|
53
|
+
export declare function copyFromAbove(cmd: GridCommandContext): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Ctrl+Shift+". The VALUE of the cell above: what a formula there shows,
|
|
56
|
+
* not the formula, so a running total can be frozen as a number. With an
|
|
57
|
+
* engine attached the evaluated value is what goes in; without one there is
|
|
58
|
+
* nothing but the text, which is what Ctrl+' copies. An error above copies
|
|
59
|
+
* nothing.
|
|
60
|
+
*/
|
|
61
|
+
export declare function copyValueFromAbove(cmd: GridCommandContext): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Alt+=. The range Excel guesses for a SUM anchored at the active cell: the
|
|
64
|
+
* run of numbers directly above, or directly to the left when there is nothing
|
|
65
|
+
* above. Returns null when neither direction has numbers to add.
|
|
66
|
+
*/
|
|
67
|
+
export declare function guessSumRange(cmd: GridCommandContext, isNumeric?: (value: unknown) => boolean): Rect | null;
|
|
68
|
+
/**
|
|
69
|
+
* How to find out what a cell actually EVALUATES to.
|
|
70
|
+
*
|
|
71
|
+
* Cells hold raw text, so a cell containing `=SUM(A1:A3)` reads as the string
|
|
72
|
+
* "=SUM(A1:A3)" and `looksNumeric` says no. AutoSum under a column of
|
|
73
|
+
* subtotals then finds no run and declines, which is the opposite of what
|
|
74
|
+
* Excel does: there, a formula that produces a number IS a number.
|
|
75
|
+
*
|
|
76
|
+
* Optional. Without one, a sheet with no engine behind it behaves as before
|
|
77
|
+
* and only literal numbers count.
|
|
78
|
+
*/
|
|
79
|
+
export type SheetValueProbe = (row: number, col: number) => unknown;
|
|
80
|
+
export declare function setSheetValueProbe(fn: SheetValueProbe | null): void;
|
|
81
|
+
export declare function getSheetValueProbe(): SheetValueProbe | null;
|
|
82
|
+
/**
|
|
83
|
+
* The numeric test AutoSum should use for the cell at (row, col): the
|
|
84
|
+
* evaluated value when an engine is attached, the raw text otherwise.
|
|
85
|
+
*/
|
|
86
|
+
export declare function numericAt(cmd: GridCommandContext, row: number, col: number): boolean;
|
|
87
|
+
/** Default numeric test for AutoSum: a finite number, or a string that parses
|
|
88
|
+
* as one. A blank is not a number, so a gap ends the run. */
|
|
89
|
+
export declare function looksNumeric(value: unknown): boolean;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { isBlankValue } from './navigate.js';
|
|
2
|
+
const identity = (value) => value;
|
|
3
|
+
let translator = identity;
|
|
4
|
+
/** Install the formula-aware translator. The engine calls this in phase 2. */
|
|
5
|
+
export function setFillTranslator(fn) {
|
|
6
|
+
translator = fn ?? identity;
|
|
7
|
+
}
|
|
8
|
+
/** The rectangle a command should act on: the active range, or the active cell
|
|
9
|
+
* alone when nothing is selected. Returns null when there is no active cell. */
|
|
10
|
+
/**
|
|
11
|
+
* Whether a command may write a cell. `setCellValue` trusts its caller, so
|
|
12
|
+
* a fill over a protected sheet has to ask for itself and leave the locked
|
|
13
|
+
* cells as they are, the way the grid's own fill handle does.
|
|
14
|
+
*/
|
|
15
|
+
function writable(cmd, r, c) {
|
|
16
|
+
return cmd.canEdit?.(r, c) !== false;
|
|
17
|
+
}
|
|
18
|
+
export function targetRect(cmd) {
|
|
19
|
+
const last = cmd.ranges[cmd.ranges.length - 1];
|
|
20
|
+
if (last)
|
|
21
|
+
return last;
|
|
22
|
+
const active = cmd.activeCell;
|
|
23
|
+
if (!active)
|
|
24
|
+
return null;
|
|
25
|
+
return [active.rowIndex, active.colIndex, active.rowIndex, active.colIndex];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ctrl+D. Copies the TOP row of the selection into every row below it.
|
|
29
|
+
*
|
|
30
|
+
* Excel has a second behaviour here: with only one cell selected it fills from
|
|
31
|
+
* the cell directly above instead, which is what makes Ctrl+D useful while
|
|
32
|
+
* typing down a column. Both are implemented.
|
|
33
|
+
*/
|
|
34
|
+
export function fillDown(cmd) {
|
|
35
|
+
const rect = targetRect(cmd);
|
|
36
|
+
if (!rect)
|
|
37
|
+
return false;
|
|
38
|
+
const [minRow, minCol, maxRow, maxCol] = rect;
|
|
39
|
+
if (minRow === maxRow) {
|
|
40
|
+
// Single row selected: pull from the row above.
|
|
41
|
+
if (minRow === 0)
|
|
42
|
+
return false;
|
|
43
|
+
return cmd.batch(() => {
|
|
44
|
+
for (let c = minCol; c <= maxCol; c += 1) {
|
|
45
|
+
if (!writable(cmd, minRow, c))
|
|
46
|
+
continue;
|
|
47
|
+
const value = cmd.getCellValue(minRow - 1, c);
|
|
48
|
+
cmd.setCellValue(minRow, c, translator(value, { rows: 1, cols: 0 }));
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return cmd.batch(() => {
|
|
54
|
+
for (let c = minCol; c <= maxCol; c += 1) {
|
|
55
|
+
const source = cmd.getCellValue(minRow, c);
|
|
56
|
+
for (let r = minRow + 1; r <= maxRow; r += 1) {
|
|
57
|
+
if (!writable(cmd, r, c))
|
|
58
|
+
continue;
|
|
59
|
+
cmd.setCellValue(r, c, translator(source, { rows: r - minRow, cols: 0 }));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** Ctrl+R. The same shape as fillDown, across instead of down. */
|
|
66
|
+
export function fillRight(cmd) {
|
|
67
|
+
const rect = targetRect(cmd);
|
|
68
|
+
if (!rect)
|
|
69
|
+
return false;
|
|
70
|
+
const [minRow, minCol, maxRow, maxCol] = rect;
|
|
71
|
+
if (minCol === maxCol) {
|
|
72
|
+
if (minCol === 0)
|
|
73
|
+
return false;
|
|
74
|
+
return cmd.batch(() => {
|
|
75
|
+
for (let r = minRow; r <= maxRow; r += 1) {
|
|
76
|
+
if (!writable(cmd, r, minCol))
|
|
77
|
+
continue;
|
|
78
|
+
const value = cmd.getCellValue(r, minCol - 1);
|
|
79
|
+
cmd.setCellValue(r, minCol, translator(value, { rows: 0, cols: 1 }));
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return cmd.batch(() => {
|
|
85
|
+
for (let r = minRow; r <= maxRow; r += 1) {
|
|
86
|
+
const source = cmd.getCellValue(r, minCol);
|
|
87
|
+
for (let c = minCol + 1; c <= maxCol; c += 1) {
|
|
88
|
+
if (!writable(cmd, r, c))
|
|
89
|
+
continue;
|
|
90
|
+
cmd.setCellValue(r, c, translator(source, { rows: 0, cols: c - minCol }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** Write one value into every cell of the selection. Excel's Ctrl+Enter. */
|
|
97
|
+
export function fillSelection(cmd, value) {
|
|
98
|
+
const rect = targetRect(cmd);
|
|
99
|
+
if (!rect)
|
|
100
|
+
return false;
|
|
101
|
+
const [minRow, minCol, maxRow, maxCol] = rect;
|
|
102
|
+
return cmd.batch(() => {
|
|
103
|
+
for (let r = minRow; r <= maxRow; r += 1) {
|
|
104
|
+
for (let c = minCol; c <= maxCol; c += 1) {
|
|
105
|
+
if (writable(cmd, r, c))
|
|
106
|
+
cmd.setCellValue(r, c, value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** Ctrl+; and Ctrl+Shift+;. ISO rather than locale-formatted, because the
|
|
113
|
+
* value goes into the data and a column's own `format` decides how it reads;
|
|
114
|
+
* stamping a localised string would put display text in the model. */
|
|
115
|
+
export function stampNow(kind, now = new Date()) {
|
|
116
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
117
|
+
const date = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
118
|
+
const time = `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
|
|
119
|
+
if (kind === 'date')
|
|
120
|
+
return date;
|
|
121
|
+
if (kind === 'time')
|
|
122
|
+
return time;
|
|
123
|
+
return `${date} ${time}`;
|
|
124
|
+
}
|
|
125
|
+
export function stampDate(cmd, kind, now) {
|
|
126
|
+
return fillSelection(cmd, stampNow(kind, now));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Ctrl+'. Copies the cell above VERBATIM - no reference translation, which is
|
|
130
|
+
* the whole point of the shortcut: it is how you get a copy of the formula
|
|
131
|
+
* above to edit, rather than one that has already shifted.
|
|
132
|
+
*/
|
|
133
|
+
export function copyFromAbove(cmd) {
|
|
134
|
+
const active = cmd.activeCell;
|
|
135
|
+
if (!active || active.rowIndex === 0)
|
|
136
|
+
return false;
|
|
137
|
+
if (!writable(cmd, active.rowIndex, active.colIndex))
|
|
138
|
+
return false;
|
|
139
|
+
const value = cmd.getCellValue(active.rowIndex - 1, active.colIndex);
|
|
140
|
+
cmd.setCellValue(active.rowIndex, active.colIndex, value);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Ctrl+Shift+". The VALUE of the cell above: what a formula there shows,
|
|
145
|
+
* not the formula, so a running total can be frozen as a number. With an
|
|
146
|
+
* engine attached the evaluated value is what goes in; without one there is
|
|
147
|
+
* nothing but the text, which is what Ctrl+' copies. An error above copies
|
|
148
|
+
* nothing.
|
|
149
|
+
*/
|
|
150
|
+
export function copyValueFromAbove(cmd) {
|
|
151
|
+
const active = cmd.activeCell;
|
|
152
|
+
if (!active || active.rowIndex === 0)
|
|
153
|
+
return false;
|
|
154
|
+
if (!writable(cmd, active.rowIndex, active.colIndex))
|
|
155
|
+
return false;
|
|
156
|
+
const probe = valueProbe;
|
|
157
|
+
const raw = cmd.getCellValue(active.rowIndex - 1, active.colIndex);
|
|
158
|
+
let value = raw;
|
|
159
|
+
if (probe) {
|
|
160
|
+
const shown = probe(active.rowIndex - 1, active.colIndex);
|
|
161
|
+
if (shown !== null && typeof shown === 'object')
|
|
162
|
+
return false;
|
|
163
|
+
if (shown !== undefined && shown !== null)
|
|
164
|
+
value = typeof shown === 'boolean' ? (shown ? 'TRUE' : 'FALSE') : String(shown);
|
|
165
|
+
}
|
|
166
|
+
cmd.setCellValue(active.rowIndex, active.colIndex, value);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Alt+=. The range Excel guesses for a SUM anchored at the active cell: the
|
|
171
|
+
* run of numbers directly above, or directly to the left when there is nothing
|
|
172
|
+
* above. Returns null when neither direction has numbers to add.
|
|
173
|
+
*/
|
|
174
|
+
export function guessSumRange(cmd, isNumeric = looksNumeric) {
|
|
175
|
+
const active = cmd.activeCell;
|
|
176
|
+
if (!active)
|
|
177
|
+
return null;
|
|
178
|
+
const { rowIndex: row, colIndex: col } = active;
|
|
179
|
+
// When an engine is attached the run is measured against evaluated values,
|
|
180
|
+
// so a column of SUM subtotals counts as numbers the way it does in Excel.
|
|
181
|
+
const numeric = valueProbe
|
|
182
|
+
? (r, c) => numericAt(cmd, r, c)
|
|
183
|
+
: (r, c) => isNumeric(cmd.getCellValue(r, c));
|
|
184
|
+
let top = row;
|
|
185
|
+
while (top > 0 && numeric(top - 1, col))
|
|
186
|
+
top -= 1;
|
|
187
|
+
if (top < row)
|
|
188
|
+
return [top, col, row - 1, col];
|
|
189
|
+
let left = col;
|
|
190
|
+
while (left > 0 && numeric(row, left - 1))
|
|
191
|
+
left -= 1;
|
|
192
|
+
if (left < col)
|
|
193
|
+
return [row, left, row, col - 1];
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
let valueProbe = null;
|
|
197
|
+
export function setSheetValueProbe(fn) {
|
|
198
|
+
valueProbe = fn;
|
|
199
|
+
}
|
|
200
|
+
export function getSheetValueProbe() {
|
|
201
|
+
return valueProbe;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The numeric test AutoSum should use for the cell at (row, col): the
|
|
205
|
+
* evaluated value when an engine is attached, the raw text otherwise.
|
|
206
|
+
*/
|
|
207
|
+
export function numericAt(cmd, row, col) {
|
|
208
|
+
const probe = valueProbe;
|
|
209
|
+
if (!probe)
|
|
210
|
+
return looksNumeric(cmd.getCellValue(row, col));
|
|
211
|
+
const value = probe(row, col);
|
|
212
|
+
// An engine reports an error as an object; that is not a number, and it
|
|
213
|
+
// should end the run rather than be counted as one.
|
|
214
|
+
if (value !== null && typeof value === 'object')
|
|
215
|
+
return false;
|
|
216
|
+
return looksNumeric(value);
|
|
217
|
+
}
|
|
218
|
+
/** Default numeric test for AutoSum: a finite number, or a string that parses
|
|
219
|
+
* as one. A blank is not a number, so a gap ends the run. */
|
|
220
|
+
export function looksNumeric(value) {
|
|
221
|
+
if (isBlankValue(value))
|
|
222
|
+
return false;
|
|
223
|
+
if (typeof value === 'number')
|
|
224
|
+
return Number.isFinite(value);
|
|
225
|
+
if (typeof value === 'string') {
|
|
226
|
+
const n = Number(value.trim());
|
|
227
|
+
return value.trim() !== '' && Number.isFinite(n);
|
|
228
|
+
}
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { NotesMap } from './rects.js';
|
|
2
|
+
export type { NotesMap } from './rects.js';
|
|
3
|
+
/** One entry of a thread: its text, who wrote it and when (ISO 8601). */
|
|
4
|
+
export type CommentEntry = {
|
|
5
|
+
text: string;
|
|
6
|
+
author?: string;
|
|
7
|
+
at?: string;
|
|
8
|
+
};
|
|
9
|
+
/** A cell's comment: the first entry, its replies, and whether it is done. */
|
|
10
|
+
export type CommentThread = CommentEntry & {
|
|
11
|
+
replies?: CommentEntry[];
|
|
12
|
+
resolved?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** A note as saved before threads existed, or a thread. */
|
|
15
|
+
export type CommentValue = string | CommentThread;
|
|
16
|
+
/** `r4` -> `B` -> the comment; the document's own shape. */
|
|
17
|
+
export type CommentsMap = Record<string, Record<string, CommentValue>>;
|
|
18
|
+
/** Either shape as a thread; undefined for a blank note. */
|
|
19
|
+
export declare function threadOf(value: CommentValue | undefined): CommentThread | undefined;
|
|
20
|
+
/** The thread on (r, c), or undefined when there is none. */
|
|
21
|
+
export declare function threadAt(comments: CommentsMap, r: number, c: number): CommentThread | undefined;
|
|
22
|
+
/** The comment's first text on (r, c), or undefined when there is none. */
|
|
23
|
+
export declare function commentAt(comments: CommentsMap, r: number, c: number): string | undefined;
|
|
24
|
+
/** True when the thread carries more than a note's text: it is written as an object. */
|
|
25
|
+
export declare function isThreaded(thread: CommentThread): boolean;
|
|
26
|
+
/** The thread as the text a tooltip shows: each entry under its author. */
|
|
27
|
+
export declare function threadText(thread: CommentThread): string;
|
|
28
|
+
/**
|
|
29
|
+
* The map with (r, c) set to `thread`, or cleared when it is null or blank.
|
|
30
|
+
* A thread with nothing but a text is written as that text, so a document
|
|
31
|
+
* that never used threads reads as it always did. A new map, never the
|
|
32
|
+
* old one changed: the grid re-reads `notes` only when the object it is
|
|
33
|
+
* handed is a different one.
|
|
34
|
+
*/
|
|
35
|
+
export declare function withThread(comments: CommentsMap, r: number, c: number, thread: CommentThread | null): CommentsMap;
|
|
36
|
+
/**
|
|
37
|
+
* The map with the first text of (r, c) set to `text`, or the comment
|
|
38
|
+
* removed when the text is blank. A thread keeps its author, replies and
|
|
39
|
+
* state; a note stays a note.
|
|
40
|
+
*/
|
|
41
|
+
export declare function withComment(comments: CommentsMap, r: number, c: number, text: string): CommentsMap;
|
|
42
|
+
/** The grid's `notes`: the text of every comment, for the mark and the tooltip. */
|
|
43
|
+
export declare function notesOf(comments: CommentsMap): NotesMap;
|
|
44
|
+
/** Every comment, top to bottom then left to right, with its first text. */
|
|
45
|
+
export declare function listComments(comments: CommentsMap): Array<{
|
|
46
|
+
row: number;
|
|
47
|
+
col: number;
|
|
48
|
+
text: string;
|
|
49
|
+
thread: CommentThread;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* The comment after (or before) `from`, reading the sheet row by row and
|
|
53
|
+
* wrapping at the end, as Excel's Next Comment and Previous Comment do. The
|
|
54
|
+
* cell itself is skipped, so pressing Next on a commented cell moves on;
|
|
55
|
+
* null when the sheet has no comments at all.
|
|
56
|
+
*/
|
|
57
|
+
export declare function nextComment(comments: CommentsMap, from: {
|
|
58
|
+
row: number;
|
|
59
|
+
col: number;
|
|
60
|
+
}, dir: 1 | -1): {
|
|
61
|
+
row: number;
|
|
62
|
+
col: number;
|
|
63
|
+
} | null;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cell comments: Excel's notes and its threaded comments in one map. A
|
|
3
|
+
* note is a text on a cell, shown as a corner mark and read on hover; a
|
|
4
|
+
* thread is that text with an author and a time, replies under it, and a
|
|
5
|
+
* resolved flag. They live in the sheet document keyed the way the grid's
|
|
6
|
+
* `notes` are (`r4` -> `B` -> value), so the document moves them with an
|
|
7
|
+
* insert or delete (`remapNotes`) and the grid draws the mark and the
|
|
8
|
+
* tooltip from the text projection `notesOf` makes.
|
|
9
|
+
*
|
|
10
|
+
* A value is a plain string for a note (the shape every document saved so
|
|
11
|
+
* far carries) or a `CommentThread`; `threadOf` reads either. This module
|
|
12
|
+
* is the pure part: reading, writing, and walking them the way Review >
|
|
13
|
+
* Previous / Next do.
|
|
14
|
+
*/
|
|
15
|
+
import { colToLetters, lettersToCol } from './address.js';
|
|
16
|
+
/** Either shape as a thread; undefined for a blank note. */
|
|
17
|
+
export function threadOf(value) {
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
if (typeof value === 'string')
|
|
21
|
+
return value.trim() ? { text: value } : undefined;
|
|
22
|
+
return value.text.trim() || value.replies?.length ? value : undefined;
|
|
23
|
+
}
|
|
24
|
+
/** The thread on (r, c), or undefined when there is none. */
|
|
25
|
+
export function threadAt(comments, r, c) {
|
|
26
|
+
return threadOf(comments[`r${r}`]?.[colToLetters(c)]);
|
|
27
|
+
}
|
|
28
|
+
/** The comment's first text on (r, c), or undefined when there is none. */
|
|
29
|
+
export function commentAt(comments, r, c) {
|
|
30
|
+
return threadAt(comments, r, c)?.text;
|
|
31
|
+
}
|
|
32
|
+
/** True when the thread carries more than a note's text: it is written as an object. */
|
|
33
|
+
export function isThreaded(thread) {
|
|
34
|
+
return Boolean(thread.author || thread.at || thread.replies?.length || thread.resolved);
|
|
35
|
+
}
|
|
36
|
+
/** The thread as the text a tooltip shows: each entry under its author. */
|
|
37
|
+
export function threadText(thread) {
|
|
38
|
+
const line = (entry) => (entry.author ? `${entry.author}:\n${entry.text}` : entry.text);
|
|
39
|
+
return [line(thread), ...(thread.replies ?? []).map(line)].join('\n\n');
|
|
40
|
+
}
|
|
41
|
+
function copy(comments) {
|
|
42
|
+
const out = {};
|
|
43
|
+
for (const [id, line] of Object.entries(comments))
|
|
44
|
+
out[id] = { ...line };
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The map with (r, c) set to `thread`, or cleared when it is null or blank.
|
|
49
|
+
* A thread with nothing but a text is written as that text, so a document
|
|
50
|
+
* that never used threads reads as it always did. A new map, never the
|
|
51
|
+
* old one changed: the grid re-reads `notes` only when the object it is
|
|
52
|
+
* handed is a different one.
|
|
53
|
+
*/
|
|
54
|
+
export function withThread(comments, r, c, thread) {
|
|
55
|
+
const rowId = `r${r}`;
|
|
56
|
+
const columnId = colToLetters(c);
|
|
57
|
+
const out = copy(comments);
|
|
58
|
+
const kept = thread ? threadOf(thread) : undefined;
|
|
59
|
+
if (kept) {
|
|
60
|
+
out[rowId] = { ...(out[rowId] ?? {}), [columnId]: isThreaded(kept) ? kept : kept.text };
|
|
61
|
+
}
|
|
62
|
+
else if (out[rowId]) {
|
|
63
|
+
delete out[rowId][columnId];
|
|
64
|
+
if (Object.keys(out[rowId]).length === 0)
|
|
65
|
+
delete out[rowId];
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The map with the first text of (r, c) set to `text`, or the comment
|
|
71
|
+
* removed when the text is blank. A thread keeps its author, replies and
|
|
72
|
+
* state; a note stays a note.
|
|
73
|
+
*/
|
|
74
|
+
export function withComment(comments, r, c, text) {
|
|
75
|
+
if (!text.trim())
|
|
76
|
+
return withThread(comments, r, c, null);
|
|
77
|
+
const before = threadAt(comments, r, c);
|
|
78
|
+
return withThread(comments, r, c, before ? { ...before, text } : { text });
|
|
79
|
+
}
|
|
80
|
+
/** The grid's `notes`: the text of every comment, for the mark and the tooltip. */
|
|
81
|
+
export function notesOf(comments) {
|
|
82
|
+
const out = {};
|
|
83
|
+
for (const [rowId, line] of Object.entries(comments)) {
|
|
84
|
+
for (const [columnId, value] of Object.entries(line)) {
|
|
85
|
+
const thread = threadOf(value);
|
|
86
|
+
if (!thread)
|
|
87
|
+
continue;
|
|
88
|
+
out[rowId] = { ...(out[rowId] ?? {}), [columnId]: threadText(thread) };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
/** Every comment, top to bottom then left to right, with its first text. */
|
|
94
|
+
export function listComments(comments) {
|
|
95
|
+
const out = [];
|
|
96
|
+
for (const [rowId, line] of Object.entries(comments)) {
|
|
97
|
+
const row = Number(rowId.slice(1));
|
|
98
|
+
if (!Number.isInteger(row) || row < 0)
|
|
99
|
+
continue;
|
|
100
|
+
for (const [columnId, value] of Object.entries(line)) {
|
|
101
|
+
const col = lettersToCol(columnId);
|
|
102
|
+
const thread = threadOf(value);
|
|
103
|
+
if (col < 0 || !thread)
|
|
104
|
+
continue;
|
|
105
|
+
out.push({ row, col, text: thread.text, thread });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return out.sort((a, b) => a.row - b.row || a.col - b.col);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The comment after (or before) `from`, reading the sheet row by row and
|
|
112
|
+
* wrapping at the end, as Excel's Next Comment and Previous Comment do. The
|
|
113
|
+
* cell itself is skipped, so pressing Next on a commented cell moves on;
|
|
114
|
+
* null when the sheet has no comments at all.
|
|
115
|
+
*/
|
|
116
|
+
export function nextComment(comments, from, dir) {
|
|
117
|
+
const all = listComments(comments);
|
|
118
|
+
if (!all.length)
|
|
119
|
+
return null;
|
|
120
|
+
const after = (a, b) => a.row > b.row || (a.row === b.row && a.col > b.col);
|
|
121
|
+
const at = (entry) => ({ row: entry.row, col: entry.col });
|
|
122
|
+
if (dir === 1) {
|
|
123
|
+
const hit = all.find((entry) => after(entry, from));
|
|
124
|
+
return at(hit ?? all[0]);
|
|
125
|
+
}
|
|
126
|
+
for (let i = all.length - 1; i >= 0; i -= 1) {
|
|
127
|
+
if (after(from, all[i]))
|
|
128
|
+
return at(all[i]);
|
|
129
|
+
}
|
|
130
|
+
return at(all[all.length - 1]);
|
|
131
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditional formatting, Excel's: rules over cells that colour them by
|
|
3
|
+
* what they hold. Highlight Cells Rules (greater than, between, text that
|
|
4
|
+
* contains, duplicates), Top/Bottom Rules (top 10, above average), Data
|
|
5
|
+
* Bars, Color Scales and Icon Sets, each over rectangles that move with
|
|
6
|
+
* an insert or delete.
|
|
7
|
+
*
|
|
8
|
+
* Rules are evaluated over COMPUTED values (what a formula shows, not its
|
|
9
|
+
* text), which is why the model lives here beside the workbook rather than
|
|
10
|
+
* in the grid's own value-driven rules. The statistics a rule needs over
|
|
11
|
+
* its range (min, max, mean, rank, counts) are computed once per repaint by
|
|
12
|
+
* the shell and handed in, so a thousand cells cost one pass.
|
|
13
|
+
*
|
|
14
|
+
* Priority is array order, first rule first, as Excel's Manage Rules lists
|
|
15
|
+
* them: the first rule that decides a property wins it, and a rule with
|
|
16
|
+
* Stop If True stops the rules below it for the cells it matches.
|
|
17
|
+
*/
|
|
18
|
+
import { type CellValue } from './ast.js';
|
|
19
|
+
import { type StructuralEdit } from './refs.js';
|
|
20
|
+
import { type Rect } from './rects.js';
|
|
21
|
+
import type { CellFormatEntry } from './format-store.js';
|
|
22
|
+
export type CfStyle = Pick<CellFormatEntry, 'fill' | 'color' | 'bold' | 'italic' | 'underline' | 'strike' | 'numFmt'>;
|
|
23
|
+
export type CfOperator = 'greater' | 'less' | 'between' | 'notBetween' | 'equal' | 'notEqual' | 'greaterOrEqual' | 'lessOrEqual';
|
|
24
|
+
export type CfTextMatch = 'contains' | 'notContains' | 'beginsWith' | 'endsWith';
|
|
25
|
+
export type CfIconSet = 'arrows' | 'traffic' | 'flags' | 'symbols';
|
|
26
|
+
export type CfScaleColors = readonly [string, string] | readonly [string, string, string];
|
|
27
|
+
export type CfRule = {
|
|
28
|
+
id: string;
|
|
29
|
+
rects: ReadonlyArray<Rect>;
|
|
30
|
+
stopIfTrue?: boolean;
|
|
31
|
+
} & ({
|
|
32
|
+
kind: 'cellIs';
|
|
33
|
+
operator: CfOperator;
|
|
34
|
+
value1: string;
|
|
35
|
+
value2?: string;
|
|
36
|
+
style: CfStyle;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'text';
|
|
39
|
+
match: CfTextMatch;
|
|
40
|
+
value: string;
|
|
41
|
+
style: CfStyle;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'duplicates';
|
|
44
|
+
unique?: boolean;
|
|
45
|
+
style: CfStyle;
|
|
46
|
+
} | {
|
|
47
|
+
kind: 'topBottom';
|
|
48
|
+
top: boolean;
|
|
49
|
+
rank: number;
|
|
50
|
+
percent?: boolean;
|
|
51
|
+
style: CfStyle;
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'average';
|
|
54
|
+
above: boolean;
|
|
55
|
+
style: CfStyle;
|
|
56
|
+
}
|
|
57
|
+
/** Excel's "Use a formula to determine which cells to format": written
|
|
58
|
+
* for the rule's top-left cell and moved to each cell, TRUE formats. */
|
|
59
|
+
| {
|
|
60
|
+
kind: 'formula';
|
|
61
|
+
formula: string;
|
|
62
|
+
style: CfStyle;
|
|
63
|
+
}
|
|
64
|
+
/** `negativeColor` paints the bars left of the axis; without it a range
|
|
65
|
+
* with negatives still draws them, in Excel's red. */
|
|
66
|
+
| {
|
|
67
|
+
kind: 'dataBar';
|
|
68
|
+
color: string;
|
|
69
|
+
negativeColor?: string;
|
|
70
|
+
} | {
|
|
71
|
+
kind: 'colorScale';
|
|
72
|
+
colors: CfScaleColors;
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'iconSet';
|
|
75
|
+
set: CfIconSet;
|
|
76
|
+
});
|
|
77
|
+
export type CfKind = CfRule['kind'];
|
|
78
|
+
/** A rule that carries a style: what the small dialogs make. */
|
|
79
|
+
export type CfStyledRule = Extract<CfRule, {
|
|
80
|
+
style: CfStyle;
|
|
81
|
+
}>;
|
|
82
|
+
/** Omit that keeps a union a union, one member at a time. */
|
|
83
|
+
type DistributiveOmit<T, K extends keyof never> = T extends unknown ? Omit<T, K> : never;
|
|
84
|
+
/** Any rule without its id and rectangles: what a new rule is made from. */
|
|
85
|
+
export type CfRuleBody = DistributiveOmit<CfRule, 'id' | 'rects'>;
|
|
86
|
+
/** A styled rule without its id and rectangles: what the dialog hands back. */
|
|
87
|
+
export type CfBody = DistributiveOmit<CfStyledRule, 'id' | 'rects'>;
|
|
88
|
+
/** The small dialogs, one per ribbon entry. */
|
|
89
|
+
export type CfPreset = 'greater' | 'less' | 'between' | 'equal' | 'text' | 'duplicates' | 'top10' | 'bottom10' | 'aboveAverage' | 'belowAverage' | 'formula';
|
|
90
|
+
/** What one rule knows about the numbers in its rectangles. */
|
|
91
|
+
export type CfStats = {
|
|
92
|
+
/** Numbers, sorted ascending. */
|
|
93
|
+
sorted: number[];
|
|
94
|
+
min: number;
|
|
95
|
+
max: number;
|
|
96
|
+
mean: number;
|
|
97
|
+
/** How often each display text occurs, for Duplicate Values. */
|
|
98
|
+
counts: Map<string, number>;
|
|
99
|
+
};
|
|
100
|
+
/** What the rules say about one cell. */
|
|
101
|
+
export type CfResult = {
|
|
102
|
+
style?: CfStyle;
|
|
103
|
+
/**
|
|
104
|
+
* A bar across the cell: `ratio` of its width, starting `axis` of the
|
|
105
|
+
* way across (0 when the range has no negatives) and running right for a
|
|
106
|
+
* positive value, left for a negative one, which `negative` says.
|
|
107
|
+
*/
|
|
108
|
+
dataBar?: {
|
|
109
|
+
ratio: number;
|
|
110
|
+
color: string;
|
|
111
|
+
axis: number;
|
|
112
|
+
negative: boolean;
|
|
113
|
+
};
|
|
114
|
+
/** The icon set and which of its three icons: 0 = the top one. */
|
|
115
|
+
icon?: {
|
|
116
|
+
set: CfIconSet;
|
|
117
|
+
index: 0 | 1 | 2;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/** How a rule reads the sheet: the shell wires the workbook in. */
|
|
121
|
+
export type CfContext = {
|
|
122
|
+
/** A formula or a literal, evaluated in the sheet; `at` is the cell a
|
|
123
|
+
* formula rule is being read for, so ROW() and COLUMN() work in it. */
|
|
124
|
+
evaluate(text: string, at?: {
|
|
125
|
+
row: number;
|
|
126
|
+
col: number;
|
|
127
|
+
}): CellValue;
|
|
128
|
+
};
|
|
129
|
+
/** The six "with" styles of Excel's Highlight Cells dialogs. */
|
|
130
|
+
export declare const CF_PRESET_STYLES: ReadonlyArray<{
|
|
131
|
+
id: string;
|
|
132
|
+
label: string;
|
|
133
|
+
style: CfStyle;
|
|
134
|
+
}>;
|
|
135
|
+
export declare const DATA_BAR_COLOR = "#638EC6";
|
|
136
|
+
/** Excel's colour for the bars left of the axis. */
|
|
137
|
+
export declare const DATA_BAR_NEGATIVE_COLOR = "#FF0000";
|
|
138
|
+
export declare const COLOR_SCALES: Record<'green-yellow-red' | 'red-yellow-green' | 'green-white' | 'white-red', CfScaleColors>;
|
|
139
|
+
export declare function cfId(): string;
|
|
140
|
+
/**
|
|
141
|
+
* The numbers and the texts a rule's rectangles hold. One pass; the shell
|
|
142
|
+
* caches the result per rule until the next repaint.
|
|
143
|
+
*/
|
|
144
|
+
export declare function ruleStats(rule: CfRule, valueAt: (r: number, c: number) => CellValue, displayAt: (r: number, c: number) => string): CfStats;
|
|
145
|
+
/** The colour a scale gives a position 0..1. */
|
|
146
|
+
export declare function scaleColor(colors: CfScaleColors, t: number): string;
|
|
147
|
+
/** Which of an icon set's three icons a position 0..1 gets: Excel's thirds. */
|
|
148
|
+
export declare function iconIndex(t: number): 0 | 1 | 2;
|
|
149
|
+
/**
|
|
150
|
+
* What the rules say about (r, c). Array order is priority; the first rule
|
|
151
|
+
* that decides a property (the fill, the text colour, the bar, the icon)
|
|
152
|
+
* keeps it; a matching rule with Stop If True ends the walk.
|
|
153
|
+
*/
|
|
154
|
+
export declare function evaluateCf(rules: ReadonlyArray<CfRule>, r: number, c: number, value: CellValue, display: string, statsFor: (rule: CfRule) => CfStats, ctx: CfContext): CfResult | null;
|
|
155
|
+
/** The rules after an insert or delete. */
|
|
156
|
+
export declare function shiftCf(rules: ReadonlyArray<CfRule>, edit: StructuralEdit): CfRule[];
|
|
157
|
+
/** The rules with the rectangles cut out of them: Clear Rules from Selected Cells. */
|
|
158
|
+
export declare function removeCf(rules: ReadonlyArray<CfRule>, rects: ReadonlyArray<Rect>): CfRule[];
|
|
159
|
+
/** The rules touching any of the rectangles. */
|
|
160
|
+
export declare function cfIn(rules: ReadonlyArray<CfRule>, rects: ReadonlyArray<Rect>): CfRule[];
|
|
161
|
+
/** A rule in words, the way Excel's Manage Rules lists it. */
|
|
162
|
+
export declare function describeCf(rule: CfRule): string;
|
|
163
|
+
/** Whether a rule carries a style the dialog can edit. */
|
|
164
|
+
export declare function hasStyle(rule: CfRule): rule is Extract<CfRule, {
|
|
165
|
+
style: CfStyle;
|
|
166
|
+
}>;
|
|
167
|
+
export {};
|