@object-ui/plugin-dashboard 17.5.0 → 17.6.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 +523 -0
- package/README.md +147 -18
- package/dist/DashboardConfigPanel.d.ts +3 -0
- package/dist/DashboardConfigPanel.d.ts.map +1 -1
- package/dist/DashboardFilterBar.d.ts.map +1 -1
- package/dist/DashboardRenderer.d.ts.map +1 -1
- package/dist/DatasetWidget.d.ts +16 -120
- package/dist/DatasetWidget.d.ts.map +1 -1
- package/dist/ObjectDataTable.d.ts +68 -3
- package/dist/ObjectDataTable.d.ts.map +1 -1
- package/dist/ObjectMetricWidget.d.ts +31 -20
- package/dist/ObjectMetricWidget.d.ts.map +1 -1
- package/dist/ObjectPivotTable.d.ts.map +1 -1
- package/dist/PivotTable.d.ts.map +1 -1
- package/dist/WidgetConfigPanel.d.ts +28 -0
- package/dist/WidgetConfigPanel.d.ts.map +1 -1
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1431 -1146
- package/dist/index.umd.cjs +2 -2
- package/dist/recordFields.d.ts +40 -1
- package/dist/recordFields.d.ts.map +1 -1
- package/dist/useConfigPanelTranslation.d.ts +35 -0
- package/dist/useConfigPanelTranslation.d.ts.map +1 -0
- package/package.json +11 -10
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ConfigPanelSchema } from '@object-ui/components';
|
|
1
2
|
import { WidgetDatasetCatalogEntry } from './dataset-catalog';
|
|
3
|
+
import { ConfigPanelTranslate } from './useConfigPanelTranslation';
|
|
2
4
|
/**
|
|
3
5
|
* ObjectUI
|
|
4
6
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -8,6 +10,7 @@ import { WidgetDatasetCatalogEntry } from './dataset-catalog';
|
|
|
8
10
|
*/
|
|
9
11
|
import * as React from 'react';
|
|
10
12
|
export declare function supportsDrillDown(t: string | undefined): boolean;
|
|
13
|
+
export declare function buildWidgetSchema(t: ConfigPanelTranslate, datasets: WidgetDatasetCatalogEntry[] | undefined, widgetType?: string): ConfigPanelSchema;
|
|
11
14
|
export interface WidgetConfigPanelProps {
|
|
12
15
|
/** Whether the panel is open */
|
|
13
16
|
open: boolean;
|
|
@@ -31,6 +34,31 @@ export interface WidgetConfigPanelProps {
|
|
|
31
34
|
/** Whether the dataset catalog is still loading (reserved for future UX). */
|
|
32
35
|
datasetsLoading?: boolean;
|
|
33
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Put the `I18nLabel` keys of a draft back into the shape they were stored in.
|
|
39
|
+
*
|
|
40
|
+
* The draft carries ONE string per label key — the active locale's, which is
|
|
41
|
+
* what the text input can hold. Persisting that string as the whole value is
|
|
42
|
+
* the data loss this card is about, so before a save each label key is mapped
|
|
43
|
+
* back against the value the panel was handed:
|
|
44
|
+
*
|
|
45
|
+
* - stored value is a plain string (or absent): nothing was ever collapsed, so
|
|
46
|
+
* the draft's string is already the correct whole value — passed through.
|
|
47
|
+
* - stored value is a map and the draft's string still equals what the panel
|
|
48
|
+
* DISPLAYED: the author never touched this field, so the **original object is
|
|
49
|
+
* returned by reference**. An untouched title survives an unrelated config
|
|
50
|
+
* edit byte-identically — the round trip the ruling requires, and the reason
|
|
51
|
+
* this is an identity restore rather than a rebuild that would happen to
|
|
52
|
+
* produce an equal object (a rebuild would add an entry for the active locale
|
|
53
|
+
* to a map that never had one).
|
|
54
|
+
* - stored value is a map and the string differs: the edit lands in the active
|
|
55
|
+
* locale's entry via `setLocalized`, every other locale preserved.
|
|
56
|
+
*
|
|
57
|
+
* Exported for direct unit testing — the panel path reaches it only through
|
|
58
|
+
* `useConfigDraft`, so a component test alone would be asserting that hook's
|
|
59
|
+
* behaviour as much as this rule.
|
|
60
|
+
*/
|
|
61
|
+
export declare function restoreI18nLabels(draft: Record<string, any>, source: Record<string, any>, language: string | undefined): Record<string, any>;
|
|
34
62
|
export declare function sanitizeDraftForType(draft: Record<string, any>): Record<string, any>;
|
|
35
63
|
export declare function WidgetConfigPanel({ open, onClose, config, onSave, onFieldChange, headerExtra, datasets, datasetsLoading: _datasetsLoading, }: WidgetConfigPanelProps): React.JSX.Element;
|
|
36
64
|
//# 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;AAY/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,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,iBAAiB,EAAe,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AA8ErC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhE;AA4ID,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,oBAAoB,EACvB,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,UAAU,CAAC,EAAE,MAAM,GAClB,iBAAiB,CAmNnB;AAMD,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;AA+CD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgBrB;AA4BD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAOpF;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,qBAiExB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,18 +13,22 @@ import { DashboardWithConfig } from './DashboardWithConfig';
|
|
|
13
13
|
import { DrillDownDrawer } from './DrillDownDrawer';
|
|
14
14
|
export { DashboardRenderer, DashboardGridLayout, MetricWidget, MetricCard, ObjectMetricWidget, PivotTable, ObjectPivotTable, ObjectDataTable, DashboardConfigPanel, WidgetConfigPanel, DashboardWithConfig, DrillDownDrawer };
|
|
15
15
|
export type { WidgetConfigPanelProps } from './WidgetConfigPanel';
|
|
16
|
+
export { CONFIG_PANEL_DEFAULT_TRANSLATIONS, useConfigPanelTranslation, type ConfigPanelTranslate, } from './useConfigPanelTranslation';
|
|
16
17
|
export type { WidgetDatasetCatalogEntry, WidgetDatasetDimension, WidgetDatasetMeasure, } from './dataset-catalog';
|
|
17
18
|
export declare const dashboardComponents: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
dashboard: React.ForwardRefExoticComponent<import('./DashboardRenderer').DashboardRendererProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
metric: ({ 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 }: import('./MetricWidget').MetricWidgetProps & import('./schemaHostProps').SchemaHostProps) => React.JSX.Element;
|
|
21
|
+
'metric-card': React.FC<import('./MetricCard').MetricCardProps & import('./schemaHostProps').SchemaHostProps>;
|
|
22
|
+
'object-metric': React.FC<{
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
schema?: any;
|
|
25
|
+
}>;
|
|
26
|
+
pivot: React.FC<import('./PivotTable').PivotTableProps>;
|
|
27
|
+
'object-pivot': React.FC<{
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
schema?: any;
|
|
30
|
+
}>;
|
|
31
|
+
'dashboard-grid': React.FC<import('./DashboardGridLayout').DashboardGridLayoutProps>;
|
|
32
|
+
'object-data-table': React.FC<import('./ObjectDataTable').ObjectDataTableProps>;
|
|
29
33
|
};
|
|
30
34
|
//# sourceMappingURL=index.d.ts.map
|
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;AAE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