impact-nova 3.0.0-alpha.20 → 3.0.0-alpha.23
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/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +32 -31
- package/dist/components/data-display/chart/chart-heatmap-layout.d.ts +31 -0
- package/dist/components/data-display/chart/chart-heatmap-layout.js +72 -0
- package/dist/components/data-display/chart/chart.category-cluster-heatmap.stories-data.d.ts +1 -1
- package/dist/components/data-display/chart/chart.js +165 -150
- package/dist/components/data-display/chart/chart.types.d.ts +17 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid-play.d.ts +9 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.d.ts +32 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.js +93 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.d.ts +46 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.js +80 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.types.d.ts +54 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.d.ts +18 -0
- package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.js +80 -0
- package/dist/components/data-display/heatmap-grid/index.d.ts +3 -0
- package/dist/components/data-display/heatmap-grid/index.js +14 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.d.ts +14 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.js +39 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.d.ts +29 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.js +33 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.d.ts +4 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.js +49 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.d.ts +3 -0
- package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.js +173 -0
- package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.d.ts +12 -0
- package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.js +161 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.js +35 -33
- package/dist/components/data-display/hex-tilemap/hex-tilemap.types.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-camera.js +30 -28
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.d.ts +1 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.js +36 -34
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.d.ts +2 -1
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.js +87 -84
- package/dist/components/flows/iris-chat/iris-chat-chrome.js +203 -185
- package/dist/i18n/defaultMessages.d.ts +6 -0
- package/dist/i18n/defaultMessages.js +16 -11
- package/dist/i18n/locales/de.js +5 -0
- package/dist/i18n/locales/es.js +5 -0
- package/dist/i18n/locales/hi.js +5 -0
- package/dist/i18n/locales/kn.js +5 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/primitives/use-field-chrome.js +22 -22
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as k, useState as B, useRef as
|
|
1
|
+
import { jsxs as W, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, useState as B, useRef as b, useImperativeHandle as H, useCallback as r } from "react";
|
|
3
3
|
import { Select as L } from "../../../../forms/select/select.js";
|
|
4
4
|
import { SelectAiInsightAffordance as P } from "../select-ai-insight-affordance.js";
|
|
5
|
-
const q = k((
|
|
5
|
+
const q = k((u, v) => {
|
|
6
6
|
const {
|
|
7
7
|
value: l,
|
|
8
8
|
options: S = [],
|
|
9
9
|
placeholder: C = "Select...",
|
|
10
|
-
isSearchable:
|
|
11
|
-
isClearable:
|
|
12
|
-
stopEditing:
|
|
13
|
-
onValueChange:
|
|
10
|
+
isSearchable: x = !0,
|
|
11
|
+
isClearable: M = !0,
|
|
12
|
+
stopEditing: d,
|
|
13
|
+
onValueChange: f,
|
|
14
14
|
data: n,
|
|
15
|
-
showAiInsight:
|
|
15
|
+
showAiInsight: w,
|
|
16
16
|
aiInsightField: V,
|
|
17
17
|
confidenceScore: R,
|
|
18
18
|
confidenceScoreField: j,
|
|
19
|
-
confidenceReason:
|
|
19
|
+
confidenceReason: A,
|
|
20
20
|
confidenceReasonField: E,
|
|
21
21
|
confidenceLabel: I
|
|
22
|
-
} =
|
|
22
|
+
} = u, o = l && typeof l == "object" && "value" in l, s = o ? l.cellMetadata : void 0, t = o ? l.value : l, p = S.map((e) => ({
|
|
23
23
|
value: e.value,
|
|
24
24
|
label: e.label,
|
|
25
25
|
isDisabled: e.isDisabled
|
|
26
|
-
})), [N,
|
|
26
|
+
})), [N, m] = B(
|
|
27
27
|
t != null ? String(t) : null
|
|
28
|
-
),
|
|
28
|
+
), h = b(
|
|
29
29
|
t != null ? String(t) : null
|
|
30
|
-
),
|
|
30
|
+
), g = b(!1);
|
|
31
31
|
H(v, () => ({
|
|
32
32
|
getValue() {
|
|
33
|
-
const e =
|
|
33
|
+
const e = h.current;
|
|
34
34
|
return o ? {
|
|
35
35
|
value: e,
|
|
36
36
|
...s !== void 0 && { cellMetadata: s }
|
|
@@ -46,33 +46,34 @@ const q = k((b, v) => {
|
|
|
46
46
|
return !0;
|
|
47
47
|
}
|
|
48
48
|
}));
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [
|
|
49
|
+
const y = p.find((e) => e.value === N) ?? null, a = r(() => {
|
|
50
|
+
g.current || (g.current = !0, d());
|
|
51
|
+
}, [d]), D = r(
|
|
52
52
|
(e) => {
|
|
53
53
|
const c = e ? e.value : null;
|
|
54
|
-
|
|
54
|
+
h.current = c, m(c), f?.(c), a();
|
|
55
55
|
},
|
|
56
|
-
[a,
|
|
57
|
-
),
|
|
56
|
+
[a, f, m]
|
|
57
|
+
), O = r(() => {
|
|
58
58
|
a();
|
|
59
|
-
}, [a]);
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
}, [a]), F = n && typeof n == "object" ? n : null;
|
|
60
|
+
return /* @__PURE__ */ W(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
63
|
className: "box-border flex h-full w-full min-w-0 items-center gap-2 ps-2 pe-2.5 ag-editable-cell-highlight",
|
|
64
64
|
"data-component": "select-cell-editor",
|
|
65
|
+
style: { minWidth: u.column?.getActualWidth() },
|
|
65
66
|
children: [
|
|
66
67
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i(
|
|
67
68
|
L,
|
|
68
69
|
{
|
|
69
|
-
options:
|
|
70
|
-
value:
|
|
71
|
-
onChange:
|
|
72
|
-
onMenuClose:
|
|
70
|
+
options: p,
|
|
71
|
+
value: y,
|
|
72
|
+
onChange: D,
|
|
73
|
+
onMenuClose: O,
|
|
73
74
|
placeholder: C,
|
|
74
|
-
isSearchable:
|
|
75
|
-
isClearable:
|
|
75
|
+
isSearchable: x,
|
|
76
|
+
isClearable: M,
|
|
76
77
|
isMulti: !1,
|
|
77
78
|
defaultMenuIsOpen: !0,
|
|
78
79
|
className: "!border-none !shadow-none !ring-0 !h-7 !rounded-[8px] !px-1.5",
|
|
@@ -82,14 +83,14 @@ const q = k((b, v) => {
|
|
|
82
83
|
/* @__PURE__ */ i(
|
|
83
84
|
P,
|
|
84
85
|
{
|
|
85
|
-
showAiInsight:
|
|
86
|
+
showAiInsight: w,
|
|
86
87
|
aiInsightField: V,
|
|
87
88
|
confidenceScore: R,
|
|
88
89
|
confidenceScoreField: j,
|
|
89
|
-
confidenceReason:
|
|
90
|
+
confidenceReason: A,
|
|
90
91
|
confidenceReasonField: E,
|
|
91
92
|
confidenceLabel: I,
|
|
92
|
-
data:
|
|
93
|
+
data: F,
|
|
93
94
|
cellMetadata: s
|
|
94
95
|
}
|
|
95
96
|
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChartProps } from './chart.types';
|
|
2
|
+
import type * as Highcharts from "highcharts";
|
|
3
|
+
/** Recommended heatmap row height when a consumer wants fixed cells. */
|
|
4
|
+
export declare const HEATMAP_CELL_MIN_HEIGHT_PX = 36;
|
|
5
|
+
/** Recommended heatmap column width floor when a consumer wants fixed cells. */
|
|
6
|
+
export declare const HEATMAP_CELL_MIN_WIDTH_PX = 72;
|
|
7
|
+
export type HeatmapChartBoxSize = {
|
|
8
|
+
height: number | string | undefined;
|
|
9
|
+
width: number | string | undefined;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
};
|
|
12
|
+
export type HeatmapChartBoxSizeInput = {
|
|
13
|
+
type?: ChartProps["type"];
|
|
14
|
+
height?: ChartProps["height"];
|
|
15
|
+
width?: ChartProps["width"];
|
|
16
|
+
cellMinHeight?: number;
|
|
17
|
+
cellMinWidth?: number;
|
|
18
|
+
fillContainer?: boolean;
|
|
19
|
+
rowCount: number;
|
|
20
|
+
columnCount: number;
|
|
21
|
+
verticalChrome?: number;
|
|
22
|
+
horizontalChrome?: number;
|
|
23
|
+
availableWidth?: number;
|
|
24
|
+
};
|
|
25
|
+
/** Margin + spacing around the heatmap plot band. */
|
|
26
|
+
export declare function readHeatmapChartChrome(options: Highcharts.Options | undefined): {
|
|
27
|
+
vertical: number;
|
|
28
|
+
horizontal: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function readHeatmapChartBoxSize(input: HeatmapChartBoxSizeInput): HeatmapChartBoxSize;
|
|
31
|
+
export declare function readHeatmapChartBoxSizeFromProps(props: Pick<ChartProps, "type" | "height" | "width" | "cellMinHeight" | "cellMinWidth" | "fillContainer" | "xAxisCategories" | "yAxisCategories" | "options">): HeatmapChartBoxSize;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function f(t) {
|
|
2
|
+
return Math.max(t, 1);
|
|
3
|
+
}
|
|
4
|
+
function i(t, e) {
|
|
5
|
+
return typeof t == "number" && Number.isFinite(t) ? t : e;
|
|
6
|
+
}
|
|
7
|
+
function C(t) {
|
|
8
|
+
return typeof t == "number" ? [t, t, t, t] : Array.isArray(t) && t.length >= 4 ? [
|
|
9
|
+
i(t[0], 10),
|
|
10
|
+
i(t[1], 10),
|
|
11
|
+
i(t[2], 15),
|
|
12
|
+
i(t[3], 10)
|
|
13
|
+
] : [10, 10, 15, 10];
|
|
14
|
+
}
|
|
15
|
+
function s(t) {
|
|
16
|
+
const e = t?.chart;
|
|
17
|
+
if (e === void 0 || Array.isArray(e))
|
|
18
|
+
return { vertical: 25, horizontal: 20 };
|
|
19
|
+
const [l, c, d, m] = C(
|
|
20
|
+
e.spacing
|
|
21
|
+
), n = i(e.marginTop, 0), a = i(e.marginRight, 0), o = i(e.marginBottom, 0), r = i(e.marginLeft, 0);
|
|
22
|
+
return {
|
|
23
|
+
vertical: n + l + o + d,
|
|
24
|
+
horizontal: r + m + a + c
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function v(t) {
|
|
28
|
+
return t.availableWidth !== void 0 && t.availableWidth > 0 ? t.availableWidth : typeof t.width == "number" ? t.width : 0;
|
|
29
|
+
}
|
|
30
|
+
function u(t) {
|
|
31
|
+
if (!(t.type === "heatmap" && (t.cellMinHeight !== void 0 || t.cellMinWidth !== void 0 || t.fillContainer === !0)))
|
|
32
|
+
return { height: t.height, width: t.width };
|
|
33
|
+
const l = f(t.rowCount), c = f(t.columnCount), d = t.verticalChrome ?? 0, m = t.horizontalChrome ?? 0, n = t.cellMinHeight, a = t.cellMinWidth, o = n === void 0 ? void 0 : l * n + d, r = o === void 0 ? t.height : typeof t.height == "number" ? Math.max(o, t.height) : o, h = a === void 0 ? void 0 : c * a + m;
|
|
34
|
+
if (h === void 0)
|
|
35
|
+
return {
|
|
36
|
+
height: r,
|
|
37
|
+
width: t.width
|
|
38
|
+
};
|
|
39
|
+
if (t.fillContainer === !0) {
|
|
40
|
+
const g = v(t);
|
|
41
|
+
return {
|
|
42
|
+
height: r,
|
|
43
|
+
width: g > 0 ? Math.max(h, g) : t.width ?? "100%",
|
|
44
|
+
minWidth: h
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
height: r,
|
|
49
|
+
width: h,
|
|
50
|
+
minWidth: h
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function w(t) {
|
|
54
|
+
const e = s(t.options);
|
|
55
|
+
return u({
|
|
56
|
+
type: t.type,
|
|
57
|
+
height: t.height,
|
|
58
|
+
width: t.width,
|
|
59
|
+
cellMinHeight: t.cellMinHeight,
|
|
60
|
+
cellMinWidth: t.cellMinWidth,
|
|
61
|
+
fillContainer: t.fillContainer,
|
|
62
|
+
rowCount: t.yAxisCategories?.length ?? 0,
|
|
63
|
+
columnCount: t.xAxisCategories?.length ?? 0,
|
|
64
|
+
verticalChrome: e.vertical,
|
|
65
|
+
horizontalChrome: e.horizontal
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
u as readHeatmapChartBoxSize,
|
|
70
|
+
w as readHeatmapChartBoxSizeFromProps,
|
|
71
|
+
s as readHeatmapChartChrome
|
|
72
|
+
};
|
|
@@ -19,4 +19,4 @@ export declare function buildCategoryClusterHeatmapPoints(): CategoryClusterHeat
|
|
|
19
19
|
export declare function formatCategoryClusterHeatmapTooltip(formatterContext: object): string;
|
|
20
20
|
export declare const CATEGORY_CLUSTER_HEATMAP_SERIES: Highcharts.SeriesHeatmapOptions;
|
|
21
21
|
export declare const CATEGORY_CLUSTER_HEATMAP_OPTIONS: Highcharts.Options;
|
|
22
|
-
export declare const CATEGORY_CLUSTER_HEATMAP_SOURCE = "import {\n Chart,\n ChartContainer,\n ChartHeader,\n ChartTitle,\n ChartContent,\n} from 'impact-nova/chart';\nimport { Card } from 'impact-nova/card';\nimport { IrisMenu } from 'impact-nova/iris';\n\n<Card className=\"w-[880px] max-w-full rounded-lg p-3 shadow-elevation-card\">\n <ChartContainer>\n <ChartHeader>\n <ChartTitle>Category \u00D7 Cluster \u2014 ST%</ChartTitle>\n </ChartHeader>\n <IrisMenu appearance=\"status\">\n Cells are colour-coded against the 69% plan...\n </IrisMenu>\n <ChartContent>\n <Chart\n type=\"heatmap\"\n xAxisCategories={['A', 'B', 'C', 'D', 'E']}\n yAxisCategories={['Knitwear', 'Outerwear', 'Tops', 'Bottoms', 'Accessories', 'Denim']}\n showLegend={false}\n series={[{ type: 'heatmap', data, dataLabels: { enabled: true, format: '{point.value}%' } }]}\n options={{ yAxis: { reversed: true }, plotOptions: { heatmap: { borderRadius: 8, borderWidth: 4 } } }}\n />\n </ChartContent>\n </ChartContainer>\n</Card>";
|
|
22
|
+
export declare const CATEGORY_CLUSTER_HEATMAP_SOURCE = "import {\n Chart,\n ChartContainer,\n ChartHeader,\n ChartTitle,\n ChartContent,\n} from 'impact-nova/chart';\nimport { Card } from 'impact-nova/card';\nimport { IrisMenu } from 'impact-nova/iris';\n\n<Card className=\"w-[880px] max-w-full rounded-lg p-3 shadow-elevation-card\">\n <ChartContainer>\n <ChartHeader>\n <ChartTitle>Category \u00D7 Cluster \u2014 ST%</ChartTitle>\n </ChartHeader>\n <IrisMenu appearance=\"status\">\n Cells are colour-coded against the 69% plan...\n </IrisMenu>\n <ChartContent className=\"h-[352px] overflow-auto\">\n <Chart\n type=\"heatmap\"\n cellMinHeight={36}\n cellMinWidth={72}\n fillContainer\n xAxisCategories={['A', 'B', 'C', 'D', 'E']}\n yAxisCategories={['Knitwear', 'Outerwear', 'Tops', 'Bottoms', 'Accessories', 'Denim']}\n showLegend={false}\n series={[{ type: 'heatmap', data, dataLabels: { enabled: true, format: '{point.value}%' } }]}\n options={{ yAxis: { reversed: true }, plotOptions: { heatmap: { borderRadius: 8, borderWidth: 4 } } }}\n />\n </ChartContent>\n </ChartContainer>\n</Card>";
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as A } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { Collapse as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { getInitializedHighcharts as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import k from "highcharts-react-official";
|
|
4
|
+
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
+
import { Skeleton as I } from "../skeleton/skeleton.js";
|
|
6
|
+
import { Collapse as U, Expand as V } from "impact-nova-icons";
|
|
7
|
+
import { Button as J } from "../../primitives/button/button.js";
|
|
8
|
+
import { getInitializedHighcharts as K } from "./initializeHighcharts.js";
|
|
9
|
+
import { readHeatmapChartBoxSizeFromProps as Q } from "./chart-heatmap-layout.js";
|
|
10
|
+
import { getBaseChartOptions as X, applySeriesGradient as Y } from "./chart.utils.js";
|
|
11
|
+
import { resolveHighchartsOptions as Z } from "./resolve-highcharts-options.js";
|
|
12
|
+
import { chartUsesScatter3d as _ } from "./chart-scatter3d.js";
|
|
13
|
+
import { useImpactNovaI18n as $ } from "../../../i18n/use-impact-nova-i18n.js";
|
|
13
14
|
/* empty css */
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
15
|
+
const z = K(), H = t.createContext(null), W = () => {
|
|
16
|
+
const n = t.useContext(H);
|
|
17
|
+
if (!n)
|
|
17
18
|
throw new Error("Chart components must be used within a ChartContainer");
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
({ className:
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
return n;
|
|
20
|
+
}, B = t.forwardRef(
|
|
21
|
+
({ className: n, children: r, isLoading: i = !1, ...o }, m) => {
|
|
22
|
+
const a = t.useRef(null), c = t.useRef(null), [g, d] = t.useState(null), [f, C] = t.useState(!1), [R, y] = t.useState(!1), q = t.useCallback((e) => {
|
|
23
|
+
a.current = e, d(e);
|
|
23
24
|
}, []);
|
|
24
|
-
t.useImperativeHandle(
|
|
25
|
-
const
|
|
26
|
-
const e =
|
|
27
|
-
e && (
|
|
28
|
-
e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(),
|
|
25
|
+
t.useImperativeHandle(m, () => a.current);
|
|
26
|
+
const w = () => {
|
|
27
|
+
const e = a.current;
|
|
28
|
+
e && (y(!0), e.classList.add("fullscreen-animating"), setTimeout(() => {
|
|
29
|
+
e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(), C(!0), e.classList.remove("fullscreen-animating");
|
|
29
30
|
}, 200));
|
|
30
|
-
},
|
|
31
|
-
const e =
|
|
32
|
-
e && (
|
|
33
|
-
document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(),
|
|
31
|
+
}, x = () => {
|
|
32
|
+
const e = a.current;
|
|
33
|
+
e && (y(!0), e.classList.add("fullscreen-animating-out"), setTimeout(() => {
|
|
34
|
+
document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), C(!1), e.classList.remove("fullscreen-animating-out");
|
|
34
35
|
}, 200));
|
|
35
|
-
},
|
|
36
|
-
|
|
36
|
+
}, v = () => {
|
|
37
|
+
f ? x() : w();
|
|
37
38
|
};
|
|
38
39
|
return t.useEffect(() => {
|
|
39
40
|
const e = () => {
|
|
40
|
-
document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement ||
|
|
41
|
+
document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || C(!1);
|
|
41
42
|
};
|
|
42
43
|
return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), () => {
|
|
43
44
|
document.removeEventListener("fullscreenchange", e), document.removeEventListener(
|
|
@@ -46,180 +47,194 @@ const k = O(), q = t.createContext(null), H = () => {
|
|
|
46
47
|
);
|
|
47
48
|
};
|
|
48
49
|
}, []), t.useEffect(() => {
|
|
49
|
-
if (!
|
|
50
|
-
const e =
|
|
51
|
-
let
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
e.setSize(
|
|
50
|
+
if (!c?.current?.chart) return;
|
|
51
|
+
const e = c.current.chart;
|
|
52
|
+
let l = null;
|
|
53
|
+
const h = () => {
|
|
54
|
+
f && a.current ? (l && cancelAnimationFrame(l), l = requestAnimationFrame(() => {
|
|
55
|
+
const u = a.current;
|
|
56
|
+
if (!u) return;
|
|
57
|
+
const E = u.getBoundingClientRect(), F = u.querySelector('[class*="ChartContent"]');
|
|
58
|
+
if (F) {
|
|
59
|
+
const b = F.getBoundingClientRect();
|
|
60
|
+
e.setSize(b.width, b.height, !1);
|
|
60
61
|
} else
|
|
61
|
-
e.setSize(
|
|
62
|
-
|
|
62
|
+
e.setSize(E.width, E.height, !1);
|
|
63
|
+
l = null;
|
|
63
64
|
})) : (e.setSize(null, null, !1), e.reflow());
|
|
64
65
|
};
|
|
65
|
-
return window.addEventListener("resize",
|
|
66
|
-
|
|
66
|
+
return window.addEventListener("resize", h), () => {
|
|
67
|
+
l && cancelAnimationFrame(l), window.removeEventListener("resize", h);
|
|
67
68
|
};
|
|
68
|
-
}, [
|
|
69
|
-
|
|
69
|
+
}, [f]), /* @__PURE__ */ s(
|
|
70
|
+
H.Provider,
|
|
70
71
|
{
|
|
71
72
|
value: {
|
|
72
|
-
isExpanded:
|
|
73
|
-
toggleFullscreen:
|
|
74
|
-
isLoading:
|
|
75
|
-
containerRef:
|
|
76
|
-
containerElement:
|
|
77
|
-
chartComponentRef:
|
|
73
|
+
isExpanded: f,
|
|
74
|
+
toggleFullscreen: v,
|
|
75
|
+
isLoading: i,
|
|
76
|
+
containerRef: a,
|
|
77
|
+
containerElement: g,
|
|
78
|
+
chartComponentRef: c
|
|
78
79
|
},
|
|
79
80
|
children: /* @__PURE__ */ s(
|
|
80
81
|
"div",
|
|
81
82
|
{
|
|
82
|
-
ref:
|
|
83
|
+
ref: q,
|
|
83
84
|
"data-component": "chart",
|
|
84
|
-
className:
|
|
85
|
-
|
|
85
|
+
className: p(
|
|
86
|
+
n,
|
|
86
87
|
"w-full relative bg-canvas-elevated transition-all duration-200 ease-in-out",
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
f && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
|
|
89
|
+
R && "overflow-hidden"
|
|
89
90
|
),
|
|
90
|
-
...
|
|
91
|
-
children:
|
|
91
|
+
...o,
|
|
92
|
+
children: r
|
|
92
93
|
}
|
|
93
94
|
)
|
|
94
95
|
}
|
|
95
96
|
);
|
|
96
97
|
}
|
|
97
98
|
);
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
({ className:
|
|
99
|
+
B.displayName = "ChartContainer";
|
|
100
|
+
const ee = t.forwardRef(
|
|
101
|
+
({ className: n, children: r, ...i }, o) => /* @__PURE__ */ s("div", { ref: o, className: p("flex items-center justify-between mb-4", n), ...i, children: r })
|
|
101
102
|
);
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
({ className:
|
|
103
|
+
ee.displayName = "ChartHeader";
|
|
104
|
+
const te = t.forwardRef(
|
|
105
|
+
({ className: n, ...r }, i) => /* @__PURE__ */ s("h3", { ref: i, className: p("text-lg font-semibold leading-none tracking-tight", n), ...r })
|
|
105
106
|
);
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
({ className:
|
|
107
|
+
te.displayName = "ChartTitle";
|
|
108
|
+
const ne = t.forwardRef(
|
|
109
|
+
({ className: n, ...r }, i) => /* @__PURE__ */ s("div", { ref: i, className: p("flex items-center gap-2", n), ...r })
|
|
109
110
|
);
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
({ className:
|
|
113
|
-
const { t:
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
|
|
111
|
+
ne.displayName = "ChartActions";
|
|
112
|
+
const se = t.forwardRef(
|
|
113
|
+
({ className: n, ...r }, i) => {
|
|
114
|
+
const { t: o } = $(), { toggleFullscreen: m, isExpanded: a } = W(), c = o("aria.toggleFullscreen");
|
|
115
|
+
return /* @__PURE__ */ A(
|
|
116
|
+
J,
|
|
116
117
|
{
|
|
117
118
|
variant: "ghost",
|
|
118
119
|
size: "icon",
|
|
119
|
-
onClick:
|
|
120
|
-
ref:
|
|
121
|
-
className:
|
|
122
|
-
"aria-label":
|
|
123
|
-
...
|
|
120
|
+
onClick: m,
|
|
121
|
+
ref: i,
|
|
122
|
+
className: p("h-8 w-8", n),
|
|
123
|
+
"aria-label": c,
|
|
124
|
+
...r,
|
|
124
125
|
children: [
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */ s("span", { className: "sr-only", children:
|
|
126
|
+
a ? /* @__PURE__ */ s(U, { className: "h-4 w-4" }) : /* @__PURE__ */ s(V, { className: "h-4 w-4" }),
|
|
127
|
+
/* @__PURE__ */ s("span", { className: "sr-only", children: c })
|
|
127
128
|
]
|
|
128
129
|
}
|
|
129
130
|
);
|
|
130
131
|
}
|
|
131
132
|
);
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
({ className:
|
|
135
|
-
const { isLoading:
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */ s(
|
|
139
|
-
/* @__PURE__ */ s(
|
|
133
|
+
se.displayName = "ChartFullScreen";
|
|
134
|
+
const P = t.forwardRef(
|
|
135
|
+
({ className: n, children: r, loader: i, ...o }, m) => {
|
|
136
|
+
const { isLoading: a, chartComponentRef: c, isExpanded: g } = W();
|
|
137
|
+
return a && i ? /* @__PURE__ */ s("div", { ref: m, className: p(n, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", g && "min-h-0"), ...o, children: i }) : /* @__PURE__ */ A("div", { ref: m, className: p(n, "w-full relative flex-1 min-h-[300px]", g && "min-h-0"), ...o, children: [
|
|
138
|
+
a && /* @__PURE__ */ A("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
|
|
139
|
+
/* @__PURE__ */ s(I, { className: "h-8 w-1/3" }),
|
|
140
|
+
/* @__PURE__ */ s(I, { className: "flex-1 w-full" })
|
|
140
141
|
] }),
|
|
141
|
-
t.Children.map(
|
|
142
|
+
t.Children.map(r, (d) => t.isValidElement(d) ? t.cloneElement(d, { ref: c }) : d)
|
|
142
143
|
] });
|
|
143
144
|
}
|
|
144
145
|
);
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
(
|
|
146
|
+
P.displayName = "ChartContent";
|
|
147
|
+
const re = t.forwardRef(
|
|
148
|
+
(n, r) => {
|
|
148
149
|
const {
|
|
149
|
-
height:
|
|
150
|
-
width:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
height: i,
|
|
151
|
+
width: o,
|
|
152
|
+
cellMinHeight: m,
|
|
153
|
+
cellMinWidth: a,
|
|
154
|
+
fillContainer: c,
|
|
155
|
+
className: g,
|
|
156
|
+
isLoading: d,
|
|
157
|
+
loader: f,
|
|
158
|
+
title: C,
|
|
159
|
+
noWrapper: R,
|
|
160
|
+
gradient: y,
|
|
161
|
+
children: q,
|
|
158
162
|
is3D: w,
|
|
159
|
-
type:
|
|
160
|
-
series:
|
|
161
|
-
...
|
|
162
|
-
} =
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
type: x,
|
|
164
|
+
series: v,
|
|
165
|
+
...e
|
|
166
|
+
} = n, l = Q({
|
|
167
|
+
type: x,
|
|
168
|
+
height: i,
|
|
169
|
+
width: o,
|
|
170
|
+
cellMinHeight: m,
|
|
171
|
+
cellMinWidth: a,
|
|
172
|
+
fillContainer: c,
|
|
173
|
+
xAxisCategories: e.xAxisCategories,
|
|
174
|
+
yAxisCategories: e.yAxisCategories,
|
|
175
|
+
options: e.options
|
|
176
|
+
}), h = l.height, u = l.width, E = typeof h == "number" ? h : null, F = typeof u == "number" ? u : null, b = t.useContext(H), [j, T] = t.useState(null), M = t.useCallback((N) => {
|
|
177
|
+
T(N);
|
|
178
|
+
}, []), O = _({ is3D: w, type: x, series: v }), D = t.useMemo(() => {
|
|
179
|
+
const N = X({ title: C, is3D: w, type: x, series: v, ...e });
|
|
166
180
|
return {
|
|
167
|
-
...
|
|
181
|
+
...N,
|
|
168
182
|
chart: {
|
|
169
|
-
...
|
|
170
|
-
height:
|
|
171
|
-
width:
|
|
183
|
+
...N.chart,
|
|
184
|
+
height: E,
|
|
185
|
+
width: F
|
|
172
186
|
}
|
|
173
187
|
};
|
|
174
|
-
}, [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
),
|
|
178
|
-
height: typeof
|
|
179
|
-
width: typeof
|
|
188
|
+
}, [C, E, F, w, x, v, e]), G = b?.containerElement ?? j ?? (typeof document > "u" ? null : document.documentElement), S = Y(
|
|
189
|
+
Z(D, G),
|
|
190
|
+
y
|
|
191
|
+
), L = {
|
|
192
|
+
height: typeof h == "number" ? h : h ?? "100%",
|
|
193
|
+
width: typeof u == "number" ? u : u ?? "100%",
|
|
194
|
+
...l.minWidth !== void 0 ? { minWidth: l.minWidth } : {}
|
|
180
195
|
};
|
|
181
|
-
return
|
|
182
|
-
|
|
196
|
+
return R ? /* @__PURE__ */ s("div", { ref: M, className: "h-full w-full", children: /* @__PURE__ */ s(
|
|
197
|
+
k,
|
|
183
198
|
{
|
|
184
|
-
highcharts:
|
|
185
|
-
options:
|
|
186
|
-
ref:
|
|
187
|
-
containerProps: { style:
|
|
199
|
+
highcharts: z,
|
|
200
|
+
options: S,
|
|
201
|
+
ref: r,
|
|
202
|
+
containerProps: { style: L }
|
|
188
203
|
}
|
|
189
204
|
) }) : b ? /* @__PURE__ */ s(
|
|
190
|
-
|
|
205
|
+
k,
|
|
191
206
|
{
|
|
192
|
-
highcharts:
|
|
193
|
-
options:
|
|
194
|
-
ref:
|
|
195
|
-
containerProps: { style:
|
|
207
|
+
highcharts: z,
|
|
208
|
+
options: S,
|
|
209
|
+
ref: r,
|
|
210
|
+
containerProps: { style: L }
|
|
196
211
|
}
|
|
197
212
|
) : /* @__PURE__ */ s(
|
|
198
|
-
|
|
213
|
+
B,
|
|
199
214
|
{
|
|
200
|
-
className:
|
|
201
|
-
isLoading:
|
|
202
|
-
"data-slot":
|
|
203
|
-
children: /* @__PURE__ */ s(
|
|
204
|
-
|
|
215
|
+
className: g,
|
|
216
|
+
isLoading: d,
|
|
217
|
+
"data-slot": O ? "chart-scatter3d" : void 0,
|
|
218
|
+
children: /* @__PURE__ */ s(P, { loader: f, children: /* @__PURE__ */ s(
|
|
219
|
+
k,
|
|
205
220
|
{
|
|
206
|
-
highcharts:
|
|
207
|
-
options:
|
|
208
|
-
ref:
|
|
209
|
-
containerProps: { style:
|
|
221
|
+
highcharts: z,
|
|
222
|
+
options: S,
|
|
223
|
+
ref: r,
|
|
224
|
+
containerProps: { style: L }
|
|
210
225
|
}
|
|
211
226
|
) })
|
|
212
227
|
}
|
|
213
228
|
);
|
|
214
229
|
}
|
|
215
230
|
);
|
|
216
|
-
|
|
231
|
+
re.displayName = "Chart";
|
|
217
232
|
export {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
re as Chart,
|
|
234
|
+
ne as ChartActions,
|
|
235
|
+
B as ChartContainer,
|
|
236
|
+
P as ChartContent,
|
|
237
|
+
se as ChartFullScreen,
|
|
238
|
+
ee as ChartHeader,
|
|
239
|
+
te as ChartTitle
|
|
225
240
|
};
|
|
@@ -33,6 +33,23 @@ export interface ChartProps {
|
|
|
33
33
|
*/
|
|
34
34
|
gradient?: boolean | ChartGradientOptions;
|
|
35
35
|
options?: Highcharts.Options;
|
|
36
|
+
/**
|
|
37
|
+
* Heatmap only. Fixed row height in px. Chart height becomes
|
|
38
|
+
* `rows * cellMinHeight + chrome` so appending rows does not shrink cells.
|
|
39
|
+
* Omit to keep stretch-to-`height` behavior.
|
|
40
|
+
*/
|
|
41
|
+
cellMinHeight?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Heatmap only. Minimum column width in px. Combine with `fillContainer`
|
|
44
|
+
* to grow columns when the host is wider than `columns * cellMinWidth`.
|
|
45
|
+
*/
|
|
46
|
+
cellMinWidth?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Heatmap only. Extra host width goes to columns (CSS `width: 100%` + `minWidth`).
|
|
49
|
+
* When omitted, `cellMinWidth` shrink-wraps the chart to the min width.
|
|
50
|
+
* Does not fetch or page data — overflow and `onEndReached` stay on the consumer.
|
|
51
|
+
*/
|
|
52
|
+
fillContainer?: boolean;
|
|
36
53
|
height?: number | string;
|
|
37
54
|
width?: number | string;
|
|
38
55
|
className?: string;
|