@svgrid/enterprise 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -95
- package/dist/ExpressionEditorHarness.svelte.d.ts +2 -2
- package/dist/SvAdvancedFilter.svelte.d.ts +2 -2
- package/dist/SvAlertRuleEditor.svelte.d.ts +2 -2
- package/dist/SvAlertsManager.svelte.d.ts +3 -3
- package/dist/SvAlertsPanel.svelte.d.ts +1 -1
- package/dist/SvAuthGate.svelte +115 -115
- package/dist/SvAuthGate.svelte.d.ts +1 -1
- package/dist/SvBoard.svelte.d.ts +1 -1
- package/dist/SvExportMenu.svelte +553 -553
- package/dist/SvExportMenu.svelte.d.ts +2 -2
- package/dist/SvExpressionEditor.svelte.d.ts +2 -2
- package/dist/SvFileInput.svelte +113 -113
- package/dist/SvFormulaBar.svelte +606 -0
- package/dist/SvFormulaBar.svelte.d.ts +62 -0
- package/dist/SvGridAlerts.svelte.d.ts +2 -2
- package/dist/SvGridBoard.svelte +2358 -2358
- package/dist/SvGridBulkEditDrawer.svelte.d.ts +1 -1
- package/dist/SvGridEditPanel.svelte +1157 -1157
- package/dist/SvGridEditPanel.svelte.d.ts +3 -3
- package/dist/SvGridMasterDetail.svelte +116 -116
- package/dist/SvGridMasterDetail.svelte.d.ts +1 -1
- package/dist/SvGridScheduler.svelte +5358 -5358
- package/dist/SvImportDialog.svelte +1020 -1020
- package/dist/SvImportDialog.svelte.d.ts +2 -2
- package/dist/SvLookupInput.svelte +180 -180
- package/dist/SvLookupInput.svelte.d.ts +1 -1
- package/dist/SvPivotDesigner.svelte +2041 -1990
- package/dist/SvPivotDesigner.svelte.d.ts +2 -2
- package/dist/SvRecordDetail.svelte.d.ts +1 -1
- package/dist/SvRibbonIcon.svelte +46 -0
- package/dist/SvRibbonIcon.svelte.d.ts +17 -0
- package/dist/SvSchedule.svelte.d.ts +1 -1
- package/dist/SvSchemaChart.svelte +236 -234
- package/dist/SvSchemaChart.svelte.d.ts +2 -2
- package/dist/SvSchemaDashboard.svelte +130 -130
- package/dist/SvSchemaDashboard.svelte.d.ts +3 -3
- package/dist/SvSheet.svelte +4114 -0
- package/dist/SvSheet.svelte.d.ts +142 -0
- package/dist/SvSheetComment.svelte +98 -0
- package/dist/SvSheetComment.svelte.d.ts +22 -0
- package/dist/SvSheetConditionalFormat.svelte +162 -0
- package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
- package/dist/SvSheetDataValidation.svelte +249 -0
- package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
- package/dist/SvSheetFilterMenu.svelte +217 -0
- package/dist/SvSheetFilterMenu.svelte.d.ts +17 -0
- package/dist/SvSheetFindReplace.svelte +132 -0
- package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
- package/dist/SvSheetFormatCells.svelte +421 -0
- package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
- package/dist/SvSheetGoalSeek.svelte +144 -0
- package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
- package/dist/SvSheetInsertFunction.svelte +147 -0
- package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
- package/dist/SvSheetListPicker.svelte +89 -0
- package/dist/SvSheetListPicker.svelte.d.ts +16 -0
- package/dist/SvSheetManageRules.svelte +185 -0
- package/dist/SvSheetManageRules.svelte.d.ts +16 -0
- package/dist/SvSheetNameManager.svelte +225 -0
- package/dist/SvSheetNameManager.svelte.d.ts +11 -0
- package/dist/SvSheetPasteSpecial.svelte +105 -0
- package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
- package/dist/SvSheetRemoveDuplicates.svelte +149 -0
- package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
- package/dist/SvSheetRibbon.svelte +1201 -0
- package/dist/SvSheetRibbon.svelte.d.ts +34 -0
- package/dist/SvSheetSizeDialog.svelte +58 -0
- package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
- package/dist/SvSheetTabs.svelte +441 -0
- package/dist/SvSheetTabs.svelte.d.ts +36 -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 +83 -0
- package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
- package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -1
- package/dist/advanced-filter-enable.js +3 -3
- package/dist/alerts/alert-engine-attach.d.ts +2 -2
- package/dist/alerts/alert-engine-attach.js +3 -3
- package/dist/alerts/alert-engine.d.ts +1 -1
- package/dist/alerts/alert-engine.js +2 -2
- package/dist/alerts/alert-formats.d.ts +1 -1
- package/dist/alerts/alert-formats.js +1 -1
- package/dist/alerts/alert-observer.d.ts +3 -3
- package/dist/alerts/alert-observer.js +1 -1
- package/dist/alerts/alert-storage.d.ts +1 -1
- package/dist/alerts/alert-store.svelte.d.ts +1 -1
- package/dist/alerts/alert-types.d.ts +2 -2
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/cdn/svgrid-enterprise.svelte-external.js +19046 -5428
- package/dist/designer/assets/GridMenus-BlsvL_aU.js +8 -0
- package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
- package/dist/designer/assets/SvChartMenu-D9hEeHar.js +1 -0
- package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
- package/dist/designer/assets/SvDateRangeInput-C0iCCZ8o.css +1 -0
- package/dist/designer/assets/SvDateTimePicker-DARvKUL2.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-DPv09DIT.css +1 -0
- package/dist/designer/assets/{preload-helper-CG0n22O7.js → SvGrid.helpers-BgT-gnCo.js} +1 -1
- package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +4 -0
- package/dist/designer/assets/SvGridChart-B8j1SSy3.js +3 -0
- package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +1 -0
- package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
- package/dist/designer/assets/SvGridChartPanel-pT6ITc2P.js +4 -0
- package/dist/designer/assets/SvGridChartView-7msfnWZT.css +1 -0
- package/dist/designer/assets/SvGridChartView-bg281UA1.js +1 -0
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +1 -0
- package/dist/designer/assets/SvGridDropdown-CcidB3rm.css +1 -0
- package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
- package/dist/designer/assets/SvListBox-BXfyqy4a.css +1 -0
- package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
- package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
- package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
- package/dist/designer/assets/SvTabs-UFCMTHXS.js +1 -0
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +1 -0
- package/dist/designer/assets/chart-cIPUsbM5.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-DtTxpBUU.js +1 -0
- package/dist/designer/assets/chart-summary-Czu_5epb.js +1 -0
- package/dist/designer/assets/chart-trend-D5I5VEe8.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/editor-contract-Bpoa7A5g.js +1 -0
- package/dist/designer/assets/export-format-D-eP4b2l.js +6 -0
- package/dist/designer/assets/focus-trap-CAreAhlU.js +1 -0
- package/dist/designer/assets/index-CMFgAoVV.css +1 -0
- package/dist/designer/assets/{index-zUBix-JQ.js → index-DwU7CAMm.js} +2985 -141
- package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
- package/dist/designer/assets/preload-helper-HclGiUj8.js +1 -0
- package/dist/designer/assets/row-resize-DLktcqUK.js +1 -0
- package/dist/designer/assets/src-CITpcm6b.js +1 -0
- package/dist/designer/assets/src-EdI3Xqds.js +58 -0
- package/dist/designer/index.html +32 -23
- package/dist/export-conditional.d.ts +1 -1
- package/dist/export-pdf.d.ts +89 -0
- package/dist/export-pdf.js +130 -0
- package/dist/export-print.js +19 -19
- package/dist/export-xls.d.ts +2 -2
- package/dist/export.d.ts +2 -2
- package/dist/export.js +23 -16
- package/dist/expressions/builder-tree.d.ts +2 -2
- package/dist/expressions/builder-tree.js +1 -1
- package/dist/expressions/compile.d.ts +1 -1
- package/dist/import.js +1 -1
- package/dist/index.d.ts +116 -53
- package/dist/index.js +117 -50
- package/dist/install.d.ts +4 -4
- package/dist/install.js +16 -11
- package/dist/license.d.ts +3 -2
- package/dist/license.js +9 -4
- package/dist/node/studio.js +187 -116
- package/dist/pivot-chart.d.ts +26 -2
- package/dist/pivot-chart.js +25 -69
- package/dist/pivot-designer.d.ts +1 -1
- package/dist/pivot-enable.js +3 -3
- package/dist/print.d.ts +1 -1
- package/dist/print.js +4 -4
- package/dist/scheduler-config.d.ts +5 -5
- package/dist/scheduler-freebusy.d.ts +1 -1
- package/dist/scheduler-freebusy.js +1 -1
- package/dist/scheduler.js +2 -2
- package/dist/schema-designer.d.ts +1 -1
- package/dist/schema-designer.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/sheet/address.d.ts +43 -0
- package/dist/sheet/address.js +81 -0
- package/dist/sheet/ast.d.ts +94 -0
- package/dist/sheet/ast.js +56 -0
- package/dist/sheet/auto-filter.d.ts +66 -0
- package/dist/sheet/auto-filter.js +147 -0
- package/dist/sheet/autocomplete.d.ts +42 -0
- package/dist/sheet/autocomplete.js +162 -0
- package/dist/sheet/coerce.d.ts +31 -0
- package/dist/sheet/coerce.js +122 -0
- package/dist/sheet/commands.d.ts +89 -0
- package/dist/sheet/commands.js +230 -0
- package/dist/sheet/comments.d.ts +29 -0
- package/dist/sheet/comments.js +73 -0
- package/dist/sheet/conditional-formats.d.ts +144 -0
- package/dist/sheet/conditional-formats.js +316 -0
- package/dist/sheet/deps.d.ts +60 -0
- package/dist/sheet/deps.js +199 -0
- package/dist/sheet/document.d.ts +150 -0
- package/dist/sheet/document.js +264 -0
- package/dist/sheet/edit-keys.d.ts +14 -0
- package/dist/sheet/edit-keys.js +40 -0
- package/dist/sheet/entry.d.ts +31 -0
- package/dist/sheet/entry.js +76 -0
- package/dist/sheet/evaluate.d.ts +61 -0
- package/dist/sheet/evaluate.js +337 -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 +99 -0
- package/dist/sheet/format-store.js +233 -0
- package/dist/sheet/freeze.d.ts +54 -0
- package/dist/sheet/freeze.js +58 -0
- package/dist/sheet/function-catalog.d.ts +10 -0
- package/dist/sheet/function-catalog.js +94 -0
- package/dist/sheet/functions.d.ts +28 -0
- package/dist/sheet/functions.js +362 -0
- package/dist/sheet/goal-seek.d.ts +73 -0
- package/dist/sheet/goal-seek.js +153 -0
- package/dist/sheet/index.d.ts +53 -0
- package/dist/sheet/index.js +53 -0
- package/dist/sheet/merges.d.ts +71 -0
- package/dist/sheet/merges.js +137 -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 +63 -0
- package/dist/sheet/number-format.js +508 -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 +108 -0
- package/dist/sheet/paste-special.d.ts +164 -0
- package/dist/sheet/paste-special.js +592 -0
- package/dist/sheet/protection.d.ts +21 -0
- package/dist/sheet/protection.js +48 -0
- package/dist/sheet/rects.d.ts +45 -0
- package/dist/sheet/rects.js +112 -0
- package/dist/sheet/refs.d.ts +82 -0
- package/dist/sheet/refs.js +266 -0
- package/dist/sheet/ribbon-icons.d.ts +31 -0
- package/dist/sheet/ribbon-icons.js +350 -0
- package/dist/sheet/ribbon.d.ts +173 -0
- package/dist/sheet/ribbon.js +753 -0
- package/dist/sheet/shortcuts.d.ts +164 -0
- package/dist/sheet/shortcuts.js +623 -0
- package/dist/sheet/structure.d.ts +87 -0
- package/dist/sheet/structure.js +166 -0
- package/dist/sheet/tables.d.ts +70 -0
- package/dist/sheet/tables.js +147 -0
- package/dist/sheet/tokenize.d.ts +54 -0
- package/dist/sheet/tokenize.js +304 -0
- package/dist/sheet/transforms.d.ts +76 -0
- package/dist/sheet/transforms.js +154 -0
- package/dist/sheet/validation.d.ts +92 -0
- package/dist/sheet/validation.js +241 -0
- package/dist/sheet/workbook.d.ts +72 -0
- package/dist/sheet/workbook.js +409 -0
- package/dist/sheet-enable.d.ts +6 -0
- package/dist/sheet-enable.js +46 -0
- package/dist/sources/aggregate.d.ts +1 -1
- package/dist/sources/auth-supabase.js +1 -1
- package/dist/sources/dashboard.d.ts +2 -2
- package/dist/sources/dashboard.js +1 -1
- package/dist/sources/index.d.ts +13 -13
- package/dist/sources/index.js +13 -13
- package/dist/sources/realtime-supabase.js +1 -1
- package/dist/sources/relation-lookup.d.ts +1 -1
- package/dist/sources/relation-lookup.js +1 -1
- package/dist/sources/rest-adapters.d.ts +1 -1
- package/dist/sources/rest-adapters.js +1 -1
- package/dist/sources/rest.d.ts +2 -2
- package/dist/sources/rest.js +3 -3
- package/dist/sources/supabase.d.ts +2 -2
- package/dist/sources/supabase.js +3 -3
- package/dist/sources/with-entity-rules.d.ts +1 -1
- package/dist/sources/with-entity-rules.js +1 -1
- package/dist/sources/with-relation-labels.d.ts +1 -1
- package/dist/studio/emit-project.js +2161 -2127
- package/dist/studio/emit-schema.js +369 -369
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/introspect-db.js +45 -45
- package/dist/studio/project.d.ts +10 -0
- package/dist/studio/samples/crm.js +6 -6
- package/dist/studio/samples/fleet.js +7 -7
- package/dist/studio/samples/insurance.js +9 -9
- package/dist/studio/samples/inventory.js +12 -12
- package/dist/studio/samples/projects.js +5 -5
- package/dist/studio/samples/support.js +8 -8
- package/dist/studio/scaffold-app.js +104 -104
- package/dist/studio/scaffold.js +151 -151
- package/dist/studio/ui-components.d.ts +7 -0
- package/dist/studio/ui-components.generated.js +63 -1
- package/dist/studio/ui-components.js +35 -0
- package/dist/sveltekit/in-memory.d.ts +3 -3
- package/dist/sveltekit/in-memory.js +4 -4
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +5 -5
- package/dist/sveltekit/query-plan.d.ts +1 -1
- package/dist/sveltekit/sql-source.d.ts +4 -4
- package/dist/sveltekit/sql-source.js +4 -4
- package/dist/sveltekit/sql.d.ts +1 -1
- package/dist/sveltekit/transport.d.ts +2 -2
- package/dist/sveltekit/transport.js +1 -1
- package/dist/upgrade-prompt.js +25 -25
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -4
- package/dist/designer/assets/GridMenus-Cgilexpk.js +0 -8
- package/dist/designer/assets/SvDateRangeInput-BV5OXYQ2.css +0 -1
- package/dist/designer/assets/SvDateRangeInput-CVn-yqrQ.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-BdioTrJQ.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-CY8TK4BT.css +0 -1
- package/dist/designer/assets/SvField-BF-9TJSd.css +0 -1
- package/dist/designer/assets/SvField-BsqiA5me.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-dLY7_kk9.js +0 -2
- package/dist/designer/assets/SvGridChart-BEDNTdc5.js +0 -2
- package/dist/designer/assets/SvGridChart-Vu4Nvjiv.css +0 -1
- package/dist/designer/assets/SvGridChartPanel-x3lzSxuf.js +0 -10
- package/dist/designer/assets/SvGridChartView-CAKhPELi.js +0 -1
- package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +0 -1
- package/dist/designer/assets/SvGridDropdown-CAYG7Y-O.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Crwb2P3Q.css +0 -1
- package/dist/designer/assets/SvListBox-CVYQcLX9.js +0 -1
- package/dist/designer/assets/SvListBox-DgN8kvjt.css +0 -1
- package/dist/designer/assets/chart-DHEgt4lN.js +0 -1
- package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
- package/dist/designer/assets/date-format-4DJvNtG2.js +0 -1
- package/dist/designer/assets/date-format-Dzy4mTGh.css +0 -1
- package/dist/designer/assets/easing-zaypKrr0.js +0 -3
- package/dist/designer/assets/export-format-DwjuTfrQ.js +0 -6
- package/dist/designer/assets/index-Cp7fDJ3b.css +0 -1
- package/dist/designer/assets/js-scroller.svelte-Bhxqb3-c.js +0 -110
- package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
- package/dist/designer/assets/src-B7DNcoQK.css +0 -1
- package/dist/designer/assets/src-BoYyigAC.js +0 -2896
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -3875
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -21
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -1938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -205
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -18
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -264
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -697
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -4938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -495
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -190
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -8
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -138
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
let target = null;
|
|
2
|
+
export function setFindTarget(next) {
|
|
3
|
+
target = next;
|
|
4
|
+
}
|
|
5
|
+
export function getFindTarget() {
|
|
6
|
+
return target;
|
|
7
|
+
}
|
|
8
|
+
function textOf(t, r, c, lookIn) {
|
|
9
|
+
if (lookIn === 'formulas')
|
|
10
|
+
return t.getRaw(r, c);
|
|
11
|
+
return t.getDisplay ? t.getDisplay(r, c) : t.getRaw(r, c);
|
|
12
|
+
}
|
|
13
|
+
/** Does `haystack` match `needle` under these options? */
|
|
14
|
+
export function cellMatches(haystack, needle, opts = {}) {
|
|
15
|
+
if (needle === '')
|
|
16
|
+
return false;
|
|
17
|
+
const a = opts.matchCase ? haystack : haystack.toLowerCase();
|
|
18
|
+
const b = opts.matchCase ? needle : needle.toLowerCase();
|
|
19
|
+
return opts.matchEntireCell ? a === b : a.includes(b);
|
|
20
|
+
}
|
|
21
|
+
/** Every cell matching, in reading order. */
|
|
22
|
+
export function findAll(cmd, needle, opts = {}) {
|
|
23
|
+
const t = target;
|
|
24
|
+
if (!t || needle === '')
|
|
25
|
+
return [];
|
|
26
|
+
const lookIn = opts.lookIn ?? 'values';
|
|
27
|
+
const bounds = opts.scope === 'selection' ? cmd.ranges : null;
|
|
28
|
+
const hits = [];
|
|
29
|
+
const inScope = (r, c) => {
|
|
30
|
+
if (!bounds)
|
|
31
|
+
return true;
|
|
32
|
+
return bounds.some(([minRow, minCol, maxRow, maxCol]) => r >= minRow && r <= maxRow && c >= minCol && c <= maxCol);
|
|
33
|
+
};
|
|
34
|
+
for (let r = 0; r < cmd.rowCount; r += 1) {
|
|
35
|
+
for (let c = 0; c < cmd.colCount; c += 1) {
|
|
36
|
+
if (!inScope(r, c))
|
|
37
|
+
continue;
|
|
38
|
+
if (cellMatches(textOf(t, r, c, lookIn), needle, opts))
|
|
39
|
+
hits.push({ rowIndex: r, colIndex: c });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return hits;
|
|
43
|
+
}
|
|
44
|
+
/** The next hit after the active cell, wrapping. Null when there are none. */
|
|
45
|
+
export function findNext(cmd, needle, opts = {}, direction = 1) {
|
|
46
|
+
const hits = findAll(cmd, needle, opts);
|
|
47
|
+
if (hits.length === 0)
|
|
48
|
+
return null;
|
|
49
|
+
const active = cmd.activeCell;
|
|
50
|
+
if (!active)
|
|
51
|
+
return hits[0];
|
|
52
|
+
const key = (h) => h.rowIndex * cmd.colCount + h.colIndex;
|
|
53
|
+
const here = active.rowIndex * cmd.colCount + active.colIndex;
|
|
54
|
+
if (direction === 1) {
|
|
55
|
+
return hits.find((h) => key(h) > here) ?? hits[0];
|
|
56
|
+
}
|
|
57
|
+
// Reverse: the last hit strictly before the active cell, else wrap to the end.
|
|
58
|
+
for (let i = hits.length - 1; i >= 0; i -= 1) {
|
|
59
|
+
if (key(hits[i]) < here)
|
|
60
|
+
return hits[i];
|
|
61
|
+
}
|
|
62
|
+
return hits[hits.length - 1];
|
|
63
|
+
}
|
|
64
|
+
/** Replace inside one string, honouring case sensitivity and whole-cell. */
|
|
65
|
+
export function replaceInText(haystack, needle, replacement, opts = {}) {
|
|
66
|
+
if (needle === '')
|
|
67
|
+
return haystack;
|
|
68
|
+
if (opts.matchEntireCell) {
|
|
69
|
+
return cellMatches(haystack, needle, opts) ? replacement : haystack;
|
|
70
|
+
}
|
|
71
|
+
if (opts.matchCase)
|
|
72
|
+
return haystack.split(needle).join(replacement);
|
|
73
|
+
// Case-insensitive substring replace, without a regex: the needle is user
|
|
74
|
+
// input and escaping it correctly is more code than scanning for it.
|
|
75
|
+
const lowerHay = haystack.toLowerCase();
|
|
76
|
+
const lowerNeedle = needle.toLowerCase();
|
|
77
|
+
let out = '';
|
|
78
|
+
let i = 0;
|
|
79
|
+
for (;;) {
|
|
80
|
+
const at = lowerHay.indexOf(lowerNeedle, i);
|
|
81
|
+
if (at < 0) {
|
|
82
|
+
out += haystack.slice(i);
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
out += haystack.slice(i, at) + replacement;
|
|
86
|
+
i = at + needle.length;
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Replace the active cell if it matches, then move to the next hit. Returns
|
|
92
|
+
* whether anything was written.
|
|
93
|
+
*/
|
|
94
|
+
export function replaceOne(cmd, needle, replacement, opts = {}) {
|
|
95
|
+
const t = target;
|
|
96
|
+
const active = cmd.activeCell;
|
|
97
|
+
if (!t || !active || needle === '')
|
|
98
|
+
return false;
|
|
99
|
+
const { rowIndex: r, colIndex: c } = active;
|
|
100
|
+
const lookIn = opts.lookIn ?? 'values';
|
|
101
|
+
const editable = t.isEditable?.(r, c) ?? true;
|
|
102
|
+
let wrote = false;
|
|
103
|
+
if (editable && cellMatches(textOf(t, r, c, lookIn), needle, opts)) {
|
|
104
|
+
// Always write through the RAW text: replacing inside a displayed value
|
|
105
|
+
// would overwrite a formula with its own result.
|
|
106
|
+
const raw = t.getRaw(r, c);
|
|
107
|
+
const next = replaceInText(raw, needle, replacement, opts);
|
|
108
|
+
if (next !== raw) {
|
|
109
|
+
t.setRaw(r, c, next);
|
|
110
|
+
t.onChange?.();
|
|
111
|
+
wrote = true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const following = findNext(cmd, needle, opts);
|
|
115
|
+
if (following) {
|
|
116
|
+
cmd.setActiveCell(following.rowIndex, following.colIndex);
|
|
117
|
+
cmd.setSelection(following.rowIndex, following.colIndex);
|
|
118
|
+
cmd.scrollIntoView(following.rowIndex, following.colIndex);
|
|
119
|
+
}
|
|
120
|
+
return wrote;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Replace every match. Returns how many cells changed.
|
|
124
|
+
*
|
|
125
|
+
* Runs inside `cmd.batch`, so a hundred replacements are ONE Ctrl+Z. Without
|
|
126
|
+
* that this would be the single worst thing in the feature set for undo: it is
|
|
127
|
+
* the one command that routinely writes more cells than the history can hold.
|
|
128
|
+
*/
|
|
129
|
+
export function replaceAll(cmd, needle, replacement, opts = {}) {
|
|
130
|
+
const t = target;
|
|
131
|
+
if (!t || needle === '')
|
|
132
|
+
return 0;
|
|
133
|
+
const hits = findAll(cmd, needle, opts);
|
|
134
|
+
if (hits.length === 0)
|
|
135
|
+
return 0;
|
|
136
|
+
return cmd.batch(() => {
|
|
137
|
+
let changed = 0;
|
|
138
|
+
for (const { rowIndex: r, colIndex: c } of hits) {
|
|
139
|
+
if (!(t.isEditable?.(r, c) ?? true))
|
|
140
|
+
continue;
|
|
141
|
+
const raw = t.getRaw(r, c);
|
|
142
|
+
const next = replaceInText(raw, needle, replacement, opts);
|
|
143
|
+
if (next === raw)
|
|
144
|
+
continue;
|
|
145
|
+
t.setRaw(r, c, next);
|
|
146
|
+
changed += 1;
|
|
147
|
+
}
|
|
148
|
+
if (changed > 0)
|
|
149
|
+
t.onChange?.();
|
|
150
|
+
return changed;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-cell formats and styles, keyed so they survive the grid moving rows
|
|
3
|
+
* around.
|
|
4
|
+
*
|
|
5
|
+
* Demo 27 keys its format map by DISPLAY row index. Sort the grid and every
|
|
6
|
+
* bold cell moves to whatever row now sits at that index, which is the kind of
|
|
7
|
+
* bug that looks like a rendering glitch and is actually lost data. This keys
|
|
8
|
+
* by `rowId:columnId`, the same shape the grid already uses for `notes`, so
|
|
9
|
+
* sorting, filtering, column reordering and pagination all leave it alone.
|
|
10
|
+
*
|
|
11
|
+
* Storage is sparse: a sheet of ten thousand cells with three bold ones holds
|
|
12
|
+
* three entries. Most cells have no entry at all and cost nothing.
|
|
13
|
+
*/
|
|
14
|
+
import type { BorderSpec } from '@svgrid/grid';
|
|
15
|
+
/** One cell's formatting. Every field optional; absent means inherit. */
|
|
16
|
+
/** The boolean fields `toggle` can flip. Every one of them is a plain
|
|
17
|
+
* on/off attribute of a cell, which is what makes Excel's all-on-turns-off
|
|
18
|
+
* rule the right one for all of them. */
|
|
19
|
+
export type ToggleableField = 'bold' | 'italic' | 'underline' | 'strike' | 'wrap';
|
|
20
|
+
export type CellFormatEntry = {
|
|
21
|
+
/** Excel number-format string, e.g. '#,##0.00'. */
|
|
22
|
+
numFmt?: string;
|
|
23
|
+
bold?: boolean;
|
|
24
|
+
italic?: boolean;
|
|
25
|
+
underline?: boolean;
|
|
26
|
+
strike?: boolean;
|
|
27
|
+
/** Text colour, any CSS colour. */
|
|
28
|
+
color?: string;
|
|
29
|
+
/** Background fill. */
|
|
30
|
+
fill?: string;
|
|
31
|
+
align?: 'left' | 'center' | 'right';
|
|
32
|
+
fontFamily?: string;
|
|
33
|
+
fontSize?: number;
|
|
34
|
+
wrap?: boolean;
|
|
35
|
+
indent?: number;
|
|
36
|
+
border?: {
|
|
37
|
+
top?: BorderSpec;
|
|
38
|
+
right?: BorderSpec;
|
|
39
|
+
bottom?: BorderSpec;
|
|
40
|
+
left?: BorderSpec;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Excel's Locked flag from Format Cells > Protection. Every cell is locked
|
|
44
|
+
* unless told otherwise, so only `false` is ever stored; the flag means
|
|
45
|
+
* nothing until the sheet is protected, when a locked cell refuses edits.
|
|
46
|
+
*/
|
|
47
|
+
locked?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type Rect = readonly [minRow: number, minCol: number, maxRow: number, maxCol: number];
|
|
50
|
+
/** Translates a display position to the stable ids the store keys on. */
|
|
51
|
+
export type CellAddressLookup = {
|
|
52
|
+
rowIdAt(rowIndex: number): string | null;
|
|
53
|
+
columnIdAt(colIndex: number): string | null;
|
|
54
|
+
};
|
|
55
|
+
export type SheetFormatStore = {
|
|
56
|
+
get(rowId: string, columnId: string): CellFormatEntry | undefined;
|
|
57
|
+
/** Merge `patch` into every cell of every rect. A field set to `undefined`
|
|
58
|
+
* is REMOVED, which is how you clear one attribute without clearing the
|
|
59
|
+
* cell; `clear` removes the whole entry. An entry left with no fields is
|
|
60
|
+
* dropped rather than kept as an empty object. */
|
|
61
|
+
set(rects: ReadonlyArray<Rect>, patch: CellFormatEntry, at: CellAddressLookup): void;
|
|
62
|
+
/** Remove all formatting from every cell of every rect. */
|
|
63
|
+
clear(rects: ReadonlyArray<Rect>, at: CellAddressLookup): void;
|
|
64
|
+
/** Toggle one boolean field across a range. Excel's rule: if EVERY cell in
|
|
65
|
+
* the range already has it, turn it off; otherwise turn it on. */
|
|
66
|
+
toggle(rects: ReadonlyArray<Rect>, field: ToggleableField, at: CellAddressLookup): void;
|
|
67
|
+
/** Drop every entry for a row. Call when a row is deleted, or the store
|
|
68
|
+
* leaks an entry per removed row for the life of the session. */
|
|
69
|
+
forgetRow(rowId: string): void;
|
|
70
|
+
forgetColumn(columnId: string): void;
|
|
71
|
+
/** How many cells carry formatting. For tests and diagnostics. */
|
|
72
|
+
readonly size: number;
|
|
73
|
+
serialize(): Record<string, CellFormatEntry>;
|
|
74
|
+
hydrate(entries: Record<string, CellFormatEntry>): void;
|
|
75
|
+
clearAll(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Rename every row id at once; `fn` returns the new id, or null to drop
|
|
78
|
+
* the row's entries. For a store keyed on record ids this is never
|
|
79
|
+
* needed - an id travels with its record - but a SHEET keys rows by
|
|
80
|
+
* position (`r4` is the fifth row and nothing else), so inserting a row
|
|
81
|
+
* above the fifth has to move its formats to `r5`, or the band stays on
|
|
82
|
+
* row five while the cells it belonged to move down.
|
|
83
|
+
*/
|
|
84
|
+
remapRows(fn: (rowId: string) => string | null): void;
|
|
85
|
+
/** The same for column ids. */
|
|
86
|
+
remapColumns(fn: (columnId: string) => string | null): void;
|
|
87
|
+
};
|
|
88
|
+
export declare function createFormatStore(initial?: Record<string, CellFormatEntry>): SheetFormatStore;
|
|
89
|
+
/** Turn an entry into inline style text for a cell renderer. */
|
|
90
|
+
export declare function entryToStyle(entry: CellFormatEntry | undefined): string;
|
|
91
|
+
/**
|
|
92
|
+
* Cell borders as inset shadows, one per side.
|
|
93
|
+
*
|
|
94
|
+
* The cell span fills its td edge to edge, so an inset shadow along one
|
|
95
|
+
* edge is a border that costs no layout: a real border would push the text
|
|
96
|
+
* and change the cell's size, and a bordered cell next to a plain one would
|
|
97
|
+
* misalign. Shadows stack, so a cell can carry any combination of sides.
|
|
98
|
+
*/
|
|
99
|
+
export declare function borderShadows(border: CellFormatEntry['border']): string;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys are "rowId columnId" with each half percent-encoded.
|
|
3
|
+
*
|
|
4
|
+
* Encoding is what makes the key reversible. Ids come from the grid and may
|
|
5
|
+
* contain spaces, so a plain join cannot be split back apart - and `hydrate`
|
|
6
|
+
* has to split it, or the row and column indexes come back empty and
|
|
7
|
+
* `forgetRow` / `forgetColumn` become silent no-ops on a restored store.
|
|
8
|
+
*/
|
|
9
|
+
function keyOf(rowId, columnId) {
|
|
10
|
+
return `${encodeURIComponent(rowId)} ${encodeURIComponent(columnId)}`;
|
|
11
|
+
}
|
|
12
|
+
function splitKey(key) {
|
|
13
|
+
const gap = key.indexOf(' ');
|
|
14
|
+
if (gap < 0)
|
|
15
|
+
return null;
|
|
16
|
+
try {
|
|
17
|
+
return {
|
|
18
|
+
rowId: decodeURIComponent(key.slice(0, gap)),
|
|
19
|
+
columnId: decodeURIComponent(key.slice(gap + 1)),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function createFormatStore(initial) {
|
|
27
|
+
const cells = new Map();
|
|
28
|
+
const rowsIndex = new Map();
|
|
29
|
+
const colsIndex = new Map();
|
|
30
|
+
function remember(rowId, columnId, key) {
|
|
31
|
+
let byRow = rowsIndex.get(rowId);
|
|
32
|
+
if (!byRow) {
|
|
33
|
+
byRow = new Set();
|
|
34
|
+
rowsIndex.set(rowId, byRow);
|
|
35
|
+
}
|
|
36
|
+
byRow.add(key);
|
|
37
|
+
let byCol = colsIndex.get(columnId);
|
|
38
|
+
if (!byCol) {
|
|
39
|
+
byCol = new Set();
|
|
40
|
+
colsIndex.set(columnId, byCol);
|
|
41
|
+
}
|
|
42
|
+
byCol.add(key);
|
|
43
|
+
}
|
|
44
|
+
function eachCell(rects, at, fn) {
|
|
45
|
+
const seen = new Set();
|
|
46
|
+
for (const [minRow, minCol, maxRow, maxCol] of rects) {
|
|
47
|
+
for (let r = minRow; r <= maxRow; r += 1) {
|
|
48
|
+
const rowId = at.rowIdAt(r);
|
|
49
|
+
if (rowId === null)
|
|
50
|
+
continue;
|
|
51
|
+
for (let c = minCol; c <= maxCol; c += 1) {
|
|
52
|
+
const columnId = at.columnIdAt(c);
|
|
53
|
+
if (columnId === null)
|
|
54
|
+
continue;
|
|
55
|
+
// Overlapping ranges must not apply a toggle twice.
|
|
56
|
+
const key = keyOf(rowId, columnId);
|
|
57
|
+
if (seen.has(key))
|
|
58
|
+
continue;
|
|
59
|
+
seen.add(key);
|
|
60
|
+
fn(rowId, columnId);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const store = {
|
|
66
|
+
get(rowId, columnId) {
|
|
67
|
+
return cells.get(keyOf(rowId, columnId));
|
|
68
|
+
},
|
|
69
|
+
set(rects, patch, at) {
|
|
70
|
+
eachCell(rects, at, (rowId, columnId) => {
|
|
71
|
+
const key = keyOf(rowId, columnId);
|
|
72
|
+
const next = { ...(cells.get(key) ?? {}), ...patch };
|
|
73
|
+
// Strip keys explicitly set to undefined so an entry does not grow
|
|
74
|
+
// a field that means nothing.
|
|
75
|
+
for (const [k, v] of Object.entries(next)) {
|
|
76
|
+
if (v === undefined)
|
|
77
|
+
delete next[k];
|
|
78
|
+
}
|
|
79
|
+
if (Object.keys(next).length === 0) {
|
|
80
|
+
cells.delete(key);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
cells.set(key, next);
|
|
84
|
+
remember(rowId, columnId, key);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
clear(rects, at) {
|
|
88
|
+
eachCell(rects, at, (rowId, columnId) => {
|
|
89
|
+
cells.delete(keyOf(rowId, columnId));
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
toggle(rects, field, at) {
|
|
93
|
+
// Excel's rule, and the one users expect: a mixed selection turns ON.
|
|
94
|
+
let all = true;
|
|
95
|
+
eachCell(rects, at, (rowId, columnId) => {
|
|
96
|
+
if (!cells.get(keyOf(rowId, columnId))?.[field])
|
|
97
|
+
all = false;
|
|
98
|
+
});
|
|
99
|
+
// `set` treats undefined as "remove this field", so one pass does both
|
|
100
|
+
// directions.
|
|
101
|
+
store.set(rects, { [field]: all ? undefined : true }, at);
|
|
102
|
+
},
|
|
103
|
+
forgetRow(rowId) {
|
|
104
|
+
for (const key of rowsIndex.get(rowId) ?? [])
|
|
105
|
+
cells.delete(key);
|
|
106
|
+
rowsIndex.delete(rowId);
|
|
107
|
+
},
|
|
108
|
+
forgetColumn(columnId) {
|
|
109
|
+
for (const key of colsIndex.get(columnId) ?? [])
|
|
110
|
+
cells.delete(key);
|
|
111
|
+
colsIndex.delete(columnId);
|
|
112
|
+
},
|
|
113
|
+
get size() {
|
|
114
|
+
return cells.size;
|
|
115
|
+
},
|
|
116
|
+
serialize() {
|
|
117
|
+
return Object.fromEntries(cells);
|
|
118
|
+
},
|
|
119
|
+
hydrate(entries) {
|
|
120
|
+
cells.clear();
|
|
121
|
+
rowsIndex.clear();
|
|
122
|
+
colsIndex.clear();
|
|
123
|
+
for (const [key, entry] of Object.entries(entries)) {
|
|
124
|
+
cells.set(key, entry);
|
|
125
|
+
// Rebuild the indexes, or forgetRow / forgetColumn do nothing on a
|
|
126
|
+
// store that came back from storage.
|
|
127
|
+
const parts = splitKey(key);
|
|
128
|
+
if (parts)
|
|
129
|
+
remember(parts.rowId, parts.columnId, key);
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
clearAll() {
|
|
133
|
+
cells.clear();
|
|
134
|
+
rowsIndex.clear();
|
|
135
|
+
colsIndex.clear();
|
|
136
|
+
},
|
|
137
|
+
remapRows(fn) {
|
|
138
|
+
const next = {};
|
|
139
|
+
for (const [key, entry] of cells) {
|
|
140
|
+
const parts = splitKey(key);
|
|
141
|
+
if (!parts)
|
|
142
|
+
continue;
|
|
143
|
+
const rowId = fn(parts.rowId);
|
|
144
|
+
if (rowId !== null)
|
|
145
|
+
next[keyOf(rowId, parts.columnId)] = entry;
|
|
146
|
+
}
|
|
147
|
+
store.hydrate(next);
|
|
148
|
+
},
|
|
149
|
+
remapColumns(fn) {
|
|
150
|
+
const next = {};
|
|
151
|
+
for (const [key, entry] of cells) {
|
|
152
|
+
const parts = splitKey(key);
|
|
153
|
+
if (!parts)
|
|
154
|
+
continue;
|
|
155
|
+
const columnId = fn(parts.columnId);
|
|
156
|
+
if (columnId !== null)
|
|
157
|
+
next[keyOf(parts.rowId, columnId)] = entry;
|
|
158
|
+
}
|
|
159
|
+
store.hydrate(next);
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
if (initial)
|
|
163
|
+
store.hydrate(initial);
|
|
164
|
+
return store;
|
|
165
|
+
}
|
|
166
|
+
/** Turn an entry into inline style text for a cell renderer. */
|
|
167
|
+
export function entryToStyle(entry) {
|
|
168
|
+
if (!entry)
|
|
169
|
+
return '';
|
|
170
|
+
const parts = [];
|
|
171
|
+
if (entry.bold)
|
|
172
|
+
parts.push('font-weight:700');
|
|
173
|
+
if (entry.italic)
|
|
174
|
+
parts.push('font-style:italic');
|
|
175
|
+
if (entry.underline && entry.strike)
|
|
176
|
+
parts.push('text-decoration:underline line-through');
|
|
177
|
+
else if (entry.underline)
|
|
178
|
+
parts.push('text-decoration:underline');
|
|
179
|
+
else if (entry.strike)
|
|
180
|
+
parts.push('text-decoration:line-through');
|
|
181
|
+
if (entry.color)
|
|
182
|
+
parts.push(`color:${entry.color}`);
|
|
183
|
+
if (entry.fill)
|
|
184
|
+
parts.push(`background:${entry.fill}`);
|
|
185
|
+
if (entry.align)
|
|
186
|
+
parts.push(`text-align:${entry.align}`);
|
|
187
|
+
if (entry.fontFamily)
|
|
188
|
+
parts.push(`font-family:${entry.fontFamily}`);
|
|
189
|
+
if (entry.fontSize)
|
|
190
|
+
parts.push(`font-size:${entry.fontSize}px`);
|
|
191
|
+
if (entry.wrap)
|
|
192
|
+
parts.push('white-space:pre-wrap');
|
|
193
|
+
if (entry.indent)
|
|
194
|
+
parts.push(`padding-left:${entry.indent * 12}px`);
|
|
195
|
+
const borders = borderShadows(entry.border);
|
|
196
|
+
if (borders)
|
|
197
|
+
parts.push(`box-shadow:${borders}`);
|
|
198
|
+
return parts.join(';');
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Cell borders as inset shadows, one per side.
|
|
202
|
+
*
|
|
203
|
+
* The cell span fills its td edge to edge, so an inset shadow along one
|
|
204
|
+
* edge is a border that costs no layout: a real border would push the text
|
|
205
|
+
* and change the cell's size, and a bordered cell next to a plain one would
|
|
206
|
+
* misalign. Shadows stack, so a cell can carry any combination of sides.
|
|
207
|
+
*/
|
|
208
|
+
export function borderShadows(border) {
|
|
209
|
+
if (!border)
|
|
210
|
+
return '';
|
|
211
|
+
const parts = [];
|
|
212
|
+
const line = (spec) => ({
|
|
213
|
+
w: spec?.width ?? 1,
|
|
214
|
+
c: spec?.color ?? 'currentColor',
|
|
215
|
+
});
|
|
216
|
+
if (border.top) {
|
|
217
|
+
const { w, c } = line(border.top);
|
|
218
|
+
parts.push(`inset 0 ${w}px 0 0 ${c}`);
|
|
219
|
+
}
|
|
220
|
+
if (border.bottom) {
|
|
221
|
+
const { w, c } = line(border.bottom);
|
|
222
|
+
parts.push(`inset 0 -${w}px 0 0 ${c}`);
|
|
223
|
+
}
|
|
224
|
+
if (border.left) {
|
|
225
|
+
const { w, c } = line(border.left);
|
|
226
|
+
parts.push(`inset ${w}px 0 0 0 ${c}`);
|
|
227
|
+
}
|
|
228
|
+
if (border.right) {
|
|
229
|
+
const { w, c } = line(border.right);
|
|
230
|
+
parts.push(`inset -${w}px 0 0 0 ${c}`);
|
|
231
|
+
}
|
|
232
|
+
return parts.join(',');
|
|
233
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freeze panes, over what the grid already has.
|
|
3
|
+
*
|
|
4
|
+
* Columns freeze through `api.setColumnPinning({ left: [...] })`, which
|
|
5
|
+
* makes them sticky and excludes them from the horizontal scroll, and rows
|
|
6
|
+
* through the grid's `frozenRows` prop, set here with `api.setOption`: the
|
|
7
|
+
* first N rows stay under the header, still the grid's own rows, editable
|
|
8
|
+
* and numbered, while the virtualized body scrolls beneath them. Both halves
|
|
9
|
+
* go through the api, so Freeze Panes is one call for any consumer.
|
|
10
|
+
*
|
|
11
|
+
* `splitFrozenRows` stays for a grid that renders its own pinned band from
|
|
12
|
+
* `pinnedTopRows` instead.
|
|
13
|
+
*/
|
|
14
|
+
import type { GridCommandContext } from '@svgrid/grid/shortcuts';
|
|
15
|
+
export type FreezeState = {
|
|
16
|
+
/** How many leading rows should be pinned. */
|
|
17
|
+
rows: number;
|
|
18
|
+
/** How many leading columns should be pinned. */
|
|
19
|
+
cols: number;
|
|
20
|
+
};
|
|
21
|
+
export type FreezeSplit<TData> = {
|
|
22
|
+
/** Pass as `pinnedTopRows`. */
|
|
23
|
+
pinnedTopRows: ReadonlyArray<TData>;
|
|
24
|
+
/** Pass as `data`. The pinned rows are REMOVED, so nothing renders twice. */
|
|
25
|
+
bodyRows: ReadonlyArray<TData>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Split a row array for a frozen-row count.
|
|
29
|
+
*
|
|
30
|
+
* ```svelte
|
|
31
|
+
* {@const split = splitFrozenRows(rows, freeze.rows)}
|
|
32
|
+
* <SvGrid data={split.bodyRows} pinnedTopRows={split.pinnedTopRows} ... />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function splitFrozenRows<TData>(rows: ReadonlyArray<TData>, count: number): FreezeSplit<TData>;
|
|
36
|
+
/** Column ids left of `cols`, which is what column pinning takes. */
|
|
37
|
+
export declare function frozenColumnIds(cmd: GridCommandContext, cols: number): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Apply both halves through the api and report the state: the columns pin,
|
|
40
|
+
* the rows freeze. Zero rows clears the row half.
|
|
41
|
+
*/
|
|
42
|
+
export declare function applyFreeze(cmd: GridCommandContext, state: FreezeState): FreezeState;
|
|
43
|
+
/**
|
|
44
|
+
* Excel's Freeze Panes: everything above and to the left of the active cell
|
|
45
|
+
* freezes. With the cursor on B3 you get two frozen rows and one frozen
|
|
46
|
+
* column.
|
|
47
|
+
*/
|
|
48
|
+
export declare function freezeAtActiveCell(cmd: GridCommandContext): FreezeState;
|
|
49
|
+
/** Freeze Top Row. */
|
|
50
|
+
export declare function freezeTopRow(cmd: GridCommandContext): FreezeState;
|
|
51
|
+
/** Freeze First Column. */
|
|
52
|
+
export declare function freezeFirstColumn(cmd: GridCommandContext): FreezeState;
|
|
53
|
+
/** Unfreeze everything. */
|
|
54
|
+
export declare function unfreeze(cmd: GridCommandContext): FreezeState;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split a row array for a frozen-row count.
|
|
3
|
+
*
|
|
4
|
+
* ```svelte
|
|
5
|
+
* {@const split = splitFrozenRows(rows, freeze.rows)}
|
|
6
|
+
* <SvGrid data={split.bodyRows} pinnedTopRows={split.pinnedTopRows} ... />
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export function splitFrozenRows(rows, count) {
|
|
10
|
+
const n = Math.max(0, Math.min(Math.floor(count), rows.length));
|
|
11
|
+
if (n === 0)
|
|
12
|
+
return { pinnedTopRows: [], bodyRows: rows };
|
|
13
|
+
return { pinnedTopRows: rows.slice(0, n), bodyRows: rows.slice(n) };
|
|
14
|
+
}
|
|
15
|
+
/** Column ids left of `cols`, which is what column pinning takes. */
|
|
16
|
+
export function frozenColumnIds(cmd, cols) {
|
|
17
|
+
const out = [];
|
|
18
|
+
for (let c = 0; c < Math.min(cols, cmd.colCount); c += 1) {
|
|
19
|
+
const id = cmd.columnIdAt(c);
|
|
20
|
+
if (id !== null)
|
|
21
|
+
out.push(id);
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Apply both halves through the api and report the state: the columns pin,
|
|
27
|
+
* the rows freeze. Zero rows clears the row half.
|
|
28
|
+
*/
|
|
29
|
+
export function applyFreeze(cmd, state) {
|
|
30
|
+
const api = cmd.api;
|
|
31
|
+
api.setColumnPinning?.({ left: frozenColumnIds(cmd, state.cols) });
|
|
32
|
+
api.setOption?.('frozenRows', state.rows > 0 ? state.rows : undefined);
|
|
33
|
+
return state;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Excel's Freeze Panes: everything above and to the left of the active cell
|
|
37
|
+
* freezes. With the cursor on B3 you get two frozen rows and one frozen
|
|
38
|
+
* column.
|
|
39
|
+
*/
|
|
40
|
+
export function freezeAtActiveCell(cmd) {
|
|
41
|
+
const active = cmd.activeCell;
|
|
42
|
+
const state = active
|
|
43
|
+
? { rows: active.rowIndex, cols: active.colIndex }
|
|
44
|
+
: { rows: 0, cols: 0 };
|
|
45
|
+
return applyFreeze(cmd, state);
|
|
46
|
+
}
|
|
47
|
+
/** Freeze Top Row. */
|
|
48
|
+
export function freezeTopRow(cmd) {
|
|
49
|
+
return applyFreeze(cmd, { rows: 1, cols: 0 });
|
|
50
|
+
}
|
|
51
|
+
/** Freeze First Column. */
|
|
52
|
+
export function freezeFirstColumn(cmd) {
|
|
53
|
+
return applyFreeze(cmd, { rows: 0, cols: 1 });
|
|
54
|
+
}
|
|
55
|
+
/** Unfreeze everything. */
|
|
56
|
+
export function unfreeze(cmd) {
|
|
57
|
+
return applyFreeze(cmd, { rows: 0, cols: 0 });
|
|
58
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type FunctionGroup = 'Math' | 'Statistical' | 'Logical' | 'Information' | 'Text' | 'Date & Time' | 'Lookup & Reference' | 'Other';
|
|
2
|
+
export type FunctionInfo = {
|
|
3
|
+
name: string;
|
|
4
|
+
group: FunctionGroup;
|
|
5
|
+
signature: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const FUNCTION_GROUPS: ReadonlyArray<FunctionGroup>;
|
|
9
|
+
/** Every function the engine knows, described, alphabetical. */
|
|
10
|
+
export declare function functionCatalog(): FunctionInfo[];
|