@progress/kendo-react-map 7.2.4-develop.3 → 7.3.0-develop.1
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/Map.js +8 -0
- package/Map.mjs +346 -0
- package/MapContext.js +8 -0
- package/MapContext.mjs +14 -0
- package/components/BubbleLayer.js +8 -0
- package/components/BubbleLayer.mjs +22 -0
- package/components/BubbleLayerTooltip.js +8 -0
- package/components/BubbleLayerTooltip.mjs +14 -0
- package/components/Layers.js +8 -0
- package/components/Layers.mjs +18 -0
- package/components/MarkerLayer.js +8 -0
- package/components/MarkerLayer.mjs +22 -0
- package/components/MarkerLayerTooltip.js +8 -0
- package/components/MarkerLayerTooltip.mjs +14 -0
- package/components/ShapeLayer.js +8 -0
- package/components/ShapeLayer.mjs +22 -0
- package/components/ShapeLayerTooltip.js +8 -0
- package/components/ShapeLayerTooltip.mjs +14 -0
- package/components/TileLayer.js +8 -0
- package/components/TileLayer.mjs +15 -0
- package/components/base/CollectionConfigurationComponent.js +8 -0
- package/components/base/CollectionConfigurationComponent.mjs +35 -0
- package/components/base/ConfigurationComponent.js +8 -0
- package/components/base/ConfigurationComponent.mjs +47 -0
- package/dist/cdn/js/kendo-react-map.js +8 -5
- package/events/base-event.js +8 -0
- package/events/base-event.mjs +19 -0
- package/events/before-reset-event.js +8 -0
- package/events/before-reset-event.mjs +20 -0
- package/events/dom-event.js +8 -0
- package/events/dom-event.mjs +23 -0
- package/events/map-click-event.js +8 -0
- package/events/map-click-event.mjs +20 -0
- package/events/map-event-builder.js +8 -0
- package/events/map-event-builder.mjs +47 -0
- package/events/marker-activate-event.js +8 -0
- package/events/marker-activate-event.mjs +20 -0
- package/events/marker-click-event.js +8 -0
- package/events/marker-click-event.mjs +20 -0
- package/events/marker-created-event.js +8 -0
- package/events/marker-created-event.mjs +20 -0
- package/events/pan-end-event.js +8 -0
- package/events/pan-end-event.mjs +20 -0
- package/events/pan-event.js +8 -0
- package/events/pan-event.mjs +20 -0
- package/events/preventable-event.js +8 -0
- package/events/preventable-event.mjs +33 -0
- package/events/reset-event.js +8 -0
- package/events/reset-event.mjs +20 -0
- package/events/shape-click-event.js +8 -0
- package/events/shape-click-event.mjs +20 -0
- package/events/shape-created-event.js +8 -0
- package/events/shape-created-event.mjs +20 -0
- package/events/shape-feature-created-event.js +8 -0
- package/events/shape-feature-created-event.mjs +20 -0
- package/events/shape-mouse-enter-event.js +8 -0
- package/events/shape-mouse-enter-event.mjs +20 -0
- package/events/shape-mouse-leave-event.js +8 -0
- package/events/shape-mouse-leave-event.mjs +20 -0
- package/events/zoom-end-event.js +8 -0
- package/events/zoom-end-event.mjs +20 -0
- package/events/zoom-start-event.js +8 -0
- package/events/zoom-start-event.mjs +20 -0
- package/index.d.mts +951 -5
- package/index.d.ts +951 -13
- package/index.js +8 -5
- package/index.mjs +64 -801
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +3 -3
- package/store/reducer.js +8 -0
- package/store/reducer.mjs +46 -0
- package/store/store.js +8 -0
- package/store/store.mjs +19 -0
- package/tooltip/MapTooltip.js +8 -0
- package/tooltip/MapTooltip.mjs +82 -0
- package/tooltip/Popup.js +8 -0
- package/tooltip/Popup.mjs +60 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +29 -0
- package/Map.d.ts +0 -192
- package/MapContext.d.ts +0 -19
- package/MapProps.d.ts +0 -104
- package/common/events.d.ts +0 -19
- package/common/map-types.d.ts +0 -5
- package/components/BubbleLayer.d.ts +0 -14
- package/components/BubbleLayerTooltip.d.ts +0 -19
- package/components/Layers.d.ts +0 -13
- package/components/MarkerLayer.d.ts +0 -14
- package/components/MarkerLayerTooltip.d.ts +0 -19
- package/components/ShapeLayer.d.ts +0 -14
- package/components/ShapeLayerTooltip.d.ts +0 -19
- package/components/TileLayer.d.ts +0 -13
- package/components/base/CollectionConfigurationComponent.d.ts +0 -23
- package/components/base/ConfigurationComponent.d.ts +0 -28
- package/components/index.d.ts +0 -13
- package/events/base-event.d.ts +0 -18
- package/events/before-reset-event.d.ts +0 -16
- package/events/dom-event.d.ts +0 -26
- package/events/map-click-event.d.ts +0 -24
- package/events/map-event-builder.d.ts +0 -10
- package/events/marker-activate-event.d.ts +0 -24
- package/events/marker-click-event.d.ts +0 -24
- package/events/marker-created-event.d.ts +0 -26
- package/events/pan-end-event.d.ts +0 -28
- package/events/pan-event.d.ts +0 -28
- package/events/preventable-event.d.ts +0 -22
- package/events/reset-event.d.ts +0 -18
- package/events/shape-click-event.d.ts +0 -29
- package/events/shape-created-event.d.ts +0 -33
- package/events/shape-feature-created-event.d.ts +0 -33
- package/events/shape-mouse-enter-event.d.ts +0 -32
- package/events/shape-mouse-leave-event.d.ts +0 -32
- package/events/zoom-end-event.d.ts +0 -20
- package/events/zoom-start-event.d.ts +0 -22
- package/package-metadata.d.ts +0 -9
- package/store/reducer.d.ts +0 -14
- package/store/store.d.ts +0 -26
- package/tooltip/BubbleTooltipContext.d.ts +0 -26
- package/tooltip/MapTooltip.d.ts +0 -41
- package/tooltip/MarkerTooltipContext.d.ts +0 -26
- package/tooltip/Popup.d.ts +0 -33
- package/tooltip/ShapeTooltipContext.d.ts +0 -22
- package/tooltip/index.d.ts +0 -9
- package/utils/index.d.ts +0 -13
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-map",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1651750998,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"};exports.packageMetadata=e;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const e = {
|
|
10
|
+
name: "@progress/kendo-react-map",
|
|
11
|
+
productName: "KendoReact",
|
|
12
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
+
publishDate: 1709715796,
|
|
14
|
+
version: "",
|
|
15
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as packageMetadata
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-map",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0-develop.1",
|
|
4
4
|
"description": "KendoReact Map package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-common": "7.
|
|
28
|
-
"@progress/kendo-react-popup": "7.
|
|
27
|
+
"@progress/kendo-react-common": "7.3.0-develop.1",
|
|
28
|
+
"@progress/kendo-react-popup": "7.3.0-develop.1",
|
|
29
29
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
30
30
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
31
31
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/store/reducer.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=(t,e)=>e.mapCollectionIdxKey?a.collectionConfigurationItem(t,e):e.mapKey?a.configurationItem(t,e):{},u=(t,e)=>{if(e.type)switch(e.type){case"add":return[...t,e.payload];case"remove":return t.filter(l=>l!==e.payload);default:return t}else return[]},a={configurationItem(t,e){return Object.assign(t,{[e.mapKey]:e.payload})},collectionConfigurationItem(t,e){let l=!1;const[s,n]=e.mapCollectionIdxKey.split("_"),i=t[s].map((o,r)=>parseInt(n,10)===r?(l=!0,e.payload):o);return l===!1&&i.splice(parseInt(n,10),0,e.payload),Object.assign(t,{[s]:i})},themeItem(t,e){let l={},s=Object.assign(l,t);const{field:n,value:i}=e.payload,o=n.split(".");let r=o.shift();for(;o.length>0;)l=l[r]=l[r]||{},r=o.shift();return l[r]=i,s}};exports.observersReducer=u;exports.optionsReducer=c;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const p = (t, e) => e.mapCollectionIdxKey ? a.collectionConfigurationItem(t, e) : e.mapKey ? a.configurationItem(t, e) : {}, c = (t, e) => {
|
|
10
|
+
if (e.type)
|
|
11
|
+
switch (e.type) {
|
|
12
|
+
case "add":
|
|
13
|
+
return [...t, e.payload];
|
|
14
|
+
case "remove":
|
|
15
|
+
return t.filter((l) => l !== e.payload);
|
|
16
|
+
default:
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
else
|
|
20
|
+
return [];
|
|
21
|
+
}, a = {
|
|
22
|
+
configurationItem(t, e) {
|
|
23
|
+
return Object.assign(t, {
|
|
24
|
+
[e.mapKey]: e.payload
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
collectionConfigurationItem(t, e) {
|
|
28
|
+
let l = !1;
|
|
29
|
+
const [s, n] = e.mapCollectionIdxKey.split("_"), i = t[s].map((r, o) => parseInt(n, 10) === o ? (l = !0, e.payload) : r);
|
|
30
|
+
return l === !1 && i.splice(parseInt(n, 10), 0, e.payload), Object.assign(t, {
|
|
31
|
+
[s]: i
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
themeItem(t, e) {
|
|
35
|
+
let l = {}, s = Object.assign(l, t);
|
|
36
|
+
const { field: n, value: i } = e.payload, r = n.split(".");
|
|
37
|
+
let o = r.shift();
|
|
38
|
+
for (; r.length > 0; )
|
|
39
|
+
l = l[o] = l[o] || {}, o = r.shift();
|
|
40
|
+
return l[o] = i, s;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
c as observersReducer,
|
|
45
|
+
p as optionsReducer
|
|
46
|
+
};
|
package/store/store.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";const i=require("@progress/kendo-react-common"),u=n=>{let s,t=[];const o=()=>s,r=e=>{s=n(s,e),i.canUseDOM&&t.forEach(c=>c())},a=e=>(t.push(e),()=>t=t.filter(c=>c!==e));return r({}),{getState:o,dispatch:r,subscribe:a}};module.exports=u;
|
package/store/store.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { canUseDOM as i } from "@progress/kendo-react-common";
|
|
10
|
+
const f = (o) => {
|
|
11
|
+
let s, t = [];
|
|
12
|
+
const a = () => s, c = (e) => {
|
|
13
|
+
s = o(s, e), i && t.forEach((r) => r());
|
|
14
|
+
}, n = (e) => (t.push(e), () => t = t.filter((r) => r !== e));
|
|
15
|
+
return c({}), { getState: a, dispatch: c, subscribe: n };
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
f as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),d=require("@progress/kendo-charts"),m=require("./Popup.js"),y=require("../MapContext.js");function f(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const s=f(h),i=class i extends s.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1}}componentDidMount(){this.mapObserver=new d.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupContext:t,shared:e,className:n,...r}=this.state;if(!t||!this.state.popupShown)return null;const c=t.layerIndex,a=this.findRenderFunctionByLayer(c);if(!a)return null;const l=()=>s.createElement("div",{className:"k-tooltip-content"},a(t)),u=`k-map-${t.type}-tooltip`;return s.createElement(m.TooltipPopup,{...r,popupContent:l,className:u})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}onShowTooltip(t){const{anchor:e,className:n}=t;let r=this.createTooltipContext(t);this.setState({popupShown:!0,popupAlign:{vertical:"bottom",horizontal:"center"},popupOffset:e,popupContext:r,popupStyles:{position:"relative"},className:n})}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createTooltipContext(t){return t}findRenderFunctionByLayer(t){const e=this.context.optionsStore.getState().layers;return e!==void 0&&Array.isArray(e)&&e[t]!==void 0&&e[t].hasOwnProperty("tooltip")&&e[t].tooltip.hasOwnProperty("render")?e[t].tooltip.render:null}};i.contextType=y.MapContext;let p=i;exports.MapTooltip=p;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { InstanceObserver as u } from "@progress/kendo-charts";
|
|
11
|
+
import { TooltipPopup as h } from "./Popup.mjs";
|
|
12
|
+
import { MapContext as m } from "../MapContext.mjs";
|
|
13
|
+
const p = class p extends n.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.context = null, this.state = {
|
|
16
|
+
popupShown: !1
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
componentDidMount() {
|
|
20
|
+
this.mapObserver = new u(this, {
|
|
21
|
+
showTooltip: "onShowTooltip",
|
|
22
|
+
hideTooltip: "onHideTooltip"
|
|
23
|
+
}), this.context.observersStore.dispatch({
|
|
24
|
+
type: "add",
|
|
25
|
+
payload: this.mapObserver
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const { popupContext: t, shared: o, className: r, ...e } = this.state;
|
|
30
|
+
if (!t || !this.state.popupShown)
|
|
31
|
+
return null;
|
|
32
|
+
const a = t.layerIndex, s = this.findRenderFunctionByLayer(a);
|
|
33
|
+
if (!s)
|
|
34
|
+
return null;
|
|
35
|
+
const l = () => /* @__PURE__ */ n.createElement("div", { className: "k-tooltip-content" }, s(t)), c = `k-map-${t.type}-tooltip`;
|
|
36
|
+
return /* @__PURE__ */ n.createElement(
|
|
37
|
+
h,
|
|
38
|
+
{
|
|
39
|
+
...e,
|
|
40
|
+
popupContent: l,
|
|
41
|
+
className: c
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
componentWillUnmount() {
|
|
46
|
+
this.context.observersStore.dispatch({
|
|
47
|
+
type: "remove",
|
|
48
|
+
payload: this.mapObserver
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
onShowTooltip(t) {
|
|
52
|
+
const { anchor: o, className: r } = t;
|
|
53
|
+
let e = this.createTooltipContext(t);
|
|
54
|
+
this.setState({
|
|
55
|
+
popupShown: !0,
|
|
56
|
+
popupAlign: { vertical: "bottom", horizontal: "center" },
|
|
57
|
+
popupOffset: o,
|
|
58
|
+
popupContext: e,
|
|
59
|
+
popupStyles: { position: "relative" },
|
|
60
|
+
className: r
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
onHideTooltip() {
|
|
64
|
+
this.setState({
|
|
65
|
+
popupShown: !1,
|
|
66
|
+
popupStyles: {},
|
|
67
|
+
className: void 0
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
createTooltipContext(t) {
|
|
71
|
+
return t;
|
|
72
|
+
}
|
|
73
|
+
findRenderFunctionByLayer(t) {
|
|
74
|
+
const o = this.context.optionsStore.getState().layers;
|
|
75
|
+
return o !== void 0 && Array.isArray(o) && o[t] !== void 0 && o[t].hasOwnProperty("tooltip") && o[t].tooltip.hasOwnProperty("render") ? o[t].tooltip.render : null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
p.contextType = m;
|
|
79
|
+
let i = p;
|
|
80
|
+
export {
|
|
81
|
+
i as MapTooltip
|
|
82
|
+
};
|
package/tooltip/Popup.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),d=require("@progress/kendo-charts"),h=require("../utils/index.js"),f=require("@progress/kendo-react-popup"),O=require("../MapContext.js");function v(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const r=v(m),b={horizontal:"fit",vertical:"fit"},S=["k-tooltip","k-map-tooltip"],y="k-tooltip-wrapper",p=class p extends r.Component{constructor(t,e){super(t,e),this.context=null,this.element=null,this.onMapMouseLeave=o=>{const{syntheticEvent:s}=o;return!!h.hasParent(s.relatedTarget,this.element)},this.mapObserver=new d.InstanceObserver(this,{onMouseLeave:"onMapMouseLeave"}),e.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupShown:t,popupAlign:e,popupOffset:o,popupStyles:s,popupContent:c,className:i}=this.props,l=[...S,i].join(" ").trim();return r.createElement(f.Popup,{animate:!0,popupAlign:e,offset:o,show:t,collision:b,className:y},r.createElement("div",{className:l,style:s,ref:u=>this.element=u},c()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}};p.contextType=O.MapContext;let a=p;exports.TooltipPopup=a;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import { InstanceObserver as c } from "@progress/kendo-charts";
|
|
11
|
+
import { hasParent as u } from "../utils/index.mjs";
|
|
12
|
+
import { Popup as h } from "@progress/kendo-react-popup";
|
|
13
|
+
import { MapContext as f } from "../MapContext.mjs";
|
|
14
|
+
const v = { horizontal: "fit", vertical: "fit" }, d = ["k-tooltip", "k-map-tooltip"], O = "k-tooltip-wrapper", n = class n extends r.Component {
|
|
15
|
+
constructor(t, e) {
|
|
16
|
+
super(t, e), this.context = null, this.element = null, this.onMapMouseLeave = (o) => {
|
|
17
|
+
const { syntheticEvent: s } = o;
|
|
18
|
+
return !!u(s.relatedTarget, this.element);
|
|
19
|
+
}, this.mapObserver = new c(this, {
|
|
20
|
+
onMouseLeave: "onMapMouseLeave"
|
|
21
|
+
}), e.observersStore.dispatch({
|
|
22
|
+
type: "add",
|
|
23
|
+
payload: this.mapObserver
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const { popupShown: t, popupAlign: e, popupOffset: o, popupStyles: s, popupContent: a, className: i } = this.props, m = [...d, i].join(" ").trim();
|
|
28
|
+
return /* @__PURE__ */ r.createElement(
|
|
29
|
+
h,
|
|
30
|
+
{
|
|
31
|
+
animate: !0,
|
|
32
|
+
popupAlign: e,
|
|
33
|
+
offset: o,
|
|
34
|
+
show: t,
|
|
35
|
+
collision: v,
|
|
36
|
+
className: O
|
|
37
|
+
},
|
|
38
|
+
/* @__PURE__ */ r.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: m,
|
|
42
|
+
style: s,
|
|
43
|
+
ref: (l) => this.element = l
|
|
44
|
+
},
|
|
45
|
+
a()
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
componentWillUnmount() {
|
|
50
|
+
this.context.observersStore.dispatch({
|
|
51
|
+
type: "remove",
|
|
52
|
+
payload: this.mapObserver
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
n.contextType = f;
|
|
57
|
+
let p = n;
|
|
58
|
+
export {
|
|
59
|
+
p as TooltipPopup
|
|
60
|
+
};
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(r,t){let e=r;for(;e&&e!==t;)e=e.parentNode;return!!e}function o(r,t,e,a){const n=r[t];if(n&&Array.isArray(n)){for(let l of n)if(!l.type||l.type!==a)return new Error(`${e} children should be Array of type ${a.displayName}.`)}return null}exports.hasParent=i;exports.validateChildren=o;
|
package/utils/index.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
let r = e;
|
|
11
|
+
for (; r && r !== t; )
|
|
12
|
+
r = r.parentNode;
|
|
13
|
+
return !!r;
|
|
14
|
+
}
|
|
15
|
+
function o(e, t, r, a) {
|
|
16
|
+
const n = e[t];
|
|
17
|
+
if (n && Array.isArray(n)) {
|
|
18
|
+
for (let l of n)
|
|
19
|
+
if (!l.type || l.type !== a)
|
|
20
|
+
return new Error(
|
|
21
|
+
`${r} children should be Array of type ${a.displayName}.`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
i as hasParent,
|
|
28
|
+
o as validateChildren
|
|
29
|
+
};
|
package/Map.d.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { InstanceObserver, Map as KendoMap } from '@progress/kendo-charts';
|
|
8
|
-
import { MapProps } from './MapProps';
|
|
9
|
-
import { MapContextType } from './MapContext';
|
|
10
|
-
import { DomEvent } from './events/dom-event';
|
|
11
|
-
import { geometry } from '@progress/kendo-drawing';
|
|
12
|
-
import { Extent, Location, MapLayer } from './common/map-types';
|
|
13
|
-
/**
|
|
14
|
-
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
15
|
-
*/
|
|
16
|
-
export declare class Map extends React.Component<MapProps, {}> {
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
static propTypes: {
|
|
21
|
-
dir: PropTypes.Requireable<string>;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
static defaultProps: {};
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
mapInstance: KendoMap | null;
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
get element(): HTMLDivElement;
|
|
35
|
-
protected _element: HTMLDivElement | null;
|
|
36
|
-
protected optionsStore: any;
|
|
37
|
-
protected optionsUnsubscriber: Function;
|
|
38
|
-
protected observersStore: any;
|
|
39
|
-
protected mapObserver: InstanceObserver;
|
|
40
|
-
protected childrenObserver: InstanceObserver;
|
|
41
|
-
protected contextValue: MapContextType;
|
|
42
|
-
constructor(props: MapProps);
|
|
43
|
-
private iconsType;
|
|
44
|
-
private svgIcons;
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
componentDidMount(): void;
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
componentWillUnmount(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @hidden
|
|
55
|
-
*/
|
|
56
|
-
componentDidUpdate(prevProps: MapProps): void;
|
|
57
|
-
/**
|
|
58
|
-
* @hidden
|
|
59
|
-
*/
|
|
60
|
-
render(): any;
|
|
61
|
-
/**
|
|
62
|
-
* @hidden
|
|
63
|
-
*/
|
|
64
|
-
getMapOptions(): any;
|
|
65
|
-
/**
|
|
66
|
-
* The marker layers instances.
|
|
67
|
-
*/
|
|
68
|
-
get layers(): MapLayer[];
|
|
69
|
-
/**
|
|
70
|
-
* Gets the extent (visible area) of the map.
|
|
71
|
-
*/
|
|
72
|
-
get extent(): Extent | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* Sets the extent (visible area) of the map.
|
|
75
|
-
*/
|
|
76
|
-
set extent(extent: Extent | undefined);
|
|
77
|
-
/**
|
|
78
|
-
* Detects the size of the container and redraws the Map.
|
|
79
|
-
* Resizing is automatic unless you set the `resizeRateLimit` option to `0`.
|
|
80
|
-
*/
|
|
81
|
-
resize(): void;
|
|
82
|
-
/**
|
|
83
|
-
* Retrieves the size of the visible portion of the map.
|
|
84
|
-
*
|
|
85
|
-
* @returns The size (width and height) of the visible portion of the map.
|
|
86
|
-
*/
|
|
87
|
-
viewSize(): {
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Returns the event coordinates relative to the map element. Offset coordinates are not synchronized to a particular location on the map.
|
|
93
|
-
*
|
|
94
|
-
* @param e The mouse event.
|
|
95
|
-
* @returns The event coordinates relative to the map element.
|
|
96
|
-
*/
|
|
97
|
-
eventOffset(e: any): geometry.Point | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Retrieves projected (layer) coordinates that correspond to this mouse event.
|
|
100
|
-
* Layer coordinates are absolute and change only when the zoom level is changed.
|
|
101
|
-
*
|
|
102
|
-
* @param e The mouse event.
|
|
103
|
-
* @returns The projected (layer) coordinates that correspond to this event.
|
|
104
|
-
*/
|
|
105
|
-
eventToLayer(e: any): geometry.Point | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Retrieves the geographic location that correspond to this mouse event.
|
|
108
|
-
*
|
|
109
|
-
* @param e The mouse event.
|
|
110
|
-
* @returns The geographic location that correspond to this mouse event.
|
|
111
|
-
*/
|
|
112
|
-
eventToLocation(e: any): geometry.Point | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Retrieves relative (view) coordinates that correspond to this mouse event.
|
|
115
|
-
* Layer elements positioned on these coordinates will appear under the mouse cursor.
|
|
116
|
-
* View coordinates are no longer valid after a map reset.
|
|
117
|
-
*
|
|
118
|
-
* @param e The mouse event.
|
|
119
|
-
* @returns The relative (view) coordinates that correspond to this mouse event.
|
|
120
|
-
*/
|
|
121
|
-
eventToView(e: any): geometry.Point | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* Transforms layer (projected) coordinates to geographical location.
|
|
124
|
-
*
|
|
125
|
-
* @param point The layer (projected) coordinates. An array argument is assumed to be in x, y order.
|
|
126
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
127
|
-
* @returns The geographic location that corresponds to the layer coordinates.
|
|
128
|
-
*/
|
|
129
|
-
layerToLocation(point: geometry.Point | number[], zoom?: number): Location | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* Returns the layer (projected) coordinates that correspond to a geographical location.
|
|
132
|
-
*
|
|
133
|
-
* @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
|
|
134
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
135
|
-
* @returns The layer (projected) coordinates.
|
|
136
|
-
*/
|
|
137
|
-
locationToLayer(location: Location | number[], zoom?: number): geometry.Point | undefined;
|
|
138
|
-
/**
|
|
139
|
-
* Returns the view (relative) coordinates that correspond to a geographical location.
|
|
140
|
-
*
|
|
141
|
-
* @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
|
|
142
|
-
* @returns The view coordinates that correspond to a geographical location.
|
|
143
|
-
*/
|
|
144
|
-
locationToView(location: Location | number[]): geometry.Point | undefined;
|
|
145
|
-
/**
|
|
146
|
-
* Returns the geographical location that correspond to the view (relative) coordinates.
|
|
147
|
-
*
|
|
148
|
-
* @param point The view coordinates. An array argument is assumed to be in x, y order.
|
|
149
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
150
|
-
* @returns The geographic location that corresponds to the view coordinates.
|
|
151
|
-
*/
|
|
152
|
-
viewToLocation(point: geometry.Point | number[], zoom?: number): Location | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* Load markers in the Map. This method will clear the current markers and show the new ones.
|
|
155
|
-
*
|
|
156
|
-
* @param newMarkers An array of markers.
|
|
157
|
-
*/
|
|
158
|
-
loadMarkers(newMarkers: any[]): void;
|
|
159
|
-
/**
|
|
160
|
-
* @hidden
|
|
161
|
-
*/
|
|
162
|
-
refresh(): void;
|
|
163
|
-
/**
|
|
164
|
-
* @hidden
|
|
165
|
-
*/
|
|
166
|
-
instantiateCoreMap(): void;
|
|
167
|
-
/**
|
|
168
|
-
* @hidden
|
|
169
|
-
*/
|
|
170
|
-
trigger(name: string, e: any): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* @hidden
|
|
173
|
-
*/
|
|
174
|
-
requiresHandlers(names: string[]): boolean;
|
|
175
|
-
/**
|
|
176
|
-
* @hidden
|
|
177
|
-
*/
|
|
178
|
-
triggerDomEvent<T>(name: string, e: DomEvent<T>): boolean;
|
|
179
|
-
/**
|
|
180
|
-
* @hidden
|
|
181
|
-
*/
|
|
182
|
-
onInit: (e: any) => void;
|
|
183
|
-
/**
|
|
184
|
-
* @hidden
|
|
185
|
-
*/
|
|
186
|
-
onRender: (e: any) => void;
|
|
187
|
-
/**
|
|
188
|
-
* @hidden
|
|
189
|
-
*/
|
|
190
|
-
onMapMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
191
|
-
private setIcons;
|
|
192
|
-
}
|
package/MapContext.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { Store } from './store/store';
|
|
7
|
-
import { InstanceObserver } from '@progress/kendo-charts';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export interface MapContextType {
|
|
12
|
-
optionsStore: Store;
|
|
13
|
-
observersStore: Store;
|
|
14
|
-
childrenObserver: InstanceObserver;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export declare const MapContext: React.Context<MapContextType | null>;
|
package/MapProps.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { MapOptions } from '@progress/kendo-charts';
|
|
7
|
-
import { BeforeResetEvent, MapClickEvent, MarkerActivateEvent, MarkerClickEvent, MarkerCreatedEvent, PanEndEvent, PanEvent, ResetEvent, ShapeClickEvent, ShapeCreatedEvent, ShapeFeatureCreatedEvent, ShapeMouseEnterEvent, ShapeMouseLeaveEvent, ZoomEndEvent, ZoomStartEvent } from './common/events';
|
|
8
|
-
/**
|
|
9
|
-
* Represents the props of the KendoReact Map component.
|
|
10
|
-
*/
|
|
11
|
-
export interface MapProps extends MapOptions {
|
|
12
|
-
/**
|
|
13
|
-
* Represents the `dir` HTML attribute.
|
|
14
|
-
*/
|
|
15
|
-
dir?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The styles that are applied to the component.
|
|
18
|
-
*/
|
|
19
|
-
style?: React.CSSProperties;
|
|
20
|
-
/**
|
|
21
|
-
* Sets additional CSS classes to the component.
|
|
22
|
-
*/
|
|
23
|
-
className?: string;
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
children?: any;
|
|
28
|
-
/**
|
|
29
|
-
* Fires when the Map is about to refresh. The event can be used to prevent the refresh of the Map in specific cases.
|
|
30
|
-
*/
|
|
31
|
-
onRefresh?: (mapOptions: any, mapInstance: any) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Fired immediately before the map is reset. This event is typically used for cleanup by layer implementers.
|
|
34
|
-
*/
|
|
35
|
-
onBeforeReset?: (event: BeforeResetEvent) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Fired when the user clicks on the map.
|
|
38
|
-
*/
|
|
39
|
-
onMapClick?: (event: MapClickEvent) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Fired when a marker has been displayed and has a DOM element assigned.
|
|
42
|
-
*/
|
|
43
|
-
onMarkerActivate?: (event: MarkerActivateEvent) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Fired when a marker has been clicked or tapped.
|
|
46
|
-
*/
|
|
47
|
-
onMarkerClick?: (event: MarkerClickEvent) => void;
|
|
48
|
-
/**
|
|
49
|
-
* Fired when a marker has been created and is about to be displayed.
|
|
50
|
-
*
|
|
51
|
-
* Cancelling the event will prevent the marker from being shown.
|
|
52
|
-
*/
|
|
53
|
-
onMarkerCreated?: (event: MarkerCreatedEvent) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Fires after the map viewport has been moved.
|
|
56
|
-
*/
|
|
57
|
-
onPanEnd?: (event: PanEndEvent) => void;
|
|
58
|
-
/**
|
|
59
|
-
* Fired while the map viewport is being moved.
|
|
60
|
-
*/
|
|
61
|
-
onPan?: (event: PanEvent) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Fired when the map is reset.
|
|
64
|
-
*
|
|
65
|
-
* This typically occurs on initial load and after a zoom/center change.
|
|
66
|
-
*/
|
|
67
|
-
onReset?: (event: ResetEvent) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Fired when a shape is clicked or tapped.
|
|
70
|
-
*/
|
|
71
|
-
onShapeClick?: (event: ShapeClickEvent) => void;
|
|
72
|
-
/**
|
|
73
|
-
* Fired when a shape is created, but is not rendered yet.
|
|
74
|
-
*/
|
|
75
|
-
onShapeCreated?: (event: ShapeCreatedEvent) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Fired when a [GeoJSON Feature](https://geojson.org/geojson-spec.html#feature-objects) is created on a shape layer.
|
|
78
|
-
*/
|
|
79
|
-
onShapeFeatureCreated?: (event: ShapeFeatureCreatedEvent) => void;
|
|
80
|
-
/**
|
|
81
|
-
* Fired when the mouse enters a shape.
|
|
82
|
-
*
|
|
83
|
-
* > This event will fire reliably only for shapes that have set fill color.
|
|
84
|
-
* > The opacity can still be set to 0 so the shapes appear to have no fill.
|
|
85
|
-
*/
|
|
86
|
-
onShapeMouseEnter?: (event: ShapeMouseEnterEvent) => void;
|
|
87
|
-
/**
|
|
88
|
-
* Fired when the mouse leaves a shape.
|
|
89
|
-
*
|
|
90
|
-
* > This event will fire reliably only for shapes that have set fill color.
|
|
91
|
-
* > The opacity can still be set to 0 so the shapes appear to have no fill.
|
|
92
|
-
*/
|
|
93
|
-
onShapeMouseLeave?: (event: ShapeMouseLeaveEvent) => void;
|
|
94
|
-
/**
|
|
95
|
-
* Fired when the map zoom level is about to change.
|
|
96
|
-
*
|
|
97
|
-
* Cancelling the event will prevent the user action.
|
|
98
|
-
*/
|
|
99
|
-
onZoomStart?: (event: ZoomStartEvent) => void;
|
|
100
|
-
/**
|
|
101
|
-
* Fired when the map zoom level has changed.
|
|
102
|
-
*/
|
|
103
|
-
onZoomEnd?: (event: ZoomEndEvent) => void;
|
|
104
|
-
}
|