@standardbeagle/edit-db 0.4.449 → 0.4.450

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.
@@ -21,9 +21,28 @@ import { Column } from '../types/schema';
21
21
  * precise underlying data.
22
22
  */
23
23
  export declare const DISPLAY_FORMAT_KEY = "display-format";
24
+ /**
25
+ * Secondary, context-specific format template (used by compact surfaces like FK
26
+ * preview popovers). When a column doesn't set it, formatting falls back to the
27
+ * main `display-format`, so the preview matches the grid by default.
28
+ */
29
+ export declare const DISPLAY_FORMAT_PREVIEW_KEY = "display-format-preview";
24
30
  export type DisplayFormat = 'date' | 'datetime' | 'time' | 'relative' | 'number' | 'percent' | 'raw';
25
- /** Resolve the effective format: explicit metadata wins, else inferred from type. */
26
- export declare function resolveDisplayFormat(column: Column): DisplayFormat | null;
31
+ /** Options for {@link formatColumnValue}. */
32
+ export interface FormatOptions {
33
+ /**
34
+ * Metadata key to read the format from before falling back to the main
35
+ * `display-format`. Lets a context override the template while defaulting to
36
+ * the main one when the column doesn't set the override key.
37
+ */
38
+ formatKey?: string;
39
+ }
40
+ /**
41
+ * Resolve the effective format: an explicit override key wins, then the main
42
+ * `display-format` metadata, else inferred from the column type. Passing
43
+ * `formatKey` lets a context default to the main template when its own is unset.
44
+ */
45
+ export declare function resolveDisplayFormat(column: Column, formatKey?: string): DisplayFormat | null;
27
46
  /** "4 hours ago" / "in 3 days" via Intl.RelativeTimeFormat. */
28
47
  export declare function formatRelative(date: Date, now?: Date): string;
29
48
  /**
@@ -31,4 +50,4 @@ export declare function formatRelative(date: Date, now?: Date): string;
31
50
  * placeholder for null/empty, a locale-formatted node for known formats (with a
32
51
  * `title` revealing the exact value), or the plain string otherwise.
33
52
  */
34
- export declare function formatColumnValue(value: unknown, column: Column): ReactNode;
53
+ export declare function formatColumnValue(value: unknown, column: Column, options?: FormatOptions): ReactNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@standardbeagle/edit-db",
3
3
  "private": false,
4
- "version": "0.4.449",
4
+ "version": "0.4.450",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@radix-ui/react-slot": "^1.2.4",