@object-ui/fields 6.2.3 → 7.0.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 (97) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/dist/complex-widgets.test.d.ts +1 -0
  3. package/dist/currency.d.ts +13 -0
  4. package/dist/datetime-widgets.test.d.ts +1 -0
  5. package/dist/field-type-coverage.test.d.ts +1 -0
  6. package/dist/index.cjs +4 -3
  7. package/dist/index.d.ts +300 -2
  8. package/dist/index.js +2460 -1274
  9. package/dist/standard-widgets.test.d.ts +0 -0
  10. package/dist/{packages/fields/src/widgets → widgets}/AddressField.d.ts +2 -1
  11. package/dist/{packages/fields/src/widgets → widgets}/AutoNumberField.d.ts +2 -1
  12. package/dist/{packages/fields/src/widgets → widgets}/AvatarField.d.ts +2 -1
  13. package/dist/{packages/fields/src/widgets → widgets}/BooleanField.d.ts +2 -1
  14. package/dist/widgets/CheckboxesField.d.ts +8 -0
  15. package/dist/{packages/fields/src/widgets → widgets}/CodeField.d.ts +2 -1
  16. package/dist/{packages/fields/src/widgets → widgets}/ColorField.d.ts +2 -1
  17. package/dist/{packages/fields/src/widgets → widgets}/CurrencyField.d.ts +2 -1
  18. package/dist/{packages/fields/src/widgets → widgets}/DateField.d.ts +2 -1
  19. package/dist/{packages/fields/src/widgets → widgets}/DateTimeField.d.ts +2 -1
  20. package/dist/{packages/fields/src/widgets → widgets}/EmailField.d.ts +2 -1
  21. package/dist/{packages/fields/src/widgets → widgets}/FileField.d.ts +2 -1
  22. package/dist/{packages/fields/src/widgets → widgets}/FormulaField.d.ts +2 -1
  23. package/dist/{packages/fields/src/widgets → widgets}/GeolocationField.d.ts +2 -1
  24. package/dist/widgets/GridField.d.ts +123 -0
  25. package/dist/widgets/GridField.test.d.ts +1 -0
  26. package/dist/{packages/fields/src/widgets → widgets}/ImageField.d.ts +2 -1
  27. package/dist/{packages/fields/src/widgets → widgets}/LocationField.d.ts +2 -1
  28. package/dist/{packages/fields/src/widgets → widgets}/LookupField.d.ts +2 -1
  29. package/dist/widgets/MarkdownContent.d.ts +9 -0
  30. package/dist/{packages/fields/src/widgets → widgets}/MasterDetailField.d.ts +2 -1
  31. package/dist/widgets/MultiSelectField.d.ts +9 -0
  32. package/dist/{packages/fields/src/widgets → widgets}/NumberField.d.ts +2 -1
  33. package/dist/{packages/fields/src/widgets → widgets}/ObjectField.d.ts +2 -1
  34. package/dist/{packages/fields/src/widgets → widgets}/PasswordField.d.ts +2 -1
  35. package/dist/{packages/fields/src/widgets → widgets}/PercentField.d.ts +2 -1
  36. package/dist/{packages/fields/src/widgets → widgets}/PhoneField.d.ts +2 -1
  37. package/dist/{packages/fields/src/widgets → widgets}/QRCodeField.d.ts +2 -1
  38. package/dist/widgets/RadioField.d.ts +8 -0
  39. package/dist/{packages/fields/src/widgets → widgets}/RatingField.d.ts +2 -1
  40. package/dist/{packages/fields/src/widgets → widgets}/RecordPickerDialog.d.ts +8 -2
  41. package/dist/{packages/fields/src/widgets → widgets}/RichTextField.d.ts +2 -1
  42. package/dist/{packages/fields/src/widgets → widgets}/SelectField.d.ts +2 -1
  43. package/dist/{packages/fields/src/widgets → widgets}/SignatureField.d.ts +2 -1
  44. package/dist/{packages/fields/src/widgets → widgets}/SliderField.d.ts +2 -1
  45. package/dist/{packages/fields/src/widgets → widgets}/SummaryField.d.ts +2 -1
  46. package/dist/widgets/TagsField.d.ts +8 -0
  47. package/dist/{packages/fields/src/widgets → widgets}/TextAreaField.d.ts +2 -1
  48. package/dist/{packages/fields/src/widgets → widgets}/TextField.d.ts +2 -1
  49. package/dist/{packages/fields/src/widgets → widgets}/TimeField.d.ts +2 -1
  50. package/dist/{packages/fields/src/widgets → widgets}/UrlField.d.ts +2 -1
  51. package/dist/{packages/fields/src/widgets → widgets}/UserField.d.ts +2 -1
  52. package/dist/{packages/fields/src/widgets → widgets}/VectorField.d.ts +2 -1
  53. package/dist/widgets/deriveLookupColumns.d.ts +36 -0
  54. package/dist/widgets/deriveLookupColumns.test.d.ts +1 -0
  55. package/dist/widgets/recentLookups.d.ts +13 -0
  56. package/dist/widgets/recentLookups.test.d.ts +1 -0
  57. package/dist/{packages/fields/src/widgets → widgets}/types.d.ts +1 -1
  58. package/package.json +14 -11
  59. package/src/__tests__/registry-collision.test.ts +91 -0
  60. package/src/__tests__/resolveFieldCurrency.test.ts +20 -0
  61. package/src/coerce-safe-value.test.ts +34 -0
  62. package/src/complex-widgets.test.tsx +58 -7
  63. package/src/currency.ts +14 -0
  64. package/src/field-type-coverage.test.ts +65 -0
  65. package/src/index.tsx +372 -57
  66. package/src/widgets/CheckboxesField.tsx +53 -0
  67. package/src/widgets/CurrencyField.tsx +5 -1
  68. package/src/widgets/GridField.test.tsx +309 -0
  69. package/src/widgets/GridField.tsx +907 -33
  70. package/src/widgets/LookupField.tsx +258 -107
  71. package/src/widgets/MarkdownContent.tsx +19 -0
  72. package/src/widgets/MultiSelectField.tsx +59 -0
  73. package/src/widgets/PercentField.tsx +19 -7
  74. package/src/widgets/RadioField.tsx +41 -0
  75. package/src/widgets/RecordPickerDialog.tsx +22 -18
  76. package/src/widgets/SelectField.tsx +23 -2
  77. package/src/widgets/TagsField.tsx +67 -0
  78. package/src/widgets/deriveLookupColumns.test.ts +74 -0
  79. package/src/widgets/deriveLookupColumns.ts +104 -0
  80. package/src/widgets/recentLookups.test.ts +45 -0
  81. package/src/widgets/recentLookups.ts +47 -0
  82. package/src/widgets/useFieldTranslation.ts +30 -0
  83. package/dist/packages/fields/src/fields-edge-cases.stories.d.ts +0 -45
  84. package/dist/packages/fields/src/fields.stories.d.ts +0 -56
  85. package/dist/packages/fields/src/index.d.ts +0 -286
  86. package/dist/packages/fields/src/record-picker-dialog.stories.d.ts +0 -25
  87. package/dist/packages/fields/src/widgets/GridField.d.ts +0 -7
  88. package/src/fields-edge-cases.stories.tsx +0 -407
  89. package/src/fields.stories.tsx +0 -566
  90. package/src/record-picker-dialog.stories.tsx +0 -160
  91. /package/dist/{packages/fields/src/__tests__/validation-feedback.test.d.ts → __tests__/registry-collision.test.d.ts} +0 -0
  92. /package/dist/{packages/fields/src/complex-widgets.test.d.ts → __tests__/resolveFieldCurrency.test.d.ts} +0 -0
  93. /package/dist/{packages/fields/src/standard-widgets.test.d.ts → __tests__/validation-feedback.test.d.ts} +0 -0
  94. /package/dist/{packages/fields/src/datetime-widgets.test.d.ts → coerce-safe-value.test.d.ts} +0 -0
  95. /package/dist/{packages/fields/src/widgets → widgets}/ImageCropperDialog.d.ts +0 -0
  96. /package/dist/{packages/fields/src/widgets → widgets}/_cell-renderer-bridge.d.ts +0 -0
  97. /package/dist/{packages/fields/src/widgets → widgets}/useFieldTranslation.d.ts +0 -0
