@svgrid/enterprise 3.0.0 → 3.0.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.
- package/README.md +95 -95
- package/dist/ExpressionEditorHarness.svelte.d.ts +2 -2
- package/dist/SvAdvancedFilter.svelte.d.ts +2 -2
- package/dist/SvAlertRuleEditor.svelte.d.ts +2 -2
- package/dist/SvAlertsManager.svelte.d.ts +3 -3
- package/dist/SvAlertsPanel.svelte.d.ts +1 -1
- package/dist/SvAuthGate.svelte +115 -115
- package/dist/SvAuthGate.svelte.d.ts +1 -1
- package/dist/SvBoard.svelte.d.ts +1 -1
- package/dist/SvExportMenu.svelte +553 -553
- package/dist/SvExportMenu.svelte.d.ts +2 -2
- package/dist/SvExpressionEditor.svelte.d.ts +2 -2
- package/dist/SvFileInput.svelte +113 -113
- package/dist/SvGridAlerts.svelte.d.ts +2 -2
- package/dist/SvGridBoard.svelte +2358 -2358
- package/dist/SvGridBulkEditDrawer.svelte.d.ts +1 -1
- package/dist/SvGridEditPanel.svelte +1157 -1157
- package/dist/SvGridEditPanel.svelte.d.ts +3 -3
- package/dist/SvGridMasterDetail.svelte +116 -116
- package/dist/SvGridMasterDetail.svelte.d.ts +1 -1
- package/dist/SvGridScheduler.svelte +5358 -5358
- package/dist/SvImportDialog.svelte +1020 -1020
- package/dist/SvImportDialog.svelte.d.ts +2 -2
- package/dist/SvLookupInput.svelte +180 -180
- package/dist/SvLookupInput.svelte.d.ts +1 -1
- package/dist/SvPivotDesigner.svelte +1990 -1990
- package/dist/SvPivotDesigner.svelte.d.ts +2 -2
- package/dist/SvRecordDetail.svelte.d.ts +1 -1
- package/dist/SvSchedule.svelte.d.ts +1 -1
- package/dist/SvSchemaChart.svelte +234 -234
- package/dist/SvSchemaChart.svelte.d.ts +2 -2
- package/dist/SvSchemaDashboard.svelte +130 -130
- package/dist/SvSchemaDashboard.svelte.d.ts +3 -3
- package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -1
- package/dist/advanced-filter-enable.js +3 -3
- package/dist/alerts/alert-engine-attach.d.ts +2 -2
- package/dist/alerts/alert-engine-attach.js +3 -3
- package/dist/alerts/alert-engine.d.ts +1 -1
- package/dist/alerts/alert-engine.js +2 -2
- package/dist/alerts/alert-formats.d.ts +1 -1
- package/dist/alerts/alert-formats.js +1 -1
- package/dist/alerts/alert-observer.d.ts +3 -3
- package/dist/alerts/alert-observer.js +1 -1
- package/dist/alerts/alert-storage.d.ts +1 -1
- package/dist/alerts/alert-store.svelte.d.ts +1 -1
- package/dist/alerts/alert-types.d.ts +2 -2
- package/dist/alerts.js +2 -2
- package/dist/board.js +2 -2
- package/dist/cdn/svgrid-enterprise.svelte-external.js +1161 -1144
- package/dist/designer/assets/GridMenus-B1JtIN21.js +8 -0
- package/dist/designer/assets/SvDateRangeInput-C0iCCZ8o.css +1 -0
- package/dist/designer/assets/{SvDateRangeInput-CVn-yqrQ.js → SvDateRangeInput-CjO7nn_x.js} +1 -1
- package/dist/designer/assets/SvDateTimePicker-ByBD_ov6.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-DPv09DIT.css +1 -0
- package/dist/designer/assets/SvField-YDLipR6O.css +1 -0
- package/dist/designer/assets/{SvField-BsqiA5me.js → SvField-cj1PFNgZ.js} +1 -1
- package/dist/designer/assets/{preload-helper-CG0n22O7.js → SvGrid.helpers-BgT-gnCo.js} +1 -1
- package/dist/designer/assets/SvGridCellEditor-0W1L2hJ1.js +2 -0
- package/dist/designer/assets/SvGridChart-DBOR4xcz.js +2 -0
- package/dist/designer/assets/SvGridChart-fkMWeh1J.css +1 -0
- package/dist/designer/assets/SvGridChartPanel-symrhNnR.js +11 -0
- package/dist/designer/assets/SvGridChartView-BmRxq6mU.js +1 -0
- package/dist/designer/assets/SvGridChartView-DUc-1RUf.css +1 -0
- package/dist/designer/assets/SvGridDropdown-Bb3HH2Aj.js +1 -0
- package/dist/designer/assets/SvGridDropdown-CcidB3rm.css +1 -0
- package/dist/designer/assets/SvListBox-1oUF6Iav.js +110 -0
- package/dist/designer/assets/SvListBox-BXfyqy4a.css +1 -0
- package/dist/designer/assets/cell-formatting-wr5wm7US.js +1 -0
- package/dist/designer/assets/chart-DXFganU8.js +1 -0
- package/dist/designer/assets/date-format-DGagAqRc.css +1 -0
- package/dist/designer/assets/{date-format-4DJvNtG2.js → date-format-onlYDsrY.js} +1 -1
- package/dist/designer/assets/export-format-D-eP4b2l.js +6 -0
- package/dist/designer/assets/{index-zUBix-JQ.js → index-C_a9Cj8Y.js} +2984 -141
- package/dist/designer/assets/index-k2stW6L8.css +1 -0
- package/dist/designer/assets/preload-helper-HclGiUj8.js +1 -0
- package/dist/designer/assets/src-D9p27OGC.js +58 -0
- package/dist/designer/index.html +22 -22
- package/dist/export-conditional.d.ts +1 -1
- package/dist/export-print.js +19 -19
- package/dist/export-xls.d.ts +2 -2
- package/dist/export.d.ts +2 -2
- package/dist/export.js +7 -7
- package/dist/expressions/builder-tree.d.ts +2 -2
- package/dist/expressions/builder-tree.js +1 -1
- package/dist/expressions/compile.d.ts +1 -1
- package/dist/import.js +1 -1
- package/dist/index.d.ts +53 -53
- package/dist/index.js +50 -50
- package/dist/install.d.ts +4 -4
- package/dist/install.js +11 -11
- package/dist/license.d.ts +3 -2
- package/dist/license.js +9 -4
- package/dist/node/studio.js +123 -114
- package/dist/pivot-chart.d.ts +1 -1
- package/dist/pivot-designer.d.ts +1 -1
- package/dist/pivot-enable.js +3 -3
- package/dist/print.d.ts +1 -1
- package/dist/print.js +4 -4
- package/dist/scheduler-config.d.ts +5 -5
- package/dist/scheduler-freebusy.d.ts +1 -1
- package/dist/scheduler-freebusy.js +1 -1
- package/dist/scheduler.js +2 -2
- package/dist/schema-designer.d.ts +1 -1
- package/dist/schema-designer.js +2 -2
- package/dist/selection-bar.js +2 -2
- package/dist/sources/aggregate.d.ts +1 -1
- package/dist/sources/auth-supabase.js +1 -1
- package/dist/sources/dashboard.d.ts +2 -2
- package/dist/sources/dashboard.js +1 -1
- package/dist/sources/index.d.ts +13 -13
- package/dist/sources/index.js +13 -13
- package/dist/sources/realtime-supabase.js +1 -1
- package/dist/sources/relation-lookup.d.ts +1 -1
- package/dist/sources/relation-lookup.js +1 -1
- package/dist/sources/rest-adapters.d.ts +1 -1
- package/dist/sources/rest-adapters.js +1 -1
- package/dist/sources/rest.d.ts +2 -2
- package/dist/sources/rest.js +3 -3
- package/dist/sources/supabase.d.ts +2 -2
- package/dist/sources/supabase.js +3 -3
- package/dist/sources/with-entity-rules.d.ts +1 -1
- package/dist/sources/with-entity-rules.js +1 -1
- package/dist/sources/with-relation-labels.d.ts +1 -1
- package/dist/studio/emit-project.js +2161 -2127
- package/dist/studio/emit-schema.js +369 -369
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio/introspect-db.js +45 -45
- package/dist/studio/project.d.ts +10 -0
- package/dist/studio/samples/crm.js +6 -6
- package/dist/studio/samples/fleet.js +7 -7
- package/dist/studio/samples/insurance.js +9 -9
- package/dist/studio/samples/inventory.js +12 -12
- package/dist/studio/samples/projects.js +5 -5
- package/dist/studio/samples/support.js +8 -8
- package/dist/studio/scaffold-app.js +104 -104
- package/dist/studio/scaffold.js +151 -151
- package/dist/studio/ui-components.d.ts +7 -0
- package/dist/studio/ui-components.js +35 -0
- package/dist/sveltekit/in-memory.d.ts +3 -3
- package/dist/sveltekit/in-memory.js +4 -4
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +5 -5
- package/dist/sveltekit/query-plan.d.ts +1 -1
- package/dist/sveltekit/sql-source.d.ts +4 -4
- package/dist/sveltekit/sql-source.js +4 -4
- package/dist/sveltekit/sql.d.ts +1 -1
- package/dist/sveltekit/transport.d.ts +2 -2
- package/dist/sveltekit/transport.js +1 -1
- package/dist/upgrade-prompt.js +25 -25
- package/package.json +6 -3
- package/dist/designer/assets/GridMenus-Cgilexpk.js +0 -8
- package/dist/designer/assets/SvDateRangeInput-BV5OXYQ2.css +0 -1
- package/dist/designer/assets/SvDateTimePicker-BdioTrJQ.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-CY8TK4BT.css +0 -1
- package/dist/designer/assets/SvField-BF-9TJSd.css +0 -1
- package/dist/designer/assets/SvGridCellEditor-dLY7_kk9.js +0 -2
- package/dist/designer/assets/SvGridChart-BEDNTdc5.js +0 -2
- package/dist/designer/assets/SvGridChart-Vu4Nvjiv.css +0 -1
- package/dist/designer/assets/SvGridChartPanel-x3lzSxuf.js +0 -10
- package/dist/designer/assets/SvGridChartView-CAKhPELi.js +0 -1
- package/dist/designer/assets/SvGridChartView-DX9HfkBR.css +0 -1
- package/dist/designer/assets/SvGridDropdown-CAYG7Y-O.js +0 -1
- package/dist/designer/assets/SvGridDropdown-Crwb2P3Q.css +0 -1
- package/dist/designer/assets/SvListBox-CVYQcLX9.js +0 -1
- package/dist/designer/assets/SvListBox-DgN8kvjt.css +0 -1
- package/dist/designer/assets/chart-DHEgt4lN.js +0 -1
- package/dist/designer/assets/date-format-Dzy4mTGh.css +0 -1
- package/dist/designer/assets/export-format-DwjuTfrQ.js +0 -6
- package/dist/designer/assets/index-Cp7fDJ3b.css +0 -1
- package/dist/designer/assets/js-scroller.svelte-Bhxqb3-c.js +0 -110
- package/dist/designer/assets/src-B7DNcoQK.css +0 -1
- package/dist/designer/assets/src-BoYyigAC.js +0 -2896
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -3875
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -21
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -1938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -205
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -18
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -264
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -697
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -4938
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -495
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -190
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -8
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -1
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -138
- package/dist/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -1
package/dist/studio/scaffold.js
CHANGED
|
@@ -123,13 +123,13 @@ export function scaffold(schema, options = {}) {
|
|
|
123
123
|
const schemaFile = {
|
|
124
124
|
path: `src/lib/${route}.schema.ts`,
|
|
125
125
|
description: 'Entity schema + row type. Re-add any Standard Schema `validate` functions here by hand.',
|
|
126
|
-
contents: `import type { EntitySchema } from '@svgrid/enterprise'
|
|
127
|
-
|
|
128
|
-
${managed(`export type ${rowType} = {
|
|
129
|
-
${rowFields}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
${schemaLiteral(schema, constName, rowType)}`)}
|
|
126
|
+
contents: `import type { EntitySchema } from '@svgrid/enterprise'
|
|
127
|
+
|
|
128
|
+
${managed(`export type ${rowType} = {
|
|
129
|
+
${rowFields}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
${schemaLiteral(schema, constName, rowType)}`)}
|
|
133
133
|
`,
|
|
134
134
|
};
|
|
135
135
|
// 2. The API route: SvelteKit +server.ts using the transport handlers.
|
|
@@ -140,53 +140,53 @@ ${schemaLiteral(schema, constName, rowType)}`)}
|
|
|
140
140
|
let serverDescription;
|
|
141
141
|
if (driver) {
|
|
142
142
|
// Fully-connected route: driver + DATABASE_URL, no manual editing needed.
|
|
143
|
-
serverImport = `${driver.imports}
|
|
143
|
+
serverImport = `${driver.imports}
|
|
144
144
|
import { createKitHandlers, createSqlDataSource } from '@svgrid/enterprise'`;
|
|
145
|
-
serverBody = `${driver.setup}
|
|
146
|
-
|
|
147
|
-
const source = createSqlDataSource<${rowType}>({
|
|
148
|
-
schema: ${constName},
|
|
149
|
-
table: ${JSON.stringify(schema.name)},${driver.dialectArg}
|
|
150
|
-
execute: async (text, params) => {
|
|
151
|
-
${driver.execBody}
|
|
152
|
-
},
|
|
153
|
-
})
|
|
154
|
-
|
|
145
|
+
serverBody = `${driver.setup}
|
|
146
|
+
|
|
147
|
+
const source = createSqlDataSource<${rowType}>({
|
|
148
|
+
schema: ${constName},
|
|
149
|
+
table: ${JSON.stringify(schema.name)},${driver.dialectArg}
|
|
150
|
+
execute: async (text, params) => {
|
|
151
|
+
${driver.execBody}
|
|
152
|
+
},
|
|
153
|
+
})
|
|
154
|
+
|
|
155
155
|
export const { POST } = createKitHandlers({ schema: ${constName}, source })`;
|
|
156
156
|
serverDescription = `API route connected to your ${dataSource} database via process.env.DATABASE_URL.`;
|
|
157
157
|
}
|
|
158
158
|
else if (dataSource === 'sql') {
|
|
159
159
|
serverImport = `import { createKitHandlers, createSqlDataSource } from '@svgrid/enterprise'`;
|
|
160
|
-
serverBody = `// Wire execute() to your SQL client: run \`text\` with \`params\`, return the rows.
|
|
161
|
-
// Works with Drizzle (db.execute), postgres.js, better-sqlite3, mysql2, ...
|
|
162
|
-
const source = createSqlDataSource<${rowType}>({
|
|
163
|
-
schema: ${constName},
|
|
164
|
-
table: ${JSON.stringify(schema.name)},
|
|
165
|
-
dialect: { placeholders: '$', ilike: true },
|
|
166
|
-
execute: async (text, params) => {
|
|
167
|
-
throw new Error('TODO: run the query with your database client and return the rows.')
|
|
168
|
-
},
|
|
169
|
-
})
|
|
170
|
-
|
|
160
|
+
serverBody = `// Wire execute() to your SQL client: run \`text\` with \`params\`, return the rows.
|
|
161
|
+
// Works with Drizzle (db.execute), postgres.js, better-sqlite3, mysql2, ...
|
|
162
|
+
const source = createSqlDataSource<${rowType}>({
|
|
163
|
+
schema: ${constName},
|
|
164
|
+
table: ${JSON.stringify(schema.name)},
|
|
165
|
+
dialect: { placeholders: '$', ilike: true },
|
|
166
|
+
execute: async (text, params) => {
|
|
167
|
+
throw new Error('TODO: run the query with your database client and return the rows.')
|
|
168
|
+
},
|
|
169
|
+
})
|
|
170
|
+
|
|
171
171
|
export const { POST } = createKitHandlers({ schema: ${constName}, source })`;
|
|
172
172
|
serverDescription = 'API route. Fill in execute() with your SQL client (Drizzle / postgres.js / ...).';
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
175
175
|
serverImport = `import { createInMemoryDataSource, createKitHandlers } from '@svgrid/enterprise'`;
|
|
176
|
-
serverBody = `// Starts empty and in-memory so the screen runs immediately. Swap this for
|
|
177
|
-
// a database-backed source (scaffold with dataSource:"sql" or a dialect) when ready.
|
|
178
|
-
const source = createInMemoryDataSource<${rowType}>([], ${constName})
|
|
179
|
-
|
|
176
|
+
serverBody = `// Starts empty and in-memory so the screen runs immediately. Swap this for
|
|
177
|
+
// a database-backed source (scaffold with dataSource:"sql" or a dialect) when ready.
|
|
178
|
+
const source = createInMemoryDataSource<${rowType}>([], ${constName})
|
|
179
|
+
|
|
180
180
|
export const { POST } = createKitHandlers({ schema: ${constName}, source })`;
|
|
181
181
|
serverDescription = 'API route using an in-memory source. Scaffold with a dialect for a real database.';
|
|
182
182
|
}
|
|
183
183
|
const serverFile = {
|
|
184
184
|
path: `src/routes${apiRoute}/+server.ts`,
|
|
185
185
|
description: serverDescription,
|
|
186
|
-
contents: `${serverImport}
|
|
187
|
-
import { ${constName}, type ${rowType} } from '${schemaImport}'
|
|
188
|
-
|
|
189
|
-
${managed(serverBody)}
|
|
186
|
+
contents: `${serverImport}
|
|
187
|
+
import { ${constName}, type ${rowType} } from '${schemaImport}'
|
|
188
|
+
|
|
189
|
+
${managed(serverBody)}
|
|
190
190
|
`,
|
|
191
191
|
};
|
|
192
192
|
// Relation (foreign-key) fields become searchable lookups in the edit form.
|
|
@@ -198,9 +198,9 @@ ${managed(serverBody)}
|
|
|
198
198
|
.map((f) => {
|
|
199
199
|
const name = `${camel(f.field)}Lookup`;
|
|
200
200
|
const endpoint = JSON.stringify(`/api/${f.relation.entity}`);
|
|
201
|
-
return ` const ${name} = createRelationLookup<Record<string, unknown>>({
|
|
202
|
-
source: createKitDataSource({ endpoint: ${endpoint} }),
|
|
203
|
-
labelField: ${JSON.stringify(f.relation.labelField)},
|
|
201
|
+
return ` const ${name} = createRelationLookup<Record<string, unknown>>({
|
|
202
|
+
source: createKitDataSource({ endpoint: ${endpoint} }),
|
|
203
|
+
labelField: ${JSON.stringify(f.relation.labelField)},
|
|
204
204
|
})`;
|
|
205
205
|
})
|
|
206
206
|
.join('\n');
|
|
@@ -210,121 +210,121 @@ ${managed(serverBody)}
|
|
|
210
210
|
const lookupsSection = hasLookups ? `\n\n${lookupDecls}\n${lookupsMap}` : '';
|
|
211
211
|
// 3. The page: a full data screen - search, server sort + paging,
|
|
212
212
|
// multi-select delete (optimistic), create/edit, loading/error/empty.
|
|
213
|
-
const pageBody = ` const source = createKitDataSource<${rowType}>({ endpoint: '${apiRoute}' })
|
|
214
|
-
const columns = schemaToColumns(${constName})${lookupsSection}
|
|
215
|
-
|
|
216
|
-
let state = $state<ServerState<${rowType}>>({
|
|
217
|
-
rows: [], total: 0, loading: false, saving: false, error: null,
|
|
218
|
-
pageIndex: 0, pageSize: 25, pageCount: 1, sortModel: [], filterModel: {},
|
|
219
|
-
})
|
|
220
|
-
const controller = createServerDataSource<${rowType}>(source, {
|
|
221
|
-
pageSize: 25,
|
|
222
|
-
optimistic: true,
|
|
223
|
-
getRowId: (r) => String(r.${idField}),
|
|
224
|
-
onChange: (s) => (state = s),
|
|
225
|
-
})
|
|
226
|
-
controller.refresh()
|
|
227
|
-
|
|
228
|
-
let selected = $state<${rowType}[]>([])
|
|
229
|
-
let editing = $state<${rowType} | null | undefined>(undefined) // undefined = closed, null = create
|
|
230
|
-
|
|
231
|
-
async function save({ mode, id, values }: { mode: 'create' | 'edit'; id: string | null; values: Partial<${rowType}> }) {
|
|
232
|
-
if (mode === 'create') {
|
|
233
|
-
await controller.createRow(values)
|
|
234
|
-
controller.setPage(state.pageCount - 1) // jump to the new row (appended at the end)
|
|
235
|
-
} else if (id) {
|
|
236
|
-
await controller.updateRow(id, values)
|
|
237
|
-
}
|
|
238
|
-
editing = undefined
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async function removeSelected() {
|
|
242
|
-
for (const row of selected) await controller.deleteRow(String(row.${idField}))
|
|
243
|
-
selected = []
|
|
213
|
+
const pageBody = ` const source = createKitDataSource<${rowType}>({ endpoint: '${apiRoute}' })
|
|
214
|
+
const columns = schemaToColumns(${constName})${lookupsSection}
|
|
215
|
+
|
|
216
|
+
let state = $state<ServerState<${rowType}>>({
|
|
217
|
+
rows: [], total: 0, loading: false, saving: false, error: null,
|
|
218
|
+
pageIndex: 0, pageSize: 25, pageCount: 1, sortModel: [], filterModel: {},
|
|
219
|
+
})
|
|
220
|
+
const controller = createServerDataSource<${rowType}>(source, {
|
|
221
|
+
pageSize: 25,
|
|
222
|
+
optimistic: true,
|
|
223
|
+
getRowId: (r) => String(r.${idField}),
|
|
224
|
+
onChange: (s) => (state = s),
|
|
225
|
+
})
|
|
226
|
+
controller.refresh()
|
|
227
|
+
|
|
228
|
+
let selected = $state<${rowType}[]>([])
|
|
229
|
+
let editing = $state<${rowType} | null | undefined>(undefined) // undefined = closed, null = create
|
|
230
|
+
|
|
231
|
+
async function save({ mode, id, values }: { mode: 'create' | 'edit'; id: string | null; values: Partial<${rowType}> }) {
|
|
232
|
+
if (mode === 'create') {
|
|
233
|
+
await controller.createRow(values)
|
|
234
|
+
controller.setPage(state.pageCount - 1) // jump to the new row (appended at the end)
|
|
235
|
+
} else if (id) {
|
|
236
|
+
await controller.updateRow(id, values)
|
|
237
|
+
}
|
|
238
|
+
editing = undefined
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
async function removeSelected() {
|
|
242
|
+
for (const row of selected) await controller.deleteRow(String(row.${idField}))
|
|
243
|
+
selected = []
|
|
244
244
|
}`;
|
|
245
245
|
const pageFile = {
|
|
246
246
|
path: `src/routes/${route}/+page.svelte`,
|
|
247
247
|
description: 'The data screen: sort, filter, search, paging, multi-select delete, and create/edit - wired to the API route.',
|
|
248
|
-
contents: `<script lang="ts">
|
|
249
|
-
import { SvGrid, createServerDataSource } from '@svgrid/grid'
|
|
250
|
-
import {
|
|
251
|
-
SvGridEditPanel,
|
|
252
|
-
createKitDataSource,${hasLookups ? '\n createRelationLookup,' : ''}
|
|
253
|
-
schemaToColumns,
|
|
254
|
-
type ServerState,
|
|
255
|
-
} from '@svgrid/enterprise'
|
|
256
|
-
import { ${constName}, type ${rowType} } from '${schemaImport}'
|
|
257
|
-
|
|
258
|
-
${managed(pageBody)}
|
|
259
|
-
</script>
|
|
260
|
-
|
|
261
|
-
<svelte:head><style>
|
|
262
|
-
${themeTokenCss({ preset: options.theme, mode: options.dark ? 'dark' : 'light' }, { layer: 'svgrid-studio' })}
|
|
263
|
-
</style></svelte:head>
|
|
264
|
-
|
|
265
|
-
<div class="page">
|
|
266
|
-
<header class="page__toolbar">
|
|
267
|
-
<h2 class="page__title">${label}</h2>
|
|
268
|
-
<div class="page__actions">
|
|
269
|
-
<button onclick={() => (editing = null)}>New</button>
|
|
270
|
-
<button disabled={selected.length === 0} onclick={removeSelected}>
|
|
271
|
-
Delete {selected.length > 0 ? '(' + selected.length + ')' : ''}
|
|
272
|
-
</button>
|
|
273
|
-
</div>
|
|
274
|
-
</header>
|
|
275
|
-
|
|
276
|
-
{#if state.error}<p class="page__error" role="alert">{state.error}</p>{/if}
|
|
277
|
-
|
|
278
|
-
<SvGrid
|
|
279
|
-
data={state.rows}
|
|
280
|
-
{columns}
|
|
281
|
-
loading={state.loading}
|
|
282
|
-
loadingOverlay
|
|
283
|
-
fitColumns
|
|
284
|
-
enableRowSummaries={false}
|
|
285
|
-
showRowSelection
|
|
286
|
-
enableCellSelection
|
|
287
|
-
sortable
|
|
288
|
-
externalSort
|
|
289
|
-
onSortingChange={(s) => controller.setSort(s)}
|
|
290
|
-
filterable
|
|
291
|
-
showGlobalFilter
|
|
292
|
-
externalFilter
|
|
293
|
-
onFiltersChange={(f) =>
|
|
294
|
-
controller.setFilter({
|
|
295
|
-
global: f.global || undefined,
|
|
296
|
-
columns: Object.fromEntries(
|
|
297
|
-
f.columns.map((c) => [c.id, { operator: c.operator, value: c.value, valueTo: c.valueTo, selectedValues: c.selectedValues }]),
|
|
298
|
-
),
|
|
299
|
-
})}
|
|
300
|
-
onRowClick={(e) => (editing = e.row)}
|
|
301
|
-
onRowSelectionChange={(_sel, rows) => (selected = rows)}
|
|
302
|
-
showPagination
|
|
303
|
-
externalPagination
|
|
304
|
-
rowCount={state.total}
|
|
305
|
-
pageIndex={state.pageIndex}
|
|
306
|
-
pageSize={state.pageSize}
|
|
307
|
-
onPaginationChange={({ pageIndex, pageSize }) => {
|
|
308
|
-
if (pageSize !== state.pageSize) controller.setPageSize(pageSize)
|
|
309
|
-
else controller.setPage(pageIndex)
|
|
310
|
-
}}
|
|
311
|
-
emptyMessage="No ${label} yet"
|
|
312
|
-
containerHeight={480}
|
|
313
|
-
/>
|
|
314
|
-
|
|
315
|
-
{#if editing !== undefined}
|
|
316
|
-
<SvGridEditPanel schema={${constName}} row={editing} ${hasLookups ? 'lookups={lookups} ' : ''}onSubmit={save} onCancel={() => (editing = undefined)} />
|
|
317
|
-
{/if}
|
|
318
|
-
</div>
|
|
319
|
-
|
|
320
|
-
<style>
|
|
321
|
-
.page { display: flex; flex-direction: column; gap: 12px; }
|
|
322
|
-
.page__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
323
|
-
.page__title { margin: 0; font-size: 18px; font-weight: 600; }
|
|
324
|
-
.page__actions { display: flex; gap: 8px; }
|
|
325
|
-
.page__actions button { padding: 7px 12px; border: 1px solid #ccc; border-radius: 6px; background: #fff; cursor: pointer; }
|
|
326
|
-
.page__error { margin: 0; padding: 8px 12px; color: #b3261e; background: #fdecea; border-radius: 6px; }
|
|
327
|
-
</style>
|
|
248
|
+
contents: `<script lang="ts">
|
|
249
|
+
import { SvGrid, createServerDataSource } from '@svgrid/grid'
|
|
250
|
+
import {
|
|
251
|
+
SvGridEditPanel,
|
|
252
|
+
createKitDataSource,${hasLookups ? '\n createRelationLookup,' : ''}
|
|
253
|
+
schemaToColumns,
|
|
254
|
+
type ServerState,
|
|
255
|
+
} from '@svgrid/enterprise'
|
|
256
|
+
import { ${constName}, type ${rowType} } from '${schemaImport}'
|
|
257
|
+
|
|
258
|
+
${managed(pageBody)}
|
|
259
|
+
</script>
|
|
260
|
+
|
|
261
|
+
<svelte:head><style>
|
|
262
|
+
${themeTokenCss({ preset: options.theme, mode: options.dark ? 'dark' : 'light' }, { layer: 'svgrid-studio' })}
|
|
263
|
+
</style></svelte:head>
|
|
264
|
+
|
|
265
|
+
<div class="page">
|
|
266
|
+
<header class="page__toolbar">
|
|
267
|
+
<h2 class="page__title">${label}</h2>
|
|
268
|
+
<div class="page__actions">
|
|
269
|
+
<button onclick={() => (editing = null)}>New</button>
|
|
270
|
+
<button disabled={selected.length === 0} onclick={removeSelected}>
|
|
271
|
+
Delete {selected.length > 0 ? '(' + selected.length + ')' : ''}
|
|
272
|
+
</button>
|
|
273
|
+
</div>
|
|
274
|
+
</header>
|
|
275
|
+
|
|
276
|
+
{#if state.error}<p class="page__error" role="alert">{state.error}</p>{/if}
|
|
277
|
+
|
|
278
|
+
<SvGrid
|
|
279
|
+
data={state.rows}
|
|
280
|
+
{columns}
|
|
281
|
+
loading={state.loading}
|
|
282
|
+
loadingOverlay
|
|
283
|
+
fitColumns
|
|
284
|
+
enableRowSummaries={false}
|
|
285
|
+
showRowSelection
|
|
286
|
+
enableCellSelection
|
|
287
|
+
sortable
|
|
288
|
+
externalSort
|
|
289
|
+
onSortingChange={(s) => controller.setSort(s)}
|
|
290
|
+
filterable
|
|
291
|
+
showGlobalFilter
|
|
292
|
+
externalFilter
|
|
293
|
+
onFiltersChange={(f) =>
|
|
294
|
+
controller.setFilter({
|
|
295
|
+
global: f.global || undefined,
|
|
296
|
+
columns: Object.fromEntries(
|
|
297
|
+
f.columns.map((c) => [c.id, { operator: c.operator, value: c.value, valueTo: c.valueTo, selectedValues: c.selectedValues }]),
|
|
298
|
+
),
|
|
299
|
+
})}
|
|
300
|
+
onRowClick={(e) => (editing = e.row)}
|
|
301
|
+
onRowSelectionChange={(_sel, rows) => (selected = rows)}
|
|
302
|
+
showPagination
|
|
303
|
+
externalPagination
|
|
304
|
+
rowCount={state.total}
|
|
305
|
+
pageIndex={state.pageIndex}
|
|
306
|
+
pageSize={state.pageSize}
|
|
307
|
+
onPaginationChange={({ pageIndex, pageSize }) => {
|
|
308
|
+
if (pageSize !== state.pageSize) controller.setPageSize(pageSize)
|
|
309
|
+
else controller.setPage(pageIndex)
|
|
310
|
+
}}
|
|
311
|
+
emptyMessage="No ${label} yet"
|
|
312
|
+
containerHeight={480}
|
|
313
|
+
/>
|
|
314
|
+
|
|
315
|
+
{#if editing !== undefined}
|
|
316
|
+
<SvGridEditPanel schema={${constName}} row={editing} ${hasLookups ? 'lookups={lookups} ' : ''}onSubmit={save} onCancel={() => (editing = undefined)} />
|
|
317
|
+
{/if}
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<style>
|
|
321
|
+
.page { display: flex; flex-direction: column; gap: 12px; }
|
|
322
|
+
.page__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
323
|
+
.page__title { margin: 0; font-size: 18px; font-weight: 600; }
|
|
324
|
+
.page__actions { display: flex; gap: 8px; }
|
|
325
|
+
.page__actions button { padding: 7px 12px; border: 1px solid #ccc; border-radius: 6px; background: #fff; cursor: pointer; }
|
|
326
|
+
.page__error { margin: 0; padding: 8px 12px; color: #b3261e; background: #fdecea; border-radius: 6px; }
|
|
327
|
+
</style>
|
|
328
328
|
`,
|
|
329
329
|
};
|
|
330
330
|
return { files: [schemaFile, serverFile, pageFile] };
|
|
@@ -82,6 +82,13 @@ export declare const GRID_CURATED_PROPS: ReadonlySet<string>;
|
|
|
82
82
|
/** The Grid's raw prop surface for the "All properties" panel: every extracted SvGrid
|
|
83
83
|
* prop the curated controls do NOT already manage. Sorted by group then label. */
|
|
84
84
|
export declare function gridPropSurface(): UiComponentProp[];
|
|
85
|
+
/** Split the grid's icon catalogue into the picker's display groups, in order,
|
|
86
|
+
* dropping any that came out empty. Takes the names rather than importing them so
|
|
87
|
+
* the studio metadata module stays free of a runtime dependency on the grid. */
|
|
88
|
+
export declare function gridIconGroups<T extends string>(names: readonly T[]): Array<{
|
|
89
|
+
label: string;
|
|
90
|
+
names: T[];
|
|
91
|
+
}>;
|
|
85
92
|
/** The Grid props settable at runtime through `ctx.grid.<prop> = value` (backed by
|
|
86
93
|
* `api.setOption`): the full extracted SvGrid surface minus controller-owned /
|
|
87
94
|
* seed-once props and function/snippet props. Drives the `ctx.grid` type + the code
|
|
@@ -637,6 +637,11 @@ export const GRID_CURATED_PROPS = new Set([
|
|
|
637
637
|
'pageSize', 'pageSizeOptions', 'paginationPosition', 'rowHeight', 'containerHeight',
|
|
638
638
|
'columnVirtualization', 'initialColumnPinning', 'conditionalFormats', 'features', 'editable',
|
|
639
639
|
'enableInlineEditing',
|
|
640
|
+
// The icon picker owns this. The extractor already skips it (a map of snippets is
|
|
641
|
+
// content, not a property), so this is belt and braces - but if snippet handling
|
|
642
|
+
// there ever changes, `icons` must not reappear as a JSON box: the value it would
|
|
643
|
+
// produce is emitted with JSON.stringify and would throw at `{@render}`.
|
|
644
|
+
'icons',
|
|
640
645
|
]);
|
|
641
646
|
/** The Grid's raw prop surface for the "All properties" panel: every extracted SvGrid
|
|
642
647
|
* prop the curated controls do NOT already manage. Sorted by group then label. */
|
|
@@ -650,6 +655,36 @@ export function gridPropSurface() {
|
|
|
650
655
|
.map((p) => ({ ...p }))
|
|
651
656
|
.sort((a, b) => (order[a.group ?? 'common'] - order[b.group ?? 'common']) || a.label.localeCompare(b.label));
|
|
652
657
|
}
|
|
658
|
+
// --- Grid icons: how the picker groups the catalogue ------------------------
|
|
659
|
+
// SvGrid names ~50 chrome glyphs and `icons` replaces any subset, which is far too
|
|
660
|
+
// long a list to show flat. Array order is BOTH the matching order (each name takes
|
|
661
|
+
// the first rule that accepts it) and the order the picker shows the groups in, so
|
|
662
|
+
// the header icons people actually reach for - sort, filter, the column menu - come
|
|
663
|
+
// first rather than falling out of a catch-all at the bottom.
|
|
664
|
+
//
|
|
665
|
+
// 'Other' is the catch-all and is expected to stay empty: a glyph added to the
|
|
666
|
+
// catalogue still shows up there rather than vanishing from the picker, but the
|
|
667
|
+
// guardrail test fails so someone gives it a real home.
|
|
668
|
+
const GRID_ICON_GROUP_RULES = [
|
|
669
|
+
{ label: 'Header + column menu', match: (n) => ['sort', 'sort-asc', 'sort-desc', 'filter', 'menu', 'chevron-down', 'chevron-right', 'autosize', 'columns', 'reset'].includes(n) },
|
|
670
|
+
{ label: 'Filter operators', match: (n) => n.startsWith('op-') },
|
|
671
|
+
{ label: 'Pinning', match: (n) => n === 'pin-left' || n === 'pin-right' || n === 'unpin' },
|
|
672
|
+
{ label: 'Rows + grouping', match: (n) => ['group', 'group-add', 'row-number', 'pinned-row-top', 'pinned-row-bottom', 'drag-handle', 'breadcrumb-separator'].includes(n) },
|
|
673
|
+
{ label: 'Toolbar + overlays', match: (n) => ['search', 'tool-panel', 'chart', 'advanced-filter', 'column-group-caret'].includes(n) },
|
|
674
|
+
{ label: 'Pager', match: (n) => n.startsWith('page-') },
|
|
675
|
+
{ label: 'Find + move', match: (n) => n.startsWith('find-') || n.startsWith('move-') },
|
|
676
|
+
{ label: 'Close + clear', match: (n) => ['x', 'close', 'clear', 'remove'].includes(n) },
|
|
677
|
+
{ label: 'Other', match: () => true },
|
|
678
|
+
];
|
|
679
|
+
/** Split the grid's icon catalogue into the picker's display groups, in order,
|
|
680
|
+
* dropping any that came out empty. Takes the names rather than importing them so
|
|
681
|
+
* the studio metadata module stays free of a runtime dependency on the grid. */
|
|
682
|
+
export function gridIconGroups(names) {
|
|
683
|
+
return GRID_ICON_GROUP_RULES.map((rule, i) => ({
|
|
684
|
+
label: rule.label,
|
|
685
|
+
names: names.filter((n) => GRID_ICON_GROUP_RULES.findIndex((c) => c.match(n)) === i),
|
|
686
|
+
})).filter((g) => g.names.length);
|
|
687
|
+
}
|
|
653
688
|
// Props NOT offered on `ctx.grid` as runtime-settable options: structural data,
|
|
654
689
|
// controller-owned plumbing, and seed-once `initial*` props (the grid reads those at
|
|
655
690
|
// mount, so `setOption` on them is a no-op - excluding them keeps intellisense honest).
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* and prototyping a schema before a database exists behind it.
|
|
7
7
|
*/
|
|
8
8
|
import type { RowData } from '@svgrid/grid';
|
|
9
|
-
import { type EntitySchema } from '../schema';
|
|
10
|
-
import type { WritableDataSource } from './types';
|
|
11
|
-
import { type AggregateSource } from '../sources/aggregate';
|
|
9
|
+
import { type EntitySchema } from '../schema.js';
|
|
10
|
+
import type { WritableDataSource } from './types.js';
|
|
11
|
+
import { type AggregateSource } from '../sources/aggregate.js';
|
|
12
12
|
export declare function createInMemoryDataSource<TData extends RowData>(initial: ReadonlyArray<TData>, schema: EntitySchema<TData>): WritableDataSource<TData> & AggregateSource & {
|
|
13
13
|
rows(): ReadonlyArray<TData>;
|
|
14
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { resolveIdField } from '../schema';
|
|
2
|
-
import { planQuery } from './query-plan';
|
|
3
|
-
import { compilePredicate } from '../expressions/compile';
|
|
4
|
-
import { aggregateRows } from '../sources/aggregate';
|
|
1
|
+
import { resolveIdField } from '../schema.js';
|
|
2
|
+
import { planQuery } from './query-plan.js';
|
|
3
|
+
import { compilePredicate } from '../expressions/compile.js';
|
|
4
|
+
import { aggregateRows } from '../sources/aggregate.js';
|
|
5
5
|
function asString(v) {
|
|
6
6
|
return v == null ? '' : String(v);
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { planQuery, coerce, type QueryPlan, type PlanPredicate, type PlanOp, } from './query-plan';
|
|
2
|
-
export { createInMemoryDataSource } from './in-memory';
|
|
3
|
-
export { createKitDataSource, createKitHandlers, type KitDataSourceOptions, type KitHandlerOptions, type KitScope, type KitHandlers, type KitMessage, } from './transport';
|
|
4
|
-
export { planToSql, type SqlDialect, type SqlPlan } from './sql';
|
|
5
|
-
export { createSqlDataSource, type SqlExecutor, type SqlDataSourceConfig, } from './sql-source';
|
|
6
|
-
export type { WritableDataSource } from './types';
|
|
1
|
+
export { planQuery, coerce, type QueryPlan, type PlanPredicate, type PlanOp, } from './query-plan.js';
|
|
2
|
+
export { createInMemoryDataSource } from './in-memory.js';
|
|
3
|
+
export { createKitDataSource, createKitHandlers, type KitDataSourceOptions, type KitHandlerOptions, type KitScope, type KitHandlers, type KitMessage, } from './transport.js';
|
|
4
|
+
export { planToSql, type SqlDialect, type SqlPlan } from './sql.js';
|
|
5
|
+
export { createSqlDataSource, type SqlExecutor, type SqlDataSourceConfig, } from './sql-source.js';
|
|
6
|
+
export type { WritableDataSource } from './types.js';
|
package/dist/sveltekit/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { planQuery, coerce, } from './query-plan';
|
|
2
|
-
export { createInMemoryDataSource } from './in-memory';
|
|
3
|
-
export { createKitDataSource, createKitHandlers, } from './transport';
|
|
4
|
-
export { planToSql } from './sql';
|
|
5
|
-
export { createSqlDataSource, } from './sql-source';
|
|
1
|
+
export { planQuery, coerce, } from './query-plan.js';
|
|
2
|
+
export { createInMemoryDataSource } from './in-memory.js';
|
|
3
|
+
export { createKitDataSource, createKitHandlers, } from './transport.js';
|
|
4
|
+
export { planToSql } from './sql.js';
|
|
5
|
+
export { createSqlDataSource, } from './sql-source.js';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* arbitrary identifiers through to SQL.
|
|
12
12
|
*/
|
|
13
13
|
import type { GridPredicateExpr, RowData, ServerRequest } from '@svgrid/grid';
|
|
14
|
-
import type { EntityFieldType, EntitySchema } from '../schema';
|
|
14
|
+
import type { EntityFieldType, EntitySchema } from '../schema.js';
|
|
15
15
|
/** Normalized predicate operators (a stable superset of the grid's filter operators). */
|
|
16
16
|
export type PlanOp = 'eq' | 'contains' | 'startsWith' | 'gt' | 'lt' | 'between' | 'isBlank' | 'in';
|
|
17
17
|
export type PlanPredicate = {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
* })
|
|
23
23
|
*/
|
|
24
24
|
import type { RowData } from '@svgrid/grid';
|
|
25
|
-
import { type EntitySchema } from '../schema';
|
|
26
|
-
import { type SqlDialect } from './sql';
|
|
27
|
-
import type { WritableDataSource } from './types';
|
|
28
|
-
import type { AggregateSource } from '../sources/aggregate';
|
|
25
|
+
import { type EntitySchema } from '../schema.js';
|
|
26
|
+
import { type SqlDialect } from './sql.js';
|
|
27
|
+
import type { WritableDataSource } from './types.js';
|
|
28
|
+
import type { AggregateSource } from '../sources/aggregate.js';
|
|
29
29
|
/** Run a parameterized query, resolving to the result rows. */
|
|
30
30
|
export type SqlExecutor = (sql: string, params: unknown[]) => Promise<ReadonlyArray<Record<string, unknown>>>;
|
|
31
31
|
export type SqlDataSourceConfig<TData extends RowData> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { resolveIdField } from '../schema';
|
|
2
|
-
import { nudgeEnterprise } from '../license';
|
|
3
|
-
import { planQuery } from './query-plan';
|
|
4
|
-
import { planToSql } from './sql';
|
|
1
|
+
import { resolveIdField } from '../schema.js';
|
|
2
|
+
import { nudgeEnterprise } from '../license.js';
|
|
3
|
+
import { planQuery } from './query-plan.js';
|
|
4
|
+
import { planToSql } from './sql.js';
|
|
5
5
|
const SQL_AGG = { sum: 'SUM', avg: 'AVG', min: 'MIN', max: 'MAX' };
|
|
6
6
|
function quoter(dialect) {
|
|
7
7
|
const q = dialect.quote ?? '"';
|
package/dist/sveltekit/sql.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* (Or map `plan.where` to Drizzle operators directly - the plan is the seam
|
|
22
22
|
* either way.)
|
|
23
23
|
*/
|
|
24
|
-
import type { QueryPlan } from './query-plan';
|
|
24
|
+
import type { QueryPlan } from './query-plan.js';
|
|
25
25
|
export type SqlDialect = {
|
|
26
26
|
/** Identifier quote char. Default `"` (ANSI / Postgres / SQLite). MySQL: `` ` ``. */
|
|
27
27
|
quote?: string;
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* const controller = createServerDataSource(source, { onChange: ... })
|
|
25
25
|
*/
|
|
26
26
|
import type { RowData, ServerDataSource, ServerRequest } from '@svgrid/grid';
|
|
27
|
-
import type { EntitySchema } from '../schema';
|
|
28
|
-
import type { WritableDataSource } from './types';
|
|
27
|
+
import type { EntitySchema } from '../schema.js';
|
|
28
|
+
import type { WritableDataSource } from './types.js';
|
|
29
29
|
/** Wire protocol: the single JSON body shape the client POSTs and the server dispatches on. */
|
|
30
30
|
export type KitMessage<TData> = {
|
|
31
31
|
kind: 'query';
|
package/dist/upgrade-prompt.js
CHANGED
|
@@ -96,34 +96,34 @@ function buildCard(feature, expired = false) {
|
|
|
96
96
|
const badge = expired ? 'TRIAL ENDED' : 'PRO';
|
|
97
97
|
const heading = expired ? 'Your trial has ended' : 'Unlock SvGrid Pro';
|
|
98
98
|
const body = expired
|
|
99
|
-
? `${featurePhrase} Your evaluation period is over - everything still works,
|
|
99
|
+
? `${featurePhrase} Your evaluation period is over - everything still works,
|
|
100
100
|
but this notice stays until a licence key is set.`
|
|
101
|
-
: `${featurePhrase} It runs in evaluation with a watermark - start a free trial
|
|
101
|
+
: `${featurePhrase} It runs in evaluation with a watermark - start a free trial
|
|
102
102
|
to remove it and ship to production.`;
|
|
103
103
|
const cta = expired ? 'Buy a licence' : 'Start free trial';
|
|
104
|
-
card.innerHTML = `
|
|
105
|
-
<button type="button" data-act="x" aria-label="Dismiss"
|
|
106
|
-
style="position:absolute;top:8px;right:8px;width:24px;height:24px;display:flex;
|
|
107
|
-
align-items:center;justify-content:center;background:transparent;border:0;
|
|
108
|
-
color:#94a3b8;font-size:18px;line-height:1;cursor:pointer;border-radius:6px;">×</button>
|
|
109
|
-
<div style="display:flex;align-items:center;gap:8px;margin-bottom:8px;">
|
|
110
|
-
<span style="display:inline-block;background:${expired ? '#b45309' : '#4f46e5'};color:#fff;font-size:10px;
|
|
111
|
-
font-weight:700;letter-spacing:0.06em;padding:2px 7px;border-radius:999px;">${badge}</span>
|
|
112
|
-
<span style="font-weight:700;color:#fff;">${heading}</span>
|
|
113
|
-
</div>
|
|
114
|
-
<p style="margin:0 0 12px;color:#cbd5e1;">
|
|
115
|
-
${body}
|
|
116
|
-
</p>
|
|
117
|
-
<div style="display:flex;gap:8px;align-items:center;">
|
|
118
|
-
<a data-act="trial" href="${TRIAL_URL}" target="_blank" rel="noopener noreferrer"
|
|
119
|
-
style="flex:1;text-align:center;background:#6366f1;color:#fff;font-weight:600;
|
|
120
|
-
text-decoration:none;padding:8px 12px;border-radius:8px;">${cta}</a>
|
|
121
|
-
<a data-act="pricing" href="${PRICING_URL}" target="_blank" rel="noopener noreferrer"
|
|
122
|
-
style="color:#a5b4fc;text-decoration:none;padding:8px 6px;font-weight:600;">Pricing</a>
|
|
123
|
-
</div>
|
|
124
|
-
<p style="margin:10px 0 0;font-size:11px;color:#64748b;">
|
|
125
|
-
Already licensed? Call <code style="color:#94a3b8;">setLicenseKey()</code> at startup to hide this.
|
|
126
|
-
</p>
|
|
104
|
+
card.innerHTML = `
|
|
105
|
+
<button type="button" data-act="x" aria-label="Dismiss"
|
|
106
|
+
style="position:absolute;top:8px;right:8px;width:24px;height:24px;display:flex;
|
|
107
|
+
align-items:center;justify-content:center;background:transparent;border:0;
|
|
108
|
+
color:#94a3b8;font-size:18px;line-height:1;cursor:pointer;border-radius:6px;">×</button>
|
|
109
|
+
<div style="display:flex;align-items:center;gap:8px;margin-bottom:8px;">
|
|
110
|
+
<span style="display:inline-block;background:${expired ? '#b45309' : '#4f46e5'};color:#fff;font-size:10px;
|
|
111
|
+
font-weight:700;letter-spacing:0.06em;padding:2px 7px;border-radius:999px;">${badge}</span>
|
|
112
|
+
<span style="font-weight:700;color:#fff;">${heading}</span>
|
|
113
|
+
</div>
|
|
114
|
+
<p style="margin:0 0 12px;color:#cbd5e1;">
|
|
115
|
+
${body}
|
|
116
|
+
</p>
|
|
117
|
+
<div style="display:flex;gap:8px;align-items:center;">
|
|
118
|
+
<a data-act="trial" href="${TRIAL_URL}" target="_blank" rel="noopener noreferrer"
|
|
119
|
+
style="flex:1;text-align:center;background:#6366f1;color:#fff;font-weight:600;
|
|
120
|
+
text-decoration:none;padding:8px 12px;border-radius:8px;">${cta}</a>
|
|
121
|
+
<a data-act="pricing" href="${PRICING_URL}" target="_blank" rel="noopener noreferrer"
|
|
122
|
+
style="color:#a5b4fc;text-decoration:none;padding:8px 6px;font-weight:600;">Pricing</a>
|
|
123
|
+
</div>
|
|
124
|
+
<p style="margin:10px 0 0;font-size:11px;color:#64748b;">
|
|
125
|
+
Already licensed? Call <code style="color:#94a3b8;">setLicenseKey()</code> at startup to hide this.
|
|
126
|
+
</p>
|
|
127
127
|
`;
|
|
128
128
|
card.querySelector('[data-act="x"]')?.addEventListener('click', () => close(card));
|
|
129
129
|
// Clicking through to a trial / pricing also counts as "handled" - close the
|
package/package.json
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
"type": "commercial",
|
|
5
5
|
"url": "https://svgrid.com/pricing"
|
|
6
6
|
},
|
|
7
|
-
"version": "3.0.
|
|
7
|
+
"version": "3.0.1",
|
|
8
8
|
"description": "Enterprise feature pack for SvGrid: Excel (xlsx) and PDF export, Excel/CSV/JSON import, pivot tables with a drag-and-drop designer, paginated print, Kanban board and scheduler renderers, no-code alerts and batch editing. CSV, TSV and JSON export are already free in @svgrid/grid. Requires a paid license key.",
|
|
9
9
|
"license": "SEE LICENSE IN LICENSE",
|
|
10
10
|
"author": "jQWidgets <sales@jqwidgets.com>",
|
|
11
11
|
"homepage": "https://svgrid.com/pricing",
|
|
12
12
|
"type": "module",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
13
16
|
"types": "./dist/index.d.ts",
|
|
14
17
|
"module": "./dist/index.js",
|
|
15
18
|
"svelte": "./dist/index.js",
|
|
@@ -70,7 +73,7 @@
|
|
|
70
73
|
"jszip": "^3.10.0",
|
|
71
74
|
"pdfmake": "^0.2.0",
|
|
72
75
|
"svelte": "^5.0.0",
|
|
73
|
-
"@svgrid/grid": "^3.0.
|
|
76
|
+
"@svgrid/grid": "^3.0.3"
|
|
74
77
|
},
|
|
75
78
|
"peerDependenciesMeta": {
|
|
76
79
|
"jszip": {
|
|
@@ -88,7 +91,7 @@
|
|
|
88
91
|
"svelte": "^5.55.5",
|
|
89
92
|
"typescript": "6.0.3",
|
|
90
93
|
"vite": "^8.2.1",
|
|
91
|
-
"@svgrid/grid": "^3.0.
|
|
94
|
+
"@svgrid/grid": "^3.0.3"
|
|
92
95
|
},
|
|
93
96
|
"repository": {
|
|
94
97
|
"type": "git",
|