@object-ui/plugin-dashboard 17.6.0 → 18.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +5044 -0
  2. package/README.md +465 -85
  3. package/dist/DashboardConfigPanel.d.ts +1 -1
  4. package/dist/DashboardFilterBar.d.ts.map +1 -1
  5. package/dist/DashboardGridLayout.d.ts +10 -8
  6. package/dist/DashboardGridLayout.d.ts.map +1 -1
  7. package/dist/DashboardRenderer.d.ts +60 -2
  8. package/dist/DashboardRenderer.d.ts.map +1 -1
  9. package/dist/DashboardWithConfig.d.ts +1 -1
  10. package/dist/DashboardWithConfig.d.ts.map +1 -1
  11. package/dist/DatasetWidget.d.ts +41 -14
  12. package/dist/DatasetWidget.d.ts.map +1 -1
  13. package/dist/DrillDownDrawer.d.ts +14 -5
  14. package/dist/DrillDownDrawer.d.ts.map +1 -1
  15. package/dist/MetricCard.d.ts +7 -1
  16. package/dist/MetricCard.d.ts.map +1 -1
  17. package/dist/MetricWidget.d.ts +48 -6
  18. package/dist/MetricWidget.d.ts.map +1 -1
  19. package/dist/ObjectDataTable.d.ts +407 -18
  20. package/dist/ObjectDataTable.d.ts.map +1 -1
  21. package/dist/ObjectMetricWidget.d.ts +35 -8
  22. package/dist/ObjectMetricWidget.d.ts.map +1 -1
  23. package/dist/ObjectPivotTable.d.ts +47 -7
  24. package/dist/ObjectPivotTable.d.ts.map +1 -1
  25. package/dist/PivotTable.d.ts +20 -3
  26. package/dist/PivotTable.d.ts.map +1 -1
  27. package/dist/RecordDetailDrawer.d.ts +21 -2
  28. package/dist/RecordDetailDrawer.d.ts.map +1 -1
  29. package/dist/WidgetConfigPanel.d.ts +2 -2
  30. package/dist/WidgetConfigPanel.d.ts.map +1 -1
  31. package/dist/WidgetEmptyState.d.ts +27 -0
  32. package/dist/WidgetEmptyState.d.ts.map +1 -0
  33. package/dist/chartRenderHandoff.d.ts +9 -0
  34. package/dist/chartRenderHandoff.d.ts.map +1 -0
  35. package/dist/domPassthroughPins.d.ts.map +1 -1
  36. package/dist/index.d.ts +22 -21
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +1977 -1715
  39. package/dist/index.umd.cjs +3 -2
  40. package/dist/legacyRetiredWidget.d.ts +28 -3
  41. package/dist/legacyRetiredWidget.d.ts.map +1 -1
  42. package/dist/measureRefusal.d.ts +50 -0
  43. package/dist/measureRefusal.d.ts.map +1 -0
  44. package/dist/metricTile.d.ts +87 -0
  45. package/dist/metricTile.d.ts.map +1 -0
  46. package/dist/recordFields.d.ts +119 -8
  47. package/dist/recordFields.d.ts.map +1 -1
  48. package/dist/retired-node-types.d.ts +29 -0
  49. package/dist/retired-node-types.d.ts.map +1 -0
  50. package/dist/schemaHostProps.d.ts +55 -11
  51. package/dist/schemaHostProps.d.ts.map +1 -1
  52. package/dist/useDashboardAutoRefresh.d.ts +47 -0
  53. package/dist/useDashboardAutoRefresh.d.ts.map +1 -0
  54. package/dist/utils.d.ts +60 -13
  55. package/dist/utils.d.ts.map +1 -1
  56. package/dist/widgetDispatch.d.ts +174 -18
  57. package/dist/widgetDispatch.d.ts.map +1 -1
  58. package/package.json +15 -16
@@ -1,5 +1,5 @@
1
1
  import { ConfigPanelSchema } from '@object-ui/components';
