Skip to content

Commit 5547a5a

Browse files
committed
merge origin/main: regenerate component.mdx on the merged tree (os-regen step 3 hand-off)
The os-regen driver kept this branch's side of content/docs/references/ui/component.mdx in the merge commit and dropped main's object-metric rows from #21622. Step 2 restored main's side; this commit regenerates the page from the merged source with gen:schema and gen:docs. Result: main's side plus this branch's one `sortField` row, and the delta against the branch side is exactly #21622's own delta on the page. Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 71395f8 commit 5547a5a

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

‎content/docs/references/ui/component.mdx‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ Sort field and direction pair
11061106
| **title** | `string \| Record<string, string>` | optional | Drill-down panel title; defaults to the metric label |
11071107
| **icon** | `string` | optional | Lucide icon name drawn in the metric tile header, inside the `colorVariant`-tinted square. Read on this component — `ObjectMetricWidget` forwards it to `MetricWidget`, which resolves it with `getLazyIcon` (the `LazyIcon` module: kebab-case or PascalCase, degrading to the `Database` glyph on an unknown name). |
11081108
| **colorVariant** | `Enum<'default' \| 'blue' \| 'teal' \| 'orange' \| 'purple' \| 'success' \| 'warning' \| 'danger'>` | optional | Icon container color variant |
1109-
| **aggregate** | `any` | optional | Aggregation config (`{ field, function, groupBy? }`) run against the object |
1109+
| **aggregate** | `{ field?: string; function: Enum<'count' \| 'sum' \| 'avg' \| 'min' \| 'max' \| 'count_distinct'>; groupBy?: string \| object }` | optional | Aggregation run against the object: `{ field?, function, groupBy? }` — `function` one of count / sum / avg / min / max / count_distinct (`field` needed for all but count), `groupBy` a field name or a `{ field, dateGranularity }` node, absent for one number over every row |
11101110
| **filter** | `{ field: string; operator: Enum<'equals' \| 'not_equals' \| 'contains' \| 'not_contains' \| 'icontains' \| …>; value?: string \| number \| boolean \| null \| (string \| number)[] }[]` | optional | Filter the aggregation is scoped by — the ViewFilterRule array form `[{ field, operator, value }, ...]`, the one filter orthography every `filter` door in this map shares. The MongoDB-style record form is refused — see migration `element-data-source-and-object-block-filter-rule-array` |
11111111
| **format** | `string` | optional | Number format pattern (e.g. '0,0', '$0,0', '0%') |
11121112
| **currency** | `string` | optional | ISO currency code (e.g. 'USD') — enables currency formatting |
@@ -1115,10 +1115,18 @@ Sort field and direction pair
11151115
| **invert** | `boolean` | optional | Display `1 - value` for opposite-signal gauges (compliance/uptime) |
11161116
| **variant** | `Enum<'card' \| 'bare'>` | optional | Layout variant |
11171117
| **fallbackValue** | `string \| number` | optional | Static value shown when no data source is available |
1118-
| **trend** | `any` | optional | Static trend info (`{ value, label, direction }`) |
1118+
| **trend** | `{ value: number; label?: string \| Record<string, string>; direction?: Enum<'up' \| 'down' \| 'neutral'> }` | optional | Static trend badge `{ value, label?, direction? }` — `value` painted as a percentage, `direction` up / down / neutral. A `compareTo`-derived trend replaces it |
11191119
| **drillDown** | `any` | optional | Click-through drill config — opens the underlying records |
11201120
| **compareTo** | `any` | optional | Period-over-period comparison (`{ kind: 'previousPeriod' \| 'previousYear' }`) |
11211121

1122+
### Nested Shape: `ObjectMetricProps.aggregate`
1123+
1124+
| Property | Type | Required | Description |
1125+
| :--- | :--- | :--- | :--- |
1126+
| **field** | `string` | optional | Field to aggregate — required for every function but `count`, which counts rows |
1127+
| **function** | `Enum<'count' \| 'sum' \| 'avg' \| 'min' \| 'max' \| 'count_distinct'>` | ✅ | Aggregation function — `count`, `sum`, `avg`, `min`, `max` or `count_distinct` |
1128+
| **groupBy** | `string \| { field: string; dateGranularity?: Enum<'day' \| 'week' \| 'month' \| 'quarter' \| 'year'>; alias?: string }` | optional | Field the rows are grouped by, or a `{ field, dateGranularity }` date-bucket node. Omit it for the one number over every row (`_all`) |
1129+
11221130
### Nested Shape: `ObjectMetricProps.filter[number]`
11231131

11241132
View filter rule
@@ -1129,6 +1137,14 @@ View filter rule
11291137
| **operator** | `Enum<'equals' \| 'not_equals' \| 'contains' \| 'not_contains' \| 'icontains' \| …>` | ✅ | Filter operator |
11301138
| **value** | `string \| number \| boolean \| null \| (string \| number)[]` | optional | Filter value. The accepted SHAPE depends on the operator: `in` / `not_in` take an array (any length, including []), `between` takes exactly [min, max], every other operator takes a scalar. The unary operators (is_empty / is_not_empty / is_null / is_not_null) take their direction from the operator name and ignore this key. One operator bounds the VALUE as well as the shape: `icontains` takes a NON-EMPTY STRING, the comparand the Filter Protocol conformance table declares for it — an empty comparand constrains nothing and a non-string one would answer a query nobody wrote, and both are refused at the query path too. |
11311139

1140+
### Nested Shape: `ObjectMetricProps.trend`
1141+
1142+
| Property | Type | Required | Description |
1143+
| :--- | :--- | :--- | :--- |
1144+
| **value** | `number` | ✅ | The change shown on the badge, painted as a percentage (`12` reads `12%`) |
1145+
| **label** | `string \| Record<string, string>` | optional | Badge caption — a string or an inline locale map. The tile-level `description` outranks it in the one caption slot they share |
1146+
| **direction** | `Enum<'up' \| 'down' \| 'neutral'>` | optional | Arrow beside the value; omit it for no arrow |
1147+
11321148

11331149
---
11341150

0 commit comments

Comments
 (0)