@object-ui/fields 16.1.0 → 17.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +432 -0
  2. package/dist/FieldEditWidget.d.ts +7 -0
  3. package/dist/field-type-alias.d.ts +16 -0
  4. package/dist/index.cjs +5 -5
  5. package/dist/index.d.ts +14 -11
  6. package/dist/index.js +2428 -2100
  7. package/dist/widgets/FilterConditionField.d.ts +32 -0
  8. package/dist/widgets/ImageLightbox.d.ts +30 -0
  9. package/dist/widgets/ImageLightbox.test.d.ts +1 -0
  10. package/dist/widgets/LookupField.hydration.test.d.ts +1 -0
  11. package/dist/widgets/LookupField.idField.test.d.ts +1 -0
  12. package/dist/widgets/RecipientPickerField.test.d.ts +0 -0
  13. package/dist/widgets/__tests__/FilterConditionField.matchAll.test.d.ts +8 -0
  14. package/dist/widgets/__tests__/FilterConditionField.operators.test.d.ts +8 -0
  15. package/dist/widgets/file-value.d.ts +112 -0
  16. package/dist/widgets/file-value.test.d.ts +1 -0
  17. package/dist/widgets/useFieldTranslation.d.ts +2 -0
  18. package/package.json +9 -8
  19. package/src/FieldEditWidget.test.ts +74 -2
  20. package/src/FieldEditWidget.tsx +44 -4
  21. package/src/field-type-alias.ts +100 -0
  22. package/src/index.tsx +94 -133
  23. package/src/widgets/CheckboxesField.tsx +8 -5
  24. package/src/widgets/FileField.tsx +88 -57
  25. package/src/widgets/FilterConditionField.tsx +109 -9
  26. package/src/widgets/ImageField.tsx +71 -33
  27. package/src/widgets/ImageLightbox.test.tsx +52 -0
  28. package/src/widgets/ImageLightbox.tsx +108 -0
  29. package/src/widgets/LookupField.hydration.test.tsx +136 -0
  30. package/src/widgets/LookupField.idField.test.tsx +61 -0
  31. package/src/widgets/LookupField.tsx +106 -9
  32. package/src/widgets/MultiSelectField.tsx +6 -3
  33. package/src/widgets/ObjectRefField.tsx +9 -4
  34. package/src/widgets/PeoplePicker.test.tsx +20 -0
  35. package/src/widgets/PeoplePicker.tsx +15 -3
  36. package/src/widgets/RadioField.tsx +6 -3
  37. package/src/widgets/RecipientPickerField.test.tsx +157 -0
  38. package/src/widgets/RecipientPickerField.tsx +36 -16
  39. package/src/widgets/TextAreaField.tsx +4 -1
  40. package/src/widgets/__tests__/FilterConditionField.matchAll.test.ts +66 -0
  41. package/src/widgets/__tests__/FilterConditionField.operators.test.ts +142 -0
  42. package/src/widgets/file-value.test.ts +230 -0
  43. package/src/widgets/file-value.ts +230 -0
  44. package/src/widgets/useFieldTranslation.ts +30 -0
package/dist/index.d.ts CHANGED
@@ -67,7 +67,7 @@ export interface DateDisplayOptions {
67
67
  }
68
68
  /**
69
69
  * Format date as relative time (e.g., "3 days ago", "Today", "Overdue 3d"),
70
- * localized via `Intl.RelativeTimeFormat` (objectstack-ai/framework#3040).
70
+ * localized via `Intl.RelativeTimeFormat` (objectstack-ai/objectstack#3040).
71
71
  *
72
72
  * `dueLike` gates the "Overdue" wording — a past `start_date`/`created_at`
73
73
  * isn't overdue, only a past due/deadline-semantic field is. Non-due-like
@@ -162,7 +162,17 @@ export declare function PhoneCellRenderer({ value }: CellRendererProps): React.R
162
162
  */
163
163
  export declare function FileCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
164
164
  /**
165
- * Image field cell renderer (with thumbnails)
165
+ * Image field cell renderer (with thumbnails + click-to-zoom).
166
+ *
167
+ * An image value may be a plain URL string, an object ({ url | src | href … }),
168
+ * a bare `sys_file` id, or an array of any of those. Normalising through
169
+ * `readFileValues` (which resolves a bare id to its stable download URL) means
170
+ * a string-URL field, a CDN link, and an unexpanded reference all render a
171
+ * thumbnail instead of a broken `<img src="">` placeholder.
172
+ *
173
+ * Clicking a thumbnail opens a full-screen lightbox (single or gallery). The
174
+ * click is `stopPropagation`-guarded so, inside a grid row, enlarging an image
175
+ * doesn't also trigger row navigation.
166
176
  */
167
177
  export declare function ImageCellRenderer({ value }: CellRendererProps): React.ReactElement;
168
178
  /**
@@ -234,15 +244,7 @@ export declare function LocationCellRenderer({ value }: CellRendererProps): Reac
234
244
  * Get the appropriate cell renderer for a field type
235
245
  */
236
246
  export declare function getCellRenderer(fieldType: string): React.FC<CellRendererProps>;
237
- /**
238
- * Map field type to form component type
239
- *
240
- * @param fieldType - The ObjectQL field type identifier to convert
241
- * (for example: `"text"`, `"number"`, `"date"`, `"lookup"`).
242
- * @returns The normalized form field type string used in the form schema
243
- * (for example: `"input"`, `"textarea"`, `"date-picker"`, `"select"`).
244
- */
245
- export declare function mapFieldTypeToFormType(fieldType: string): string;
247
+ export { mapFieldTypeToFormType } from './field-type-alias';
246
248
  /**
247
249
  * Formats file size in bytes to human-readable string
248
250
  * @param bytes - File size in bytes (must be non-negative)
@@ -308,6 +310,7 @@ export declare function registerAllFields(): void;
308
310
  */
309
311
  export declare function registerFields(): void;
310
312
  export * from './widgets/types';
313
+ export * from './widgets/file-value';
311
314
  export * from './FieldEditWidget';
312
315
  export * from './widgets/TextField';
313
316
  export * from './widgets/NumberField';