2
- import { ConfigPanelTranslate } from './useConfigPanelTranslation';
2
+ import { ConfigPanelTranslate } from './useConfigPanelTranslation.js';
3
3
  /**
4
4
  * ObjectUI
5
5
  * Copyright (c) 2024-present ObjectStack Inc.
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardFilterBar.d.ts","sourceRoot":"","sources":["../src/DashboardFilterBar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAuC,MAAM,OAAO,CAAC;AAiB5D,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AAoCzB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgTD,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,uBAAuB,4BAyCrH"}
1
+ {"version":3,"file":"DashboardFilterBar.d.ts","sourceRoot":"","sources":["../src/DashboardFilterBar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAC;AAkBpE,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AA6DzB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2cD,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,uBAAuB,4BAyCrH"}
@@ -9,26 +9,28 @@ export interface DashboardGridLayoutProps {
9
9
  * `DatasetWidget` for ADR-0021 dataset-bound widgets (objectui#4614).
10
10
  *
11
11
  * Typed `unknown`, not `any`. The sibling declares `dataSource?: any`
12
- * (`DashboardRenderer.tsx:198`) for a reason that is explicitly historical —
12
+ * (`DashboardRendererProps.dataSource`) for a reason that is explicitly historical —
13
13
  * "that is precisely what it resolved to before", via the index signature that
14
14
  * used to answer for it — and this is a NEW declaration with no prior
15
15
  * resolution to preserve. `unknown` is what the consumer itself declares
16
- * (`DatasetWidget.tsx:655`, `dataSource: unknown`), so the value is forwarded
16
+ * (`DatasetWidget`'s own parameter, `dataSource: unknown`), so the value is forwarded
17
17
  * to exactly the type that receives it, and no call site is held to anything
18
18
  * new: every value is assignable to `unknown`. Narrowing it further to a real
19
19
  * adapter type is a separate change with its own consumer sweep, on both
20
20
  * surfaces at once.
21
21
  *
22
22
  * Optional, and the omitted case is a SUPPORTED one rather than an oversight:
23
- * `dashboard-grid`'s SDUI registration declares only `title` / `className`
24
- * inputs, so schema-driven hosts render this component with no adapter at all.
23
+ * a host may mount this component with no adapter at all (until objectui#10859
24
+ * batch 8 retired the `dashboard-grid` node key, its SDUI registration declared
25
+ * only `title` / `className` inputs, so schema-driven hosts always did).
25
26
  * A dataset-bound widget arriving that way renders `DatasetWidget`'s own
26
27
  * no-capability diagnostic — a visible state, never a blank tile.
27
28
  *
28
- * `SchemaRenderer` forwards this as a React prop (its `...props` spread, last:
29
- * `SchemaRenderer.tsx:632`). It cannot be shadowed by the spec's per-element
30
- * `dataSource` BINDING, which is stripped from the schema before that spread
31
- * for exactly this reason (`SchemaRenderer.tsx:564-575`, objectstack#5576).
29
+ * `SchemaRenderer` forwards this as a React prop (its `...props` spread,
30
+ * last). It cannot be shadowed by the spec's per-element `dataSource`
31
+ * BINDING, which is stripped from the schema before that spread for exactly
32
+ * this reason (the `dataSource: _dataSource` strip in `SchemaRenderer`'s
33
+ * destructure, objectstack#5576).
32
34
  */
33
35
  dataSource?: unknown;
34
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardGridLayout.d.ts","sourceRoot":"","sources":["../src/DashboardGridLayout.t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;;;;;;;;;;;;;;;;;;OA2BG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC/C;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC5D,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,SAAS,EAAE,GAClB,wBAAwB,CAa1B;AAiBD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAklBlE,CAAC"}
@@ -1,6 +1,7 @@
1
- import { DashboardComponentSchema, DashboardWidgetSchema } from '@object-ui/types';
1
+ import { DashboardComponentSchema } from '@object-ui/types';
2
2
  import { ActionDef, ActionResult, ActionContext, ModalHandler, SduiDomPassThroughKey } from '@object-ui/core';
