@geo2france/api-dashboard 1.5.0 → 1.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/README.MD CHANGED
@@ -30,7 +30,7 @@ Les composants sont actuellement utilisés pour le [tableau de bord de l'Odema](
30
30
 
31
31
  ## Installation
32
32
 
33
- `npm install https://github.com/geo2france/api-dashboard/releases/latest/download/api-dashboard.tgz`
33
+ `npm i @geo2france/api-dashboard`
34
34
 
35
35
 
36
36
  ## Utilisation
@@ -38,5 +38,6 @@ export declare const ControlContext: React.Context<ControlContextType | undefine
38
38
  interface IDSLDashboardPageProps {
39
39
  children: React.ReactNode;
40
40
  name?: string;
41
+ columns?: number;
41
42
  }
42
43
  export declare const DSL_DashboardPage: React.FC<IDSLDashboardPageProps>;
@@ -40,7 +40,7 @@ export default DashboardPage;
40
40
  export const DatasetContext = createContext({});
41
41
  export const DatasetRegistryContext = createContext(() => { }); // A modifier, utiliser un seul context
42
42
  export const ControlContext = createContext(undefined);
43
- export const DSL_DashboardPage = ({ name = 'Tableau de bord', children }) => {
43
+ export const DSL_DashboardPage = ({ name = 'Tableau de bord', columns = 2, children }) => {
44
44
  const [datasets, setdatasets] = useState({});
45
45
  const [palette, setPalette] = useState(DEFAULT_PALETTE);
46
46
  //const allDatasetLoaded = Object.values(datasets).every(d => !d.isFetching);
@@ -76,5 +76,5 @@ export const DSL_DashboardPage = ({ name = 'Tableau de bord', children }) => {
76
76
  backgroundColor: "#fff",
77
77
  height: "auto",
78
78
  width: "100%",
79
- }, children: control_components }), _jsx(Row, { gutter: [8, 8], style: { margin: 16 }, children: visible_components.map((component, idx) => _jsx(Col, { xl: 12, xs: 24, children: _jsx(DSL_ChartBlock, { children: component }) }, idx)) }), logic_components] }) }) })] }));
79
+ }, children: control_components }), _jsx(Row, { gutter: [8, 8], style: { margin: 16 }, children: visible_components.map((component, idx) => _jsx(Col, { xl: 24 / columns, xs: 24, children: _jsx(DSL_ChartBlock, { children: component }) }, idx)) }), logic_components] }) }) })] }));
80
80
  };
@@ -6,13 +6,13 @@ interface AppContextProps {
6
6
  logo?: string;
7
7
  }
8
8
  export declare const AppContext: import("react").Context<AppContextProps>;
9
- interface DashboardApprProps {
9
+ export interface DashboardConfig {
10
10
  title?: string;
11
11
  subtitle?: string;
12
- route_config: RouteConfig[];
12
+ routes: RouteConfig[];
13
13
  theme?: ThemeConfig;
14
14
  logo: string;
15
15
  brands?: Partner[];
16
16
  }
17
- declare const DashboardApp: React.FC<DashboardApprProps>;
17
+ declare const DashboardApp: React.FC<DashboardConfig>;
18
18
  export default DashboardApp;
@@ -31,7 +31,7 @@ const default_theme = {
31
31
  }
32
32
  };
33
33
  export const AppContext = createContext({});
34
- const DashboardApp = ({ route_config, theme, logo, brands, title, subtitle }) => {
34
+ const DashboardApp = ({ routes, theme, logo, brands, title, subtitle }) => {
35
35
  const context_values = { title, subtitle, logo };
36
36
  /* CONTROLS */
37
37
  const [controls, setControles] = useState({});
@@ -41,6 +41,6 @@ const DashboardApp = ({ route_config, theme, logo, brands, title, subtitle }) =>
41
41
  ...c
42
42
  }));
43
43
  };
44
- return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ConfigProvider, { theme: theme || default_theme /* Merger plutôt ?*/, children: _jsx(HelmetProvider, { children: _jsx(AppContext.Provider, { value: context_values, children: _jsx(ControlContext.Provider, { value: { values: controls, pushValue: pushControl }, children: _jsx(HashRouter, { children: _jsx(Routes, { children: _jsxs(Route, { element: _jsxs(Layout, { children: [_jsxs(Layout, { children: [_jsx(DashboardSider, { route_config: route_config }), _jsx(Content, { style: { width: "85%" }, children: _jsx(Outlet, {}) })] }), _jsx(DasbhoardFooter, { brands: brands })] }), children: [generateRoutes(route_config), _jsx(Route, { path: "*", element: _jsx(ErrorComponent, {}) })] }) }) }) }) }) }) }) }));
44
+ return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ConfigProvider, { theme: theme || default_theme /* Merger plutôt ?*/, children: _jsx(HelmetProvider, { children: _jsx(AppContext.Provider, { value: context_values, children: _jsx(ControlContext.Provider, { value: { values: controls, pushValue: pushControl }, children: _jsx(HashRouter, { children: _jsx(Routes, { children: _jsxs(Route, { element: _jsxs(Layout, { children: [_jsxs(Layout, { children: [_jsx(DashboardSider, { route_config: routes }), _jsx(Content, { style: { width: "85%" }, children: _jsx(Outlet, {}) })] }), _jsx(DasbhoardFooter, { brands: brands })] }), children: [generateRoutes(routes), _jsx(Route, { path: "*", element: _jsx(ErrorComponent, {}) })] }) }) }) }) }) }) }) }));
45
45
  };
46
46
  export default DashboardApp;
package/dist/index.d.ts CHANGED
@@ -25,5 +25,6 @@ import { dataProvider as FileProvider } from "./data_providers/file";
25
25
  export { WfsProvider, DatafairProvider, FileProvider };
26
26
  export type { SimpleRecord, Partner, RouteConfig } from "./types";
27
27
  export type { LegendItem } from "./components/MapLegend/MapLegend";
28
+ export type { DashboardConfig } from "./components/Layout/DashboardApp";
28
29
  import * as DSL from './dsl';
29
30
  export { DSL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geo2france/api-dashboard",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "description": "Build dashboards with JSX/TSX",
6
6
  "main": "dist/index.js",
@@ -92,7 +92,6 @@
92
92
  "react-dom": "^18.3.1",
93
93
  "react-icons": "5.4",
94
94
  "react-map-gl": "^7.1.7",
95
- "react-router-dom": "^6.25.1",
96
- "recharts": "^2.15.3"
95
+ "react-router-dom": "^6.25.1"
97
96
  }
98
97
  }