@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,409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workbook: several named sheets that can read each other.
|
|
3
|
+
*
|
|
4
|
+
* The engine already parsed `Orders!A1` and `'Price list'!A1:C9` from the day
|
|
5
|
+
* it was promoted, because demo 119 had them. What was missing is the thing
|
|
6
|
+
* those references point AT. This is that model, plus the recalculation that
|
|
7
|
+
* has to span sheets once they can.
|
|
8
|
+
*
|
|
9
|
+
* Cells hold raw text and nothing else. Everything derived - the computed
|
|
10
|
+
* value, the dependency edges, the display string - is recomputed from it, so
|
|
11
|
+
* there is exactly one copy of the truth and no way for a cached value to
|
|
12
|
+
* disagree with the formula above it.
|
|
13
|
+
*/
|
|
14
|
+
import { parseFormula } from './parse.js';
|
|
15
|
+
import { evaluate, rangeValues } from './evaluate.js';
|
|
16
|
+
import { withCustomFunctions } from './functions.js';
|
|
17
|
+
import { isError } from './ast.js';
|
|
18
|
+
import { createDependencyGraph, precedentsOf, cellKey } from './deps.js';
|
|
19
|
+
import { createNames } from './names.js';
|
|
20
|
+
import { fixupReferences, renameSheetReferences } from './refs.js';
|
|
21
|
+
/** A name Excel would accept for a sheet. */
|
|
22
|
+
export function isValidSheetName(name) {
|
|
23
|
+
if (name.trim() === '' || name.length > 31)
|
|
24
|
+
return false;
|
|
25
|
+
// Excel forbids these because they are the reference grammar.
|
|
26
|
+
return !/[:\\/?*[\]]/.test(name);
|
|
27
|
+
}
|
|
28
|
+
/** `Sheet1`, `Sheet2`, ... skipping any that already exist. */
|
|
29
|
+
function nextSheetName(taken) {
|
|
30
|
+
const used = new Set(taken.map((n) => n.toLowerCase()));
|
|
31
|
+
for (let i = 1;; i += 1) {
|
|
32
|
+
const candidate = `Sheet${i}`;
|
|
33
|
+
if (!used.has(candidate.toLowerCase()))
|
|
34
|
+
return candidate;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function createWorkbook(initial = [{ name: 'Sheet1', cells: [] }], options = {}) {
|
|
38
|
+
const order = [];
|
|
39
|
+
const byName = new Map();
|
|
40
|
+
const graph = createDependencyGraph();
|
|
41
|
+
const functions = withCustomFunctions(options.functions);
|
|
42
|
+
/** Computed values, keyed the same way the graph is. Rebuilt lazily and
|
|
43
|
+
* invalidated by every write, so it can never hold a value whose formula
|
|
44
|
+
* has since changed. */
|
|
45
|
+
const values = new Map();
|
|
46
|
+
/** Cells currently being resolved, for cycle detection. */
|
|
47
|
+
const visiting = new Set();
|
|
48
|
+
/** Parsed formulas, keyed by their TEXT rather than their position: a
|
|
49
|
+
* column of =A1*2 filled down is one parse, not one per row. */
|
|
50
|
+
const astCache = new Map();
|
|
51
|
+
// Changing what a name refers to changes every formula that uses it, and
|
|
52
|
+
// the dependency graph only knows the CELLS a name pointed at when the
|
|
53
|
+
// formula was last evaluated. Dropping the cache is the honest answer:
|
|
54
|
+
// names change rarely, and a full recompute costs less than one stale total.
|
|
55
|
+
const names = (() => {
|
|
56
|
+
const inner = createNames();
|
|
57
|
+
const drop = () => { values.clear(); graph.clear(); };
|
|
58
|
+
return {
|
|
59
|
+
...inner,
|
|
60
|
+
define: (name, refersTo) => { inner.define(name, refersTo); drop(); },
|
|
61
|
+
remove: (name) => { inner.remove(name); drop(); },
|
|
62
|
+
hydrate: (entries) => { inner.hydrate(entries); drop(); },
|
|
63
|
+
clear: () => { inner.clear(); drop(); },
|
|
64
|
+
};
|
|
65
|
+
})();
|
|
66
|
+
let active = '';
|
|
67
|
+
function sheetCells(name) {
|
|
68
|
+
return byName.get(name.toLowerCase());
|
|
69
|
+
}
|
|
70
|
+
/** Resolve a sheet reference. A null sheet means the one being evaluated,
|
|
71
|
+
* which the resolver tracks as it descends. */
|
|
72
|
+
function resolveSheetName(sheet, self) {
|
|
73
|
+
return sheet ?? self;
|
|
74
|
+
}
|
|
75
|
+
function parseCached(text) {
|
|
76
|
+
if (astCache.has(text))
|
|
77
|
+
return astCache.get(text) ?? null;
|
|
78
|
+
let ast;
|
|
79
|
+
try {
|
|
80
|
+
ast = parseFormula(text);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
ast = null;
|
|
84
|
+
}
|
|
85
|
+
astCache.set(text, ast);
|
|
86
|
+
return ast;
|
|
87
|
+
}
|
|
88
|
+
function contextFor(self, override) {
|
|
89
|
+
return {
|
|
90
|
+
resolve: (sheet, row, col) => {
|
|
91
|
+
const name = resolveSheetName(sheet, self);
|
|
92
|
+
// A validation rule reads the cell it is checking as the text being
|
|
93
|
+
// entered, which is not in the sheet yet; nothing else is overridden.
|
|
94
|
+
if (override && name === self && row === override.row && col === override.col)
|
|
95
|
+
return literal(override.text);
|
|
96
|
+
return compute(name, row, col);
|
|
97
|
+
},
|
|
98
|
+
lastRow: (sheet) => Math.max(rowCount(resolveSheetName(sheet, self)) - 1, 0),
|
|
99
|
+
resolveNameNode: (name) => names.resolve(name),
|
|
100
|
+
functions,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compute(sheet, row, col) {
|
|
104
|
+
const cells = sheetCells(sheet);
|
|
105
|
+
if (!cells)
|
|
106
|
+
return { error: '#REF!' };
|
|
107
|
+
if (row < 0 || col < 0)
|
|
108
|
+
return { error: '#REF!' };
|
|
109
|
+
// Anything past the written area is BLANK. A sheet has no size in this
|
|
110
|
+
// model beyond what has been typed into it, so there is no edge to fall
|
|
111
|
+
// off: =SUM(A1:A100) over a twelve-row sheet is an ordinary thing to
|
|
112
|
+
// write, and returning #REF! for the empty rows would poison the total.
|
|
113
|
+
//
|
|
114
|
+
// #REF! is reserved for the two cases that really are broken: a sheet
|
|
115
|
+
// that does not exist, and a negative index, which is what a reference
|
|
116
|
+
// shifted off the top by a delete becomes.
|
|
117
|
+
if (row >= cells.length || col >= (cells[row]?.length ?? 0))
|
|
118
|
+
return '';
|
|
119
|
+
const key = cellKey(sheet, row, col);
|
|
120
|
+
const cached = values.get(key);
|
|
121
|
+
if (cached !== undefined)
|
|
122
|
+
return cached;
|
|
123
|
+
if (visiting.has(key))
|
|
124
|
+
return { error: '#CYCLE!' };
|
|
125
|
+
visiting.add(key);
|
|
126
|
+
const text = (cells[row]?.[col] ?? '').trim();
|
|
127
|
+
let value;
|
|
128
|
+
if (text === '') {
|
|
129
|
+
value = '';
|
|
130
|
+
}
|
|
131
|
+
else if (text.startsWith('=')) {
|
|
132
|
+
const ast = parseCached(text);
|
|
133
|
+
if (!ast)
|
|
134
|
+
value = { error: '#PARSE!' };
|
|
135
|
+
else {
|
|
136
|
+
value = evaluate(ast, contextFor(sheet));
|
|
137
|
+
graph.setPrecedents(key, precedentsOf(ast, { sheet }, (s) => Math.max(rowCount(s ?? sheet) - 1, 0), (name) => names.resolve(name)));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const n = Number(text);
|
|
142
|
+
const upper = text.toUpperCase();
|
|
143
|
+
value = text !== '' && Number.isFinite(n) ? n
|
|
144
|
+
: upper === 'TRUE' ? true
|
|
145
|
+
: upper === 'FALSE' ? false
|
|
146
|
+
: text;
|
|
147
|
+
}
|
|
148
|
+
visiting.delete(key);
|
|
149
|
+
values.set(key, value);
|
|
150
|
+
return value;
|
|
151
|
+
}
|
|
152
|
+
/** What typed text is worth when it is not a formula: a number, a boolean or itself. */
|
|
153
|
+
function literal(text) {
|
|
154
|
+
const t = text.trim();
|
|
155
|
+
if (t === '')
|
|
156
|
+
return '';
|
|
157
|
+
if (t.startsWith('='))
|
|
158
|
+
return t;
|
|
159
|
+
const n = Number(t);
|
|
160
|
+
const upper = t.toUpperCase();
|
|
161
|
+
return Number.isFinite(n) ? n : upper === 'TRUE' ? true : upper === 'FALSE' ? false : t;
|
|
162
|
+
}
|
|
163
|
+
function rowCount(sheet) {
|
|
164
|
+
return sheetCells(sheet)?.length ?? 0;
|
|
165
|
+
}
|
|
166
|
+
function colCount(sheet) {
|
|
167
|
+
const cells = sheetCells(sheet);
|
|
168
|
+
if (!cells)
|
|
169
|
+
return 0;
|
|
170
|
+
return cells.reduce((max, row) => Math.max(max, row.length), 0);
|
|
171
|
+
}
|
|
172
|
+
/** Drop cached values for a cell and everything downstream of it. */
|
|
173
|
+
function invalidate(keys) {
|
|
174
|
+
const touched = [...keys];
|
|
175
|
+
for (const key of keys)
|
|
176
|
+
values.delete(key);
|
|
177
|
+
for (const key of graph.dirtyFrom(keys)) {
|
|
178
|
+
values.delete(key);
|
|
179
|
+
touched.push(key);
|
|
180
|
+
}
|
|
181
|
+
return touched;
|
|
182
|
+
}
|
|
183
|
+
function reportRecalc(keys) {
|
|
184
|
+
const cb = options.onRecalc;
|
|
185
|
+
if (!cb || keys.length === 0)
|
|
186
|
+
return;
|
|
187
|
+
cb(keys.map((key) => {
|
|
188
|
+
const gap = key.indexOf(' ');
|
|
189
|
+
const gap2 = key.indexOf(' ', gap + 1);
|
|
190
|
+
const row = Number(key.slice(0, gap));
|
|
191
|
+
const col = Number(key.slice(gap + 1, gap2));
|
|
192
|
+
const sheet = key.slice(gap2 + 1);
|
|
193
|
+
return { sheet, row, col, value: compute(sheet, row, col) };
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
const workbook = {
|
|
197
|
+
get sheets() { return [...order]; },
|
|
198
|
+
get active() { return active; },
|
|
199
|
+
get names() { return names; },
|
|
200
|
+
setActive(name) {
|
|
201
|
+
if (sheetCells(name))
|
|
202
|
+
active = order.find((n) => n.toLowerCase() === name.toLowerCase()) ?? active;
|
|
203
|
+
},
|
|
204
|
+
addSheet(name, at) {
|
|
205
|
+
const chosen = name ?? nextSheetName(order);
|
|
206
|
+
if (!isValidSheetName(chosen)) {
|
|
207
|
+
throw new Error(`"${chosen}" is not a valid sheet name: it must be 1 to 31 characters and must not contain : \\ / ? * [ ]`);
|
|
208
|
+
}
|
|
209
|
+
if (sheetCells(chosen))
|
|
210
|
+
throw new Error(`a sheet named "${chosen}" already exists`);
|
|
211
|
+
byName.set(chosen.toLowerCase(), []);
|
|
212
|
+
const index = at === undefined ? order.length : Math.max(0, Math.min(at, order.length));
|
|
213
|
+
order.splice(index, 0, chosen);
|
|
214
|
+
active = chosen;
|
|
215
|
+
return chosen;
|
|
216
|
+
},
|
|
217
|
+
removeSheet(name) {
|
|
218
|
+
const index = order.findIndex((n) => n.toLowerCase() === name.toLowerCase());
|
|
219
|
+
// A workbook with no sheets has nowhere to put the cursor, and Excel
|
|
220
|
+
// refuses the same way.
|
|
221
|
+
if (index < 0 || order.length <= 1)
|
|
222
|
+
return false;
|
|
223
|
+
const [removed] = order.splice(index, 1);
|
|
224
|
+
byName.delete(removed.toLowerCase());
|
|
225
|
+
// Every cached value may have read the sheet that just went.
|
|
226
|
+
values.clear();
|
|
227
|
+
graph.clear();
|
|
228
|
+
if (active.toLowerCase() === removed.toLowerCase()) {
|
|
229
|
+
active = order[Math.min(index, order.length - 1)] ?? order[0];
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
232
|
+
},
|
|
233
|
+
renameSheet(from, to) {
|
|
234
|
+
const index = order.findIndex((n) => n.toLowerCase() === from.toLowerCase());
|
|
235
|
+
if (index < 0 || !isValidSheetName(to))
|
|
236
|
+
return false;
|
|
237
|
+
if (from.toLowerCase() !== to.toLowerCase() && sheetCells(to))
|
|
238
|
+
return false;
|
|
239
|
+
const cells = sheetCells(from);
|
|
240
|
+
byName.delete(from.toLowerCase());
|
|
241
|
+
byName.set(to.toLowerCase(), cells);
|
|
242
|
+
order[index] = to;
|
|
243
|
+
if (active.toLowerCase() === from.toLowerCase())
|
|
244
|
+
active = to;
|
|
245
|
+
// Every formula and name that pointed at the old name points at the
|
|
246
|
+
// new one, as in Excel; otherwise =Orders!B2 on Summary read #REF!
|
|
247
|
+
// the moment Orders became Sales. The rewrite goes through the parser,
|
|
248
|
+
// so a string literal holding the old name is not touched.
|
|
249
|
+
for (const [, sheet] of byName) {
|
|
250
|
+
for (const line of sheet) {
|
|
251
|
+
for (let c = 0; c < line.length; c += 1) {
|
|
252
|
+
const next = renameSheetReferences(line[c], from, to);
|
|
253
|
+
if (typeof next === 'string')
|
|
254
|
+
line[c] = next;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
for (const entry of names.list()) {
|
|
259
|
+
const next = renameSheetReferences(entry.refersTo, from, to);
|
|
260
|
+
if (typeof next === 'string' && next !== entry.refersTo)
|
|
261
|
+
names.define(entry.name, next);
|
|
262
|
+
}
|
|
263
|
+
values.clear();
|
|
264
|
+
graph.clear();
|
|
265
|
+
return true;
|
|
266
|
+
},
|
|
267
|
+
moveSheet(name, to) {
|
|
268
|
+
const index = order.findIndex((n) => n.toLowerCase() === name.toLowerCase());
|
|
269
|
+
if (index < 0)
|
|
270
|
+
return false;
|
|
271
|
+
const [moved] = order.splice(index, 1);
|
|
272
|
+
order.splice(Math.max(0, Math.min(to, order.length)), 0, moved);
|
|
273
|
+
return true;
|
|
274
|
+
},
|
|
275
|
+
getRaw(sheet, row, col) {
|
|
276
|
+
return sheetCells(sheet)?.[row]?.[col] ?? '';
|
|
277
|
+
},
|
|
278
|
+
setRaw(sheet, row, col, text) {
|
|
279
|
+
const cells = sheetCells(sheet);
|
|
280
|
+
if (!cells || row < 0 || col < 0)
|
|
281
|
+
return;
|
|
282
|
+
while (cells.length <= row)
|
|
283
|
+
cells.push([]);
|
|
284
|
+
const line = cells[row];
|
|
285
|
+
while (line.length <= col)
|
|
286
|
+
line.push('');
|
|
287
|
+
if (line[col] === text)
|
|
288
|
+
return;
|
|
289
|
+
line[col] = text;
|
|
290
|
+
const key = cellKey(sheet, row, col);
|
|
291
|
+
// A cell that is no longer a formula reads nothing.
|
|
292
|
+
if (!text.trim().startsWith('='))
|
|
293
|
+
graph.setPrecedents(key, null);
|
|
294
|
+
reportRecalc(invalidate([key]));
|
|
295
|
+
},
|
|
296
|
+
getValue(sheet, row, col) {
|
|
297
|
+
return compute(sheet, row, col);
|
|
298
|
+
},
|
|
299
|
+
evaluateText(sheet, text, override) {
|
|
300
|
+
const t = text.trim();
|
|
301
|
+
if (t === '')
|
|
302
|
+
return '';
|
|
303
|
+
if (t.startsWith('=')) {
|
|
304
|
+
if (!sheetCells(sheet))
|
|
305
|
+
return { error: '#REF!' };
|
|
306
|
+
const ast = parseCached(t);
|
|
307
|
+
return ast ? evaluate(ast, contextFor(sheet, override)) : { error: '#PARSE!' };
|
|
308
|
+
}
|
|
309
|
+
return literal(t);
|
|
310
|
+
},
|
|
311
|
+
evaluateRange(sheet, text) {
|
|
312
|
+
const t = text.trim();
|
|
313
|
+
if (!t.startsWith('=') || !sheetCells(sheet))
|
|
314
|
+
return null;
|
|
315
|
+
const ast = parseCached(t);
|
|
316
|
+
return ast ? rangeValues(ast, contextFor(sheet)) : null;
|
|
317
|
+
},
|
|
318
|
+
snapshot(sheet) {
|
|
319
|
+
const rows = rowCount(sheet);
|
|
320
|
+
const cols = colCount(sheet);
|
|
321
|
+
const out = [];
|
|
322
|
+
for (let r = 0; r < rows; r += 1) {
|
|
323
|
+
const line = [];
|
|
324
|
+
for (let c = 0; c < cols; c += 1)
|
|
325
|
+
line.push(compute(sheet, r, c));
|
|
326
|
+
out.push(line);
|
|
327
|
+
}
|
|
328
|
+
return out;
|
|
329
|
+
},
|
|
330
|
+
applyStructuralEdit(sheet, edit) {
|
|
331
|
+
const target = sheetCells(sheet);
|
|
332
|
+
if (!target || edit.count <= 0)
|
|
333
|
+
return;
|
|
334
|
+
// Rewrite every formula in the WORKBOOK, not just this sheet: another
|
|
335
|
+
// sheet may hold =Orders!A5, and inserting a row in Orders has to move
|
|
336
|
+
// it exactly as if it were local.
|
|
337
|
+
for (const other of order) {
|
|
338
|
+
const cells = sheetCells(other);
|
|
339
|
+
for (let r = 0; r < cells.length; r += 1) {
|
|
340
|
+
const line = cells[r];
|
|
341
|
+
for (let c = 0; c < line.length; c += 1) {
|
|
342
|
+
const text = line[c] ?? '';
|
|
343
|
+
if (!text.startsWith('='))
|
|
344
|
+
continue;
|
|
345
|
+
// Only references INTO this sheet move: an unqualified one on
|
|
346
|
+
// another sheet belongs to that sheet's geometry, which did not
|
|
347
|
+
// change, and a reference on THIS sheet that names another sheet
|
|
348
|
+
// belongs to that one. The scope tells the rewriter both.
|
|
349
|
+
if (other !== sheet && !text.includes(`${sheet}!`) && !text.includes(`'${sheet}'!`))
|
|
350
|
+
continue;
|
|
351
|
+
const next = fixupReferences(text, edit, { sheet, self: other });
|
|
352
|
+
if (typeof next === 'string')
|
|
353
|
+
line[c] = next;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// A name has no home sheet, so only one that names this sheet moves.
|
|
358
|
+
// NetSales = Orders!$I$2:$I$25 must not shift because a column went
|
|
359
|
+
// into Summary.
|
|
360
|
+
for (const entry of names.list()) {
|
|
361
|
+
const next = fixupReferences(entry.refersTo, edit, { sheet, self: null });
|
|
362
|
+
if (typeof next === 'string' && next !== entry.refersTo)
|
|
363
|
+
names.define(entry.name, next);
|
|
364
|
+
}
|
|
365
|
+
const blankRow = () => [];
|
|
366
|
+
if (edit.kind === 'insertRows') {
|
|
367
|
+
target.splice(edit.at, 0, ...Array.from({ length: edit.count }, blankRow));
|
|
368
|
+
}
|
|
369
|
+
else if (edit.kind === 'deleteRows') {
|
|
370
|
+
target.splice(edit.at, edit.count);
|
|
371
|
+
}
|
|
372
|
+
else if (edit.kind === 'insertCols') {
|
|
373
|
+
for (const line of target) {
|
|
374
|
+
if (line.length >= edit.at)
|
|
375
|
+
line.splice(edit.at, 0, ...Array(edit.count).fill(''));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
for (const line of target) {
|
|
380
|
+
if (line.length > edit.at)
|
|
381
|
+
line.splice(edit.at, edit.count);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
values.clear();
|
|
385
|
+
graph.clear();
|
|
386
|
+
astCache.clear();
|
|
387
|
+
},
|
|
388
|
+
recalculate() {
|
|
389
|
+
values.clear();
|
|
390
|
+
graph.clear();
|
|
391
|
+
},
|
|
392
|
+
rowCount,
|
|
393
|
+
colCount,
|
|
394
|
+
serialize() {
|
|
395
|
+
return {
|
|
396
|
+
sheets: order.map((name) => ({ name, cells: sheetCells(name).map((r) => [...r]) })),
|
|
397
|
+
active,
|
|
398
|
+
names: names.serialize(),
|
|
399
|
+
};
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
for (const sheet of initial.length > 0 ? initial : [{ name: 'Sheet1', cells: [] }]) {
|
|
403
|
+
byName.set(sheet.name.toLowerCase(), sheet.cells.map((r) => [...r]));
|
|
404
|
+
order.push(sheet.name);
|
|
405
|
+
}
|
|
406
|
+
active = order[0] ?? '';
|
|
407
|
+
return workbook;
|
|
408
|
+
}
|
|
409
|
+
export { isError };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register the Excel keymap. Idempotent - safe to call from every component
|
|
3
|
+
* that wants it, or once at app start. Also invoked by {@link installEnterprise}
|
|
4
|
+
* so wiring the Pro API turns the shortcuts on too.
|
|
5
|
+
*/
|
|
6
|
+
export declare function enableSheet(): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel keyboard commands (Pro). `enableSheet()` registers the sheet keymap
|
|
3
|
+
* with the grid, so Ctrl+Arrow jumps to the edge of a data region, Ctrl+D and
|
|
4
|
+
* Ctrl+R fill, Ctrl+A selects the current region, and the rest of the Excel
|
|
5
|
+
* muscle memory works on any `<SvGrid>` with cell selection on.
|
|
6
|
+
*
|
|
7
|
+
* The grid ships the `registerGridShortcuts` seam for free and interprets a key
|
|
8
|
+
* itself only when nothing claims it; the commands are here. Soft-gated like
|
|
9
|
+
* the rest of Enterprise: it works without a license key but the grid shows the
|
|
10
|
+
* unlicensed watermark and a one-time console nudge.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { setLicenseKey, enableSheet } from '@svgrid/enterprise'
|
|
14
|
+
* setLicenseKey('YOUR-KEY')
|
|
15
|
+
* enableSheet()
|
|
16
|
+
* // then: <SvGrid {data} {columns} enableCellSelection />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// The Svelte-free subpath: importing the barrel would drag SvGrid.svelte into
|
|
20
|
+
// this module's chunk, and into any unit test that touches it.
|
|
21
|
+
import { registerGridShortcuts } from '@svgrid/grid/shortcuts';
|
|
22
|
+
import { isLicenseKeySet } from './license.js';
|
|
23
|
+
import { emitUnlicensedNudge } from './watermark.js';
|
|
24
|
+
import { handleSheetKey } from './sheet/shortcuts.js';
|
|
25
|
+
import { setFillTranslator } from './sheet/commands.js';
|
|
26
|
+
import { translateFormula } from './sheet/refs.js';
|
|
27
|
+
let enabled = false;
|
|
28
|
+
/**
|
|
29
|
+
* Register the Excel keymap. Idempotent - safe to call from every component
|
|
30
|
+
* that wants it, or once at app start. Also invoked by {@link installEnterprise}
|
|
31
|
+
* so wiring the Pro API turns the shortcuts on too.
|
|
32
|
+
*/
|
|
33
|
+
export function enableSheet() {
|
|
34
|
+
if (enabled)
|
|
35
|
+
return;
|
|
36
|
+
enabled = true;
|
|
37
|
+
// Priority 100 so the sheet keymap sits above anything an app registers of
|
|
38
|
+
// its own without asking for a priority.
|
|
39
|
+
registerGridShortcuts(handleSheetKey, { id: 'svgrid-sheet', priority: 100 });
|
|
40
|
+
// Teach fill about formulas. Without this Ctrl+D copies '=A1*2' down as
|
|
41
|
+
// literal text into every row; with it the relative half of each reference
|
|
42
|
+
// shifts and the absolute half does not, the way Excel fills.
|
|
43
|
+
setFillTranslator((value, delta) => translateFormula(value, delta.rows, delta.cols));
|
|
44
|
+
if (!isLicenseKeySet())
|
|
45
|
+
emitUnlicensedNudge();
|
|
46
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* consumes either.
|
|
7
7
|
*/
|
|
8
8
|
import type { RowData, ServerFilterModel } from '@svgrid/grid';
|
|
9
|
-
import type { EntitySchema } from '../schema';
|
|
9
|
+
import type { EntitySchema } from '../schema.js';
|
|
10
10
|
export type AggregateReduce = 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
11
11
|
export type AggregateRequest = {
|
|
12
12
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* await auth.signIn(email, password)
|
|
10
10
|
* // ... auth.signOut(); auth.dispose() on unmount
|
|
11
11
|
*/
|
|
12
|
-
import { nudgeEnterprise } from '../license';
|
|
12
|
+
import { nudgeEnterprise } from '../license.js';
|
|
13
13
|
const userOf = (session) => session?.user ? { id: session.user.id, email: session.user.email } : null;
|
|
14
14
|
export function createSupabaseAuth(config) {
|
|
15
15
|
nudgeEnterprise('Studio'); // soft-gate; never blocks
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* / `getAggregate` seam), so nothing here re-implements aggregation.
|
|
8
8
|
*/
|
|
9
9
|
import type { RowData } from '@svgrid/grid';
|
|
10
|
-
import type { EntitySchema } from '../schema';
|
|
11
|
-
import { type AggregateReduce } from './aggregate';
|
|
10
|
+
import type { EntitySchema } from '../schema.js';
|
|
11
|
+
import { type AggregateReduce } from './aggregate.js';
|
|
12
12
|
import type { ChartType } from '@svgrid/grid';
|
|
13
13
|
/** A single-number tile: reduce `measure` over the rows (count ignores measure). */
|
|
14
14
|
export type KpiWidget = {
|
package/dist/sources/index.d.ts
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* `ServerDataSource` over a specific backend, so the grid, edit form, sorting,
|
|
4
4
|
* filtering, and paging work identically regardless of where the data lives.
|
|
5
5
|
*/
|
|
6
|
-
export { normalizeFilters, type NormalizedFilter, type NormalizedPredicate } from './filters';
|
|
7
|
-
export { buildEntitySchema, pickLabelField, linkRelationLabels, type IntrospectedColumn, type ColumnReference, } from './schema-from-columns';
|
|
8
|
-
export { createSupabaseDataSource, type SupabaseDataSourceConfig, type SupabaseClientLike } from './supabase';
|
|
9
|
-
export { createRestDataSource, type RestDataSourceConfig } from './rest';
|
|
10
|
-
export { offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, type RestAdapter, type OffsetLimitOptions, } from './rest-adapters';
|
|
11
|
-
export { introspectSupabaseTable, listSupabaseTables, type IntrospectSupabaseOptions } from './introspect-supabase';
|
|
12
|
-
export { createSupabaseRealtime, type SupabaseRealtimeConfig, type SupabaseRealtimeClientLike, type SupabaseRealtimeHandle, type RealtimeChannelLike, type RealtimeChange, } from './realtime-supabase';
|
|
13
|
-
export { createRelationLookup, type RelationLookup, type RelationLookupConfig, type RelationOption, } from './relation-lookup';
|
|
14
|
-
export { createSupabaseAuth, type SupabaseAuthConfig, type SupabaseAuthController, type SupabaseAuthClientLike, type AuthState, type AuthUser, } from './auth-supabase';
|
|
15
|
-
export { aggregateRows, chartFieldsFromSchema, type AggregateReduce, type AggregateRequest, type AggregateBucket, type AggregateSource, } from './aggregate';
|
|
16
|
-
export { withEntityRules } from './with-entity-rules';
|
|
17
|
-
export { withRelationLabels, type RelationLabelConfig } from './with-relation-labels';
|
|
18
|
-
export { reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, type DashboardSpec, type DashboardWidget, type KpiWidget, type ChartWidget, } from './dashboard';
|
|
6
|
+
export { normalizeFilters, type NormalizedFilter, type NormalizedPredicate } from './filters.js';
|
|
7
|
+
export { buildEntitySchema, pickLabelField, linkRelationLabels, type IntrospectedColumn, type ColumnReference, } from './schema-from-columns.js';
|
|
8
|
+
export { createSupabaseDataSource, type SupabaseDataSourceConfig, type SupabaseClientLike } from './supabase.js';
|
|
9
|
+
export { createRestDataSource, type RestDataSourceConfig } from './rest.js';
|
|
10
|
+
export { offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, type RestAdapter, type OffsetLimitOptions, } from './rest-adapters.js';
|
|
11
|
+
export { introspectSupabaseTable, listSupabaseTables, type IntrospectSupabaseOptions } from './introspect-supabase.js';
|
|
12
|
+
export { createSupabaseRealtime, type SupabaseRealtimeConfig, type SupabaseRealtimeClientLike, type SupabaseRealtimeHandle, type RealtimeChannelLike, type RealtimeChange, } from './realtime-supabase.js';
|
|
13
|
+
export { createRelationLookup, type RelationLookup, type RelationLookupConfig, type RelationOption, } from './relation-lookup.js';
|
|
14
|
+
export { createSupabaseAuth, type SupabaseAuthConfig, type SupabaseAuthController, type SupabaseAuthClientLike, type AuthState, type AuthUser, } from './auth-supabase.js';
|
|
15
|
+
export { aggregateRows, chartFieldsFromSchema, type AggregateReduce, type AggregateRequest, type AggregateBucket, type AggregateSource, } from './aggregate.js';
|
|
16
|
+
export { withEntityRules } from './with-entity-rules.js';
|
|
17
|
+
export { withRelationLabels, type RelationLabelConfig } from './with-relation-labels.js';
|
|
18
|
+
export { reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, type DashboardSpec, type DashboardWidget, type KpiWidget, type ChartWidget, } from './dashboard.js';
|
package/dist/sources/index.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* `ServerDataSource` over a specific backend, so the grid, edit form, sorting,
|
|
4
4
|
* filtering, and paging work identically regardless of where the data lives.
|
|
5
5
|
*/
|
|
6
|
-
export { normalizeFilters } from './filters';
|
|
7
|
-
export { buildEntitySchema, pickLabelField, linkRelationLabels, } from './schema-from-columns';
|
|
8
|
-
export { createSupabaseDataSource } from './supabase';
|
|
9
|
-
export { createRestDataSource } from './rest';
|
|
10
|
-
export { offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, } from './rest-adapters';
|
|
11
|
-
export { introspectSupabaseTable, listSupabaseTables } from './introspect-supabase';
|
|
12
|
-
export { createSupabaseRealtime, } from './realtime-supabase';
|
|
13
|
-
export { createRelationLookup, } from './relation-lookup';
|
|
14
|
-
export { createSupabaseAuth, } from './auth-supabase';
|
|
15
|
-
export { aggregateRows, chartFieldsFromSchema, } from './aggregate';
|
|
16
|
-
export { withEntityRules } from './with-entity-rules';
|
|
17
|
-
export { withRelationLabels } from './with-relation-labels';
|
|
18
|
-
export { reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, } from './dashboard';
|
|
6
|
+
export { normalizeFilters } from './filters.js';
|
|
7
|
+
export { buildEntitySchema, pickLabelField, linkRelationLabels, } from './schema-from-columns.js';
|
|
8
|
+
export { createSupabaseDataSource } from './supabase.js';
|
|
9
|
+
export { createRestDataSource } from './rest.js';
|
|
10
|
+
export { offsetLimitAdapter, dummyJsonAdapter, jsonServerAdapter, } from './rest-adapters.js';
|
|
11
|
+
export { introspectSupabaseTable, listSupabaseTables } from './introspect-supabase.js';
|
|
12
|
+
export { createSupabaseRealtime, } from './realtime-supabase.js';
|
|
13
|
+
export { createRelationLookup, } from './relation-lookup.js';
|
|
14
|
+
export { createSupabaseAuth, } from './auth-supabase.js';
|
|
15
|
+
export { aggregateRows, chartFieldsFromSchema, } from './aggregate.js';
|
|
16
|
+
export { withEntityRules } from './with-entity-rules.js';
|
|
17
|
+
export { withRelationLabels } from './with-relation-labels.js';
|
|
18
|
+
export { reduceValue, kpiSeries, sparklinePoints, seriesDelta, formatKpiValue, dashboardFromSchema, } from './dashboard.js';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* coalesce bursts into a single refetch. For per-row effects (e.g. flashing a
|
|
18
18
|
* changed row) read the normalized event passed to `onChange`.
|
|
19
19
|
*/
|
|
20
|
-
import { nudgeEnterprise } from '../license';
|
|
20
|
+
import { nudgeEnterprise } from '../license.js';
|
|
21
21
|
export function createSupabaseRealtime(config) {
|
|
22
22
|
nudgeEnterprise('Studio'); // soft-gate; never blocks
|
|
23
23
|
const schema = config.schema ?? 'public';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* `companyId` relation field renders a searchable picker instead of a raw input.
|
|
18
18
|
*/
|
|
19
19
|
import type { RowData, ServerDataSource } from '@svgrid/grid';
|
|
20
|
-
import { type EntitySchema } from '../schema';
|
|
20
|
+
import { type EntitySchema } from '../schema.js';
|
|
21
21
|
export type RelationOption = {
|
|
22
22
|
value: string;
|
|
23
23
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveIdField } from '../schema';
|
|
1
|
+
import { resolveIdField } from '../schema.js';
|
|
2
2
|
export function createRelationLookup(config) {
|
|
3
3
|
const pageSize = config.pageSize ?? 20;
|
|
4
4
|
const valueField = config.valueField ?? (config.schema ? resolveIdField(config.schema) : 'id');
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `jsonServerAdapter` are ready-made presets for two very common shapes.
|
|
13
13
|
*/
|
|
14
14
|
import type { RowData } from '@svgrid/grid';
|
|
15
|
-
import type { RestDataSourceConfig } from './rest';
|
|
15
|
+
import type { RestDataSourceConfig } from './rest.js';
|
|
16
16
|
/** The parts of a REST config that describe a backend's wire format. */
|
|
17
17
|
export type RestAdapter<TData extends RowData> = Required<Pick<RestDataSourceConfig<TData>, 'buildQuery' | 'parse'>>;
|
|
18
18
|
export type OffsetLimitOptions = {
|
package/dist/sources/rest.d.ts
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* where `sort` is a comma list with `-` for descending (e.g. `-createdAt,name`).
|
|
16
16
|
*/
|
|
17
17
|
import type { RowData, ServerRequest, ServerResult } from '@svgrid/grid';
|
|
18
|
-
import { type EntitySchema } from '../schema';
|
|
19
|
-
import type { WritableDataSource } from '../sveltekit/types';
|
|
18
|
+
import { type EntitySchema } from '../schema.js';
|
|
19
|
+
import type { WritableDataSource } from '../sveltekit/types.js';
|
|
20
20
|
export type RestDataSourceConfig<TData extends RowData> = {
|
|
21
21
|
/** Collection endpoint, e.g. `/api/customers`. */
|
|
22
22
|
url: string;
|
package/dist/sources/rest.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveIdField } from '../schema';
|
|
2
|
-
import { nudgeEnterprise } from '../license';
|
|
3
|
-
import { normalizeFilters } from './filters';
|
|
1
|
+
import { resolveIdField } from '../schema.js';
|
|
2
|
+
import { nudgeEnterprise } from '../license.js';
|
|
3
|
+
import { normalizeFilters } from './filters.js';
|
|
4
4
|
const encodePredicate = (p) => {
|
|
5
5
|
if (p.op === 'in')
|
|
6
6
|
return `in:${p.values.join(',')}`;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* stripped from inserts (it's database-generated).
|
|
14
14
|
*/
|
|
15
15
|
import type { RowData } from '@svgrid/grid';
|
|
16
|
-
import { type EntitySchema } from '../schema';
|
|
17
|
-
import type { WritableDataSource } from '../sveltekit/types';
|
|
16
|
+
import { type EntitySchema } from '../schema.js';
|
|
17
|
+
import type { WritableDataSource } from '../sveltekit/types.js';
|
|
18
18
|
/** The slice of a `supabase-js` client this adapter needs. */
|
|
19
19
|
export type SupabaseClientLike = {
|
|
20
20
|
from(table: string): any;
|
package/dist/sources/supabase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveIdField } from '../schema';
|
|
2
|
-
import { nudgeEnterprise } from '../license';
|
|
3
|
-
import { normalizeFilters } from './filters';
|
|
1
|
+
import { resolveIdField } from '../schema.js';
|
|
2
|
+
import { nudgeEnterprise } from '../license.js';
|
|
3
|
+
import { normalizeFilters } from './filters.js';
|
|
4
4
|
const sanitize = (term) => term.replace(/[%,()]/g, '');
|
|
5
5
|
export function createSupabaseDataSource(config) {
|
|
6
6
|
nudgeEnterprise('Studio'); // soft-gate; never blocks
|