@standardbeagle/edit-db 0.4.590 → 0.4.685

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.
@@ -10,4 +10,4 @@ import { ExportFormat, ExportResult } from '../lib/export';
10
10
  * <see cref="DEFAULT_ROW_CAP"/> bounds the drain; the result reports
11
11
  * `truncated` so the caller can warn instead of silently shipping a partial file.
12
12
  */
13
- export declare function useTableExport(): (table: Table, format: ExportFormat) => Promise<ExportResult>;
13
+ export declare function useTableExport(): (table: Table, format: ExportFormat, signal?: AbortSignal) => Promise<ExportResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -26,6 +26,8 @@ export declare const UTF8_BOM = "\uFEFF";
26
26
  * `null`/`undefined` become a bare empty field; an empty string becomes a
27
27
  * quoted empty pair (`""`) so the two stay distinguishable in the output bytes.
28
28
  * bigint and Date get exact/stable string forms; objects are JSON-encoded.
29
+ * String values that would execute as a spreadsheet formula are prefixed with
30
+ * an apostrophe.
29
31
  */
30
32
  export declare function formatCsvCell(value: unknown): string;
31
33
  export interface CsvOptions {
@@ -62,8 +64,12 @@ export interface ExportAllOptions {
62
64
  * Pull one page at the given offset. This is the ONLY data seam — the caller
63
65
  * closes over the existing fetcher/query-builder so the current filters and
64
66
  * sort are honored, and no new HTTP client is introduced.
67
+ *
68
+ * The abort signal is passed to the seam on every page — not left for each
69
+ * call site to close over — so cancelling reaches the IN-FLIGHT request,
70
+ * not just the loop's next iteration.
65
71
  */
66
- fetchPage: (offset: number, limit: number) => Promise<ExportPage>;
72
+ fetchPage: (offset: number, limit: number, signal: AbortSignal | undefined) => Promise<ExportPage>;
67
73
  /** Page size for each fetch. Default 500. */
68
74
  pageSize?: number;
69
75
  /** Hard stop after this many rows; the result is marked `truncated`. */
@@ -45,10 +45,19 @@ export interface FormatOptions {
45
45
  export declare function resolveDisplayFormat(column: Column, formatKey?: string): DisplayFormat | null;
46
46
  /** "4 hours ago" / "in 3 days" via Intl.RelativeTimeFormat. */
47
47
  export declare function formatRelative(date: Date, now?: Date): string;
48
+ /**
49
+ * Display labels for an enum column, or null when it has none that can be
50
+ * trusted. `enum-labels` are positional against `enum-values`, so a count
51
+ * mismatch would mislabel every value; it is treated as no labels at all.
52
+ */
53
+ export declare function usableEnumLabels(column: Column): string[] | null;
54
+ /** The label for one enum value, or null when the column has no usable labels or the value is not one of them. */
55
+ export declare function enumLabelFor(value: unknown, column: Column): string | null;
48
56
  /**
49
57
  * Format a scalar value for display, given its column. Returns a muted
50
- * placeholder for null/empty, a locale-formatted node for known formats (with a
51
- * `title` revealing the exact value), or the plain string otherwise.
58
+ * placeholder for null/empty, the enum label for a labelled enum value (with
59
+ * the stored value in `title`), a locale-formatted node for known formats (with
60
+ * a `title` revealing the exact value), or the plain string otherwise.
52
61
  */
53
62
  export declare function formatColumnValue(value: unknown, column: Column, options?: FormatOptions): ReactNode;
54
63
  /**
@@ -38,6 +38,17 @@ interface RowData {
38
38
  }
39
39
  export declare function isGraphQlName(value: unknown): value is string;
40
40
  export declare function assertGraphQlName(value: unknown, kind: string): asserts value is string;
41
+ /**
42
+ * The single producer of a table's generated filter input type name.
43
+ *
44
+ * The server names it `TableFilter<graphQlName>Input`
45
+ * (DbTable.TableFilterTypeName, src/BifrostQL.Core/Model/DbTable.cs). Spelling
46
+ * it inline invites the `<graphQlName>Filter` guess, which parses fine and then
47
+ * fails server-side with "Unknown type '<graphQlName>Filter'." on every
48
+ * FILTERED request while the unfiltered path keeps working. Every builder that
49
+ * declares a `$filter` variable calls this, so the two sides cannot drift.
50
+ */
51
+ export declare function tableFilterTypeName(table: Table): string;
41
52
  export declare function getFilterOperators(paramType: string): string[];
42
53
  /**
43
54
  * Parses the header filter (a JSON `[column, operator, value, type]` tuple carried
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@standardbeagle/edit-db",
3
3
  "private": false,
4
- "version": "0.4.590",
4
+ "version": "0.4.685",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@radix-ui/react-slot": "^1.2.4",
@@ -39,7 +39,7 @@
39
39
  "storybook": "^10.4.1",
40
40
  "tailwindcss": "^4.3.0",
41
41
  "typescript": "^5.9.3",
42
- "vite": "^7.3.6",
42
+ "vite": "^8.2.2",
43
43
  "vite-plugin-dts": "^4.5.4",
44
44
  "vitest": "^4.1.8"
45
45
  },