@svgrid/enterprise 2.2.1 → 2.3.1

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.
Files changed (126) hide show
  1. package/README.md +95 -81
  2. package/dist/cdn/svgrid-enterprise.svelte-external.js +26642 -11252
  3. package/dist/designer/assets/GridMenus-BtWVk9Ab.js +7 -0
  4. package/dist/designer/assets/SvGridChartPanel-DWlBO2SD.js +10 -0
  5. package/dist/designer/assets/SvGridChartView-8c8Mb4j8.js +1 -0
  6. package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +1 -0
  7. package/dist/designer/assets/index-DsDgp9Xq.js +78758 -0
  8. package/dist/designer/assets/index-tTY_Dx4P.css +1 -0
  9. package/dist/designer/assets/jszip.min-fkJdmAmj.js +2 -0
  10. package/dist/designer/assets/pdfmake-DeCsnyl9.js +242 -0
  11. package/dist/designer/assets/smart.export-BZlSCE8T.js +35 -0
  12. package/dist/designer/assets/vfs_fonts-eX2NpmfX.js +1 -0
  13. package/dist/designer/index.html +13 -0
  14. package/dist/node/studio.js +15304 -2708
  15. package/package.json +35 -11
  16. package/src/SvAlertRuleEditor.svelte +294 -0
  17. package/src/SvAlertsManager.svelte +210 -0
  18. package/src/SvAlertsPanel.svelte +129 -0
  19. package/src/SvBoard.svelte +3 -1
  20. package/src/SvExpressionEditor.svelte +341 -0
  21. package/src/SvGridAlerts.dom.test.ts +113 -0
  22. package/src/SvGridAlerts.svelte +265 -0
  23. package/src/SvGridBoard.svelte +2358 -0
  24. package/src/SvGridEditPanel.svelte +849 -794
  25. package/src/SvGridScheduler.svelte +5358 -4410
  26. package/src/SvPivotDesigner.svelte +3 -3
  27. package/src/SvRecordDetail.svelte +6 -2
  28. package/src/SvSchedule.svelte +3 -1
  29. package/src/{ai-export-pdf.test.ts → ai-export-pdf.dom.test.ts} +77 -74
  30. package/src/{ai-export-xlsx.test.ts → ai-export-xlsx.dom.test.ts} +90 -87
  31. package/src/{ai-export.test.ts → ai-export.dom.test.ts} +114 -110
  32. package/src/alerts/alert-engine-attach.ts +165 -0
  33. package/src/alerts/alert-engine.test.ts +135 -0
  34. package/src/alerts/alert-engine.ts +260 -0
  35. package/src/alerts/alert-formats.test.ts +87 -0
  36. package/src/alerts/alert-formats.ts +77 -0
  37. package/src/alerts/alert-observer.test.ts +189 -0
  38. package/src/alerts/alert-observer.ts +208 -0
  39. package/src/alerts/alert-scheduler.ts +96 -0
  40. package/src/alerts/alert-storage.test.ts +54 -0
  41. package/src/alerts/alert-storage.ts +116 -0
  42. package/src/alerts/alert-store.svelte.ts +80 -0
  43. package/src/alerts/alert-types.ts +94 -0
  44. package/src/alerts.ts +28 -0
  45. package/src/board.dom.test.ts +941 -0
  46. package/src/board.ts +36 -0
  47. package/src/export-ooxml.ts +4 -0
  48. package/src/export-xls.ts +3 -0
  49. package/src/export.ts +6 -0
  50. package/src/expressions/evaluate.test.ts +111 -0
  51. package/src/expressions/evaluate.ts +237 -0
  52. package/src/expressions/expression-columns.ts +133 -0
  53. package/src/expressions/expression-types.ts +84 -0
  54. package/src/expressions/parse.test.ts +106 -0
  55. package/src/expressions/parse.ts +610 -0
  56. package/src/import.test.ts +1 -1
  57. package/src/import.ts +3 -1
  58. package/src/index.ts +192 -46
  59. package/src/install.ts +12 -2
  60. package/src/pivot-enable.ts +44 -0
  61. package/src/pivot.test.ts +0 -1
  62. package/src/scheduler-assignments.test.ts +97 -0
  63. package/src/scheduler-assignments.ts +134 -0
  64. package/src/scheduler-axis.test.ts +108 -0
  65. package/src/scheduler-axis.ts +238 -0
  66. package/src/scheduler-booking.test.ts +57 -0
  67. package/src/scheduler-booking.ts +63 -0
  68. package/src/scheduler-config.ts +179 -0
  69. package/src/scheduler-dependencies.test.ts +155 -0
  70. package/src/scheduler-dependencies.ts +223 -0
  71. package/src/scheduler-freebusy.test.ts +41 -0
  72. package/src/scheduler-freebusy.ts +36 -0
  73. package/src/scheduler-heatmap.test.ts +39 -0
  74. package/src/scheduler-heatmap.ts +55 -0
  75. package/src/scheduler-resource-tree.test.ts +84 -0
  76. package/src/scheduler-resource-tree.ts +107 -0
  77. package/src/scheduler-slots.test.ts +53 -0
  78. package/src/scheduler-slots.ts +94 -0
  79. package/src/scheduler-summary.test.ts +47 -0
  80. package/src/scheduler-summary.ts +81 -0
  81. package/src/schema-designer.ts +1 -1
  82. package/src/sources/index.ts +1 -1
  83. package/src/sources/introspect-supabase.test.ts +13 -1
  84. package/src/sources/introspect-supabase.ts +20 -0
  85. package/src/studio/copilot-core.test.ts +45 -0
  86. package/src/studio/copilot-core.ts +65 -0
  87. package/src/studio/deploy-cli.test.ts +56 -0
  88. package/src/studio/deploy-cli.ts +100 -0
  89. package/src/studio/emit-project.test.ts +800 -24
  90. package/src/studio/emit-project.ts +1307 -135
  91. package/src/studio/emit-schema.test.ts +17 -0
  92. package/src/studio/emit-schema.ts +182 -41
  93. package/src/studio/index.ts +59 -1
  94. package/src/studio/init-flow.test.ts +239 -0
  95. package/src/studio/init-flow.ts +358 -0
  96. package/src/studio/introspect-openapi.test.ts +84 -0
  97. package/src/studio/introspect-openapi.ts +252 -0
  98. package/src/studio/project.test.ts +57 -1
  99. package/src/studio/project.ts +302 -8
  100. package/src/studio/samples/crm.ts +282 -258
  101. package/src/studio/samples/datasets.test.ts +84 -0
  102. package/src/studio/samples/datasets.ts +340 -0
  103. package/src/studio/samples/fleet.ts +213 -186
  104. package/src/studio/samples/insurance.ts +223 -195
  105. package/src/studio/samples/inventory.ts +213 -182
  106. package/src/studio/samples/live-data.test.ts +99 -98
  107. package/src/studio/samples/live-data.ts +8 -10
  108. package/src/studio/samples/projects.ts +212 -190
  109. package/src/studio/samples/samples.test.ts +268 -216
  110. package/src/studio/samples/shared.ts +22 -145
  111. package/src/studio/samples/starter.ts +251 -0
  112. package/src/studio/samples/support.ts +209 -184
  113. package/src/studio/screen-suites.test.ts +226 -0
  114. package/src/studio/screen-suites.ts +445 -0
  115. package/src/studio/ui-components-surface.test.ts +185 -0
  116. package/src/studio/ui-components.generated.ts +7154 -0
  117. package/src/studio/ui-components.ts +273 -3
  118. package/src/sveltekit/index.ts +1 -0
  119. package/src/sveltekit/sql-source.test.ts +13 -0
  120. package/src/sveltekit/sql-source.ts +12 -7
  121. package/src/sveltekit/transport-scope.test.ts +125 -0
  122. package/src/sveltekit/transport.ts +76 -2
  123. package/src/upgrade-prompt.ts +2 -2
  124. package/src/watermark.ts +2 -2
  125. package/src/ai.test.ts +0 -522
  126. package/src/ai.ts +0 -1388
