@object-ui/fields 14.0.0 → 15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,178 @@
1
1
  # @object-ui/fields
2
2
 
3
+ ## 15.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@15.0.0
8
+ - @object-ui/core@15.0.0
9
+ - @object-ui/i18n@15.0.0
10
+ - @object-ui/react@15.0.0
11
+ - @object-ui/components@15.0.0
12
+ - @object-ui/providers@15.0.0
13
+
14
+ ## 14.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 579b24d: feat(fields+form+detail): file/image uploads in inline line-item grids (#2360)
19
+
20
+ `Field.file` in a master-detail inline grid previously degraded to a plain text
21
+ input (no `input[type=file]` on the page → no way to upload from the grid), and
22
+ auto-derived subform / related-list columns silently dropped file fields.
23
+
24
+ - **fields**: new `FileCell` — a compact upload control for grid cells (upload
25
+ button + removable chips, image thumbnails), sharing the `UploadProvider`
26
+ pipeline with the full-size `FileField` via an extracted `useFileUploads`
27
+ hook. `GridField` supports `type: 'file'` columns (with `accept` /
28
+ `multiple`), renders file names in list/readonly modes, and no longer falls
29
+ back to a text `<Input>` for file columns.
30
+ - **plugin-form**: `deriveColumns` / `hydrateColumns` no longer exclude
31
+ `file`/`image`/`avatar` fields — they map to `file` columns and carry the
32
+ field's `multiple` + `accept` (image fields default to `['image/*']`).
33
+ - **plugin-detail**: auto-derived related-list columns no longer skip
34
+ `file`/`image` fields — they render through the existing FileCellRenderer /
35
+ ImageCellRenderer (file-name chip / thumbnail).
36
+
37
+ ### Patch Changes
38
+
39
+ - 2efa9fd: Detail-page UX follow-ups from the ADR-0085 PR4 real-backend browser pass (framework#2548):
40
+
41
+ - **Highlight strip no longer repeats the record title.** A declared
42
+ `highlightFields` list containing the title field rendered it as the first
43
+ chip — truncated — directly under the identical page H1. `deriveHighlightFields`
44
+ now resolves the title (`primaryField` / `nameField` / deprecated
45
+ `displayNameField`, else the conventional display-field names) via the new
46
+ exported `resolveTitleField` and filters it from declared lists before the
47
+ 4-chip cap, matching what the heuristic branch always did. app-shell's
48
+ `RecordDetailView` synthParts (which pre-computes the list and bypasses the
49
+ derivation) applies the same filter.
50
+ - **Per-field currency reaches the renderers.** The spec channel
51
+ (`currencyConfig.defaultCurrency`) was dropped by the highlight-strip and
52
+ detail-section field enrichment, so a spec-authored currency field could
53
+ never show its symbol ("25,000,000" instead of "$25,000,000");
54
+ `resolveFieldCurrency` reads it second after the designer-only bare
55
+ `currency` key.
56
+ - **app-shell approvals fetches send the Bearer token.** The header badge
57
+ poll, home-inbox count, and record-page approvals panel were cookie-only
58
+ (new shared `bearerAuthHeaders()` util) — same split-origin failure mode as
59
+ the console `approvalsApi` fix below.
60
+ - **`fieldGroups[].icon` / `description` reach detail pages.** The shared
61
+ derivation (ADR-0085 §5) already passed them through; the detail synth
62
+ dropped them. Sections now carry both, and `DetailSection` renders a real
63
+ Lucide icon for identifier-shaped names (emoji/text values keep the
64
+ historical text rendering).
65
+ - **Record meta footer stops dangling without an actor.** Seeded/system rows
66
+ with `created_by: null` rendered "Created by · 10m ago"; the footer now
67
+ falls back to actor-less labels ("Created / Updated"), with new i18n keys in
68
+ all six locales (and the zh `createdBy`/`updatedBy` mistranslation fixed:
69
+ 创建人/更新人, not 创建于/更新于).
70
+ - **Select badges ellipsize instead of clipping mid-glyph.** In bounded
71
+ containers (highlight-strip columns, grid cells) an overlong option label
72
+ used to be cut at the container edge ("Technolog…"); badges now shrink with
73
+ an inner truncate and expose the full label as a hover title. The highlight
74
+ strip's hover title also prefers the option label over the raw stored value.
75
+
76
+ Console app (unversioned): `approvalsApi` now sends the stored Bearer token
77
+ like every other console call — cookie-only auth silently lost the approvals
78
+ surface on split-origin deployments where the SameSite cookie doesn't flow.
79
+
80
+ - 2b30583: fix(fields): LookupCellRenderer honors the target object's configured `display_field` (framework#2926 ⑧). ObjectGrid already forwarded `display_field` on the column meta, but the read cell ignored it and always ran the hardcoded heuristics (`name` first), so lookup columns showed the raw API name instead of the configured display/label field. The preferred field now threads through every render path (expanded objects, arrays, JSON strings, and the on-demand `useLookupName` fetch, whose cache key includes the display field to prevent cross-column stale names).
81
+ - 3e8bf07: fix(fields): PeoplePicker keyboard cursor no longer resets on identity-only
82
+ result re-emissions
83
+
84
+ The cursor-reset effect keyed on the records array identity, so a background
85
+ refetch returning the same records (StrictMode double-effect, refetch-on-focus)
86
+ yanked the active row back to none mid-navigation — surfacing as a flaky
87
+ ArrowDown→Enter CI test and a real (if rare) keyboard UX glitch. The reset is
88
+ now keyed on the record-id signature, so the cursor only resets when the
89
+ results actually change.
90
+
91
+ - 4afb251: Record-level inline edit polish (objectui#2572, follow-up to #2407) — the five
92
+ rough edges from the live showcase verification pass:
93
+
94
+ - **Expanded reference values pass through to the picker.** `InlineFieldInput`
95
+ no longer collapses an `$expand`-ed record object to a bare id before
96
+ handing it to `LookupField` / `UserField` — the picker resolves the display
97
+ name it already carries instead of re-fetching the referenced record via
98
+ `findOne` (or sticking on the placeholder when it can't). `LookupField`
99
+ still hands its Level-2 pickers (PeoplePicker / RecordPickerDialog) bare
100
+ ids, collapsed via the existing `normalizeId`.
101
+ - **Approval-lock preflight.** The record page now re-reads the approval
102
+ state whenever the record is invalidated (a save can _trigger_ an approval
103
+ flow that locks the record), derives one `approvalLocked` signal
104
+ (`approval_status` pending/in_approval OR an open pending request), gates
105
+ the inline-edit session's `canEdit` with it — hiding the pencil affordances
106
+ and no-op'ing `enter()` on a locked record — and drives the save bar's
107
+ `locked`/`lockedHint` so users can't type into a draft that Save would
108
+ reject with `RECORD_LOCKED`.
109
+ - **Numeric field types edit with the real numeric widgets.** `number` /
110
+ `currency` / `percent` route to `NumberField` / `CurrencyField` /
111
+ `PercentField` (the same widgets the form uses) instead of a free-text
112
+ input: numeric keyboard, symbol adornment, fraction↔percent display
113
+ conversion, and numbers (not strings) into the draft. `NumberField` and
114
+ `CurrencyField` now surface metadata `min`/`max` on the input, `NumberField`
115
+ honors an explicit `step` and steps by 1 for `scale: 0` (previously fell
116
+ back to `any`).
117
+ - **Header Edit CTA stands down during an inline session.** The synthesized
118
+ `sys_edit` action carries `disableDuringInlineEdit`, and the `page:header`
119
+ renderer greys such actions out while `InlineEditContext.editing` — the
120
+ classic form-edit surface can no longer be stacked on top of a live inline
121
+ draft.
122
+ - **Keyboard shortcuts for the shared edit session.** `InlineEditSaveBar`
123
+ binds **Esc → cancel** (deferring to any open Radix layer — popover /
124
+ select / dialog — which owns Escape for "close") and **Cmd/Ctrl+Enter →
125
+ save**, both respecting `saving`/`locked`.
126
+
127
+ - 2712fc1: fix(fields+detail): resolve the pre-existing rules-of-hooks violations in the cell renderers
128
+
129
+ - `CurrencyCellRenderer` / `EmailCellRenderer` / `PhoneCellRenderer` called
130
+ hooks (`useLocalization`, `useFieldLabel`, `useState`) **after** their
131
+ empty-value early return — a value flipping between null and set changed
132
+ the hook count between renders (latent "Rendered more hooks than during
133
+ the previous render" crash). Hooks now run unconditionally before the
134
+ early return.
135
+ - `useFieldLabel` wrapped `useObjectTranslation()` in try/catch; a throw
136
+ after other hooks ran would desync hook order. The underlying hook is
137
+ provider-safe (optional context + global i18n fallback), so the guard is
138
+ removed.
139
+ - `ReferenceCellRenderer` no longer constructs JSX inside try/catch (the
140
+ try can't catch render errors anyway) — the display string is computed in
141
+ the try, rendered outside.
142
+ - `RecordMetaFooter`'s UserRef renders the registry cell renderer via
143
+ `React.createElement` instead of a locally-assigned capitalized JSX tag
144
+ (flagged as component-creation-during-render; the registry reference is
145
+ stable).
146
+
147
+ No behavior change intended; eslint react-hooks errors on these files drop
148
+ to zero.
149
+
150
+ - Updated dependencies [82441e4]
151
+ - Updated dependencies [2efa9fd]
152
+ - Updated dependencies [0890fa7]
153
+ - Updated dependencies [2ded18c]
154
+ - Updated dependencies [e628d1f]
155
+ - Updated dependencies [5523fc4]
156
+ - Updated dependencies [887062c]
157
+ - Updated dependencies [23d65c3]
158
+ - Updated dependencies [055e1d2]
159
+ - Updated dependencies [9e2d58f]
160
+ - Updated dependencies [dea65f7]
161
+ - Updated dependencies [f30ff68]
162
+ - Updated dependencies [073e7aa]
163
+ - Updated dependencies [6c0135c]
164
+ - Updated dependencies [5b52624]
165
+ - Updated dependencies [4afb251]
166
+ - Updated dependencies [d5b1bc0]
167
+ - Updated dependencies [f94905d]
168
+ - Updated dependencies [f0f10f5]
169
+ - @object-ui/i18n@14.1.0
170
+ - @object-ui/core@14.1.0
171
+ - @object-ui/types@14.1.0
172
+ - @object-ui/react@14.1.0
173
+ - @object-ui/components@14.1.0
174
+ - @object-ui/providers@14.1.0
175
+
3
176
  ## 14.0.0
4
177
 
5
178
  ### Minor Changes
package/README.md CHANGED
@@ -55,6 +55,17 @@ Supported types out of the box:
55
55
  - **Media**: `file`, `image`
56
56
  - **System**: `formula`, `summary`, `auto_number`
57
57
 
58
+ ### File uploads in line-item grids
59
+
60
+ `GridField` (the master-detail line-items grid) supports `type: 'file'` columns:
61
+ the cell renders a compact upload button plus removable file chips (thumbnails
62
+ for images) instead of degrading to a text input, so users can attach a receipt
63
+ or photo per row without opening the row form (objectui#2360). Columns accept
64
+ `accept?: string[]` and `multiple?: boolean`; uploads run through the same
65
+ `UploadProvider` pipeline as the full-size `FileField` (the compact control is
66
+ exported as `FileCell`). Auto-derived subform columns map `file`/`image`/
67
+ `avatar` fields to file columns instead of dropping them.
68
+
58
69
  ### Cascading & role-gated select options
59
70
 
60
71
  `select` options support a per-option `visibleWhen` CEL predicate (offered only
File without changes