@object-ui/plugin-report 4.0.6 → 4.0.8

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,26 @@
1
1
  # @object-ui/plugin-report
2
2
 
3
+ ## 4.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/components@4.0.8
8
+ - @object-ui/fields@4.0.8
9
+ - @object-ui/react@4.0.8
10
+ - @object-ui/types@4.0.8
11
+ - @object-ui/core@4.0.8
12
+
13
+ ## 4.0.7
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [7c9b85c]
18
+ - @object-ui/core@4.0.7
19
+ - @object-ui/react@4.0.7
20
+ - @object-ui/components@4.0.7
21
+ - @object-ui/fields@4.0.7
22
+ - @object-ui/types@4.0.7
23
+
3
24
  ## 4.0.6
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -6,6 +6,7 @@ Report components for Object UI — build, view, render, and export reports with
6
6
 
7
7
  - 📊 **Report Builder** - Visual drag-and-drop report construction
8
8
  - 👁️ **Report Viewer** - Interactive report viewing with toolbar controls
9
+ - 🎨 **Type-aware cells** - select → Badge, lookup → link, boolean → ✓/✗, email/url/phone → mailto/external/tel links, image → thumbnail, etc. (auto-hydrated from object metadata)
9
10
  - 🖨️ **Report Renderer** - Render reports from JSON definitions with charts
10
11
  - 📤 **Multi-Format Export** - Export to CSV, JSON, HTML, PDF, and Excel
11
12
  - 🔄 **Live Data Export** - Export with real-time data via `exportWithLiveData`
@@ -132,6 +133,67 @@ Components auto-register with `ComponentRegistry`:
132
133
  }
133
134
  ```
134
135
 
136
+ ### Type-aware cell rendering
137
+
138
+ `ReportViewer` delegates cell rendering to the shared `getCellRenderer`
139
+ registry from `@object-ui/fields`, so each column is rendered with the
140
+ component appropriate for its type — instead of `String(value)`.
141
+
142
+ | `field.type` | Rendering |
143
+ | ----------------------------- | --------------------------------------------- |
144
+ | `text` / `string` | Plain text |
145
+ | `number` / `currency` / `percent` | Locale-formatted, optional currency/percent symbol |
146
+ | `boolean` | ✓ / ✗ icons |
147
+ | `date` / `datetime` / `time` | Localised date/time |
148
+ | `select` / `multi_select` / `status` | Badge(s), label resolved from `options`, color from `option.color` or `colorMap` |
149
+ | `lookup` / `reference` / `master_detail` | Linked record name (id fallback), deep-link to `/console/apps/<app>/<referenceTo>/record/<id>` |
150
+ | `email` | `mailto:` link |
151
+ | `url` | External link (`target="_blank"`) |
152
+ | `phone` | `tel:` link |
153
+ | `image` | Inline thumbnail |
154
+ | `file` | Filename + download link |
155
+ | `user` / `owner` | Avatar + name |
156
+ | `richtext` / `html` / `markdown` | Sanitised inline content |
157
+ | `json` | Collapsed code preview |
158
+
159
+ Authors do **not** need to repeat type metadata on every report column:
160
+ when a report binds an `objectName`, the runtime auto-hydrates each
161
+ column's `type`, `options`, `referenceTo`, and `label` from the
162
+ corresponding `ObjectField`. Author-provided values always win.
163
+
164
+ Minimal report leveraging type-aware cells:
165
+
166
+ ```ts
167
+ import type { ReportInput } from '@objectstack/spec/ui';
168
+
169
+ export const ContactsReport: ReportInput = {
170
+ name: 'contacts_by_account',
171
+ label: 'Contacts by Account',
172
+ objectName: 'contact', // ← enables auto-hydration
173
+ type: 'tabular',
174
+ columns: [
175
+ { field: 'full_name', label: 'Name' },
176
+ { field: 'email', label: 'Email' }, // → mailto:
177
+ { field: 'phone', label: 'Phone' }, // → tel:
178
+ { field: 'is_primary', label: 'Primary' }, // → ✓/✗
179
+ { field: 'account', label: 'Account' }, // → linked record
180
+ { field: 'status', label: 'Status' }, // → Badge with option color
181
+ ],
182
+ };
183
+ ```
184
+
185
+ Override per column when needed:
186
+
187
+ ```ts
188
+ columns: [
189
+ { field: 'tier', label: 'Tier', type: 'select',
190
+ options: [{ value: 'gold', label: 'Gold', color: 'amber' }] },
191
+ ]
192
+ ```
193
+
194
+ Legacy `renderAs: 'badge'` + `colorMap` is still honoured for plain
195
+ string columns.
196
+
135
197
  <!-- release-metadata:v3.3.0 -->
136
198
 
137
199
  ## Compatibility