@sybilion/uilib 1.3.23 → 1.3.25
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/esm/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.js +34 -0
- package/dist/esm/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl.js +7 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.constants.js +17 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.js +807 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.styl.js +7 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +130 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.js +20 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl.js +7 -0
- package/dist/esm/components/widgets/PerformanceChart/performanceChart.helpers.js +591 -0
- package/dist/esm/components/widgets/PerformanceChart/performanceChartUserSeries.js +109 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.d.ts +7 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceChart.constants.d.ts +3 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceChart.d.ts +54 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceTable.d.ts +31 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.d.ts +20 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/index.d.ts +4 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/performanceChart.helpers.d.ts +212 -0
- package/dist/esm/types/src/components/widgets/PerformanceChart/performanceChartUserSeries.d.ts +20 -0
- package/dist/esm/types/src/docs/pages/PerformanceChartPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl +25 -0
- package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl.d.ts +11 -0
- package/src/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.tsx +67 -0
- package/src/components/widgets/PerformanceChart/PerformanceChart.constants.ts +17 -0
- package/src/components/widgets/PerformanceChart/PerformanceChart.styl +194 -0
- package/src/components/widgets/PerformanceChart/PerformanceChart.styl.d.ts +30 -0
- package/src/components/widgets/PerformanceChart/PerformanceChart.tsx +1251 -0
- package/src/components/widgets/PerformanceChart/PerformanceTable.tsx +381 -0
- package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl +49 -0
- package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.styl.d.ts +12 -0
- package/src/components/widgets/PerformanceChart/PerformanceUnderChartLegend/PerformanceUnderChartLegend.tsx +83 -0
- package/src/components/widgets/PerformanceChart/index.ts +28 -0
- package/src/components/widgets/PerformanceChart/performanceChart.helpers.ts +790 -0
- package/src/components/widgets/PerformanceChart/performanceChartUserSeries.ts +149 -0
- package/src/docs/pages/PerformanceChartPage.tsx +211 -0
- package/src/docs/registry.ts +6 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Tabs, TabsList, TabsTrigger } from '../../../ui/Tabs/Tabs.js';
|
|
4
|
+
import { useThrottledCallback } from '../../../../hooks/useThrottledCallback.js';
|
|
5
|
+
import S from './HorizonsSelector.styl.js';
|
|
6
|
+
|
|
7
|
+
function HorizonsSelector({ selectedHorizon, onHorizonChange, availableHorizons, }) {
|
|
8
|
+
const horizons = useMemo(() => {
|
|
9
|
+
return availableHorizons
|
|
10
|
+
.sort((a, b) => {
|
|
11
|
+
// Sort by horizon number: horizon_1, horizon_2, etc.
|
|
12
|
+
const numA = parseInt(a.replace('horizon_', ''), 10);
|
|
13
|
+
const numB = parseInt(b.replace('horizon_', ''), 10);
|
|
14
|
+
return numA - numB;
|
|
15
|
+
})
|
|
16
|
+
.map(horizon => {
|
|
17
|
+
const num = horizon.replace('horizon_', '');
|
|
18
|
+
return {
|
|
19
|
+
value: horizon,
|
|
20
|
+
label: num,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}, [availableHorizons]);
|
|
24
|
+
const onChangeThrottled = useThrottledCallback(onHorizonChange, 300);
|
|
25
|
+
if (horizons.length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (jsxs("div", { className: S.root, children: [jsx("span", { className: S.horizonsLabel, children: "Planning horizon in months:" }), jsx(Tabs, { value: selectedHorizon, onValueChange: onHorizonChange, variant: "button", children: jsx(TabsList, { children: horizons.map(horizon => (jsx(TabsTrigger, { value: horizon.value, onPointerMove: () => {
|
|
29
|
+
if (selectedHorizon !== horizon.value)
|
|
30
|
+
onChangeThrottled(horizon.value);
|
|
31
|
+
}, children: horizon.label }, horizon.value))) }) })] }));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { HorizonsSelector };
|
package/dist/esm/components/widgets/PerformanceChart/HorizonsSelector/HorizonsSelector.styl.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.HorizonsSelector_root__r5vAR{align-items:center;display:flex;flex-grow:1;gap:var(--p-4);justify-content:flex-end}.HorizonsSelector_horizonsLabel__-OzSL{color:var(--foreground);font-size:14px;font-weight:500}.HorizonsSelector_horizonsButtons__Z0aVg{display:flex;gap:var(--p-2)}.HorizonsSelector_horizonButton__YYpIJ{min-width:40px}.HorizonsSelector_infoIcon__7p03J{font-size:12px;margin-left:4px;opacity:.6}";
|
|
4
|
+
var S = {"root":"HorizonsSelector_root__r5vAR","horizonsLabel":"HorizonsSelector_horizonsLabel__-OzSL","horizonsButtons":"HorizonsSelector_horizonsButtons__Z0aVg","horizonButton":"HorizonsSelector_horizonButton__YYpIJ","infoIcon":"HorizonsSelector_infoIcon__7p03J"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|