@object-ui/fields 11.5.0 → 13.2.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,155 @@
1
1
  # @object-ui/fields
2
2
 
3
+ ## 13.2.0
4
+
5
+ ### Patch Changes
6
+
7
+ - e492b9d: Permission sets — pure separation of **design** (Studio) and **assignment**
8
+ (Setup), per ADR-0056 / epic #2398. A `sys_permission_set` used to render its six
9
+ authorization facets in Setup as raw `[Object]` / JSON textareas, and only
10
+ objects+fields were editable in Studio; this reworks both surfaces.
11
+
12
+ **Setup (assign + read-only):**
13
+ - The six facets (`object_permissions`, `field_permissions`, `system_permissions`,
14
+ `row_level_security`, `tab_permissions`, `admin_scope`) now render read-only on
15
+ the `sys_permission_set` record page as a compact summary (counts, or capability
16
+ chips) plus a **“Design in Studio →”** deep-link into the structured editor
17
+ (`/apps/:appName/metadata/permission/:setName`, env scope). No `[Object]`, no
18
+ JSON — in the record view, inline edit, and the create/edit form. Implemented as
19
+ a `permission-facet-link` field widget stamped onto the six fields via the single
20
+ `ObjectStackAdapter.getObjectSchema` choke point and honored by DetailSection +
21
+ the record form.
22
+ - User assignment (add/remove via `sys_user_permission_set`) is surfaced directly
23
+ on the Setup record page.
24
+
25
+ **Studio (design every facet):** the permission matrix editor gains structured
26
+ editors for the facets that were JSON-only —
27
+ - **System Capabilities**: a multi-select over the live `sys_capability` registry
28
+ (scope-grouped, labelled chips).
29
+ - **Row-Level Security**: per-policy rows (object · operation · enabled) with CEL
30
+ USING/CHECK.
31
+ - **Tab Visibility**: per-tab `visible | hidden | default_on | default_off`.
32
+ - **Delegated Admin Scope**: business-unit + subtree, manage-assignments /
33
+ -bindings / author-env-sets toggles, and an assignable-permission-sets allowlist.
34
+ Assignment was moved out of the editor (it is now a Setup act) — the editor is
35
+ purely a design surface.
36
+
37
+ Storage/types are unchanged; editors read/write the draft’s existing parsed
38
+ fields and tolerate legacy JSON strings on load. Note: env-scope metadata saves of
39
+ these facets do not yet project onto the queryable `sys_permission_set` data
40
+ record the Setup summary reads, so a fresh Studio edit isn’t reflected in Setup’s
41
+ read-only view until the projection refreshes — tracked as a framework follow-up
42
+ (enforcement reads the authoritative metadata).
43
+
44
+ - Updated dependencies [80901aa]
45
+ - Updated dependencies [53c40c2]
46
+ - Updated dependencies [e492b9d]
47
+ - @object-ui/components@13.2.0
48
+ - @object-ui/i18n@13.2.0
49
+ - @object-ui/react@13.2.0
50
+ - @object-ui/types@13.2.0
51
+ - @object-ui/core@13.2.0
52
+ - @object-ui/providers@13.2.0
53
+
54
+ ## 13.1.0
55
+
56
+ ### Patch Changes
57
+
58
+ - @object-ui/types@13.1.0
59
+ - @object-ui/core@13.1.0
60
+ - @object-ui/i18n@13.1.0
61
+ - @object-ui/react@13.1.0
62
+ - @object-ui/components@13.1.0
63
+ - @object-ui/providers@13.1.0
64
+
65
+ ## 13.0.0
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [9e38270]
70
+ - Updated dependencies [ac04b76]
71
+ - Updated dependencies [619097e]
72
+ - @object-ui/i18n@13.0.0
73
+ - @object-ui/components@13.0.0
74
+ - @object-ui/types@13.0.0
75
+ - @object-ui/react@13.0.0
76
+ - @object-ui/core@13.0.0
77
+ - @object-ui/providers@13.0.0
78
+
79
+ ## 12.1.0
80
+
81
+ ### Patch Changes
82
+
83
+ - 6cbccf3: Localize form validation messages, toast client-side validation failures, and make native date/time picker icons legible in dark mode.
84
+
85
+ Record-form validation messages (required, min/max length, min/max value, pattern, email, URL) were hard-coded English even when the field label was localized — e.g. a Chinese "计划开始日期" field showed "计划开始日期 is required". `buildValidationRules` baked English strings, so the form renderer's `t(...)` fallback never applied. It now emits `required: true` and, for the other rules, a `messageKey` + `undefined` message (a field-authored `*_message` still wins and passes through verbatim); the form renderer fills the blanks via i18n (`validation.*` keys already exist in every locale), so messages track the label's language.
86
+
87
+ When client-side validation blocks a submit, the offending field's inline error can sit below the fold in a long modal/drawer form — the user clicks 创建 and sees nothing happen. The form renderer now also fires a `toast.error` naming the fields (`validation.formInvalid`, added to all 10 locales), mirroring the existing server-error toast so the feedback is visible regardless of scroll position.
88
+
89
+ Separately, native controls now declare `color-scheme` (`light` on `:root`, `dark` on `.dark`), so the webkit calendar-picker-indicator and other built-in glyphs render light-on-dark instead of vanishing against the dark input background.
90
+
91
+ - Updated dependencies [6cbccf3]
92
+ - Updated dependencies [e1840bf]
93
+ - Updated dependencies [c31874d]
94
+ - @object-ui/components@12.1.0
95
+ - @object-ui/i18n@12.1.0
96
+ - @object-ui/types@12.1.0
97
+ - @object-ui/react@12.1.0
98
+ - @object-ui/core@12.1.0
99
+ - @object-ui/providers@12.1.0
100
+
101
+ ## 12.0.0
102
+
103
+ ### Minor Changes
104
+
105
+ - 226fde9: Cascading & role-gated `select` options (#2284).
106
+
107
+ `select` options now accept a per-option `visibleWhen` CEL predicate — the option
108
+ is offered only when it evaluates TRUE against the live record **plus
109
+ `current_user`** (same engine/env as a field-level `visibleWhen`). Combined with a
110
+ field-level `dependsOn`, this drives dependent selects (country → province → city)
111
+ and role/context gating with no bespoke matrix — the same primitives dependent
112
+ lookups (#2215) already use.
113
+
114
+ - `@object-ui/core` exposes `resolveVisibleOptions` / `isOptionGroupGated` /
115
+ `resolveDependsOnFields` / `isValueStillOffered` (evaluator), reusing the
116
+ canonical `evalFieldPredicate`.
117
+ - The form renderer narrows a dependent select's option list, gates the control
118
+ with a "Select {parent} first" hint while a `dependsOn` field is empty, and
119
+ clears a now-invalid value when the parent changes.
120
+ - The standalone `SelectField` widget applies the same resolution via
121
+ `dependentValues` + the global predicate scope.
122
+
123
+ Client-side hiding is UX, not authorization: gate authorization-sensitive option
124
+ values on the server too. Aligns with `@objectstack/spec` `SelectOption.visibleWhen`.
125
+
126
+ ### Patch Changes
127
+
128
+ - e36a9c7: Align the DetailView column density with the entry form (objectui#2578 "多列显示").
129
+
130
+ - **Detail views now reach up to 4 columns, matching the form.** `inferDetailColumns` was hard-capped at 2 columns and the section column count was derived per-section, so a field-heavy record displayed 2 columns in detail but 4 in the edit form. It now uses the same density scale as the form's `inferColumns` (1 → 2 → 3 → 4 by field count) and `deriveFieldGroupDetailSections` derives the count from the object's _total_ field count and stamps it uniformly on every section — so view and edit read at the same width. The responsive grid classes and `getResponsiveSpanClass` ladder were extended through the 3- and 4-column breakpoints, and the effective column count is clamped to the number of visible fields so a lone field never sits at 1/N width.
131
+ - **Long JSON values no longer spill into the neighbouring column.** `JsonCellRenderer` (used by `address`/`json`/`object`/`composite`/`record` fields) applied `truncate` to a bare inline `<span>`, where `overflow:hidden`/`text-overflow:ellipsis` never clip (there is no width box) and the accompanying `white-space:nowrap` also defeated the cell's `break-words`; a long name-keyed map or address JSON therefore overflowed into the adjacent GPS/color cell once the grid narrowed to multi-column. The renderer is now a `block max-w-full` element so `truncate` clamps to the cell width (full value still on hover), and the detail cell wrappers carry `min-w-0` so unbreakable values wrap instead of setting the track's min width.
132
+
133
+ - 68e2d1c: Studio UX audit fixes (objectui#2285) — browser walkthrough of the Studio design surface surfaced one rendering bug and several dead-space/discoverability issues; all fixed and re-verified end to end:
134
+
135
+ - **Bug — mobile card view showed `[object Object]` for lookup fields.** `ObjectGrid`'s narrow-viewport card layout dumped raw field values through `String(value)` instead of reusing the type-aware cell renderer the desktop table already used; a lookup's expanded object (`{ id, name }`) rendered as the literal string. Now routed through the shared `coerceToSafeValue` helper (newly exported from `@object-ui/fields`, alongside `pickRecordDisplayName`) and a hoisted `renderRecordDetail`, matching the desktop path.
136
+ - **Studio has no responsive/mobile layout.** Below the mobile breakpoint, each pillar's rail (Objects / Flows / Nav tree / Permission sets) now collapses into a toggleable overlay drawer instead of permanently squeezing the canvas into ~190px, and the top pillar-tab bar scrolls horizontally instead of clipping Automations/Interfaces/Access off-screen.
137
+ - **Records tab / Automations canvas had a dead space band.** `ObjectView`'s built-in "+ New" toolbar row (a separate, mostly-empty flex row above the grid) is now folded into the grid's own toolbar via a new optional `onAddRecord` passthrough on `renderListView`; the Automations canvas container now sizes to the pillar's full height instead of its own intrinsic content height.
138
+ - **Automations "fit view" never actually zoomed in.** `fitToView`'s zoom calculation was hard-capped at 100%, so small (2-4 node) flows stayed stranded in a corner of a mostly-blank canvas even after fitting. Removed the artificial cap (now bounded only by the existing `MAX_ZOOM`) and auto-fit once on mount so opening a flow starts appropriately zoomed instead of a fixed 100%/pan-0,0 default.
139
+ - **Validations tab didn't default-select the first rule**, unlike the Access pillar's Permission Set list — now consistent.
140
+ - **HTML/React "source" pages left the Properties panel permanently empty** (no selectable block exists for raw JSX/HTML pages). It now shows a contextual message pointing at the source editor instead of the generic "click a block" empty state.
141
+ - **Permission matrix column headers (C/R/U/D/Tr/Re/Pu/VA/MA) had no visible legend** — added one above the matrix (the header cells' native tooltips stay as-is).
142
+ - **App Builder landing page** widened and given the same icon-badge treatment as Home's app cards, with a 3-column grid on wide screens instead of a narrow fixed-width column stranded in the corner of the viewport.
143
+
144
+ - Updated dependencies [226fde9]
145
+ - Updated dependencies [e4de456]
146
+ - @object-ui/types@12.0.0
147
+ - @object-ui/core@12.0.0
148
+ - @object-ui/components@12.0.0
149
+ - @object-ui/providers@12.0.0
150
+ - @object-ui/react@12.0.0
151
+ - @object-ui/i18n@12.0.0
152
+
3
153
  ## 11.5.0
4
154
 
5
155
  ### Patch 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
+ ### Cascading & role-gated select options
59
+
60
+ `select` options support a per-option `visibleWhen` CEL predicate (offered only
61
+ when TRUE, evaluated against the live record + `current_user`) and a field-level
62
+ `dependsOn`. Together they drive dependent selects (country → province → city)
63
+ and role-gated options with no bespoke matrix — the same primitives dependent
64
+ lookups use. While a `dependsOn` parent is empty the control is gated; a parent
65
+ change re-filters the list and clears a now-invalid value. Client-side hiding is
66
+ UX only — gate authorization-sensitive values on the server too. See
67
+ [`content/docs/fields/select.mdx`](../../content/docs/fields/select.mdx).
68
+
58
69
  <!-- release-metadata:v3.3.0 -->
59
70
 
60
71
  ## Compatibility