@object-ui/plugin-dashboard 16.0.0 → 17.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 +482 -1
- package/dist/DashboardGridLayout.d.ts +4 -4
- package/dist/DashboardGridLayout.d.ts.map +1 -1
- package/dist/DashboardRenderer.d.ts +2 -2
- package/dist/DashboardRenderer.d.ts.map +1 -1
- package/dist/DashboardWithConfig.d.ts +13 -3
- package/dist/DashboardWithConfig.d.ts.map +1 -1
- package/dist/DatasetWidget.d.ts.map +1 -1
- package/dist/MetricCard.d.ts.map +1 -1
- package/dist/MetricWidget.d.ts.map +1 -1
- package/dist/ObjectDataTable.d.ts.map +1 -1
- package/dist/ObjectMetricWidget.d.ts.map +1 -1
- package/dist/ObjectPivotTable.d.ts.map +1 -1
- package/dist/PivotTable.d.ts +10 -0
- package/dist/PivotTable.d.ts.map +1 -1
- package/dist/WidgetConfigPanel.d.ts +12 -9
- package/dist/WidgetConfigPanel.d.ts.map +1 -1
- package/dist/dataset-catalog.d.ts +46 -0
- package/dist/dataset-catalog.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1330 -1645
- package/dist/index.umd.cjs +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/widgetDispatch.d.ts +76 -0
- package/dist/widgetDispatch.d.ts.map +1 -0
- package/package.json +14 -12
package/dist/PivotTable.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ export interface PivotTableProps {
|
|
|
22
22
|
*/
|
|
23
23
|
onDrillDown?: (event: DrillEvent) => void;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The aggregations this pivot computes — the renderer half of the spec's
|
|
27
|
+
* `ChartAggregateFunctionSchema` (`ui/chart.zod.ts`), the UI-side subset the
|
|
28
|
+
* spec deliberately carved out of the engine's 8-name `AggregationFunction`.
|
|
29
|
+
* Engine-level names (`count_distinct`, `array_agg`, `string_agg`) used to
|
|
30
|
+
* fall into a `default:` branch that returned a SUM — a plausible wrong total
|
|
31
|
+
* with no signal (#2941). They now short-circuit to a visible notice before
|
|
32
|
+
* any cell is computed. Exported for the spec-parity test.
|
|
33
|
+
*/
|
|
34
|
+
export declare const PIVOT_AGGREGATIONS: ReadonlySet<string>;
|
|
25
35
|
/**
|
|
26
36
|
* PivotTable – Cross-tabulation / Pivot Table component.
|
|
27
37
|
*
|
package/dist/PivotTable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotTable.d.ts","sourceRoot":"","sources":["../src/PivotTable.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"PivotTable.d.ts","sourceRoot":"","sources":["../src/PivotTable.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAC3C;AAyDD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAkD,CAAC;AAwBtG;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgRhD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetDatasetCatalogEntry } from './dataset-catalog';
|
|
1
2
|
/**
|
|
2
3
|
* ObjectUI
|
|
3
4
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -7,10 +8,6 @@
|
|
|
7
8
|
*/
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
export declare function supportsDrillDown(t: string | undefined): boolean;
|
|
10
|
-
export type SelectOption = {
|
|
11
|
-
value: string;
|
|
12
|
-
label: string;
|
|
13
|
-
};
|
|
14
11
|
export interface WidgetConfigPanelProps {
|
|
15
12
|
/** Whether the panel is open */
|
|
16
13
|
open: boolean;
|
|
@@ -24,10 +21,16 @@ export interface WidgetConfigPanelProps {
|
|
|
24
21
|
onFieldChange?: (field: string, value: any) => void;
|
|
25
22
|
/** Extra content rendered in the header row (e.g. delete button) */
|
|
26
23
|
headerExtra?: React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Analytics dataset catalog (ADR-0021). When supplied, the dataset selector
|
|
26
|
+
* and the dimensions/values pickers bind to the live schema instead of
|
|
27
|
+
* free-text. Hosts resolve it (e.g. via the metadata client) and inject it;
|
|
28
|
+
* absent → free-text authoring still works.
|
|
29
|
+
*/
|
|
30
|
+
datasets?: WidgetDatasetCatalogEntry[];
|
|
31
|
+
/** Whether the dataset catalog is still loading (reserved for future UX). */
|
|
32
|
+
datasetsLoading?: boolean;
|
|
31
33
|
}
|
|
32
|
-
export declare function
|
|
34
|
+
export declare function sanitizeDraftForType(draft: Record<string, any>): Record<string, any>;
|
|
35
|
+
export declare function WidgetConfigPanel({ open, onClose, config, onSave, onFieldChange, headerExtra, datasets, datasetsLoading: _datasetsLoading, }: WidgetConfigPanelProps): React.JSX.Element;
|
|
33
36
|
//# sourceMappingURL=WidgetConfigPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetConfigPanel.d.ts","sourceRoot":"","sources":["../src/WidgetConfigPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetConfigPanel.d.ts","sourceRoot":"","sources":["../src/WidgetConfigPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AA4DnE,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhE;AAoVD,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,oBAAoB;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,wCAAwC;IACxC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC9C,oCAAoC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpD,oEAAoE;IACpE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACvC,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAgCD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAMpF;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EAAE,gBAAgB,GAClC,EAAE,sBAAsB,qBA8BxB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Dataset catalog types for the dashboard widget config panel (ADR-0021).
|
|
10
|
+
*
|
|
11
|
+
* `WidgetConfigPanel` authors the semantic-layer shape (`dataset` +
|
|
12
|
+
* `dimensions` + `values`) and needs (a) the list of datasets to bind and
|
|
13
|
+
* (b) the bound dataset's dimensions/measures to offer as picker options.
|
|
14
|
+
*
|
|
15
|
+
* The shape mirrors app-shell's `DatasetCatalogEntry`
|
|
16
|
+
* (`views/metadata-admin/previews/useDatasetCatalog.ts`). It is duplicated here
|
|
17
|
+
* — not imported — because `@object-ui/plugin-dashboard` must not depend on
|
|
18
|
+
* `@object-ui/app-shell` (layering). Hosts resolve the catalog (e.g. via the
|
|
19
|
+
* metadata client's `list('dataset')`) and inject it through the panel's
|
|
20
|
+
* `datasets` prop, keeping the plugin network-free and testable.
|
|
21
|
+
*/
|
|
22
|
+
export interface WidgetDatasetDimension {
|
|
23
|
+
/** Dimension name (snake_case, referenced by `widget.dimensions`). */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Human label (falls back to the name). */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Raw field type id when declared (e.g. 'text', 'date'). */
|
|
28
|
+
type?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WidgetDatasetMeasure {
|
|
31
|
+
/** Measure name (snake_case, referenced by `widget.values`). */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Human label (falls back to the name). */
|
|
34
|
+
label?: string;
|
|
35
|
+
/** Aggregate function (sum / avg / count / …) — display hint only. */
|
|
36
|
+
aggregate?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface WidgetDatasetCatalogEntry {
|
|
39
|
+
/** Dataset unique name (what `widget.dataset` stores). */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Human label (falls back to the name). */
|
|
42
|
+
label?: string;
|
|
43
|
+
dimensions: WidgetDatasetDimension[];
|
|
44
|
+
measures: WidgetDatasetMeasure[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=dataset-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset-catalog.d.ts","sourceRoot":"","sources":["../src/dataset-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { WidgetConfigPanel } from './WidgetConfigPanel';
|
|
|
11
11
|
import { DashboardWithConfig } from './DashboardWithConfig';
|
|
12
12
|
import { DrillDownDrawer } from './DrillDownDrawer';
|
|
13
13
|
export { DashboardRenderer, DashboardGridLayout, MetricWidget, MetricCard, ObjectMetricWidget, PivotTable, ObjectPivotTable, ObjectDataTable, DashboardConfigPanel, WidgetConfigPanel, DashboardWithConfig, DrillDownDrawer };
|
|
14
|
+
export type { WidgetConfigPanelProps } from './WidgetConfigPanel';
|
|
15
|
+
export type { WidgetDatasetCatalogEntry, WidgetDatasetDimension, WidgetDatasetMeasure, } from './dataset-catalog';
|
|
14
16
|
export declare const dashboardComponents: {
|
|
15
17
|
DashboardRenderer: import('react').ForwardRefExoticComponent<Omit<import('./DashboardRenderer').DashboardRendererProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
18
|
DashboardGridLayout: import('react').FC<import('./DashboardGridLayout').DashboardGridLayoutProps>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;A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