@object-ui/fields 14.0.0 → 14.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
@@ -57,22 +57,29 @@ export declare function formatPercent(value: number, precision?: number): string
57
57
  * "active" → "Active"
58
58
  */
59
59
  export declare function humanizeLabel(value: string): string;
60
+ /** Options shared by {@link formatDate} / {@link formatRelativeDate}. */
61
+ export interface DateDisplayOptions {
62
+ dueLike?: boolean;
63
+ /** BCP-47 display locale (ADR-0053 tenant default); falls back to the runtime locale. */
64
+ locale?: string;
65
+ /** i18n translate fn for phrases `Intl` can't produce (the "Overdue Nd" wording). */
66
+ t?: (key: string, params?: Record<string, unknown>) => string;
67
+ }
60
68
  /**
61
- * Format date as relative time (e.g., "2 days ago", "Today", "Overdue 3d")
69
+ * Format date as relative time (e.g., "3 days ago", "Today", "Overdue 3d"),
70
+ * localized via `Intl.RelativeTimeFormat` (objectstack-ai/framework#3040).
62
71
  *
63
72
  * `dueLike` gates the "Overdue" wording — a past `start_date`/`created_at`
64
73
  * isn't overdue, only a past due/deadline-semantic field is. Non-due-like
65
- * past dates render as "Nd ago" instead.
74
+ * past dates render as plain "N days ago" instead. The overdue phrase has no
75
+ * `Intl` equivalent, so it resolves through `options.t` (key
76
+ * `fields.relativeDate.overdue`) with an English fallback.
66
77
  */
67
- export declare function formatRelativeDate(value: string | Date | number, options?: {
68
- dueLike?: boolean;
69
- }): string;
78
+ export declare function formatRelativeDate(value: string | Date | number, options?: DateDisplayOptions): string;
70
79
  /**
71
80
  * Format date value
72
81
  */
73
- export declare function formatDate(value: string | Date | number, style?: string, options?: {
74
- dueLike?: boolean;
75
- }): string;
82
+ export declare function formatDate(value: string | Date | number, style?: string, options?: DateDisplayOptions): string;
76
83
  /**
77
84
  * Format datetime value
78
85
  */
@@ -167,6 +174,11 @@ export declare function ImageCellRenderer({ value }: CellRendererProps): React.R
167
174
  * 3. Fetch-on-demand: when the value is a primitive ID and `field.reference_to`
168
175
  * is known, resolve via dataSource and show the related record's display name.
169
176
  * Falls back to a muted placeholder while pending and on failure.
177
+ *
178
+ * Record → name resolution (1 and 3) goes through the referenced object's
179
+ * schema when the data source exposes it (`displayField` → nameField/titleFormat
180
+ * → derivation, see {@link resolveLookupRecordName}), so the chip and the
181
+ * picker agree (issue #2357).
170
182
  */
171
183
  export declare function LookupCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
172
184
  /**