3
3
  import { HTMLAttributes } from 'react';
4
+ import { DashboardAutoRefresh } from './useDashboardAutoRefresh.js';
4
5
  /**
5
6
  * The dashboard renderer's props.
6
7
  *
@@ -44,6 +45,10 @@ export interface DashboardRendererProps extends Pick<HTMLAttributes<HTMLDivEleme
44
45
  * is precisely what it resolved to before, so declaring it changes what is
45
46
  * DECLARED without changing what any call site is held to. Narrowing it to a
46
47
  * real adapter type is a separate change with its own consumer sweep.
48
+ *
49
+ * Optional: when it is omitted, the adapter of the enclosing
50
+ * `SchemaRendererProvider` is used, which is how a `dashboard` block held on
51
+ * a page gets one (objectui#10815).
47
52
  */
48
53
  dataSource?: any;
49
54
  /** Callback invoked when dashboard refresh is triggered (manual or auto) */
@@ -67,8 +72,13 @@ export interface DashboardRendererProps extends Pick<HTMLAttributes<HTMLDivEleme
67
72
  * Receives the next widgets array (with positions swapped). The parent
68
73
  * is expected to persist via its data adapter. When omitted, drag-and-
69
74
  * drop affordances are disabled even in design mode.
75
+ *
76
+ * Typed by the slot itself, `DashboardComponentSchema['widgets']`: the array
77
+ * is `schema.widgets` reordered, so each entry is a widget or a component node
78
+ * placed directly in the slot (objectui#11514; it read `DashboardWidgetSchema[]`
79
+ * while the component arm was assignable to the widget arm).
70
80
  */
71
- onWidgetsReorder?: (widgets: DashboardWidgetSchema[]) => void;
81
+ onWidgetsReorder?: (widgets: DashboardComponentSchema['widgets']) => void;
72
82
  /** Optional handler for actionType="modal" header actions. Receives a schema and ActionContext. */
73
83
  modalHandler?: ModalHandler;
74
84
  /** Optional named handlers for actionType="script" header actions, keyed by action name (actionUrl). */
@@ -80,6 +90,54 @@ export interface DashboardRendererProps extends Pick<HTMLAttributes<HTMLDivEleme
80
90
  * title/subtitle so we don't display them twice.
81
91
  */
82
92
  hideHeaderText?: boolean;
93
+ /**
94
+ * The host draws the "Refresh All" control, in its own chrome, and this is
95
+ * how it learns what to draw (objectui#12554). Set it and the renderer draws
96
+ * no refresh button of its own; leave it unset and the renderer draws one
97
+ * whenever `onRefresh` is wired, exactly as before.
98
+ *
99
+ * The auto-refresh timer is untouched: it stays this renderer's, armed by
100
+ * `onRefresh` and the authored `refreshIntervalSeconds`, so a host that
101
+ * draws the button runs no timer of its own. What the renderer hands over is
102
+ * the state of that one refresh implementation (`useDashboardAutoRefresh`):
103
+ *
104
+ * - `refreshing`, true while a run is in flight, manual or timed: spin the
105
+ * icon and disable the button on it, as the renderer's own control does;
106
+ * - `handleRefresh`, the run the renderer's button calls: wire the host's
107
+ * button to it, so a click shows the same indicator and calls `onRefresh`.
108
+ *
109
+ * It is called on mount, again each time `refreshing` changes, and with
110
+ * `null` when there is nothing to draw: no `onRefresh` is wired, or the
111
+ * renderer unmounted. The renderer reads it through a ref, so a host may
112
+ * pass a new function on every render (a `useState` setter is enough).
113
+ *
114
+ * The record-count badge (`recordCount`) is not part of the hand-over; it
115
+ * stays where the renderer draws it. The console's dashboard page
116
+ * (`DashboardView`) sets this, and draws the button among its page header's
117
+ * actions.
118
+ */
119
+ onRefreshStateChange?: (state: DashboardAutoRefresh | null) => void;
120
+ /**
121
+ * The document arrives already translated for the active language: the host
122
+ * read it from the server's `/meta` route, which resolves the packaged
123
+ * catalog per request locale and keeps a published edit over it (an explicit
124
+ * override beats the packaged default — `translateDashboard` in
125
+ * `@objectstack/spec`). The console's dashboard page (`DashboardView`) sets
126
+ * it.
127
+ *
128
+ * When true, the texts the server translated — the dashboard `label` and
129
+ * `description`, and each widget's `title` and `description` — are drawn as
130
+ * given: an inline per-locale map is
131
+ * still collapsed to the active language, but no client bundle lookup runs
132
+ * over them. A second pass over a served value is what let the packaged
133
+ * catalog win again, client-side, over a published edit (objectui#11295).
134
+ *
135
+ * Leave it unset for a document the server never translated — an inline
136
+ * block, a preview, a design surface: the client bundle is then its one
137
+ * translation pass, exactly as before. Header-action labels keep their bundle
138
+ * lookup either way: the server does not translate them.
139
+ */
140
+ localized?: boolean;
83
141
  }
