@svgrid/enterprise 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -95
- package/dist/ExpressionEditorHarness.svelte.d.ts +2 -2
- package/dist/SvAdvancedFilter.svelte.d.ts +2 -2
- package/dist/SvAlertRuleEditor.svelte.d.ts +2 -2
- package/dist/SvAlertsManager.svelte.d.ts +3 -3
- package/dist/SvAlertsPanel.svelte.d.ts +1 -1
- package/dist/SvAuthGate.svelte +115 -115
- package/dist/SvAuthGate.svelte.d.ts +1 -1
- package/dist/SvBoard.svelte.d.ts +1 -1
- package/dist/SvExportMenu.svelte +553 -553
- package/dist/SvExportMenu.svelte.d.ts +2 -2
- package/dist/SvExpressionEditor.svelte.d.ts +2 -2
- package/dist/SvFileInput.svelte +113 -113
- package/dist/SvFormulaBar.svelte +606 -0
- package/dist/SvFormulaBar.svelte.d.ts +62 -0
- package/dist/SvGridAlerts.svelte.d.ts +2 -2
- package/dist/SvGridBoard.svelte +2358 -2358
- package/dist/SvGridBulkEditDrawer.svelte.d.ts +1 -1
- package/dist/SvGridEditPanel.svelte +1157 -1157
- package/dist/SvGridEditPanel.svelte.d.ts +3 -3
- package/dist/SvGridMasterDetail.svelte +116 -116
- package/dist/SvGridMasterDetail.svelte.d.ts +1 -1
- package/dist/SvGridScheduler.svelte +5358 -5358
- package/dist/SvImportDialog.svelte +1020 -1020
- package/dist/SvImportDialog.svelte.d.ts +2 -2
- package/dist/SvLookupInput.svelte +180 -180
- package/dist/SvLookupInput.svelte.d.ts +1 -1
- package/dist/SvPivotDesigner.svelte +2041 -1990
- package/dist/SvPivotDesigner.svelte.d.ts +2 -2
- package/dist/SvRecordDetail.svelte.d.ts +1 -1
- package/dist/SvRibbonIcon.svelte +46 -0
- package/dist/SvRibbonIcon.svelte.d.ts +17 -0
- package/dist/SvSchedule.svelte.d.ts +1 -1
- package/dist/SvSchemaChart.svelte +236 -234
- package/dist/SvSchemaChart.svelte.d.ts +2 -2
- package/dist/SvSchemaDashboard.svelte +130 -130
- package/dist/SvSchemaDashboard.svelte.d.ts +3 -3
- package/dist/SvSheet.svelte +4114 -0
- package/dist/SvSheet.svelte.d.ts +142 -0
- package/dist/SvSheetComment.svelte +98 -0
- package/dist/SvSheetComment.svelte.d.ts +22 -0
- package/dist/SvSheetConditionalFormat.svelte +162 -0
- package/dist/SvSheetConditionalFormat.svelte.d.ts +14 -0
- package/dist/SvSheetDataValidation.svelte +249 -0
- package/dist/SvSheetDataValidation.svelte.d.ts +14 -0
- package/dist/SvSheetFilterMenu.svelte +217 -0
- package/dist/SvSheetFilterMenu.svelte.d.ts +17 -0
- package/dist/SvSheetFindReplace.svelte +132 -0
- package/dist/SvSheetFindReplace.svelte.d.ts +10 -0
- package/dist/SvSheetFormatCells.svelte +421 -0
- package/dist/SvSheetFormatCells.svelte.d.ts +17 -0
- package/dist/SvSheetGoalSeek.svelte +144 -0
- package/dist/SvSheetGoalSeek.svelte.d.ts +12 -0
- package/dist/SvSheetInsertFunction.svelte +147 -0
- package/dist/SvSheetInsertFunction.svelte.d.ts +8 -0
- package/dist/SvSheetListPicker.svelte +89 -0
- package/dist/SvSheetListPicker.svelte.d.ts +16 -0
- package/dist/SvSheetManageRules.svelte +185 -0
- package/dist/SvSheetManageRules.svelte.d.ts +16 -0
- package/dist/SvSheetNameManager.svelte +225 -0
- package/dist/SvSheetNameManager.svelte.d.ts +11 -0
- package/dist/SvSheetPasteSpecial.svelte +105 -0
- package/dist/SvSheetPasteSpecial.svelte.d.ts +12 -0
- package/dist/SvSheetRemoveDuplicates.svelte +149 -0
- package/dist/SvSheetRemoveDuplicates.svelte.d.ts +12 -0
- package/dist/SvSheetRibbon.svelte +1201 -0
- package/dist/SvSheetRibbon.svelte.d.ts +34 -0
- package/dist/SvSheetSizeDialog.svelte +58 -0
- package/dist/SvSheetSizeDialog.svelte.d.ts +11 -0
- package/dist/SvSheetTabs.svelte +441 -0
- package/dist/SvSheetTabs.svelte.d.ts +36 -0
- package/dist/SvSheetTabs.test-harness.svelte.d.ts +17 -0
- package/dist/SvSheetTabs.test-harness.svelte.js +22 -0
- package/dist/SvSheetTextToColumns.svelte +172 -0
- package/dist/SvSheetTextToColumns.svelte.d.ts +13 -0
- package/dist/SvSheetValidationAlert.svelte +83 -0
- package/dist/SvSheetValidationAlert.svelte.d.ts +15 -0
- package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -1
- package/dist/advanced-filter-enable.js +3 -3
- package/dist/alerts/alert-engine-attach.d.ts +2 -2
- package/dist/alerts/alert-engine-attach.js +3 -3
- package/dist/alerts/alert-engine.d.ts +1 -1
- package/dist/alerts/alert-engine.js +2 -2
- package/dist/alerts/alert-formats.d.ts +1 -1
- package/dist/alerts/alert-formats.js +1 -1
- package/dist/alerts/alert-observer.d.ts +3 -3
- package/dist/alerts/alert-observer.js +1 -1
- package/dist/alerts/alert-storage.d.ts +1 -1
- package/dist/alerts/alert-store.svelte.d.ts +1 -1
- package/dist/alerts/alert-types.d.ts +2 -2
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/cdn/svgrid-enterprise.svelte-external.js +19046 -5428
- package/dist/designer/assets/GridMenus-BlsvL_aU.js +8 -0
- package/dist/designer/assets/SvChartMenu-BYO9cYdy.css +1 -0
- package/dist/designer/assets/SvChartMenu-D9hEeHar.js +1 -0
- package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +1 -0
- package/dist/designer/assets/SvDateRangeInput-C0iCCZ8o.css +1 -0
- package/dist/designer/assets/SvDateTimePicker-DARvKUL2.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-DPv09DIT.css +1 -0
- package/dist/designer/assets/{preload-helper-CG0n22O7.js → SvGrid.helpers-BgT-gnCo.js} +1 -1
- package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +4 -0
- package/dist/designer/assets/SvGridChart-B8j1SSy3.js +3 -0
- package/dist/designer/assets/SvGridChart-BgLuPO7I.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-08YWWeqY.css +1 -0
- package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +1 -0
- package/dist/designer/assets/SvGridChartPanel-4Pc8y5yO.css +1 -0
- package/dist/designer/assets/SvGridChartPanel-pT6ITc2P.js +4 -0
- package/dist/designer/assets/SvGridChartView-7msfnWZT.css +1 -0
- package/dist/designer/assets/SvGridChartView-bg281UA1.js +1 -0
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +1 -0
- package/dist/designer/assets/SvGridDropdown-CcidB3rm.css +1 -0
- package/dist/designer/assets/SvListBox-BDS66lmZ.js +110 -0
- package/dist/designer/assets/SvListBox-BXfyqy4a.css +1 -0
- package/dist/designer/assets/SvMenuList-DJ47ba1h.css +1 -0
- package/dist/designer/assets/SvMenuList-Dgq2D5VN.js +1 -0
- package/dist/designer/assets/SvTabs-DKmwb5p1.css +1 -0
- package/dist/designer/assets/SvTabs-UFCMTHXS.js +1 -0
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +1 -0
- package/dist/designer/assets/chart-cIPUsbM5.js +1 -0
- package/dist/designer/assets/chart-export-B6bkQ3X8.js +11 -0
- package/dist/designer/assets/chart-export-pdf-BbA28-gt.js +11 -0
- package/dist/designer/assets/chart-panel-messages-DtTxpBUU.js +1 -0
- package/dist/designer/assets/chart-summary-Czu_5epb.js +1 -0
- package/dist/designer/assets/chart-trend-D5I5VEe8.js +1 -0
- package/dist/designer/assets/chart-validate-BMqM-qkF.js +1 -0
- package/dist/designer/assets/column-resize-BYDzR1Ve.js +1 -0
- package/dist/designer/assets/date-format-B8JbEtIG.js +1 -0
- package/dist/designer/assets/date-format-DKS-z0xS.css +1 -0
- package/dist/designer/assets/editor-contract-Bpoa7A5g.js +1 -0
- package/dist/designer/assets/export-format-D-eP4b2l.js +6 -0
- package/dist/designer/assets/focus-trap-CAreAhlU.js +1 -0
- package/dist/designer/assets/index-CMFgAoVV.css +1 -0
- package/dist/designer/assets/{index-zUBix-JQ.js → index-DwU7CAMm.js} +2985 -141
- package/dist/designer/assets/list-option-BP_dWS66.js +1 -0
- package/dist/designer/assets/preload-helper-HclGiUj8.js +1 -0
- package/dist/designer/assets/row-resize-DLktcqUK.js +1 -0
- package/dist/designer/assets/src-CITpcm6b.js +1 -0
- package/dist/designer/assets/src-EdI3Xqds.js +58 -0
- package/dist/designer/index.html +32 -23
- package/dist/export-conditional.d.ts +1 -1
- package/dist/export-pdf.d.ts +89 -0
- package/dist/export-pdf.js +130 -0
- package/dist/export-print.js +19 -19
- package/dist/export-xls.d.ts +2 -2
- package/dist/export.d.ts +2 -2
- package/dist/export.js +23 -16
- package/dist/expressions/builder-tree.d.ts +2 -2
- package/dist/expressions/builder-tree.js +1 -1
- package/dist/expressions/compile.d.ts +1 -1
- package/dist/import.js +1 -1
- package/dist/index.d.ts +116 -53
- package/dist/index.js +117 -50
- package/dist/install.d.ts +4 -4
- package/dist/install.js +16 -11
- package/dist/license.d.ts +3 -2
- package/dist/license.js +9 -4
- package/dist/node/studio.js +187 -116
- package/dist/pivot-chart.d.ts +26 -2
- package/dist/pivot-chart.js +25 -69
- package/dist/pivot-designer.d.ts +1 -1
- package/dist/pivot-enable.js +3 -3
- package/dist/print.d.ts +1 -1
- package/dist/print.js +4 -4
- package/dist/scheduler-config.d.ts +5 -5
- package/dist/scheduler-freebusy.d.ts +1 -1
- package/dist/scheduler-freebusy.js +1 -1
- package/dist/scheduler.js +2 -2
- package/dist/schema-designer.d.ts +1 -1
- package/dist/schema-designer.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/sheet/address.d.ts +43 -0
- package/dist/sheet/address.js +81 -0
- package/dist/sheet/ast.d.ts +94 -0
- package/dist/sheet/ast.js +56 -0
- package/dist/sheet/auto-filter.d.ts +66 -0
- package/dist/sheet/auto-filter.js +147 -0
- package/dist/sheet/autocomplete.d.ts +42 -0
- package/dist/sheet/autocomplete.js +162 -0
- package/dist/sheet/coerce.d.ts +31 -0
- package/dist/sheet/coerce.js +122 -0
- package/dist/sheet/commands.d.ts +89 -0
- package/dist/sheet/commands.js +230 -0
- package/dist/sheet/comments.d.ts +29 -0
- package/dist/sheet/comments.js +73 -0
- package/dist/sheet/conditional-formats.d.ts +144 -0
- package/dist/sheet/conditional-formats.js +316 -0
- package/dist/sheet/deps.d.ts +60 -0
- package/dist/sheet/deps.js +199 -0
- package/dist/sheet/document.d.ts +150 -0
- package/dist/sheet/document.js +264 -0
- package/dist/sheet/edit-keys.d.ts +14 -0
- package/dist/sheet/edit-keys.js +40 -0
- package/dist/sheet/entry.d.ts +31 -0
- package/dist/sheet/entry.js +76 -0
- package/dist/sheet/evaluate.d.ts +61 -0
- package/dist/sheet/evaluate.js +337 -0
- package/dist/sheet/find-replace.d.ts +62 -0
- package/dist/sheet/find-replace.js +152 -0
- package/dist/sheet/format-store.d.ts +99 -0
- package/dist/sheet/format-store.js +233 -0
- package/dist/sheet/freeze.d.ts +54 -0
- package/dist/sheet/freeze.js +58 -0
- package/dist/sheet/function-catalog.d.ts +10 -0
- package/dist/sheet/function-catalog.js +94 -0
- package/dist/sheet/functions.d.ts +28 -0
- package/dist/sheet/functions.js +362 -0
- package/dist/sheet/goal-seek.d.ts +73 -0
- package/dist/sheet/goal-seek.js +153 -0
- package/dist/sheet/index.d.ts +53 -0
- package/dist/sheet/index.js +53 -0
- package/dist/sheet/merges.d.ts +71 -0
- package/dist/sheet/merges.js +137 -0
- package/dist/sheet/names.d.ts +31 -0
- package/dist/sheet/names.js +87 -0
- package/dist/sheet/navigate.d.ts +52 -0
- package/dist/sheet/navigate.js +135 -0
- package/dist/sheet/number-format.d.ts +63 -0
- package/dist/sheet/number-format.js +508 -0
- package/dist/sheet/palette.d.ts +19 -0
- package/dist/sheet/palette.js +84 -0
- package/dist/sheet/parse.d.ts +13 -0
- package/dist/sheet/parse.js +108 -0
- package/dist/sheet/paste-special.d.ts +164 -0
- package/dist/sheet/paste-special.js +592 -0
- package/dist/sheet/protection.d.ts +21 -0
- package/dist/sheet/protection.js +48 -0
- package/dist/sheet/rects.d.ts +45 -0
- package/dist/sheet/rects.js +112 -0
- package/dist/sheet/refs.d.ts +82 -0
- package/dist/sheet/refs.js +266 -0
- package/dist/sheet/ribbon-icons.d.ts +31 -0
- package/dist/sheet/ribbon-icons.js +350 -0
- package/dist/sheet/ribbon.d.ts +173 -0
- package/dist/sheet/ribbon.js +753 -0
- package/dist/sheet/shortcuts.d.ts +164 -0
- package/dist/sheet/shortcuts.js +623 -0
- package/dist/sheet/structure.d.ts +87 -0
- package/dist/sheet/structure.js +166 -0
- package/dist/sheet/tables.d.ts +70 -0
- package/dist/sheet/tables.js +147 -0
- package/dist/sheet/tokenize.d.ts +54 -0
- package/dist/sheet/tokenize.js +304 -0
- package/dist/sheet/transforms.d.ts +76 -0
- package/dist/sheet/transforms.js +154 -0
- package/dist/sheet/validation.d.ts +92 -0
- package/dist/sheet/validation.js +241 -0
- package/dist/sheet/workbook.d.ts +72 -0
- package/dist/sheet/workbook.js +409 -0
- package/dist/sheet-enable.d.ts +6 -0
- package/dist/sheet-enable.js +46 -0
- package/dist/sources/aggregate.d.ts +1 -1
- package/dist/sources/auth-supabase.js +1 -1
- package/dist/sources/dashboard.d.ts +2 -2
- package/dist/sources/dashboard.js +1 -1
- package/dist/sources/index.d.ts +13 -13
- package/dist/sources/index.js +13 -13
- package/dist/sources/realtime-supabase.js +1 -1
- package/dist/sources/relation-lookup.d.ts +1 -1
- package/dist/sources/relation-lookup.js +1 -1
- package/dist/sources/rest-adapters.d.ts +1 -1
- package/dist/sources/rest-adapters.js +1 -1
- package/dist/sources/rest.d.ts +2 -2
- package/dist/sources/rest.js +3 -3
- package/dist/sources/supabase.d.ts +2 -2
- package/dist/sources/supabase.js +3 -3
- package/dist/sources/with-entity-rules.d.ts +1 -1
- package/dist/sources/with-entity-rules.js +1 -1
- package/dist/sources/with-relation-labels.d.ts +1 -1
- package/dist/studio/emit-project.js +2161 -2127
- package/dist/studio/emit-schema.js +369 -369
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/introspect-db.js +45 -45
- package/dist/studio/project.d.ts +10 -0
- package/dist/studio/samples/crm.js +6 -6
- package/dist/studio/samples/fleet.js +7 -7
- package/dist/studio/samples/insurance.js +9 -9
- package/dist/studio/samples/inventory.js +12 -12
- package/dist/studio/samples/projects.js +5 -5
- package/dist/studio/samples/support.js +8 -8
- package/dist/studio/scaffold-app.js +104 -104
- package/dist/studio/scaffold.js +151 -151
- package/dist/studio/ui-components.d.ts +7 -0
- package/dist/studio/ui-components.generated.js +63 -1
- package/dist/studio/ui-components.js +35 -0
- package/dist/sveltekit/in-memory.d.ts +3 -3
- package/dist/sveltekit/in-memory.js +4 -4
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +5 -5
- package/dist/sveltekit/query-plan.d.ts +1 -1
- package/dist/sveltekit/sql-source.d.ts +4 -4
- package/dist/sveltekit/sql-source.js +4 -4
- package/dist/sveltekit/sql.d.ts +1 -1
- package/dist/sveltekit/transport.d.ts +2 -2
- package/dist/sveltekit/transport.js +1 -1
- package/dist/upgrade-prompt.js +25 -25
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -4
- package/dist/designer/assets/GridMenus-Cgilexpk.js +0 -8
- package/dist/designer/assets/SvDateRangeInput-BV5OXYQ2.css +0 -1
- package/dist/designer/assets/SvDateRangeInput-CVn-yqrQ.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-BdioTrJQ.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-CY8TK4BT.css +0 -1
- package/dist/designer/assets/SvField-BF-9TJSd.css +0 -1
- package/dist/designer/assets/SvField-BsqiA5me.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-dLY7_kk9.js +0 -2
- package/dist/designer/assets/SvGridChart-BEDNTdc5.js +0 -2
- package/dist/designer/assets/SvGridChart-Vu4Nvjiv.css +0 -1
- package/dist/designer/assets/SvGridChartPanel-x3lzSxuf.js +0 -10
- package/dist/designer/assets/SvGridChartView-CAKhPELi.js +0 -1
- package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +0 -1
- package/dist/designer/assets/SvGridDropdown-CAYG7Y-O.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Crwb2P3Q.css +0 -1
- package/dist/designer/assets/SvListBox-CVYQcLX9.js +0 -1
- package/dist/designer/assets/SvListBox-DgN8kvjt.css +0 -1
- package/dist/designer/assets/chart-DHEgt4lN.js +0 -1
- package/dist/designer/assets/column-resize-C_inr5zT.js +0 -1
- package/dist/designer/assets/date-format-4DJvNtG2.js +0 -1
- package/dist/designer/assets/date-format-Dzy4mTGh.css +0 -1
- package/dist/designer/assets/easing-zaypKrr0.js +0 -3
- package/dist/designer/assets/export-format-DwjuTfrQ.js +0 -6
- package/dist/designer/assets/index-Cp7fDJ3b.css +0 -1
- package/dist/designer/assets/js-scroller.svelte-Bhxqb3-c.js +0 -110
- package/dist/designer/assets/row-resize-B0FWHcNr.js +0 -1
- package/dist/designer/assets/src-B7DNcoQK.css +0 -1
- package/dist/designer/assets/src-BoYyigAC.js +0 -2896
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -3875
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -21
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -1938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -205
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -18
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -264
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -697
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -4938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -495
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -190
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -8
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -138
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e?e.map(e=>{if(typeof e==`object`&&e){let t=e,n=t.value??t.label??``;return{...t,value:n,label:t.label??String(n)}}return{value:e,label:String(e)}}):[]}function t(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.label.toLowerCase().includes(n)):[...e]}function n(e){let t=[],n=new Map;return e.forEach((e,r)=>{let i=e.group??null,a=n.get(i);a||(a={group:i,options:[]},n.set(i,a),t.push(a)),a.options.push({...e,index:r})}),t}function r(e,t){let r=Math.max(1,t.groupHeaderHeight??28),i=t.rowHeight,a=e=>Math.max(1,typeof i==`function`?i(e,e.index):i),o=[],s=Array(e.length),c=!1;for(let t of n(e)){t.group!=null&&(c=!0,o.push({type:`group`,label:t.group,size:r}));for(let e of t.options)s[e.index]=o.length,o.push({type:`option`,opt:e,size:a(e)})}return{entries:o,hasGroups:c,sizeAt:e=>o[e]?.size??0,optionFlatIndex:s}}function i(e,t,n){let r=t.trim().toLowerCase();if(!r||!e.length)return-1;let i=e.length;for(let t=1;t<=i;t++){let a=(n+t)%i,o=e[a];if(o&&!o.disabled&&o.label.toLowerCase().startsWith(r))return a}return-1}function a(e=600){let t=``,n;return{get value(){return t},push(r){return t+=r,n&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t},clear(){t=``,n&&clearTimeout(n)}}}function o(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==` `}export{o as a,n as i,t as n,i as o,r,e as s,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=function(e,t){return new URL(e,t).href},t={},n=function(n,r,i){let a=Promise.resolve();if(r&&r.length>0){let n=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);function c(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function l(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}a=c(r.map(r=>{if(r=e(r,i),r=l(r),r in t)return;t[r]=!0;let a=r.endsWith(`.css`);for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.href===r&&(!a||t.rel===`stylesheet`))return}let o=document.createElement(`link`);if(o.rel=a?`stylesheet`:`modulepreload`,a||(o.as=`script`),o.crossOrigin=``,o.href=r,s&&o.setAttribute(`nonce`,s),document.head.appendChild(o),a)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}))}function o(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(e=>{for(let t of e||[])t.status===`rejected`&&o(t.reason);return n().catch(o)})};export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";var t=e({rowResize:()=>r}),n=`sv-grid-row-resize-handle`;function r(e,t){let r=t,i=null,a=null;function o(e){let t=e.querySelector(`[data-svgrid-row]`)?.dataset.svgridRow;return t==null?NaN:Number(t)}function s(e){if(!i)return;let t=r.min??20,n=r.max??320,a=Math.max(t,Math.min(n,i.startHeight+(e.clientY-i.startY)));i.trEl.style.height=`${Math.round(a)}px`,r.onResizeMove?.(i.rowIndex,Math.round(a))}function c(e){if(!i)return;let t=r.min??20,n=r.max??320,a=Math.max(t,Math.min(n,i.startHeight+(e.clientY-i.startY)));r.onResize(i.rowIndex,Math.round(a)),i.strip.classList.remove(`is-resizing`);try{i.trEl.releasePointerCapture(e.pointerId)}catch{}i=null,window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),document.body.style.cursor=``}function l(e){if(r.disabled)return;let t=e.target;if(!t?.classList.contains(n))return;let i=e.shiftKey?1:10,a=0;if(e.key===`ArrowUp`)a=-i;else if(e.key===`ArrowDown`)a=i;else return;let s=t.closest(`tr.sv-grid-row`);if(!s)return;let c=o(s);if(!Number.isFinite(c))return;e.preventDefault(),e.stopPropagation();let l=r.min??20,u=r.max??320,d=Math.round(Math.max(l,Math.min(u,s.getBoundingClientRect().height+a)));s.style.height=`${d}px`,r.onResizeMove?.(c,d),r.onResize(c,d)}function u(e){if(r.disabled)return;let t=e.target;if(!t?.classList.contains(n))return;let l=t.closest(`tr.sv-grid-row`);if(!l)return;let u=o(l);if(!Number.isFinite(u))return;e.preventDefault(),e.stopPropagation();let d=e.timeStamp,f=a!==null&&a.rowIndex===u&&d-a.at<400;if(a={rowIndex:u,at:d},f&&r.onAutosize){a=null,r.onAutosize(u);return}t.classList.add(`is-resizing`),i={rowIndex:u,startY:e.clientY,startHeight:l.getBoundingClientRect().height,trEl:l,strip:t};try{l.setPointerCapture(e.pointerId)}catch{}document.body.style.cursor=`row-resize`,window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c)}function d(){if(r.disabled){f();return}let t=e.querySelectorAll(`tr.sv-grid-row`);for(let e of t){if(e.classList.contains(`sv-grid-header-row`)||e.classList.contains(`sv-grid-row-spacer`))continue;let t=e.querySelector(`.sv-grid-cell.sv-row-gutter, .sv-grid-cell.sv-grid-row-number-cell`)??(r.anchor===`row`?e.querySelector(`.sv-grid-cell`):null);if(!t||t.querySelector(`:scope > .${n}`))continue;getComputedStyle(t).position===`static`&&(t.style.position=`relative`),t.style.overflow=`visible`;let i=document.createElement(`div`);i.className=n,i.setAttribute(`role`,`separator`),i.setAttribute(`aria-orientation`,`horizontal`),i.setAttribute(`aria-label`,`Resize row`),i.tabIndex=0,i.style.cssText=`position:absolute;left:0;right:0;bottom:0;height:5px;cursor:row-resize;user-select:none;z-index:60;pointer-events:auto;`,t.appendChild(i)}}function f(){e.querySelectorAll(`.${n}`).forEach(e=>e.remove())}e.addEventListener(`pointerdown`,u,{capture:!0}),e.addEventListener(`keydown`,l,{capture:!0});let p=new MutationObserver(()=>d());return p.observe(e,{childList:!0,subtree:!0}),d(),{update(e){let t=r.disabled;r=e,t!==r.disabled&&d()},destroy(){e.removeEventListener(`pointerdown`,u,{capture:!0}),e.removeEventListener(`keydown`,l,{capture:!0}),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),p.disconnect(),f()}}}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./chart-export-B6bkQ3X8.js";var n=e({chartToPngBlob:()=>t});export{n as t};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./jszip.min-CX2fPs3O.js","./rolldown-runtime-Dd_uD5pT.js","./pdfmake-BpIYFHoG.js","./vfs_fonts-BV-Ul9v2.js","./src-CITpcm6b.js","./chart-export-B6bkQ3X8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{a as n,c as r,d as i,i as a,l as o,n as s,o as c,s as l,t as u,u as d}from"./export-format-D-eP4b2l.js";import{t as f}from"./preload-helper-HclGiUj8.js";var p={arrows:[`↓`,`→`,`↑`],traffic:[`🔴`,`🟡`,`🟢`],triangles:[`▼`,`◆`,`▲`]};function m(e){let t=1/0,n=-1/0,r=!1;for(let i of e){if(i==null||i===``)continue;let e=Number(i);Number.isFinite(e)&&(r=!0,e<t&&(t=e),e>n&&(n=e))}return r?{min:t,max:n}:null}function h(e,t,n){let r=0;for(let e=0;e<t.length;e+=1)n>=t[e]&&(r=e+1);return e[Math.min(e.length-1,Math.max(0,r))]??e[e.length-1]}function g(e){return e<0?0:e>1?1:e}function _(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=parseInt(t[1],16);return[n>>16&255,n>>8&255,n&255]}function v(e){return`#`+e.map(e=>Math.round(g(e/255)*255).toString(16).padStart(2,`0`)).join(``)}function y(e){let t=_(e);if(!t)return null;let n=t.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]>.45?`#1e293b`:`#ffffff`}function b(e,t,n){let r=_(e),i=_(t);if(!r||!i)return e;let a=g(n);return v([r[0]+(i[0]-r[0])*a,r[1]+(i[1]-r[1])*a,r[2]+(i[2]-r[2])*a])}function x(e,t){let n=_(e);return n?`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${g(t).toFixed(3)})`:e}function S(e,t){let n=[...e].sort((e,t)=>e.offset-t.offset);if(n.length===0)return`#000000`;if(t<=n[0].offset)return n[0].color;let r=n[n.length-1];if(t>=r.offset)return r.color;for(let e=0;e<n.length-1;e+=1){let r=n[e],i=n[e+1];if(t>=r.offset&&t<=i.offset){let e=i.offset-r.offset||1;return b(r.color,i.color,(t-r.offset)/e)}}return r.color}function C(e,t){if(e.stops&&e.stops.length>=2)return S(e.stops,t);let n=e.min??`#ffffff`,r=e.max??`#000000`;return e.mid?t<=.5?b(n,e.mid,t/.5):b(e.mid,r,(t-.5)/.5):b(n,r,t)}function w(e,t,n,r){let i;if(e.compareColumn){let r=Number(n?.[e.compareColumn]);if(!Number.isFinite(r)||r===0)return null;i=g(t/r)}else if(e.type===`colorScale`&&e.zeroCentred){let n=e.minValue??r?.min??t,a=e.maxValue??r?.max??t;i=g(.5+t/(Math.max(Math.abs(n),Math.abs(a))||1)/2)}else{let n=r?.min??t,a=r?.max??t,o,s;if(e.bounds===`percent`){let t=a-n;o=n+(e.minValue??0)/100*t,s=n+(e.maxValue??100)/100*t}else o=e.minValue??n,s=e.maxValue??a;i=s===o?.5:g((t-o)/(s-o))}return e.type===`colorScale`&&e.reverse&&(i=1-i),i}function T(e,t,n,r,i){let a={};for(let o of r){if(o.columns&&!o.columns.includes(n))continue;let r=Number(e);if(o.type===`rule`){if(o.when({value:e,row:t})){if(o.background&&(a.background=o.background,!o.color)){let e=y(o.background);e&&(a.color=e)}o.color&&(a.color=o.color),o.fontWeight!=null&&(a.fontWeight=o.fontWeight)}continue}if(!(e==null||e===``||!Number.isFinite(r))){if(o.type===`colorScale`){let n=w(o,r,t,i);if(n==null)continue;if(o.mode===`alpha`){let[e,t]=o.alphaBounds??[.05,.85];a.background=x(o.base??`#2563eb`,e+(t-e)*n)}else{a.background=C(o,n);let e=y(a.background);e&&(a.color=e)}o.tooltip===`value`?a.title=String(e):o.tooltip===`percent`&&(a.title=`${Math.round(n*100)}%`)}else if(o.type===`dataBar`){let e;if(o.compareColumn){let n=w(o,r,t,i);if(n==null)continue;e=n*100}else if(o.bounds===`percent`){let n=w(o,r,t,i);if(n==null)continue;e=n*100}else{let t=o.minValue??Math.min(0,i?.min??0),n=(o.maxValue??i?.max??r)-t||1;e=g((r-t)/n)*100}a.dataBar={percent:e,color:r<0?o.negativeColor??`#ef4444`:o.color,fromRight:!1,gradient:o.gradient},o.showValue===!1&&(a.color=`transparent`)}else if(o.type===`iconSet`){let e=p[o.set??`arrows`];a.icon=h(e,o.thresholds,r),o.iconOnly&&(a.iconOnly=!0)}}}return a}function E(e){return(e.type===`colorScale`||e.type===`dataBar`)&&!(`compareColumn`in e&&e.compareColumn)}function D(e){return e.some(E)}var O=new Set([]),k=`SVENTERPRISE-`;function ee(e){if(!e)return null;let t=e.split(`-`);if(t.length<3)return null;let n=t[t.length-2];if(n==null)return null;if(/^\d{6}$/.test(n)){let e=Number(n.slice(0,4)),t=Number(n.slice(4,6));return t<1||t>12?null:new Date(Date.UTC(e,t,1)-1)}if(/^\d{8}$/.test(n)){let e=Number(n.slice(0,4)),t=Number(n.slice(4,6)),r=Number(n.slice(6,8));if(t<1||t>12||r<1||r>31)return null;let i=new Date(Date.UTC(e,t-1,r,23,59,59,999));return i.getUTCMonth()===t-1?i:null}return null}function te(e,t=new Date){if(e==null||e===``)return{status:`unset`,valid:!1};if(!e.startsWith(`SVENTERPRISE-`))return{status:`invalid`,valid:!1};if(O.has(e))return{status:`revoked`,valid:!1};let n=ee(e)??void 0,r=n?t.getTime()>n.getTime():void 0;return{status:e.startsWith(`SVENTERPRISE-DEV`)?`dev`:e.startsWith(`SVENTERPRISE-EVAL`)?`eval`:`licensed`,valid:!0,expiresAt:n,expired:r}}var A=`data-svgrid-enterprise-watermark`,j=`data-svgrid-enterprise-nudged`,ne=`https://svgrid.com`,re=`www.svgrid.com`,ie=5e3,ae=700,oe=!1,M=null;function N(){se(),!(typeof document>`u`||typeof window>`u`)&&(queueMicrotask(()=>ce()),M||(M=new MutationObserver(()=>ce()),M.observe(document.body,{childList:!0,subtree:!0})))}function se(){oe||(oe=!0,!(typeof console>`u`)&&console.log(`%c @svgrid/enterprise %c User is using a Commercial version which requires a license.
|
|
3
|
+
Contact sales@jqwidgets.com for details or visit the license page: https://svgrid.com/pricing/`,`background:#4f46e5;color:#fff;padding:2px 6px;border-radius:3px;font-weight:600`,`color:inherit`))}function ce(){if(typeof document>`u`)return;let e=document.querySelectorAll(`.sv-grid-root, [role="grid"]`);if(e.length===0){ue();return}document.querySelectorAll(`[${A}="fixed"]`).forEach(e=>e.remove()),e.forEach(le)}function le(e){if(e.hasAttribute(j))return;e.setAttribute(j,`1`),getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let t=de(`grid`);pe(t,!1),e.appendChild(t),fe(t)}function ue(){if(typeof document>`u`||document.querySelector(`[${A}="fixed"]`))return;let e=de(`fixed`);pe(e,!0),document.body.appendChild(e),fe(e)}function de(e){let t=document.createElement(`a`);return t.setAttribute(A,e),t.href=ne,t.target=`_blank`,t.rel=`noopener noreferrer`,t.textContent=re,t.title=`Unlicensed @svgrid/enterprise. Contact sales@jqwidgets.com or visit www.svgrid.com.`,t}function fe(e){if(typeof window>`u`){e.remove();return}window.setTimeout(()=>{e.style.opacity=`0`,window.setTimeout(()=>e.remove(),ae)},ie)}function pe(e,t){Object.assign(e.style,{position:t?`fixed`:`absolute`,bottom:t?`12px`:`6px`,right:t?`12px`:`8px`,zIndex:`2147483647`,background:`rgba(15,23,42,0.85)`,color:`#fff`,padding:t?`6px 10px`:`4px 8px`,borderRadius:t?`4px`:`3px`,fontFamily:`-apple-system, "Segoe UI", Roboto, sans-serif`,fontSize:t?`11px`:`10px`,lineHeight:`1.2`,textDecoration:`none`,boxShadow:t?`0 2px 12px rgba(0,0,0,0.35)`:`0 1px 4px rgba(0,0,0,0.3)`,border:`1px solid rgba(255,255,255,0.18)`,pointerEvents:`auto`,letterSpacing:`0.02em`,opacity:`1`,transition:`opacity ${ae}ms ease`})}var me=`data-svgrid-enterprise-upgrade`,he=`https://svgrid.com/pricing`,ge=`https://svgrid.com/pricing?ref=in-app&utm_source=svgrid-enterprise&utm_medium=upgrade-prompt`,_e=!1;function P(e,t){if(_e||typeof document>`u`||typeof window>`u`||document.querySelector(`[${me}]`))return;_e=!0;let n=ve(e,t?.expired===!0);document.body.appendChild(n),requestAnimationFrame(()=>{n.style.opacity=`1`,n.style.transform=`translateY(0)`})}function F(e){e.style.opacity=`0`,e.style.transform=`translateY(8px)`,window.setTimeout(()=>e.remove(),220)}function ve(e,t=!1){let n=document.createElement(`div`);n.setAttribute(me,`1`),n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-label`,t?`Your trial has ended`:`Unlock SvGrid Pro`),Object.assign(n.style,{position:`fixed`,bottom:`16px`,right:`16px`,zIndex:`2147483646`,width:`320px`,maxWidth:`calc(100vw - 32px)`,boxSizing:`border-box`,padding:`16px 16px 14px`,background:`#0f172a`,color:`#e2e8f0`,borderRadius:`12px`,border:`1px solid rgba(99,102,241,0.4)`,boxShadow:`0 12px 40px rgba(0,0,0,0.45)`,fontFamily:`-apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fontSize:`13px`,lineHeight:`1.45`,opacity:`0`,transform:`translateY(8px)`,transition:`opacity 220ms ease, transform 220ms ease`});let r=e?`<strong style="color:#fff">${ye(e?String(e):`This`)}</strong> is a Pro feature.`:`You just used a <strong style="color:#fff">Pro</strong> feature.`,i=t?`TRIAL ENDED`:`PRO`,a=t?`Your trial has ended`:`Unlock SvGrid Pro`,o=t?`${r} Your evaluation period is over - everything still works,
|
|
4
|
+
but this notice stays until a licence key is set.`:`${r} It runs in evaluation with a watermark - start a free trial
|
|
5
|
+
to remove it and ship to production.`;return n.innerHTML=`
|
|
6
|
+
<button type="button" data-act="x" aria-label="Dismiss"
|
|
7
|
+
style="position:absolute;top:8px;right:8px;width:24px;height:24px;display:flex;
|
|
8
|
+
align-items:center;justify-content:center;background:transparent;border:0;
|
|
9
|
+
color:#94a3b8;font-size:18px;line-height:1;cursor:pointer;border-radius:6px;">×</button>
|
|
10
|
+
<div style="display:flex;align-items:center;gap:8px;margin-bottom:8px;">
|
|
11
|
+
<span style="display:inline-block;background:${t?`#b45309`:`#4f46e5`};color:#fff;font-size:10px;
|
|
12
|
+
font-weight:700;letter-spacing:0.06em;padding:2px 7px;border-radius:999px;">${i}</span>
|
|
13
|
+
<span style="font-weight:700;color:#fff;">${a}</span>
|
|
14
|
+
</div>
|
|
15
|
+
<p style="margin:0 0 12px;color:#cbd5e1;">
|
|
16
|
+
${o}
|
|
17
|
+
</p>
|
|
18
|
+
<div style="display:flex;gap:8px;align-items:center;">
|
|
19
|
+
<a data-act="trial" href="${ge}" target="_blank" rel="noopener noreferrer"
|
|
20
|
+
style="flex:1;text-align:center;background:#6366f1;color:#fff;font-weight:600;
|
|
21
|
+
text-decoration:none;padding:8px 12px;border-radius:8px;">${t?`Buy a licence`:`Start free trial`}</a>
|
|
22
|
+
<a data-act="pricing" href="${he}" target="_blank" rel="noopener noreferrer"
|
|
23
|
+
style="color:#a5b4fc;text-decoration:none;padding:8px 6px;font-weight:600;">Pricing</a>
|
|
24
|
+
</div>
|
|
25
|
+
<p style="margin:10px 0 0;font-size:11px;color:#64748b;">
|
|
26
|
+
Already licensed? Call <code style="color:#94a3b8;">setLicenseKey()</code> at startup to hide this.
|
|
27
|
+
</p>
|
|
28
|
+
`,n.querySelector(`[data-act="x"]`)?.addEventListener(`click`,()=>F(n)),n.querySelector(`[data-act="trial"]`)?.addEventListener(`click`,()=>F(n)),n.querySelector(`[data-act="pricing"]`)?.addEventListener(`click`,()=>F(n)),n}function ye(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var I=null,be=!1,L=!1;function xe(e){if(L)return;L=!0;let t=e.expiresAt?` on ${e.expiresAt.toISOString().slice(0,10)}`:``;console.info(`@svgrid/enterprise: your evaluation license expired${t}. Everything still works, but the watermark and upgrade notice stay until a license key is set. Contact sales@jqwidgets.com or see https://svgrid.com/pricing`)}function Se(){return I!=null}function Ce(e){let t=te(I);if(t.valid&&!t.expired)return;let n=t.valid&&t.expired===!0;N(),n&&xe(t),P(e,{expired:n})}function we(e){let t=te(I);switch(t.status){case`unset`:N(),P(e);return;case`invalid`:throw Error(`@svgrid/enterprise: invalid license key format (expected "${k}..." prefix).`);case`revoked`:throw Error(`@svgrid/enterprise: this license key has been revoked. Contact sales@jqwidgets.com for a replacement.`);case`dev`:case`eval`:if(t.expired){N(),xe(t),P(e,{expired:!0});return}be||=(console.info(`@svgrid/enterprise: using a development / evaluation license. Not for production use.`),!0);return;case`licensed`:return}}var Te=!1;function Ee(){if(Te)return;if(typeof window>`u`)throw Error(`@svgrid/enterprise: installSmartShim() requires a browser environment`);let e=window.Smart??{Utilities:{}};e.Utilities=e.Utilities??{},typeof e.Utilities.Assign!=`function`&&(e.Utilities.Assign=(t,n)=>{e.Utilities[t]=n}),(!e.Utilities.Core||typeof e.Utilities.Core.toDash!=`function`)&&(e.Utilities.Core={toDash:e=>e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())}),window.Smart=e,Te=!0}var De=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function R(e){return e.replace(De,``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function Oe(e){let t=(e,t=2)=>String(e).padStart(t,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}.000`}async function ke(e,t,n,r={}){let o=Math.max(1,r.chunkRows??5e3),s=n.length,c=r.rawValues===!0,l=r.cellVisual,u=r.precisionSafe===!0,f=new Map,p=[`<Style ss:ID="sHeader"><Font ss:Bold="1"/><Interior ss:Color="#F2F2F2" ss:Pattern="Solid"/></Style>`],m=e=>e===`right`?`Right`:e===`center`?`Center`:`Left`,h=e=>{let t=e.align&&e.align!==`left`;if(!e.numFmt&&!e.fill&&!e.color&&!e.bold&&!t)return;let n=`${e.numFmt??``}|${e.fill??``}|${e.color??``}|${e.bold?`b`:``}|${e.align??``}`,r=f.get(n);if(r)return r;let i=`s${f.size+1}`,a=[];return t&&a.push(`<Alignment ss:Horizontal="${m(e.align)}"/>`),(e.color||e.bold)&&a.push(`<Font${e.color?` ss:Color="${e.color}"`:``}${e.bold?` ss:Bold="1"`:``}/>`),e.fill&&a.push(`<Interior ss:Color="${e.fill}" ss:Pattern="Solid"/>`),e.numFmt&&a.push(`<NumberFormat ss:Format="${R(e.numFmt)}"/>`),p.push(`<Style ss:ID="${i}">${a.join(``)}</Style>`),f.set(n,i),i};function g(e,t,n,r){let o=e.link?.(t)||void 0,s=l?.(n,r),f=t=>h({numFmt:t,fill:s?.fill,color:s?.color,bold:s?.bold,align:e.align});if(e.exportValue){let n=e.exportValue(t),r=n==null?``:String(n);return{type:`String`,value:s?.icon?`${s.icon} ${r}`:r,styleId:f(),href:o}}let p=t[e.field];if(s?.icon){let t=c?String(p??``):a(p,e.format);return{type:`String`,value:`${s.icon} ${t}`,styleId:f(),href:o}}let m=e=>u&&Math.abs(e)>=0x38d7ea4c68000;if(c){let e=p==null?``:String(p);return typeof p==`number`&&Number.isFinite(p)&&!m(p)?{type:`Number`,value:e,styleId:f(),href:o}:{type:`String`,value:e,styleId:f(),href:o}}let g=i(p,e.format);if(g.ok){let t=d(e.format);return g.value instanceof Date?{type:`DateTime`,value:Oe(g.value),styleId:f(t),href:o}:m(g.value)?{type:`String`,value:String(g.value),styleId:f(),href:o}:{type:`Number`,value:String(g.value),styleId:f(t),href:o}}return{type:`String`,value:a(p,e.format),styleId:f(),href:o}}let _=e=>`<Cell${e.styleId?` ss:StyleID="${e.styleId}"`:``}${e.href?` ss:HRef="${R(e.href)}"`:``}><Data ss:Type="${e.type}">${R(e.value)}</Data></Cell>`,v=r.widths?r.widths.map(e=>`<Column ss:Width="${Math.round(e*.75)}"/>`).join(``):``,y=Math.max(0,Math.floor(r.freezeColumns??0)),b=r.freezeHeader||y>0?`<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><FreezePanes/><FrozenNoSplit/>`+(r.freezeHeader?`<SplitHorizontal>1</SplitHorizontal><TopRowBottomPane>1</TopRowBottomPane>`:``)+(y>0?`<SplitVertical>${y}</SplitVertical><LeftColumnRightPane>${y}</LeftColumnRightPane>`:``)+`<ActivePane>2</ActivePane></WorksheetOptions>`:``,x=[`<Row>${t.map(e=>`<Cell ss:StyleID="sHeader"><Data ss:Type="String">${R(e.header??e.field)}</Data></Cell>`).join(``)}</Row>`];for(let e=0;e<s;e++){if(r.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let i=n[e],a=t.map((t,n)=>_(g(t,i,e,n))).join(``);x.push(`<Row>${a}</Row>`),e>0&&e%o===0&&(r.onProgress?.({phase:`serialize`,ratio:e/s,row:e,total:s}),await new Promise(e=>setTimeout(e,0)))}return r.onProgress?.({phase:`serialize`,ratio:1,row:s,total:s}),`<?xml version="1.0"?>
|
|
29
|
+
<?mso-application progid="Excel.Sheet"?>
|
|
30
|
+
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><Styles>${p.join(``)}</Styles><Worksheet ss:Name="${R(e.slice(0,31)||`Sheet1`)}"><Table>${v}${x.join(``)}</Table>`+b+`</Worksheet></Workbook>`}var Ae={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},je=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function z(e){return e.replace(je,``).replace(/[&<>"']/g,e=>Ae[e])}function B(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return n}function V(e){if(!e)return null;let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());return t?`FF`+t[1].toUpperCase():null}function Me(e){let t=Date.UTC(1899,11,30);return(e.getTime()-t)/864e5}var Ne=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
31
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`,Pe=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
32
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`;function Fe(e){return e.replace(/[\\/?*[\]:]/g,` `).trim().slice(0,31)||`Sheet1`}function Ie(e){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
33
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${z(Fe(e))}" sheetId="1" r:id="rId1"/></sheets></workbook>`}var Le=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`;function Re(e,t){let n=new Map,r=164,i=e=>{if(!e)return 0;let t=n.get(e);if(t!=null)return t;let i=r++;return n.set(e,i),i},a=[`<font><sz val="11"/><name val="Calibri"/></font>`,`<font><b/><sz val="11"/><name val="Calibri"/></font>`],o=new Map,s=(e,t)=>{let n=V(t);if(!e&&!n)return 0;let r=`${e?`b`:``}|${n??``}`,i=o.get(r);if(i!=null)return i;let s=a.length;return a.push(`<font>${e?`<b/>`:``}<sz val="11"/><name val="Calibri"/>${n?`<color rgb="${n}"/>`:``}</font>`),o.set(r,s),s},c=[`<fill><patternFill patternType="none"/></fill>`,`<fill><patternFill patternType="gray125"/></fill>`],l=new Map,u=e=>{let t=V(e);if(!t)return 0;let n=l.get(t);if(n!=null)return n;let r=c.length;return c.push(`<fill><patternFill patternType="solid"><fgColor rgb="${t}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(t,r),r},d=[`<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>`,`<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>`],f=new Map,p=(e,t,n,r)=>{let i=`${e}|${t}|${n}|${r??``}`,a=f.get(i);if(a!=null)return a;let o=d.length,s=r&&r!==`left`?`<alignment horizontal="${r}"/>`:``;return d.push(`<xf numFmtId="${e}" fontId="${t}" fillId="${n}" borderId="0" xfId="0"${e?` applyNumberFormat="1"`:``}${t?` applyFont="1"`:``}${n?` applyFill="1"`:``}${s?` applyAlignment="1"`:``}>${s}</xf>`),f.set(i,o),o},m=e=>{let t=i(e.numFmt),n=s(e.bold===!0,e.color),r=u(e.fill);return t===0&&n===0&&r===0&&(!e.align||e.align===`left`)?0:p(t,n,r,e.align)};for(let e of t)for(let t of e)m(t);return{styleIndexOf:m,build:()=>`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
35
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`+(n.size>0?`<numFmts count="${n.size}">${[...n.entries()].map(([e,t])=>`<numFmt numFmtId="${t}" formatCode="${z(e)}"/>`).join(``)}</numFmts>`:``)+`<fonts count="${a.length}">${a.join(``)}</fonts><fills count="${c.length}">${c.join(``)}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${d.length}">${d.join(``)}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}}function ze(e){let{header:t,rows:n}=e,r=Re(t,n),i=[],a=[`<row r="1">${t.map((e,t)=>`<c r="${B(t)}1" s="1" t="inlineStr"><is><t xml:space="preserve">${z(e)}</t></is></c>`).join(``)}</row>`];for(let e=0;e<n.length;e++){let t=e+2,o=n[e],s=[];for(let e=0;e<o.length;e++){let n=o[e],a=`${B(e)}${t}`,c=r.styleIndexOf(n),l=c?` s="${c}"`:``;if(n.link&&i.push({ref:a,url:n.link,id:`rId${i.length+1}`}),n.value==null||n.value===``)s.push(`<c r="${a}"${l}/>`);else if(n.t===`n`)s.push(`<c r="${a}"${l}><v>${Number(n.value)}</v></c>`);else if(n.t===`d`){let e=n.value instanceof Date?n.value:new Date(String(n.value));s.push(`<c r="${a}"${l}><v>${Me(e)}</v></c>`)}else n.t===`b`?s.push(`<c r="${a}"${l} t="b"><v>${+!!n.value}</v></c>`):s.push(`<c r="${a}"${l} t="inlineStr"><is><t xml:space="preserve">${z(String(n.value))}</t></is></c>`)}a.push(`<row r="${t}">${s.join(``)}</row>`)}let o=e.widths?`<cols>${e.widths.map((e,t)=>`<col min="${t+1}" max="${t+1}" width="${Math.max(4,Math.round(e/7*100)/100)}" customWidth="1"/>`).join(``)}</cols>`:``,s=Math.max(0,Math.floor(e.freezeColumns??0)),c=+!!e.freezeHeader,l=`<sheetView workbookViewId="0"/>`;if(c>0||s>0){let e=`${B(s)}${c+1}`,t=s>0&&c>0?`bottomRight`:s>0?`topRight`:`bottomLeft`;l=`<sheetView workbookViewId="0"><pane${s>0?` xSplit="${s}"`:``}${c>0?` ySplit="${c}"`:``} topLeftCell="${e}" activePane="${t}" state="frozen"/><selection pane="${t}" activeCell="${e}" sqref="${e}"/></sheetView>`}let u=n.length>0?(e.condFormats??[]).map((e,t)=>{let r=B(e.colIdx),i=`${r}2:${r}${n.length+1}`;if(e.kind===`dataBar`){let n=V(e.color)??`FF638EC6`;return`<conditionalFormatting sqref="${i}"><cfRule type="dataBar" priority="${t+1}"><dataBar><cfvo type="min"/><cfvo type="max"/><color rgb="${n}"/></dataBar></cfRule></conditionalFormatting>`}let a=e.colors.map(e=>V(e)??`FFFFFFFF`),o=a.length>=3?`<cfvo type="min"/><cfvo type="percentile" val="50"/><cfvo type="max"/>`:`<cfvo type="min"/><cfvo type="max"/>`,s=a.map(e=>`<color rgb="${e}"/>`).join(``);return`<conditionalFormatting sqref="${i}"><cfRule type="colorScale" priority="${t+1}"><colorScale>${o}${s}</colorScale></cfRule></conditionalFormatting>`}).join(``):``,d=i.length?`<hyperlinks>${i.map(e=>`<hyperlink ref="${e.ref}" r:id="${e.id}"/>`).join(``)}</hyperlinks>`:``,f=``,p=``,m=``;if(e.table&&t.length>0){let o=e.table,s=new Set,c=t.map((e,t)=>{let n=(e??``).trim()||`Column${t+1}`,r=n,i=1;for(;s.has(r.toLowerCase());)r=`${n}${++i}`;return s.add(r.toLowerCase()),r}),l=B(t.length-1),u=n.length+1,d=u+1,h=o.totalsRow&&n.length>0,g=o.totalsFns.findIndex(e=>!e);if(h){let e=t.map((e,t)=>{let i=`${B(t)}${d}`,a=o.totalsFns[t];if(a){let e=0;for(let r of n){let n=r[t];n?.t===`n`&&typeof n.value==`number`&&(e+=n.value)}let s=n.find(e=>e[t]?.t===`n`)?.[t]?.numFmt,l=r.styleIndexOf({t:`n`,value:e,numFmt:s,bold:!0}),u=a===`average`?101:a===`count`?103:109,d=a===`count`?n.length:e;return`<c r="${i}"${l?` s="${l}"`:``}><f>SUBTOTAL(${u},${o.name}[${z(c[t])}])</f><v>${d}</v></c>`}if(t===g){let e=r.styleIndexOf({t:`s`,value:`Total`,bold:!0});return`<c r="${i}"${e?` s="${e}"`:``} t="inlineStr"><is><t>Total</t></is></c>`}return`<c r="${i}"/>`});a.push(`<row r="${d}">${e.join(``)}</row>`)}let _=c.map((e,t)=>{let n=h?o.totalsFns[t]:void 0,r=h?n?` totalsRowFunction="${n}"`:t===g?` totalsRowLabel="Total"`:``:``;return`<tableColumn id="${t+1}" name="${z(e)}"${r}/>`}).join(``);f=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
36
|
+
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="${z(o.name)}" displayName="${z(o.name)}" ref="A1:${l}${h?d:u}"${h?` totalsRowCount="1"`:` totalsRowShown="0"`}><autoFilter ref="A1:${l}${u}"/><tableColumns count="${t.length}">${_}</tableColumns><tableStyleInfo name="${z(o.style??`TableStyleMedium2`)}" showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0"/></table>`,m=`rId${i.length+1}`,p=`<tableParts count="1"><tablePart r:id="${m}"/></tableParts>`}let h=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
37
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheetViews>${l}</sheetViews><sheetFormatPr defaultRowHeight="15"/>`+o+`<sheetData>${a.join(``)}</sheetData>`+u+d+p+`</worksheet>`,g={"[Content_Types].xml":f?Ne.replace(`</Types>`,`<Override PartName="/xl/tables/table1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/></Types>`):Ne,"_rels/.rels":Pe,"xl/workbook.xml":Ie(e.sheetName),"xl/_rels/workbook.xml.rels":Le,"xl/styles.xml":r.build(),"xl/worksheets/sheet1.xml":h};if(f&&(g[`xl/tables/table1.xml`]=f),i.length||m){let e=i.map(e=>`<Relationship Id="${e.id}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="${z(e.url)}" TargetMode="External"/>`);m&&e.push(`<Relationship Id="${m}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table1.xml"/>`),g[`xl/worksheets/_rels/sheet1.xml.rels`]=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
38
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+e.join(``)+`</Relationships>`}return g}async function Be(e,t){let n=new t;for(let[t,r]of Object.entries(e))n.file(t,r);return n.generateAsync({type:`blob`,mimeType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`})}function Ve(e){let t=e=>!!e&&typeof e==`object`&&Object.keys(e).some(e=>/\.(ttf|otf)$/i.test(e))&&Object.values(e).every(e=>typeof e==`string`),n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e))return null;if(n.add(e),t(e))return e;let i=e;return r(i.pdfMake?.vfs)??r(i.vfs)??r(i.default)};return r(e)}function He(e,t){let n=Ve(t);return n?(typeof e.addVirtualFileSystem==`function`&&e.addVirtualFileSystem(n),e.vfs=n,!0):!1}var Ue={A4:[595.28,841.89],A3:[841.89,1190.55],A5:[419.53,595.28],LETTER:[612,792],LEGAL:[612,1008]};async function We(e,t){if(!e?.length)return[];let n=[];for(let r of e){if(`image`in r){n.push(r);continue}let e=await t(r.element),i=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error??Error(`could not read the chart image`)),r.readAsDataURL(e)});n.push({image:i,title:r.title,caption:r.caption,width:r.width})}return n}function Ge(e){let{columns:t}=e,n=e.opts??{},r=e.now??new Date(0),i=n.fontSize??8,a=n.headerColor??`#334155`,o=n.headerTextColor??`#ffffff`,s=n.zebra??!0,c=n.zebraColor??`#f1f5f9`,l=n.groupColor??`#e2e8f0`,u=n.groupTextColor??`#0f172a`,d=n.subtotalColor??`#f8fafc`,f=n.repeatHeader??!0,p=n.pageOrientation??(t.length>(n.autoLandscapeThreshold??8)?`landscape`:`portrait`),m=Array.isArray(n.columnWidths)?n.columnWidths:t.map(()=>n.columnWidths===`auto`?`auto`:`*`),h=t.map(e=>({text:e.header,bold:!0,alignment:e.align??`left`,color:o,fillColor:a})),g=e.body??(e.rows??[]).map(e=>({kind:`data`,cells:e})),_=e.dataCellStyle,v=e.dataCellLink,y=0,b=new Set,x=[h];g.forEach((e,n)=>{let r=n+1;if(e.kind===`group`){let n={text:e.label,bold:!0,color:u,fillColor:l,colSpan:t.length,margin:[(e.level??0)*12,2,0,2]},r=Array.from({length:Math.max(0,t.length-1)},()=>({text:``}));x.push([n,...r])}else if(e.kind===`subtotal`)x.push(t.map((t,n)=>({text:e.cells[n]??``,bold:!0,alignment:t.align??`left`,fillColor:d})));else{b.add(r);let n=y++;x.push(t.map((t,r)=>{let i={text:e.cells[r]??``,alignment:t.align??`left`},a=_?.(n,r);a&&(a.fill&&(i.fillColor=a.fill),a.color&&(i.color=a.color),a.bold&&(i.bold=!0));let o=v?.(n,r);return o&&(i.link=o,i.decoration=`underline`,a?.color||(i.color=`#2563eb`)),i}))}});let S={table:{headerRows:+!!f,dontBreakRows:!0,widths:m,body:x},layout:{fillColor:e=>s&&e>0&&e%2==0&&b.has(e)?c:null,hLineWidth:()=>.5,vLineWidth:()=>.5,hLineColor:()=>`#e2e8f0`,vLineColor:()=>`#e2e8f0`,paddingTop:()=>3,paddingBottom:()=>3,paddingLeft:()=>5,paddingRight:()=>5}},C=[];if(n.logo&&C.push({image:n.logo,width:n.logoWidth??90,margin:[0,0,0,8]}),n.title&&C.push({text:n.title,fontSize:i+8,bold:!0,margin:[0,0,0,2]}),n.subtitle&&C.push({text:n.subtitle,fontSize:i+1,color:`#64748b`,margin:[0,0,0,8]}),n.kpis?.length){let e=n.kpiColor??`#f8fafc`;C.push({table:{widths:n.kpis.map(()=>`*`),body:[n.kpis.map(t=>({fillColor:e,margin:[8,6,8,6],stack:[{text:t.label,fontSize:i,color:`#64748b`},{text:t.value,fontSize:i+10,bold:!0,margin:[0,2,0,0]},...t.delta?[{text:t.delta,fontSize:i,color:t.color??`#64748b`,margin:[0,2,0,0]}]:[]]}))]},layout:{hLineWidth:()=>0,vLineWidth:()=>4,vLineColor:()=>`#ffffff`,paddingLeft:()=>0,paddingRight:()=>0,paddingTop:()=>0,paddingBottom:()=>0},margin:[0,0,0,10]})}let w=n.margins??[28,34,28,34],[T,E]=Ue[n.pageSize??`A4`],D=(p===`landscape`?E:T)-w[0]-w[2],O=(e.charts??(n.charts??[]).filter(e=>`image`in e)).map(e=>({stack:[...e.title?[{text:e.title,fontSize:i+3,bold:!0,margin:[0,0,0,4]}]:[],{image:e.image,width:Math.min(e.width??D,D)},...e.caption?[{text:e.caption,fontSize:i,color:`#64748b`,margin:[0,3,0,0]}]:[]],margin:[0,0,0,12],unbreakable:!0}));n.chartsPosition!==`below`&&C.push(...O),C.push(S),n.chartsPosition===`below`&&(O.length&&C.push({text:``,margin:[0,0,0,12]}),C.push(...O));let k={pageSize:n.pageSize??`A4`,pageOrientation:p,pageMargins:n.margins??[28,34,28,34],defaultStyle:{fontSize:i},content:C};if(n.showPageNumbers??!0){let e=r.toISOString().slice(0,10);k.footer=(t,n)=>({margin:[28,6,28,0],columns:[{text:e,alignment:`left`,fontSize:7,color:`#94a3b8`},{text:`Page ${t} of ${n}`,alignment:`right`,fontSize:7,color:`#94a3b8`}]})}return k}function Ke(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!n)return e;let r=parseInt(n[1],16);return`#`+[r>>16&255,r>>8&255,r&255].map(e=>Math.round(e+(255-e)*t).toString(16).padStart(2,`0`)).join(``)}function qe(e){let t={};return e.background&&(t.fill=e.background),!t.fill&&e.dataBar&&(t.fill=Ke(e.dataBar.color,.72)),e.color&&e.color!==`transparent`&&(t.color=e.color),(e.fontWeight===`bold`||typeof e.fontWeight==`number`&&e.fontWeight>=600)&&(t.bold=!0),e.icon&&(t.icon=e.icon),Object.keys(t).length>0?t:void 0}function H(e,t,n){if(!n||n.length===0)return()=>void 0;let r=new Map;if(D(n))for(let n of e)r.set(n.field,m(t.map(e=>e[n.field])));return(i,a)=>{let o=e[a],s=t[i];if(!o||!s)return;let c=s[o.field];return qe(T(c,s,o.field,n,r.get(o.field)??null))}}var Je=[`csv`,`tsv`,`html`,`json`,`xml`,`md`],Ye=null;async function Xe(){if(typeof window>`u`)throw Error(`@svgrid/enterprise: export requires a browser environment`);return Ye||=(async()=>{Ee(),await f(()=>import(`./smart.export-CDCwbFH4.js`),[],import.meta.url);let e=window.Smart?.Utilities?.DataExporter;if(!e)throw Error(`@svgrid/enterprise: failed to load Smart.Utilities.DataExporter`);return e})(),Ye}async function U(t){let n=globalThis;if(t===`xlsx`&&n.JSZip==null){let t;try{t=await f(()=>import(`./jszip.min-CX2fPs3O.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1]),import.meta.url)}catch{throw Error(`@svgrid/enterprise: xlsx export requires the "jszip" peer dependency. Install it with: pnpm add jszip`)}n.JSZip=t.default??t}if(t===`pdf`&&n.pdfMake==null){let t,r;try{t=await f(()=>import(`./pdfmake-BpIYFHoG.js`).then(t=>e(t.default,1)),__vite__mapDeps([2,1]),import.meta.url),r=await f(()=>import(`./vfs_fonts-BV-Ul9v2.js`).then(t=>e(t.default,1)),__vite__mapDeps([3,1]),import.meta.url)}catch{throw Error(`@svgrid/enterprise: pdf export requires the "pdfmake" peer dependency. Install it with: pnpm add pdfmake`)}let i=t.default??t;if(!He(i,r))throw Error(`@svgrid/enterprise: "pdfmake/build/vfs_fonts" did not contain a font map; the installed pdfmake is not one this export knows.`);n.pdfMake=i}}function W(e,t){if(Array.isArray(t))return t;switch(t){case`selected`:return e.getSelectedRows();case`all`:return e.getData();case`displayed`:case void 0:default:return e.getDisplayedRows()}}function G(e,t,n){if(t.columns&&t.columns.length>0)return t.columns;let r=e.getColumns().filter(e=>e.visible&&e.field);return r.length>0?r.map(e=>({field:e.field,header:e.header,format:e.format,align:e.align})):n.length>0?Object.keys(n[0]).filter(e=>!e.startsWith(`_`)).map(e=>({field:e})):[]}function K(e,t,n){if(e.exportValue)return e.exportValue(t)??``;let r=t[e.field];return n?r:a(r,e.format)}async function q(e,t,n){let r=n.rawValues===!0,i={};for(let e of t)i[e.field]=e.header??e.field;let a=[i],o=e.length;for(let i=0;i<o;i++){if(n.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let s=e[i],c={};for(let e of t)c[e.field]=K(e,s,r);a.push(c),i>0&&i%5e3==0&&(n.onProgress?.({phase:`project`,ratio:i/o,row:i,total:o}),await new Promise(e=>setTimeout(e,0)))}return n.onProgress?.({phase:`project`,ratio:1,row:o,total:o}),a}function Ze(e){if(!e)return;let t={};e.headerRow&&(t.header={...e.headerRow});let n=e.rows?{...e.rows}:{};return e.rowAlternate&&(n.alternationCount=2,n.alternationStart=0,e.rowAlternate.backgroundColor&&(n.alternationIndex1BackgroundColor=e.rowAlternate.backgroundColor),e.rowAlternate.color&&(n.alternationIndex1Color=e.rowAlternate.color)),Object.keys(n).length>0&&(t.rows=n),e.cells&&(t.cells=e.cells),t}var Qe=0,$e=new Map;function et(e){let t=$e.get(e);if(t)return t;let n=`img${++Qe}`;return $e.set(e,n),n}function tt(e,t=64,n=64){let r=/^data:image\/([a-zA-Z0-9+]+);/i.exec(e)?.[1]?.toLowerCase()??`png`,i=r===`jpg`?`jpeg`:r===`svg+xml`?`svg`:r;return{id:et(e),base64:e,imageType:i,width:t,height:n}}function nt(e,t){if(!e||e.length===0||t.length===0)return;let n=t[0],r=[];for(let i of e){let e={},a;if(`image`in i)e[n]=i.image,a={mergeAcross:!0,textAlign:`left`};else if(`text`in i)e[n]=i.text,a={mergeAcross:!0,...i.style??{}};else{let r=t[Math.floor(t.length/2)],o=t[t.length-1];i.left!==void 0&&(e[n]=i.left),i.center!==void 0&&(e[r]=i.center),i.right!==void 0&&(e[o]=i.right),a={textAlign:`left`}}r.push({cells:e,style:a})}return r}function rt(e,t){let n=e&&e.length>0?new Set(e):null;return(e,r,i)=>typeof i!=`string`||!/^data:image\//i.test(i)?null:n&&!n.has(r)?{image:tt(i,96,96),value:``}:{image:tt(i,t.width,t.height),value:``}}function it(e){let t={exportHeader:!0,pageOrientation:e.pageOrientation??`portrait`};e.freezeHeader!==!1&&(t.freezeHeader=!0),e.freezeColumns&&e.freezeColumns>0&&(t.freezeColumnsCount=Math.floor(e.freezeColumns));let n=Ze(e.styles);if(n&&(t.style=n),e.hierarchical&&(t.hierarchical=!0),e.merges?.length&&!e.groupBy?.length&&!e.hierarchical){let n=e.merges.map(e=>({cell:[e.row,e.col],rowspan:Math.max(1,Math.floor(e.rowSpan??1)),colspan:Math.max(1,Math.floor(e.colSpan??1))})).filter(e=>e.rowspan>1||e.colspan>1);n.length&&(t.mergedCells=n)}return t}function at(e,t,n){let r=nt(t.header,n),i=nt(t.footer,n);r&&(e.headerContent=r),i&&(e.footerContent=i);let a=(t.header?.some(e=>`image`in e)??!1)||(t.footer?.some(e=>`image`in e)??!1);if(t.imageFields?.length||a){let n=t.imageSize??{width:32,height:32};e.addImageToCell=rt(t.imageFields,n)}return e}function J(e,t){return e.toLowerCase().endsWith(`.`+t)?e:`${e}.${t}`}function ot(e,t,n,r,i){return i!==!1&&u(e,t),{blob:e,filename:t,mime:n,rowCount:r,byteSize:e.size}}function st(e,t,n,r,i){i!==!1&&s(e,t,n);let a=new Blob([e],{type:n});return{blob:a,filename:t,mime:n,rowCount:r,byteSize:a.size}}function Y(e,t,n){let r=Math.min(t.length,200);return e.map(e=>{if(typeof e.width==`number`)return e.width;let i=String(e.header??e.field).length;for(let a=0;a<r;a++){let r=K(e,t[a],n),o=r==null?0:String(r).length;o>i&&(i=o)}return Math.max(48,Math.min(400,i*7+14))})}function X(e,t,n){if(typeof t.freezeColumns==`number`)return t.freezeColumns;let r=e.getColumnPinning().left;if(!r||r.length===0)return;let i=new Set(r),a=0;for(let e of n)if(i.has(e.field))a++;else break;return a>0?a:void 0}function ct(e){let t=e,n=``;do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return n}function Z(e,t){if(e.some(e=>e.link))return(n,r)=>{let i=e[r],a=t[n];if(!(!i?.link||!a))return i.link(a)||void 0}}function lt(e){let t={};for(let n of e)n.align&&(t[n.field]=n.align);return t}async function ut(e,t,i,a,s,u){let d=i.map(e=>e.field),f={onProgress:a.onProgress,signal:a.signal};switch(e){case`html`:return{text:await c(t,d,{...f,title:(a.filename??`grid`).trim()||`grid`,align:lt(i),cellStyle:s,cellLink:u}),mime:`text/html;charset=utf-8`,ext:`html`};case`json`:return{text:await l(t,d,f),mime:`application/json;charset=utf-8`,ext:`json`};case`xml`:return{text:await o(t,d,f),mime:`application/xml;charset=utf-8`,ext:`xml`};case`md`:return{text:await r(t,d,{...f,align:lt(i)}),mime:`text/markdown;charset=utf-8`,ext:`md`};case`tsv`:return{text:await n(t,d,{...f,csv:{...a.csv,delimiter:` `}}),mime:`text/tab-separated-values;charset=utf-8`,ext:`tsv`};default:{let e=a.csv?.delimiter??`,`;return{text:await n(t,d,{...f,csv:{...a.csv,delimiter:e}}),mime:`text/csv;charset=utf-8`,ext:`csv`}}}}async function dt(e,t){if(t.sheets&&t.sheets.length>0)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx', got '${t.format}'`);let n=W(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=G(e,t,n),i=await q(n,r,t.format===`json`?{...t,rawValues:t.rawValues??!0}:t),a=(t.filename??`grid`).trim()||`grid`,o=t.format===`html`?H(r,n,t.conditionalFormats):void 0,s=t.format===`html`?Z(r,n):void 0,{text:c,mime:l,ext:u}=await ut(t.format,i,r,t,o,s);return st(c,J(a,u),l,n.length,t.download)}async function ft(e,t){if(t.sheets&&t.sheets.length>0)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx'. Use 'xls' for a single legacy sheet.`);let n=W(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=G(e,t,n),i=(t.filename??`grid`).trim()||`grid`,a=H(r,n,t.conditionalFormats);return st(await ke(i,r,n,{rawValues:t.rawValues,onProgress:t.onProgress,signal:t.signal,freezeHeader:t.freezeHeader!==!1,freezeColumns:X(e,t,r),widths:t.autoFitColumns===!1?void 0:Y(r,n,t.rawValues===!0),cellVisual:t.conditionalFormats?.length?a:void 0,precisionSafe:t.precisionSafe}),J(i,`xls`),`application/vnd.ms-excel;charset=utf-8`,n.length,t.download)}function Q(e){return e.format?.type===`number`||e.format?.type===`currency`}function pt(e,t,n){let r=[],i=t=>e.find(e=>e.field===t)?.header??t,o=e.findIndex(e=>!Q(e)),s=(t,c)=>{if(c>=n.length){for(let n of t)r.push({kind:`data`,cells:e.map(e=>String(K(e,n,!1)??``))});return}let l=n[c],u=new Map;for(let e of t){let t=String(e[l]??``),n=u.get(t);n?n.push(e):u.set(t,[e])}for(let[t,n]of u)if(r.push({kind:`group`,label:`${i(l)}: ${t} (${n.length})`,level:c}),s(n,c+1),e.some(Q)){let i=e.map(e=>{if(!Q(e))return``;let t=n.reduce((t,n)=>t+(Number(n[e.field])||0),0);return a(t,e.format)});o>=0&&(i[o]=`Subtotal (${t})`),r.push({kind:`subtotal`,cells:i})}};return s(t,0),r}async function mt(e,t){await U(`pdf`);let n=globalThis.pdfMake;if(!n)throw Error(`@svgrid/enterprise: pdf export requires the "pdfmake" peer dependency.`);let r=W(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=G(e,t,r),a=i.map(e=>e.field),o=i.map(e=>({header:e.header??e.field,align:e.align})),s=t.autoGroup!==!1&&!t.groupBy?.length&&!t.hierarchical?(e.getState().grouping??[]).filter(e=>!!e).map(e=>String(e)):[],c=t.groupBy?.length?t.groupBy:s.length>0?s:void 0;if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:r.length});let l={...t.pdf,pageOrientation:t.pdf?.pageOrientation??t.pageOrientation},u=await We(l.charts,async e=>{let{chartToPngBlob:t}=await f(async()=>{let{chartToPngBlob:e}=await import(`./src-CITpcm6b.js`).then(e=>e.t);return{chartToPngBlob:e}},__vite__mapDeps([4,1,5]),import.meta.url);return t(e,{scale:2})}),d=new Date,p;if(c?.length)p=Ge({columns:o,body:pt(i,r,c),opts:l,charts:u,now:d});else{let e=(await q(r,i,t)).slice(1).map(e=>a.map(t=>String(e[t]??``))),n=H(i,r,t.conditionalFormats);for(let t=0;t<e.length;t++)for(let r=0;r<i.length;r++){let i=n(t,r)?.icon;i&&(e[t][r]=`${i} ${e[t][r]??``}`)}p=Ge({columns:o,rows:e,dataCellStyle:(e,t)=>{let r=n(e,t);return r?{fill:r.fill,color:r.color,bold:r.bold}:void 0},dataCellLink:Z(i,r),opts:l,charts:u,now:d})}let m=(t.filename??`grid`).trim()||`grid`,h=await new Promise(e=>n.createPdf(p).getBlob(e));return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),ot(h,J(m,`pdf`),`application/pdf`,r.length,t.download)}async function ht(e,t,n,r,o,s){let c=e.map(e=>e.header??e.field),l=s?.precisionSafe===!0,u=(e,t,n)=>l&&Math.abs(e)>=0x38d7ea4c68000?{t:`s`,value:String(e),...t}:{t:`n`,value:e,numFmt:n,...t},f=(t,s,c)=>{let l=e[c],f=r(s,c),p={align:l.align,fill:f?.fill,color:f?.color,bold:f?.bold,link:o?.(s,c)};if(l.exportValue){let e=l.exportValue(t);return typeof e==`number`&&Number.isFinite(e)?u(e,p,d(l.format)):e instanceof Date?{t:`d`,value:e,numFmt:d(l.format)??`yyyy-mm-dd`,...p}:{t:`s`,value:e==null?``:String(e),...p}}let m=t[l.field];if(f?.icon){let e=n?String(m??``):a(m,l.format);return{t:`s`,value:`${f.icon} ${e}`,...p}}if(n)return typeof m==`number`&&Number.isFinite(m)?u(m,p):{t:`s`,value:m==null?``:String(m),...p};let h=i(m,l.format);return h.ok?h.value instanceof Date?{t:`d`,value:h.value,numFmt:d(l.format)??`yyyy-mm-dd`,...p}:u(h.value,p,d(l.format)):{t:`s`,value:a(m,l.format),...p}},p=[],m=t.length;for(let n=0;n<m;n++){if(s?.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);let r=t[n];p.push(e.map((e,t)=>f(r,n,t))),n>0&&n%2e3==0&&(s?.onProgress?.({phase:`project`,ratio:n/m,row:n,total:m}),await new Promise(e=>setTimeout(e,0)))}return{header:c,cells:p}}async function gt(e,t){await U(`xlsx`);let n=globalThis.JSZip;if(!n)throw Error(`@svgrid/enterprise: xlsx export requires the "jszip" peer dependency.`);let r=W(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=G(e,t,r),a=t.rawValues===!0,o=t.conditionalFormats??[],s=H(i,r,o.filter(e=>e.type===`rule`||e.type===`iconSet`)),c=Z(i,r),l=[];for(let e of o){if(e.type!==`colorScale`&&e.type!==`dataBar`)continue;let t=e.columns&&e.columns.length>0?i.map((t,n)=>e.columns.includes(t.field)?n:-1).filter(e=>e>=0):i.map((e,t)=>t);for(let n of t)if(e.type===`dataBar`)l.push({kind:`dataBar`,colIdx:n,color:e.color});else{let t=e.min??`#ffffff`,r=e.max??`#000000`;l.push({kind:`colorScale`,colIdx:n,colors:e.mid?[t,e.mid,r]:[t,r]})}}if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:r.length});let{header:u,cells:d}=await ht(i,r,a,s,c,{onProgress:t.onProgress,signal:t.signal,precisionSafe:t.precisionSafe}),f=t.autoFitColumns===!1?void 0:Y(i,r,a),p=(t.filename??`grid`).trim()||`grid`,m;t.excelTable&&(m={name:`Table1`,totalsRow:typeof t.excelTable==`object`&&t.excelTable.totalsRow===!0,style:typeof t.excelTable==`object`?t.excelTable.style:void 0,totalsFns:i.map(e=>Q(e)?`sum`:void 0)});let h=await Be(ze({sheetName:p,header:u,rows:d,widths:f,freezeHeader:t.freezeHeader!==!1,freezeColumns:X(e,t,i),condFormats:l,table:m}),n);return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),ot(h,J(p,`xlsx`),`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,r.length,t.download)}async function _t(e,t){if(we(`Export`),Je.includes(t.format))return dt(e,t);if(t.format===`xls`)return ft(e,t);if(t.format===`pdf`)return mt(e,t);if(t.format===`xlsx`){let n=t.autoGroup===!1?[]:(e.getState().grouping??[]).filter(e=>!!e),r=(t.groupBy?.length??0)>0||n.length>0,i=!!t.styles&&!t.conditionalFormats?.length;if(!t.sheets?.length&&!r&&!t.hierarchical&&!t.merges?.length&&!t.header?.length&&!t.footer?.length&&!t.imageFields?.length&&!i)return gt(e,t)}await U(t.format);let n=await Xe();if(t.sheets&&t.sheets.length>0){if(t.format!==`xlsx`)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx', got '${t.format}'`);let r=t.rawValues===!0,i=t.sheets.map(n=>{let i=G(e,{columns:n.columns??t.columns},n.rows),a=n.rows.map(e=>{let t={};for(let n of i)t[n.field]=K(n,e,r);return t}),o=t.autoFitColumns===!1?null:Y(i,n.rows,r);return{label:n.label,dataSource:a,columns:i.map((e,t)=>o?{dataField:e.field,label:e.header??e.field,width:o[t]}:{dataField:e.field,label:e.header??e.field}),dataFields:i.map(e=>e.field),style:Ze(n.styles??t.styles)}}),a=(t.filename??`grid`).trim()||`grid`,o=it(t),s=i[0],c=new n(o);c.spreadsheets=i,at(c,t,s.dataFields);let l={};for(let e of s.columns)l[e.dataField]=e.label;let u=[l,...s.dataSource];if(t.download===!1)throw Error(`@svgrid/enterprise: download:false is not supported for multi-sheet xlsx.`);c.exportData(u,t.format,a);return}let r=W(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=G(e,t,r),a=await q(r,i,t),o=(t.filename??`grid`).trim()||`grid`,s=i.map(e=>e.field),c=t.autoGroup!==!1&&!t.groupBy?.length&&!t.hierarchical?(e.getState().grouping??[]).filter(e=>!!e).map(e=>String(e)):[],l=t.groupBy?.length?t.groupBy:c.length>0?c:void 0,u=!t.hierarchical&&l?.length?l:void 0,d=it(t);if(t.conditionalFormats?.length){let e=H(i,r,t.conditionalFormats),n={};for(let t=0;t<r.length;t++)for(let r=0;r<i.length;r++){let o=e(t,r);if(!o)continue;let s={};if(o.fill&&(s.backgroundColor=o.fill),o.color&&(s.color=o.color),o.bold&&(s.fontWeight=`bold`),Object.keys(s).length&&(n[ct(r)+(t+2)]=s),o.icon){let e=a[t+1],n=i[r].field;e&&(e[n]=`${o.icon} ${e[n]??``}`)}}if(Object.keys(n).length){let e=d.style??{};d.style={...e,cells:{...e.cells??{},...n}}}}if(t.download===!1)throw Error(`@svgrid/enterprise: download:false is not supported for this xlsx export (grouped / merges / header / footer / images). Use a plain xlsx, xls, pdf, or a text format.`);if(t.signal?.aborted)throw new DOMException(`Export aborted`,`AbortError`);t.onProgress?.({phase:`write`,ratio:0,total:a.length-1});let f=new n(d,u);at(f,t,s),f.exportData(a,t.format,o),t.onProgress?.({phase:`write`,ratio:1,total:a.length-1})}var vt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function $(e){return(e==null?``:String(e)).replace(/[&<>"']/g,e=>vt[e])}function yt(e){let{columns:t,rows:n}=e,r=e.cellStyle,i=e.cellLink,a=e.opts??{},o=a.orientation??`portrait`,s=a.pageSize?`${a.pageSize} ${o}`:o,c=a.margin??`14mm`,l=a.zebra??!0,u=a.zebraColor??`#f6f8fa`,d=a.headerColor??`#f1f5f9`,f=a.headerTextColor??`#0f172a`,p=a.fontSize??9,m=e=>e&&e!==`left`?` style="text-align:${e}"`:``,h=`<thead><tr>`+t.map(e=>`<th${m(e.align)}>${$(e.header)}</th>`).join(``)+`</tr></thead>`,g=(e,t,n,a)=>{let o=[];e.align&&e.align!==`left`&&o.push(`text-align:${e.align}`);let s=r?.(n,a);s?.fill&&o.push(`background:${s.fill}`),s?.color&&o.push(`color:${s.color}`),s?.bold&&o.push(`font-weight:700`);let c=o.length?` style="${o.join(`;`)}"`:``,l=s?.icon?`${$(s.icon)} ${$(t)}`:$(t),u=i?.(n,a);return u&&(l=`<a href="${$(u)}">${l}</a>`),`<td${c}>${l}</td>`},_=`<tbody>`+n.map((e,n)=>`<tr>`+t.map((t,r)=>g(t,e[r]??``,n,r)).join(``)+`</tr>`).join(``)+`</tbody>`,v=[];return a.logo&&v.push(`<img class="logo" src="${$(a.logo)}" alt="" />`),a.title&&v.push(`<h1>${$(a.title)}</h1>`),a.subtitle&&v.push(`<p class="subtitle">${$(a.subtitle)}</p>`),`<!DOCTYPE html>
|
|
39
|
+
<html><head><meta charset="utf-8"><title>${$(a.title??`Grid`)}</title>
|
|
40
|
+
<style>
|
|
41
|
+
@page { size: ${s}; margin: ${c}; }
|
|
42
|
+
@media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
|
|
43
|
+
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #111; margin: 0; }
|
|
44
|
+
.logo { max-height: ${a.logoWidth?``:`48px`}; width: ${a.logoWidth?`${a.logoWidth}px`:`auto`}; display: block; margin-bottom: 8px; }
|
|
45
|
+
h1 { font-size: 16pt; margin: 0 0 2px 0; }
|
|
46
|
+
.subtitle { font-size: 10pt; color: #64748b; margin: 0 0 10px 0; }
|
|
47
|
+
table { border-collapse: collapse; width: 100%; font-size: ${p}pt; }
|
|
48
|
+
thead { display: table-header-group; }
|
|
49
|
+
tr { break-inside: avoid; }
|
|
50
|
+
th, td { border: 1px solid #cbd5e1; padding: 4px 7px; text-align: left; }
|
|
51
|
+
th { background: ${d}; color: ${f}; font-weight: 700; }
|
|
52
|
+
${l?`tbody tr:nth-child(even) { background: ${u}; }`:``}
|
|
53
|
+
</style></head>
|
|
54
|
+
<body>
|
|
55
|
+
${v.join(`
|
|
56
|
+
`)}
|
|
57
|
+
<table>${h}${_}</table>
|
|
58
|
+
</body></html>`}async function bt(e,t){if(we(`Print`),typeof window>`u`)throw Error(`@svgrid/enterprise: print requires a browser environment`);let n=W(e,t?.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to print - the grid has no rows`);let r=G(e,{columns:t?.columns},n),i=r.map(e=>e.field),a=(await q(n,r,{rawValues:t?.rawValues})).slice(1).map(e=>i.map(t=>String(e[t]??``))),o=r.map(e=>({header:e.header??e.field,align:e.align})),s={title:t?.title??`Grid`,subtitle:t?.subtitle,logo:t?.logo,orientation:t?.orientation??`portrait`,pageSize:t?.pageSize,margin:t?.margin,zebra:t?.zebra,headerColor:t?.headerColor},c=H(r,n,t?.conditionalFormats),l=yt({columns:o,rows:a,cellStyle:(e,t)=>c(e,t),cellLink:Z(r,n),opts:s}),u=window.open(``,`_blank`,`width=900,height=700`);if(!u)throw Error(`@svgrid/enterprise: print() could not open a window - the browser blocked the popup`);u.document.open(),u.document.write(l),u.document.close(),u.focus(),u.addEventListener(`load`,()=>{setTimeout(()=>u.print(),50)}),setTimeout(()=>{try{u.print()}catch{}},300)}var xt=t({DATA_BAR_COLOR:()=>DATA_BAR_COLOR,DEFAULT_ALERT_MESSAGE:()=>DEFAULT_ALERT_MESSAGE,PROTECTED_MESSAGE:()=>PROTECTED_MESSAGE,countReducer:()=>countReducer,exportGrid:()=>_t,printGrid:()=>bt});export{m as a,T as c,N as i,Se as n,E as o,Ce as r,D as s,xt as t};
|
package/dist/designer/index.html
CHANGED
|
@@ -4,34 +4,43 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>SvGrid Studio - Designer</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-DwU7CAMm.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-Dd_uD5pT.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/disclose-version-CIm4S9xS.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/preload-helper-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
14
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-formatting-wr5wm7US.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/export-format-D-eP4b2l.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/preload-helper-HclGiUj8.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/src-EdI3Xqds.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="./assets/editor-contract-Bpoa7A5g.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="./assets/date-format-B8JbEtIG.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="./assets/list-option-BP_dWS66.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="./assets/SvListBox-BDS66lmZ.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGrid.helpers-BgT-gnCo.js">
|
|
15
19
|
<link rel="modulepreload" crossorigin href="./assets/popover-CUkLsvRX.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="./assets/SvGridDropdown-
|
|
20
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridDropdown-Bb3HH2Aj.js">
|
|
17
21
|
<link rel="modulepreload" crossorigin href="./assets/dismissable-BO547MH9.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="./assets/SvDateTimePicker-
|
|
22
|
+
<link rel="modulepreload" crossorigin href="./assets/SvDateTimePicker-DARvKUL2.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="./assets/SvDateRangeInput-BBRzrQeg.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-trap-CAreAhlU.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="./assets/SvTabs-UFCMTHXS.js">
|
|
19
26
|
<link rel="modulepreload" crossorigin href="./assets/editor-registry-BjP16H0v.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
21
|
-
<link rel="modulepreload" crossorigin href="./assets/chart-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
23
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
24
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
25
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
26
|
-
<link rel="
|
|
27
|
-
<link rel="stylesheet" crossorigin href="./assets/date-format-
|
|
28
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
29
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
30
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
31
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
32
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
33
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
34
|
-
<link rel="stylesheet" crossorigin href="./assets/
|
|
27
|
+
<link rel="modulepreload" crossorigin href="./assets/SvMenuList-Dgq2D5VN.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-trend-D5I5VEe8.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-cIPUsbM5.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-export-B6bkQ3X8.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridChart-B8j1SSy3.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-panel-messages-DtTxpBUU.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridChartPanel-pT6ITc2P.js">
|
|
34
|
+
<link rel="stylesheet" crossorigin href="./assets/date-format-DKS-z0xS.css">
|
|
35
|
+
<link rel="stylesheet" crossorigin href="./assets/SvListBox-BXfyqy4a.css">
|
|
36
|
+
<link rel="stylesheet" crossorigin href="./assets/SvGridDropdown-CcidB3rm.css">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="./assets/SvDateTimePicker-DPv09DIT.css">
|
|
38
|
+
<link rel="stylesheet" crossorigin href="./assets/SvDateRangeInput-C0iCCZ8o.css">
|
|
39
|
+
<link rel="stylesheet" crossorigin href="./assets/SvTabs-DKmwb5p1.css">
|
|
40
|
+
<link rel="stylesheet" crossorigin href="./assets/SvMenuList-DJ47ba1h.css">
|
|
41
|
+
<link rel="stylesheet" crossorigin href="./assets/SvGridChart-BgLuPO7I.css">
|
|
42
|
+
<link rel="stylesheet" crossorigin href="./assets/SvGridChartPanel-4Pc8y5yO.css">
|
|
43
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CMFgAoVV.css">
|
|
35
44
|
</head>
|
|
36
45
|
<body>
|
|
37
46
|
<div id="app"></div>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type ConditionalFormat } from '@svgrid/grid/format';
|
|
15
15
|
import type { RowData } from '@svgrid/grid';
|
|
16
|
-
import type { ExportColumn } from './export';
|
|
16
|
+
import type { ExportColumn } from './export.js';
|
|
17
17
|
/** The visual primitives an exporter can apply to one cell. */
|
|
18
18
|
export type ExportCellVisual = {
|
|
19
19
|
fill?: string;
|
package/dist/export-pdf.d.ts
CHANGED
|
@@ -10,6 +10,41 @@
|
|
|
10
10
|
* result to `pdfMake.createPdf(def).download(...)`.
|
|
11
11
|
*/
|
|
12
12
|
export type PdfPageSize = 'A4' | 'A3' | 'A5' | 'LETTER' | 'LEGAL';
|
|
13
|
+
/** The font files pdfmake reads, by name, as base64. */
|
|
14
|
+
export type PdfVirtualFileSystem = Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* The font map inside whatever `import('pdfmake/build/vfs_fonts')` returned.
|
|
17
|
+
*
|
|
18
|
+
* The file has changed shape across pdfmake releases and bundlers wrap it
|
|
19
|
+
* once more: `{ pdfMake: { vfs } }` (0.1.x), `{ vfs }`, either of those under
|
|
20
|
+
* `default`, and since 0.2.8 the module IS the map (`module.exports = vfs`,
|
|
21
|
+
* so an ESM interop hands it over as `default` with the `.ttf` names as
|
|
22
|
+
* keys). Only the last shape ships today, and it is the one the old lookup
|
|
23
|
+
* did not recognise, which left registration to a side effect of import
|
|
24
|
+
* order (see {@link registerPdfFonts}). Returns `null` when nothing in the
|
|
25
|
+
* module looks like a font map.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolvePdfVfs(mod: unknown): PdfVirtualFileSystem | null;
|
|
28
|
+
/** The parts of pdfmake's browser API that font registration touches. */
|
|
29
|
+
export type PdfMakeLike = {
|
|
30
|
+
vfs?: PdfVirtualFileSystem;
|
|
31
|
+
addVirtualFileSystem?: (vfs: PdfVirtualFileSystem) => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Hand the fonts to the pdfmake instance that will create the document,
|
|
35
|
+
* explicitly. `vfs_fonts` registers itself only as a side effect: at import
|
|
36
|
+
* time it looks for a global `pdfMake` with `addVirtualFileSystem` and calls
|
|
37
|
+
* it. Under a bundler that global is whichever instance happened to load
|
|
38
|
+
* first, and when a dev server re-optimises its dependencies mid-session
|
|
39
|
+
* that is a stale one, so the instance doing the export has no fonts and
|
|
40
|
+
* `createPdf` fails with "File 'Roboto-Medium.ttf' not found in virtual
|
|
41
|
+
* file system". Registering here, on the instance in hand, removes the
|
|
42
|
+
* dependence on import order: `addVirtualFileSystem` where the version has
|
|
43
|
+
* it (0.2.x, where `createPdf` reads that before the `vfs` property) and the
|
|
44
|
+
* `vfs` property as well, which older versions read. Returns whether a map
|
|
45
|
+
* was found to register.
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerPdfFonts(pdfMake: PdfMakeLike, vfsModule: unknown): boolean;
|
|
13
48
|
export type PdfExportOptions = {
|
|
14
49
|
pageSize?: PdfPageSize;
|
|
15
50
|
pageOrientation?: 'portrait' | 'landscape';
|
|
@@ -51,7 +86,57 @@ export type PdfExportOptions = {
|
|
|
51
86
|
groupTextColor?: string;
|
|
52
87
|
/** Subtotal row fill color. Default '#f8fafc'. */
|
|
53
88
|
subtotalColor?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Charts to print with the table. Each is a rendered chart's element (the
|
|
91
|
+
* grid chart's wrapper or its `<svg>`, rasterised on export) or an image
|
|
92
|
+
* data URL you already have, with an optional title and caption. Printed
|
|
93
|
+
* at the content width unless `width` (pt) says otherwise.
|
|
94
|
+
*/
|
|
95
|
+
charts?: ReadonlyArray<PdfChart>;
|
|
96
|
+
/** Where the charts go: above the table (default) or below it. */
|
|
97
|
+
chartsPosition?: 'above' | 'below';
|
|
98
|
+
/**
|
|
99
|
+
* A strip of headline numbers above the table: a label, the value, and an
|
|
100
|
+
* optional delta line in its own colour ("+4.2%" in green).
|
|
101
|
+
*/
|
|
102
|
+
kpis?: ReadonlyArray<PdfKpi>;
|
|
103
|
+
/** KPI box fill. Default '#f8fafc'. */
|
|
104
|
+
kpiColor?: string;
|
|
54
105
|
};
|
|
106
|
+
/** A chart for the PDF: an element to rasterise, or a finished image. */
|
|
107
|
+
export type PdfChart = {
|
|
108
|
+
element: SVGSVGElement | HTMLElement;
|
|
109
|
+
title?: string;
|
|
110
|
+
caption?: string;
|
|
111
|
+
width?: number;
|
|
112
|
+
} | {
|
|
113
|
+
image: string;
|
|
114
|
+
title?: string;
|
|
115
|
+
caption?: string;
|
|
116
|
+
width?: number;
|
|
117
|
+
};
|
|
118
|
+
/** One box of the KPI strip. */
|
|
119
|
+
export type PdfKpi = {
|
|
120
|
+
label: string;
|
|
121
|
+
value: string;
|
|
122
|
+
/** A second line under the value: a change, a target, a period. */
|
|
123
|
+
delta?: string;
|
|
124
|
+
/** Colour of the delta line. Default '#64748b'. */
|
|
125
|
+
color?: string;
|
|
126
|
+
};
|
|
127
|
+
/** A chart whose image is ready: what `buildPdfDocDefinition` consumes. */
|
|
128
|
+
export type PdfChartImage = {
|
|
129
|
+
image: string;
|
|
130
|
+
title?: string;
|
|
131
|
+
caption?: string;
|
|
132
|
+
width?: number;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Turn every `element` chart into an image through `rasterize` (the grid's
|
|
136
|
+
* `chartToPngBlob`, injected so this stays testable without a canvas); image
|
|
137
|
+
* charts pass through. Order is kept.
|
|
138
|
+
*/
|
|
139
|
+
export declare function resolvePdfCharts(charts: ReadonlyArray<PdfChart> | undefined, rasterize: (el: SVGSVGElement | HTMLElement) => Promise<Blob>): Promise<PdfChartImage[]>;
|
|
55
140
|
/**
|
|
56
141
|
* A body row for the PDF table. `data` is a normal row; `group` is a bold,
|
|
57
142
|
* full-width group header (from grid grouping); `subtotal` is a per-group
|
|
@@ -103,5 +188,9 @@ export declare function buildPdfDocDefinition(params: {
|
|
|
103
188
|
/** Per-data-cell hyperlink URL. */
|
|
104
189
|
dataCellLink?: (dataRowIdx: number, colIdx: number) => string | undefined;
|
|
105
190
|
opts?: PdfExportOptions;
|
|
191
|
+
/** Charts with their images resolved (see `resolvePdfCharts`). Takes
|
|
192
|
+
* precedence over the `element` entries of `opts.charts`, which cannot be
|
|
193
|
+
* drawn here. */
|
|
194
|
+
charts?: ReadonlyArray<PdfChartImage>;
|
|
106
195
|
now?: Date;
|
|
107
196
|
}): PdfDocDefinition;
|
package/dist/export-pdf.js
CHANGED
|
@@ -9,6 +9,85 @@
|
|
|
9
9
|
* docDefinition object, so it's fully unit-testable; `exportGrid` feeds the
|
|
10
10
|
* result to `pdfMake.createPdf(def).download(...)`.
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* The font map inside whatever `import('pdfmake/build/vfs_fonts')` returned.
|
|
14
|
+
*
|
|
15
|
+
* The file has changed shape across pdfmake releases and bundlers wrap it
|
|
16
|
+
* once more: `{ pdfMake: { vfs } }` (0.1.x), `{ vfs }`, either of those under
|
|
17
|
+
* `default`, and since 0.2.8 the module IS the map (`module.exports = vfs`,
|
|
18
|
+
* so an ESM interop hands it over as `default` with the `.ttf` names as
|
|
19
|
+
* keys). Only the last shape ships today, and it is the one the old lookup
|
|
20
|
+
* did not recognise, which left registration to a side effect of import
|
|
21
|
+
* order (see {@link registerPdfFonts}). Returns `null` when nothing in the
|
|
22
|
+
* module looks like a font map.
|
|
23
|
+
*/
|
|
24
|
+
export function resolvePdfVfs(mod) {
|
|
25
|
+
const isMap = (v) => !!v && typeof v === 'object' && Object.keys(v).some((k) => /\.(ttf|otf)$/i.test(k)) &&
|
|
26
|
+
Object.values(v).every((x) => typeof x === 'string');
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
const walk = (v) => {
|
|
29
|
+
if (!v || typeof v !== 'object' || seen.has(v))
|
|
30
|
+
return null;
|
|
31
|
+
seen.add(v);
|
|
32
|
+
if (isMap(v))
|
|
33
|
+
return v;
|
|
34
|
+
const o = v;
|
|
35
|
+
return walk(o.pdfMake?.vfs) ?? walk(o.vfs) ?? walk(o.default);
|
|
36
|
+
};
|
|
37
|
+
return walk(mod);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Hand the fonts to the pdfmake instance that will create the document,
|
|
41
|
+
* explicitly. `vfs_fonts` registers itself only as a side effect: at import
|
|
42
|
+
* time it looks for a global `pdfMake` with `addVirtualFileSystem` and calls
|
|
43
|
+
* it. Under a bundler that global is whichever instance happened to load
|
|
44
|
+
* first, and when a dev server re-optimises its dependencies mid-session
|
|
45
|
+
* that is a stale one, so the instance doing the export has no fonts and
|
|
46
|
+
* `createPdf` fails with "File 'Roboto-Medium.ttf' not found in virtual
|
|
47
|
+
* file system". Registering here, on the instance in hand, removes the
|
|
48
|
+
* dependence on import order: `addVirtualFileSystem` where the version has
|
|
49
|
+
* it (0.2.x, where `createPdf` reads that before the `vfs` property) and the
|
|
50
|
+
* `vfs` property as well, which older versions read. Returns whether a map
|
|
51
|
+
* was found to register.
|
|
52
|
+
*/
|
|
53
|
+
export function registerPdfFonts(pdfMake, vfsModule) {
|
|
54
|
+
const vfs = resolvePdfVfs(vfsModule);
|
|
55
|
+
if (!vfs)
|
|
56
|
+
return false;
|
|
57
|
+
if (typeof pdfMake.addVirtualFileSystem === 'function')
|
|
58
|
+
pdfMake.addVirtualFileSystem(vfs);
|
|
59
|
+
pdfMake.vfs = vfs;
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
/** Page sizes in pt (portrait), for the content width the charts fill. */
|
|
63
|
+
const PAGE_PT = {
|
|
64
|
+
A4: [595.28, 841.89], A3: [841.89, 1190.55], A5: [419.53, 595.28], LETTER: [612, 792], LEGAL: [612, 1008],
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Turn every `element` chart into an image through `rasterize` (the grid's
|
|
68
|
+
* `chartToPngBlob`, injected so this stays testable without a canvas); image
|
|
69
|
+
* charts pass through. Order is kept.
|
|
70
|
+
*/
|
|
71
|
+
export async function resolvePdfCharts(charts, rasterize) {
|
|
72
|
+
if (!charts?.length)
|
|
73
|
+
return [];
|
|
74
|
+
const out = [];
|
|
75
|
+
for (const c of charts) {
|
|
76
|
+
if ('image' in c) {
|
|
77
|
+
out.push(c);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const blob = await rasterize(c.element);
|
|
81
|
+
const image = await new Promise((resolve, reject) => {
|
|
82
|
+
const fr = new FileReader();
|
|
83
|
+
fr.onload = () => resolve(String(fr.result));
|
|
84
|
+
fr.onerror = () => reject(fr.error ?? new Error('could not read the chart image'));
|
|
85
|
+
fr.readAsDataURL(blob);
|
|
86
|
+
});
|
|
87
|
+
out.push({ image, title: c.title, caption: c.caption, width: c.width });
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
12
91
|
/**
|
|
13
92
|
* Build a pdfmake docDefinition from resolved columns + formatted string rows.
|
|
14
93
|
* `now` is injected for a deterministic footer date in tests.
|
|
@@ -122,7 +201,58 @@ export function buildPdfDocDefinition(params) {
|
|
|
122
201
|
content.push({ text: o.title, fontSize: fontSize + 8, bold: true, margin: [0, 0, 0, 2] });
|
|
123
202
|
if (o.subtitle)
|
|
124
203
|
content.push({ text: o.subtitle, fontSize: fontSize + 1, color: '#64748b', margin: [0, 0, 0, 8] });
|
|
204
|
+
// The KPI strip: one row of boxes, each a label over a big number.
|
|
205
|
+
if (o.kpis?.length) {
|
|
206
|
+
const fill = o.kpiColor ?? '#f8fafc';
|
|
207
|
+
content.push({
|
|
208
|
+
table: {
|
|
209
|
+
widths: o.kpis.map(() => '*'),
|
|
210
|
+
body: [
|
|
211
|
+
o.kpis.map((k) => ({
|
|
212
|
+
fillColor: fill,
|
|
213
|
+
margin: [8, 6, 8, 6],
|
|
214
|
+
stack: [
|
|
215
|
+
{ text: k.label, fontSize: fontSize, color: '#64748b' },
|
|
216
|
+
{ text: k.value, fontSize: fontSize + 10, bold: true, margin: [0, 2, 0, 0] },
|
|
217
|
+
...(k.delta ? [{ text: k.delta, fontSize: fontSize, color: k.color ?? '#64748b', margin: [0, 2, 0, 0] }] : []),
|
|
218
|
+
],
|
|
219
|
+
})),
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
layout: {
|
|
223
|
+
hLineWidth: () => 0,
|
|
224
|
+
vLineWidth: () => 4,
|
|
225
|
+
vLineColor: () => '#ffffff',
|
|
226
|
+
paddingLeft: () => 0,
|
|
227
|
+
paddingRight: () => 0,
|
|
228
|
+
paddingTop: () => 0,
|
|
229
|
+
paddingBottom: () => 0,
|
|
230
|
+
},
|
|
231
|
+
margin: [0, 0, 0, 10],
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
// Charts: the resolved images, at the content width unless told otherwise.
|
|
235
|
+
const margins = o.margins ?? [28, 34, 28, 34];
|
|
236
|
+
const [pw, ph] = PAGE_PT[o.pageSize ?? 'A4'];
|
|
237
|
+
const contentWidth = (orientation === 'landscape' ? ph : pw) - margins[0] - margins[2];
|
|
238
|
+
const chartImages = params.charts ?? (o.charts ?? []).filter((c) => 'image' in c);
|
|
239
|
+
const chartBlocks = chartImages.map((c) => ({
|
|
240
|
+
stack: [
|
|
241
|
+
...(c.title ? [{ text: c.title, fontSize: fontSize + 3, bold: true, margin: [0, 0, 0, 4] }] : []),
|
|
242
|
+
{ image: c.image, width: Math.min(c.width ?? contentWidth, contentWidth) },
|
|
243
|
+
...(c.caption ? [{ text: c.caption, fontSize: fontSize, color: '#64748b', margin: [0, 3, 0, 0] }] : []),
|
|
244
|
+
],
|
|
245
|
+
margin: [0, 0, 0, 12],
|
|
246
|
+
unbreakable: true,
|
|
247
|
+
}));
|
|
248
|
+
if (o.chartsPosition !== 'below')
|
|
249
|
+
content.push(...chartBlocks);
|
|
125
250
|
content.push(table);
|
|
251
|
+
if (o.chartsPosition === 'below') {
|
|
252
|
+
if (chartBlocks.length)
|
|
253
|
+
content.push({ text: '', margin: [0, 0, 0, 12] });
|
|
254
|
+
content.push(...chartBlocks);
|
|
255
|
+
}
|
|
126
256
|
const def = {
|
|
127
257
|
pageSize: o.pageSize ?? 'A4',
|
|
128
258
|
pageOrientation: orientation,
|
package/dist/export-print.js
CHANGED
|
@@ -68,24 +68,24 @@ export function buildPrintDocument(params) {
|
|
|
68
68
|
band.push(`<h1>${esc(o.title)}</h1>`);
|
|
69
69
|
if (o.subtitle)
|
|
70
70
|
band.push(`<p class="subtitle">${esc(o.subtitle)}</p>`);
|
|
71
|
-
return `<!DOCTYPE html>
|
|
72
|
-
<html><head><meta charset="utf-8"><title>${esc(o.title ?? 'Grid')}</title>
|
|
73
|
-
<style>
|
|
74
|
-
@page { size: ${size}; margin: ${margin}; }
|
|
75
|
-
@media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
|
|
76
|
-
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #111; margin: 0; }
|
|
77
|
-
.logo { max-height: ${o.logoWidth ? '' : '48px'}; width: ${o.logoWidth ? `${o.logoWidth}px` : 'auto'}; display: block; margin-bottom: 8px; }
|
|
78
|
-
h1 { font-size: 16pt; margin: 0 0 2px 0; }
|
|
79
|
-
.subtitle { font-size: 10pt; color: #64748b; margin: 0 0 10px 0; }
|
|
80
|
-
table { border-collapse: collapse; width: 100%; font-size: ${fontSize}pt; }
|
|
81
|
-
thead { display: table-header-group; }
|
|
82
|
-
tr { break-inside: avoid; }
|
|
83
|
-
th, td { border: 1px solid #cbd5e1; padding: 4px 7px; text-align: left; }
|
|
84
|
-
th { background: ${headerColor}; color: ${headerTextColor}; font-weight: 700; }
|
|
85
|
-
${zebra ? `tbody tr:nth-child(even) { background: ${zebraColor}; }` : ''}
|
|
86
|
-
</style></head>
|
|
87
|
-
<body>
|
|
88
|
-
${band.join('\n ')}
|
|
89
|
-
<table>${thead}${tbody}</table>
|
|
71
|
+
return `<!DOCTYPE html>
|
|
72
|
+
<html><head><meta charset="utf-8"><title>${esc(o.title ?? 'Grid')}</title>
|
|
73
|
+
<style>
|
|
74
|
+
@page { size: ${size}; margin: ${margin}; }
|
|
75
|
+
@media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
|
|
76
|
+
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #111; margin: 0; }
|
|
77
|
+
.logo { max-height: ${o.logoWidth ? '' : '48px'}; width: ${o.logoWidth ? `${o.logoWidth}px` : 'auto'}; display: block; margin-bottom: 8px; }
|
|
78
|
+
h1 { font-size: 16pt; margin: 0 0 2px 0; }
|
|
79
|
+
.subtitle { font-size: 10pt; color: #64748b; margin: 0 0 10px 0; }
|
|
80
|
+
table { border-collapse: collapse; width: 100%; font-size: ${fontSize}pt; }
|
|
81
|
+
thead { display: table-header-group; }
|
|
82
|
+
tr { break-inside: avoid; }
|
|
83
|
+
th, td { border: 1px solid #cbd5e1; padding: 4px 7px; text-align: left; }
|
|
84
|
+
th { background: ${headerColor}; color: ${headerTextColor}; font-weight: 700; }
|
|
85
|
+
${zebra ? `tbody tr:nth-child(even) { background: ${zebraColor}; }` : ''}
|
|
86
|
+
</style></head>
|
|
87
|
+
<body>
|
|
88
|
+
${band.join('\n ')}
|
|
89
|
+
<table>${thead}${tbody}</table>
|
|
90
90
|
</body></html>`;
|
|
91
91
|
}
|
package/dist/export-xls.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ExportColumn } from './export';
|
|
1
|
+
import type { ExportColumn } from './export.js';
|
|
2
2
|
import type { RowData } from '@svgrid/grid';
|
|
3
|
-
import type { SerializeOptions } from './export-serialize';
|
|
3
|
+
import type { SerializeOptions } from './export-serialize.js';
|
|
4
4
|
/**
|
|
5
5
|
* Serialize rows to an Excel 2003 XML Spreadsheet (`.xls`) document string.
|
|
6
6
|
* Streams in chunks with `onProgress` + `AbortSignal`, matching the other
|
package/dist/export.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CellFormatConfig, RowData, TableFeatures } from '@svgrid/grid';
|
|
2
2
|
import type { SvGridApi } from '@svgrid/grid';
|
|
3
|
-
import { type CsvOptions, type SerializeProgress } from './export-serialize';
|
|
4
|
-
import { type PdfBodyRow, type PdfExportOptions } from './export-pdf';
|
|
3
|
+
import { type CsvOptions, type SerializeProgress } from './export-serialize.js';
|
|
4
|
+
import { type PdfBodyRow, type PdfExportOptions } from './export-pdf.js';
|
|
5
5
|
import type { ConditionalFormat } from '@svgrid/grid/format';
|
|
6
6
|
/**
|
|
7
7
|
* Export target formats.
|