@svgrid/enterprise 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +94 -24
- package/README.md +36 -4
- package/dist/SvAdvancedFilter.svelte +1 -1
- package/dist/SvAlertsManager.svelte +2 -1
- package/dist/SvBoard.svelte +2 -1
- package/dist/SvExportMenu.svelte +4 -1
- package/dist/SvExportMenu.svelte.d.ts +0 -13
- package/dist/SvExpressionEditor.svelte +3 -3
- package/dist/SvFormulaBar.svelte +680 -0
- package/dist/SvFormulaBar.svelte.d.ts +69 -0
- package/dist/SvGridAlerts.svelte +49 -9
- package/dist/SvGridBoard.svelte +13 -8
- package/dist/SvGridBulkEditDrawer.svelte +26 -2
- package/dist/SvGridEditPanel.svelte +3 -0
- package/dist/SvGridScheduler.svelte +69 -40
- package/dist/SvGridSelectionBar.svelte +10 -3
- package/dist/SvPivotDesigner.svelte +263 -54
- package/dist/SvPivotDesigner.svelte.d.ts +27 -20
- package/dist/SvRibbonIcon.svelte +46 -0
- package/dist/SvRibbonIcon.svelte.d.ts +17 -0
- package/dist/SvSchemaChart.svelte +4 -2
- package/dist/SvSheet.svelte +7914 -0
- package/dist/SvSheet.svelte.d.ts +215 -0
- package/dist/SvSheetChartSetup.svelte +151 -0
- package/dist/SvSheetChartSetup.svelte.d.ts +18 -0
- package/dist/SvSheetComment.svelte +283 -0
- package/dist/SvSheetComment.svelte.d.ts +22 -0
- package/dist/SvSheetConditionalFormat.svelte +159 -0
- package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
- package/dist/SvSheetDataValidation.svelte +273 -0
- package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
- package/dist/SvSheetEditRanges.svelte +217 -0
- package/dist/SvSheetEditRanges.svelte.d.ts +15 -0
- package/dist/SvSheetErrors.svelte +125 -0
- package/dist/SvSheetErrors.svelte.d.ts +20 -0
- package/dist/SvSheetEvaluate.svelte +133 -0
- package/dist/SvSheetEvaluate.svelte.d.ts +15 -0
- package/dist/SvSheetFilterMenu.svelte +320 -0
- package/dist/SvSheetFilterMenu.svelte.d.ts +22 -0
- package/dist/SvSheetFindReplace.svelte +132 -0
- package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
- package/dist/SvSheetFormatCells.svelte +465 -0
- package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
- package/dist/SvSheetGoalSeek.svelte +145 -0
- package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
- package/dist/SvSheetInsertFunction.svelte +149 -0
- package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
- package/dist/SvSheetIteration.svelte +81 -0
- package/dist/SvSheetIteration.svelte.d.ts +10 -0
- package/dist/SvSheetLink.svelte +99 -0
- package/dist/SvSheetLink.svelte.d.ts +17 -0
- package/dist/SvSheetListPicker.svelte +91 -0
- package/dist/SvSheetListPicker.svelte.d.ts +10 -0
- package/dist/SvSheetManageRules.svelte +187 -0
- package/dist/SvSheetManageRules.svelte.d.ts +16 -0
- package/dist/SvSheetNameManager.svelte +227 -0
- package/dist/SvSheetNameManager.svelte.d.ts +11 -0
- package/dist/SvSheetPageSetup.svelte +159 -0
- package/dist/SvSheetPageSetup.svelte.d.ts +13 -0
- package/dist/SvSheetPasteSpecial.svelte +107 -0
- package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
- package/dist/SvSheetPivot.svelte +220 -0
- package/dist/SvSheetPivot.svelte.d.ts +21 -0
- package/dist/SvSheetProtectSheet.svelte +81 -0
- package/dist/SvSheetProtectSheet.svelte.d.ts +11 -0
- package/dist/SvSheetRemoveDuplicates.svelte +152 -0
- package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
- package/dist/SvSheetRibbon.svelte +1254 -0
- package/dist/SvSheetRibbon.svelte.d.ts +34 -0
- package/dist/SvSheetSizeDialog.svelte +60 -0
- package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
- package/dist/SvSheetSort.svelte +218 -0
- package/dist/SvSheetSort.svelte.d.ts +28 -0
- package/dist/SvSheetSparklines.svelte +135 -0
- package/dist/SvSheetSparklines.svelte.d.ts +14 -0
- package/dist/SvSheetTable.svelte +160 -0
- package/dist/SvSheetTable.svelte.d.ts +24 -0
- package/dist/SvSheetTabs.svelte +571 -0
- package/dist/SvSheetTabs.svelte.d.ts +50 -0
- package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
- package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
- package/dist/SvSheetTextToColumns.svelte +172 -0
- package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
- package/dist/SvSheetValidationAlert.svelte +85 -0
- package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
- package/dist/advanced-filter-enable.js +1 -1
- package/dist/alerts/alert-engine.d.ts +6 -0
- package/dist/alerts/alert-engine.js +21 -4
- package/dist/alerts/alert-formats.js +2 -0
- package/dist/alerts/alert-types.d.ts +1 -1
- package/dist/alerts.d.ts +1 -1
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/bulk-edit.d.ts +3 -1
- package/dist/bulk-edit.js +1 -1
- package/dist/cdn/svgrid-enterprise.svelte-external.js +43538 -6539
- package/dist/designer/assets/GridMenus-8gTNssgV.js +8 -0
- package/dist/designer/assets/SvChartMenu-BDoeqGz6.js +1 -0
- package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
- package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-DCPg7WGN.js +1 -0
- package/dist/designer/assets/SvGridCellEditor-DMoWJjEI.js +4 -0
- package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
- package/dist/designer/assets/SvGridChart-Cy1ATrWh.js +3 -0
- package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-eQ3mn0L9.js +1 -0
- package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
- package/dist/designer/assets/SvGridChartPanel-CATdVc9X.js +4 -0
- package/dist/designer/assets/{SvGridChartView-DUc-1RUf.css → SvGridChartView-7msfnWZT.css} +1 -1
- package/dist/designer/assets/SvGridChartView-CmsZtCED.js +1 -0
- package/dist/designer/assets/SvGridDropdown-Cjz0H-fI.js +1 -0
- package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
- package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
- package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
- package/dist/designer/assets/SvTabs-2mHC6oaz.js +1 -0
- package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
- package/dist/designer/assets/cell-formatting-BbubJTVz.js +1 -0
- package/dist/designer/assets/chart-Cn7MnNqA.js +1 -0
- package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
- package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
- package/dist/designer/assets/chart-panel-messages-Dz7PTIqT.js +1 -0
- package/dist/designer/assets/chart-summary-BD1qYB2R.js +1 -0
- package/dist/designer/assets/chart-trend-B8xr5LuD.js +1 -0
- package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
- package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
- package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
- package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
- package/dist/designer/assets/{dismissable-BO547MH9.js → dismissable-ChWRPkoa.js} +1 -1
- package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
- package/dist/designer/assets/{export-format-D-eP4b2l.js → export-format-DGckmgKr.js} +1 -1
- package/dist/designer/assets/focus-trap-V2-6Fy9I.js +1 -0
- package/dist/designer/assets/{index-C_a9Cj8Y.js → index-D5bVbuzI.js} +318 -315
- package/dist/designer/assets/index-_JVFxt02.css +1 -0
- package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
- package/dist/designer/assets/row-resize-BInFWCpr.js +1 -0
- package/dist/designer/assets/server-block-cache-CXJKkJpy.js +1 -0
- package/dist/designer/assets/src-CITpcm6b.js +1 -0
- package/dist/designer/assets/src-DUQ4xE3x.js +58 -0
- package/dist/designer/assets/validate-C3B8QKsM.js +1 -0
- package/dist/designer/index.html +29 -19
- package/dist/export-pdf.d.ts +164 -0
- package/dist/export-pdf.js +346 -15
- package/dist/export.js +25 -10
- package/dist/gantt/SvGridGantt.svelte +2890 -0
- package/dist/gantt/SvGridGantt.svelte.d.ts +30 -0
- package/dist/gantt/gantt-config.d.ts +73 -0
- package/dist/gantt/gantt-config.js +1 -0
- package/dist/gantt/gantt-critical-path.d.ts +67 -0
- package/dist/gantt/gantt-critical-path.js +207 -0
- package/dist/gantt/gantt-model.d.ts +257 -0
- package/dist/gantt/gantt-model.js +651 -0
- package/dist/gantt/gantt-resources.d.ts +59 -0
- package/dist/gantt/gantt-resources.js +71 -0
- package/dist/gantt/gantt.d.ts +7 -0
- package/dist/gantt/gantt.js +36 -0
- package/dist/gantt/index.d.ts +15 -0
- package/dist/gantt/index.js +22 -0
- package/dist/gantt/timeline-arrows.d.ts +102 -0
- package/dist/gantt/timeline-arrows.js +181 -0
- package/dist/import.d.ts +2 -2
- package/dist/import.js +1 -1
- package/dist/index.d.ts +93 -3
- package/dist/index.js +107 -3
- package/dist/install.js +13 -1
- package/dist/license-core.d.ts +17 -1
- package/dist/license-core.js +16 -5
- package/dist/license.d.ts +18 -2
- package/dist/license.js +71 -6
- package/dist/node/studio.js +203 -9
- package/dist/pivot-chart.d.ts +25 -1
- package/dist/pivot-chart.js +25 -69
- package/dist/pivot-enable.js +2 -2
- package/dist/scheduler-dependencies.d.ts +35 -0
- package/dist/scheduler-dependencies.js +36 -1
- package/dist/scheduler.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/server/SvGroupCell.svelte +213 -0
- package/dist/server/SvGroupCell.svelte.d.ts +62 -0
- package/dist/server/SvRowGroupPanel.svelte +322 -0
- package/dist/server/SvRowGroupPanel.svelte.d.ts +37 -0
- package/dist/server/enable.d.ts +17 -0
- package/dist/server/enable.js +49 -0
- package/dist/server/index.d.ts +22 -0
- package/dist/server/index.js +24 -0
- package/dist/server/messages.d.ts +45 -0
- package/dist/server/messages.js +35 -0
- package/dist/server/server-group-model.d.ts +104 -0
- package/dist/server/server-group-model.js +272 -0
- package/dist/server/server-pivot.d.ts +46 -0
- package/dist/server/server-pivot.js +57 -0
- package/dist/server/server-row-model.d.ts +547 -0
- package/dist/server/server-row-model.js +1551 -0
- package/dist/server/server-selection.d.ts +99 -0
- package/dist/server/server-selection.js +215 -0
- package/dist/server/svgrid-adapter.d.ts +155 -0
- package/dist/server/svgrid-adapter.js +202 -0
- package/dist/sheet/address.d.ts +43 -0
- package/dist/sheet/address.js +81 -0
- package/dist/sheet/ast.d.ts +138 -0
- package/dist/sheet/ast.js +70 -0
- package/dist/sheet/auto-filter.d.ts +120 -0
- package/dist/sheet/auto-filter.js +295 -0
- package/dist/sheet/autocomplete.d.ts +51 -0
- package/dist/sheet/autocomplete.js +248 -0
- package/dist/sheet/cell-images.d.ts +39 -0
- package/dist/sheet/cell-images.js +90 -0
- package/dist/sheet/cell-types.d.ts +58 -0
- package/dist/sheet/cell-types.js +96 -0
- package/dist/sheet/coerce.d.ts +71 -0
- package/dist/sheet/coerce.js +289 -0
- package/dist/sheet/commands.d.ts +89 -0
- package/dist/sheet/commands.js +230 -0
- package/dist/sheet/comments.d.ts +63 -0
- package/dist/sheet/comments.js +131 -0
- package/dist/sheet/conditional-formats.d.ts +167 -0
- package/dist/sheet/conditional-formats.js +341 -0
- package/dist/sheet/csv.d.ts +32 -0
- package/dist/sheet/csv.js +158 -0
- package/dist/sheet/culture.d.ts +87 -0
- package/dist/sheet/culture.js +247 -0
- package/dist/sheet/delta.d.ts +102 -0
- package/dist/sheet/delta.js +203 -0
- package/dist/sheet/deps.d.ts +104 -0
- package/dist/sheet/deps.js +274 -0
- package/dist/sheet/document.d.ts +252 -0
- package/dist/sheet/document.js +465 -0
- package/dist/sheet/edit-keys.d.ts +14 -0
- package/dist/sheet/edit-keys.js +40 -0
- package/dist/sheet/engine.d.ts +67 -0
- package/dist/sheet/engine.js +19 -0
- package/dist/sheet/entry.d.ts +35 -0
- package/dist/sheet/entry.js +226 -0
- package/dist/sheet/error-check.d.ts +49 -0
- package/dist/sheet/error-check.js +83 -0
- package/dist/sheet/evaluate-steps.d.ts +48 -0
- package/dist/sheet/evaluate-steps.js +196 -0
- package/dist/sheet/evaluate.d.ts +128 -0
- package/dist/sheet/evaluate.js +1049 -0
- package/dist/sheet/filter-files.d.ts +37 -0
- package/dist/sheet/filter-files.js +465 -0
- package/dist/sheet/find-replace.d.ts +62 -0
- package/dist/sheet/find-replace.js +152 -0
- package/dist/sheet/format-store.d.ts +114 -0
- package/dist/sheet/format-store.js +243 -0
- package/dist/sheet/freeze.d.ts +54 -0
- package/dist/sheet/freeze.js +58 -0
- package/dist/sheet/from-rows.d.ts +14 -0
- package/dist/sheet/from-rows.js +50 -0
- package/dist/sheet/function-catalog.d.ts +10 -0
- package/dist/sheet/function-catalog.js +385 -0
- package/dist/sheet/functions.d.ts +28 -0
- package/dist/sheet/functions.js +634 -0
- package/dist/sheet/goal-seek.d.ts +73 -0
- package/dist/sheet/goal-seek.js +153 -0
- package/dist/sheet/index.d.ts +80 -0
- package/dist/sheet/index.js +80 -0
- package/dist/sheet/links.d.ts +57 -0
- package/dist/sheet/links.js +174 -0
- package/dist/sheet/merges.d.ts +71 -0
- package/dist/sheet/merges.js +137 -0
- package/dist/sheet/messages.d.ts +778 -0
- package/dist/sheet/messages.js +806 -0
- package/dist/sheet/names.d.ts +31 -0
- package/dist/sheet/names.js +87 -0
- package/dist/sheet/navigate.d.ts +52 -0
- package/dist/sheet/navigate.js +135 -0
- package/dist/sheet/number-format.d.ts +110 -0
- package/dist/sheet/number-format.js +905 -0
- package/dist/sheet/objects.d.ts +106 -0
- package/dist/sheet/objects.js +149 -0
- package/dist/sheet/ods-document.d.ts +44 -0
- package/dist/sheet/ods-document.js +1275 -0
- package/dist/sheet/open-file.d.ts +26 -0
- package/dist/sheet/open-file.js +56 -0
- package/dist/sheet/outline.d.ts +82 -0
- package/dist/sheet/outline.js +228 -0
- package/dist/sheet/packs/array.d.ts +16 -0
- package/dist/sheet/packs/array.js +172 -0
- package/dist/sheet/packs/database.d.ts +42 -0
- package/dist/sheet/packs/database.js +142 -0
- package/dist/sheet/packs/engineering.d.ts +2 -0
- package/dist/sheet/packs/engineering.js +296 -0
- package/dist/sheet/packs/financial.d.ts +5 -0
- package/dist/sheet/packs/financial.js +220 -0
- package/dist/sheet/packs/math-stats.d.ts +2 -0
- package/dist/sheet/packs/math-stats.js +372 -0
- package/dist/sheet/packs/special.d.ts +44 -0
- package/dist/sheet/packs/special.js +187 -0
- package/dist/sheet/packs/stats-dist.d.ts +2 -0
- package/dist/sheet/packs/stats-dist.js +785 -0
- package/dist/sheet/packs/text-date.d.ts +2 -0
- package/dist/sheet/packs/text-date.js +332 -0
- package/dist/sheet/packs/trig.d.ts +2 -0
- package/dist/sheet/packs/trig.js +73 -0
- package/dist/sheet/page-setup.d.ts +73 -0
- package/dist/sheet/page-setup.js +73 -0
- package/dist/sheet/palette.d.ts +19 -0
- package/dist/sheet/palette.js +84 -0
- package/dist/sheet/parse.d.ts +13 -0
- package/dist/sheet/parse.js +140 -0
- package/dist/sheet/paste-special.d.ts +186 -0
- package/dist/sheet/paste-special.js +601 -0
- package/dist/sheet/pivot-range.d.ts +160 -0
- package/dist/sheet/pivot-range.js +333 -0
- package/dist/sheet/presence.d.ts +73 -0
- package/dist/sheet/presence.js +79 -0
- package/dist/sheet/print.d.ts +104 -0
- package/dist/sheet/print.js +169 -0
- package/dist/sheet/protection.d.ts +75 -0
- package/dist/sheet/protection.js +101 -0
- package/dist/sheet/rects.d.ts +45 -0
- package/dist/sheet/rects.js +112 -0
- package/dist/sheet/refs.d.ts +130 -0
- package/dist/sheet/refs.js +413 -0
- package/dist/sheet/ribbon-icons.d.ts +31 -0
- package/dist/sheet/ribbon-icons.js +536 -0
- package/dist/sheet/ribbon.d.ts +173 -0
- package/dist/sheet/ribbon.js +1054 -0
- package/dist/sheet/sheet-kinds.d.ts +74 -0
- package/dist/sheet/sheet-kinds.js +91 -0
- package/dist/sheet/shortcuts.d.ts +174 -0
- package/dist/sheet/shortcuts.js +674 -0
- package/dist/sheet/sort.d.ts +51 -0
- package/dist/sheet/sort.js +107 -0
- package/dist/sheet/sparklines.d.ts +111 -0
- package/dist/sheet/sparklines.js +204 -0
- package/dist/sheet/structure.d.ts +87 -0
- package/dist/sheet/structure.js +166 -0
- package/dist/sheet/table-styles.d.ts +74 -0
- package/dist/sheet/table-styles.js +152 -0
- package/dist/sheet/tables.d.ts +89 -0
- package/dist/sheet/tables.js +178 -0
- package/dist/sheet/tokenize.d.ts +71 -0
- package/dist/sheet/tokenize.js +355 -0
- package/dist/sheet/transforms.d.ts +76 -0
- package/dist/sheet/transforms.js +154 -0
- package/dist/sheet/validation.d.ts +108 -0
- package/dist/sheet/validation.js +278 -0
- package/dist/sheet/workbook.d.ts +217 -0
- package/dist/sheet/workbook.js +1120 -0
- package/dist/sheet/xls-cfb.d.ts +32 -0
- package/dist/sheet/xls-cfb.js +290 -0
- package/dist/sheet/xls-document.d.ts +10 -0
- package/dist/sheet/xls-document.js +1243 -0
- package/dist/sheet/xls-formula.d.ts +40 -0
- package/dist/sheet/xls-formula.js +569 -0
- package/dist/sheet/xlsx-document.d.ts +108 -0
- package/dist/sheet/xlsx-document.js +1849 -0
- package/dist/sheet/xlsx-drawing.d.ts +99 -0
- package/dist/sheet/xlsx-drawing.js +420 -0
- package/dist/sheet-enable.d.ts +6 -0
- package/dist/sheet-enable.js +45 -0
- package/dist/sheet-text.d.ts +7 -0
- package/dist/sheet-text.js +29 -0
- package/dist/sources/auth-supabase.js +2 -2
- package/dist/sources/realtime-supabase.js +2 -2
- package/dist/sources/rest.d.ts +6 -2
- package/dist/sources/rest.js +42 -7
- package/dist/sources/supabase.d.ts +10 -1
- package/dist/sources/supabase.js +73 -40
- package/dist/studio/emit-project.js +14 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/project.d.ts +11 -2
- package/dist/studio/project.js +5 -2
- package/dist/studio/ui-components.generated.js +170 -3
- package/dist/sveltekit/in-memory.d.ts +2 -2
- package/dist/sveltekit/in-memory.js +125 -4
- package/dist/sveltekit/index.d.ts +1 -1
- package/dist/sveltekit/index.js +1 -1
- package/dist/sveltekit/query-plan.d.ts +50 -4
- package/dist/sveltekit/query-plan.js +25 -3
- package/dist/sveltekit/sql-source.d.ts +6 -0
- package/dist/sveltekit/sql-source.js +34 -6
- package/dist/sveltekit/sql.d.ts +31 -0
- package/dist/sveltekit/sql.js +135 -25
- package/dist/sveltekit/transport.d.ts +10 -2
- package/dist/sveltekit/transport.js +30 -6
- package/dist/upgrade-prompt.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watermark.js +35 -2
- package/dist/wc/GridMenus-By9vPuq0.js +1088 -0
- package/dist/wc/SvChartMenu-CQNrQGT2.js +308 -0
- package/dist/wc/SvDateRangeInput-DR6m7bSM.js +199 -0
- package/dist/wc/SvDateTimePicker-D-vRnaMo.js +771 -0
- package/dist/wc/SvField-B_kurx_P.js +149 -0
- package/dist/wc/SvGrid.helpers-BdVDtjUm.js +135 -0
- package/dist/wc/SvGridCellEditor-Bnf1Kr5C.js +560 -0
- package/dist/wc/SvGridChart-BqUJh2pG.js +3572 -0
- package/dist/wc/SvGridChartBuilder-CGycC5cn.js +988 -0
- package/dist/wc/SvGridChartPanel-CRnizsHD.js +1746 -0
- package/dist/wc/SvGridChartView-D1pa_xMy.js +47 -0
- package/dist/wc/SvGridDropdown-45WsObLL.js +259 -0
- package/dist/wc/SvModal-DrfOYYyX.js +189 -0
- package/dist/wc/cell-formatting-CBfgahv1.js +86 -0
- package/dist/wc/chart-6OXlybVT.js +4341 -0
- package/dist/wc/chart-export-CeSADGfi.js +135 -0
- package/dist/wc/chart-export-pdf-BGko7MER.js +104 -0
- package/dist/wc/chart-summary-2m3ia1-n.js +137 -0
- package/dist/wc/chart-trend-CQOQtTMl.js +50 -0
- package/dist/wc/chart-validate-CD6ptiwg.js +180 -0
- package/dist/wc/client-DQIzjDBG.js +3064 -0
- package/dist/wc/column-resize-DUPgynvc.js +101 -0
- package/dist/wc/date-format-DS-z_h9v.js +1130 -0
- package/dist/wc/dismissable-CQ6XFXsk.js +45 -0
- package/dist/wc/editor-contract-peBDxir_.js +22 -0
- package/dist/wc/editor-registry-DxGKqcvx.js +24 -0
- package/dist/wc/focus-trap-Dbb2tJxb.js +65 -0
- package/dist/wc/list-option-DrRyivWp.js +82 -0
- package/dist/wc/popover-WsGlvtQv.js +69 -0
- package/dist/wc/positioning-BiKLfu1E.js +112 -0
- package/dist/wc/react.d.ts +41 -0
- package/dist/wc/react.js +90 -0
- package/dist/wc/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/wc/row-drag-touch-CycRR65n.js +93 -0
- package/dist/wc/row-resize-limG_N1z.js +111 -0
- package/dist/wc/sv-sheet-element.d.ts +97 -0
- package/dist/wc/sv-sheet-element.js +44213 -0
- package/dist/wc/svelte-virtualizer.svelte-CXtQy2TQ.js +530 -0
- package/dist/wc/validate-BqDthkNr.js +88 -0
- package/dist/wc/vue.d.ts +31 -0
- package/dist/wc/vue.js +75 -0
- package/package.json +36 -6
- package/dist/designer/assets/GridMenus-B1JtIN21.js +0 -8
- package/dist/designer/assets/SvDateRangeInput-CjO7nn_x.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +0 -1
- package/dist/designer/assets/SvField-YDLipR6O.css +0 -1
- package/dist/designer/assets/SvField-cj1PFNgZ.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +0 -2
- package/dist/designer/assets/SvGridChart-DBOR4xcz.js +0 -2
- package/dist/designer/assets/SvGridChart-fkMWeh1J.css +0 -1
- package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +0 -11
- package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +0 -1
- package/dist/designer/assets/SvListBox-1oUF6Iav.js +0 -110
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +0 -1
- package/dist/designer/assets/chart-DXFganU8.js +0 -1
- package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
- package/dist/designer/assets/date-format-DGagAqRc.css +0 -1
- package/dist/designer/assets/date-format-onlYDsrY.js +0 -1
- package/dist/designer/assets/easing-zaypKrr0.js +0 -3
- package/dist/designer/assets/index-k2stW6L8.css +0 -1
- package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
- package/dist/designer/assets/src-D9p27OGC.js +0 -58
- package/dist/designer/assets/validate-h-aslRV9.js +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Excel's Conditional Formatting Rules Manager: the rules of the sheet
|
|
4
|
+
* (or of the current selection), in priority order, each with what it
|
|
5
|
+
* does, a sample and where it applies; Edit Rule (for the rules the small
|
|
6
|
+
* dialog can edit), Delete Rule, Move Up, Move Down and Stop If True. The
|
|
7
|
+
* list is a working copy: OK hands it back as one change, Cancel drops
|
|
8
|
+
* it.
|
|
9
|
+
*/
|
|
10
|
+
import { useSheetText } from './sheet-text'
|
|
11
|
+
import { SvModal } from '@svgrid/grid'
|
|
12
|
+
import { describeCf, hasStyle, cfIn, type CfRule, type CfStyledRule } from './sheet/conditional-formats'
|
|
13
|
+
import { colToLetters } from './sheet/address'
|
|
14
|
+
import type { Rect } from './sheet/rects'
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
open?: boolean
|
|
18
|
+
rules: ReadonlyArray<CfRule>
|
|
19
|
+
/** The selection, for the Current Selection filter. */
|
|
20
|
+
selection: ReadonlyArray<Rect>
|
|
21
|
+
onApply: (rules: CfRule[]) => void
|
|
22
|
+
/** Edit Rule: the shell opens the small dialog on the rule and calls
|
|
23
|
+
* `replace` with the result. */
|
|
24
|
+
onEdit: (rule: CfStyledRule, replace: (next: CfStyledRule) => void) => void
|
|
25
|
+
onClose?: () => void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let { open = $bindable(false), rules, selection, onApply, onEdit, onClose }: Props = $props()
|
|
29
|
+
const t = useSheetText()
|
|
30
|
+
|
|
31
|
+
let working = $state<CfRule[]>([])
|
|
32
|
+
let scope = $state<'sheet' | 'selection'>('sheet')
|
|
33
|
+
let selected = $state<string | null>(null)
|
|
34
|
+
|
|
35
|
+
$effect(() => {
|
|
36
|
+
if (!open) return
|
|
37
|
+
// Read the props, write the state: reading `working` back here would
|
|
38
|
+
// make the effect depend on what it just wrote and run without end.
|
|
39
|
+
const copy = rules.map((r) => ({ ...r, rects: r.rects.map((x) => [...x] as unknown as Rect) }))
|
|
40
|
+
working = copy
|
|
41
|
+
scope = 'sheet'
|
|
42
|
+
selected = copy[0]?.id ?? null
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const shown = $derived(scope === 'sheet' ? working : cfIn(working, selection))
|
|
46
|
+
const current = $derived(working.find((r) => r.id === selected) ?? null)
|
|
47
|
+
const index = $derived(current ? working.indexOf(current) : -1)
|
|
48
|
+
|
|
49
|
+
const address = (rects: ReadonlyArray<Rect>) =>
|
|
50
|
+
rects.map(([r1, c1, r2, c2]) => {
|
|
51
|
+
const a = `${colToLetters(c1)}${r1 + 1}`
|
|
52
|
+
const b = `${colToLetters(c2)}${r2 + 1}`
|
|
53
|
+
return a === b ? a : `${a}:${b}`
|
|
54
|
+
}).join(', ')
|
|
55
|
+
|
|
56
|
+
const sample = (rule: CfRule): { background?: string; color?: string; text: string } => {
|
|
57
|
+
if (hasStyle(rule)) return { background: rule.style.fill, color: rule.style.color, text: 'AaBbCcYyZz' }
|
|
58
|
+
if (rule.kind === 'dataBar') return { background: `linear-gradient(90deg, ${rule.color} 60%, transparent 60%)`, text: '' }
|
|
59
|
+
if (rule.kind === 'colorScale') return { background: `linear-gradient(90deg, ${rule.colors.join(', ')})`, text: '' }
|
|
60
|
+
return { text: t('manageRules.iconSet') }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function remove() {
|
|
64
|
+
if (index < 0) return
|
|
65
|
+
working = working.filter((_, i) => i !== index)
|
|
66
|
+
selected = working[Math.min(index, working.length - 1)]?.id ?? null
|
|
67
|
+
}
|
|
68
|
+
function move(delta: -1 | 1) {
|
|
69
|
+
if (index < 0) return
|
|
70
|
+
const to = index + delta
|
|
71
|
+
if (to < 0 || to >= working.length) return
|
|
72
|
+
const next = working.slice()
|
|
73
|
+
const [rule] = next.splice(index, 1)
|
|
74
|
+
next.splice(to, 0, rule!)
|
|
75
|
+
working = next
|
|
76
|
+
}
|
|
77
|
+
function toggleStop(rule: CfRule) {
|
|
78
|
+
working = working.map((r) => (r.id === rule.id ? { ...r, stopIfTrue: !r.stopIfTrue } : r))
|
|
79
|
+
}
|
|
80
|
+
function edit() {
|
|
81
|
+
const rule = current
|
|
82
|
+
if (!rule || !hasStyle(rule)) return
|
|
83
|
+
onEdit(rule, (next) => {
|
|
84
|
+
working = working.map((r) => (r.id === rule.id ? next : r))
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
function ok() {
|
|
88
|
+
onApply(working)
|
|
89
|
+
open = false
|
|
90
|
+
onClose?.()
|
|
91
|
+
}
|
|
92
|
+
function close() {
|
|
93
|
+
open = false
|
|
94
|
+
onClose?.()
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<SvModal bind:open onClose={onClose} title={t('manageRules.title')} size="md" width={640}>
|
|
99
|
+
<div class="sv-sheet-dialog manage">
|
|
100
|
+
<label class="field auto">
|
|
101
|
+
<span>{t('manageRules.showFor')}</span>
|
|
102
|
+
<select bind:value={scope}>
|
|
103
|
+
<option value="sheet">{t('manageRules.thisSheet')}</option>
|
|
104
|
+
<option value="selection">{t('manageRules.selection')}</option>
|
|
105
|
+
</select>
|
|
106
|
+
</label>
|
|
107
|
+
<div class="toolbar">
|
|
108
|
+
<button type="button" class="btn" onclick={edit} disabled={!current || !hasStyle(current)}>{t('manageRules.editRule')}</button>
|
|
109
|
+
<button type="button" class="btn" onclick={remove} disabled={!current}>{t('manageRules.deleteRule')}</button>
|
|
110
|
+
<button type="button" class="btn" onclick={() => move(-1)} disabled={index <= 0} aria-label={t('manageRules.moveUp')} title={t('manageRules.moveUp')}>▲</button>
|
|
111
|
+
<button type="button" class="btn" onclick={() => move(1)} disabled={index < 0 || index >= working.length - 1} aria-label={t('manageRules.moveDown')} title={t('manageRules.moveDown')}>▼</button>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="list" role="grid" aria-label={t('manageRules.rules')}>
|
|
114
|
+
<div class="head" role="row">
|
|
115
|
+
<span role="columnheader">{t('manageRules.rule')}</span>
|
|
116
|
+
<span role="columnheader">{t('manageRules.format')}</span>
|
|
117
|
+
<span role="columnheader">{t('manageRules.appliesTo')}</span>
|
|
118
|
+
<span role="columnheader">{t('manageRules.stopIfTrue')}</span>
|
|
119
|
+
</div>
|
|
120
|
+
{#if shown.length === 0}
|
|
121
|
+
<div class="empty">{t(scope === 'sheet' ? 'manageRules.noneOnSheet' : 'manageRules.noneInSelection')}</div>
|
|
122
|
+
{/if}
|
|
123
|
+
{#each shown as rule (rule.id)}
|
|
124
|
+
{@const s = sample(rule)}
|
|
125
|
+
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_interactive_supports_focus -->
|
|
126
|
+
<div class="rule" class:on={rule.id === selected} role="row" aria-selected={rule.id === selected} onclick={() => (selected = rule.id)}>
|
|
127
|
+
<span role="gridcell" class="what">{describeCf(rule)}</span>
|
|
128
|
+
<span role="gridcell" class="sample" style:background={s.background ?? 'transparent'} style:color={s.color ?? 'inherit'}>{s.text}</span>
|
|
129
|
+
<span role="gridcell" class="where">{address(rule.rects)}</span>
|
|
130
|
+
<span role="gridcell" class="stop"><input type="checkbox" checked={!!rule.stopIfTrue} aria-label={t('manageRules.stopIfTrue')} onchange={() => toggleStop(rule)} onclick={(e) => e.stopPropagation()} /></span>
|
|
131
|
+
</div>
|
|
132
|
+
{/each}
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
{#snippet footer()}
|
|
136
|
+
<div class="sv-sheet-dialog-buttons">
|
|
137
|
+
<button type="button" class="btn primary" onclick={ok}>{t('ok')}</button>
|
|
138
|
+
<button type="button" class="btn" onclick={close}>{t('cancel')}</button>
|
|
139
|
+
</div>
|
|
140
|
+
{/snippet}
|
|
141
|
+
</SvModal>
|
|
142
|
+
|
|
143
|
+
<style>
|
|
144
|
+
.toolbar { display: flex; gap: 6px; }
|
|
145
|
+
.toolbar .btn {
|
|
146
|
+
height: 26px;
|
|
147
|
+
padding: 0 10px;
|
|
148
|
+
font: inherit;
|
|
149
|
+
color: inherit;
|
|
150
|
+
background: var(--sg-bg, #fff);
|
|
151
|
+
border: 1px solid var(--sg-border, #d1d1d1);
|
|
152
|
+
border-radius: var(--sg-radius, 3px);
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
.toolbar .btn:hover:not(:disabled) { background: var(--sg-row-hover-bg, #f5f5f5); }
|
|
156
|
+
.toolbar .btn:disabled { opacity: 0.5; cursor: default; }
|
|
157
|
+
.list {
|
|
158
|
+
border: 1px solid var(--sg-border, #d1d1d1);
|
|
159
|
+
border-radius: var(--sg-radius, 3px);
|
|
160
|
+
max-height: 260px;
|
|
161
|
+
overflow-y: auto;
|
|
162
|
+
}
|
|
163
|
+
.head, .rule {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: 1fr 120px 130px 84px;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 8px;
|
|
168
|
+
padding: 4px 8px;
|
|
169
|
+
}
|
|
170
|
+
.head {
|
|
171
|
+
font-weight: 600;
|
|
172
|
+
color: var(--sg-muted, #616161);
|
|
173
|
+
background: var(--sg-bg-subtle, #f3f3f3);
|
|
174
|
+
border-bottom: 1px solid var(--sg-border, #d1d1d1);
|
|
175
|
+
}
|
|
176
|
+
.rule { cursor: default; }
|
|
177
|
+
.rule.on { background: var(--sg-selection-bg, rgba(16, 124, 65, 0.12)); }
|
|
178
|
+
.rule .sample {
|
|
179
|
+
padding: 2px 6px;
|
|
180
|
+
border: 1px solid var(--sg-border, #d1d1d1);
|
|
181
|
+
text-align: center;
|
|
182
|
+
min-height: 20px;
|
|
183
|
+
}
|
|
184
|
+
.rule .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
185
|
+
.rule .stop { text-align: center; }
|
|
186
|
+
.empty { padding: 10px; color: var(--sg-muted, #616161); }
|
|
187
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CfRule, type CfStyledRule } from './sheet/conditional-formats.js';
|
|
2
|
+
import type { Rect } from './sheet/rects.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
rules: ReadonlyArray<CfRule>;
|
|
6
|
+
/** The selection, for the Current Selection filter. */
|
|
7
|
+
selection: ReadonlyArray<Rect>;
|
|
8
|
+
onApply: (rules: CfRule[]) => void;
|
|
9
|
+
/** Edit Rule: the shell opens the small dialog on the rule and calls
|
|
10
|
+
* `replace` with the result. */
|
|
11
|
+
onEdit: (rule: CfStyledRule, replace: (next: CfStyledRule) => void) => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
};
|
|
14
|
+
declare const SvSheetManageRules: import("svelte").Component<Props, {}, "open">;
|
|
15
|
+
type SvSheetManageRules = ReturnType<typeof SvSheetManageRules>;
|
|
16
|
+
export default SvSheetManageRules;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Excel's Name Manager: every defined name with what it refers to and
|
|
4
|
+
* what that is worth right now; edit one in place, delete one, add one.
|
|
5
|
+
* Writes go to `workbook.names`, and the shell is told afterwards, since
|
|
6
|
+
* no cell was typed into and the sheet would otherwise not repaint.
|
|
7
|
+
*/
|
|
8
|
+
import { useSheetText } from './sheet-text'
|
|
9
|
+
import { SvModal } from '@svgrid/grid'
|
|
10
|
+
import type { Workbook } from './sheet/workbook'
|
|
11
|
+
import type { DefinedName } from './sheet/names'
|
|
12
|
+
import { isValidName } from './sheet/names'
|
|
13
|
+
import { parseA1 } from './sheet/address'
|
|
14
|
+
|
|
15
|
+
type Props = {
|
|
16
|
+
open?: boolean
|
|
17
|
+
workbook: Workbook
|
|
18
|
+
/** Called after every change, so the shell recomputes and repaints. */
|
|
19
|
+
onChange: () => void
|
|
20
|
+
onClose?: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let { open = $bindable(false), workbook, onChange, onClose }: Props = $props()
|
|
24
|
+
const t = useSheetText()
|
|
25
|
+
|
|
26
|
+
let names = $state<DefinedName[]>([])
|
|
27
|
+
let newName = $state('')
|
|
28
|
+
let newRefersTo = $state('')
|
|
29
|
+
let editing = $state<string | null>(null)
|
|
30
|
+
let editRefersTo = $state('')
|
|
31
|
+
let problem = $state<string | null>(null)
|
|
32
|
+
|
|
33
|
+
function reload() {
|
|
34
|
+
names = workbook.names.list()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
$effect(() => {
|
|
38
|
+
if (!open) return
|
|
39
|
+
reload()
|
|
40
|
+
newName = ''
|
|
41
|
+
newRefersTo = ''
|
|
42
|
+
editing = null
|
|
43
|
+
problem = null
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
/** What a name is worth right now, for the Value column. */
|
|
47
|
+
function valueOf(entry: DefinedName): string {
|
|
48
|
+
const text = entry.refersTo.replace(/^=/, '')
|
|
49
|
+
const bang = text.lastIndexOf('!')
|
|
50
|
+
const sheetName = bang >= 0 ? text.slice(0, bang).replace(/^'(.*)'$/, '$1') : workbook.active
|
|
51
|
+
const address = bang >= 0 ? text.slice(bang + 1) : text
|
|
52
|
+
const [first, last] = address.split(':')
|
|
53
|
+
const from = parseA1(first ?? '')
|
|
54
|
+
if (!from || from.row === null) return ''
|
|
55
|
+
if (last) {
|
|
56
|
+
const to = parseA1(last)
|
|
57
|
+
if (to && to.row !== null) {
|
|
58
|
+
const cells = (to.row - from.row + 1) * (to.col - from.col + 1)
|
|
59
|
+
return `${cells} cells`
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const v = workbook.getValue(sheetName, from.row, from.col)
|
|
63
|
+
if (typeof v === 'object' && v !== null) return v.error
|
|
64
|
+
if (typeof v === 'number') return v.toLocaleString('en-US', { maximumFractionDigits: 4 })
|
|
65
|
+
return String(v)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Accept `Assumptions!B6`, `=Assumptions!$B$6`, `B6` or a range. */
|
|
69
|
+
function normalise(refersTo: string): string | null {
|
|
70
|
+
const text = refersTo.trim().replace(/^=/, '')
|
|
71
|
+
if (text === '') return null
|
|
72
|
+
const bang = text.lastIndexOf('!')
|
|
73
|
+
const address = bang >= 0 ? text.slice(bang + 1) : text
|
|
74
|
+
const [first, last] = address.split(':')
|
|
75
|
+
if (!parseA1(first ?? '')) return null
|
|
76
|
+
if (last !== undefined && !parseA1(last)) return null
|
|
77
|
+
const sheet = bang >= 0 ? text.slice(0, bang + 1) : `${quote(workbook.active)}!`
|
|
78
|
+
return `=${sheet}${address}`
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const quote = (name: string) => (/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name) ? name : `'${name.replace(/'/g, "''")}'`)
|
|
82
|
+
|
|
83
|
+
function changed() {
|
|
84
|
+
onChange()
|
|
85
|
+
reload()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function add() {
|
|
89
|
+
const name = newName.trim()
|
|
90
|
+
if (!isValidName(name)) { problem = `"${name}" is not a valid name: letters, digits and underscores, not a cell address`; return }
|
|
91
|
+
if (workbook.names.has(name)) { problem = `${name} is already defined; edit it below instead`; return }
|
|
92
|
+
const refersTo = normalise(newRefersTo)
|
|
93
|
+
if (!refersTo) { problem = `"${newRefersTo}" is not a cell or range`; return }
|
|
94
|
+
workbook.names.define(name, refersTo)
|
|
95
|
+
newName = ''
|
|
96
|
+
newRefersTo = ''
|
|
97
|
+
problem = null
|
|
98
|
+
changed()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function startEdit(entry: DefinedName) {
|
|
102
|
+
editing = entry.name
|
|
103
|
+
editRefersTo = entry.refersTo
|
|
104
|
+
problem = null
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function saveEdit() {
|
|
108
|
+
if (!editing) return
|
|
109
|
+
const refersTo = normalise(editRefersTo)
|
|
110
|
+
if (!refersTo) { problem = `"${editRefersTo}" is not a cell or range`; return }
|
|
111
|
+
workbook.names.define(editing, refersTo)
|
|
112
|
+
editing = null
|
|
113
|
+
problem = null
|
|
114
|
+
changed()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function remove(name: string) {
|
|
118
|
+
workbook.names.remove(name)
|
|
119
|
+
changed()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function close() {
|
|
123
|
+
open = false
|
|
124
|
+
onClose?.()
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<SvModal bind:open onClose={onClose} title={t('nameManager.title')} size="md">
|
|
129
|
+
<div class="sv-sheet-dialog manager" role="group" aria-label={t('nameManager.title')}>
|
|
130
|
+
<table class="names">
|
|
131
|
+
<thead>
|
|
132
|
+
<tr><th>{t('nameManager.name')}</th><th>{t('nameManager.refersTo')}</th><th>{t('nameManager.value')}</th><th></th></tr>
|
|
133
|
+
</thead>
|
|
134
|
+
<tbody>
|
|
135
|
+
{#each names as entry (entry.name)}
|
|
136
|
+
<tr>
|
|
137
|
+
<td class="mono">{entry.name}</td>
|
|
138
|
+
<td class="mono">
|
|
139
|
+
{#if editing === entry.name}
|
|
140
|
+
<input
|
|
141
|
+
type="text"
|
|
142
|
+
bind:value={editRefersTo}
|
|
143
|
+
aria-label={t('nameManager.refersTo')}
|
|
144
|
+
spellcheck="false"
|
|
145
|
+
onkeydown={(e) => { if (e.key === 'Enter') { e.preventDefault(); saveEdit() } if (e.key === 'Escape') { e.stopPropagation(); editing = null } }}
|
|
146
|
+
/>
|
|
147
|
+
{:else}
|
|
148
|
+
{entry.refersTo}
|
|
149
|
+
{/if}
|
|
150
|
+
</td>
|
|
151
|
+
<td class="num">{valueOf(entry)}</td>
|
|
152
|
+
<td class="actions">
|
|
153
|
+
{#if editing === entry.name}
|
|
154
|
+
<button type="button" class="link" onclick={saveEdit}>{t('save')}</button>
|
|
155
|
+
<button type="button" class="link" onclick={() => (editing = null)}>{t('cancel')}</button>
|
|
156
|
+
{:else}
|
|
157
|
+
<button type="button" class="link" onclick={() => startEdit(entry)}>{t('nameManager.edit')}</button>
|
|
158
|
+
<button type="button" class="link" onclick={() => remove(entry.name)}>{t('delete')}</button>
|
|
159
|
+
{/if}
|
|
160
|
+
</td>
|
|
161
|
+
</tr>
|
|
162
|
+
{:else}
|
|
163
|
+
<tr><td colspan="4" class="empty">{t('nameManager.empty')}</td></tr>
|
|
164
|
+
{/each}
|
|
165
|
+
</tbody>
|
|
166
|
+
</table>
|
|
167
|
+
|
|
168
|
+
<form class="new" onsubmit={(e) => { e.preventDefault(); add() }}>
|
|
169
|
+
<label>
|
|
170
|
+
<span>{t('nameManager.nameField')}</span>
|
|
171
|
+
<input type="text" bind:value={newName} placeholder={t('nameManager.namePlaceholder')} spellcheck="false" />
|
|
172
|
+
</label>
|
|
173
|
+
<label>
|
|
174
|
+
<span>{t('nameManager.refersToField')}</span>
|
|
175
|
+
<input type="text" bind:value={newRefersTo} placeholder={t('nameManager.refersToPlaceholder')} spellcheck="false" />
|
|
176
|
+
</label>
|
|
177
|
+
<button type="submit" class="btn">{t('nameManager.new')}</button>
|
|
178
|
+
</form>
|
|
179
|
+
{#if problem}<p class="status problem" role="alert">{problem}</p>{/if}
|
|
180
|
+
</div>
|
|
181
|
+
{#snippet footer()}
|
|
182
|
+
<div class="sv-sheet-dialog-buttons">
|
|
183
|
+
<button type="button" class="btn" onclick={close}>{t('close')}</button>
|
|
184
|
+
</div>
|
|
185
|
+
{/snippet}
|
|
186
|
+
</SvModal>
|
|
187
|
+
|
|
188
|
+
<style>
|
|
189
|
+
.names { width: 100%; border-collapse: collapse; }
|
|
190
|
+
.names th {
|
|
191
|
+
text-align: left;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
color: var(--sg-muted, #616161);
|
|
194
|
+
padding: 4px 8px;
|
|
195
|
+
border-bottom: 1px solid var(--sg-border, #d1d1d1);
|
|
196
|
+
}
|
|
197
|
+
.names td { padding: 4px 8px; border-bottom: 1px solid var(--sg-border, #e5e5e5); vertical-align: middle; }
|
|
198
|
+
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
|
|
199
|
+
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
|
|
200
|
+
.actions { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }
|
|
201
|
+
.empty { text-align: center; color: var(--sg-muted, #616161); }
|
|
202
|
+
.link {
|
|
203
|
+
padding: 0;
|
|
204
|
+
font: inherit;
|
|
205
|
+
color: var(--sg-accent, #217346);
|
|
206
|
+
background: none;
|
|
207
|
+
border: 0;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
}
|
|
210
|
+
.link:hover { text-decoration: underline; }
|
|
211
|
+
.new { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: end; }
|
|
212
|
+
.new label { display: flex; flex-direction: column; gap: 4px; }
|
|
213
|
+
.new .btn {
|
|
214
|
+
height: 26px;
|
|
215
|
+
padding: 0 14px;
|
|
216
|
+
font: inherit;
|
|
217
|
+
color: var(--sg-fg, #242424);
|
|
218
|
+
background: var(--sg-bg, #fff);
|
|
219
|
+
border: 1px solid var(--sg-border, #d1d1d1);
|
|
220
|
+
border-radius: var(--sg-radius, 3px);
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
}
|
|
223
|
+
.problem { color: var(--sg-danger, #dc2626); }
|
|
224
|
+
@media (max-width: 560px) {
|
|
225
|
+
.new { grid-template-columns: 1fr; }
|
|
226
|
+
}
|
|
227
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Workbook } from './sheet/workbook.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
workbook: Workbook;
|
|
5
|
+
/** Called after every change, so the shell recomputes and repaints. */
|
|
6
|
+
onChange: () => void;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const SvSheetNameManager: import("svelte").Component<Props, {}, "open">;
|
|
10
|
+
type SvSheetNameManager = ReturnType<typeof SvSheetNameManager>;
|
|
11
|
+
export default SvSheetNameManager;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Excel's Page Setup dialog, the one page of it the sheet prints from:
|
|
4
|
+
* orientation, paper, a margins preset, the scale, the print area, the
|
|
5
|
+
* rows that repeat at the top of every page, and whether gridlines and
|
|
6
|
+
* headings print. Opens on the sheet's setup, hands the whole thing back
|
|
7
|
+
* on OK, and Print... hands it back and prints. Print Titles on the
|
|
8
|
+
* ribbon opens the same dialog, as Excel's opens Page Setup on its
|
|
9
|
+
* Sheet tab.
|
|
10
|
+
*/
|
|
11
|
+
import { useSheetText } from './sheet-text'
|
|
12
|
+
import { SvModal } from '@svgrid/grid'
|
|
13
|
+
import { MARGIN_PRESETS, PAPER_SIZES, marginPresetOf, copyPageSetup, type PageSetup, type PaperSize, type MarginPreset } from './sheet/page-setup'
|
|
14
|
+
import { parseRangeText, rangeText } from './sheet/protection'
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
open?: boolean
|
|
18
|
+
/** The sheet's setup as it stands. */
|
|
19
|
+
setup: PageSetup
|
|
20
|
+
onApply: (setup: PageSetup) => void
|
|
21
|
+
/** Print...: the shell applies and prints. */
|
|
22
|
+
onPrint: () => void
|
|
23
|
+
onClose?: () => void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let { open = $bindable(false), setup, onApply, onPrint, onClose }: Props = $props()
|
|
27
|
+
const t = useSheetText()
|
|
28
|
+
|
|
29
|
+
let orientation = $state<PageSetup['orientation']>('portrait')
|
|
30
|
+
let paper = $state<PaperSize>('A4')
|
|
31
|
+
let margins = $state<MarginPreset | 'custom'>('normal')
|
|
32
|
+
let scale = $state('100')
|
|
33
|
+
let area = $state('')
|
|
34
|
+
let titles = $state('')
|
|
35
|
+
let gridlines = $state(false)
|
|
36
|
+
let headings = $state(false)
|
|
37
|
+
let problem = $state<string | null>(null)
|
|
38
|
+
let first = $state<HTMLSelectElement | null>(null)
|
|
39
|
+
|
|
40
|
+
const PAPERS = Object.keys(PAPER_SIZES) as PaperSize[]
|
|
41
|
+
|
|
42
|
+
$effect(() => {
|
|
43
|
+
if (!open) return
|
|
44
|
+
orientation = setup.orientation
|
|
45
|
+
paper = setup.paper
|
|
46
|
+
margins = marginPresetOf(setup.margins) ?? 'custom'
|
|
47
|
+
scale = String(setup.scale)
|
|
48
|
+
area = setup.printArea ? rangeText(setup.printArea) : ''
|
|
49
|
+
titles = setup.printTitleRows ? `${setup.printTitleRows[0] + 1}:${setup.printTitleRows[1] + 1}` : ''
|
|
50
|
+
gridlines = setup.gridlines
|
|
51
|
+
headings = setup.headings
|
|
52
|
+
problem = null
|
|
53
|
+
queueMicrotask(() => first?.focus())
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
/** The setup as the fields say, or null with `problem` set. */
|
|
57
|
+
function read(): PageSetup | null {
|
|
58
|
+
const next = copyPageSetup(setup)
|
|
59
|
+
next.orientation = orientation
|
|
60
|
+
next.paper = paper
|
|
61
|
+
if (margins !== 'custom') next.margins = { ...MARGIN_PRESETS[margins] }
|
|
62
|
+
const pct = Number(scale)
|
|
63
|
+
next.scale = Number.isFinite(pct) && pct >= 10 && pct <= 400 ? Math.round(pct) : 100
|
|
64
|
+
if (area.trim()) {
|
|
65
|
+
const rects = parseRangeText(area)
|
|
66
|
+
if (!rects) { problem = t('pageSetup.invalidArea', { text: area }); return null }
|
|
67
|
+
next.printArea = rects
|
|
68
|
+
} else next.printArea = null
|
|
69
|
+
if (titles.trim()) {
|
|
70
|
+
const m = /^\$?(\d+)\s*:\s*\$?(\d+)$/.exec(titles.trim()) ?? /^\$?(\d+)$/.exec(titles.trim())
|
|
71
|
+
if (!m) { problem = t('pageSetup.invalidRows', { text: titles }); return null }
|
|
72
|
+
const a = Number(m[1]) - 1
|
|
73
|
+
const b = Number(m[2] ?? m[1]) - 1
|
|
74
|
+
if (a < 0 || b < a) { problem = t('pageSetup.invalidRows', { text: titles }); return null }
|
|
75
|
+
next.printTitleRows = [a, b]
|
|
76
|
+
} else next.printTitleRows = null
|
|
77
|
+
next.gridlines = gridlines
|
|
78
|
+
next.headings = headings
|
|
79
|
+
problem = null
|
|
80
|
+
return next
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function ok() {
|
|
84
|
+
const next = read()
|
|
85
|
+
if (!next) return
|
|
86
|
+
open = false
|
|
87
|
+
onApply(next)
|
|
88
|
+
onClose?.()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function print() {
|
|
92
|
+
const next = read()
|
|
93
|
+
if (!next) return
|
|
94
|
+
open = false
|
|
95
|
+
onApply(next)
|
|
96
|
+
onPrint()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function close() {
|
|
100
|
+
open = false
|
|
101
|
+
onClose?.()
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<SvModal bind:open onClose={onClose} title={t('pageSetup.title')} size="sm" width={420}>
|
|
106
|
+
<form class="sv-sheet-dialog" onsubmit={(e) => { e.preventDefault(); ok() }}>
|
|
107
|
+
<label class="field">
|
|
108
|
+
<span>{t('pageSetup.orientation')}</span>
|
|
109
|
+
<select bind:this={first} bind:value={orientation}>
|
|
110
|
+
<option value="portrait">{t('pageSetup.portrait')}</option>
|
|
111
|
+
<option value="landscape">{t('pageSetup.landscape')}</option>
|
|
112
|
+
</select>
|
|
113
|
+
</label>
|
|
114
|
+
<label class="field">
|
|
115
|
+
<span>{t('pageSetup.paper')}</span>
|
|
116
|
+
<select bind:value={paper}>
|
|
117
|
+
{#each PAPERS as p (p)}<option value={p}>{p}</option>{/each}
|
|
118
|
+
</select>
|
|
119
|
+
</label>
|
|
120
|
+
<label class="field">
|
|
121
|
+
<span>{t('pageSetup.margins')}</span>
|
|
122
|
+
<select bind:value={margins}>
|
|
123
|
+
<option value="normal">{t('pageSetup.margins.normal')}</option>
|
|
124
|
+
<option value="narrow">{t('pageSetup.margins.narrow')}</option>
|
|
125
|
+
<option value="wide">{t('pageSetup.margins.wide')}</option>
|
|
126
|
+
{#if margins === 'custom'}<option value="custom">{t('pageSetup.margins.custom')}</option>{/if}
|
|
127
|
+
</select>
|
|
128
|
+
</label>
|
|
129
|
+
<label class="field">
|
|
130
|
+
<span>{t('pageSetup.scale')}</span>
|
|
131
|
+
<input type="number" min="10" max="400" bind:value={scale} />
|
|
132
|
+
</label>
|
|
133
|
+
<label class="field">
|
|
134
|
+
<span>{t('pageSetup.printArea')}</span>
|
|
135
|
+
<input type="text" bind:value={area} spellcheck="false" placeholder={t('pageSetup.printAreaPlaceholder')} />
|
|
136
|
+
</label>
|
|
137
|
+
<label class="field">
|
|
138
|
+
<span>{t('pageSetup.titleRows')}</span>
|
|
139
|
+
<input type="text" bind:value={titles} spellcheck="false" placeholder={t('pageSetup.titleRowsPlaceholder')} />
|
|
140
|
+
</label>
|
|
141
|
+
<div class="checks">
|
|
142
|
+
<label class="check"><input type="checkbox" bind:checked={gridlines} /> {t('pageSetup.gridlines')}</label>
|
|
143
|
+
<label class="check"><input type="checkbox" bind:checked={headings} /> {t('pageSetup.headings')}</label>
|
|
144
|
+
</div>
|
|
145
|
+
{#if problem}<p class="status problem" role="alert">{problem}</p>{/if}
|
|
146
|
+
</form>
|
|
147
|
+
{#snippet footer()}
|
|
148
|
+
<div class="sv-sheet-dialog-buttons">
|
|
149
|
+
<button type="button" class="btn" onclick={print}>{t('pageSetup.print')}</button>
|
|
150
|
+
<span class="spacer"></span>
|
|
151
|
+
<button type="button" class="btn primary" onclick={ok}>{t('ok')}</button>
|
|
152
|
+
<button type="button" class="btn" onclick={close}>{t('cancel')}</button>
|
|
153
|
+
</div>
|
|
154
|
+
{/snippet}
|
|
155
|
+
</SvModal>
|
|
156
|
+
|
|
157
|
+
<style>
|
|
158
|
+
.spacer { flex: 1; }
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PageSetup } from './sheet/page-setup.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
/** The sheet's setup as it stands. */
|
|
5
|
+
setup: PageSetup;
|
|
6
|
+
onApply: (setup: PageSetup) => void;
|
|
7
|
+
/** Print...: the shell applies and prints. */
|
|
8
|
+
onPrint: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const SvSheetPageSetup: import("svelte").Component<Props, {}, "open">;
|
|
12
|
+
type SvSheetPageSetup = ReturnType<typeof SvSheetPageSetup>;
|
|
13
|
+
export default SvSheetPageSetup;
|