@svgrid/enterprise 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExpressionEditorHarness.svelte +47 -0
- package/dist/ExpressionEditorHarness.svelte.d.ts +15 -0
- package/dist/SvAdvancedFilter.svelte +208 -0
- package/dist/SvAdvancedFilter.svelte.d.ts +37 -0
- package/dist/SvExpressionEditor.svelte +251 -123
- package/dist/SvGridEditPanel.svelte +1157 -1157
- package/dist/advanced-filter/expr-columns-from-grid.d.ts +30 -0
- package/dist/advanced-filter/expr-columns-from-grid.js +44 -0
- package/dist/advanced-filter-enable.d.ts +5 -0
- package/dist/advanced-filter-enable.js +35 -0
- package/dist/cdn/svgrid-enterprise.svelte-external.js +8274 -7706
- package/dist/designer/assets/GridMenus-Bjr19Tz_.js +7 -0
- package/dist/designer/assets/{SvListBox-BVzVfCG3.js → SvListBox-BB8rt4aP.js} +1 -1
- package/dist/designer/assets/{index-CKdwDseq.js → index-xjfKckuH.js} +43 -43
- package/dist/designer/assets/{js-scroller.svelte-tHanKJx0.js → js-scroller.svelte-CGkUUXwV.js} +2 -2
- package/dist/designer/assets/src-BT3LjWJL.css +1 -0
- package/dist/designer/assets/src-DDhAK0WP.js +2893 -0
- package/dist/designer/index.html +5 -5
- package/dist/expressions/builder-tree.d.ts +62 -0
- package/dist/expressions/builder-tree.js +133 -0
- package/dist/expressions/compile.d.ts +14 -0
- package/dist/expressions/compile.js +286 -0
- package/dist/expressions/expression-columns.d.ts +1 -11
- package/dist/expressions/expression-columns.js +40 -11
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/install.js +2 -0
- package/dist/node/studio.js +61 -13
- package/dist/sources/rest.js +25 -0
- package/dist/sources/supabase.js +49 -3
- package/dist/studio/emit-project.js +2125 -2125
- package/dist/studio/ui-components.generated.js +33 -0
- package/dist/sveltekit/in-memory.js +96 -3
- package/dist/sveltekit/query-plan.d.ts +32 -1
- package/dist/sveltekit/query-plan.js +88 -1
- package/dist/sveltekit/sql.d.ts +20 -0
- package/dist/sveltekit/sql.js +26 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/designer/assets/GridMenus-CW-rnHS9.js +0 -7
- package/dist/designer/assets/src-DCKhP5Xy.css +0 -1
- package/dist/designer/assets/src-DLsSdh3J.js +0 -2893
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive the expression layer's column metadata from a live grid.
|
|
3
|
+
*
|
|
4
|
+
* Saves every consumer from hand-writing an `ExprColumn[]` that mirrors their
|
|
5
|
+
* column defs and then drifting from it.
|
|
6
|
+
*/
|
|
7
|
+
import type { ExprColumn } from '../expressions/expression-columns';
|
|
8
|
+
/** Grid columns as `api.getColumns()` reports them. */
|
|
9
|
+
type GridColumnInfo = {
|
|
10
|
+
id: string;
|
|
11
|
+
field?: string;
|
|
12
|
+
header: string;
|
|
13
|
+
visible: boolean;
|
|
14
|
+
editorType?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ExprColumnsOptions = {
|
|
17
|
+
/** Include columns currently hidden by the user. Default false. */
|
|
18
|
+
includeHidden?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Build `ExprColumn[]` from a grid API.
|
|
22
|
+
*
|
|
23
|
+
* Typed loosely on purpose: `SvGridApi` is generic over features and row type,
|
|
24
|
+
* and this only needs `getColumns()`. Taking the concrete generic here would
|
|
25
|
+
* force every caller to thread both parameters through for no benefit.
|
|
26
|
+
*/
|
|
27
|
+
export declare function exprColumnsFromGrid(api: {
|
|
28
|
+
getColumns(): ReadonlyArray<GridColumnInfo>;
|
|
29
|
+
}, options?: ExprColumnsOptions): ExprColumn[];
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Columns the grid renders but a user cannot meaningfully filter on. These are
|
|
3
|
+
* structural (a checkbox gutter, a row-number gutter) rather than data.
|
|
4
|
+
*/
|
|
5
|
+
const NON_DATA_IDS = new Set(['__select', '__selection', '__rowNumber', '__autoGroup', '__actions']);
|
|
6
|
+
/** Map a grid editorType onto the coarse type the operator catalogue uses. */
|
|
7
|
+
function toExprType(editorType) {
|
|
8
|
+
switch (editorType) {
|
|
9
|
+
case 'number':
|
|
10
|
+
return 'number';
|
|
11
|
+
case 'date':
|
|
12
|
+
return 'date';
|
|
13
|
+
case 'datetime':
|
|
14
|
+
return 'datetime';
|
|
15
|
+
case 'checkbox':
|
|
16
|
+
return 'boolean';
|
|
17
|
+
default:
|
|
18
|
+
return 'text';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build `ExprColumn[]` from a grid API.
|
|
23
|
+
*
|
|
24
|
+
* Typed loosely on purpose: `SvGridApi` is generic over features and row type,
|
|
25
|
+
* and this only needs `getColumns()`. Taking the concrete generic here would
|
|
26
|
+
* force every caller to thread both parameters through for no benefit.
|
|
27
|
+
*/
|
|
28
|
+
export function exprColumnsFromGrid(api, options = {}) {
|
|
29
|
+
const out = [];
|
|
30
|
+
for (const col of api.getColumns()) {
|
|
31
|
+
if (NON_DATA_IDS.has(col.id))
|
|
32
|
+
continue;
|
|
33
|
+
if (!options.includeHidden && !col.visible)
|
|
34
|
+
continue;
|
|
35
|
+
out.push({
|
|
36
|
+
id: col.id,
|
|
37
|
+
// Fall back to the id so a column with no header is still addressable
|
|
38
|
+
// in the `[Bracketed Name]` reference syntax.
|
|
39
|
+
name: col.header || col.id,
|
|
40
|
+
type: toExprType(col.editorType),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced Filter (Pro): register the expression compiler with the grid.
|
|
3
|
+
*
|
|
4
|
+
* Same shape as `pivot-enable.ts` - idempotent flag, register, soft-gate nudge.
|
|
5
|
+
* The grid owns the filter state and the pipeline slot; this supplies the
|
|
6
|
+
* compiler that turns an expression into a row predicate.
|
|
7
|
+
*/
|
|
8
|
+
import { registerAdvancedFilterEngine } from '@svgrid/grid';
|
|
9
|
+
import { isLicenseKeySet } from './license';
|
|
10
|
+
import { emitUnlicensedNudge } from './watermark';
|
|
11
|
+
import { compilePredicate } from './expressions/compile';
|
|
12
|
+
let enabled = false;
|
|
13
|
+
const advancedFilterEngine = (expr, ctx) => {
|
|
14
|
+
// The grid treats null as "do not filter" and never surfaces a partially
|
|
15
|
+
// applied predicate, so swallowing here is safe and is the fail-open half of
|
|
16
|
+
// the contract documented on AdvancedFilterEngine.
|
|
17
|
+
try {
|
|
18
|
+
return compilePredicate(expr, ctx);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Enable the advanced filter. Call once (installEnterprise does it for you),
|
|
26
|
+
* after which `api.setAdvancedFilter(expr)` actually filters rows.
|
|
27
|
+
*/
|
|
28
|
+
export function enableAdvancedFilter() {
|
|
29
|
+
if (enabled)
|
|
30
|
+
return;
|
|
31
|
+
enabled = true;
|
|
32
|
+
registerAdvancedFilterEngine(advancedFilterEngine);
|
|
33
|
+
if (!isLicenseKeySet())
|
|
34
|
+
emitUnlicensedNudge();
|
|
35
|
+
}
|