84
142
  /**
85
143
  * DashboardRenderer — the public dashboard renderer.
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardRenderer.d.ts","sourceRoot":"","sources":["../src/DashboardRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAc,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGpG,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAUnH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAmI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACnE,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;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O,CAAC;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;IACpE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AA4pCD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,mHAiB7B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { DashboardComponentSchema } from '@object-ui/types';
2
- import { WidgetDatasetCatalogEntry } from './dataset-catalog';
2
+ import { WidgetDatasetCatalogEntry } from './dataset-catalog.js';
3
3
  /**
4
4
  * ObjectUI
5
5
  * Copyright (c) 2024-present ObjectStack Inc.
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardWithConfig.d.ts","sourceRoot":"","sources":["../src/DashboardWithConfig.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,wBAAwB,EAAyB,MAAM,kBAAkB,CAAC;AAKxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAMnE,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,MAAM,EAAE,wBAAwB,CAAC;IACjC,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,6DAA6D;IAC7D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACpD,iEAAiE;IACjE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACvE,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,yBAAyB;IACzB,WAA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IACjD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACvC,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAyB,EACzB,SAAS,EACT,QAAQ,EACR,eAAe,GAChB,EAAE,wBAAwB,qBAmM1B"}
@@ -86,24 +86,51 @@ export declare function extractDateWindows(filter: unknown): {
86
86
  rest: Record<string, unknown> | undefined;
87
87
  };
88
88
  /**
89
- * The authored chart CHROME and the series/axis presentation merge, both of
90
- * which now live in `@object-ui/core`'s `chart-presentation` beside
91
- * `buildChartSeries` — the derivation they are merged onto (objectui#4877).
89
+ * The authored chart CHROME, which now lives in `@object-ui/core`'s
90
+ * `chart-presentation` beside `buildChartSeries` — the derivation it is lowered
91
+ * onto (objectui#4877).
92
92
  *
93
- * They were written here (#3135 → objectstack#7016 → #4229) and moved when the
94
- * report renderer's embedded chart turned out to need the SAME merge over the
95
- * same spec keys: `ReportChartSchema` and `ChartConfigSchema` declare one
96
- * vocabulary, and a second copy of the split beside this one is precisely the
97
- * duplication objectui#4389 filed as a defect. The doctrine — the two
98
- * admission criteria, the data/presentation ruling, why `aria` stays
99
- * unforwarded — travelled with the code; see that module's header.
93
+ * It was written here (#3135 → objectstack#7016 → #4229) and moved when the
94
+ * report renderer's embedded chart turned out to need the SAME lowering over
95
+ * the same spec keys, and a second copy of the split beside this one is
96
+ * precisely the duplication objectui#4389 filed as a defect. The doctrine — the
97
+ * two admission criteria, the data/presentation ruling, why `aria` stays
98
+ * unforwarded — travelled with the code; see that module's header and
99
+ * `chartConfigPresentation`'s docblock.
100
100
  *
101
- * Re-exported under their original names so this module's public surface is
102
- * unchanged.
101
+ * Re-exported under its original name. The series/axis presentation merge
102
+ * (`mergeAuthoredPresentation`) was re-exported here too until objectui#11315:
103
+ * a dashboard widget's `chartConfig` no longer carries the `series` / `xAxis` /
104
+ * `yAxis` it read (spec 17.5.0), so this widget stopped calling it, and
105
+ * objectui#11372 then removed it from `@object-ui/core`.
103
106
  */
