@svgrid/enterprise 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +94 -24
- package/README.md +36 -4
- package/dist/SvAdvancedFilter.svelte +1 -1
- package/dist/SvAlertsManager.svelte +2 -1
- package/dist/SvBoard.svelte +2 -1
- package/dist/SvExportMenu.svelte +4 -1
- package/dist/SvExportMenu.svelte.d.ts +0 -13
- package/dist/SvExpressionEditor.svelte +3 -3
- package/dist/SvFormulaBar.svelte +94 -20
- package/dist/SvFormulaBar.svelte.d.ts +7 -0
- package/dist/SvGridAlerts.svelte +49 -9
- package/dist/SvGridBoard.svelte +13 -8
- package/dist/SvGridBulkEditDrawer.svelte +26 -2
- package/dist/SvGridEditPanel.svelte +3 -0
- package/dist/SvGridScheduler.svelte +69 -40
- package/dist/SvGridSelectionBar.svelte +10 -3
- package/dist/SvPivotDesigner.svelte +198 -40
- package/dist/SvPivotDesigner.svelte.d.ts +27 -20
- package/dist/SvSheet.svelte +4043 -243
- package/dist/SvSheet.svelte.d.ts +76 -3
- package/dist/SvSheetChartSetup.svelte +151 -0
- package/dist/SvSheetChartSetup.svelte.d.ts +18 -0
- package/dist/SvSheetComment.svelte +216 -31
- package/dist/SvSheetComment.svelte.d.ts +11 -11
- package/dist/SvSheetConditionalFormat.svelte +28 -31
- package/dist/SvSheetDataValidation.svelte +66 -42
- package/dist/SvSheetEditRanges.svelte +217 -0
- package/dist/SvSheetEditRanges.svelte.d.ts +15 -0
- package/dist/SvSheetErrors.svelte +125 -0
- package/dist/SvSheetErrors.svelte.d.ts +20 -0
- package/dist/SvSheetEvaluate.svelte +133 -0
- package/dist/SvSheetEvaluate.svelte.d.ts +15 -0
- package/dist/SvSheetFilterMenu.svelte +137 -34
- package/dist/SvSheetFilterMenu.svelte.d.ts +5 -0
- package/dist/SvSheetFindReplace.svelte +19 -19
- package/dist/SvSheetFormatCells.svelte +125 -81
- package/dist/SvSheetGoalSeek.svelte +17 -16
- package/dist/SvSheetInsertFunction.svelte +15 -13
- package/dist/SvSheetIteration.svelte +81 -0
- package/dist/SvSheetIteration.svelte.d.ts +10 -0
- package/dist/SvSheetLink.svelte +99 -0
- package/dist/SvSheetLink.svelte.d.ts +17 -0
- package/dist/SvSheetListPicker.svelte +4 -2
- package/dist/SvSheetListPicker.svelte.d.ts +0 -6
- package/dist/SvSheetManageRules.svelte +20 -18
- package/dist/SvSheetNameManager.svelte +17 -15
- package/dist/SvSheetPageSetup.svelte +159 -0
- package/dist/SvSheetPageSetup.svelte.d.ts +13 -0
- package/dist/SvSheetPasteSpecial.svelte +22 -20
- package/dist/SvSheetPivot.svelte +220 -0
- package/dist/SvSheetPivot.svelte.d.ts +21 -0
- package/dist/SvSheetProtectSheet.svelte +81 -0
- package/dist/SvSheetProtectSheet.svelte.d.ts +11 -0
- package/dist/SvSheetRemoveDuplicates.svelte +13 -10
- package/dist/SvSheetRibbon.svelte +104 -51
- package/dist/SvSheetSizeDialog.svelte +4 -2
- package/dist/SvSheetSort.svelte +218 -0
- package/dist/SvSheetSort.svelte.d.ts +28 -0
- package/dist/SvSheetSparklines.svelte +135 -0
- package/dist/SvSheetSparklines.svelte.d.ts +14 -0
- package/dist/SvSheetTable.svelte +160 -0
- package/dist/SvSheetTable.svelte.d.ts +24 -0
- package/dist/SvSheetTabs.svelte +161 -31
- package/dist/SvSheetTabs.svelte.d.ts +22 -8
- package/dist/SvSheetTextToColumns.svelte +20 -20
- package/dist/SvSheetValidationAlert.svelte +8 -6
- package/dist/advanced-filter-enable.js +1 -1
- package/dist/alerts/alert-engine.d.ts +6 -0
- package/dist/alerts/alert-engine.js +21 -4
- package/dist/alerts/alert-formats.js +2 -0
- package/dist/alerts/alert-types.d.ts +1 -1
- package/dist/alerts.d.ts +1 -1
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/bulk-edit.d.ts +3 -1
- package/dist/bulk-edit.js +1 -1
- package/dist/cdn/svgrid-enterprise.svelte-external.js +39827 -16429
- package/dist/designer/assets/GridMenus-8gTNssgV.js +8 -0
- package/dist/designer/assets/{SvChartMenu-D9hEeHar.js → SvChartMenu-BDoeqGz6.js} +1 -1
- package/dist/designer/assets/{SvDateTimePicker-DARvKUL2.js → SvDateTimePicker-DCPg7WGN.js} +1 -1
- package/dist/designer/assets/SvGridCellEditor-DMoWJjEI.js +4 -0
- package/dist/designer/assets/{SvGridChart-B8j1SSy3.js → SvGridChart-Cy1ATrWh.js} +2 -2
- package/dist/designer/assets/SvGridChartBuilder-eQ3mn0L9.js +1 -0
- package/dist/designer/assets/{SvGridChartPanel-pT6ITc2P.js → SvGridChartPanel-CATdVc9X.js} +3 -3
- package/dist/designer/assets/{SvGridChartView-bg281UA1.js → SvGridChartView-CmsZtCED.js} +1 -1
- package/dist/designer/assets/SvGridDropdown-Cjz0H-fI.js +1 -0
- package/dist/designer/assets/{SvTabs-UFCMTHXS.js → SvTabs-2mHC6oaz.js} +1 -1
- package/dist/designer/assets/cell-formatting-BbubJTVz.js +1 -0
- package/dist/designer/assets/{chart-cIPUsbM5.js → chart-Cn7MnNqA.js} +1 -1
- package/dist/designer/assets/{chart-panel-messages-DtTxpBUU.js → chart-panel-messages-Dz7PTIqT.js} +1 -1
- package/dist/designer/assets/{chart-summary-Czu_5epb.js → chart-summary-BD1qYB2R.js} +1 -1
- package/dist/designer/assets/{chart-trend-D5I5VEe8.js → chart-trend-B8xr5LuD.js} +1 -1
- package/dist/designer/assets/{dismissable-BO547MH9.js → dismissable-ChWRPkoa.js} +1 -1
- package/dist/designer/assets/{export-format-D-eP4b2l.js → export-format-DGckmgKr.js} +1 -1
- package/dist/designer/assets/{focus-trap-CAreAhlU.js → focus-trap-V2-6Fy9I.js} +1 -1
- package/dist/designer/assets/{index-DwU7CAMm.js → index-D5bVbuzI.js} +317 -315
- package/dist/designer/assets/index-_JVFxt02.css +1 -0
- package/dist/designer/assets/row-resize-BInFWCpr.js +1 -0
- package/dist/designer/assets/server-block-cache-CXJKkJpy.js +1 -0
- package/dist/designer/assets/src-DUQ4xE3x.js +58 -0
- package/dist/designer/assets/validate-C3B8QKsM.js +1 -0
- package/dist/designer/index.html +17 -16
- package/dist/export-pdf.d.ts +75 -0
- package/dist/export-pdf.js +216 -15
- package/dist/export.js +10 -2
- package/dist/gantt/SvGridGantt.svelte +2890 -0
- package/dist/gantt/SvGridGantt.svelte.d.ts +30 -0
- package/dist/gantt/gantt-config.d.ts +73 -0
- package/dist/gantt/gantt-config.js +1 -0
- package/dist/gantt/gantt-critical-path.d.ts +67 -0
- package/dist/gantt/gantt-critical-path.js +207 -0
- package/dist/gantt/gantt-model.d.ts +257 -0
- package/dist/gantt/gantt-model.js +651 -0
- package/dist/gantt/gantt-resources.d.ts +59 -0
- package/dist/gantt/gantt-resources.js +71 -0
- package/dist/gantt/gantt.d.ts +7 -0
- package/dist/gantt/gantt.js +36 -0
- package/dist/gantt/index.d.ts +15 -0
- package/dist/gantt/index.js +22 -0
- package/dist/gantt/timeline-arrows.d.ts +102 -0
- package/dist/gantt/timeline-arrows.js +181 -0
- package/dist/import.d.ts +2 -2
- package/dist/import.js +1 -1
- package/dist/index.d.ts +34 -7
- package/dist/index.js +44 -7
- package/dist/install.js +8 -1
- package/dist/license-core.d.ts +17 -1
- package/dist/license-core.js +16 -5
- package/dist/license.d.ts +18 -2
- package/dist/license.js +71 -6
- package/dist/node/studio.js +140 -8
- package/dist/pivot-enable.js +2 -2
- package/dist/scheduler-dependencies.d.ts +35 -0
- package/dist/scheduler-dependencies.js +36 -1
- package/dist/scheduler.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/server/SvGroupCell.svelte +213 -0
- package/dist/server/SvGroupCell.svelte.d.ts +62 -0
- package/dist/server/SvRowGroupPanel.svelte +322 -0
- package/dist/server/SvRowGroupPanel.svelte.d.ts +37 -0
- package/dist/server/enable.d.ts +17 -0
- package/dist/server/enable.js +49 -0
- package/dist/server/index.d.ts +22 -0
- package/dist/server/index.js +24 -0
- package/dist/server/messages.d.ts +45 -0
- package/dist/server/messages.js +35 -0
- package/dist/server/server-group-model.d.ts +104 -0
- package/dist/server/server-group-model.js +272 -0
- package/dist/server/server-pivot.d.ts +46 -0
- package/dist/server/server-pivot.js +57 -0
- package/dist/server/server-row-model.d.ts +547 -0
- package/dist/server/server-row-model.js +1551 -0
- package/dist/server/server-selection.d.ts +99 -0
- package/dist/server/server-selection.js +215 -0
- package/dist/server/svgrid-adapter.d.ts +155 -0
- package/dist/server/svgrid-adapter.js +202 -0
- package/dist/sheet/ast.d.ts +45 -1
- package/dist/sheet/ast.js +14 -0
- package/dist/sheet/auto-filter.d.ts +58 -4
- package/dist/sheet/auto-filter.js +159 -11
- package/dist/sheet/autocomplete.d.ts +9 -0
- package/dist/sheet/autocomplete.js +90 -4
- package/dist/sheet/cell-images.d.ts +39 -0
- package/dist/sheet/cell-images.js +90 -0
- package/dist/sheet/cell-types.d.ts +58 -0
- package/dist/sheet/cell-types.js +96 -0
- package/dist/sheet/coerce.d.ts +40 -0
- package/dist/sheet/coerce.js +170 -3
- package/dist/sheet/comments.d.ts +43 -9
- package/dist/sheet/comments.js +85 -27
- package/dist/sheet/conditional-formats.d.ts +29 -6
- package/dist/sheet/conditional-formats.js +37 -12
- package/dist/sheet/csv.d.ts +32 -0
- package/dist/sheet/csv.js +158 -0
- package/dist/sheet/culture.d.ts +87 -0
- package/dist/sheet/culture.js +247 -0
- package/dist/sheet/delta.d.ts +102 -0
- package/dist/sheet/delta.js +203 -0
- package/dist/sheet/deps.d.ts +45 -1
- package/dist/sheet/deps.js +77 -2
- package/dist/sheet/document.d.ts +106 -4
- package/dist/sheet/document.js +204 -3
- package/dist/sheet/engine.d.ts +67 -0
- package/dist/sheet/engine.js +19 -0
- package/dist/sheet/entry.d.ts +8 -4
- package/dist/sheet/entry.js +171 -21
- package/dist/sheet/error-check.d.ts +49 -0
- package/dist/sheet/error-check.js +83 -0
- package/dist/sheet/evaluate-steps.d.ts +48 -0
- package/dist/sheet/evaluate-steps.js +196 -0
- package/dist/sheet/evaluate.d.ts +67 -0
- package/dist/sheet/evaluate.js +725 -13
- package/dist/sheet/filter-files.d.ts +37 -0
- package/dist/sheet/filter-files.js +465 -0
- package/dist/sheet/format-store.d.ts +15 -0
- package/dist/sheet/format-store.js +11 -1
- package/dist/sheet/from-rows.d.ts +14 -0
- package/dist/sheet/from-rows.js +50 -0
- package/dist/sheet/function-catalog.d.ts +1 -1
- package/dist/sheet/function-catalog.js +296 -5
- package/dist/sheet/functions.js +363 -91
- package/dist/sheet/index.d.ts +35 -8
- package/dist/sheet/index.js +35 -8
- package/dist/sheet/links.d.ts +57 -0
- package/dist/sheet/links.js +174 -0
- package/dist/sheet/messages.d.ts +778 -0
- package/dist/sheet/messages.js +806 -0
- package/dist/sheet/number-format.d.ts +52 -5
- package/dist/sheet/number-format.js +465 -68
- package/dist/sheet/objects.d.ts +106 -0
- package/dist/sheet/objects.js +149 -0
- package/dist/sheet/ods-document.d.ts +44 -0
- package/dist/sheet/ods-document.js +1275 -0
- package/dist/sheet/open-file.d.ts +26 -0
- package/dist/sheet/open-file.js +56 -0
- package/dist/sheet/outline.d.ts +82 -0
- package/dist/sheet/outline.js +228 -0
- package/dist/sheet/packs/array.d.ts +16 -0
- package/dist/sheet/packs/array.js +172 -0
- package/dist/sheet/packs/database.d.ts +42 -0
- package/dist/sheet/packs/database.js +142 -0
- package/dist/sheet/packs/engineering.d.ts +2 -0
- package/dist/sheet/packs/engineering.js +296 -0
- package/dist/sheet/packs/financial.d.ts +5 -0
- package/dist/sheet/packs/financial.js +220 -0
- package/dist/sheet/packs/math-stats.d.ts +2 -0
- package/dist/sheet/packs/math-stats.js +372 -0
- package/dist/sheet/packs/special.d.ts +44 -0
- package/dist/sheet/packs/special.js +187 -0
- package/dist/sheet/packs/stats-dist.d.ts +2 -0
- package/dist/sheet/packs/stats-dist.js +785 -0
- package/dist/sheet/packs/text-date.d.ts +2 -0
- package/dist/sheet/packs/text-date.js +332 -0
- package/dist/sheet/packs/trig.d.ts +2 -0
- package/dist/sheet/packs/trig.js +73 -0
- package/dist/sheet/page-setup.d.ts +73 -0
- package/dist/sheet/page-setup.js +73 -0
- package/dist/sheet/parse.js +42 -10
- package/dist/sheet/paste-special.d.ts +22 -0
- package/dist/sheet/paste-special.js +14 -5
- package/dist/sheet/pivot-range.d.ts +160 -0
- package/dist/sheet/pivot-range.js +333 -0
- package/dist/sheet/presence.d.ts +73 -0
- package/dist/sheet/presence.js +79 -0
- package/dist/sheet/print.d.ts +104 -0
- package/dist/sheet/print.js +169 -0
- package/dist/sheet/protection.d.ts +55 -1
- package/dist/sheet/protection.js +55 -2
- package/dist/sheet/rects.d.ts +1 -1
- package/dist/sheet/refs.d.ts +48 -0
- package/dist/sheet/refs.js +155 -8
- package/dist/sheet/ribbon-icons.d.ts +1 -1
- package/dist/sheet/ribbon-icons.js +186 -0
- package/dist/sheet/ribbon.d.ts +1 -1
- package/dist/sheet/ribbon.js +324 -23
- package/dist/sheet/sheet-kinds.d.ts +74 -0
- package/dist/sheet/sheet-kinds.js +91 -0
- package/dist/sheet/shortcuts.d.ts +13 -3
- package/dist/sheet/shortcuts.js +63 -12
- package/dist/sheet/sort.d.ts +51 -0
- package/dist/sheet/sort.js +107 -0
- package/dist/sheet/sparklines.d.ts +111 -0
- package/dist/sheet/sparklines.js +204 -0
- package/dist/sheet/table-styles.d.ts +74 -0
- package/dist/sheet/table-styles.js +152 -0
- package/dist/sheet/tables.d.ts +19 -0
- package/dist/sheet/tables.js +31 -0
- package/dist/sheet/tokenize.d.ts +18 -1
- package/dist/sheet/tokenize.js +60 -9
- package/dist/sheet/validation.d.ts +16 -0
- package/dist/sheet/validation.js +37 -0
- package/dist/sheet/workbook.d.ts +148 -3
- package/dist/sheet/workbook.js +742 -31
- package/dist/sheet/xls-cfb.d.ts +32 -0
- package/dist/sheet/xls-cfb.js +290 -0
- package/dist/sheet/xls-document.d.ts +10 -0
- package/dist/sheet/xls-document.js +1243 -0
- package/dist/sheet/xls-formula.d.ts +40 -0
- package/dist/sheet/xls-formula.js +569 -0
- package/dist/sheet/xlsx-document.d.ts +108 -0
- package/dist/sheet/xlsx-document.js +1849 -0
- package/dist/sheet/xlsx-drawing.d.ts +99 -0
- package/dist/sheet/xlsx-drawing.js +420 -0
- package/dist/sheet-enable.js +6 -7
- package/dist/sheet-text.d.ts +7 -0
- package/dist/sheet-text.js +29 -0
- package/dist/sources/auth-supabase.js +2 -2
- package/dist/sources/realtime-supabase.js +2 -2
- package/dist/sources/rest.d.ts +6 -2
- package/dist/sources/rest.js +42 -7
- package/dist/sources/supabase.d.ts +10 -1
- package/dist/sources/supabase.js +73 -40
- package/dist/studio/emit-project.js +14 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/project.d.ts +11 -2
- package/dist/studio/project.js +5 -2
- package/dist/studio/ui-components.generated.js +107 -2
- package/dist/sveltekit/in-memory.d.ts +2 -2
- package/dist/sveltekit/in-memory.js +125 -4
- package/dist/sveltekit/index.d.ts +1 -1
- package/dist/sveltekit/index.js +1 -1
- package/dist/sveltekit/query-plan.d.ts +50 -4
- package/dist/sveltekit/query-plan.js +25 -3
- package/dist/sveltekit/sql-source.d.ts +6 -0
- package/dist/sveltekit/sql-source.js +34 -6
- package/dist/sveltekit/sql.d.ts +31 -0
- package/dist/sveltekit/sql.js +135 -25
- package/dist/sveltekit/transport.d.ts +10 -2
- package/dist/sveltekit/transport.js +30 -6
- package/dist/upgrade-prompt.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watermark.js +35 -2
- package/dist/wc/GridMenus-By9vPuq0.js +1088 -0
- package/dist/wc/SvChartMenu-CQNrQGT2.js +308 -0
- package/dist/wc/SvDateRangeInput-DR6m7bSM.js +199 -0
- package/dist/wc/SvDateTimePicker-D-vRnaMo.js +771 -0
- package/dist/wc/SvField-B_kurx_P.js +149 -0
- package/dist/wc/SvGrid.helpers-BdVDtjUm.js +135 -0
- package/dist/wc/SvGridCellEditor-Bnf1Kr5C.js +560 -0
- package/dist/wc/SvGridChart-BqUJh2pG.js +3572 -0
- package/dist/wc/SvGridChartBuilder-CGycC5cn.js +988 -0
- package/dist/wc/SvGridChartPanel-CRnizsHD.js +1746 -0
- package/dist/wc/SvGridChartView-D1pa_xMy.js +47 -0
- package/dist/wc/SvGridDropdown-45WsObLL.js +259 -0
- package/dist/wc/SvModal-DrfOYYyX.js +189 -0
- package/dist/wc/cell-formatting-CBfgahv1.js +86 -0
- package/dist/wc/chart-6OXlybVT.js +4341 -0
- package/dist/wc/chart-export-CeSADGfi.js +135 -0
- package/dist/wc/chart-export-pdf-BGko7MER.js +104 -0
- package/dist/wc/chart-summary-2m3ia1-n.js +137 -0
- package/dist/wc/chart-trend-CQOQtTMl.js +50 -0
- package/dist/wc/chart-validate-CD6ptiwg.js +180 -0
- package/dist/wc/client-DQIzjDBG.js +3064 -0
- package/dist/wc/column-resize-DUPgynvc.js +101 -0
- package/dist/wc/date-format-DS-z_h9v.js +1130 -0
- package/dist/wc/dismissable-CQ6XFXsk.js +45 -0
- package/dist/wc/editor-contract-peBDxir_.js +22 -0
- package/dist/wc/editor-registry-DxGKqcvx.js +24 -0
- package/dist/wc/focus-trap-Dbb2tJxb.js +65 -0
- package/dist/wc/list-option-DrRyivWp.js +82 -0
- package/dist/wc/popover-WsGlvtQv.js +69 -0
- package/dist/wc/positioning-BiKLfu1E.js +112 -0
- package/dist/wc/react.d.ts +41 -0
- package/dist/wc/react.js +90 -0
- package/dist/wc/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/wc/row-drag-touch-CycRR65n.js +93 -0
- package/dist/wc/row-resize-limG_N1z.js +111 -0
- package/dist/wc/sv-sheet-element.d.ts +97 -0
- package/dist/wc/sv-sheet-element.js +44213 -0
- package/dist/wc/svelte-virtualizer.svelte-CXtQy2TQ.js +530 -0
- package/dist/wc/validate-BqDthkNr.js +88 -0
- package/dist/wc/vue.d.ts +31 -0
- package/dist/wc/vue.js +75 -0
- package/package.json +30 -5
- package/dist/designer/assets/GridMenus-BlsvL_aU.js +0 -8
- package/dist/designer/assets/SvGridCellEditor-C7uQXYds.js +0 -4
- package/dist/designer/assets/SvGridChartBuilder-kvyIU_Rl.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +0 -1
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +0 -1
- package/dist/designer/assets/index-CMFgAoVV.css +0 -1
- package/dist/designer/assets/row-resize-DLktcqUK.js +0 -1
- package/dist/designer/assets/src-EdI3Xqds.js +0 -58
- package/dist/designer/assets/validate-h-aslRV9.js +0 -1
|
@@ -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,t){let n=r.min??20,i=r.max??320;e.setAttribute(`aria-valuemin`,String(n)),e.setAttribute(`aria-valuemax`,String(i)),e.setAttribute(`aria-valuenow`,String(Math.round(Math.max(n,Math.min(i,t||n)))))}function s(e){let t=e.querySelector(`[data-svgrid-row]`)?.dataset.svgridRow;return t==null?NaN:Number(t)}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)));i.trEl.style.height=`${Math.round(a)}px`,o(i.strip,a),r.onResizeMove?.(i.rowIndex,Math.round(a))}function l(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`,c),window.removeEventListener(`pointerup`,l),document.body.style.cursor=``}function u(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 c=t.closest(`tr.sv-grid-row`);if(!c)return;let l=s(c);if(!Number.isFinite(l))return;e.preventDefault(),e.stopPropagation();let u=r.min??20,d=r.max??320,f=Math.round(Math.max(u,Math.min(d,c.getBoundingClientRect().height+a)));c.style.height=`${f}px`,o(t,f),r.onResizeMove?.(l,f),r.onResize(l,f)}function d(e){if(r.disabled)return;let t=e.target;if(!t?.classList.contains(n))return;let o=t.closest(`tr.sv-grid-row`);if(!o)return;let u=s(o);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:o.getBoundingClientRect().height,trEl:o,strip:t};try{o.setPointerCapture(e.pointerId)}catch{}document.body.style.cursor=`row-resize`,window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l)}function f(){if(r.disabled){p();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)continue;let i=t.querySelector(`:scope > .${n}`);if(i){o(i,e.getBoundingClientRect().height);continue}getComputedStyle(t).position===`static`&&(t.style.position=`relative`),t.style.overflow=`visible`;let a=document.createElement(`div`);a.className=n,a.setAttribute(`role`,`separator`),a.setAttribute(`aria-orientation`,`horizontal`),a.setAttribute(`aria-label`,`Resize row`),a.tabIndex=0,o(a,e.getBoundingClientRect().height),a.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(a)}}function p(){e.querySelectorAll(`.${n}`).forEach(e=>e.remove())}e.addEventListener(`pointerdown`,d,{capture:!0}),e.addEventListener(`keydown`,u,{capture:!0});let m=new MutationObserver(()=>f());return m.observe(e,{childList:!0,subtree:!0}),f(),{update(e){let t=r.disabled;r=e,t!==r.disabled&&f()},destroy(){e.removeEventListener(`pointerdown`,d,{capture:!0}),e.removeEventListener(`keydown`,u,{capture:!0}),window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),m.disconnect(),p()}}}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Symbol.for(`svgrid.rowPlaceholder`);Object.freeze({[e]:`loading`}),Object.freeze({[e]:`failed`});function t(t){if(typeof t!=`object`||!t)return null;let n=t[e];return n===`loading`||n===`failed`?n:null}function n(t,n){return Object.freeze({...n,[e]:t})}export{t as n,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-DGckmgKr.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 ee(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 te(e,t){if(e.stops&&e.stops.length>=2)return ee(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 S(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 C(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),o.icon&&(a.icon=o.icon)}continue}if(!(e==null||e===``||!Number.isFinite(r))){if(o.type===`colorScale`){let n=S(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=te(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=S(o,r,t,i);if(n==null)continue;e=n*100}else if(o.bounds===`percent`){let n=S(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 w(e){return(e.type===`colorScale`||e.type===`dataBar`)&&!(`compareColumn`in e&&e.compareColumn)}function T(e){return e.some(w)}var E=new Set([]),D=`SVENTERPRISE-`;function ne(e,t){return e===`suite`||t===`grid`}function O(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 k(e,t=new Date){if(e==null||e===``)return{status:`unset`,valid:!1,edition:`suite`};if(!e.startsWith(`SVENTERPRISE-`))return{status:`invalid`,valid:!1,edition:`suite`};if(E.has(e))return{status:`revoked`,valid:!1,edition:`suite`};let n=O(e)??void 0,r=n?t.getTime()>n.getTime():void 0,i=e.startsWith(`SVENTERPRISE-DEV`)?`dev`:e.startsWith(`SVENTERPRISE-EVAL`)?`eval`:`licensed`;return{status:i,valid:!0,edition:i===`licensed`&&e.startsWith(`SVENTERPRISE-GRID-`)?`grid`:`suite`,expiresAt:n,expired:r}}var A=`data-svgrid-enterprise-watermark`,re=`data-svgrid-enterprise-nudged`,ie=`https://svgrid.com`,j=`www.svgrid.com`,M=5e3,N=700,ae=!1,P=null;function F(){oe(),!(typeof document>`u`||typeof window>`u`)&&(queueMicrotask(()=>se()),P||(P=new MutationObserver(()=>se()),P.observe(document.body,{childList:!0,subtree:!0})))}function oe(){ae||(ae=!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 se(){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());let t=new Set;e.forEach(e=>{let n=ce(e);n&&t.add(n)}),t.forEach(le)}function ce(e){let t=e.closest(`.sv-grid-root`);if(t)return t;let n=e;for(;n&&/^(TABLE|THEAD|TBODY|TFOOT|TR|COLGROUP)$/.test(n.tagName);)n=n.parentElement;return n}function le(e){if(e.hasAttribute(re))return;e.setAttribute(re,`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=ie,t.target=`_blank`,t.rel=`noopener noreferrer`,t.textContent=j,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(()=>{if(typeof window>`u`){e.remove();return}e.style.opacity=`0`,window.setTimeout(()=>e.remove(),N)},M)}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 ${N}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 I(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 L(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`,()=>L(n)),n.querySelector(`[data-act="trial"]`)?.addEventListener(`click`,()=>L(n)),n.querySelector(`[data-act="pricing"]`)?.addEventListener(`click`,()=>L(n)),n}function ye(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var R=null,be=!1,xe=!1,Se=new Set;function z(e){if(xe)return;xe=!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 Ce(){return R!=null}function we(e){let t=k(R);if(t.valid&&!t.expired)return;let n=t.valid&&t.expired===!0;F(),n&&z(t),I(e,{expired:n})}var Te={grid:`the enterprise grid`,spreadsheet:`the spreadsheet`,studio:`the Studio`};function Ee(e){Se.has(e)||(Se.add(e),console.info(`@svgrid/enterprise: your Grid license does not cover ${Te[e]}. Everything still works, but the watermark and upgrade notice stay until the license is upgraded to Suite. Contact sales@jqwidgets.com or see https://svgrid.com/pricing`))}function De(e,t){let n=k(R),r=n.valid&&ne(n.edition,e);if(r&&!n.expired)return;let i=n.valid&&n.expired!==!0&&!r;F(),i?Ee(e):n.valid&&n.expired===!0&&z(n),I(t,{expired:n.valid&&n.expired===!0})}function Oe(e){let t=k(R);switch(t.status){case`unset`:F(),I(e);return;case`invalid`:throw Error(`@svgrid/enterprise: invalid license key format (expected "${D}..." 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){F(),z(t),I(e,{expired:!0});return}be||=(console.info(`@svgrid/enterprise: using a development / evaluation license. Not for production use.`),!0);return;case`licensed`:return}}var ke=!1;function Ae(){if(ke)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,ke=!0}var je=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function B(e){return e.replace(je,``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function Me(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 Ne(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="${B(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:Me(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="${B(e.href)}"`:``}><Data ss:Type="${e.type}">${B(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">${B(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="${B(e.slice(0,31)||`Sheet1`)}"><Table>${v}${x.join(``)}</Table>`+b+`</Worksheet></Workbook>`}var Pe={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Fe=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;function V(e){return e.replace(Fe,``).replace(/[&<>"']/g,e=>Pe[e])}function H(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 U(e){if(!e)return null;let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());return t?`FF`+t[1].toUpperCase():null}function Ie(e){let t=Date.UTC(1899,11,30);return(e.getTime()-t)/864e5}var Le=`<?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>`,Re=`<?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 ze(e){return e.replace(/[\\/?*[\]:]/g,` `).trim().slice(0,31)||`Sheet1`}function Be(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="${V(ze(e))}" sheetId="1" r:id="rId1"/></sheets></workbook>`}var Ve=`<?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 He(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=U(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=U(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="${V(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 Ue(e){let{header:t,rows:n}=e,r=He(t,n),i=[],a=[`<row r="1">${t.map((e,t)=>`<c r="${H(t)}1" s="1" t="inlineStr"><is><t xml:space="preserve">${V(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=`${H(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>${Ie(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">${V(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=`${H(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=H(e.colIdx),i=`${r}2:${r}${n.length+1}`;if(e.kind===`dataBar`){let n=U(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=>U(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=H(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=`${H(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}[${V(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="${V(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="${V(o.name)}" displayName="${V(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="${V(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?Le.replace(`</Types>`,`<Override PartName="/xl/tables/table1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/></Types>`):Le,"_rels/.rels":Re,"xl/workbook.xml":Be(e.sheetName),"xl/_rels/workbook.xml.rels":Ve,"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="${V(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 We(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 Ge(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 Ke(e,t){let n=Ge(t);return n?(typeof e.addVirtualFileSystem==`function`&&e.addVirtualFileSystem(n),e.vfs=n,!0):!1}function qe(e){if(!e)return null;let t=e.trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1];return`#`+(e.length===3?e.split(``).map(e=>e+e).join(``):e).toLowerCase()}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(t);if(!r||!((r[4]===void 0?1:r[4].endsWith(`%`)?Number(r[4].slice(0,-1))/100:Number(r[4]))>.05))return null;let i=e=>Math.max(0,Math.min(255,Math.round(Number(e)))).toString(16).padStart(2,`0`);return`#`+i(r[1])+i(r[2])+i(r[3])}function Je(e){let t=parseInt(e.slice(1),16),n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*n(t>>16&255)+.7152*n(t>>8&255)+.0722*n(t&255)}function Ye(e){if(!e||typeof getComputedStyle!=`function`)return{};let t=t=>e.querySelector(t),n=(e,t)=>e?qe(getComputedStyle(e).getPropertyValue(t)):null,r=e=>{for(let t=e;t;t=t.parentElement){let e=n(t,`background-color`);if(e)return e}return null},i=`:not([class*="row-number"]):not([class*="selection"])`,a=t(`.sv-grid-head .sv-grid-column${i}`)??t(`.sv-grid-header-cell`)??t(`thead th`),o=t(`.sv-grid-body .sv-grid-row:not(.sv-grid-row-alt):not(.sv-grid-header-row) .sv-grid-cell${i}`)??t(`tbody td`),s=t(`.sv-grid-body .sv-grid-row-alt .sv-grid-cell${i}`),c=t(`.sv-grid-group-row .sv-grid-cell`),l={},u=r(a),d=n(a,`color`);u&&(l.headerColor=u),d&&(l.headerTextColor=d);let f=r(o?o.parentElement:t(`.sv-grid-container`)??e),p=n(o,`color`);if(f&&Je(f)<.4||p&&Je(p)>.5)return l;p&&(l.textColor=p);let m=n(o,`border-bottom-color`)??n(a,`border-bottom-color`);m&&(l.borderColor=m);let h=n(s,`background-color`);h&&h!==f&&(l.zebraColor=h);let g=n(c,`background-color`),_=n(c,`color`);return g&&g!==f&&(l.groupColor=g),_&&(l.groupTextColor=_),l}var Xe={A4:[595.28,841.89],A3:[841.89,1190.55],A5:[419.53,595.28],LETTER:[612,792],LEGAL:[612,1008]};async function Ze(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 Qe(e){let{columns:t}=e,n=e.opts??{},r=e.styles??{},i=e.theme??{},a=e.now??new Date(0),o=n.fontSize??8,s=n.headerColor??r.headerRow?.backgroundColor??i.headerColor??`#334155`,c=n.headerTextColor??r.headerRow?.color??i.headerTextColor??`#ffffff`,l=n.zebra??!0,u=n.zebraColor??r.rowAlternate?.backgroundColor??i.zebraColor??`#f1f5f9`,d=n.groupColor??i.groupColor??`#e2e8f0`,f=n.groupTextColor??i.groupTextColor??`#0f172a`,p=n.subtotalColor??i.subtotalColor??`#f8fafc`,m=n.textColor??r.rows?.color??i.textColor,h=n.borderColor??i.borderColor??`#e2e8f0`,g=n.repeatHeader??!0,_=e=>e===`bold`||typeof e==`number`&&e>=600,v=e=>{if(e===void 0)return;let t=typeof e==`number`?e:parseFloat(e);return Number.isFinite(t)&&t>0?t:void 0},y=(e,t)=>{if(!t)return;t.backgroundColor&&(e.fillColor=t.backgroundColor),t.color&&(e.color=t.color),_(t.fontWeight)?e.bold=!0:t.fontWeight===`normal`&&(e.bold=!1),t.fontStyle===`italic`&&(e.italics=!0);let n=v(t.fontSize);n&&(e.fontSize=n),t.textAlign&&(e.alignment=t.textAlign)},b=new Map;for(let[e,t]of Object.entries(r.cells??{})){let n=/^([A-Z]+)(\d+)$/i.exec(e.trim());if(!n)continue;let r=0;for(let e of n[1].toUpperCase())r=r*26+(e.charCodeAt(0)-64);b.set(`${Number(n[2])-1}:${r-1}`,t)}let x=n.pageOrientation??(t.length>(n.autoLandscapeThreshold??8)?`landscape`:`portrait`),ee=Array.isArray(n.columnWidths)?n.columnWidths:t.map(()=>n.columnWidths===`auto`?`auto`:`*`),te=t.map((e,t)=>{let n={text:e.header,bold:!0,alignment:e.align??`left`,color:c,fillColor:s};return y(n,r.headerRow?{...r.headerRow,backgroundColor:void 0,color:void 0}:void 0),y(n,b.get(`0:${t}`)),n}),S=e.body??(e.rows??[]).map(e=>({kind:`data`,cells:e})),C=e.dataCellStyle,w=e.dataCellLink,T=0,E=new Set,D=[te];if(S.forEach((e,n)=>{let i=n+1;if(e.kind===`group`){let n={text:e.label,bold:!0,color:f,fillColor:d,colSpan:t.length,margin:[(e.level??0)*12,2,0,2]},r=Array.from({length:Math.max(0,t.length-1)},()=>({text:``}));D.push([n,...r])}else if(e.kind===`subtotal`)D.push(t.map((t,n)=>({text:e.cells[n]??``,bold:!0,alignment:t.align??`left`,fillColor:p})));else{E.add(i);let n=T++;D.push(t.map((t,i)=>{let a={text:e.cells[i]??``,alignment:t.align??`left`};m&&(a.color=m),y(a,r.rows?{...r.rows,backgroundColor:void 0}:void 0),l&&n%2==1&&r.rowAlternate?.color&&(a.color=r.rowAlternate.color),y(a,b.get(`${n+1}:${i}`));let o=C?.(n,i);o&&(o.fill&&(a.fillColor=o.fill),o.color&&(a.color=o.color),o.bold&&(a.bold=!0));let s=w?.(n,i);return s&&(a.link=s,a.decoration=`underline`,o?.color||(a.color=`#2563eb`)),a}))}}),e.merges?.length&&!e.body){let n=[...E].sort((e,t)=>e-t);for(let r of e.merges){let e=Math.max(1,Math.floor(r.rowSpan??1)),i=Math.max(1,Math.floor(r.colSpan??1));if(e===1&&i===1)continue;let a=n[r.row];if(a===void 0||r.col<0||r.col>=t.length)continue;let o=D[a]?.[r.col];if(o){e>1&&(o.rowSpan=Math.min(e,D.length-a)),i>1&&(o.colSpan=Math.min(i,t.length-r.col));for(let e=0;e<(o.rowSpan??1);e+=1)for(let t=0;t<(o.colSpan??1);t+=1){if(e===0&&t===0)continue;let n=D[a+e]?.[r.col+t];n&&(n.text=``)}}}}let ne={table:{headerRows:+!!g,dontBreakRows:!0,widths:ee,body:D},layout:{fillColor:e=>l&&e>0&&e%2==0&&E.has(e)?u:null,hLineWidth:()=>.5,vLineWidth:()=>.5,hLineColor:()=>h,vLineColor:()=>h,paddingTop:()=>3,paddingBottom:()=>3,paddingLeft:()=>5,paddingRight:()=>5}},O=(e,t)=>(e??[]).map(e=>{if(`image`in e)return{image:e.image,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},margin:t};if(`text`in e){let n={text:e.text};return y(n,e.style),{...n,margin:t}}return{columns:[{text:e.left??``,alignment:`left`},{text:e.center??``,alignment:`center`},{text:e.right??``,alignment:`right`}],margin:t}}),k=[];if(k.push(...O(e.headerLines,[0,0,0,4])),n.logo&&k.push({image:n.logo,width:n.logoWidth??90,margin:[0,0,0,8]}),n.title&&k.push({text:n.title,fontSize:o+8,bold:!0,margin:[0,0,0,2]}),n.subtitle&&k.push({text:n.subtitle,fontSize:o+1,color:`#64748b`,margin:[0,0,0,8]}),n.kpis?.length){let e=n.kpiColor??`#f8fafc`;k.push({table:{widths:n.kpis.map(()=>`*`),body:[n.kpis.map(t=>({fillColor:e,margin:[8,6,8,6],stack:[{text:t.label,fontSize:o,color:`#64748b`},{text:t.value,fontSize:o+10,bold:!0,margin:[0,2,0,0]},...t.delta?[{text:t.delta,fontSize:o,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 A=n.margins??[28,34,28,34],[re,ie]=Xe[n.pageSize??`A4`],j=(x===`landscape`?ie:re)-A[0]-A[2],M=(e.charts??(n.charts??[]).filter(e=>`image`in e)).map(e=>({stack:[...e.title?[{text:e.title,fontSize:o+3,bold:!0,margin:[0,0,0,4]}]:[],{image:e.image,width:Math.min(e.width??j,j)},...e.caption?[{text:e.caption,fontSize:o,color:`#64748b`,margin:[0,3,0,0]}]:[]],margin:[0,0,0,12],unbreakable:!0}));n.chartsPosition!==`below`&&k.push(...M),k.push(ne),n.chartsPosition===`below`&&(M.length&&k.push({text:``,margin:[0,0,0,12]}),k.push(...M)),k.push(...O(e.footerLines,[0,4,0,0]));let N={pageSize:n.pageSize??`A4`,pageOrientation:x,pageMargins:n.margins??[28,34,28,34],defaultStyle:{fontSize:o},content:k};if(n.showPageNumbers??!0){let e=a.toISOString().slice(0,10);N.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 N}function $e(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 et(e){let t={};return e.background&&(t.fill=e.background),!t.fill&&e.dataBar&&(t.fill=$e(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 W(e,t,n){if(!n||n.length===0)return()=>void 0;let r=new Map;if(T(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 et(C(c,s,o.field,n,r.get(o.field)??null))}}var tt=[`csv`,`tsv`,`html`,`json`,`xml`,`md`],nt=null;async function rt(){if(typeof window>`u`)throw Error(`@svgrid/enterprise: export requires a browser environment`);return nt||=(async()=>{Ae(),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})(),nt}async function G(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(!Ke(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 K(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 q(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 J(e,t,n){if(e.exportValue)return e.exportValue(t)??``;let r=t[e.field];return n?r:a(r,e.format)}async function Y(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]=J(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 it(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 at=0,ot=new Map;function st(e){let t=ot.get(e);if(t)return t;let n=`img${++at}`;return ot.set(e,n),n}function ct(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:st(e),base64:e,imageType:i,width:t,height:n}}function lt(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 ut(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:ct(i,96,96),value:``}:{image:ct(i,t.width,t.height),value:``}}function dt(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=it(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 ft(e,t,n){let r=lt(t.header,n),i=lt(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=ut(t.imageFields,n)}return e}function X(e,t){return e.toLowerCase().endsWith(`.`+t)?e:`${e}.${t}`}function pt(e,t,n,r,i){return i!==!1&&u(e,t),{blob:e,filename:t,mime:n,rowCount:r,byteSize:e.size}}function mt(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 ht(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=J(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 gt(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 _t(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 vt(e){let t={};for(let n of e)n.align&&(t[n.field]=n.align);return t}async function yt(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:vt(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:vt(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 bt(e,t){if(t.sheets&&t.sheets.length>0)throw Error(`@svgrid/enterprise: multi-sheet export requires format 'xlsx', got '${t.format}'`);let n=K(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=q(e,t,n),i=await Y(n,r,t.format===`json`?{...t,rawValues:t.rawValues??!0}:t),a=(t.filename??`grid`).trim()||`grid`,o=t.format===`html`?W(r,n,t.conditionalFormats):void 0,s=t.format===`html`?Z(r,n):void 0,{text:c,mime:l,ext:u}=await yt(t.format,i,r,t,o,s);return mt(c,X(a,u),l,n.length,t.download)}async function xt(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=K(e,t.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let r=q(e,t,n),i=(t.filename??`grid`).trim()||`grid`,a=W(r,n,t.conditionalFormats);return mt(await Ne(i,r,n,{rawValues:t.rawValues,onProgress:t.onProgress,signal:t.signal,freezeHeader:t.freezeHeader!==!1,freezeColumns:gt(e,t,r),widths:t.autoFitColumns===!1?void 0:ht(r,n,t.rawValues===!0),cellVisual:t.conditionalFormats?.length?a:void 0,precisionSafe:t.precisionSafe}),X(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 St(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(J(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 Ct(e,t){await G(`pdf`);let n=globalThis.pdfMake;if(!n)throw Error(`@svgrid/enterprise: pdf export requires the "pdfmake" peer dependency.`);let r=K(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=q(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=l.matchTheme===!1?{}:Ye(e.getElement?.()??null),d={headerLines:t.header,footerLines:t.footer},p=await Ze(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})}),m=new Date,h;if(c?.length)h=Qe({columns:o,body:St(i,r,c),opts:l,styles:t.styles,theme:u,...d,charts:p,now:m});else{let e=(await Y(r,i,t)).slice(1).map(e=>a.map(t=>String(e[t]??``))),n=W(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]??``}`)}h=Qe({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,styles:t.styles,theme:u,...d,merges:t.merges,charts:p,now:m})}let g=(t.filename??`grid`).trim()||`grid`,_=await new Promise(e=>n.createPdf(h).getBlob(e));return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),pt(_,X(g,`pdf`),`application/pdf`,r.length,t.download)}async function wt(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 Tt(e,t){await G(`xlsx`);let n=globalThis.JSZip;if(!n)throw Error(`@svgrid/enterprise: xlsx export requires the "jszip" peer dependency.`);let r=K(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=q(e,t,r),a=t.rawValues===!0,o=t.conditionalFormats??[],s=W(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 wt(i,r,a,s,c,{onProgress:t.onProgress,signal:t.signal,precisionSafe:t.precisionSafe}),f=t.autoFitColumns===!1?void 0:ht(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 We(Ue({sheetName:p,header:u,rows:d,widths:f,freezeHeader:t.freezeHeader!==!1,freezeColumns:gt(e,t,i),condFormats:l,table:m}),n);return t.onProgress?.({phase:`write`,ratio:1,total:r.length}),pt(h,X(p,`xlsx`),`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,r.length,t.download)}async function Et(e,t){if(Oe(`Export`),tt.includes(t.format))return bt(e,t);if(t.format===`xls`)return xt(e,t);if(t.format===`pdf`)return Ct(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 Tt(e,t)}await G(t.format);let n=await rt();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=q(e,{columns:n.columns??t.columns},n.rows),a=n.rows.map(e=>{let t={};for(let n of i)t[n.field]=J(n,e,r);return t}),o=t.autoFitColumns===!1?null:ht(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:it(n.styles??t.styles)}}),a=(t.filename??`grid`).trim()||`grid`,o=dt(t),s=i[0],c=new n(o);c.spreadsheets=i,ft(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=K(e,t.rows);if(r.length===0)throw Error(`@svgrid/enterprise: nothing to export - the grid has no rows`);let i=q(e,t,r),a=await Y(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=dt(t);if(t.conditionalFormats?.length){let e=W(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[_t(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);ft(f,t,s),f.exportData(a,t.format,o),t.onProgress?.({phase:`write`,ratio:1,total:a.length-1})}var Dt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function $(e){return(e==null?``:String(e)).replace(/[&<>"']/g,e=>Dt[e])}function Ot(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 kt(e,t){if(Oe(`Print`),typeof window>`u`)throw Error(`@svgrid/enterprise: print requires a browser environment`);let n=K(e,t?.rows);if(n.length===0)throw Error(`@svgrid/enterprise: nothing to print - the grid has no rows`);let r=q(e,{columns:t?.columns},n),i=r.map(e=>e.field),a=(await Y(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=W(r,n,t?.conditionalFormats),l=Ot({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 At=t({ALL_VALUES:()=>ALL_VALUES,DATA_BAR_COLOR:()=>DATA_BAR_COLOR,DATA_BAR_NEGATIVE_COLOR:()=>DATA_BAR_NEGATIVE_COLOR,DEFAULT_ALERT_MESSAGE:()=>DEFAULT_ALERT_MESSAGE,DEFAULT_TABLE_STYLE:()=>DEFAULT_TABLE_STYLE,GRAND_TOTAL_ROW_ID:()=>GRAND_TOTAL_ROW_ID,GROUP_TOTAL_ROW_ID_PREFIX:()=>GROUP_TOTAL_ROW_ID_PREFIX,NO_TABLE_STYLE:()=>NO_TABLE_STYLE,PROTECTED_MESSAGE:()=>PROTECTED_MESSAGE,countReducer:()=>countReducer,exportGrid:()=>Et,printGrid:()=>kt});export{F as a,T as c,De as i,C as l,Ce as n,m as o,we as r,w as s,At as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./server-block-cache-CXJKkJpy.js";var t=10,n=`https://svgrid.com/docs/getting-started/3-data-and-columns/`;function r(e,t=[]){for(let n of e)n.columns?.length?r(n.columns,t):t.push(n);return t}function i(i){let o=[],s=r(i.columns??[]),c=[];for(let n of i.data??[]){if(c.length>=t)break;e(n)||c.push(n)}if(c.length&&!i.serverGroup){let e=new Set;for(let t of c)if(t&&typeof t==`object`)for(let n of Object.keys(t))e.add(n);for(let t of s){let r=t.field;if(!r||t.fieldFn||e.has(r))continue;let i=a(r,[...e]);o.push(`[svgrid] Column field "${r}" does not exist on your row data, so that column renders empty.${i?` Did you mean "${i}"?`:``} Available keys: ${[...e].slice(0,12).join(`, `)}. See ${n}`)}}let l=new Map;for(let e of s){let t=e.id??e.field;t&&l.set(t,(l.get(t)??0)+1)}for(let[e,t]of l)t>1&&o.push(`[svgrid] ${t} columns share the id "${e}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${n}`);let u=i.pageable===void 0&&i.showPagination===void 0;i.pageSize!==void 0&&u&&o.push("[svgrid] `pageSize` is set but pagination was never turned on, so it has no effect and every row renders. Add `pageable` to switch the pager on."),!(i.sortable===!0||i.features?.rowSortingFeature)&&s.some(e=>e.sortable===!0)&&o.push("[svgrid] A column sets `sortable: true`, but sorting is not enabled on the grid, so its header does nothing. Add `sortable` to <SvGrid> (it registers the sorting feature for you).");let d=new Set;for(let e of s){let t=e.id??e.field;t&&d.add(t)}for(let e of i.groupBy??[]){if(d.has(e))continue;let t=a(e,[...d]);o.push(`[svgrid] \`groupBy\` refers to column "${e}", which does not exist, so that grouping level is ignored.${t?` Did you mean "${t}"?`:``} Column ids: ${[...d].slice(0,12).join(`, `)}`)}let f=i.treeData?.column;if(f&&!d.has(f)&&o.push(`[svgrid] \`treeData.column\` refers to column "${f}", which does not exist, so the expander falls back to the first visible column.`),c.length&&i.treeData){let e=new Set;for(let t of c)if(t&&typeof t==`object`)for(let n of Object.keys(t))e.add(n);let t=i.treeData.parentField;if(t&&!e.has(t)){let n=a(t,[...e]);o.push(`[svgrid] \`treeData.parentField\` is "${t}", which is not on your row data, so every row becomes a root and no hierarchy appears.${n?` Did you mean "${n}"?`:``}`)}let n=i.treeData.idField;n&&!e.has(n)&&o.push(`[svgrid] \`treeData.idField\` is "${n}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`)}return i.gantt&&i.treeData&&o.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."),(i.initialColumnPinning?.left?.length??0)+(i.initialColumnPinning?.right?.length??0)>0&&i.columnVirtualization!==!1&&o.push("[svgrid] `initialColumnPinning` is set while column virtualization is on (its default), so the pinned columns will not stick - the virtualizer recycles column nodes. Add `columnVirtualization={false}`."),i.externalPagination===!0&&i.rowCount===void 0&&o.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."),i.externalSort===!0&&!i.onSortingChange&&o.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."),i.externalFilter===!0&&!i.onFiltersChange&&o.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."),o}function a(e,t){let n,r=1/0;for(let i of t){let t=o(e.toLowerCase(),i.toLowerCase());t<r&&(r=t,n=i)}let i=Math.min(3,Math.floor(e.length/3)+1);return r<=i?n:void 0}function o(e,t){if(e===t)return 0;let n=Array(t.length+1);for(let e=0;e<=t.length;e++)n[e]=e;for(let r=1;r<=e.length;r++){let i=n[0];n[0]=r;for(let a=1;a<=t.length;a++){let o=Math.min(n[a]+1,n[a-1]+1,i+(e[r-1]===t[a-1]?0:1));i=n[a],n[a]=o}}return n[t.length]}export{i as validateGridConfig};
|
package/dist/designer/index.html
CHANGED
|
@@ -4,33 +4,34 @@
|
|
|
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-D5bVbuzI.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/cell-formatting-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/export-format-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-formatting-BbubJTVz.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/export-format-DGckmgKr.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-HclGiUj8.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/src-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/src-DUQ4xE3x.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/editor-contract-Bpoa7A5g.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="./assets/date-format-B8JbEtIG.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/list-option-BP_dWS66.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/SvListBox-BDS66lmZ.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/SvGrid.helpers-BgT-gnCo.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="./assets/editor-registry-BjP16H0v.js">
|
|
19
20
|
<link rel="modulepreload" crossorigin href="./assets/popover-CUkLsvRX.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="./assets/SvGridDropdown-
|
|
21
|
-
<link rel="modulepreload" crossorigin href="./assets/dismissable-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="./assets/SvDateTimePicker-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridDropdown-Cjz0H-fI.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="./assets/dismissable-ChWRPkoa.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="./assets/SvDateTimePicker-DCPg7WGN.js">
|
|
23
24
|
<link rel="modulepreload" crossorigin href="./assets/SvDateRangeInput-BBRzrQeg.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-trap-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="./assets/SvTabs-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="./assets/editor-registry-BjP16H0v.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-trap-V2-6Fy9I.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="./assets/SvTabs-2mHC6oaz.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="./assets/SvMenuList-Dgq2D5VN.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="./assets/chart-trend-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="./assets/chart-
|
|
28
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-trend-B8xr5LuD.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-Cn7MnNqA.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="./assets/chart-export-B6bkQ3X8.js">
|
|
31
|
-
<link rel="modulepreload" crossorigin href="./assets/SvGridChart-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="./assets/chart-panel-messages-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="./assets/SvGridChartPanel-
|
|
31
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridChart-Cy1ATrWh.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="./assets/chart-panel-messages-Dz7PTIqT.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="./assets/SvGridChartPanel-CATdVc9X.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="./assets/server-block-cache-CXJKkJpy.js">
|
|
34
35
|
<link rel="stylesheet" crossorigin href="./assets/date-format-DKS-z0xS.css">
|
|
35
36
|
<link rel="stylesheet" crossorigin href="./assets/SvListBox-BXfyqy4a.css">
|
|
36
37
|
<link rel="stylesheet" crossorigin href="./assets/SvGridDropdown-CcidB3rm.css">
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
<link rel="stylesheet" crossorigin href="./assets/SvMenuList-DJ47ba1h.css">
|
|
41
42
|
<link rel="stylesheet" crossorigin href="./assets/SvGridChart-BgLuPO7I.css">
|
|
42
43
|
<link rel="stylesheet" crossorigin href="./assets/SvGridChartPanel-4Pc8y5yO.css">
|
|
43
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
44
|
+
<link rel="stylesheet" crossorigin href="./assets/index-_JVFxt02.css">
|
|
44
45
|
</head>
|
|
45
46
|
<body>
|
|
46
47
|
<div id="app"></div>
|
package/dist/export-pdf.d.ts
CHANGED
|
@@ -102,7 +102,72 @@ export type PdfExportOptions = {
|
|
|
102
102
|
kpis?: ReadonlyArray<PdfKpi>;
|
|
103
103
|
/** KPI box fill. Default '#f8fafc'. */
|
|
104
104
|
kpiColor?: string;
|
|
105
|
+
/** Body text colour. Default black. */
|
|
106
|
+
textColor?: string;
|
|
107
|
+
/** Table line colour. Default '#e2e8f0'. */
|
|
108
|
+
borderColor?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Take the colours from the grid on screen - header fill and text, body
|
|
111
|
+
* text, zebra fill, lines - so the PDF looks like the grid it came from
|
|
112
|
+
* rather than the default slate table. Default true. Explicit colour
|
|
113
|
+
* options and `styles` win over the theme. A dark theme lends only its
|
|
114
|
+
* header: the page stays white, so its body text and stripes would not
|
|
115
|
+
* read.
|
|
116
|
+
*/
|
|
117
|
+
matchTheme?: boolean;
|
|
118
|
+
};
|
|
119
|
+
/** One cell's look, the same keys `ExportCellStyle` has. */
|
|
120
|
+
export type PdfCellStyle = {
|
|
121
|
+
color?: string;
|
|
122
|
+
backgroundColor?: string;
|
|
123
|
+
fontWeight?: 'normal' | 'bold' | number;
|
|
124
|
+
fontStyle?: 'normal' | 'italic';
|
|
125
|
+
fontSize?: number | string;
|
|
126
|
+
textAlign?: 'left' | 'right' | 'center';
|
|
105
127
|
};
|
|
128
|
+
/** Blanket styles for the PDF table: what `ExportOptions.styles` carries. */
|
|
129
|
+
export type PdfStyles = {
|
|
130
|
+
headerRow?: PdfCellStyle;
|
|
131
|
+
rows?: PdfCellStyle;
|
|
132
|
+
rowAlternate?: PdfCellStyle;
|
|
133
|
+
/** Per-cell overrides by Excel-style reference: `A1` is the first header cell, `A2` the first data cell. */
|
|
134
|
+
cells?: Record<string, PdfCellStyle>;
|
|
135
|
+
};
|
|
136
|
+
/** A line above or below the table: what `ExportOptions.header` / `footer` carry. */
|
|
137
|
+
export type PdfPageLine = {
|
|
138
|
+
text: string;
|
|
139
|
+
style?: PdfCellStyle;
|
|
140
|
+
} | {
|
|
141
|
+
image: string;
|
|
142
|
+
width?: number;
|
|
143
|
+
height?: number;
|
|
144
|
+
} | {
|
|
145
|
+
left?: string;
|
|
146
|
+
center?: string;
|
|
147
|
+
right?: string;
|
|
148
|
+
};
|
|
149
|
+
/** A merged block of data cells, zero-based within the data rows. */
|
|
150
|
+
export type PdfMerge = {
|
|
151
|
+
row: number;
|
|
152
|
+
col: number;
|
|
153
|
+
rowSpan?: number;
|
|
154
|
+
colSpan?: number;
|
|
155
|
+
};
|
|
156
|
+
/** The colours the grid on screen is drawn with, as `readGridPdfTheme` reports them. */
|
|
157
|
+
export type PdfTheme = Partial<Pick<PdfExportOptions, 'headerColor' | 'headerTextColor' | 'textColor' | 'zebraColor' | 'borderColor' | 'groupColor' | 'groupTextColor' | 'subtotalColor'>>;
|
|
158
|
+
/** `rgb(...)` / `rgba(...)` / `#hex` -> `#rrggbb`, or null for transparent and anything else. */
|
|
159
|
+
export declare function cssColorToHex(value: string | null | undefined): string | null;
|
|
160
|
+
/** Relative luminance of a `#rrggbb`, 0 (black) to 1 (white). */
|
|
161
|
+
export declare function hexLuminance(hex: string): number;
|
|
162
|
+
/**
|
|
163
|
+
* Read the colours a mounted grid is drawn with, from computed styles: the
|
|
164
|
+
* header cell's fill and text, a body cell's text and line colour, the
|
|
165
|
+
* stripe of an alternate row, a group row's fill and text. Colours that are
|
|
166
|
+
* transparent or unreadable are left out, and under a dark theme (a dark
|
|
167
|
+
* body background) only the header colours are reported, since the page
|
|
168
|
+
* the PDF prints on is white.
|
|
169
|
+
*/
|
|
170
|
+
export declare function readGridPdfTheme(root: HTMLElement | null | undefined): PdfTheme;
|
|
106
171
|
/** A chart for the PDF: an element to rasterise, or a finished image. */
|
|
107
172
|
export type PdfChart = {
|
|
108
173
|
element: SVGSVGElement | HTMLElement;
|
|
@@ -192,5 +257,15 @@ export declare function buildPdfDocDefinition(params: {
|
|
|
192
257
|
* precedence over the `element` entries of `opts.charts`, which cannot be
|
|
193
258
|
* drawn here. */
|
|
194
259
|
charts?: ReadonlyArray<PdfChartImage>;
|
|
260
|
+
/** Blanket header / row / zebra / per-cell styles (`ExportOptions.styles`). */
|
|
261
|
+
styles?: PdfStyles;
|
|
262
|
+
/** The grid's own colours (see `readGridPdfTheme`); `opts` and `styles` win over them. */
|
|
263
|
+
theme?: PdfTheme;
|
|
264
|
+
/** Lines printed above the table (`ExportOptions.header`). */
|
|
265
|
+
headerLines?: ReadonlyArray<PdfPageLine>;
|
|
266
|
+
/** Lines printed below the table (`ExportOptions.footer`). */
|
|
267
|
+
footerLines?: ReadonlyArray<PdfPageLine>;
|
|
268
|
+
/** Merged data cells; ignored with a structured `body`, whose rows own the layout. */
|
|
269
|
+
merges?: ReadonlyArray<PdfMerge>;
|
|
195
270
|
now?: Date;
|
|
196
271
|
}): PdfDocDefinition;
|