@object-ui/fields 11.4.0 → 13.1.0

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/index.d.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  import { FieldMetadata } from '@object-ui/types';
3
3
  import { resolveFieldCurrency } from './currency';
4
+ /**
5
+ * Pick the most reasonable display name from an arbitrary record object.
6
+ * Tries common name-like keys in priority order, then falls back to undefined.
7
+ */
8
+ export declare function pickRecordDisplayName(record: Record<string, unknown> | null | undefined, preferredField?: string): string | undefined;
4
9
  /**
5
10
  * Heuristic: detect strings that look like opaque foreign-key IDs (e.g. nanoid
6
11
  * or BSON ObjectId). Used so we don't display random gibberish to users when
@@ -54,12 +59,20 @@ export declare function formatPercent(value: number, precision?: number): string
54
59
  export declare function humanizeLabel(value: string): string;
55
60
  /**
56
61
  * Format date as relative time (e.g., "2 days ago", "Today", "Overdue 3d")
62
+ *
63
+ * `dueLike` gates the "Overdue" wording — a past `start_date`/`created_at`
64
+ * isn't overdue, only a past due/deadline-semantic field is. Non-due-like
65
+ * past dates render as "Nd ago" instead.
57
66
  */
58
- export declare function formatRelativeDate(value: string | Date | number): string;
67
+ export declare function formatRelativeDate(value: string | Date | number, options?: {
68
+ dueLike?: boolean;
69
+ }): string;
59
70
  /**
60
71
  * Format date value
61
72
  */
62
- export declare function formatDate(value: string | Date | number, style?: string): string;
73
+ export declare function formatDate(value: string | Date | number, style?: string, options?: {
74
+ dueLike?: boolean;
75
+ }): string;
63
76
  /**
64
77
  * Format datetime value
65
78
  */