@object-ui/plugin-list 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 +95 -0
- package/dist/ListView.d.ts +26 -5
- package/dist/ListView.d.ts.map +1 -1
- package/dist/index.js +285 -329
- package/dist/index.umd.cjs +2 -2
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,100 @@
|
|
|
1
1
|
# @object-ui/plugin-list
|
|
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/fields@15.0.0
|
|
13
|
+
- @object-ui/permissions@15.0.0
|
|
14
|
+
- @object-ui/mobile@15.0.0
|
|
15
|
+
|
|
16
|
+
## 14.1.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- dea65f7: Unify the list-view conditional tier onto the canonical CEL engine (#1584).
|
|
21
|
+
|
|
22
|
+
Conditional formatting (list / grid / kanban) and row-action `visible` /
|
|
23
|
+
`disabled` predicates are now evaluated by `@objectstack/formula`'s
|
|
24
|
+
`ExpressionEngine` — the same engine the server uses — instead of the legacy
|
|
25
|
+
JS-dialect `ExpressionEvaluator`, matching how `@objectstack/spec` already types
|
|
26
|
+
these surfaces (`ExpressionInputSchema` / CEL). The whole platform now speaks one
|
|
27
|
+
expression dialect (framework ADR-0058).
|
|
28
|
+
|
|
29
|
+
- `@object-ui/core`: new `evalRowPredicate` + `resolveConditionalFormatting`
|
|
30
|
+
helpers (next to `evalFieldPredicate`). One implementation of all three
|
|
31
|
+
formatting rule shapes; dialect routing (a `{ dialect: 'cel' }` envelope is
|
|
32
|
+
always CEL; a bare string is CEL unless it carries legacy-only syntax
|
|
33
|
+
(`${…}` / `===` / `?.` / `.includes()`), which routes to the old engine with a
|
|
34
|
+
one-time deprecation warning); the native `{ field, operator, value }` form is
|
|
35
|
+
translated to CEL.
|
|
36
|
+
- `@object-ui/react`: new `useRowPredicate` hook (canonical CEL, ambient
|
|
37
|
+
predicate scope merged).
|
|
38
|
+
- Consumers converged: `ListView.evaluateConditionalFormatting` (thin wrapper,
|
|
39
|
+
export kept), `ObjectGrid` row styling (inline copy removed), kanban card
|
|
40
|
+
styles, and the grid / data-table row-action menus. `plugin-view`'s kanban
|
|
41
|
+
branch now forwards top-level `conditionalFormatting` (previously dropped).
|
|
42
|
+
- Row-action `visible` fails **closed** (broken predicate → hidden + warn);
|
|
43
|
+
`disabled` fails soft. The CEL `in` operator (and list membership) now work in
|
|
44
|
+
row predicates — the legacy engine could not parse them.
|
|
45
|
+
- The legacy `FormField.condition: { field, equals/notEquals/in }` is retired to
|
|
46
|
+
a CEL translation (back-compat preserved); `FieldDesigner` migrated to
|
|
47
|
+
`visibleWhen`.
|
|
48
|
+
|
|
49
|
+
Fully back-compat: existing conditional-formatting rules, row-action predicates,
|
|
50
|
+
and form `condition` metadata keep working (translated / routed as needed).
|
|
51
|
+
|
|
52
|
+
- f0f10f5: feat(kanban): default lane field honours the ADR-0085 `stageField` role
|
|
53
|
+
|
|
54
|
+
Kanban views without an explicit `groupByField`/`groupField` hard-coded their
|
|
55
|
+
lane field to the literal `'status'` (in both app-shell's ObjectView options
|
|
56
|
+
and plugin-list's ListView fallback) — ignoring the object's declared
|
|
57
|
+
lifecycle and even inventing a field the object doesn't have. The default now
|
|
58
|
+
resolves through the shared `stageField` detector:
|
|
59
|
+
|
|
60
|
+
1. explicit view config (unchanged, always wins);
|
|
61
|
+
2. the object's `stageField` semantic role;
|
|
62
|
+
3. `stageField: false` → **no default lanes** (the status-shaped field is
|
|
63
|
+
declared non-linear; the board renders its empty state until the view
|
|
64
|
+
picks a lane field explicitly);
|
|
65
|
+
4. else the shared name/type heuristic (status / stage / state / phase by
|
|
66
|
+
name, then status/stage by type) — never a nonexistent field.
|
|
67
|
+
|
|
68
|
+
`detectStatusField` moved from `@object-ui/plugin-detail` to
|
|
69
|
+
`@object-ui/types` (new export, with the `StatusFieldSource` input type) so
|
|
70
|
+
plugin-list and app-shell share the exact semantics; plugin-detail re-exports
|
|
71
|
+
it unchanged.
|
|
72
|
+
|
|
73
|
+
Also fixes ListView's pre-existing rules-of-hooks error while touching the
|
|
74
|
+
file: `useListFieldLabel` wrapped `useObjectLabel()` in try/catch (hook-order
|
|
75
|
+
desync risk; the hook is provider-safe) — same fix as objectui#2595's
|
|
76
|
+
`useFieldLabel`.
|
|
77
|
+
|
|
78
|
+
Behavior change is limited to kanban views with no explicit lane field on
|
|
79
|
+
objects that either declare `stageField` (now honoured), declare
|
|
80
|
+
`stageField: false` (now suppressed), or have no status-shaped field at all
|
|
81
|
+
(previously grouped by a nonexistent `status` into one "undefined" lane; now
|
|
82
|
+
an honest empty state). Objects with a real `status` field — the common case —
|
|
83
|
+
are unchanged.
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 4b0aee6: Fix: a view declaring its `sort` in the `@objectstack/spec` bare-string
|
|
88
|
+
top-level form (`sort: "name desc"` — `ListViewSchema.sort` is
|
|
89
|
+
`string | Array<{field, order}>`) crashed ListView with
|
|
90
|
+
"schema.sort.map is not a function". Found by the spec/renderer
|
|
91
|
+
shape-mismatch audit that followed the dashboard filter-options crash.
|
|
92
|
+
Sort parsing is now a single normalized `parseSortConfig` (exported) that
|
|
93
|
+
accepts the bare string, legacy `"field desc"` array entries, and
|
|
94
|
+
`{ field, order }` objects, and returns `[]` for malformed entries instead
|
|
95
|
+
of throwing. The `@object-ui/types` declaration already carried the union —
|
|
96
|
+
only the implementation missed the string branch.
|
|
97
|
+
|
|
3
98
|
## 14.0.0
|
|
4
99
|
|
|
5
100
|
### Patch Changes
|
package/dist/ListView.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FilterGroup } from '@object-ui/components';
|
|
1
|
+
import { SortItem, FilterGroup } from '@object-ui/components';
|
|
2
2
|
import { ViewType } from './ViewSwitcher';
|
|
3
3
|
import { ListViewSchema } from '@object-ui/types';
|
|
4
4
|
/**
|
|
@@ -50,6 +50,19 @@ export interface ListViewProps {
|
|
|
50
50
|
* E.g., ['status', 'in', ['a','b']] → ['or', ['status','=','a'], ['status','=','b']]
|
|
51
51
|
*/
|
|
52
52
|
export declare function normalizeFilterCondition(condition: any[]): any[];
|
|
53
|
+
/**
|
|
54
|
+
* Format an action identifier string into a human-readable label.
|
|
55
|
+
* e.g., 'send_email' → 'Send Email'
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Normalize a view's `sort` declaration to SortItem[]. @objectstack/spec
|
|
59
|
+
* ListViewSchema.sort is `string | Array<{ field, order }>` — the TOP-LEVEL
|
|
60
|
+
* value may be a bare string ("name desc"); array entries may be strings
|
|
61
|
+
* (legacy "field desc") or `{ field, order }` objects. Calling `.map` on the
|
|
62
|
+
* bare-string form threw "schema.sort.map is not a function" and crashed the
|
|
63
|
+
* list (spec/renderer shape-mismatch audit, objectui#2578 follow-up).
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseSortConfig(sort: unknown): SortItem[];
|
|
53
66
|
/**
|
|
54
67
|
* Normalize an array of filter conditions, expanding `in`/`not in` operators
|
|
55
68
|
* and ensuring consistent AST structure.
|
|
@@ -59,12 +72,20 @@ export declare function convertFilterGroupToAST(group: FilterGroup): any[];
|
|
|
59
72
|
/**
|
|
60
73
|
* Evaluate conditional formatting rules against a record.
|
|
61
74
|
* Returns a CSSProperties object for the first matching rule, or empty object.
|
|
62
|
-
* Supports
|
|
75
|
+
* Supports all three historical rule shapes (spec `{ condition, style }`,
|
|
76
|
+
* ObjectUI `{ expression, … }`, native `{ field, operator, value, … }`).
|
|
77
|
+
*
|
|
78
|
+
* Thin wrapper over `@object-ui/core`'s `resolveConditionalFormatting`, which
|
|
79
|
+
* evaluates every predicate on the canonical CEL engine (with a legacy-dialect
|
|
80
|
+
* fallback) so a list view speaks the same expression dialect the server does
|
|
81
|
+
* (issue #1584 / ADR-0058). Kept exported for back-compat with consumers that
|
|
82
|
+
* evaluate formatting outside the ListView component.
|
|
63
83
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
84
|
+
* @param scope Extra top-level scope (the host predicate scope) bound
|
|
85
|
+
* alongside the row, so `features.*` / `current_user.*`
|
|
86
|
+
* conditions resolve as they do on grid rows / kanban cards.
|
|
66
87
|
*/
|
|
67
|
-
export declare function evaluateConditionalFormatting(record: Record<string, unknown>, rules?: ListViewSchema['conditionalFormatting']): React.CSSProperties;
|
|
88
|
+
export declare function evaluateConditionalFormatting(record: Record<string, unknown>, rules?: ListViewSchema['conditionalFormatting'], scope?: Record<string, unknown>): React.CSSProperties;
|
|
68
89
|
/**
|
|
69
90
|
* Imperative handle exposed by ListView via React.forwardRef.
|
|
70
91
|
* Allows parent components to trigger a data refresh programmatically.
|
package/dist/ListView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAwB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAKhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,C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