@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,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gantt-resources - who is booked on what, and where that exceeds what they can
|
|
3
|
+
* take. Pure and framework-free, like every model in this folder.
|
|
4
|
+
*
|
|
5
|
+
* The question a planner asks of a Gantt is not "what is assigned" (the table
|
|
6
|
+
* already says that) but "where am I over-committed". So the output is a grid:
|
|
7
|
+
* one row per resource, one cell per axis column, holding how many of that
|
|
8
|
+
* resource's tasks touch the column and whether that is more than its capacity.
|
|
9
|
+
*
|
|
10
|
+
* One definition worth stating, because a histogram that quietly means
|
|
11
|
+
* something else is worse than none: a cell's `load` is **how many of that
|
|
12
|
+
* resource's tasks overlap the column**, not an average and not a
|
|
13
|
+
* person-hours figure. On a day-granular axis that is exactly concurrency -
|
|
14
|
+
* three bars over Tuesday reads 3. On a coarser axis (weeks, months) it counts
|
|
15
|
+
* everything touching the column, which reads high rather than low: a month
|
|
16
|
+
* showing 4 is a month with four jobs in it, whoever they overlap.
|
|
17
|
+
*/
|
|
18
|
+
import type { SchedulerResource } from '@svgrid/grid';
|
|
19
|
+
/** A task as the histogram needs it: a span and who is on it. */
|
|
20
|
+
export type ResourceAssignment = {
|
|
21
|
+
key: string;
|
|
22
|
+
resource: string;
|
|
23
|
+
start: Date;
|
|
24
|
+
end: Date;
|
|
25
|
+
};
|
|
26
|
+
/** One column of one resource's strip. */
|
|
27
|
+
export type ResourceLoadCell = {
|
|
28
|
+
load: number;
|
|
29
|
+
/** Past what this resource can take. */
|
|
30
|
+
over: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type ResourceLoadRow = {
|
|
33
|
+
id: string;
|
|
34
|
+
label: string;
|
|
35
|
+
capacity: number;
|
|
36
|
+
cells: ResourceLoadCell[];
|
|
37
|
+
/** The busiest column, for scaling the bars and for a "peak 4" caption. */
|
|
38
|
+
peak: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Sum `assignments` into a per-resource, per-column grid.
|
|
42
|
+
*
|
|
43
|
+
* `resources` fixes the rows and their order; pass none and the rows are every
|
|
44
|
+
* resource named by an assignment, in first-seen order, so a plan that just
|
|
45
|
+
* types owner names into a field still gets a histogram.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resourceLoad(assignments: ReadonlyArray<ResourceAssignment>, columns: ReadonlyArray<{
|
|
48
|
+
start: Date;
|
|
49
|
+
end: Date;
|
|
50
|
+
}>, opts?: {
|
|
51
|
+
resources?: ReadonlyArray<SchedulerResource> | null;
|
|
52
|
+
/** A resource's capacity; anything above it is an over-allocation. */
|
|
53
|
+
capacityOf?: (id: string) => number;
|
|
54
|
+
}): ResourceLoadRow[];
|
|
55
|
+
/**
|
|
56
|
+
* The resource ids that are over capacity somewhere, for a toolbar count or a
|
|
57
|
+
* warning badge. Order follows {@link resourceLoad}'s rows.
|
|
58
|
+
*/
|
|
59
|
+
export declare function overallocations(rows: ReadonlyArray<ResourceLoadRow>): string[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sum `assignments` into a per-resource, per-column grid.
|
|
3
|
+
*
|
|
4
|
+
* `resources` fixes the rows and their order; pass none and the rows are every
|
|
5
|
+
* resource named by an assignment, in first-seen order, so a plan that just
|
|
6
|
+
* types owner names into a field still gets a histogram.
|
|
7
|
+
*/
|
|
8
|
+
export function resourceLoad(assignments, columns, opts = {}) {
|
|
9
|
+
const capacityOf = opts.capacityOf ?? (() => 1);
|
|
10
|
+
const order = [];
|
|
11
|
+
const labels = new Map();
|
|
12
|
+
if (opts.resources?.length) {
|
|
13
|
+
for (const r of opts.resources) {
|
|
14
|
+
const id = String(r.id);
|
|
15
|
+
if (labels.has(id))
|
|
16
|
+
continue;
|
|
17
|
+
order.push(id);
|
|
18
|
+
labels.set(id, r.title ?? id);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
for (const a of assignments) {
|
|
23
|
+
if (labels.has(a.resource))
|
|
24
|
+
continue;
|
|
25
|
+
order.push(a.resource);
|
|
26
|
+
labels.set(a.resource, a.resource);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Bucket the assignments by resource once, so the column scan below is
|
|
30
|
+
// O(columns x that resource's tasks) rather than O(columns x every task).
|
|
31
|
+
const byResource = new Map();
|
|
32
|
+
for (const a of assignments) {
|
|
33
|
+
if (!labels.has(a.resource))
|
|
34
|
+
continue;
|
|
35
|
+
if (a.end.getTime() <= a.start.getTime())
|
|
36
|
+
continue;
|
|
37
|
+
const list = byResource.get(a.resource);
|
|
38
|
+
if (list)
|
|
39
|
+
list.push(a);
|
|
40
|
+
else
|
|
41
|
+
byResource.set(a.resource, [a]);
|
|
42
|
+
}
|
|
43
|
+
const rows = [];
|
|
44
|
+
for (const id of order) {
|
|
45
|
+
const mine = byResource.get(id) ?? [];
|
|
46
|
+
const capacity = Math.max(1, capacityOf(id));
|
|
47
|
+
const cells = [];
|
|
48
|
+
let peak = 0;
|
|
49
|
+
for (const col of columns) {
|
|
50
|
+
const from = col.start.getTime();
|
|
51
|
+
const to = col.end.getTime();
|
|
52
|
+
let load = 0;
|
|
53
|
+
for (const a of mine) {
|
|
54
|
+
if (a.start.getTime() < to && a.end.getTime() > from)
|
|
55
|
+
load++;
|
|
56
|
+
}
|
|
57
|
+
if (load > peak)
|
|
58
|
+
peak = load;
|
|
59
|
+
cells.push({ load, over: load > capacity });
|
|
60
|
+
}
|
|
61
|
+
rows.push({ id, label: labels.get(id) ?? id, capacity, cells, peak });
|
|
62
|
+
}
|
|
63
|
+
return rows;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The resource ids that are over capacity somewhere, for a toolbar count or a
|
|
67
|
+
* warning badge. Order follows {@link resourceLoad}'s rows.
|
|
68
|
+
*/
|
|
69
|
+
export function overallocations(rows) {
|
|
70
|
+
return rows.filter((r) => r.cells.some((c) => c.over)).map((r) => r.id);
|
|
71
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register the Enterprise Gantt view. Idempotent - safe to call from every
|
|
3
|
+
* component that uses `gantt`, or once at app start. Also invoked by
|
|
4
|
+
* {@link installEnterprise} so wiring the Pro API turns the view on too.
|
|
5
|
+
*/
|
|
6
|
+
export declare function enableGanttView(): void;
|
|
7
|
+
export { default as SvGridGantt } from './SvGridGantt.svelte';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gantt (view) - registers the Enterprise Gantt renderer with the grid so
|
|
3
|
+
* `<SvGrid gantt={...}>` renders a task table beside a time chart instead of
|
|
4
|
+
* the table. The grid ships the `gantt` prop and its config types for free; the
|
|
5
|
+
* *renderer* (SvGridGantt) is Pro and plugs in through the grid's
|
|
6
|
+
* `registerGanttView` seam.
|
|
7
|
+
*
|
|
8
|
+
* Like the rest of Enterprise it runs without a license key during the
|
|
9
|
+
* evaluation; the grid shows the watermark and a one-time console notice.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { setLicenseKey, enableGanttView } from '@svgrid/enterprise'
|
|
13
|
+
* setLicenseKey('YOUR-KEY')
|
|
14
|
+
* enableGanttView()
|
|
15
|
+
* // then: <SvGrid {data} {columns} gantt={{ startField: 'start', endField: 'end' }} />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import { registerGanttView } from '@svgrid/grid';
|
|
19
|
+
import { isLicenseKeySet } from '../license.js';
|
|
20
|
+
import { emitUnlicensedNudge } from '../watermark.js';
|
|
21
|
+
import SvGridGantt from './SvGridGantt.svelte';
|
|
22
|
+
let enabled = false;
|
|
23
|
+
/**
|
|
24
|
+
* Register the Enterprise Gantt view. Idempotent - safe to call from every
|
|
25
|
+
* component that uses `gantt`, or once at app start. Also invoked by
|
|
26
|
+
* {@link installEnterprise} so wiring the Pro API turns the view on too.
|
|
27
|
+
*/
|
|
28
|
+
export function enableGanttView() {
|
|
29
|
+
if (enabled)
|
|
30
|
+
return;
|
|
31
|
+
enabled = true;
|
|
32
|
+
registerGanttView(SvGridGantt);
|
|
33
|
+
if (!isLicenseKeySet())
|
|
34
|
+
emitUnlicensedNudge();
|
|
35
|
+
}
|
|
36
|
+
export { default as SvGridGantt } from './SvGridGantt.svelte';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@svgrid/enterprise/gantt` - the Gantt view, as its own entry point for apps
|
|
3
|
+
* that want the project chart without pulling the rest of the Pro pack. Every
|
|
4
|
+
* name here is also re-exported from the package root, so
|
|
5
|
+
* `import { enableGanttView } from '@svgrid/enterprise'` works just as well.
|
|
6
|
+
*
|
|
7
|
+
* The `gantt` prop and its config types live in `@svgrid/grid`; this package
|
|
8
|
+
* holds the renderer, the layout model and the planning helpers.
|
|
9
|
+
*/
|
|
10
|
+
export { enableGanttView, SvGridGantt } from './gantt.js';
|
|
11
|
+
export type { GanttProConfig, GanttConstraint } from './gantt-config.js';
|
|
12
|
+
export { resolveTasks, parseDay, type GanttTaskSpec, type ResolvedTask, ganttTree, nodeIndex, visibleAnchor, type GanttNode, projectRange, ganttAxis, ganttTickWidth, ganttScale, type GanttScale, type GanttSegment, makeCalendar, startOfDay, addDays, isWorkingDay, workingDays, addWorkingDays, startForWorkingDays, moveWorkingSpan, snapToWorkingDay, type WorkingCalendar, } from './gantt-model.js';
|
|
13
|
+
export { criticalPath, slackDays, type CpmResult, } from './gantt-critical-path.js';
|
|
14
|
+
export { resourceLoad, overallocations, type ResourceAssignment, type ResourceLoadCell, type ResourceLoadRow, } from './gantt-resources.js';
|
|
15
|
+
export { dependencyArrows, elbowPath, type Arrow, type ArrowLink, type BarRect, } from './timeline-arrows.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@svgrid/enterprise/gantt` - the Gantt view, as its own entry point for apps
|
|
3
|
+
* that want the project chart without pulling the rest of the Pro pack. Every
|
|
4
|
+
* name here is also re-exported from the package root, so
|
|
5
|
+
* `import { enableGanttView } from '@svgrid/enterprise'` works just as well.
|
|
6
|
+
*
|
|
7
|
+
* The `gantt` prop and its config types live in `@svgrid/grid`; this package
|
|
8
|
+
* holds the renderer, the layout model and the planning helpers.
|
|
9
|
+
*/
|
|
10
|
+
export { enableGanttView, SvGridGantt } from './gantt.js';
|
|
11
|
+
export {
|
|
12
|
+
// resolving rows into bars
|
|
13
|
+
resolveTasks, parseDay,
|
|
14
|
+
// the work-breakdown tree
|
|
15
|
+
ganttTree, nodeIndex, visibleAnchor,
|
|
16
|
+
// the window and the axis
|
|
17
|
+
projectRange, ganttAxis, ganttTickWidth, ganttScale,
|
|
18
|
+
// working-time arithmetic
|
|
19
|
+
makeCalendar, startOfDay, addDays, isWorkingDay, workingDays, addWorkingDays, startForWorkingDays, moveWorkingSpan, snapToWorkingDay, } from './gantt-model.js';
|
|
20
|
+
export { criticalPath, slackDays, } from './gantt-critical-path.js';
|
|
21
|
+
export { resourceLoad, overallocations, } from './gantt-resources.js';
|
|
22
|
+
export { dependencyArrows, elbowPath, } from './timeline-arrows.js';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* timeline-arrows - the pure geometry behind dependency arrows, shared by the
|
|
3
|
+
* Scheduler's timeline views and the Gantt chart. No Svelte, no DOM: bar
|
|
4
|
+
* rectangles in, SVG path strings out.
|
|
5
|
+
*
|
|
6
|
+
* This lived inside SvGridScheduler.svelte until the Gantt needed the same
|
|
7
|
+
* elbows. Two copies of a connector routine is how two views end up drawing
|
|
8
|
+
* the same link differently, so it moved here and both call it.
|
|
9
|
+
*
|
|
10
|
+
* Coordinates are pixels in the lane area's own space (the caller offsets past
|
|
11
|
+
* any resource gutter), y is the vertical centre of a bar.
|
|
12
|
+
*/
|
|
13
|
+
import type { DependencyType } from '../scheduler-dependencies.js';
|
|
14
|
+
/**
|
|
15
|
+
* Where one task's bar sits: its two horizontal edges and its vertical centre.
|
|
16
|
+
* `halfH` is half the bar's height; give it for a bar an arrow may enter
|
|
17
|
+
* from above or below (a plain task bar), leave it out for one that must be
|
|
18
|
+
* entered from the side (a milestone's diamond, a summary's thin spine).
|
|
19
|
+
*/
|
|
20
|
+
export type BarRect = {
|
|
21
|
+
left: number;
|
|
22
|
+
right: number;
|
|
23
|
+
midY: number;
|
|
24
|
+
halfH?: number;
|
|
25
|
+
/** A milestone's diamond: `left` / `right` are its side corners. */
|
|
26
|
+
kind?: 'milestone';
|
|
27
|
+
};
|
|
28
|
+
/** Which way the arrowhead points. */
|
|
29
|
+
export type ArrowDir = 'right' | 'left' | 'down' | 'up';
|
|
30
|
+
/** One drawn arrow: the elbow path, plus the arrowhead's tip and whether the
|
|
31
|
+
* link is currently violated (drawn dashed / red by the caller). */
|
|
32
|
+
export type Arrow = {
|
|
33
|
+
id: string;
|
|
34
|
+
/** The `d` of the connector path. */
|
|
35
|
+
d: string;
|
|
36
|
+
bad: boolean;
|
|
37
|
+
/** Arrowhead tip x. */
|
|
38
|
+
hx: number;
|
|
39
|
+
/** Arrowhead tip y. */
|
|
40
|
+
hy: number;
|
|
41
|
+
/** Which way the head points: `right` / `left` into a side, `down` / `up` into an edge. */
|
|
42
|
+
dir: ArrowDir;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Orthogonal elbow connector between two anchor points. The simple case leaves
|
|
46
|
+
* the predecessor, turns once, and arrives at the successor. When the
|
|
47
|
+
* successor's start is less than a stub past the predecessor's finish - a
|
|
48
|
+
* backward link, or simply two tasks scheduled back to back at a coarse zoom -
|
|
49
|
+
* a straight elbow would run back through a bar, so the path steps down (or
|
|
50
|
+
* up) to the boundary between the two rows, runs back along it, and approaches
|
|
51
|
+
* the successor from its left.
|
|
52
|
+
*
|
|
53
|
+
* `rowDy` is the caller's row (lane) pitch. The detour runs half of it, which
|
|
54
|
+
* is the gap between the bars of two adjacent rows: a full row would land the
|
|
55
|
+
* backward segment on the successor's own centre line and draw it straight
|
|
56
|
+
* across the bar it is meant to point at.
|
|
57
|
+
*/
|
|
58
|
+
export declare function elbowPath(x1: number, y1: number, x2: number, y2: number, rowDy: number): string;
|
|
59
|
+
/** The link shape a dependency needs, structurally shared by the scheduler's
|
|
60
|
+
* `SchedulerDependency` and the grid's `GanttDependency`. */
|
|
61
|
+
export type ArrowLink = {
|
|
62
|
+
id: string;
|
|
63
|
+
from: string;
|
|
64
|
+
to: string;
|
|
65
|
+
type?: DependencyType;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* One arrow per link whose BOTH ends have a rectangle in `rects`. A link
|
|
69
|
+
* pointing at a row that is filtered out (or inside a collapsed subtree the
|
|
70
|
+
* caller did not re-anchor) simply has no arrow - it is not an error.
|
|
71
|
+
*
|
|
72
|
+
* The link type picks which edges to join: the predecessor's start for `SS` /
|
|
73
|
+
* `SF` and its finish otherwise, the successor's finish for `FF` / `SF` and
|
|
74
|
+
* its start otherwise.
|
|
75
|
+
*
|
|
76
|
+
* Two tasks scheduled back to back - the successor starting where the
|
|
77
|
+
* predecessor finishes, the everyday case in a plan - put the successor's
|
|
78
|
+
* start under the stub the arrow leaves by. An elbow there has to hook back
|
|
79
|
+
* on itself to reach the start edge from the left, which at a coarse zoom is
|
|
80
|
+
* a scribble beside every bar. So a finish-anchored link whose successor bar
|
|
81
|
+
* runs under the stub is drawn the way planners draw it: out of the
|
|
82
|
+
* predecessor, across the stub, straight down (or up) into the successor's
|
|
83
|
+
* edge, head pointing at the bar. The successor needs a `halfH` for that; a
|
|
84
|
+
* milestone or a summary is always entered from the side.
|
|
85
|
+
*/
|
|
86
|
+
export declare function dependencyArrows(rects: ReadonlyMap<string, BarRect>, links: ReadonlyArray<ArrowLink>, badIds: ReadonlySet<string>, loopDy: number): Arrow[];
|
|
87
|
+
/** The arrowhead's `d` for a tip at (hx, hy) pointing `dir`: 6px long, 7px wide. */
|
|
88
|
+
export declare function arrowHeadPath(hx: number, hy: number, dir: ArrowDir): string;
|
|
89
|
+
/** The vertices of a connector path, as `elbowPath` writes them. */
|
|
90
|
+
export declare function pathPoints(d: string): Array<[number, number]>;
|
|
91
|
+
/** Distance from a point to a polyline, in the same units. */
|
|
92
|
+
export declare function distanceToPath(points: ReadonlyArray<readonly [number, number]>, x: number, y: number): number;
|
|
93
|
+
/**
|
|
94
|
+
* The arrow under a point, if any is within `tolerance` px - how a right-click
|
|
95
|
+
* on the chart body finds the link it landed on. The arrows layer takes no
|
|
96
|
+
* pointer events of its own (bars have to stay draggable underneath it), so
|
|
97
|
+
* the hit test is done here, on the geometry. The nearest wins when arrows
|
|
98
|
+
* overlap.
|
|
99
|
+
*/
|
|
100
|
+
export declare function nearestArrow<T extends {
|
|
101
|
+
d: string;
|
|
102
|
+
}>(arrows: ReadonlyArray<T>, x: number, y: number, tolerance: number): T | null;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/** The minimum a connector stands off a bar's edge before it turns, in px. */
|
|
2
|
+
const STUB = 10;
|
|
3
|
+
/**
|
|
4
|
+
* Orthogonal elbow connector between two anchor points. The simple case leaves
|
|
5
|
+
* the predecessor, turns once, and arrives at the successor. When the
|
|
6
|
+
* successor's start is less than a stub past the predecessor's finish - a
|
|
7
|
+
* backward link, or simply two tasks scheduled back to back at a coarse zoom -
|
|
8
|
+
* a straight elbow would run back through a bar, so the path steps down (or
|
|
9
|
+
* up) to the boundary between the two rows, runs back along it, and approaches
|
|
10
|
+
* the successor from its left.
|
|
11
|
+
*
|
|
12
|
+
* `rowDy` is the caller's row (lane) pitch. The detour runs half of it, which
|
|
13
|
+
* is the gap between the bars of two adjacent rows: a full row would land the
|
|
14
|
+
* backward segment on the successor's own centre line and draw it straight
|
|
15
|
+
* across the bar it is meant to point at.
|
|
16
|
+
*/
|
|
17
|
+
export function elbowPath(x1, y1, x2, y2, rowDy) {
|
|
18
|
+
const p = x1 + STUB;
|
|
19
|
+
if (x2 >= p)
|
|
20
|
+
return `M${x1},${y1} L${p},${y1} L${p},${y2} L${x2},${y2}`;
|
|
21
|
+
const q = x2 - STUB;
|
|
22
|
+
const half = rowDy / 2;
|
|
23
|
+
const midY = y2 >= y1 ? y1 + half : y1 - half;
|
|
24
|
+
return `M${x1},${y1} L${p},${y1} L${p},${midY} L${q},${midY} L${q},${y2} L${x2},${y2}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One arrow per link whose BOTH ends have a rectangle in `rects`. A link
|
|
28
|
+
* pointing at a row that is filtered out (or inside a collapsed subtree the
|
|
29
|
+
* caller did not re-anchor) simply has no arrow - it is not an error.
|
|
30
|
+
*
|
|
31
|
+
* The link type picks which edges to join: the predecessor's start for `SS` /
|
|
32
|
+
* `SF` and its finish otherwise, the successor's finish for `FF` / `SF` and
|
|
33
|
+
* its start otherwise.
|
|
34
|
+
*
|
|
35
|
+
* Two tasks scheduled back to back - the successor starting where the
|
|
36
|
+
* predecessor finishes, the everyday case in a plan - put the successor's
|
|
37
|
+
* start under the stub the arrow leaves by. An elbow there has to hook back
|
|
38
|
+
* on itself to reach the start edge from the left, which at a coarse zoom is
|
|
39
|
+
* a scribble beside every bar. So a finish-anchored link whose successor bar
|
|
40
|
+
* runs under the stub is drawn the way planners draw it: out of the
|
|
41
|
+
* predecessor, across the stub, straight down (or up) into the successor's
|
|
42
|
+
* edge, head pointing at the bar. The successor needs a `halfH` for that; a
|
|
43
|
+
* milestone or a summary is always entered from the side.
|
|
44
|
+
*/
|
|
45
|
+
export function dependencyArrows(rects, links, badIds, loopDy) {
|
|
46
|
+
const out = [];
|
|
47
|
+
for (const dep of links) {
|
|
48
|
+
const a = rects.get(dep.from);
|
|
49
|
+
const b = rects.get(dep.to);
|
|
50
|
+
if (!a || !b)
|
|
51
|
+
continue;
|
|
52
|
+
const type = dep.type ?? 'FS';
|
|
53
|
+
const bad = badIds.has(dep.id);
|
|
54
|
+
const y1 = a.midY;
|
|
55
|
+
const y2 = b.midY;
|
|
56
|
+
if (type === 'SS') {
|
|
57
|
+
// Out of the predecessor's START, leftwards, so the stub never runs
|
|
58
|
+
// through its own bar; down; and into the successor's start from the
|
|
59
|
+
// left. The stub stands off whichever start is further left.
|
|
60
|
+
const x1 = a.left;
|
|
61
|
+
const x2 = b.left;
|
|
62
|
+
const q = Math.min(x1, x2) - STUB;
|
|
63
|
+
out.push({ id: dep.id, d: `M${x1},${y1} L${q},${y1} L${q},${y2} L${x2},${y2}`, bad, hx: x2, hy: y2, dir: 'right' });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (type === 'FF') {
|
|
67
|
+
// Out of the predecessor's finish, rightwards past whichever finish is
|
|
68
|
+
// further right, down, and into the successor's finish from the RIGHT -
|
|
69
|
+
// arriving from the left would run the length of the successor's bar.
|
|
70
|
+
const x1 = a.right;
|
|
71
|
+
const x2 = b.right;
|
|
72
|
+
const p = Math.max(x1, x2) + STUB;
|
|
73
|
+
out.push({ id: dep.id, d: `M${x1},${y1} L${p},${y1} L${p},${y2} L${x2},${y2}`, bad, hx: x2, hy: y2, dir: 'left' });
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (type === 'SF') {
|
|
77
|
+
// Out of the predecessor's start leftwards, into the successor's
|
|
78
|
+
// finish from the right. Legal, the successor ends before the
|
|
79
|
+
// predecessor starts and one turn does it; when it does not, step to
|
|
80
|
+
// the row boundary and round.
|
|
81
|
+
const x1 = a.left;
|
|
82
|
+
const x2 = b.right;
|
|
83
|
+
const q = x1 - STUB;
|
|
84
|
+
if (x2 + STUB <= q) {
|
|
85
|
+
out.push({ id: dep.id, d: `M${x1},${y1} L${q},${y1} L${q},${y2} L${x2},${y2}`, bad, hx: x2, hy: y2, dir: 'left' });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const midY = y2 >= y1 ? y1 + loopDy / 2 : y1 - loopDy / 2;
|
|
89
|
+
const r = x2 + STUB;
|
|
90
|
+
out.push({
|
|
91
|
+
id: dep.id,
|
|
92
|
+
d: `M${x1},${y1} L${q},${y1} L${q},${midY} L${r},${midY} L${r},${y2} L${x2},${y2}`,
|
|
93
|
+
bad, hx: x2, hy: y2, dir: 'left',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
// FS, the everyday link: out of the finish, into the start.
|
|
99
|
+
const x1 = a.right;
|
|
100
|
+
const x2 = b.left;
|
|
101
|
+
const p = x1 + STUB;
|
|
102
|
+
// A milestone that follows its predecessor: its diamond sits under the
|
|
103
|
+
// stub, so the arrow drops onto the apex nearest the predecessor - a
|
|
104
|
+
// straight line down from the finish - rather than hooking round to a
|
|
105
|
+
// side corner.
|
|
106
|
+
if (b.kind === 'milestone' && y1 !== y2) {
|
|
107
|
+
const cx = (b.left + b.right) / 2;
|
|
108
|
+
const r = (b.right - b.left) / 2;
|
|
109
|
+
if (cx >= x1 - 0.5 && cx < p) {
|
|
110
|
+
const below = y2 > y1;
|
|
111
|
+
const yApex = below ? y2 - r : y2 + r;
|
|
112
|
+
out.push({ id: dep.id, d: `M${x1},${y1} L${cx},${y1} L${cx},${yApex}`, bad, hx: cx, hy: yApex, dir: below ? 'down' : 'up' });
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Back to back: the successor's start is under the stub, so drop into
|
|
117
|
+
// its top (or rise into its bottom) rather than hook back to the start.
|
|
118
|
+
if (b.halfH != null && x2 < p && y1 !== y2 && b.left <= p && p <= b.right - 3) {
|
|
119
|
+
const below = y2 > y1;
|
|
120
|
+
const yEdge = below ? y2 - b.halfH : y2 + b.halfH;
|
|
121
|
+
out.push({ id: dep.id, d: `M${x1},${y1} L${p},${y1} L${p},${yEdge}`, bad, hx: p, hy: yEdge, dir: below ? 'down' : 'up' });
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
out.push({ id: dep.id, d: elbowPath(x1, y1, x2, y2, loopDy), bad, hx: x2, hy: y2, dir: 'right' });
|
|
125
|
+
}
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
/** The arrowhead's `d` for a tip at (hx, hy) pointing `dir`: 6px long, 7px wide. */
|
|
129
|
+
export function arrowHeadPath(hx, hy, dir) {
|
|
130
|
+
if (dir === 'down')
|
|
131
|
+
return `M${hx},${hy} l-3.5,-6 l7,0 z`;
|
|
132
|
+
if (dir === 'up')
|
|
133
|
+
return `M${hx},${hy} l-3.5,6 l7,0 z`;
|
|
134
|
+
if (dir === 'left')
|
|
135
|
+
return `M${hx},${hy} l6,-3.5 l0,7 z`;
|
|
136
|
+
return `M${hx},${hy} l-6,-3.5 l0,7 z`;
|
|
137
|
+
}
|
|
138
|
+
/** The vertices of a connector path, as `elbowPath` writes them. */
|
|
139
|
+
export function pathPoints(d) {
|
|
140
|
+
const out = [];
|
|
141
|
+
for (const m of d.matchAll(/[ML]\s*(-?[\d.]+),(-?[\d.]+)/g)) {
|
|
142
|
+
out.push([Number(m[1]), Number(m[2])]);
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
/** Distance from a point to a polyline, in the same units. */
|
|
147
|
+
export function distanceToPath(points, x, y) {
|
|
148
|
+
let best = Infinity;
|
|
149
|
+
for (let i = 1; i < points.length; i++) {
|
|
150
|
+
const [ax, ay] = points[i - 1];
|
|
151
|
+
const [bx, by] = points[i];
|
|
152
|
+
const dx = bx - ax;
|
|
153
|
+
const dy = by - ay;
|
|
154
|
+
const len2 = dx * dx + dy * dy;
|
|
155
|
+
// Where the perpendicular from the point lands on the segment, clamped to it.
|
|
156
|
+
const t = len2 === 0 ? 0 : Math.max(0, Math.min(1, ((x - ax) * dx + (y - ay) * dy) / len2));
|
|
157
|
+
const px = ax + t * dx;
|
|
158
|
+
const py = ay + t * dy;
|
|
159
|
+
best = Math.min(best, Math.hypot(x - px, y - py));
|
|
160
|
+
}
|
|
161
|
+
return best;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The arrow under a point, if any is within `tolerance` px - how a right-click
|
|
165
|
+
* on the chart body finds the link it landed on. The arrows layer takes no
|
|
166
|
+
* pointer events of its own (bars have to stay draggable underneath it), so
|
|
167
|
+
* the hit test is done here, on the geometry. The nearest wins when arrows
|
|
168
|
+
* overlap.
|
|
169
|
+
*/
|
|
170
|
+
export function nearestArrow(arrows, x, y, tolerance) {
|
|
171
|
+
let hit = null;
|
|
172
|
+
let best = tolerance;
|
|
173
|
+
for (const a of arrows) {
|
|
174
|
+
const dist = distanceToPath(pathPoints(a.d), x, y);
|
|
175
|
+
if (dist <= best) {
|
|
176
|
+
best = dist;
|
|
177
|
+
hit = a;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return hit;
|
|
181
|
+
}
|
package/dist/import.d.ts
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*
|
|
21
21
|
* await api.importData({ file, format: 'auto', commit: true })
|
|
22
22
|
*
|
|
23
|
-
* Both go through the same polite license
|
|
23
|
+
* Both go through the same polite license check as `exportData` and
|
|
24
24
|
* `print`, so unlicensed evaluation works but emits a one-time nudge.
|
|
25
25
|
*/
|
|
26
26
|
import type { RowData, SvGridApi, TableFeatures } from '@svgrid/grid';
|
|
27
27
|
/** Source formats `importGrid` reads. `'auto'` picks one from the file extension. */
|
|
28
28
|
export type ImportFormat = 'xlsx' | 'csv' | 'tsv' | 'json' | 'auto';
|
|
29
29
|
/** Maps a source header to the row field it populates, for files whose columns do not match your data. */
|
|
30
|
-
export type ImportColumnMap = Record<string, string>;
|
|
30
|
+
export type ImportColumnMap = Record<string, string | null>;
|
|
31
31
|
/**
|
|
32
32
|
* Declared data type per target field. When `columnTypes` is set on
|
|
33
33
|
* `ImportOptions`, the parser tries to coerce each non-empty cell into
|
package/dist/import.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* await api.importData({ file, format: 'auto', commit: true })
|
|
22
22
|
*
|
|
23
|
-
* Both go through the same polite license
|
|
23
|
+
* Both go through the same polite license check as `exportData` and
|
|
24
24
|
* `print`, so unlicensed evaluation works but emits a one-time nudge.
|
|
25
25
|
*/
|
|
26
26
|
import { assertEnterpriseLicensed } from './license.js';
|