104
- export { chartConfigPresentation, mergeAuthoredPresentation, type AuthoredSeriesPresentation, type MergedChartSeries, } from '@object-ui/core';
105
- export declare function DatasetWidget({ widget, dataSource }: {
107
+ export { chartConfigPresentation } from '@object-ui/core';
108
+ /**
109
+ * A dataset-bound widget: a metric tile, a table / pivot, or a chart, drawn
110
+ * from one dataset query.
111
+ *
112
+ * ⛔ No sub-caption prop, and no read of a `description` key in the options
113
+ * bag: the metric sub-caption is retired at both ends (objectui#11389, ruling
114
+ * C, after objectstack's half in `@objectstack/spec` 17.7.0). A widget keeps
115
+ * one authored description, `widget.description`, which the dashboard surface
116
+ * draws as the card-header subtitle. If a caption under a metric's value
117
+ * returns, it returns as a declared widget-level key outside the options bag,
118
+ * never as a key inside it. The options census in `@object-ui/sdui-parser`
119
+ * reads this file's text, comments included, which is why this note does not
120
+ * spell the bag's member access.
121
+ */
122
+ /**
123
+ * [objectui#12528] The heading a dashboard surface hands a dataset-bound
124
+ * metric tile instead of drawing its own card header: the widget's resolved
125
+ * title, and its resolved description, which becomes the title's tooltip.
126
+ */
127
+ export interface DatasetMetricHeading {
128
+ title: string;
129
+ description?: string;
130
+ }
131
+ export declare function DatasetWidget({ widget, dataSource, heading }: {
106
132
  widget: any;
107
133
  dataSource: unknown;
134
+ heading?: DatasetMetricHeading;
108
135
  }): import("react").JSX.Element;
109
136
  //# sourceMappingURL=DatasetWidget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatasetWidget.d.ts","sourceRoot":"","sources":["../src/DatasetWidget.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAYL,uBAAuB,EAUvB,YAAY,EA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ED,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG;IACnD,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC3C,CA4DA;AAuID;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuBD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAAE,+BAu8ClI"}
@@ -24,11 +24,20 @@ export interface DrillDownDrawerProps {
24
24
  /** Optional className on the inner container. */
25
25
  className?: string;
26
26
  /**
27
- * M3: drill into an analytical `SpecReport` instead of the raw record list.
28
- * When provided the drawer body renders a `spec-report` schema via
29
- * `SchemaRenderer`. The widget's `filter` is merged in as an `$and` so the
30
- * metric's scope flows into the report. The report itself can drill
31
- * further (into a list / record) via its own row-click protocol.
27
+ * M3: drill into an analytical report instead of the raw record list.
28
+ * When the value is a dataset-bound report (ADR-0021: a `dataset`, or a
29
+ * `joined` report whose blocks bind one; see {@link isDatasetBoundReport})
30
+ * the drawer body renders a `report` node wrapping it
31
+ * (`{ type: 'report', report }`) via `SchemaRenderer` (objectui#11440; the
32
+ * retired `spec-report` alias carried the same wrapper). The widget's
33
+ * `filter` is joined to the report's own `runtimeFilter` with `$and` and
34
+ * written as the report's `runtimeFilter`, the one filter key the dataset
35
+ * renderer applies (objectui#5137, objectui#11506), so the metric's scope
36
+ * flows into the report. The report itself can drill further (into a list /
37
+ * record) via its own row-click protocol. Any other value lists the records,
38
+ * the two retired forms the authoring faces refuse by name among them: a
39
+ * `{ name }` reference (objectui#11517) and the pre-9.0 `objectName` form
40
+ * (objectui#11506).
32
41
  */
33
42
  report?: Record<string, unknown>;
34
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DrillDownDrawer.d.ts","sourceRoot":"","sources":["../src/DrillDownDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC1C,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoG1D,CAAC"}
1
+ {"version":3,"file":"DrillDownDrawer.d.ts","sourceRoot":"","sources":["../src/DrillDownDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC1C,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AA+BD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+G1D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { I18nLabel } from '@object-ui/types';
3
- import { SchemaHostProps } from './schemaHostProps';
3
+ import { SchemaHostProps } from './schemaHostProps.js';
4
4
  /**
5
5
  * DOM PASS-THROUGH (objectui#4426) — see `MetricWidget.tsx`'s interface header
6
6
  * for the full argument; this is the same widening on the same spread, onto the
@@ -18,6 +18,12 @@ import { SchemaHostProps } from './schemaHostProps';
18
18
  * whole. The repo's spelling for this carve-out is `ComboboxProps`
19
19
  * (`extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange">`),
20
20
  * omitted there for the same reason: the component's own contract owns the name.
21
+ *
22
+ * This declaration is the DIRECT React door's. Rendered through
23
+ * `SchemaRenderer`, the card's element receives only what `toDomProps` passes
24
+ * (objectui#4425, phase 2) — see `hostDomProps` in `./schemaHostProps`. That is
25
+ * also why an authored `label` stops at the component: it is not this card's
26
+ * heading (`title` is) and not an attribute either.
21
27
  */
22
28
  export interface MetricCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
23
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MetricCard.d.ts","sourceRoot":"","sources":["../src/MetricCard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1F;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,eAAe,CA6ElE,CAAC"}
1
+ {"version":3,"file":"MetricCard.d.ts","sourceRoot":"","sources":["../src/MetricCard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1F;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,eAAe,CAkFlE,CAAC"}
@@ -1,7 +1,33 @@
1
1
  import { default as React } from 'react';
2
2
  import { I18nLabel } from '@object-ui/types';
3
- import { MetricColorVariant } from './colorVariants';
4
- import { SchemaHostProps } from './schemaHostProps';
3
+ import { MetricColorVariant } from './colorVariants.js';
4
+ import { SchemaHostProps } from './schemaHostProps.js';
5
+ import { MetricDelta } from './utils.js';
6
+ /**
7
+ * Lightweight numeric formatter for metric widgets.
8
+ *
9
+ * Honors a numeral.js-style `format` pattern:
10
+ * - `'0,0'` / `'0,0.00'` → thousands separators with explicit decimals
11
+ * - leading `$/¥/€/£` or `currency` prop → currency formatting
12
+ * - trailing `%` → percent, handed WHOLE to `formatPercent`
13
+ * (`@object-ui/fields`) at the storage the PATTERN states: numeral's `%`
14
+ * multiplies by 100, so the value is a fraction. `formatPercent` owns the
15
+ * scaling and the locale's percent convention — see the branch's own note
16
+ * (objectui#9165, objectui#11475). A host that holds the field the value was
17
+ * aggregated from renders the percent itself at that field's storage
18
+ * (`ObjectMetricWidget`), the way it renders a currency.
19
+ *
20
+ * When no format is given but the value is a finite number, defaults to
21
+ * thousands separators with no decimals — that's what users expect for
22
+ * KPI cards (`1,930,000` not `1930000`).
23
+ */
24
+ /**
25
+ * The decimal places a numeral.js-style pattern fixes (`'0,0.00'` → 2,
26
+ * `'0.0%'` → 1, `'0,0'` → 0) — the one parse this tile's formatter makes, read
27
+ * by `ObjectMetricWidget` too when it renders a percent aggregate itself, so the
28
+ * two never read one authored pattern at two widths.
29
+ */
30
+ export declare function metricPatternDecimals(format: string | undefined): number;
5
31
  /**
6
32
  * The variant vocabulary and its two class tables now live in
7
33
  * `./colorVariants` — the dataset-bound KPI (`DatasetWidget`, objectui#3359)
@@ -43,9 +69,15 @@ export type { MetricColorVariant };
43
69
  * own signature — the renderer's private door, not the consumer's front door.
44
70
  * The narrower `FieldWidgetDomProps` shape (objectui#3221) is the other spelling
45
71
  * in this repo, but it exists to be bound key-by-key to a runtime whitelist
46
- * (`toDomProps`) in both directions; this component has no such whitelist, and
47
- * inventing a half of one here would declare a set the spread does not enforce.
48
- * Whether plugin widgets should get that whitelist is objectui#4425.
72
+ * (`toDomProps`) in both directions, and this declaration is the DIRECT React
73
+ * door's, which keeps no whitelist.
74
+ *
75
+ * The renderer's door does (objectui#4425, phase 2): rendered through
76
+ * `SchemaRenderer`, this component's element receives only what `toDomProps`
77
+ * passes, so an authored key it does not declare — or `name`, or an authored
78
+ * `title` — no longer reaches the `Card`. This declaration governs the direct
79
+ * door only, and what it promises still arrives there. Both doors, and how the
80
+ * component tells them apart, are `hostDomProps` in `./schemaHostProps`.
49
81
  */
50
82
  export interface MetricWidgetProps extends React.HTMLAttributes<HTMLDivElement> {
51
83
  /**
@@ -66,6 +98,16 @@ export interface MetricWidgetProps extends React.HTMLAttributes<HTMLDivElement>
66
98
  label?: string | I18nLabel;
67
99
  direction?: 'up' | 'down' | 'neutral';
68
100
  };
101
+ /**
102
+ * The `compareTo`-derived trend a host computed with `computeMetricDelta`
103
+ * (`ObjectMetricWidget`); it replaces `trend` outright when set. Host state,
104
+ * ⛔ not a node key: its `value` may be `null` — a zero baseline, which has
105
+ * no percentage and draws as a dash (objectui#12677) — while the authored
106
+ * `trend.value` stays the number the spec declares.
107
+ */
108
+ derivedTrend?: MetricDelta & {
109
+ label?: string;
110
+ };
69
111
  icon?: React.ReactNode | string;
70
112
  className?: string;
71
113
  description?: string | I18nLabel;
@@ -108,5 +150,5 @@ export interface MetricWidgetProps extends React.HTMLAttributes<HTMLDivElement>
108
150
  */
109
151
  variant?: 'card' | 'bare';
110
152
  }
111
- export declare const MetricWidget: ({ label, value, trend, icon, className, description, loading, error, colorVariant, format, currency, prefix, suffix, onClick, variant, schema: _schema, bind: _bind, events: _events, props: _propsBag, ariaLabel: _ariaLabel, ariaDescribedBy: _ariaDescribedBy, dataSource: _dataSource, ...domProps }: MetricWidgetProps & SchemaHostProps) => React.JSX.Element;
153
+ export declare const MetricWidget: ({ label, value, trend, derivedTrend, icon, className, description, loading, error, colorVariant, format, currency, prefix, suffix, onClick, variant, schema: _schema, bind: _bind, events: _events, props: _propsBag, ariaLabel: _ariaLabel, ariaDescribedBy: _ariaDescribedBy, dataSource: _dataSource, ...domProps }: MetricWidgetProps & SchemaHostProps) => React.JSX.Element;
112
154
  //# sourceMappingURL=MetricWidget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MetricWidget.d.ts","sourceRoot":"","sources":["../src/MetricWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,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