File without changes
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Address data structure
@@ -13,4 +14,4 @@ export interface AddressValue {
13
14
  * Address field widget - provides a structured address input
14
15
  * Supports street, city, state, zip code, and country
15
16
  */
16
- export declare function AddressField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<AddressValue>): import("react/jsx-runtime").JSX.Element;
17
+ export declare function AddressField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<AddressValue>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * AutoNumberField - Read-only auto-generated field
4
5
  * Values are automatically generated by the system and cannot be edited
5
6
  */
6
- export declare function AutoNumberField({ value, field, ...props }: FieldWidgetProps<string | number>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function AutoNumberField({ value, field, ...props }: FieldWidgetProps<string | number>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Avatar field widget - provides an avatar/profile picture uploader
4
5
  * Supports image URLs or file uploads
5
6
  */
6
- export declare function AvatarField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function AvatarField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * BooleanField - Toggle input supporting switch and checkbox variants
4
5
  * Renders as Switch or Checkbox based on field widget configuration
5
6
  */
6
- export declare function BooleanField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<boolean>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function BooleanField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<boolean>): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { FieldWidgetProps } from './types';
3
+ /**
4
+ * CheckboxesField - select zero or more values from a fixed option set, rendered
5
+ * as a list of checkboxes. The stored value is a string[]. Used for the
6
+ * `checkboxes` field type.
7
+ */
8
+ export declare function CheckboxesField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string[]>): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Code field widget - provides a code editor with syntax highlighting
4
5
  * Uses a simple textarea with monospace font
