@hisptz/dhis2-analytics 2.0.5 → 2.0.7
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/Map/DHIS2Map.js +7 -7
- package/dist/components/Map/DHIS2Map.js.map +1 -1
- package/dist/esm/components/Map/DHIS2Map.js +6 -6
- package/dist/esm/components/Map/DHIS2Map.js.map +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -1
- package/dist/types/components/Map/interfaces/index.d.ts +2 -1
- package/dist/types/components/Map/interfaces/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
4
|
var MapArea = require('./components/MapArea/index.js');
|
|
6
|
-
var
|
|
5
|
+
var MapProvider = require('./components/MapProvider');
|
|
7
6
|
require('leaflet/dist/leaflet.css');
|
|
8
7
|
var reactQuery = require('react-query');
|
|
9
8
|
|
|
@@ -22,8 +21,9 @@ const MapComponent = ({
|
|
|
22
21
|
mapOptions,
|
|
23
22
|
key,
|
|
24
23
|
controls,
|
|
25
|
-
legends
|
|
26
|
-
|
|
24
|
+
legends,
|
|
25
|
+
setRef
|
|
26
|
+
}) => {
|
|
27
27
|
const sanitizedPointLayers = [
|
|
28
28
|
{
|
|
29
29
|
type: "point",
|
|
@@ -41,7 +41,7 @@ const MapComponent = ({
|
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
43
|
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
-
|
|
44
|
+
MapProvider.MapProvider,
|
|
45
45
|
{
|
|
46
46
|
periodSelection,
|
|
47
47
|
orgUnitSelection,
|
|
@@ -56,7 +56,7 @@ const MapComponent = ({
|
|
|
56
56
|
},
|
|
57
57
|
legends,
|
|
58
58
|
controls,
|
|
59
|
-
ref,
|
|
59
|
+
ref: setRef,
|
|
60
60
|
mapOptions
|
|
61
61
|
},
|
|
62
62
|
key
|
|
@@ -64,7 +64,7 @@ const MapComponent = ({
|
|
|
64
64
|
}
|
|
65
65
|
) });
|
|
66
66
|
};
|
|
67
|
-
const DHIS2Map =
|
|
67
|
+
const DHIS2Map = MapComponent;
|
|
68
68
|
const Map = DHIS2Map;
|
|
69
69
|
|
|
70
70
|
exports.DHIS2Map = DHIS2Map;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"AAiDI;AAhDJ,OAAO,aAAa;AAKpB,SAAS,mBAAmB;AAE5B,OAAO;AACP,SAAS,aAAa,2BAA2B;AAEjD,MAAM,cAAc,IAAI,YAAY;AAEpC,MAAM,eAAe,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAgB;AACf,QAAM,uBAA2C;AAAA,IAChD;AAAA,MACC,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,SAAS,YAAY,WAAW;AAAA,MAChC,GAAG;AAAA,IACJ;AAAA,EACD;AACA,QAAM,0BAAiD;AAAA,IACtD;AAAA,MACC,GAAG;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,SAAS,eAAe,WAAW;AAAA,IACpC;AAAA,EACD;AAEA,SACC,oBAAC,uBAAoB,QAAQ,aAC5B;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACA,QAAQ;AAAA,YACP;AAAA,YACA;AAAA,YACA,gBAAgB;AAAA,YAChB,aAAa;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UAEA,KAAK;AAAA,UACL;AAAA;AAAA,QAFK;AAAA,MAGN;AAAA;AAAA,EACD,GACD;AAEF;AACO,MAAM,WAA+B;AAKrC,MAAM,MAAM","sourcesContent":["import React from \"react\";\nimport MapArea from \"./components/MapArea/index.js\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomPointLayer,\n} from \"./components/MapLayer/interfaces\";\nimport { MapProvider } from \"./components/MapProvider\";\nimport { MapProps } from \"./interfaces\";\nimport \"leaflet/dist/leaflet.css\";\nimport { QueryClient, QueryClientProvider } from \"react-query\";\n\nconst queryClient = new QueryClient();\n\nconst MapComponent = ({\n\torgUnitSelection,\n\tpointLayer,\n\tboundaryLayer,\n\tthematicLayers,\n\tearthEngineLayers,\n\tperiodSelection,\n\tmapOptions,\n\tkey,\n\tcontrols,\n\tlegends,\n\tsetRef,\n}: MapProps) => {\n\tconst sanitizedPointLayers: CustomPointLayer[] = [\n\t\t{\n\t\t\ttype: \"point\",\n\t\t\tid: \"point\",\n\t\t\tenabled: pointLayer?.enabled ?? false,\n\t\t\t...pointLayer,\n\t\t},\n\t];\n\tconst sanitizedBoundaryLayers: CustomBoundaryLayer[] = [\n\t\t{\n\t\t\t...boundaryLayer,\n\t\t\ttype: \"overlay\",\n\t\t\tid: \"boundary\",\n\t\t\tenabled: boundaryLayer?.enabled ?? false,\n\t\t},\n\t];\n\n\treturn (\n\t\t<QueryClientProvider client={queryClient}>\n\t\t\t<MapProvider\n\t\t\t\tperiodSelection={periodSelection}\n\t\t\t\torgUnitSelection={orgUnitSelection}\n\t\t\t>\n\t\t\t\t<MapArea\n\t\t\t\t\tlayers={{\n\t\t\t\t\t\tthematicLayers,\n\t\t\t\t\t\tearthEngineLayers,\n\t\t\t\t\t\tboundaryLayers: sanitizedBoundaryLayers,\n\t\t\t\t\t\tpointLayers: sanitizedPointLayers,\n\t\t\t\t\t}}\n\t\t\t\t\tlegends={legends}\n\t\t\t\t\tcontrols={controls}\n\t\t\t\t\tkey={key}\n\t\t\t\t\tref={setRef}\n\t\t\t\t\tmapOptions={mapOptions}\n\t\t\t\t/>\n\t\t\t</MapProvider>\n\t\t</QueryClientProvider>\n\t);\n};\nexport const DHIS2Map: React.FC<MapProps> = MapComponent;\n\n/**\n * @deprecated since `v2`. Use `DHIS2Map` instead\n * */\nexport const Map = DHIS2Map;\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
2
|
import MapArea from './components/MapArea/index.js';
|
|
4
|
-
import { MapProvider } from './components/MapProvider
|
|
3
|
+
import { MapProvider } from './components/MapProvider';
|
|
5
4
|
import 'leaflet/dist/leaflet.css';
|
|
6
5
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
7
6
|
|
|
@@ -16,8 +15,9 @@ const MapComponent = ({
|
|
|
16
15
|
mapOptions,
|
|
17
16
|
key,
|
|
18
17
|
controls,
|
|
19
|
-
legends
|
|
20
|
-
|
|
18
|
+
legends,
|
|
19
|
+
setRef
|
|
20
|
+
}) => {
|
|
21
21
|
const sanitizedPointLayers = [
|
|
22
22
|
{
|
|
23
23
|
type: "point",
|
|
@@ -50,7 +50,7 @@ const MapComponent = ({
|
|
|
50
50
|
},
|
|
51
51
|
legends,
|
|
52
52
|
controls,
|
|
53
|
-
ref,
|
|
53
|
+
ref: setRef,
|
|
54
54
|
mapOptions
|
|
55
55
|
},
|
|
56
56
|
key
|
|
@@ -58,7 +58,7 @@ const MapComponent = ({
|
|
|
58
58
|
}
|
|
59
59
|
) });
|
|
60
60
|
};
|
|
61
|
-
const DHIS2Map =
|
|
61
|
+
const DHIS2Map = MapComponent;
|
|
62
62
|
const Map = DHIS2Map;
|
|
63
63
|
|
|
64
64
|
export { DHIS2Map, Map };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"AAiDI;AAhDJ,OAAO,aAAa;AAKpB,SAAS,mBAAmB;AAE5B,OAAO;AACP,SAAS,aAAa,2BAA2B;AAEjD,MAAM,cAAc,IAAI,YAAY;AAEpC,MAAM,eAAe,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAgB;AACf,QAAM,uBAA2C;AAAA,IAChD;AAAA,MACC,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,SAAS,YAAY,WAAW;AAAA,MAChC,GAAG;AAAA,IACJ;AAAA,EACD;AACA,QAAM,0BAAiD;AAAA,IACtD;AAAA,MACC,GAAG;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,SAAS,eAAe,WAAW;AAAA,IACpC;AAAA,EACD;AAEA,SACC,oBAAC,uBAAoB,QAAQ,aAC5B;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACA,QAAQ;AAAA,YACP;AAAA,YACA;AAAA,YACA,gBAAgB;AAAA,YAChB,aAAa;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UAEA,KAAK;AAAA,UACL;AAAA;AAAA,QAFK;AAAA,MAGN;AAAA;AAAA,EACD,GACD;AAEF;AACO,MAAM,WAA+B;AAKrC,MAAM,MAAM","sourcesContent":["import React from \"react\";\nimport MapArea from \"./components/MapArea/index.js\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomPointLayer,\n} from \"./components/MapLayer/interfaces\";\nimport { MapProvider } from \"./components/MapProvider\";\nimport { MapProps } from \"./interfaces\";\nimport \"leaflet/dist/leaflet.css\";\nimport { QueryClient, QueryClientProvider } from \"react-query\";\n\nconst queryClient = new QueryClient();\n\nconst MapComponent = ({\n\torgUnitSelection,\n\tpointLayer,\n\tboundaryLayer,\n\tthematicLayers,\n\tearthEngineLayers,\n\tperiodSelection,\n\tmapOptions,\n\tkey,\n\tcontrols,\n\tlegends,\n\tsetRef,\n}: MapProps) => {\n\tconst sanitizedPointLayers: CustomPointLayer[] = [\n\t\t{\n\t\t\ttype: \"point\",\n\t\t\tid: \"point\",\n\t\t\tenabled: pointLayer?.enabled ?? false,\n\t\t\t...pointLayer,\n\t\t},\n\t];\n\tconst sanitizedBoundaryLayers: CustomBoundaryLayer[] = [\n\t\t{\n\t\t\t...boundaryLayer,\n\t\t\ttype: \"overlay\",\n\t\t\tid: \"boundary\",\n\t\t\tenabled: boundaryLayer?.enabled ?? false,\n\t\t},\n\t];\n\n\treturn (\n\t\t<QueryClientProvider client={queryClient}>\n\t\t\t<MapProvider\n\t\t\t\tperiodSelection={periodSelection}\n\t\t\t\torgUnitSelection={orgUnitSelection}\n\t\t\t>\n\t\t\t\t<MapArea\n\t\t\t\t\tlayers={{\n\t\t\t\t\t\tthematicLayers,\n\t\t\t\t\t\tearthEngineLayers,\n\t\t\t\t\t\tboundaryLayers: sanitizedBoundaryLayers,\n\t\t\t\t\t\tpointLayers: sanitizedPointLayers,\n\t\t\t\t\t}}\n\t\t\t\t\tlegends={legends}\n\t\t\t\t\tcontrols={controls}\n\t\t\t\t\tkey={key}\n\t\t\t\t\tref={setRef}\n\t\t\t\t\tmapOptions={mapOptions}\n\t\t\t\t/>\n\t\t\t</MapProvider>\n\t\t</QueryClientProvider>\n\t);\n};\nexport const DHIS2Map: React.FC<MapProps> = MapComponent;\n\n/**\n * @deprecated since `v2`. Use `DHIS2Map` instead\n * */\nexport const Map = DHIS2Map;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DHIS2Map.d.ts","sourceRoot":"","sources":["../../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DHIS2Map.d.ts","sourceRoot":"","sources":["../../../../src/components/Map/DHIS2Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,0BAA0B,CAAC;AA0DlC,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAgB,CAAC;AAEzD;;KAEK;AACL,eAAO,MAAM,GAAG,oBAAW,CAAC"}
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import type { MapContainerProps } from "react-leaflet";
|
|
4
4
|
import { MapControls, MapLegendConfig } from "../components/MapArea/interfaces/index.js";
|
|
5
5
|
import { EarthEngineLayerConfig, ThematicLayerConfig } from "../components/MapLayer/interfaces/index.js";
|
|
6
|
-
import type
|
|
6
|
+
import { type LeafletEventHandlerFnMap, type LeafletMouseEvent, Map as LeafletMap } from "leaflet";
|
|
7
7
|
export interface MapProviderProps {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
orgUnitSelection: OrgUnitSelection;
|
|
@@ -17,6 +17,7 @@ export interface MapProviderProps {
|
|
|
17
17
|
}
|
|
18
18
|
export interface MapProps {
|
|
19
19
|
key?: string;
|
|
20
|
+
setRef?: (ref: LeafletMap) => void;
|
|
20
21
|
orgUnitSelection: OrgUnitSelection;
|
|
21
22
|
pointLayer?: {
|
|
22
23
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACN,WAAW,EACX,eAAe,EACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Map/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACN,WAAW,EACX,eAAe,EACf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACN,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,GAAG,IAAI,UAAU,EACjB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,eAAe,CAAC,EAAE;QACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,CAAC,EAAE;YAAE,KAAK,EAAE,IAAI,CAAC;YAAC,GAAG,EAAE,IAAI,CAAA;SAAE,CAAC;KACnC,CAAC;CACF;AAED,MAAM,WAAW,QAAQ;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,CAAC,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE;YACP,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,QAAQ,CAAC,EAAE,MAAM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GAAG,CAAC;IACb,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react-query": "^3.39.3",
|
|
56
56
|
"react-spring": "^9.6.1",
|
|
57
57
|
"screenfull": "^6.0.2",
|
|
58
|
-
"@hisptz/dhis2-
|
|
59
|
-
"@hisptz/dhis2-
|
|
58
|
+
"@hisptz/dhis2-ui": "2.0.4",
|
|
59
|
+
"@hisptz/dhis2-utils": "2.0.4"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@dhis2/app-runtime": "^3.10.2",
|