@object-ui/fields 11.4.0 → 13.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/CHANGELOG.md +115 -0
- package/README.md +11 -0
- package/dist/__tests__/DateCellRenderer.test.d.ts +0 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +15 -2
- package/dist/index.js +1555 -1497
- package/dist/widgets/SelectField.cascade.test.d.ts +0 -0
- package/dist/widgets/SelectField.d.ts +10 -3
- package/dist/widgets/openNativePicker.d.ts +11 -0
- package/package.json +8 -8
- package/src/__tests__/DateCellRenderer.test.tsx +50 -0
- package/src/index.tsx +64 -27
- package/src/widgets/DateField.tsx +5 -0
- package/src/widgets/DateTimeField.tsx +5 -0
- package/src/widgets/SelectField.cascade.test.tsx +138 -0
- package/src/widgets/SelectField.tsx +74 -14
- package/src/widgets/TimeField.tsx +5 -0
- package/src/widgets/openNativePicker.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
# @object-ui/fields
|
|
2
2
|
|
|
3
|
+
## 13.1.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @object-ui/types@13.1.0
|
|
8
|
+
- @object-ui/core@13.1.0
|
|
9
|
+
- @object-ui/i18n@13.1.0
|
|
10
|
+
- @object-ui/react@13.1.0
|
|
11
|
+
- @object-ui/components@13.1.0
|
|
12
|
+
- @object-ui/providers@13.1.0
|
|
13
|
+
|
|
14
|
+
## 13.0.0
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [9e38270]
|
|
19
|
+
- Updated dependencies [ac04b76]
|
|
20
|
+
- Updated dependencies [619097e]
|
|
21
|
+
- @object-ui/i18n@13.0.0
|
|
22
|
+
- @object-ui/components@13.0.0
|
|
23
|
+
- @object-ui/types@13.0.0
|
|
24
|
+
- @object-ui/react@13.0.0
|
|
25
|
+
- @object-ui/core@13.0.0
|
|
26
|
+
- @object-ui/providers@13.0.0
|
|
27
|
+
|
|
28
|
+
## 12.1.0
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 6cbccf3: Localize form validation messages, toast client-side validation failures, and make native date/time picker icons legible in dark mode.
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [6cbccf3]
|
|
41
|
+
- Updated dependencies [e1840bf]
|
|
42
|
+
- Updated dependencies [c31874d]
|
|
43
|
+
- @object-ui/components@12.1.0
|
|
44
|
+
- @object-ui/i18n@12.1.0
|
|
45
|
+
- @object-ui/types@12.1.0
|
|
46
|
+
- @object-ui/react@12.1.0
|
|
47
|
+
- @object-ui/core@12.1.0
|
|
48
|
+
- @object-ui/providers@12.1.0
|
|
49
|
+
|
|
50
|
+
## 12.0.0
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- 226fde9: Cascading & role-gated `select` options (#2284).
|
|
55
|
+
|
|
56
|
+
`select` options now accept a per-option `visibleWhen` CEL predicate — the option
|
|
57
|
+
is offered only when it evaluates TRUE against the live record **plus
|
|
58
|
+
`current_user`** (same engine/env as a field-level `visibleWhen`). Combined with a
|
|
59
|
+
field-level `dependsOn`, this drives dependent selects (country → province → city)
|
|
60
|
+
and role/context gating with no bespoke matrix — the same primitives dependent
|
|
61
|
+
lookups (#2215) already use.
|
|
62
|
+
|
|
63
|
+
- `@object-ui/core` exposes `resolveVisibleOptions` / `isOptionGroupGated` /
|
|
64
|
+
`resolveDependsOnFields` / `isValueStillOffered` (evaluator), reusing the
|
|
65
|
+
canonical `evalFieldPredicate`.
|
|
66
|
+
- The form renderer narrows a dependent select's option list, gates the control
|
|
67
|
+
with a "Select {parent} first" hint while a `dependsOn` field is empty, and
|
|
68
|
+
clears a now-invalid value when the parent changes.
|
|
69
|
+
- The standalone `SelectField` widget applies the same resolution via
|
|
70
|
+
`dependentValues` + the global predicate scope.
|
|
71
|
+
|
|
72
|
+
Client-side hiding is UX, not authorization: gate authorization-sensitive option
|
|
73
|
+
values on the server too. Aligns with `@objectstack/spec` `SelectOption.visibleWhen`.
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- e36a9c7: Align the DetailView column density with the entry form (objectui#2578 "多列显示").
|
|
78
|
+
|
|
79
|
+
- **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.
|
|
80
|
+
- **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.
|
|
81
|
+
|
|
82
|
+
- 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:
|
|
83
|
+
|
|
84
|
+
- **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.
|
|
85
|
+
- **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.
|
|
86
|
+
- **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.
|
|
87
|
+
- **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.
|
|
88
|
+
- **Validations tab didn't default-select the first rule**, unlike the Access pillar's Permission Set list — now consistent.
|
|
89
|
+
- **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.
|
|
90
|
+
- **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).
|
|
91
|
+
- **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.
|
|
92
|
+
|
|
93
|
+
- Updated dependencies [226fde9]
|
|
94
|
+
- Updated dependencies [e4de456]
|
|
95
|
+
- @object-ui/types@12.0.0
|
|
96
|
+
- @object-ui/core@12.0.0
|
|
97
|
+
- @object-ui/components@12.0.0
|
|
98
|
+
- @object-ui/providers@12.0.0
|
|
99
|
+
- @object-ui/react@12.0.0
|
|
100
|
+
- @object-ui/i18n@12.0.0
|
|
101
|
+
|
|
102
|
+
## 11.5.0
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- Updated dependencies [544d8eb]
|
|
107
|
+
- Updated dependencies [6fffd3d]
|
|
108
|
+
- Updated dependencies [9255686]
|
|
109
|
+
- Updated dependencies [fae75e2]
|
|
110
|
+
- Updated dependencies [1072701]
|
|
111
|
+
- @object-ui/i18n@11.5.0
|
|
112
|
+
- @object-ui/react@11.5.0
|
|
113
|
+
- @object-ui/components@11.5.0
|
|
114
|
+
- @object-ui/types@11.5.0
|
|
115
|
+
- @object-ui/core@11.5.0
|
|
116
|
+
- @object-ui/providers@11.5.0
|
|
117
|
+
|
|
3
118
|
## 11.4.0
|
|
4
119
|
|
|
5
120
|
### 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
|
+
### 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
|
|
File without changes
|