@object-ui/plugin-form 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 +127 -0
- package/dist/DrawerForm.d.ts +2 -0
- package/dist/MasterDetailForm.d.ts +3 -0
- package/dist/ModalForm.d.ts +4 -0
- package/dist/SplitForm.d.ts +4 -0
- package/dist/TabbedForm.d.ts +8 -0
- package/dist/WizardForm.d.ts +12 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +249 -166
- package/dist/index.umd.cjs +1 -1
- package/dist/successBehavior.d.ts +3 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,132 @@
|
|
|
1
1
|
# @object-ui/plugin-form
|
|
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/fields@13.1.0
|
|
13
|
+
- @object-ui/permissions@13.1.0
|
|
14
|
+
|
|
15
|
+
## 13.0.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [9e38270]
|
|
20
|
+
- Updated dependencies [ac04b76]
|
|
21
|
+
- Updated dependencies [619097e]
|
|
22
|
+
- @object-ui/i18n@13.0.0
|
|
23
|
+
- @object-ui/components@13.0.0
|
|
24
|
+
- @object-ui/types@13.0.0
|
|
25
|
+
- @object-ui/fields@13.0.0
|
|
26
|
+
- @object-ui/react@13.0.0
|
|
27
|
+
- @object-ui/core@13.0.0
|
|
28
|
+
- @object-ui/permissions@13.0.0
|
|
29
|
+
|
|
30
|
+
## 12.1.0
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 195121a: Studio form designer + preview now match the runtime form's column density.
|
|
35
|
+
|
|
36
|
+
The Data pillar's **Form → Layout** designer laid every section out in a fixed 2-column grid capped at `max-w-3xl`, and **Form → Preview** capped the real `ObjectForm` at `max-w-2xl`. So on a wide screen the studio showed at most 2 columns while the record the end user actually edits spreads to up to 4 — the design surface misrepresented the real layout.
|
|
37
|
+
|
|
38
|
+
`ObjectFormDesigner` now derives its column count the same way the runtime form does (`inferColumns` over the object's editable field count, objectui#2578) and lays each section out with the shared container-query grid classes (`containerGridColsFor`) inside a per-section `@container`, so a field-heavy object reaches 4 fields per row on wide screens and collapses to one column when the panel is narrow. Wide widgets (textarea/markdown/html/…) span the full row, mirroring the form. Both the layout and preview canvases were widened to `max-w-6xl` so the container queries can actually reach 4 columns. `containerGridColsFor` is now exported from `@object-ui/plugin-form` as the single source of truth for these grid classes.
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [6cbccf3]
|
|
41
|
+
- Updated dependencies [e1840bf]
|
|
42
|
+
- Updated dependencies [c31874d]
|
|
43
|
+
- @object-ui/components@12.1.0
|
|
44
|
+
- @object-ui/fields@12.1.0
|
|
45
|
+
- @object-ui/i18n@12.1.0
|
|
46
|
+
- @object-ui/types@12.1.0
|
|
47
|
+
- @object-ui/react@12.1.0
|
|
48
|
+
- @object-ui/core@12.1.0
|
|
49
|
+
- @object-ui/permissions@12.1.0
|
|
50
|
+
|
|
51
|
+
## 12.0.0
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- e4de456: Fix form section grouping inconsistencies found in a UX review of grouped forms:
|
|
56
|
+
|
|
57
|
+
- **Unified section visual language.** `FormSection`'s Card-wrapped path (used by Modal/Split/Tabbed/Wizard forms) previously rendered as a nearly-invisible white-on-white card (same `bg-card` as the page background, distinguished only by a barely-visible shadow) with a duplicated, inconsistent header (different title size, and a collapse chevron positioned differently) versus the flat `SectionDivider` path used by simple/drawer forms. Both now share the same header treatment (`text-sm font-semibold`, inline-left chevron, bottom border), and the Card path gets a soft `bg-muted/40` tint so grouped sections are visually distinguishable without relying on shadow alone.
|
|
58
|
+
- **`readonly` no longer renders as `disabled`.** A field marked `readonly` (statically or via `readonlyWhen`) was being folded into the `disabled` prop before reaching field widgets, so widgets with a dedicated readonly display (e.g. `EmailField`'s mailto link, `TextField`'s plain-text view) never received it — every readonly field just looked permanently disabled. `readonly` is now forwarded as its own prop; generic `input`/`textarea` fields get a distinct readonly style (`bg-muted/40`, no `cursor-not-allowed`) instead of the disabled look.
|
|
59
|
+
- **Section `className`/`gridClassName` now flow through JSON schemas.** `ObjectFormSection` and the per-form-variant section configs (`ModalFormSectionConfig`, `SplitFormSectionConfig`, `FormSectionConfig`, `DrawerFormSectionConfig`) accept `className` (and `gridClassName` where applicable), wired through `ObjectForm`'s form-type dispatch into `FormSection`/`SectionDivider` — closing a gap where section wrappers couldn't be customized from schema despite `FormSection` itself already supporting it.
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies [226fde9]
|
|
64
|
+
- Updated dependencies [e36a9c7]
|
|
65
|
+
- Updated dependencies [e4de456]
|
|
66
|
+
- Updated dependencies [68e2d1c]
|
|
67
|
+
- @object-ui/types@12.0.0
|
|
68
|
+
- @object-ui/core@12.0.0
|
|
69
|
+
- @object-ui/components@12.0.0
|
|
70
|
+
- @object-ui/fields@12.0.0
|
|
71
|
+
- @object-ui/permissions@12.0.0
|
|
72
|
+
- @object-ui/react@12.0.0
|
|
73
|
+
- @object-ui/i18n@12.0.0
|
|
74
|
+
|
|
75
|
+
## 11.5.0
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- fae75e2: Fix two bugs verified still-present after #2254 claimed to resolve them (framework#2620 / framework#2616 Showcase UX pass, tracked in #2268):
|
|
80
|
+
|
|
81
|
+
- **Wizard/form `submitBehavior: 'thank-you'` allowed duplicate resubmission.** #2254 fixed the spec-bridge dropping `submitBehavior` before it reached the renderer, so the configured toast message started appearing — but `WizardForm`'s last step and `ObjectForm`'s submit handler only ever called `toast.success(...)` for `thank-you`/`next-record`; the form stayed mounted and fully filled with its submit button re-enabled once the request settled, so a second click created a second record. Both components now track a terminal `submitted` state and, when set, replace the form with a confirmation panel (using the behavior's `title`/`message`, which were also never read before) — mirroring the pattern `apps/console/src/components/FormPage.tsx` already used for its own standalone forms.
|
|
82
|
+
|
|
83
|
+
- **Command Center-style 3-up chart bands stayed collapsed to ~100-130px, and a dataset-bound chart's measure leaked its raw field name.**
|
|
84
|
+
- `responsiveStyles` (and `style`) were declared on the page-spec `PageComponent` bridge input type but never copied onto the `SchemaNode` in `spec-bridge/bridges/page.ts::mapComponent()` — so a page author's ADR-0065 layout override (e.g. forcing `display: 'grid'` on a `type: 'flex'` band) never reached `SchemaRenderer`, and the node silently fell back to its default flex layout. Both fields are now mapped through.
|
|
85
|
+
- `ObjectChart`'s dataset-bound fetch path (`schema.dataset` + `ds.queryDataset(...)`) discarded the response's `fields` array (which carries each measure's `label`, e.g. `{ name: 'task_count', label: 'Tasks' }`) before it ever reached `buildChartSeries()` — whose `fields` param already resolves this correctly (see `chart-series.test.ts`) — so the legend/tooltip always fell back to the raw field name. The fetched `fields` are now captured and threaded through.
|
|
86
|
+
|
|
87
|
+
- ec9c8ee: Fix master-detail record create: stop double success toast + localize the Cancel button.
|
|
88
|
+
|
|
89
|
+
Objects with inline subforms (master-detail, e.g. a Lead with product line items)
|
|
90
|
+
render `MasterDetailForm` inside `ModalForm`/`DrawerForm` instead of the plain
|
|
91
|
+
footer, which exposed two mismatches with the host contract:
|
|
92
|
+
|
|
93
|
+
- **Double success toast.** Flat `ObjectForm` delegates confirmation to the host
|
|
94
|
+
when an `onSuccess` is supplied (skips its own default toast), but
|
|
95
|
+
`MasterDetailForm.handleSaved` ALWAYS toasted `Created`/`Saved` AND ran
|
|
96
|
+
`onSuccess`. In the console the host's `onSuccess` chains into the `crud_success`
|
|
97
|
+
handler, which toasts a localized message — so create fired both `Created` and
|
|
98
|
+
e.g. `线索创建成功`. `handleSaved` now only toasts as a fallback when no host
|
|
99
|
+
`onSuccess` is provided, matching the `ObjectForm` contract; saves without a host
|
|
100
|
+
handler stay non-silent.
|
|
101
|
+
|
|
102
|
+
- **Hardcoded English `Cancel`.** The master-detail action bar wrote `Cancel` as a
|
|
103
|
+
literal and accepted no `cancelText`, so the button stayed English while the
|
|
104
|
+
submit button was localized (`submitText` was already forwarded).
|
|
105
|
+
`MasterDetailForm` now takes `cancelText`, and `ModalForm`/`DrawerForm`/`ObjectForm`
|
|
106
|
+
forward the host's localized label down the subforms branch.
|
|
107
|
+
|
|
108
|
+
Adds regression tests: create with a host `onSuccess` fires no built-in toast (no
|
|
109
|
+
double-confirm), and the Cancel button renders the host-supplied `cancelText`.
|
|
110
|
+
|
|
111
|
+
- 6c1ad9e: Record task flows open as derived overlays with lossless return (framework#2604, extends framework#2578).
|
|
112
|
+
|
|
113
|
+
- **Create/Edit never route** — the global record form is URL-driven (`?form=new` / `?form=<id>`): browser Back closes the overlay with the origin (list scroll/filters, detail state) intact; field-heavy objects derive a full-screen modal (`modalSize:'full'`) via the new `deriveRecordFlowSurface` mirror in plugin-view, light ones keep the auto-sized modal. `editMode:'page'` opt-in unchanged.
|
|
114
|
+
- **Save invariant** — _edit never moves you_ (origin refetches in place); _create lands on the new record's detail_ on its derived surface (drawer over the still-intact list for light objects, detail route for heavy), with `replace:true` so Back skips the transient form entry.
|
|
115
|
+
- **Subtable child create/edit = overlay over the parent detail, never a route** — related-list New/Edit push `?form=…&formObject=<child>&formLink=<fk>:<parentId>`; the one global overlay pre-links the parent (refresh-safe), sizes to the CHILD object, and on save stays on the parent while only the child's related lists refetch. ModalForm now forwards `initialValues` into its master-detail (subforms) branch so pre-links survive for children with inline line items.
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [544d8eb]
|
|
118
|
+
- Updated dependencies [6fffd3d]
|
|
119
|
+
- Updated dependencies [9255686]
|
|
120
|
+
- Updated dependencies [fae75e2]
|
|
121
|
+
- Updated dependencies [1072701]
|
|
122
|
+
- @object-ui/i18n@11.5.0
|
|
123
|
+
- @object-ui/react@11.5.0
|
|
124
|
+
- @object-ui/components@11.5.0
|
|
125
|
+
- @object-ui/types@11.5.0
|
|
126
|
+
- @object-ui/fields@11.5.0
|
|
127
|
+
- @object-ui/core@11.5.0
|
|
128
|
+
- @object-ui/permissions@11.5.0
|
|
129
|
+
|
|
3
130
|
## 11.4.0
|
|
4
131
|
|
|
5
132
|
### Minor Changes
|
package/dist/DrawerForm.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface DrawerFormSectionConfig {
|
|
|
8
8
|
fields: (string | FormField)[];
|
|
9
9
|
collapsible?: boolean;
|
|
10
10
|
collapsed?: boolean;
|
|
11
|
+
/** Custom CSS class for the section's divider header. */
|
|
12
|
+
className?: string;
|
|
11
13
|
}
|
|
12
14
|
export interface DrawerFormSchema {
|
|
13
15
|
type: 'object-form';
|
|
@@ -48,6 +48,9 @@ export interface MasterDetailFormSchema {
|
|
|
48
48
|
formType?: 'simple' | 'tabbed';
|
|
49
49
|
title?: string;
|
|
50
50
|
submitText?: string;
|
|
51
|
+
/** Label for the Cancel button in the action bar. i18n is the host's job
|
|
52
|
+
* (this plugin is locale-agnostic); defaults to English 'Cancel'. */
|
|
53
|
+
cancelText?: string;
|
|
51
54
|
/** Hide the bottom Save/Cancel action bar — e.g. a non-persisting design
|
|
52
55
|
* preview. Defaults to shown (the form owns the only Save in this layout). */
|
|
53
56
|
showSubmit?: boolean;
|
package/dist/ModalForm.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface ModalFormSectionConfig {
|
|
|
6
6
|
description?: string;
|
|
7
7
|
columns?: 1 | 2 | 3 | 4;
|
|
8
8
|
fields: (string | FormField)[];
|
|
9
|
+
/** Custom CSS class for the section's Card wrapper. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Custom CSS class for the section's field grid. */
|
|
12
|
+
gridClassName?: string;
|
|
9
13
|
}
|
|
10
14
|
export interface ModalFormSchema {
|
|
11
15
|
type: 'object-form';
|
package/dist/SplitForm.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface SplitFormSectionConfig {
|
|
|
6
6
|
description?: string;
|
|
7
7
|
columns?: 1 | 2 | 3 | 4;
|
|
8
8
|
fields: (string | FormField)[];
|
|
9
|
+
/** Custom CSS class for the section's Card wrapper. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Custom CSS class for the section's field grid. */
|
|
12
|
+
gridClassName?: string;
|
|
9
13
|
}
|
|
10
14
|
export interface SplitFormSchema {
|
|
11
15
|
type: 'object-form';
|
package/dist/TabbedForm.d.ts
CHANGED
|
@@ -22,6 +22,14 @@ export interface FormSectionConfig {
|
|
|
22
22
|
* Field names or configurations in this section
|
|
23
23
|
*/
|
|
24
24
|
fields: (string | FormField)[];
|
|
25
|
+
/**
|
|
26
|
+
* Custom CSS class for the section's Card wrapper.
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Custom CSS class for the section's field grid.
|
|
31
|
+
*/
|
|
32
|
+
gridClassName?: string;
|
|
25
33
|
}
|
|
26
34
|
export interface TabbedFormSchema {
|
|
27
35
|
type: 'object-form';
|
package/dist/WizardForm.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DataSource } from '@object-ui/types';
|
|
3
|
+
import { SubmitBehavior } from './successBehavior';
|
|
3
4
|
import { FormSectionConfig } from './TabbedForm';
|
|
4
5
|
export interface WizardFormSchema {
|
|
5
6
|
type: 'object-form';
|
|
@@ -47,15 +48,24 @@ export interface WizardFormSchema {
|
|
|
47
48
|
/**
|
|
48
49
|
* Declarative success toast text shown when no `onSuccess` handler is given
|
|
49
50
|
* (metadata pages cannot pass a function). Falls back to 'Created'/'Saved'.
|
|
51
|
+
* Ignored when `submitBehavior` is set.
|
|
50
52
|
*/
|
|
51
53
|
successMessage?: string;
|
|
52
54
|
/** Navigate here after a successful create/update (declarative; metadata
|
|
53
55
|
* pages can't pass onSuccess). Supports `{id}`/`{recordId}` interpolation
|
|
54
|
-
* from the saved record. Same-origin-guarded. Takes precedence over the toast.
|
|
56
|
+
* from the saved record. Same-origin-guarded. Takes precedence over the toast.
|
|
57
|
+
* Ignored when `submitBehavior` is set. */
|
|
55
58
|
navigateOnSuccess?: string;
|
|
56
59
|
/** Reset the wizard (back to step 1, cleared) after a successful create so the
|
|
57
|
-
* user can enter another. Ignored when `navigateOnSuccess`
|
|
60
|
+
* user can enter another. Ignored when `navigateOnSuccess` or `submitBehavior`
|
|
61
|
+
* is set. */
|
|
58
62
|
resetOnSuccess?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Declarative post-submit behavior aligned with `@objectstack/spec`'s
|
|
65
|
+
* `FormView.submitBehavior`. When present, takes precedence over
|
|
66
|
+
* `successMessage` / `navigateOnSuccess` / `resetOnSuccess`.
|
|
67
|
+
*/
|
|
68
|
+
submitBehavior?: SubmitBehavior;
|
|
59
69
|
/**
|
|
60
70
|
* Show cancel button
|
|
61
71
|
* @default true
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { ObjectForm };
|
|
|
3
3
|
export type { ObjectFormProps } from './ObjectForm';
|
|
4
4
|
export { FormSection } from './FormSection';
|
|
5
5
|
export type { FormSectionProps } from './FormSection';
|
|
6
|
-
export { applyAutoLayout, inferColumns, inferModalSize, isWideFieldType, isAutoGeneratedFieldType, applyAutoColSpan, filterCreateModeFields, filterSystemFields, filterAutoGeneratedFields, } from './autoLayout';
|
|
6
|
+
export { applyAutoLayout, inferColumns, inferModalSize, isWideFieldType, isAutoGeneratedFieldType, applyAutoColSpan, containerGridColsFor, filterCreateModeFields, filterSystemFields, filterAutoGeneratedFields, } from './autoLayout';
|
|
7
7
|
export { TabbedForm } from './TabbedForm';
|
|
8
8
|
export type { TabbedFormProps, TabbedFormSchema, FormSectionConfig } from './TabbedForm';
|
|
9
9
|
export { WizardForm } from './WizardForm';
|