5
6
  * For advanced code editing, use the @object-ui/plugin-editor component
6
7
  */
7
- export declare function CodeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function CodeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Color field widget - provides a color picker input
4
5
  * Supports hex color values (e.g., #ff0000)
5
6
  */
6
- export declare function ColorField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ColorField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
- export declare function CurrencyField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function CurrencyField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * DateField - Date picker input widget
4
5
  * Uses native date input and displays locale-formatted date in readonly mode
5
6
  */
6
- export declare function DateField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function DateField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * DateTimeField - Combined date and time picker widget
4
5
  * Displays both date and time in locale format when readonly
5
6
  */
6
- export declare function DateTimeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function DateTimeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * EmailField - Email address input with mailto link in readonly mode
4
5
  * Renders as a clickable mailto link when readonly, standard email input otherwise
5
6
  */
6
- export declare function EmailField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function EmailField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * FileField - File upload widget with drag-and-drop support
4
5
  * Supports single and multiple file uploads with configurable accepted file types.
5
6
  * L2: File size validation, per-file progress indicators, error messages.
6
7
  */
7
- export declare function FileField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function FileField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * FormulaField - Read-only computed field
4
5
  * Values are computed on the backend and cannot be edited
5
6
  */
6
- export declare function FormulaField({ value, field, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function FormulaField({ value, field, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Geolocation data structure
@@ -11,4 +12,4 @@ export interface GeolocationValue {
11
12
  * Geolocation field widget - provides a location picker with coordinates
12
13
  * Supports manual entry and browser geolocation API
13
14
  */
14
- export declare function GeolocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<GeolocationValue>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function GeolocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<GeolocationValue>): React.JSX.Element;
@@ -0,0 +1,123 @@
1
+ import { default as React } from 'react';
2
+ import { FieldWidgetProps } from './types';
3
+ /**
4
+ * GridField / LineItemsField — editable child-grid ("line items") widget.
5
+ *
6
+ * A controlled component: `value` is an array of row objects, `onChange`
7
+ * receives the next array. It renders one editable cell per configured
8
+ * column, supports add / delete row, and shows a running total of a numeric
9
+ * column. This is the renderer for the `field:grid` widget and the cell
10
+ * engine behind the master-detail subform (see ADR-0001).
11
+ *
12
+ * Column config (a subset of `GridColumnDefinition`):
13
+ * { field, label?, type?, options?, width?, required?, prefix?, step? }
14
+ * type ∈ 'text' | 'number' | 'currency' | 'date' | 'select'
15
+ *
16
+ * Field-level config (from `GridFieldMetadata`):
17
+ * columns, min_rows, max_rows, allow_add, allow_delete, total_field
18
+ */
19
+ export interface GridColumn {
20
+ field: string;
21
+ label?: string;
22
+ type?: 'text' | 'number' | 'currency' | 'date' | 'select' | 'lookup';
23
+ options?: Array<{
24
+ label: string;
25
+ value: string;
26
+ }>;
27
+ width?: number;
28
+ required?: boolean;
29
+ prefix?: string;
30
+ step?: number;
31
+ /** For `type: 'lookup'` — the referenced object and label/id fields. */
32
+ reference?: string;
33
+ displayField?: string;
34
+ idField?: string;
35
+ multiple?: boolean;
36
+ /**
37
+ * Hidden from the grid by default but revealable via the column chooser.
38
+ * Set by `deriveColumns` for fields beyond the default-visible budget — the
39
+ * data is NOT dropped (it's just collapsed, like Odoo's `optional` columns /
40
+ * Salesforce column personalization), so business-critical fields stay
41
+ * reachable. Required columns are never default-hidden.
42
+ */
43
+ defaultHidden?: boolean;
44
+ /**
45
+ * A computed (read-only) column whose value is derived live from sibling
46
+ * cells via {@link expr} — e.g. an invoice line's `amount = quantity *
47
+ * unit_price`. The grid renders it read-only, recomputes it as the row's
48
+ * inputs change, and writes the result back into the row so it persists
49
+ * (and any running total reflects it). The classic spreadsheet pattern used
50
+ * by QuickBooks / Stripe / NetSuite line grids — nobody types the amount.
51
+ */
52
+ computed?: boolean;
53
+ /** Arithmetic expression for a {@link computed} column. Supports `+ - * / %`,
54
+ * parentheses, numeric literals and field refs (`record.qty` or bare `qty`). */
55
+ expr?: string;
56
+ /** Decimal places to round a computed numeric/currency result to. */
57
+ scale?: number;
58
+ /** For `type: 'lookup'` — when a record is picked, copy its fields into any
59
+ * sibling columns of the same name (e.g. a product's unit_price/description).
60
+ * On by default for lookup columns; set `false` to disable the auto-fill. */
61
+ autofill?: boolean;
62
+ /**
63
+ * CEL predicate: when TRUE for this row, the cell is **read-only** (B2 field
64
+ * rules, generalized to grid cells). Evaluated per row against the row as
65
+ * `record` plus the header as `parent` (so a line locks when
66
+ * `parent.status == 'paid'` *or* on an intra-row condition like
67
+ * `record.kind == 'auto'`). Client-side UX; fails open (stays editable).
68
+ */
69
+ readonlyWhen?: string | {
70
+ dialect?: string;
71
+ source: string;
72
+ };
73
+ /**
74
+ * CEL predicate: when TRUE for this row, the cell is **required** (flagged
75
+ * inline-invalid while empty). Same `record` + `parent` scope as
76
+ * {@link readonlyWhen}.
77
+ */
78
+ requiredWhen?: string | {
79
+ dialect?: string;
80
+ source: string;
81
+ };
82
+ }
83
+ type Row = Record<string, any>;
84
+ /** Evaluate an arithmetic `expr` against `row`. null when blank/unparseable. */
85
+ export declare function evalArith(expr: string, row: Row): number | null;
86
+ /**
87
+ * Recompute every {@link GridColumn.computed} cell in `row` from its sibling
88
+ * inputs, returning a new row. Called after each edit so computed columns and
89
+ * the running total stay live, and so the computed value persists in the batch.
90
+ */
91
+ /**
92
+ * Build the row patch for a lookup-cell selection: set the FK column to the
93
+ * chosen record's id, and (unless the column opts out with `autofill: false`)
94
+ * copy any of the record's fields whose names match a sibling column — the
95
+ * catalog-typeahead behaviour (pick a product → its unit_price/description fill
96
+ * in). Skips the lookup column itself and computed columns. Pure + exported so
97
+ * it is unit-testable independent of the picker UI.
98
+ */
99
+ export declare function lookupAutofillPatch(columns: GridColumn[], col: GridColumn, record: any): Row;
100
+ export declare function computeRow(columns: GridColumn[], row: Row): Row;
101
+ /** Sum a numeric column across rows (ignoring blanks/NaN). */
102
+ export declare function sumColumn(rows: Row[], field: string): number;
103
+ export declare function GridField({ value, onChange, field, readonly, disabled, className, onRowExpand, displayMode, onAdd, ...props }: FieldWidgetProps<Row[]> & {
104
+ /** When provided, each row shows an "expand" button that opens the row in a
105
+ * full form (the host — e.g. MasterDetailForm — renders the drawer/modal and
106
+ * writes the edited values back). Lets a "fat" child be edited in a real form
107
+ * while the grid stays a quick at-a-glance editor. */
108
+ onRowExpand?: (rowIndex: number) => void;
109
+ /** 'grid' (default) = editable cells; 'list' = read-only rows whose primary
110
+ * action is per-row edit (via `onRowExpand`) and whose Add opens a new row
111
+ * in the full form (via `onAdd`). The form-factor for "fat" children. */
112
+ displayMode?: 'grid' | 'list';
113
+ /** In 'list' mode, "Add" calls this (host opens the full form for a new row)
114
+ * instead of inserting a blank inline row. */
115
+ onAdd?: () => void;
116
+ /** The header/parent record, bound as `parent` when evaluating a column's
117
+ * `readonlyWhen` / `requiredWhen` CEL predicate — so a line cell can react to
118
+ * the header (`parent.status == 'paid'`). Supplied by MasterDetailForm. */
119
+ contextRecord?: Record<string, unknown>;
120
+ }): React.JSX.Element;
121
+ /** Semantic alias — the master-detail subform's child grid. */
122
+ export declare const LineItemsField: typeof GridField;
123
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * ImageField - Image upload widget with preview thumbnails
4
5
  * Supports single and multiple image uploads with drag-and-drop and preview display
5
6
  */
6
- export declare function ImageField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ImageField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * LocationField - Geographic coordinate input for latitude and longitude
4
5
  * Stores location as { latitude, longitude } object and displays as comma-separated pair
5
6
  */
6
- export declare function LocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function LocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  export interface LookupOption {
3
4
  value: string | number;
@@ -14,4 +15,4 @@ export interface LookupOption {
14
15
  * from the referenced object using `DataSource.find()`.
15
16
  * Falls back to static `options` when no DataSource is available.
16
17
  */
17
- export declare function LookupField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
18
+ export declare function LookupField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Heavy markdown renderer, split into its own module so it can be lazy-loaded
4
+ * by the cell/detail renderers (react-markdown pulls in ~100-200 KB). GitHub
5
+ * Flavored Markdown + sanitization (defense against XSS in stored content).
6
+ */
7
+ export default function MarkdownContent({ value }: {
8
+ value: string;
9
+ }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Master-Detail relationship data structure
@@ -11,4 +12,4 @@ export interface MasterDetailValue {
11
12
  * Master-Detail field widget - manages one-to-many relationships
12
13
  * Displays related records with add/remove capabilities
13
14
  */
14
- export declare function MasterDetailField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<MasterDetailValue[]>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function MasterDetailField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<MasterDetailValue[]>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { FieldWidgetProps } from './types';
3
+ /**
4
+ * MultiSelectField - select zero or more values from a fixed option set.
5
+ *
6
+ * Renders the configured options as toggleable chips. The stored value is a
7
+ * string[] (the selected option values). Used for the `multiselect` field type.
8
+ */
9
+ export declare function MultiSelectField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string[]>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * NumberField - Numeric input with optional decimal precision
4
5
  * Supports min/max/step constraints and configurable decimal precision
5
6
  */
6
- export declare function NumberField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<number>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function NumberField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<number>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * ObjectField - JSON object editor
4
5
  * Allows editing structured JSON data
5
6
  */
6
- export declare function ObjectField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ObjectField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * PasswordField - Secure password input with visibility toggle
4
5
  * Includes show/hide toggle button and masks value in readonly mode
5
6
  */
6
- export declare function PasswordField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function PasswordField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * PercentField - Percentage input with configurable decimal precision
4
5
  * Stores values as decimals (0-1) and displays as percentages (0-100%)
5
6
  * Includes a slider for interactive control.
6
7
  */
7
- export declare function PercentField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function PercentField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * PhoneField - Telephone number input with tel link in readonly mode
4
5
  * Renders as a clickable tel link when readonly, standard phone input otherwise
5
6
  */
6
- export declare function PhoneField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function PhoneField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * QR Code field widget - generates QR codes from text
4
5
  * Uses a simple SVG-based QR code generator
5
6
  */
6
- export declare function QRCodeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function QRCodeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { FieldWidgetProps } from './types';
3
+ /**
4
+ * RadioField - choose exactly one value from a fixed option set, rendered as a
5
+ * radio group. The stored value is the selected option value (string). Used for
6
+ * the `radio` field type.
7
+ */
8
+ export declare function RadioField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Rating field widget - provides a star rating input
4
5
  * Supports numeric values from 0 to max (default 5)
5
6
  */
6
- export declare function RatingField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<number>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function RatingField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<number>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { DataSource, LookupColumnDef, LookupFilterDef } from '../../../types/src';
2
+ import { DataSource, LookupColumnDef, LookupFilterDef } from '@object-ui/types';
3
3
  /**
4
4
  * Cell renderer function signature — matches getCellRenderer from @object-ui/fields.
5
5
  * Accepts a field type and returns a React component that renders a formatted cell.
@@ -74,6 +74,12 @@ export interface RecordPickerGridSlotProps {
74
74
  /** Cell renderer resolver */
75
75
  cellRenderer?: CellRendererResolver;
76
76
  }
77
+ /**
78
+ * Convert LookupFilterDef[] to a Record<string, any> compatible with
79
+ * QueryParams.$filter. Supports operator mapping for eq/ne/gt/lt/gte/lte/
80
+ * contains/in/notIn.
81
+ */
82
+ export declare function lookupFiltersToRecord(filters: LookupFilterDef[]): Record<string, any>;
77
83
  export interface RecordPickerDialogProps {
78
84
  /** Whether the dialog is open */
79
85
  open: boolean;
@@ -171,4 +177,4 @@ export interface RecordPickerDialogProps {
171
177
  * states, and single/multi-select. Responsive: mobile-friendly width
172
178
  * via Tailwind breakpoints.
173
179
  */
174
- export declare function RecordPickerDialog({ open, onOpenChange, title, multiple, dataSource, objectName, columns: columnsProp, displayField, titleFormat, idField, pageSize, value, onSelect, onSelectRecords, lookupFilters, cellRenderer, filterColumns, renderFilterBar, renderGrid, }: RecordPickerDialogProps): import("react/jsx-runtime").JSX.Element;
180
+ export declare function RecordPickerDialog({ open, onOpenChange, title, multiple, dataSource, objectName, columns: columnsProp, displayField, titleFormat, idField, pageSize, value, onSelect, onSelectRecords, lookupFilters, cellRenderer, filterColumns, renderFilterBar, renderGrid, }: RecordPickerDialogProps): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Rich text field with markdown/HTML support
4
5
  * For now, this is a simple textarea. A full implementation would use
5
6
  * a rich text editor like TipTap, Lexical, or Slate.
6
7
  */
7
- export declare function RichTextField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function RichTextField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * SelectField - Dropdown selection widget with configurable options
4
5
  * Renders options from field metadata with support for placeholder and readonly display
5
6
  */
6
- export declare function SelectField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function SelectField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Signature field widget - provides a signature pad for capturing signatures
4
5
  * Outputs signature as a base64 PNG image
5
6
  */
6
- export declare function SignatureField({ value, onChange, readonly }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function SignatureField({ value, onChange, readonly }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * Slider field widget - provides a range slider input
4
5
  * Supports numeric values with configurable min, max, and step
5
6
  */
6
- export declare function SliderField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<number>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function SliderField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<number>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * SummaryField - Read-only aggregation field
4
5
  * Values are aggregated from related records and cannot be edited
5
6
  */
6
- export declare function SummaryField({ value, field, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function SummaryField({ value, field, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { FieldWidgetProps } from './types';
3
+ /**
4
+ * TagsField - free-form list of string tags. Type a value and press Enter (or
5
+ * comma) to add it; click a tag's × to remove it. The stored value is a
6
+ * string[]. Used for the `tags` field type.
7
+ */
8
+ export declare function TagsField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string[]>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * TextAreaField - Multi-line text input widget
@@ -8,4 +9,4 @@ import { FieldWidgetProps } from './types';
8
9
  * a fullscreen edit dialog — much easier on phones than tapping a 4-row
9
10
  * textarea trapped between other fields.
10
11
  */
11
- export declare function TextAreaField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function TextAreaField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * TextField - Standard single-line or multi-line text input
4
5
  * Automatically renders as a textarea when rows are configured in field metadata
5
6
  */
6
- export declare function TextField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function TextField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * TimeField - Time picker input widget
4
5
  * Uses native time input for hour and minute selection
5
6
  */
6
- export declare function TimeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function TimeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * UrlField - URL input with clickable link in readonly mode
4
5
  * Validates URLs to only render http/https links for security
5
6
  */
6
- export declare function UrlField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function UrlField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * UserField - User/Owner selector field
4
5
  * Allows selecting one or multiple users
5
6
  */
6
- export declare function UserField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function UserField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { default as React } from 'react';
1
2
  import { FieldWidgetProps } from './types';
2
3
  /**
3
4
  * VectorField - Vector/embedding data display
4
5
  * Shows vector embeddings in a read-only format
5
6
  */
6
- export declare function VectorField({ value, field, ...props }: FieldWidgetProps<number[]>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function VectorField({ value, field, ...props }: FieldWidgetProps<number[]>): React.JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { LookupColumnDef } from '@object-ui/types';
2
+ export interface DeriveColumnsOptions {
3
+ /** Primary display field — always the leading column. */
4
+ displayField: string;
5
+ /** Maximum number of columns to derive (including the display field). */
6
+ max?: number;
7
+ }
8
+ interface ObjectSchemaLike {
9
+ fields?: Record<string, {
10
+ type?: string;
11
+ label?: string;
12
+ hidden?: boolean;
13
+ }>;
14
+ /** Object-level "fields to display in search result cards" (spec metadata). */
15
+ displayFields?: unknown;
16
+ }
17
+ /**
18
+ * Derive sensible Record Picker columns from a referenced object's schema when
19
+ * a lookup field declares no explicit `lookup_columns`.
20
+ *
21
+ * Priority:
22
+ * 1. The referenced object's own `displayFields` ("fields to display in
23
+ * search result cards") — the author's declared search-card shape.
24
+ * 2. Otherwise the display field plus the next few business fields in
25
+ * declaration order, skipping system/audit fields and heavy non-tabular
26
+ * types.
27
+ *
28
+ * The result gives every lookup a multi-column, disambiguating picker with zero
29
+ * field-level configuration. Column `type` is carried through so the picker can
30
+ * render currency / select / date cells via the shared cell renderer.
31
+ *
32
+ * Returns an empty array when no usable schema is available, in which case the
33
+ * caller should fall back to the single display-field column.
34
+ */
35
+ export declare function deriveLookupColumns(objectSchema: ObjectSchemaLike | null | undefined, { displayField, max }: DeriveColumnsOptions): LookupColumnDef[];
36
+ export {};
@@ -0,0 +1 @@
1
+ export {};