package/README.md CHANGED
@@ -1,81 +1,95 @@
1
- <p align="center">
2
- <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
- </p>
4
-
5
- <h1 align="center">@svgrid/enterprise</h1>
6
-
7
- <p align="center"><strong>The commercial feature pack for SvGrid.</strong></p>
8
-
9
- <p align="center">
10
- <a href="https://svgrid.com">Website</a> ·
11
- <a href="https://svgrid.com/docs">Docs</a> ·
12
- <a href="https://svgrid.com/pricing">Pricing</a>
13
- </p>
14
-
15
- ---
16
-
17
- `@svgrid/enterprise` layers production export, printing, analytics, extra grid views, and a full data-app layer on top of the MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core. It attaches to the grid's public API without changing it - the same `api` object you already hold simply gains new methods.
18
-
19
- ## What it adds
20
-
21
- - **Data export** - Excel (`.xlsx`), PDF, CSV, TSV, and HTML, with theme-matched styling, headers/footers, and image support.
22
- - **Data import** - read Excel / CSV / TSV / JSON into typed rows with column auto-mapping, type inference, and per-row validation, plus a ready-made `SvImportDialog`.
23
- - **Paginated print** - opens a clean, paginated, printable view of the grid with title and page breaks.
24
- - **Pivot tables** - drag-and-drop pivot Designer with row/column/value fields, aggregation, drill-through to source rows, and pivot-to-chart.
25
- - **Scheduler / calendar view** - a Month/Week/Day/Agenda calendar rendered as a view of the grid: `enableSchedulerView()` lets `<SvGrid scheduler={...}>` show events with resources, recurrence, and drag/resize.
26
- - **Staged editing** - collect edits into a reviewable change set before committing.
27
- - **Scheduling automation** - a client-side cron / one-off scheduler (`createScheduler`, `parseCron`, `CRON_PRESETS`) to drive recurring exports and alerts with no backend.
28
- - **AI toolkit** - natural-language filter, "chart this", smart-fill, summarize, classify, anomaly detection, and NL export. Every call routes through a provider you register with `setAIProvider()`; no model client is bundled.
29
- - **SvGrid Studio** - a schema-driven data-app layer: `EntitySchema`, memory / SQL / Supabase / REST data sources, a SvelteKit adapter, edit panels, master/detail, schema charts + KPI dashboards, and the project model + codegen behind the visual designer. See [`@svgrid/studio`](https://www.npmjs.com/package/@svgrid/studio).
30
-
31
- ## Install
32
-
33
- ```bash
34
- npm install @svgrid/enterprise
35
- ```
36
-
37
- Format engines are optional peer dependencies - install only the ones you use:
38
-
39
- ```bash
40
- npm install jszip # Excel (.xlsx) export + import
41
- npm install pdfmake # PDF export
42
- ```
43
-
44
- ## Usage
45
-
46
- ```ts
47
- import { setLicenseKey, installEnterprise } from '@svgrid/enterprise'
48
-
49
- setLicenseKey('SVENTERPRISE-XXXX-XXXX-XXXX') // your Enterprise key
50
-
51
- // Inside <SvGrid onApiReady={(api) => { ... }}>:
52
- const pro = installEnterprise(api)
53
-
54
- // Export / print
55
- await pro.exportData({ format: 'xlsx', filename: 'orders' })
56
- pro.print({ title: 'Q2 Orders' })
57
-
58
- // Import
59
- const result = await pro.importData({ file, format: 'xlsx' })
60
-
61
- // AI (needs setAIProvider())
62
- await pro.ai.filter('EU orders over $1k from last quarter')
63
- ```
64
-
65
- `installEnterprise` returns the same grid API with the enterprise methods (`exportData`, `copyExport`, `print`, `importData`, `ai.*`, `pivot.*`) added on top, so the rest of your integration is unchanged. It also registers the scheduler / calendar view, so `<SvGrid scheduler={...}>` works.
66
-
67
- ## Licensing
68
-
69
- Commercial. A valid Enterprise key is required at runtime; calls throw without one. Purchase a key at [svgrid.com/pricing](https://svgrid.com/pricing).
70
-
71
- OSS projects under an [OSI-approved license](https://opensource.org/licenses) qualify for a **free Enterprise key**.
72
-
73
- The source in this package is published for evaluation and for paying customers; visibility does not grant a license. See [LICENSE](./LICENSE).
74
-
75
- ## Support
76
-
77
- Enterprise licenses include commercial and priority support. Open an issue at [github.com/sv-grid/sv-grid](https://github.com/sv-grid/sv-grid/issues) or reach the team via [svgrid.com](https://svgrid.com).
78
-
79
- ## Trademark
80
-
81
- SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.
1
+ <p align="center">
2
+ <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
+ </p>
4
+
5
+ <h1 align="center">@svgrid/enterprise</h1>
6
+
7
+ <p align="center"><strong>Excel export, import, pivot tables, and print for SvGrid.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@svgrid/enterprise"><img src="https://img.shields.io/npm/v/%40svgrid%2Fenterprise.svg?label=%40svgrid%2Fenterprise" alt="npm version" /></a>
11
+ <a href="https://svgrid.com/pricing/"><img src="https://img.shields.io/badge/license-commercial-blue.svg" alt="Commercial license" /></a>
12
+ <a href="https://svelte.dev"><img src="https://img.shields.io/badge/svelte-5-ff3e00.svg" alt="Svelte 5" /></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://svgrid.com">Website</a> ·
17
+ <a href="https://svgrid.com/docs/">Docs</a> ·
18
+ <a href="https://svgrid.com/pricing/">Pricing</a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ `@svgrid/enterprise` layers production export, printing, analytics, extra grid views, and a full data-app layer on top of the MIT [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid) core. It attaches to the grid's public API without changing it - the same `api` object you already hold simply gains new methods.
24
+
25
+ ## What it adds
26
+
27
+ - **Data export** - Excel (`.xlsx`), PDF, CSV, TSV, and HTML, with theme-matched styling, headers/footers, and image support.
28
+ - **Data import** - read Excel / CSV / TSV / JSON into typed rows with column auto-mapping, type inference, and per-row validation, plus a ready-made `SvImportDialog`.
29
+ - **Paginated print** - opens a clean, paginated, printable view of the grid with title and page breaks.
30
+ - **Pivot tables** - drag-and-drop pivot Designer with row/column/value fields, aggregation, drill-through to source rows, and pivot-to-chart.
31
+ - **Scheduler / calendar view** - a Month/Week/Day/Agenda calendar rendered as a view of the grid: `enableSchedulerView()` lets `<SvGrid scheduler={...}>` show events with resources, recurrence, and drag/resize.
32
+ - **Staged editing** - collect edits into a reviewable change set before committing.
33
+ - **Scheduling automation** - a client-side cron / one-off scheduler (`createScheduler`, `parseCron`, `CRON_PRESETS`) to drive recurring exports and alerts with no backend.
34
+ - **SvGrid Studio** - a schema-driven data-app layer: `EntitySchema`, memory / SQL / Supabase / REST data sources, a SvelteKit adapter, edit panels, master/detail, schema charts + KPI dashboards, and the project model + codegen behind the visual designer. See [`@svgrid/studio`](https://www.npmjs.com/package/@svgrid/studio).
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ npm install @svgrid/enterprise
40
+ ```
41
+
42
+ Format engines are optional peer dependencies - install only the ones you use:
43
+
44
+ ```bash
45
+ npm install jszip # Excel (.xlsx) export + import
46
+ npm install pdfmake # PDF export
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ ```ts
52
+ import { setLicenseKey, installEnterprise } from '@svgrid/enterprise'
53
+
54
+ setLicenseKey('SVENTERPRISE-XXXX-XXXX-XXXX') // your Enterprise key
55
+
56
+ // Inside <SvGrid onApiReady={(api) => { ... }}>:
57
+ const pro = installEnterprise(api)
58
+
59
+ // Export / print
60
+ await pro.exportData({ format: 'xlsx', filename: 'orders' })
61
+ pro.print({ title: 'Q2 Orders' })
62
+
63
+ // Import
64
+ const result = await pro.importData({ file, format: 'xlsx' })
65
+
66
+ // Pivot - returns { rows, columns } for a second <SvGrid>
67
+ const { rows, columns } = pro.pivot.build({
68
+ rows: ['region'],
69
+ values: [{ field: 'total', agg: 'sum' }],
70
+ })
71
+ ```
72
+
73
+ The AI helpers are **not** in this package. Natural-language filter,
74
+ smart fill, summarize, classify, anomaly detection, and "chart this" are
75
+ built in and free in [`@svgrid/grid`](https://www.npmjs.com/package/@svgrid/grid).
76
+ Installing Enterprise only adds the Excel/PDF export engine that
77
+ AI-planned exports write through.
78
+
79
+ `installEnterprise` returns the same grid API with the enterprise methods (`exportData`, `copyExport`, `print`, `importData`, `pivot.*`) added on top, so the rest of your integration is unchanged. It also registers the Kanban board and scheduler / calendar views, so `<SvGrid board={...}>` and `<SvGrid scheduler={...}>` render.
80
+
81
+ ## Licensing
82
+
83
+ Commercial. A valid Enterprise key is required at runtime; calls throw without one. Purchase a key at [svgrid.com/pricing](https://svgrid.com/pricing/).
84
+
85
+ OSS projects under an [OSI-approved license](https://opensource.org/licenses) qualify for a **free Enterprise key**.
86
+
87
+ The source in this package is published for evaluation and for paying customers; visibility does not grant a license. See [LICENSE](./LICENSE).
88
+
89
+ ## Support
90
+
91
+ Enterprise licenses include commercial and priority support. Open an issue at [github.com/sv-grid/sv-grid](https://github.com/sv-grid/sv-grid/issues) or reach the team via [svgrid.com](https://svgrid.com).
92
+
93
+ ## Trademark
94
+
95
+ SvGrid&trade; and sv-grid&trade; are trademarks of jQWidgets Ltd.