@e-llm-studio/federated-dashboard-components 0.0.1-alpha.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/README.md +698 -0
- package/dist/ExecutiveDashboardWrapper.js +2 -0
- package/dist/ExecutiveDashboardWrapper.js.map +1 -0
- package/dist/_virtual/_tslib.js +2 -0
- package/dist/_virtual/_tslib.js.map +1 -0
- package/dist/api/dashboardApi.js +2 -0
- package/dist/api/dashboardApi.js.map +1 -0
- package/dist/cjs/ExecutiveDashboardWrapper.js +2 -0
- package/dist/cjs/ExecutiveDashboardWrapper.js.map +1 -0
- package/dist/cjs/_virtual/_tslib.js +2 -0
- package/dist/cjs/_virtual/_tslib.js.map +1 -0
- package/dist/cjs/api/dashboardApi.js +2 -0
- package/dist/cjs/api/dashboardApi.js.map +1 -0
- package/dist/cjs/components/DashboardCard/BreakingNewsBanner.js +2 -0
- package/dist/cjs/components/DashboardCard/BreakingNewsBanner.js.map +1 -0
- package/dist/cjs/components/DashboardCard/CardShell.js +2 -0
- package/dist/cjs/components/DashboardCard/CardShell.js.map +1 -0
- package/dist/cjs/components/DashboardCard/CenteredCell.js +2 -0
- package/dist/cjs/components/DashboardCard/CenteredCell.js.map +1 -0
- package/dist/cjs/components/DashboardCard/DashboardCard.js +2 -0
- package/dist/cjs/components/DashboardCard/DashboardCard.js.map +1 -0
- package/dist/cjs/components/DashboardCard/DetailRow.js +2 -0
- package/dist/cjs/components/DashboardCard/DetailRow.js.map +1 -0
- package/dist/cjs/components/DashboardCard/EventsSection.js +2 -0
- package/dist/cjs/components/DashboardCard/EventsSection.js.map +1 -0
- package/dist/cjs/components/DashboardCard/FooterLinkButton.js +2 -0
- package/dist/cjs/components/DashboardCard/FooterLinkButton.js.map +1 -0
- package/dist/cjs/components/DashboardCard/GridSection.js +2 -0
- package/dist/cjs/components/DashboardCard/GridSection.js.map +1 -0
- package/dist/cjs/components/DashboardCard/ListSection.js +2 -0
- package/dist/cjs/components/DashboardCard/ListSection.js.map +1 -0
- package/dist/cjs/components/DashboardCard/SectionHeadingBar.js +2 -0
- package/dist/cjs/components/DashboardCard/SectionHeadingBar.js.map +1 -0
- package/dist/cjs/components/DashboardCard/SkeletonRow.js +2 -0
- package/dist/cjs/components/DashboardCard/SkeletonRow.js.map +1 -0
- package/dist/cjs/components/DashboardCard/TagsSection.js +2 -0
- package/dist/cjs/components/DashboardCard/TagsSection.js.map +1 -0
- package/dist/cjs/components/DashboardCard/TopDropdownMenu.js +2 -0
- package/dist/cjs/components/DashboardCard/TopDropdownMenu.js.map +1 -0
- package/dist/cjs/components/DashboardCard/sectionContent.js +2 -0
- package/dist/cjs/components/DashboardCard/sectionContent.js.map +1 -0
- package/dist/cjs/components/DashboardCard/styles/DashboardCardStyles.js +2 -0
- package/dist/cjs/components/DashboardCard/styles/DashboardCardStyles.js.map +1 -0
- package/dist/cjs/components/DashboardDateFilter/DashboardDateFilter.js +2 -0
- package/dist/cjs/components/DashboardDateFilter/DashboardDateFilter.js.map +1 -0
- package/dist/cjs/components/DashboardDateFilter/datePreset.js +2 -0
- package/dist/cjs/components/DashboardDateFilter/datePreset.js.map +1 -0
- package/dist/cjs/components/DashboardSkeleton/DashboardSkeleton.js +2 -0
- package/dist/cjs/components/DashboardSkeleton/DashboardSkeleton.js.map +1 -0
- package/dist/cjs/components/DatePickers/DatePicker.js +2 -0
- package/dist/cjs/components/DatePickers/DatePicker.js.map +1 -0
- package/dist/cjs/components/DatePickers/DateRangeSelector.js +2 -0
- package/dist/cjs/components/DatePickers/DateRangeSelector.js.map +1 -0
- package/dist/cjs/components/DatePickers/DateSelector.js +2 -0
- package/dist/cjs/components/DatePickers/DateSelector.js.map +1 -0
- package/dist/cjs/components/DropDowns/CustomMultiSelect.js +2 -0
- package/dist/cjs/components/DropDowns/CustomMultiSelect.js.map +1 -0
- package/dist/cjs/components/DropDowns/CustomSingleSelect.js +2 -0
- package/dist/cjs/components/DropDowns/CustomSingleSelect.js.map +1 -0
- package/dist/cjs/components/ExecutiveDashboard.js +2 -0
- package/dist/cjs/components/ExecutiveDashboard.js.map +1 -0
- package/dist/cjs/components/FiltersSidebar/CustomTextInput.js +2 -0
- package/dist/cjs/components/FiltersSidebar/CustomTextInput.js.map +1 -0
- package/dist/cjs/components/FiltersSidebar/FiltersSidebar.js +2 -0
- package/dist/cjs/components/FiltersSidebar/FiltersSidebar.js.map +1 -0
- package/dist/cjs/components/Graph/Graph.js +2 -0
- package/dist/cjs/components/Graph/Graph.js.map +1 -0
- package/dist/cjs/components/Graph/GraphEmptyState.js +2 -0
- package/dist/cjs/components/Graph/GraphEmptyState.js.map +1 -0
- package/dist/cjs/components/Graph/GraphSkeleton.js +2 -0
- package/dist/cjs/components/Graph/GraphSkeleton.js.map +1 -0
- package/dist/cjs/components/Graph/LineChart.js +2 -0
- package/dist/cjs/components/Graph/LineChart.js.map +1 -0
- package/dist/cjs/components/Graph/PlotBySelector.js +2 -0
- package/dist/cjs/components/Graph/PlotBySelector.js.map +1 -0
- package/dist/cjs/components/Graph/types.js +2 -0
- package/dist/cjs/components/Graph/types.js.map +1 -0
- package/dist/cjs/components/MetricCard/MetricCard.js +2 -0
- package/dist/cjs/components/MetricCard/MetricCard.js.map +1 -0
- package/dist/cjs/components/Table/FTable.js +2 -0
- package/dist/cjs/components/Table/FTable.js.map +1 -0
- package/dist/cjs/components/Table/SortDropdown.js +2 -0
- package/dist/cjs/components/Table/SortDropdown.js.map +1 -0
- package/dist/cjs/components/Table/TableCard.js +2 -0
- package/dist/cjs/components/Table/TableCard.js.map +1 -0
- package/dist/cjs/components/Table/TableGrid/TableGrid.js +2 -0
- package/dist/cjs/components/Table/TableGrid/TableGrid.js.map +1 -0
- package/dist/cjs/components/Table/TableGrid/TableLayoutToggle.js +2 -0
- package/dist/cjs/components/Table/TableGrid/TableLayoutToggle.js.map +1 -0
- package/dist/cjs/components/Table/TableGrid/spans.js +2 -0
- package/dist/cjs/components/Table/TableGrid/spans.js.map +1 -0
- package/dist/cjs/components/Table/TableGrid/useResponsiveColumns.js +2 -0
- package/dist/cjs/components/Table/TableGrid/useResponsiveColumns.js.map +1 -0
- package/dist/cjs/components/ui/chart.js +2 -0
- package/dist/cjs/components/ui/chart.js.map +1 -0
- package/dist/cjs/components/ui/utils.js +2 -0
- package/dist/cjs/components/ui/utils.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/styles.css +1 -0
- package/dist/cjs/utils/index.js +2 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/kpiIcon.js +2 -0
- package/dist/cjs/utils/kpiIcon.js.map +1 -0
- package/dist/cjs/utils/sectionOrder.js +2 -0
- package/dist/cjs/utils/sectionOrder.js.map +1 -0
- package/dist/cjs/utils/tableColumns.js +2 -0
- package/dist/cjs/utils/tableColumns.js.map +1 -0
- package/dist/components/DashboardCard/BreakingNewsBanner.js +2 -0
- package/dist/components/DashboardCard/BreakingNewsBanner.js.map +1 -0
- package/dist/components/DashboardCard/CardShell.js +2 -0
- package/dist/components/DashboardCard/CardShell.js.map +1 -0
- package/dist/components/DashboardCard/CenteredCell.js +2 -0
- package/dist/components/DashboardCard/CenteredCell.js.map +1 -0
- package/dist/components/DashboardCard/DashboardCard.js +2 -0
- package/dist/components/DashboardCard/DashboardCard.js.map +1 -0
- package/dist/components/DashboardCard/DetailRow.js +2 -0
- package/dist/components/DashboardCard/DetailRow.js.map +1 -0
- package/dist/components/DashboardCard/EventsSection.js +2 -0
- package/dist/components/DashboardCard/EventsSection.js.map +1 -0
- package/dist/components/DashboardCard/FooterLinkButton.js +2 -0
- package/dist/components/DashboardCard/FooterLinkButton.js.map +1 -0
- package/dist/components/DashboardCard/GridSection.js +2 -0
- package/dist/components/DashboardCard/GridSection.js.map +1 -0
- package/dist/components/DashboardCard/ListSection.js +2 -0
- package/dist/components/DashboardCard/ListSection.js.map +1 -0
- package/dist/components/DashboardCard/SectionHeadingBar.js +2 -0
- package/dist/components/DashboardCard/SectionHeadingBar.js.map +1 -0
- package/dist/components/DashboardCard/SkeletonRow.js +2 -0
- package/dist/components/DashboardCard/SkeletonRow.js.map +1 -0
- package/dist/components/DashboardCard/TagsSection.js +2 -0
- package/dist/components/DashboardCard/TagsSection.js.map +1 -0
- package/dist/components/DashboardCard/TopDropdownMenu.js +2 -0
- package/dist/components/DashboardCard/TopDropdownMenu.js.map +1 -0
- package/dist/components/DashboardCard/sectionContent.js +2 -0
- package/dist/components/DashboardCard/sectionContent.js.map +1 -0
- package/dist/components/DashboardCard/styles/DashboardCardStyles.js +2 -0
- package/dist/components/DashboardCard/styles/DashboardCardStyles.js.map +1 -0
- package/dist/components/DashboardDateFilter/DashboardDateFilter.js +2 -0
- package/dist/components/DashboardDateFilter/DashboardDateFilter.js.map +1 -0
- package/dist/components/DashboardDateFilter/datePreset.js +2 -0
- package/dist/components/DashboardDateFilter/datePreset.js.map +1 -0
- package/dist/components/DashboardSkeleton/DashboardSkeleton.js +2 -0
- package/dist/components/DashboardSkeleton/DashboardSkeleton.js.map +1 -0
- package/dist/components/DatePickers/DatePicker.js +2 -0
- package/dist/components/DatePickers/DatePicker.js.map +1 -0
- package/dist/components/DatePickers/DateRangeSelector.js +2 -0
- package/dist/components/DatePickers/DateRangeSelector.js.map +1 -0
- package/dist/components/DatePickers/DateSelector.js +2 -0
- package/dist/components/DatePickers/DateSelector.js.map +1 -0
- package/dist/components/DropDowns/CustomMultiSelect.js +2 -0
- package/dist/components/DropDowns/CustomMultiSelect.js.map +1 -0
- package/dist/components/DropDowns/CustomSingleSelect.js +2 -0
- package/dist/components/DropDowns/CustomSingleSelect.js.map +1 -0
- package/dist/components/ExecutiveDashboard.js +2 -0
- package/dist/components/ExecutiveDashboard.js.map +1 -0
- package/dist/components/FiltersSidebar/CustomTextInput.js +2 -0
- package/dist/components/FiltersSidebar/CustomTextInput.js.map +1 -0
- package/dist/components/FiltersSidebar/FiltersSidebar.js +2 -0
- package/dist/components/FiltersSidebar/FiltersSidebar.js.map +1 -0
- package/dist/components/Graph/Graph.js +2 -0
- package/dist/components/Graph/Graph.js.map +1 -0
- package/dist/components/Graph/GraphEmptyState.js +2 -0
- package/dist/components/Graph/GraphEmptyState.js.map +1 -0
- package/dist/components/Graph/GraphSkeleton.js +2 -0
- package/dist/components/Graph/GraphSkeleton.js.map +1 -0
- package/dist/components/Graph/LineChart.js +2 -0
- package/dist/components/Graph/LineChart.js.map +1 -0
- package/dist/components/Graph/PlotBySelector.js +2 -0
- package/dist/components/Graph/PlotBySelector.js.map +1 -0
- package/dist/components/Graph/types.js +2 -0
- package/dist/components/Graph/types.js.map +1 -0
- package/dist/components/MetricCard/MetricCard.js +2 -0
- package/dist/components/MetricCard/MetricCard.js.map +1 -0
- package/dist/components/Table/FTable.js +2 -0
- package/dist/components/Table/FTable.js.map +1 -0
- package/dist/components/Table/SortDropdown.js +2 -0
- package/dist/components/Table/SortDropdown.js.map +1 -0
- package/dist/components/Table/TableCard.js +2 -0
- package/dist/components/Table/TableCard.js.map +1 -0
- package/dist/components/Table/TableGrid/TableGrid.js +2 -0
- package/dist/components/Table/TableGrid/TableGrid.js.map +1 -0
- package/dist/components/Table/TableGrid/TableLayoutToggle.js +2 -0
- package/dist/components/Table/TableGrid/TableLayoutToggle.js.map +1 -0
- package/dist/components/Table/TableGrid/spans.js +2 -0
- package/dist/components/Table/TableGrid/spans.js.map +1 -0
- package/dist/components/Table/TableGrid/useResponsiveColumns.js +2 -0
- package/dist/components/Table/TableGrid/useResponsiveColumns.js.map +1 -0
- package/dist/components/ui/chart.js +2 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/utils.js +2 -0
- package/dist/components/ui/utils.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/App.d.ts +2 -0
- package/dist/types/App.d.ts.map +1 -0
- package/dist/types/ExecutiveDashboardWrapper.d.ts +4 -0
- package/dist/types/ExecutiveDashboardWrapper.d.ts.map +1 -0
- package/dist/types/api/dashboardApi.d.ts +30 -0
- package/dist/types/api/dashboardApi.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/BreakingNewsBanner.d.ts +9 -0
- package/dist/types/components/DashboardCard/BreakingNewsBanner.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/CardShell.d.ts +22 -0
- package/dist/types/components/DashboardCard/CardShell.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/CenteredCell.d.ts +6 -0
- package/dist/types/components/DashboardCard/CenteredCell.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/DashboardCard.d.ts +5 -0
- package/dist/types/components/DashboardCard/DashboardCard.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/DetailRow.d.ts +9 -0
- package/dist/types/components/DashboardCard/DetailRow.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/EventsSection.d.ts +3 -0
- package/dist/types/components/DashboardCard/EventsSection.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/FooterLinkButton.d.ts +6 -0
- package/dist/types/components/DashboardCard/FooterLinkButton.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/GridSection.d.ts +3 -0
- package/dist/types/components/DashboardCard/GridSection.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/ListSection.d.ts +4 -0
- package/dist/types/components/DashboardCard/ListSection.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/SectionHeadingBar.d.ts +9 -0
- package/dist/types/components/DashboardCard/SectionHeadingBar.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/SkeletonRow.d.ts +3 -0
- package/dist/types/components/DashboardCard/SkeletonRow.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/TagsSection.d.ts +3 -0
- package/dist/types/components/DashboardCard/TagsSection.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/TopDropdownMenu.d.ts +6 -0
- package/dist/types/components/DashboardCard/TopDropdownMenu.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/sectionContent.d.ts +4 -0
- package/dist/types/components/DashboardCard/sectionContent.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/styles/DashboardCardStyles.d.ts +17 -0
- package/dist/types/components/DashboardCard/styles/DashboardCardStyles.d.ts.map +1 -0
- package/dist/types/components/DashboardCard/types.d.ts +156 -0
- package/dist/types/components/DashboardCard/types.d.ts.map +1 -0
- package/dist/types/components/DashboardDateFilter/DashboardDateFilter.d.ts +41 -0
- package/dist/types/components/DashboardDateFilter/DashboardDateFilter.d.ts.map +1 -0
- package/dist/types/components/DashboardDateFilter/DashboardDateFilter.types.d.ts +18 -0
- package/dist/types/components/DashboardDateFilter/DashboardDateFilter.types.d.ts.map +1 -0
- package/dist/types/components/DashboardDateFilter/datePreset.d.ts +90 -0
- package/dist/types/components/DashboardDateFilter/datePreset.d.ts.map +1 -0
- package/dist/types/components/DashboardSkeleton/DashboardSkeleton.d.ts +4 -0
- package/dist/types/components/DashboardSkeleton/DashboardSkeleton.d.ts.map +1 -0
- package/dist/types/components/DatePickers/DatePicker.d.ts +10 -0
- package/dist/types/components/DatePickers/DatePicker.d.ts.map +1 -0
- package/dist/types/components/DatePickers/DateRangeSelector.d.ts +20 -0
- package/dist/types/components/DatePickers/DateRangeSelector.d.ts.map +1 -0
- package/dist/types/components/DatePickers/DateSelector.d.ts +19 -0
- package/dist/types/components/DatePickers/DateSelector.d.ts.map +1 -0
- package/dist/types/components/DropDowns/CustomMultiSelect.d.ts +17 -0
- package/dist/types/components/DropDowns/CustomMultiSelect.d.ts.map +1 -0
- package/dist/types/components/DropDowns/CustomSingleSelect.d.ts +16 -0
- package/dist/types/components/DropDowns/CustomSingleSelect.d.ts.map +1 -0
- package/dist/types/components/ExecutiveDashboard.d.ts +56 -0
- package/dist/types/components/ExecutiveDashboard.d.ts.map +1 -0
- package/dist/types/components/FiltersSidebar/CustomTextInput.d.ts +12 -0
- package/dist/types/components/FiltersSidebar/CustomTextInput.d.ts.map +1 -0
- package/dist/types/components/FiltersSidebar/FiltersSidebar.d.ts +34 -0
- package/dist/types/components/FiltersSidebar/FiltersSidebar.d.ts.map +1 -0
- package/dist/types/components/Graph/Graph.d.ts +4 -0
- package/dist/types/components/Graph/Graph.d.ts.map +1 -0
- package/dist/types/components/Graph/GraphEmptyState.d.ts +11 -0
- package/dist/types/components/Graph/GraphEmptyState.d.ts.map +1 -0
- package/dist/types/components/Graph/GraphSkeleton.d.ts +10 -0
- package/dist/types/components/Graph/GraphSkeleton.d.ts.map +1 -0
- package/dist/types/components/Graph/LineChart.d.ts +25 -0
- package/dist/types/components/Graph/LineChart.d.ts.map +1 -0
- package/dist/types/components/Graph/PlotBySelector.d.ts +17 -0
- package/dist/types/components/Graph/PlotBySelector.d.ts.map +1 -0
- package/dist/types/components/Graph/types.d.ts +217 -0
- package/dist/types/components/Graph/types.d.ts.map +1 -0
- package/dist/types/components/MetricCard/MetricCard.d.ts +49 -0
- package/dist/types/components/MetricCard/MetricCard.d.ts.map +1 -0
- package/dist/types/components/Table/FTable.d.ts +49 -0
- package/dist/types/components/Table/FTable.d.ts.map +1 -0
- package/dist/types/components/Table/SortDropdown.d.ts +13 -0
- package/dist/types/components/Table/SortDropdown.d.ts.map +1 -0
- package/dist/types/components/Table/TableCard.d.ts +35 -0
- package/dist/types/components/Table/TableCard.d.ts.map +1 -0
- package/dist/types/components/Table/TableGrid/TableGrid.d.ts +54 -0
- package/dist/types/components/Table/TableGrid/TableGrid.d.ts.map +1 -0
- package/dist/types/components/Table/TableGrid/TableLayoutToggle.d.ts +20 -0
- package/dist/types/components/Table/TableGrid/TableLayoutToggle.d.ts.map +1 -0
- package/dist/types/components/Table/TableGrid/spans.d.ts +15 -0
- package/dist/types/components/Table/TableGrid/spans.d.ts.map +1 -0
- package/dist/types/components/Table/TableGrid/useResponsiveColumns.d.ts +17 -0
- package/dist/types/components/Table/TableGrid/useResponsiveColumns.d.ts.map +1 -0
- package/dist/types/components/ui/chart.d.ts +72 -0
- package/dist/types/components/ui/chart.d.ts.map +1 -0
- package/dist/types/components/ui/utils.d.ts +7 -0
- package/dist/types/components/ui/utils.d.ts.map +1 -0
- package/dist/types/constant/index.d.ts +5 -0
- package/dist/types/constant/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +38 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +357 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +65 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/kpiIcon.d.ts +4 -0
- package/dist/types/utils/kpiIcon.d.ts.map +1 -0
- package/dist/types/utils/sectionOrder.d.ts +43 -0
- package/dist/types/utils/sectionOrder.d.ts.map +1 -0
- package/dist/types/utils/tableColumns.d.ts +16 -0
- package/dist/types/utils/tableColumns.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/kpiIcon.js +2 -0
- package/dist/utils/kpiIcon.js.map +1 -0
- package/dist/utils/sectionOrder.js +2 -0
- package/dist/utils/sectionOrder.js.map +1 -0
- package/dist/utils/tableColumns.js +2 -0
- package/dist/utils/tableColumns.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ResponsiveColumns {
|
|
3
|
+
/** Columns that actually fit right now — always <= `desired`, never < 1. */
|
|
4
|
+
columns: number;
|
|
5
|
+
/** Most columns the current width can hold at `minColumnWidth`. */
|
|
6
|
+
maxFitting: number;
|
|
7
|
+
/** Measured container width, or null before the first measurement. */
|
|
8
|
+
width: number | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Watches an element's width and caps a desired column count to what actually
|
|
12
|
+
* fits, so the grid reflows on container resize (not just viewport resize —
|
|
13
|
+
* this component is embedded in host apps where the two differ).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useResponsiveColumns(desired: number, minColumnWidth: number, gap: number): [React.RefObject<HTMLDivElement>, ResponsiveColumns];
|
|
16
|
+
export default useResponsiveColumns;
|
|
17
|
+
//# sourceMappingURL=useResponsiveColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResponsiveColumns.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableGrid/useResponsiveColumns.ts"],"names":[],"mappings":";AAMA,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,GACV,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,iBAAiB,CAAC,CAgEtD;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
import "./chart.css";
|
|
4
|
+
/**
|
|
5
|
+
* shadcn/ui chart primitives, ported to plain CSS (no Tailwind).
|
|
6
|
+
*
|
|
7
|
+
* Same public API as shadcn's `chart.tsx`:
|
|
8
|
+
* - `ChartContainer` — wraps Recharts' ResponsiveContainer, injects per-key
|
|
9
|
+
* `--color-<key>` CSS variables from a `ChartConfig`.
|
|
10
|
+
* - `ChartConfig` — `{ [key]: { label?, icon?, color? } }`.
|
|
11
|
+
* - `ChartTooltip` — Recharts' Tooltip (re-export).
|
|
12
|
+
* - `ChartTooltipContent`— styled tooltip body.
|
|
13
|
+
* - `ChartLegend` — Recharts' Legend (re-export).
|
|
14
|
+
* - `ChartLegendContent` — styled legend (with optional click-to-toggle).
|
|
15
|
+
*/
|
|
16
|
+
export type ChartConfig = {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
label?: React.ReactNode;
|
|
19
|
+
icon?: React.ComponentType;
|
|
20
|
+
color?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type ChartContextProps = {
|
|
24
|
+
config: ChartConfig;
|
|
25
|
+
};
|
|
26
|
+
export declare function useChart(): ChartContextProps;
|
|
27
|
+
export declare const ChartContainer: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
28
|
+
config: ChartConfig;
|
|
29
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
30
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
32
|
+
type TooltipItem = {
|
|
33
|
+
value?: number | string;
|
|
34
|
+
name?: string | number;
|
|
35
|
+
dataKey?: string | number;
|
|
36
|
+
color?: string;
|
|
37
|
+
payload?: any;
|
|
38
|
+
};
|
|
39
|
+
export declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color"> & {
|
|
40
|
+
active?: boolean | undefined;
|
|
41
|
+
payload?: TooltipItem[] | undefined;
|
|
42
|
+
label?: any;
|
|
43
|
+
indicator?: "line" | "dot" | "dashed" | undefined;
|
|
44
|
+
hideLabel?: boolean | undefined;
|
|
45
|
+
hideIndicator?: boolean | undefined;
|
|
46
|
+
nameKey?: string | undefined;
|
|
47
|
+
labelKey?: string | undefined;
|
|
48
|
+
color?: string | undefined;
|
|
49
|
+
labelFormatter?: ((label: any, payload: TooltipItem[]) => React.ReactNode) | undefined;
|
|
50
|
+
formatter?: ((value: any, name: any, item: TooltipItem, index: number, payload: any) => React.ReactNode) | undefined;
|
|
51
|
+
/** Per-series value formatters, keyed by dataKey. */
|
|
52
|
+
valueFormatters?: Record<string, (value: any, item: TooltipItem) => React.ReactNode> | undefined;
|
|
53
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
55
|
+
type LegendItem = {
|
|
56
|
+
value?: any;
|
|
57
|
+
dataKey?: string | number;
|
|
58
|
+
color?: string;
|
|
59
|
+
payload?: any;
|
|
60
|
+
};
|
|
61
|
+
export declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
62
|
+
payload?: LegendItem[] | undefined;
|
|
63
|
+
verticalAlign?: "top" | "bottom" | undefined;
|
|
64
|
+
align?: "center" | "left" | "right" | undefined;
|
|
65
|
+
hideIcon?: boolean | undefined;
|
|
66
|
+
nameKey?: string | undefined;
|
|
67
|
+
/** When provided, legend items become toggle buttons. */
|
|
68
|
+
onItemClick?: ((key: string) => void) | undefined;
|
|
69
|
+
hiddenKeys?: Set<string> | undefined;
|
|
70
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAE9C,OAAO,aAAa,CAAC;AAErB;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,KAAK,iBAAiB,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAIjD,wBAAgB,QAAQ,sBAMvB;AAID,eAAO,MAAM,cAAc;YAGf,WAAW;cACT,MAAM,cAAc,CAC5B,OAAO,kBAAkB,mBAAmB,CAC7C,CAAC,UAAU,CAAC;gDAqBf,CAAC;AAwBH,eAAO,MAAM,YAAY,kCAA4B,CAAC;AAEtD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;YAKpB,GAAG;;;;;;;8BAOc,GAAG,WAAW,WAAW,EAAE,KAAK,MAAM,SAAS;yBAE/D,GAAG,QACJ,GAAG,QACH,WAAW,SACV,MAAM,WACJ,GAAG,KACT,MAAM,SAAS;IACpB,qDAAqD;6CACZ,GAAG,QAAQ,WAAW,KAAK,MAAM,SAAS;gDAqHtF,CAAC;AAKF,eAAO,MAAM,WAAW,iCAA2B,CAAC;AAEpD,KAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;IAQ3B,yDAAyD;yBACrC,MAAM,KAAK,IAAI;;gDAyFtC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal className combiner. shadcn normally uses `clsx` + `tailwind-merge`,
|
|
3
|
+
* but this library ships plain CSS (no Tailwind), so a simple truthy-join is
|
|
4
|
+
* all we need — there are no conflicting Tailwind classes to dedupe.
|
|
5
|
+
*/
|
|
6
|
+
export declare function cn(...classes: Array<string | false | null | undefined>): string;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAE/E"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DashboardApiConfig } from "../api/dashboardApi";
|
|
2
|
+
import { DashboardDataResponse, DashboardQueryParams, FetchUIConfig } from "../types";
|
|
3
|
+
export declare const fetchUIConfigMock: FetchUIConfig;
|
|
4
|
+
export declare function fetchDashboardDataMock(_config: DashboardApiConfig, _params: DashboardQueryParams, _signal?: AbortSignal): Promise<DashboardDataResponse>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constant/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACH,qBAAqB,EACrB,oBAAoB,EAIpB,aAAa,EACd,MAAM,UAAU,CAAC;AAqPlB,eAAO,MAAM,iBAAiB,EAAE,aAG/B,CAAC;AAsDF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAGhC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export { default as ExecutiveDashboardWrapper, ExecutiveDashboardWrapper as ExecutiveDashboard_Container, } from "./ExecutiveDashboardWrapper";
|
|
2
|
+
export { default as ExecutiveDashboard } from "./components/ExecutiveDashboard";
|
|
3
|
+
export type { DashboardProps } from "./components/ExecutiveDashboard";
|
|
4
|
+
export { fetchUIConfig, fetchDashboardData, fetchTableData, DashboardApiError, } from "./api/dashboardApi";
|
|
5
|
+
export type { DashboardApiConfig as DashboardApiEndpointConfig } from "./api/dashboardApi";
|
|
6
|
+
export type { DashboardContainerProps, DashboardApiConfig, DashboardUIConfig, DashboardUIData, DashboardDataResponse, TableDataResponse, DashboardQueryParams, DateFiltersConfig, SidebarFilterConfig, GraphBuilderConfig, GraphTierConfig, PlotOptionConfig, SeriesConfig, KpiCardConfig, TierData, PlotByOptions, SeriesDataMap, FetchUIConfig, FetchDashboardData, FetchTableData, DashboardSectionKey, } from "./types";
|
|
7
|
+
export { DASHBOARD_SECTION_KEYS, PINNED_SECTION_KEYS, isSectionHidden, resolveSectionOrder, } from "./utils/sectionOrder";
|
|
8
|
+
export { default as Graph } from "./components/Graph/Graph";
|
|
9
|
+
export { default as LineChart } from "./components/Graph/LineChart";
|
|
10
|
+
export { default as PlotBySelector } from "./components/Graph/PlotBySelector";
|
|
11
|
+
export { DEFAULT_COLORS, colorForIndex } from "./components/Graph/types";
|
|
12
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, useChart, } from "./components/ui/chart";
|
|
13
|
+
export type { ChartConfig } from "./components/ui/chart";
|
|
14
|
+
export type { GraphProps, Series, DataPoint, CurveType, PlotByConfig, PlotByOption, AxisConfig, XAxisConfig, YAxisConfig, TooltipConfig, TooltipPoint, LegendConfig, GraphConfig, GraphStyle, GraphPaneConfig, } from "./components/Graph/types";
|
|
15
|
+
export { default as DashboardDateFilter } from './components/DashboardDateFilter/DashboardDateFilter';
|
|
16
|
+
export { default as MetricCard } from './components/MetricCard/MetricCard';
|
|
17
|
+
export { default as FiltersSidebar } from './components/FiltersSidebar/FiltersSidebar';
|
|
18
|
+
export { default as FTable } from './components/Table/FTable';
|
|
19
|
+
export { default as TableCard } from './components/Table/TableCard';
|
|
20
|
+
export { default as TableGrid } from './components/Table/TableGrid/TableGrid';
|
|
21
|
+
export { default as TableLayoutToggle } from './components/Table/TableGrid/TableLayoutToggle';
|
|
22
|
+
export { default as useResponsiveColumns } from './components/Table/TableGrid/useResponsiveColumns';
|
|
23
|
+
export type { TableGridProps } from './components/Table/TableGrid/TableGrid';
|
|
24
|
+
export type { TableLayoutToggleProps, TableLayoutMode } from './components/Table/TableGrid/TableLayoutToggle';
|
|
25
|
+
export type { TableSpan } from './components/Table/TableGrid/spans';
|
|
26
|
+
export type { FTableColumn, TableRow } from './components/Table/FTable';
|
|
27
|
+
export type { TableCardProps } from './components/Table/TableCard';
|
|
28
|
+
export type { DashboardTablesConfig, DashboardTableRenderConfig, DashboardTableCardStyles, DashboardTableLayoutConfig, TableBuilderConfig, TableColumnConfig, } from './types';
|
|
29
|
+
export { formatKpiValue, getKpiDelta, getKpiSentiment, getKpiValueColor, isKpiValueObject, KPI_SENTIMENT_COLORS, } from './utils';
|
|
30
|
+
export type { IndicatorLogic, KpiDelta, KpiSentiment, KpiValueObject, } from './utils';
|
|
31
|
+
export * from './components/DashboardDateFilter/DashboardDateFilter.types';
|
|
32
|
+
export * from './components/DashboardDateFilter/datePreset';
|
|
33
|
+
export type { MetricCardProps } from './components/MetricCard/MetricCard';
|
|
34
|
+
export type { FiltersSidebarProps } from './components/FiltersSidebar/FiltersSidebar';
|
|
35
|
+
export type { FTableProps } from './components/Table/FTable';
|
|
36
|
+
export { DashboardCard } from './components/DashboardCard/DashboardCard';
|
|
37
|
+
export type { DashboardCardProps, DashboardSection, SectionItem, TagItem, TagsSectionConfig, EventItem, EventDetail, DropdownConfig, FooterLinkConfig, NewsItem, } from './components/DashboardCard/DashboardCard';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,IAAI,yBAAyB,EACpC,yBAAyB,IAAI,4BAA4B,GAC1D,MAAM,6B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Ac,6CAA6C,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACT,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { KpiValueObject } from "../utils";
|
|
3
|
+
import type { FTableColumn } from "../components/Table/FTable";
|
|
4
|
+
import type { TableSpan } from "../components/Table/TableGrid/spans";
|
|
5
|
+
import type { TableLayoutMode } from "../components/Table/TableGrid/TableLayoutToggle";
|
|
6
|
+
export type { TableSpan, TableLayoutMode };
|
|
7
|
+
/**
|
|
8
|
+
* A re-orderable dashboard section, named by the key it arrives under in the UI
|
|
9
|
+
* config payload — pass whatever key you already have.
|
|
10
|
+
*
|
|
11
|
+
* The listed literals are today's sections (for editor autocomplete); the
|
|
12
|
+
* `(string & {})` arm keeps any future section key valid without a type change.
|
|
13
|
+
*
|
|
14
|
+
* `dateFilters` and `sidebarFilters` have a fixed position — the date bar is
|
|
15
|
+
* pinned to the top, the filters sidebar is an overlay — so `sectionOrder`
|
|
16
|
+
* ignores them. `hiddenSections` still hides them.
|
|
17
|
+
*
|
|
18
|
+
* Matching is case-insensitive and ignores spaces/underscores/dashes. Anything
|
|
19
|
+
* unrecognized is ignored (with a dev-mode console warning) rather than
|
|
20
|
+
* throwing, since these lists are usually config-driven.
|
|
21
|
+
*/
|
|
22
|
+
export type DashboardSectionKey = "graphBuilder" | "kpiCards" | "tableBuilder" | "dateFilters" | "sidebarFilters" | (string & {});
|
|
23
|
+
export interface DashboardContainerProps {
|
|
24
|
+
/** Identifies which dashboard config to load. Sent to every API call. */
|
|
25
|
+
configId: string;
|
|
26
|
+
/** Defaults to https://dev.appmod.ai — override for other environments. */
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* API #1 - "UI API". Called once on mount. Returns structure/labels:
|
|
30
|
+
* graph tier + plot-option definitions, kpi card titles, sidebar filter
|
|
31
|
+
* definitions, date presets. Defaults to the built-in fetcher that hits
|
|
32
|
+
* `POST /federated/filters/ui` (+ `/distinct-value`) against `baseUrl`.
|
|
33
|
+
*/
|
|
34
|
+
fetchUIConfig?: FetchUIConfig;
|
|
35
|
+
/**
|
|
36
|
+
* API #2 - "Data API". Called on mount and again whenever the date range
|
|
37
|
+
* or the applied filters change. Returns the numeric graph series and kpi
|
|
38
|
+
* card values. Defaults to the built-in fetcher that hits
|
|
39
|
+
* `POST /federated/filters/get-data` against `baseUrl`.
|
|
40
|
+
*/
|
|
41
|
+
fetchDashboardData?: FetchDashboardData;
|
|
42
|
+
/**
|
|
43
|
+
* Optional table pagination fetcher. It is called when a table card is
|
|
44
|
+
* expanded and again as the user reaches the bottom of that table.
|
|
45
|
+
*/
|
|
46
|
+
fetchTableData?: FetchTableData;
|
|
47
|
+
/** Optional overrides so the parent can control the initial range. */
|
|
48
|
+
initialStartDate?: Date;
|
|
49
|
+
initialEndDate?: Date;
|
|
50
|
+
/** Fired whenever the resolved date range changes (after DashboardDateFilter). */
|
|
51
|
+
onDateChange?: (payload: any) => void;
|
|
52
|
+
/** Fired after filters are applied via the sidebar. */
|
|
53
|
+
onFiltersApplied?: (filters: Record<string, string | string[]>) => void;
|
|
54
|
+
/** Custom loading / error renderers so the parent controls the UX fully. */
|
|
55
|
+
renderLoading?: () => React.ReactNode;
|
|
56
|
+
renderError?: (error: Error, retry: () => void) => React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Node shown inside the graph when no series have data. When omitted a
|
|
59
|
+
* built-in default empty state is rendered.
|
|
60
|
+
*/
|
|
61
|
+
graphEmptyState?: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Per-table rendering supplied by the host app, keyed by the table `key`
|
|
64
|
+
* from the UI config's `tableBuilder`. Each entry describes how that table's
|
|
65
|
+
* columns render (custom `body` JSX, headers, styles) plus raw PrimeReact
|
|
66
|
+
* `tableProps`. Optional and partial: any table without an entry falls back
|
|
67
|
+
* to auto-generated plain-text columns derived from `tableBuilder`.
|
|
68
|
+
*/
|
|
69
|
+
tables?: DashboardTablesConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Grid layout for the tables section (how many tables sit side by side and
|
|
72
|
+
* which options the toolbar offers). Always responsive — see
|
|
73
|
+
* `minColumnWidth`. Optional; sensible defaults apply.
|
|
74
|
+
*/
|
|
75
|
+
tableLayout?: DashboardTableLayoutConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Vertical order of the sections, using the keys from the UI config — e.g.
|
|
78
|
+
* `["tableBuilder", "kpiCards", "graphBuilder"]` puts the tables on top.
|
|
79
|
+
*
|
|
80
|
+
* Partial lists are fine: anything omitted is appended in its default
|
|
81
|
+
* position, so `["tableBuilder"]` alone means "tables first, then the rest as
|
|
82
|
+
* usual". Any section the API grows later is orderable by its key too.
|
|
83
|
+
*
|
|
84
|
+
* The date filter bar stays pinned at the top and the filters sidebar stays
|
|
85
|
+
* an overlay — neither can be re-ordered (but both can be hidden).
|
|
86
|
+
*/
|
|
87
|
+
sectionOrder?: DashboardSectionKey[];
|
|
88
|
+
/**
|
|
89
|
+
* Parts to leave out entirely, e.g. `["tableBuilder", "dateFilters"]`.
|
|
90
|
+
* Applied after `sectionOrder`, so hiding always wins.
|
|
91
|
+
*
|
|
92
|
+
* Unlike `sectionOrder`, this accepts the pinned parts too: `dateFilters`
|
|
93
|
+
* removes the date filter bar and `sidebarFilters` removes the filters
|
|
94
|
+
* sidebar (along with the button that opens it).
|
|
95
|
+
*/
|
|
96
|
+
hiddenSections?: DashboardSectionKey[];
|
|
97
|
+
}
|
|
98
|
+
/** Toolbar + grid behaviour for the tables section. */
|
|
99
|
+
export interface DashboardTableLayoutConfig {
|
|
100
|
+
/**
|
|
101
|
+
* Per-table width, so the host can lay the section out table by table —
|
|
102
|
+
* e.g. `{ table_one: "full", table_two: "1/2", table_three: "1/2" }` puts
|
|
103
|
+
* the first table on its own row and the next two side by side. Keys are
|
|
104
|
+
* `tableBuilder[].key`; an array is read by table order instead. Values are
|
|
105
|
+
* a fraction of the row (`"full"`, `"1/2"`, `"1/3"`, `"2/3"`, any `"a/b"`)
|
|
106
|
+
* or a raw column count in `totalColumns` units.
|
|
107
|
+
*
|
|
108
|
+
* Still responsive: a table never renders narrower than `minColumnWidth`, so
|
|
109
|
+
* `"1/2"` becomes a full row once the container can't fit two side by side.
|
|
110
|
+
*/
|
|
111
|
+
spans?: Record<string, TableSpan> | TableSpan[];
|
|
112
|
+
/** Grid columns the `spans` values are expressed in. Default `12`. */
|
|
113
|
+
totalColumns?: number;
|
|
114
|
+
/** Width for tables missing from `spans`. Default: full width. */
|
|
115
|
+
defaultSpan?: TableSpan;
|
|
116
|
+
/** Column counts offered as toolbar icons. Default `[1, 2, 3]`. */
|
|
117
|
+
options?: number[];
|
|
118
|
+
/**
|
|
119
|
+
* Layout selected on first render — a column count, or `"custom"` for the
|
|
120
|
+
* `spans` layout. Defaults to `"custom"` when `spans` is set, else `1`.
|
|
121
|
+
*/
|
|
122
|
+
defaultColumns?: TableLayoutMode;
|
|
123
|
+
/** Controlled layout — pass with `onColumnsChange` to own the state. */
|
|
124
|
+
columns?: TableLayoutMode;
|
|
125
|
+
onColumnsChange?: (columns: TableLayoutMode) => void;
|
|
126
|
+
/** Hide the toggle and keep whatever column count is configured. Default `true`. */
|
|
127
|
+
showToggle?: boolean;
|
|
128
|
+
/** Optional caption rendered left of the toggle (e.g. "Layout"). */
|
|
129
|
+
toggleLabel?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Narrowest a table card may become before a column is dropped. This is what
|
|
132
|
+
* keeps a chosen layout responsive: pick 3-up and the grid falls back to
|
|
133
|
+
* 2-up, then 1-up, as the container narrows. Default `380`.
|
|
134
|
+
*/
|
|
135
|
+
minColumnWidth?: number;
|
|
136
|
+
/** Gap between cards in px. Default `12`. */
|
|
137
|
+
gap?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Stretch every card in a row to the tallest one, so two tables sitting side
|
|
140
|
+
* by side end up the same height even with different row counts. Set `false`
|
|
141
|
+
* to let each card hug its own content. Default `true`.
|
|
142
|
+
*/
|
|
143
|
+
equalHeights?: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Per-table styling for the surrounding TableCard chrome (icon + title + shell). */
|
|
146
|
+
export interface DashboardTableCardStyles {
|
|
147
|
+
/** The card shell — set `width` here to size the whole card (see note below). */
|
|
148
|
+
root?: React.CSSProperties;
|
|
149
|
+
/** The header row that holds the icon, title, search and expand controls. */
|
|
150
|
+
header?: React.CSSProperties;
|
|
151
|
+
/** The title text — padding, font, colour, etc. */
|
|
152
|
+
title?: React.CSSProperties;
|
|
153
|
+
/** Icon appearance. `size`/`color` are applied to the glyph itself. */
|
|
154
|
+
icon?: {
|
|
155
|
+
/** Glyph size in px. */
|
|
156
|
+
size?: number;
|
|
157
|
+
/** Glyph colour. */
|
|
158
|
+
color?: string;
|
|
159
|
+
/** Background of the icon container (rendered as a rounded chip). */
|
|
160
|
+
background?: string;
|
|
161
|
+
/** Escape hatch for any other icon-container CSS (padding, radius, …). */
|
|
162
|
+
style?: React.CSSProperties;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
export interface DashboardTableRenderConfig {
|
|
166
|
+
/** Passthrough props merged onto the underlying PrimeReact DataTable. */
|
|
167
|
+
tableProps?: Record<string, any>;
|
|
168
|
+
/** Column render definitions (header, style, `body` render fn). */
|
|
169
|
+
columns: FTableColumn[];
|
|
170
|
+
/**
|
|
171
|
+
* Styling for the card wrapping this table (icon, title, shell).
|
|
172
|
+
* To resize a table set `card.root.width` — that sizes the whole card and
|
|
173
|
+
* the table fills it; sizing only the table leaves the card full-width.
|
|
174
|
+
*/
|
|
175
|
+
card?: DashboardTableCardStyles;
|
|
176
|
+
}
|
|
177
|
+
/** Host-supplied table rendering, keyed by `tableBuilder[].key`. */
|
|
178
|
+
export type DashboardTablesConfig = Record<string, DashboardTableRenderConfig>;
|
|
179
|
+
export interface TableColumnConfig {
|
|
180
|
+
key: string;
|
|
181
|
+
label: string;
|
|
182
|
+
columnName: string[];
|
|
183
|
+
description?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface TableBuilderConfig {
|
|
186
|
+
key: string;
|
|
187
|
+
icon?: string;
|
|
188
|
+
title?: string;
|
|
189
|
+
rowLimit?: number;
|
|
190
|
+
showRankColumn?: boolean;
|
|
191
|
+
columns: TableColumnConfig[];
|
|
192
|
+
generatedSql?: string;
|
|
193
|
+
}
|
|
194
|
+
export interface DataPoint {
|
|
195
|
+
x: string;
|
|
196
|
+
y: number;
|
|
197
|
+
}
|
|
198
|
+
export interface SidebarFilterOption {
|
|
199
|
+
label: string;
|
|
200
|
+
value: string;
|
|
201
|
+
}
|
|
202
|
+
export interface DatePresetConfig {
|
|
203
|
+
key: string;
|
|
204
|
+
}
|
|
205
|
+
export interface DashboardUIConfig {
|
|
206
|
+
success: boolean;
|
|
207
|
+
request_id: string;
|
|
208
|
+
data: DashboardUIData;
|
|
209
|
+
error: string | null;
|
|
210
|
+
}
|
|
211
|
+
export interface DashboardUIData {
|
|
212
|
+
dateFilters: DateFiltersConfig;
|
|
213
|
+
sidebarFilters: SidebarFilterConfig[];
|
|
214
|
+
graphBuilder: GraphBuilderConfig;
|
|
215
|
+
kpiCards: KpiCardConfig[];
|
|
216
|
+
tableBuilder?: TableBuilderConfig[];
|
|
217
|
+
/**
|
|
218
|
+
* Optional config-driven section order, using this payload's own keys.
|
|
219
|
+
* Overridden by the `sectionOrder` prop when both are present.
|
|
220
|
+
*/
|
|
221
|
+
sectionOrder?: DashboardSectionKey[];
|
|
222
|
+
}
|
|
223
|
+
export interface DateFiltersConfig {
|
|
224
|
+
datepresets: string[];
|
|
225
|
+
defaultPreset: string;
|
|
226
|
+
showFilterButton: "yes" | "no";
|
|
227
|
+
showFilterCount: "yes" | "no";
|
|
228
|
+
showLiveButton: "yes" | "no";
|
|
229
|
+
liveDurationMs: number;
|
|
230
|
+
}
|
|
231
|
+
export interface SidebarFilterConfig {
|
|
232
|
+
label: string;
|
|
233
|
+
description: string;
|
|
234
|
+
schemaFilterName: string;
|
|
235
|
+
type: string;
|
|
236
|
+
}
|
|
237
|
+
export interface GraphBuilderConfig {
|
|
238
|
+
title: string;
|
|
239
|
+
subtitle: string;
|
|
240
|
+
icon: string;
|
|
241
|
+
styles: string;
|
|
242
|
+
axis: {
|
|
243
|
+
xAxisLabel: string;
|
|
244
|
+
};
|
|
245
|
+
tiers: GraphTierConfig[];
|
|
246
|
+
legend: LegendConfig;
|
|
247
|
+
}
|
|
248
|
+
export interface GraphTierConfig {
|
|
249
|
+
key: string;
|
|
250
|
+
title: string;
|
|
251
|
+
displayOrder: number;
|
|
252
|
+
plotOptions: PlotOptionConfig[];
|
|
253
|
+
yAxis: {
|
|
254
|
+
maxValue: number | null;
|
|
255
|
+
beginAtZero: "yes" | "no";
|
|
256
|
+
};
|
|
257
|
+
series: SeriesConfig[];
|
|
258
|
+
}
|
|
259
|
+
export interface PlotOptionConfig {
|
|
260
|
+
label: string;
|
|
261
|
+
value: string;
|
|
262
|
+
yAxisLabel: string;
|
|
263
|
+
format: string;
|
|
264
|
+
generatedSql: string;
|
|
265
|
+
displayOrder: number;
|
|
266
|
+
}
|
|
267
|
+
export interface SeriesConfig {
|
|
268
|
+
key: string;
|
|
269
|
+
name: string;
|
|
270
|
+
color: string;
|
|
271
|
+
style: string;
|
|
272
|
+
curveType: string;
|
|
273
|
+
areaFill: "yes" | "no";
|
|
274
|
+
areaOpacity: string;
|
|
275
|
+
strokeWidth: string;
|
|
276
|
+
showPoints: "yes" | "no";
|
|
277
|
+
pointRadius: string;
|
|
278
|
+
columnName: string[];
|
|
279
|
+
description: string;
|
|
280
|
+
generatedSql: string;
|
|
281
|
+
displayOrder: number;
|
|
282
|
+
}
|
|
283
|
+
export interface LegendConfig {
|
|
284
|
+
showLegends: "yes" | "no";
|
|
285
|
+
position: "top" | "bottom";
|
|
286
|
+
allowToggle: "yes" | "no";
|
|
287
|
+
alignment: "start" | "center" | "end";
|
|
288
|
+
}
|
|
289
|
+
export interface KpiCardConfig {
|
|
290
|
+
title: string;
|
|
291
|
+
subtitle: string;
|
|
292
|
+
valueFormat: string;
|
|
293
|
+
indicatorLogic: string;
|
|
294
|
+
icon: string;
|
|
295
|
+
columnName: string[];
|
|
296
|
+
description: string;
|
|
297
|
+
generatedSql: string;
|
|
298
|
+
displayOrder: number;
|
|
299
|
+
}
|
|
300
|
+
export interface DataPoint {
|
|
301
|
+
x: string;
|
|
302
|
+
y: number;
|
|
303
|
+
}
|
|
304
|
+
export interface SeriesDataMap {
|
|
305
|
+
[seriesKey: string]: DataPoint[];
|
|
306
|
+
}
|
|
307
|
+
export interface PlotByOptions {
|
|
308
|
+
[plotOptionKey: string]: SeriesDataMap;
|
|
309
|
+
}
|
|
310
|
+
export interface TierData {
|
|
311
|
+
key: string;
|
|
312
|
+
plotbyoptions: PlotByOptions;
|
|
313
|
+
series?: SeriesConfig[];
|
|
314
|
+
}
|
|
315
|
+
export interface DashboardDataResponse {
|
|
316
|
+
graph: {
|
|
317
|
+
[graphKey: string]: TierData[];
|
|
318
|
+
};
|
|
319
|
+
kpiCards: {
|
|
320
|
+
/**
|
|
321
|
+
* Either the legacy bare value, or `{ currentValue, baselineValue }`
|
|
322
|
+
* where a baseline is available for indicator colouring.
|
|
323
|
+
*/
|
|
324
|
+
[kpiId: string]: string | number | KpiValueObject;
|
|
325
|
+
};
|
|
326
|
+
/** Row arrays keyed by `tableBuilder[].key`. */
|
|
327
|
+
table?: {
|
|
328
|
+
[tableKey: string]: Record<string, any>[];
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/** A single cursor-paginated response from /federated/filters/table-data. */
|
|
332
|
+
export interface TableDataResponse {
|
|
333
|
+
table: {
|
|
334
|
+
[tableKey: string]: Record<string, any>[];
|
|
335
|
+
};
|
|
336
|
+
count: number;
|
|
337
|
+
hasNext: boolean;
|
|
338
|
+
nextCursor?: string | null;
|
|
339
|
+
}
|
|
340
|
+
export interface DashboardQueryParams {
|
|
341
|
+
startDate?: Date;
|
|
342
|
+
endDate?: Date;
|
|
343
|
+
filters?: Record<string, string | string[]>;
|
|
344
|
+
}
|
|
345
|
+
/** Identifies the dashboard config + the API origin for every request. */
|
|
346
|
+
export interface DashboardApiConfig {
|
|
347
|
+
configId: string;
|
|
348
|
+
baseUrl?: string;
|
|
349
|
+
}
|
|
350
|
+
export type FetchUIConfig = (config: DashboardApiConfig, signal?: AbortSignal) => Promise<DashboardUIConfig>;
|
|
351
|
+
export type FetchDashboardData = (config: DashboardApiConfig, params: DashboardQueryParams, signal?: AbortSignal) => Promise<DashboardDataResponse>;
|
|
352
|
+
export type FetchTableData = (config: DashboardApiConfig, params: DashboardQueryParams & {
|
|
353
|
+
tableKey: string;
|
|
354
|
+
pageSize?: number;
|
|
355
|
+
cursor?: string;
|
|
356
|
+
}, signal?: AbortSignal) => Promise<TableDataResponse>;
|
|
357
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAEvF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,CA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,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,oBAAoB,EAC5B,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,MAAM,MAAM,cAAc,GAAG,CAC3B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,oBAAoB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,EACD,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn a raw number into a short, axis-friendly string: 1_500_000 -> "1.5M",
|
|
3
|
+
* 900_000 -> "900K", 42 -> "42", -1_250 -> "-1.3K".
|
|
4
|
+
*
|
|
5
|
+
* Edge cases handled:
|
|
6
|
+
* - Non-finite inputs (NaN, ±Infinity) return "" instead of "NaN"/"InfinityT".
|
|
7
|
+
* - Sign is preserved for negatives.
|
|
8
|
+
* - Rounding roll-over is promoted to the next unit so 999_999 reads "1M"
|
|
9
|
+
* rather than "1000K".
|
|
10
|
+
*/
|
|
11
|
+
export declare function compactNumber(num: number): string;
|
|
12
|
+
/** Whether a rising value is good, bad, or carries no judgement. */
|
|
13
|
+
export type IndicatorLogic = "higher_better" | "lower_better" | "neutral";
|
|
14
|
+
export type KpiSentiment = "positive" | "negative" | "neutral";
|
|
15
|
+
/**
|
|
16
|
+
* New KPI payload shape: the API sends the current value alongside the
|
|
17
|
+
* comparison baseline (previous period) so the card can judge direction.
|
|
18
|
+
* The older shape — a bare `string | number` — is still supported everywhere.
|
|
19
|
+
*/
|
|
20
|
+
export interface KpiValueObject {
|
|
21
|
+
currentValue: number | string | null;
|
|
22
|
+
baselineValue?: number | string | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function isKpiValueObject(rawValue: unknown): rawValue is KpiValueObject;
|
|
25
|
+
/**
|
|
26
|
+
* Compare a KPI against its baseline and say whether the movement is good.
|
|
27
|
+
*
|
|
28
|
+
* Returns "neutral" — never a colour-worthy verdict — whenever the comparison
|
|
29
|
+
* would be meaningless: no baseline, unparseable numbers, an explicitly
|
|
30
|
+
* neutral indicator, or no change at all.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getKpiSentiment(currentValue: unknown, baselineValue: unknown, indicatorLogic?: string): KpiSentiment;
|
|
33
|
+
/**
|
|
34
|
+
* Colours chosen for >=3:1 contrast on a light card at the value's size
|
|
35
|
+
* (25px/700, which counts as large text).
|
|
36
|
+
*/
|
|
37
|
+
export declare const KPI_SENTIMENT_COLORS: Record<Exclude<KpiSentiment, "neutral">, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the colour for a KPI value. Returns `undefined` for the neutral case
|
|
40
|
+
* so the value inherits its normal stylesheet colour rather than being pinned
|
|
41
|
+
* to a hardcoded black.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getKpiValueColor(currentValue: unknown, baselineValue: unknown, indicatorLogic?: string, overrides?: Partial<Record<Exclude<KpiSentiment, "neutral">, string>>): string | undefined;
|
|
44
|
+
export interface KpiDelta {
|
|
45
|
+
/** Signed percentage change vs baseline, e.g. -75.18 for 22.1M -> 5.5M. */
|
|
46
|
+
percent: number;
|
|
47
|
+
/** Which way the raw number moved. Independent of whether that is good. */
|
|
48
|
+
direction: "up" | "down" | "flat";
|
|
49
|
+
/** Whether that movement is good, per the indicator logic. */
|
|
50
|
+
sentiment: KpiSentiment;
|
|
51
|
+
/** Magnitude formatted for display, e.g. "75.2%". Sign lives in `direction`. */
|
|
52
|
+
label: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Percentage change from baseline to current.
|
|
56
|
+
*
|
|
57
|
+
* Returns undefined when the change cannot be expressed as a percentage:
|
|
58
|
+
* missing/unparseable numbers, or a baseline of 0 (any move off zero is an
|
|
59
|
+
* infinite percentage — showing "Infinity%" or "100%" would both be lies).
|
|
60
|
+
* A zero-change KPI is still returned, as a "flat" 0% with neutral sentiment.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getKpiDelta(currentValue: unknown, baselineValue: unknown, indicatorLogic?: string): KpiDelta | undefined;
|
|
63
|
+
export declare function formatKpiValue(rawValue: unknown, valueFormat?: string): string;
|
|
64
|
+
export declare function getActiveFilterCount(filters: Record<string, string | string[]>): number;
|
|
65
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA+BjD;AAED,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,SAAS,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAO9E;AASD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,YAAY,CAcd;AAED;;;GAGG;AACH,eAAO,MA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