@progress/kendo-react-map 10.2.0-develop.1 → 10.2.0-develop.10
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 +1 -1
- package/Map.mjs +11 -1
- package/components/base/CollectionConfigurationComponent.js +1 -1
- package/components/base/CollectionConfigurationComponent.mjs +13 -12
- package/components/base/ConfigurationComponent.js +1 -1
- package/components/base/ConfigurationComponent.mjs +10 -6
- package/dist/cdn/js/kendo-react-map.js +1 -1
- package/index.d.mts +24 -6
- package/index.d.ts +24 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
- package/tooltip/Popup.js +1 -1
- package/tooltip/Popup.mjs +29 -15
package/Map.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),O=require("prop-types"),m=require("@progress/kendo-charts"),T=require("./events/map-event-builder.js"),v=require("./store/store.js"),f=require("./store/reducer.js"),k=require("./MapContext.js"),S=require("./tooltip/MapTooltip.js"),I=require("@progress/kendo-react-common"),w=require("./package-metadata.js"),L=require("./events/dom-event.js"),c=require("@progress/kendo-svg-icons");function A(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>p[t]})}}return e.default=p,Object.freeze(e)}const a=A(M),g={mapMarkerTargetIcon:c.mapMarkerTargetIcon,mapMarkerIcon:c.mapMarkerIcon,plusIcon:c.plusIcon,minusIcon:c.minusIcon,caretAltUpIcon:c.caretAltUpIcon,caretAltDownIcon:c.caretAltDownIcon,caretAltLeftIcon:c.caretAltLeftIcon,caretAltRightIcon:c.caretAltRightIcon},b="svg",h=class h extends a.Component{constructor(e){super(e),this.mapInstance=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.observersStore={},this.showLicenseWatermark=!1,this.iconsType=b,this.svgIcons=g,this.onInit=t=>{this.mapInstance=t.sender},this.onRender=t=>{this.mapInstance!==null&&this.trigger("render",t)},this.onMapMouseLeave=t=>{const n=L.toDomEvent(this,t);this.triggerDomEvent("onMouseLeave",n)?t.preventDefault():this.mapInstance!==null&&this.mapInstance.hideTooltip()},this.showLicenseWatermark=!I.validatePackage(w.packageMetadata,{component:"Map"}),this.optionsStore=v(f.optionsReducer),this.observersStore=v(f.observersReducer),this.childrenObserver=new m.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.contextValue={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver},this.mapObserver=new m.InstanceObserver(this,{init:"onInit"})}get element(){return this._element}componentDidMount(){this.instantiateCoreMap(),this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this))}componentWillUnmount(){this.optionsUnsubscriber(),this.mapInstance!==null&&(this.mapInstance.destroy(),this.mapInstance=null)}componentDidUpdate(e){const{dir:t,children:n,...s}=this.props;this.mapInstance!==null&&(Object.entries(e).filter(r=>r[0]!=="dir"&&r[0]!=="children").some(r=>{const[i,l]=r;return!(s.hasOwnProperty(i)&&s[i]===l)})&&this.refresh(),e.dir)}render(){const{style:e={},className:t,children:n}=this.props,s=Object.assign({},e,{position:"relative"}),o=a.createElement("div",{className:t,style:s,key:"mapElement"},a.createElement("div",{ref:r=>this._element=r,className:"k-map",onMouseLeave:this.onMapMouseLeave},n));return a.createElement(a.Fragment,null,a.createElement(I.IconsContext.Consumer,null,r=>a.createElement(k.MapContext.Provider,{value:this.contextValue},a.createElement(S.MapTooltip,{key:"tooltip"}),o,this.setIcons(r))),this.showLicenseWatermark&&a.createElement(I.WatermarkOverlay,null))}getMapOptions(){const{center:e,controls:t,minZoom:n,maxZoom:s,minSize:o,pannable:r,wraparound:i,zoom:l,zoomable:y}=this.props;let u={center:e,controls:t,minZoom:n,maxZoom:s,minSize:o,pannable:r,wraparound:i,zoom:l,zoomable:y,icons:{type:this.iconsType,svgIcons:this.svgIcons}};return u=Object.assign(u,this.optionsStore.getState()),u}get layers(){var e;return(e=this.mapInstance)==null?void 0:e.layers}get extent(){var e;return(e=this.mapInstance)==null?void 0:e.extent()}set extent(e){var t;(t=this.mapInstance)==null||t.extent(e)}resize(){}viewSize(){var e;return(e=this.mapInstance)==null?void 0:e.viewSize()}eventOffset(e){var t;return(t=this.mapInstance)==null?void 0:t.eventOffset(e)}eventToLayer(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToLayer(e)}eventToLocation(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToLocation(e)}eventToView(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToView(e)}layerToLocation(e,t){var n;return(n=this.mapInstance)==null?void 0:n.layerToLocation(e,t)}locationToLayer(e,t){var n;return(n=this.mapInstance)==null?void 0:n.locationToLayer(e,t)}locationToView(e){var t;return(t=this.mapInstance)==null?void 0:t.locationToView(e)}viewToLocation(e,t){var n;return(n=this.mapInstance)==null?void 0:n.viewToLocation(e,t)}loadMarkers(e){const t=this.mapInstance.markers;t&&t._load(e)}refresh(){if(this.mapInstance!==null){const e=this.getMapOptions();this.props.onRefresh?this.props.onRefresh.call(void 0,e,this.mapInstance):this.mapInstance.setOptions(e)}}instantiateCoreMap(){const e=this.getMapOptions();this.mapInstance=new m.Map(this.element,e,{},{observer:this.mapObserver,sender:this})}trigger(e,t){const n=e==="click"?"mapClick":e,s=T.create(n,t,this),o="on"+n.charAt(0).toUpperCase()+n.slice(1),r=this.observersStore.getState();let i=!1;for(let l=0;l<r.length;l++)r[l].trigger(n,t)&&(i=!0);return i===!1&&s&&this.props.hasOwnProperty(o)?(this.props[o].call(void 0,s),s.isDefaultPrevented&&s.isDefaultPrevented()):i}requiresHandlers(e){for(let t=0;t<e.length;t++){const n=e[t],s="on"+n.charAt(0).toUpperCase()+n.slice(1);if(this.props.hasOwnProperty(s))return!0}return!1}triggerDomEvent(e,t){const n=this.observersStore.getState();let s=!1;for(let o=0;o<n.length;o++)n[o].trigger(e,t)&&(s=!0);return s}setIcons(e){const{type:t,icons:n={}}=e,s={...g},o={mapMarkerTargetIcon:n.mapMarkerTargetIcon,mapMarkerIcon:n.mapMarkerIcon,plusIcon:n.plusIcon,minusIcon:n.minusIcon,caretAltUpIcon:n.caretAltUpIcon,caretAltDownIcon:n.caretAltDownIcon,caretAltLeftIcon:n.caretAltLeftIcon,caretAltRightIcon:n.caretAltRightIcon};let r;for(r in o)if(o[r]){const i=o[r];i&&typeof i!="string"&&(s[r]=i)}return this.svgIcons=s,this.iconsType=t||b,null}};h.propTypes={dir:O.string},h.defaultProps={};let d=h;exports.Map=d;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),O=require("prop-types"),m=require("@progress/kendo-charts"),T=require("./events/map-event-builder.js"),v=require("./store/store.js"),f=require("./store/reducer.js"),k=require("./MapContext.js"),S=require("./tooltip/MapTooltip.js"),I=require("@progress/kendo-react-common"),w=require("./package-metadata.js"),L=require("./events/dom-event.js"),c=require("@progress/kendo-svg-icons");function A(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>p[t]})}}return e.default=p,Object.freeze(e)}const a=A(M),g={mapMarkerTargetIcon:c.mapMarkerTargetIcon,mapMarkerIcon:c.mapMarkerIcon,plusIcon:c.plusIcon,minusIcon:c.minusIcon,caretAltUpIcon:c.caretAltUpIcon,caretAltDownIcon:c.caretAltDownIcon,caretAltLeftIcon:c.caretAltLeftIcon,caretAltRightIcon:c.caretAltRightIcon},b="svg",h=class h extends a.Component{constructor(e){super(e),this.mapInstance=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.observersStore={},this.showLicenseWatermark=!1,this.iconsType=b,this.svgIcons=g,this.onInit=t=>{this.mapInstance=t.sender},this.onRender=t=>{this.mapInstance!==null&&this.trigger("render",t)},this.onMapMouseLeave=t=>{const n=L.toDomEvent(this,t);this.triggerDomEvent("onMouseLeave",n)?t.preventDefault():this.mapInstance!==null&&this.mapInstance.hideTooltip()},this.showLicenseWatermark=!I.validatePackage(w.packageMetadata,{component:"Map"}),this.optionsStore=v(f.optionsReducer),this.observersStore=v(f.observersReducer),this.childrenObserver=new m.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.contextValue={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver},this.mapObserver=new m.InstanceObserver(this,{init:"onInit"})}get element(){return this._element}componentDidMount(){this.instantiateCoreMap(),this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this))}componentWillUnmount(){this.optionsUnsubscriber(),this.mapInstance!==null&&(this.mapInstance.destroy(),this.mapInstance=null)}componentDidUpdate(e){const{dir:t,children:n,...s}=this.props;this.mapInstance!==null&&(Object.entries(e).filter(r=>r[0]!=="dir"&&r[0]!=="children").some(r=>{const[i,l]=r;return!(s.hasOwnProperty(i)&&s[i]===l)})&&this.refresh(),e.dir)}render(){const{style:e={},className:t,children:n}=this.props,s=Object.assign({},e,{position:"relative"}),o=a.createElement("div",{className:t,style:s,key:"mapElement"},a.createElement("div",{ref:r=>{this._element=r},className:"k-map",onMouseLeave:this.onMapMouseLeave},n));return a.createElement(a.Fragment,null,a.createElement(I.IconsContext.Consumer,null,r=>a.createElement(k.MapContext.Provider,{value:this.contextValue},a.createElement(S.MapTooltip,{key:"tooltip"}),o,this.setIcons(r))),this.showLicenseWatermark&&a.createElement(I.WatermarkOverlay,null))}getMapOptions(){const{center:e,controls:t,minZoom:n,maxZoom:s,minSize:o,pannable:r,wraparound:i,zoom:l,zoomable:y}=this.props;let u={center:e,controls:t,minZoom:n,maxZoom:s,minSize:o,pannable:r,wraparound:i,zoom:l,zoomable:y,icons:{type:this.iconsType,svgIcons:this.svgIcons}};return u=Object.assign(u,this.optionsStore.getState()),u}get layers(){var e;return(e=this.mapInstance)==null?void 0:e.layers}get extent(){var e;return(e=this.mapInstance)==null?void 0:e.extent()}set extent(e){var t;(t=this.mapInstance)==null||t.extent(e)}resize(){}viewSize(){var e;return(e=this.mapInstance)==null?void 0:e.viewSize()}eventOffset(e){var t;return(t=this.mapInstance)==null?void 0:t.eventOffset(e)}eventToLayer(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToLayer(e)}eventToLocation(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToLocation(e)}eventToView(e){var t;return(t=this.mapInstance)==null?void 0:t.eventToView(e)}layerToLocation(e,t){var n;return(n=this.mapInstance)==null?void 0:n.layerToLocation(e,t)}locationToLayer(e,t){var n;return(n=this.mapInstance)==null?void 0:n.locationToLayer(e,t)}locationToView(e){var t;return(t=this.mapInstance)==null?void 0:t.locationToView(e)}viewToLocation(e,t){var n;return(n=this.mapInstance)==null?void 0:n.viewToLocation(e,t)}loadMarkers(e){const t=this.mapInstance.markers;t&&t._load(e)}refresh(){if(this.mapInstance!==null){const e=this.getMapOptions();this.props.onRefresh?this.props.onRefresh.call(void 0,e,this.mapInstance):this.mapInstance.setOptions(e)}}instantiateCoreMap(){const e=this.getMapOptions();this.mapInstance=new m.Map(this.element,e,{},{observer:this.mapObserver,sender:this})}trigger(e,t){const n=e==="click"?"mapClick":e,s=T.create(n,t,this),o="on"+n.charAt(0).toUpperCase()+n.slice(1),r=this.observersStore.getState();let i=!1;for(let l=0;l<r.length;l++)r[l].trigger(n,t)&&(i=!0);return i===!1&&s&&this.props.hasOwnProperty(o)?(this.props[o].call(void 0,s),s.isDefaultPrevented&&s.isDefaultPrevented()):i}requiresHandlers(e){for(let t=0;t<e.length;t++){const n=e[t],s="on"+n.charAt(0).toUpperCase()+n.slice(1);if(this.props.hasOwnProperty(s))return!0}return!1}triggerDomEvent(e,t){const n=this.observersStore.getState();let s=!1;for(let o=0;o<n.length;o++)n[o].trigger(e,t)&&(s=!0);return s}setIcons(e){const{type:t,icons:n={}}=e,s={...g},o={mapMarkerTargetIcon:n.mapMarkerTargetIcon,mapMarkerIcon:n.mapMarkerIcon,plusIcon:n.plusIcon,minusIcon:n.minusIcon,caretAltUpIcon:n.caretAltUpIcon,caretAltDownIcon:n.caretAltDownIcon,caretAltLeftIcon:n.caretAltLeftIcon,caretAltRightIcon:n.caretAltRightIcon};let r;for(r in o)if(o[r]){const i=o[r];i&&typeof i!="string"&&(s[r]=i)}return this.svgIcons=s,this.iconsType=t||b,null}};h.propTypes={dir:O.string},h.defaultProps={};let d=h;exports.Map=d;
|
package/Map.mjs
CHANGED
|
@@ -83,7 +83,17 @@ const u = {
|
|
|
83
83
|
style: n,
|
|
84
84
|
key: "mapElement"
|
|
85
85
|
},
|
|
86
|
-
/* @__PURE__ */ a.createElement(
|
|
86
|
+
/* @__PURE__ */ a.createElement(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
ref: (r) => {
|
|
90
|
+
this._element = r;
|
|
91
|
+
},
|
|
92
|
+
className: "k-map",
|
|
93
|
+
onMouseLeave: this.onMapMouseLeave
|
|
94
|
+
},
|
|
95
|
+
s
|
|
96
|
+
)
|
|
87
97
|
);
|
|
88
98
|
return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(k.Consumer, null, (r) => /* @__PURE__ */ a.createElement(M.Provider, { value: this.contextValue }, /* @__PURE__ */ a.createElement(O, { key: "tooltip" }), o, this.setIcons(r))), this.showLicenseWatermark && /* @__PURE__ */ a.createElement(w, null));
|
|
89
99
|
}
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";const
|
|
8
|
+
"use strict";const l=require("react"),u=require("../../MapContext.js");function d(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=d(l),a=class a extends s.Component{get optionsStore(){var e;return(e=this.context)==null?void 0:e.optionsStore}renderChildren(e,t){const{children:r}=e.props,{_mapKey:i,_parentStore:o}=this.props,p={...e.props,_mapCollectionIdxKey:`${i}_${t}`,_parentStore:o};return s.cloneElement(e,p,r)}render(){const{_mapKey:e,_parentStore:t,children:r}=this.props;return(t||this.optionsStore).dispatch({mapKey:e,payload:[]}),s.Children.map(r,(o,p)=>s.isValidElement(o)?this.renderChildren(o,p):o)}};a.contextType=u.MapContext;let c=a;module.exports=c;
|
|
@@ -5,26 +5,27 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as r from "react";
|
|
9
9
|
import { MapContext as c } from "../../MapContext.mjs";
|
|
10
|
-
const n = class n extends
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const n = class n extends r.Component {
|
|
11
|
+
get optionsStore() {
|
|
12
|
+
var e;
|
|
13
|
+
return (e = this.context) == null ? void 0 : e.optionsStore;
|
|
13
14
|
}
|
|
14
|
-
renderChildren(e,
|
|
15
|
-
const { children: o } = e.props, { _mapKey: a, _parentStore:
|
|
15
|
+
renderChildren(e, s) {
|
|
16
|
+
const { children: o } = e.props, { _mapKey: a, _parentStore: t } = this.props, p = {
|
|
16
17
|
...e.props,
|
|
17
|
-
_mapCollectionIdxKey: `${a}_${
|
|
18
|
-
_parentStore:
|
|
18
|
+
_mapCollectionIdxKey: `${a}_${s}`,
|
|
19
|
+
_parentStore: t
|
|
19
20
|
};
|
|
20
|
-
return
|
|
21
|
+
return r.cloneElement(e, p, o);
|
|
21
22
|
}
|
|
22
23
|
render() {
|
|
23
|
-
const { _mapKey: e, _parentStore:
|
|
24
|
-
return (
|
|
24
|
+
const { _mapKey: e, _parentStore: s, children: o } = this.props;
|
|
25
|
+
return (s || this.optionsStore).dispatch({
|
|
25
26
|
mapKey: e,
|
|
26
27
|
payload: []
|
|
27
|
-
}),
|
|
28
|
+
}), r.Children.map(o, (t, p) => r.isValidElement(t) ? this.renderChildren(t, p) : t);
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
31
|
n.contextType = c;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";const p=require("react"),a=require("../../store/store.js"),d=require("../../store/reducer.js"),l=require("../../MapContext.js");function u(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=u(p),
|
|
8
|
+
"use strict";const p=require("react"),a=require("../../store/store.js"),d=require("../../store/reducer.js"),l=require("../../MapContext.js");function u(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=u(p),c=class c extends n.Component{get optionsStore(){var t;return(t=this.context)==null?void 0:t.optionsStore}constructor(t){super(t),this.childStore=a(d.optionsReducer)}render(){const{children:t}=this.props;return t!==void 0?n.Children.map(t,e=>n.isValidElement(e)?this.renderChildren(e):e):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_mapKey:t,_mapCollectionIdxKey:e,_parentStore:r,children:h,...i}=this.props;(r||this.optionsStore).dispatch({mapKey:t,mapCollectionIdxKey:e,payload:Object.assign({},i,this.childStore.getState())})}renderChildren(t){const{children:e}=t.props,r={...t.props,_parentStore:this.childStore};return n.cloneElement(t,r,e)}};c.contextType=l.MapContext;let s=c;module.exports=s;
|
|
@@ -10,8 +10,12 @@ import p from "../../store/store.mjs";
|
|
|
10
10
|
import { optionsReducer as c } from "../../store/reducer.mjs";
|
|
11
11
|
import { MapContext as a } from "../../MapContext.mjs";
|
|
12
12
|
const s = class s extends o.Component {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
get optionsStore() {
|
|
14
|
+
var t;
|
|
15
|
+
return (t = this.context) == null ? void 0 : t.optionsStore;
|
|
16
|
+
}
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(t), this.childStore = p(c);
|
|
15
19
|
}
|
|
16
20
|
render() {
|
|
17
21
|
const { children: t } = this.props;
|
|
@@ -24,11 +28,11 @@ const s = class s extends o.Component {
|
|
|
24
28
|
this.dispatch();
|
|
25
29
|
}
|
|
26
30
|
dispatch() {
|
|
27
|
-
const { _mapKey: t, _mapCollectionIdxKey: e, _parentStore: r, children: d, ...
|
|
31
|
+
const { _mapKey: t, _mapCollectionIdxKey: e, _parentStore: r, children: d, ...i } = this.props;
|
|
28
32
|
(r || this.optionsStore).dispatch({
|
|
29
33
|
mapKey: t,
|
|
30
34
|
mapCollectionIdxKey: e,
|
|
31
|
-
payload: Object.assign({},
|
|
35
|
+
payload: Object.assign({}, i, this.childStore.getState())
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
renderChildren(t) {
|
|
@@ -40,7 +44,7 @@ const s = class s extends o.Component {
|
|
|
40
44
|
}
|
|
41
45
|
};
|
|
42
46
|
s.contextType = a;
|
|
43
|
-
let
|
|
47
|
+
let n = s;
|
|
44
48
|
export {
|
|
45
|
-
|
|
49
|
+
n as default
|
|
46
50
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("prop-types"),require("@progress/kendo-charts"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","prop-types","@progress/kendo-charts","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactMap={},e.React,e.KendoReactCommon,e.PropTypes,e.KendoCharts,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,n,r,o,s,a){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var p=i(t);const c=p.createContext(null);c.displayName="MapContext";const l=class extends p.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore}renderChildren(e,t){const{children:n}=e.props,{_mapKey:r,_parentStore:o}=this.props,s={...e.props,_mapCollectionIdxKey:`${r}_${t}`,_parentStore:o};return p.cloneElement(e,s,n)}render(){const{_mapKey:e,_parentStore:t,children:n}=this.props;return(t||this.optionsStore).dispatch({mapKey:e,payload:[]}),p.Children.map(n,((e,t)=>p.isValidElement(e)?this.renderChildren(e,t):e))}};l.contextType=c;let h=l;const u=e=>{let t,r=[];const o=o=>{t=e(t,o),n.canUseDOM&&r.forEach((e=>e()))};return o({}),{getState:()=>t,dispatch:o,subscribe:e=>(r.push(e),()=>r=r.filter((t=>t!==e)))}},d=(e,t)=>t.mapCollectionIdxKey?v.collectionConfigurationItem(e,t):t.mapKey?v.configurationItem(e,t):{},m=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter((e=>e!==t.payload));default:return e}},v={configurationItem:(e,t)=>Object.assign(e,{[t.mapKey]:t.payload}),collectionConfigurationItem(e,t){let n=!1;const[r,o]=t.mapCollectionIdxKey.split("_"),s=e[r].map(((e,r)=>parseInt(o,10)===r?(n=!0,t.payload):e));return!1===n&&s.splice(parseInt(o,10),0,t.payload),Object.assign(e,{[r]:s})},themeItem(e,t){let n={};const r=Object.assign(n,e),{field:o,value:s}=t.payload,a=o.split(".");let i=a.shift();for(;a.length>0;)n=n[i]=n[i]||{},i=a.shift();return n[i]=s,r}},y=class extends p.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore,this.childStore=u(d)}render(){const{children:e}=this.props;return void 0!==e?p.Children.map(e,(e=>p.isValidElement(e)?this.renderChildren(e):e)):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_mapKey:e,_mapCollectionIdxKey:t,_parentStore:n,children:r,...o}=this.props;(n||this.optionsStore).dispatch({mapKey:e,mapCollectionIdxKey:t,payload:Object.assign({},o,this.childStore.getState())})}renderChildren(e){const{children:t}=e.props,n={...e.props,_parentStore:this.childStore};return p.cloneElement(e,n,t)}};y.contextType=c;let g=y,f=class{constructor(e){this.target=e}},I=class extends f{constructor(e,t){super(t)}},E=class extends f{constructor(e,t){super(t),this.location=e.location,this.originalEvent=e.originalEvent}},b=class extends f{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},S=class extends f{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},k=class extends f{constructor(){super(...arguments),this.prevented=!1}preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}},M=class extends k{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},x=class extends f{constructor(e,t){super(t),this.origin=e.origin,this.center=e.center,this.originalEvent=e.originalEvent}},C=class extends f{constructor(e,t){super(t),this.origin=e.origin,this.center=e.center,this.originalEvent=e.originalEvent}},T=class extends f{constructor(e,t){super(t)}},O=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},w=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.location=null,e.shape&&(this.dataItem=e.shape.dataItem,this.location=e.shape.location)}},L=class extends f{constructor(e,t){super(t),this.dataItem=e.dataItem,this.layer=e.layer,this.group=e.group,this.properties=e.properties}},A=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},K=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},N=class extends f{constructor(e,t){super(t),this.originalEvent=e.originalEvent}},_=class extends k{constructor(e,t){super(t),this.originalEvent=e.originalEvent}};const D={beforeReset:I,mapClick:E,markerActivate:b,markerClick:S,markerCreated:M,panEnd:x,pan:C,reset:T,shapeClick:O,shapeCreated:w,shapeFeatureCreated:L,shapeMouseEnter:A,shapeMouseLeave:K,zoomEnd:N,zoomStart:_};function P(e,t,n,r){const o=e[t];if(o&&Array.isArray(o))for(const e of o)if(!e.type||e.type!==r)return new Error(`${n} children should be Array of type ${r.displayName}.`);return null}const R={horizontal:"fit",vertical:"fit"},U=["k-tooltip","k-map-tooltip"],j=class extends p.Component{constructor(e,t){super(e,t),this.context=null,this.element=null,this.onMapMouseLeave=e=>{const{syntheticEvent:t}=e;return!!function(e,t){let n=e;for(;n&&n!==t;)n=n.parentNode;return!!n}(t.relatedTarget,this.element)},this.mapObserver=new o.InstanceObserver(this,{onMouseLeave:"onMapMouseLeave"}),t.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupShown:e,popupAlign:t,popupOffset:n,popupStyles:r,popupContent:o,className:a}=this.props,i=[...U,a].join(" ").trim();return p.createElement(s.Popup,{animate:!0,popupAlign:t,offset:n,show:e,collision:R,className:"k-tooltip-wrapper"},p.createElement("div",{className:i,style:r,ref:e=>this.element=e},o()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}};j.contextType=c;let z=j;const V=class extends p.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1}}componentDidMount(){this.mapObserver=new o.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupContext:e,shared:t,className:n,...r}=this.state;if(!e||!this.state.popupShown)return null;const o=e.layerIndex,s=this.findRenderFunctionByLayer(o);if(!s)return null;const a=`k-map-${e.type}-tooltip`;return p.createElement(z,{...r,popupContent:()=>p.createElement("div",{className:"k-tooltip-content"},s(e)),className:a})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}onShowTooltip(e){const{anchor:t,className:n}=e,r=this.createTooltipContext(e);this.setState({popupShown:!0,popupAlign:{vertical:"bottom",horizontal:"center"},popupOffset:t,popupContext:r,popupStyles:{position:"relative"},className:n})}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createTooltipContext(e){return e}findRenderFunctionByLayer(e){const t=this.context.optionsStore.getState().layers;return void 0!==t&&Array.isArray(t)&&void 0!==t[e]&&t[e].hasOwnProperty("tooltip")&&t[e].tooltip.hasOwnProperty("render")?t[e].tooltip.render:null}};V.contextType=c;let q=V;const W={name:"@progress/kendo-react-map",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1651750998,version:"10.2.0-develop.1",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"};let B=class{constructor(e,t){this.sender=e,this.syntheticEvent=t}};const F={mapMarkerTargetIcon:a.mapMarkerTargetIcon,mapMarkerIcon:a.mapMarkerIcon,plusIcon:a.plusIcon,minusIcon:a.minusIcon,caretAltUpIcon:a.caretAltUpIcon,caretAltDownIcon:a.caretAltDownIcon,caretAltLeftIcon:a.caretAltLeftIcon,caretAltRightIcon:a.caretAltRightIcon},Z=class extends p.Component{constructor(e){super(e),this.mapInstance=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.observersStore={},this.showLicenseWatermark=!1,this.iconsType="svg",this.svgIcons=F,this.onInit=e=>{this.mapInstance=e.sender},this.onRender=e=>{null!==this.mapInstance&&this.trigger("render",e)},this.onMapMouseLeave=e=>{const t=function(e,t){return new B(e,t)}(this,e);this.triggerDomEvent("onMouseLeave",t)?e.preventDefault():null!==this.mapInstance&&this.mapInstance.hideTooltip()},this.showLicenseWatermark=!n.validatePackage(W,{component:"Map"}),this.optionsStore=u(d),this.observersStore=u(m),this.childrenObserver=new o.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.contextValue={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver},this.mapObserver=new o.InstanceObserver(this,{init:"onInit"})}get element(){return this._element}componentDidMount(){this.instantiateCoreMap(),this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this))}componentWillUnmount(){this.optionsUnsubscriber(),null!==this.mapInstance&&(this.mapInstance.destroy(),this.mapInstance=null)}componentDidUpdate(e){const{dir:t,children:n,...r}=this.props;null!==this.mapInstance&&(Object.entries(e).filter((e=>"dir"!==e[0]&&"children"!==e[0])).some((e=>{const[t,n]=e;return!(r.hasOwnProperty(t)&&r[t]===n)}))&&this.refresh(),e.dir)}render(){const{style:e={},className:t,children:r}=this.props,o=Object.assign({},e,{position:"relative"}),s=p.createElement("div",{className:t,style:o,key:"mapElement"},p.createElement("div",{ref:e=>this._element=e,className:"k-map",onMouseLeave:this.onMapMouseLeave},r));return p.createElement(p.Fragment,null,p.createElement(n.IconsContext.Consumer,null,(e=>p.createElement(c.Provider,{value:this.contextValue},p.createElement(q,{key:"tooltip"}),s,this.setIcons(e)))),this.showLicenseWatermark&&p.createElement(n.WatermarkOverlay,null))}getMapOptions(){const{center:e,controls:t,minZoom:n,maxZoom:r,minSize:o,pannable:s,wraparound:a,zoom:i,zoomable:p}=this.props;let c={center:e,controls:t,minZoom:n,maxZoom:r,minSize:o,pannable:s,wraparound:a,zoom:i,zoomable:p,icons:{type:this.iconsType,svgIcons:this.svgIcons}};return c=Object.assign(c,this.optionsStore.getState()),c}get layers(){var e;return null==(e=this.mapInstance)?void 0:e.layers}get extent(){var e;return null==(e=this.mapInstance)?void 0:e.extent()}set extent(e){var t;null==(t=this.mapInstance)||t.extent(e)}resize(){}viewSize(){var e;return null==(e=this.mapInstance)?void 0:e.viewSize()}eventOffset(e){var t;return null==(t=this.mapInstance)?void 0:t.eventOffset(e)}eventToLayer(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToLayer(e)}eventToLocation(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToLocation(e)}eventToView(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToView(e)}layerToLocation(e,t){var n;return null==(n=this.mapInstance)?void 0:n.layerToLocation(e,t)}locationToLayer(e,t){var n;return null==(n=this.mapInstance)?void 0:n.locationToLayer(e,t)}locationToView(e){var t;return null==(t=this.mapInstance)?void 0:t.locationToView(e)}viewToLocation(e,t){var n;return null==(n=this.mapInstance)?void 0:n.viewToLocation(e,t)}loadMarkers(e){const t=this.mapInstance.markers;t&&t._load(e)}refresh(){if(null!==this.mapInstance){const e=this.getMapOptions();this.props.onRefresh?this.props.onRefresh.call(void 0,e,this.mapInstance):this.mapInstance.setOptions(e)}}instantiateCoreMap(){const e=this.getMapOptions();this.mapInstance=new o.Map(this.element,e,{},{observer:this.mapObserver,sender:this})}trigger(e,t){const n="click"===e?"mapClick":e,r=function(e,t,n){if(D[e])return new D[e](t,n)}(n,t,this),o="on"+n.charAt(0).toUpperCase()+n.slice(1),s=this.observersStore.getState();let a=!1;for(let e=0;e<s.length;e++)s[e].trigger(n,t)&&(a=!0);return!1===a&&r&&this.props.hasOwnProperty(o)?(this.props[o].call(void 0,r),r.isDefaultPrevented&&r.isDefaultPrevented()):a}requiresHandlers(e){for(let t=0;t<e.length;t++){const n=e[t],r="on"+n.charAt(0).toUpperCase()+n.slice(1);if(this.props.hasOwnProperty(r))return!0}return!1}triggerDomEvent(e,t){const n=this.observersStore.getState();let r=!1;for(let o=0;o<n.length;o++)n[o].trigger(e,t)&&(r=!0);return r}setIcons(e){const{type:t,icons:n={}}=e,r={...F},o={mapMarkerTargetIcon:n.mapMarkerTargetIcon,mapMarkerIcon:n.mapMarkerIcon,plusIcon:n.plusIcon,minusIcon:n.minusIcon,caretAltUpIcon:n.caretAltUpIcon,caretAltDownIcon:n.caretAltDownIcon,caretAltLeftIcon:n.caretAltLeftIcon,caretAltRightIcon:n.caretAltRightIcon};let s;for(s in o)if(o[s]){const e=o[s];e&&"string"!=typeof e&&(r[s]=e)}return this.svgIcons=r,this.iconsType=t||"svg",null}};Z.propTypes={dir:r.string},Z.defaultProps={};let $=Z;const H=e=>p.createElement(h,{...e,_mapKey:"layers"});H.propTypes={children:r.node};const G=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),J=e=>p.createElement(g,{type:"shape",...e});J.displayName="MapShapeLayer",J.propTypes={children:function(e,t,n){return P(e,t,n,G)}};const Q=e=>p.createElement(g,{type:"tile",...e});Q.displayName="MapTileLayer";const X=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),Y=e=>p.createElement(g,{type:"bubble",...e});Y.displayName="MapBubbleLayer",Y.propTypes={children:function(e,t,n){return P(e,t,n,X)}};const ee=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),te=e=>p.createElement(g,{type:"marker",...e});te.displayName="MapMarkerLayer",te.propTypes={children:function(e,t,n){return P(e,t,n,ee)}},Object.defineProperty(e,"Extent",{enumerable:!0,get:function(){return o.Extent}}),Object.defineProperty(e,"Location",{enumerable:!0,get:function(){return o.Location}}),e.BeforeResetEvent=I,e.CollectionConfigurationComponent=h,e.ConfigurationComponent=g,e.Map=$,e.MapBubbleLayer=Y,e.MapBubbleLayerTooltip=X,e.MapClickEvent=E,e.MapLayers=H,e.MapMarkerLayer=te,e.MapMarkerLayerTooltip=ee,e.MapShapeLayer=J,e.MapShapeLayerTooltip=G,e.MapTileLayer=Q,e.MapTooltip=q,e.MarkerActivateEvent=b,e.MarkerClickEvent=S,e.MarkerCreatedEvent=M,e.PanEndEvent=x,e.PanEvent=C,e.ResetEvent=T,e.ShapeClickEvent=O,e.ShapeCreatedEvent=w,e.ShapeFeatureCreatedEvent=L,e.ShapeMouseEnterEvent=A,e.ShapeMouseLeaveEvent=K,e.ZoomEndEvent=N,e.ZoomStartEvent=_}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("prop-types"),require("@progress/kendo-charts"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","prop-types","@progress/kendo-charts","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactMap={},e.React,e.KendoReactCommon,e.PropTypes,e.KendoCharts,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,n,r,o,s,a){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var p=i(t);const c=p.createContext(null);c.displayName="MapContext";const l=class extends p.Component{get optionsStore(){var e;return null==(e=this.context)?void 0:e.optionsStore}renderChildren(e,t){const{children:n}=e.props,{_mapKey:r,_parentStore:o}=this.props,s={...e.props,_mapCollectionIdxKey:`${r}_${t}`,_parentStore:o};return p.cloneElement(e,s,n)}render(){const{_mapKey:e,_parentStore:t,children:n}=this.props;return(t||this.optionsStore).dispatch({mapKey:e,payload:[]}),p.Children.map(n,((e,t)=>p.isValidElement(e)?this.renderChildren(e,t):e))}};l.contextType=c;let h=l;const u=e=>{let t,r=[];const o=o=>{t=e(t,o),n.canUseDOM&&r.forEach((e=>e()))};return o({}),{getState:()=>t,dispatch:o,subscribe:e=>(r.push(e),()=>r=r.filter((t=>t!==e)))}},d=(e,t)=>t.mapCollectionIdxKey?v.collectionConfigurationItem(e,t):t.mapKey?v.configurationItem(e,t):{},m=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter((e=>e!==t.payload));default:return e}},v={configurationItem:(e,t)=>Object.assign(e,{[t.mapKey]:t.payload}),collectionConfigurationItem(e,t){let n=!1;const[r,o]=t.mapCollectionIdxKey.split("_"),s=e[r].map(((e,r)=>parseInt(o,10)===r?(n=!0,t.payload):e));return!1===n&&s.splice(parseInt(o,10),0,t.payload),Object.assign(e,{[r]:s})},themeItem(e,t){let n={};const r=Object.assign(n,e),{field:o,value:s}=t.payload,a=o.split(".");let i=a.shift();for(;a.length>0;)n=n[i]=n[i]||{},i=a.shift();return n[i]=s,r}},y=class extends p.Component{get optionsStore(){var e;return null==(e=this.context)?void 0:e.optionsStore}constructor(e){super(e),this.childStore=u(d)}render(){const{children:e}=this.props;return void 0!==e?p.Children.map(e,(e=>p.isValidElement(e)?this.renderChildren(e):e)):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_mapKey:e,_mapCollectionIdxKey:t,_parentStore:n,children:r,...o}=this.props;(n||this.optionsStore).dispatch({mapKey:e,mapCollectionIdxKey:t,payload:Object.assign({},o,this.childStore.getState())})}renderChildren(e){const{children:t}=e.props,n={...e.props,_parentStore:this.childStore};return p.cloneElement(e,n,t)}};y.contextType=c;let g=y,f=class{constructor(e){this.target=e}},I=class extends f{constructor(e,t){super(t)}},E=class extends f{constructor(e,t){super(t),this.location=e.location,this.originalEvent=e.originalEvent}},b=class extends f{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},S=class extends f{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},k=class extends f{constructor(){super(...arguments),this.prevented=!1}preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}},M=class extends k{constructor(e,t){super(t),this.marker=e.marker,this.layer=e.layer}},x=class extends f{constructor(e,t){super(t),this.origin=e.origin,this.center=e.center,this.originalEvent=e.originalEvent}},C=class extends f{constructor(e,t){super(t),this.origin=e.origin,this.center=e.center,this.originalEvent=e.originalEvent}},T=class extends f{constructor(e,t){super(t)}},O=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},w=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.location=null,e.shape&&(this.dataItem=e.shape.dataItem,this.location=e.shape.location)}},L=class extends f{constructor(e,t){super(t),this.dataItem=e.dataItem,this.layer=e.layer,this.group=e.group,this.properties=e.properties}},A=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},K=class extends f{constructor(e,t){super(t),this.layer=e.layer,this.shape=e.shape,this.originalEvent=e.originalEvent}},D=class extends f{constructor(e,t){super(t),this.originalEvent=e.originalEvent}},N=class extends k{constructor(e,t){super(t),this.originalEvent=e.originalEvent}};const _={beforeReset:I,mapClick:E,markerActivate:b,markerClick:S,markerCreated:M,panEnd:x,pan:C,reset:T,shapeClick:O,shapeCreated:w,shapeFeatureCreated:L,shapeMouseEnter:A,shapeMouseLeave:K,zoomEnd:D,zoomStart:N};function P(e,t,n,r){const o=e[t];if(o&&Array.isArray(o))for(const e of o)if(!e.type||e.type!==r)return new Error(`${n} children should be Array of type ${r.displayName}.`);return null}const R={horizontal:"fit",vertical:"fit"},U=["k-tooltip","k-map-tooltip"],j=class extends p.Component{constructor(e){super(e),this.context=null,this.element=null,this.onMapMouseLeave=e=>{const{syntheticEvent:t}=e;return!!function(e,t){let n=e;for(;n&&n!==t;)n=n.parentNode;return!!n}(t.relatedTarget,this.element)},this.mapObserver=new o.InstanceObserver(this,{onMouseLeave:"onMapMouseLeave"})}componentDidMount(){var e;null==(e=this.context)||e.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupShown:e,popupAlign:t,popupOffset:n,popupStyles:r,popupContent:o,className:a}=this.props,i=[...U,a].join(" ").trim();return p.createElement(s.Popup,{animate:!0,popupAlign:t,offset:n,show:e,collision:R,className:"k-tooltip-wrapper"},p.createElement("div",{className:i,style:r,ref:e=>{this.element=e}},o()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}};j.contextType=c;let z=j;const V=class extends p.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1}}componentDidMount(){this.mapObserver=new o.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupContext:e,shared:t,className:n,...r}=this.state;if(!e||!this.state.popupShown)return null;const o=e.layerIndex,s=this.findRenderFunctionByLayer(o);if(!s)return null;const a=`k-map-${e.type}-tooltip`;return p.createElement(z,{...r,popupContent:()=>p.createElement("div",{className:"k-tooltip-content"},s(e)),className:a})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}onShowTooltip(e){const{anchor:t,className:n}=e,r=this.createTooltipContext(e);this.setState({popupShown:!0,popupAlign:{vertical:"bottom",horizontal:"center"},popupOffset:t,popupContext:r,popupStyles:{position:"relative"},className:n})}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createTooltipContext(e){return e}findRenderFunctionByLayer(e){const t=this.context.optionsStore.getState().layers;return void 0!==t&&Array.isArray(t)&&void 0!==t[e]&&t[e].hasOwnProperty("tooltip")&&t[e].tooltip.hasOwnProperty("render")?t[e].tooltip.render:null}};V.contextType=c;let q=V;const W={name:"@progress/kendo-react-map",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1651750998,version:"10.2.0-develop.10",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"};let B=class{constructor(e,t){this.sender=e,this.syntheticEvent=t}};const F={mapMarkerTargetIcon:a.mapMarkerTargetIcon,mapMarkerIcon:a.mapMarkerIcon,plusIcon:a.plusIcon,minusIcon:a.minusIcon,caretAltUpIcon:a.caretAltUpIcon,caretAltDownIcon:a.caretAltDownIcon,caretAltLeftIcon:a.caretAltLeftIcon,caretAltRightIcon:a.caretAltRightIcon},Z=class extends p.Component{constructor(e){super(e),this.mapInstance=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.observersStore={},this.showLicenseWatermark=!1,this.iconsType="svg",this.svgIcons=F,this.onInit=e=>{this.mapInstance=e.sender},this.onRender=e=>{null!==this.mapInstance&&this.trigger("render",e)},this.onMapMouseLeave=e=>{const t=function(e,t){return new B(e,t)}(this,e);this.triggerDomEvent("onMouseLeave",t)?e.preventDefault():null!==this.mapInstance&&this.mapInstance.hideTooltip()},this.showLicenseWatermark=!n.validatePackage(W,{component:"Map"}),this.optionsStore=u(d),this.observersStore=u(m),this.childrenObserver=new o.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.contextValue={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver},this.mapObserver=new o.InstanceObserver(this,{init:"onInit"})}get element(){return this._element}componentDidMount(){this.instantiateCoreMap(),this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this))}componentWillUnmount(){this.optionsUnsubscriber(),null!==this.mapInstance&&(this.mapInstance.destroy(),this.mapInstance=null)}componentDidUpdate(e){const{dir:t,children:n,...r}=this.props;null!==this.mapInstance&&(Object.entries(e).filter((e=>"dir"!==e[0]&&"children"!==e[0])).some((e=>{const[t,n]=e;return!(r.hasOwnProperty(t)&&r[t]===n)}))&&this.refresh(),e.dir)}render(){const{style:e={},className:t,children:r}=this.props,o=Object.assign({},e,{position:"relative"}),s=p.createElement("div",{className:t,style:o,key:"mapElement"},p.createElement("div",{ref:e=>{this._element=e},className:"k-map",onMouseLeave:this.onMapMouseLeave},r));return p.createElement(p.Fragment,null,p.createElement(n.IconsContext.Consumer,null,(e=>p.createElement(c.Provider,{value:this.contextValue},p.createElement(q,{key:"tooltip"}),s,this.setIcons(e)))),this.showLicenseWatermark&&p.createElement(n.WatermarkOverlay,null))}getMapOptions(){const{center:e,controls:t,minZoom:n,maxZoom:r,minSize:o,pannable:s,wraparound:a,zoom:i,zoomable:p}=this.props;let c={center:e,controls:t,minZoom:n,maxZoom:r,minSize:o,pannable:s,wraparound:a,zoom:i,zoomable:p,icons:{type:this.iconsType,svgIcons:this.svgIcons}};return c=Object.assign(c,this.optionsStore.getState()),c}get layers(){var e;return null==(e=this.mapInstance)?void 0:e.layers}get extent(){var e;return null==(e=this.mapInstance)?void 0:e.extent()}set extent(e){var t;null==(t=this.mapInstance)||t.extent(e)}resize(){}viewSize(){var e;return null==(e=this.mapInstance)?void 0:e.viewSize()}eventOffset(e){var t;return null==(t=this.mapInstance)?void 0:t.eventOffset(e)}eventToLayer(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToLayer(e)}eventToLocation(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToLocation(e)}eventToView(e){var t;return null==(t=this.mapInstance)?void 0:t.eventToView(e)}layerToLocation(e,t){var n;return null==(n=this.mapInstance)?void 0:n.layerToLocation(e,t)}locationToLayer(e,t){var n;return null==(n=this.mapInstance)?void 0:n.locationToLayer(e,t)}locationToView(e){var t;return null==(t=this.mapInstance)?void 0:t.locationToView(e)}viewToLocation(e,t){var n;return null==(n=this.mapInstance)?void 0:n.viewToLocation(e,t)}loadMarkers(e){const t=this.mapInstance.markers;t&&t._load(e)}refresh(){if(null!==this.mapInstance){const e=this.getMapOptions();this.props.onRefresh?this.props.onRefresh.call(void 0,e,this.mapInstance):this.mapInstance.setOptions(e)}}instantiateCoreMap(){const e=this.getMapOptions();this.mapInstance=new o.Map(this.element,e,{},{observer:this.mapObserver,sender:this})}trigger(e,t){const n="click"===e?"mapClick":e,r=function(e,t,n){if(_[e])return new _[e](t,n)}(n,t,this),o="on"+n.charAt(0).toUpperCase()+n.slice(1),s=this.observersStore.getState();let a=!1;for(let e=0;e<s.length;e++)s[e].trigger(n,t)&&(a=!0);return!1===a&&r&&this.props.hasOwnProperty(o)?(this.props[o].call(void 0,r),r.isDefaultPrevented&&r.isDefaultPrevented()):a}requiresHandlers(e){for(let t=0;t<e.length;t++){const n=e[t],r="on"+n.charAt(0).toUpperCase()+n.slice(1);if(this.props.hasOwnProperty(r))return!0}return!1}triggerDomEvent(e,t){const n=this.observersStore.getState();let r=!1;for(let o=0;o<n.length;o++)n[o].trigger(e,t)&&(r=!0);return r}setIcons(e){const{type:t,icons:n={}}=e,r={...F},o={mapMarkerTargetIcon:n.mapMarkerTargetIcon,mapMarkerIcon:n.mapMarkerIcon,plusIcon:n.plusIcon,minusIcon:n.minusIcon,caretAltUpIcon:n.caretAltUpIcon,caretAltDownIcon:n.caretAltDownIcon,caretAltLeftIcon:n.caretAltLeftIcon,caretAltRightIcon:n.caretAltRightIcon};let s;for(s in o)if(o[s]){const e=o[s];e&&"string"!=typeof e&&(r[s]=e)}return this.svgIcons=r,this.iconsType=t||"svg",null}};Z.propTypes={dir:r.string},Z.defaultProps={};let $=Z;const H=e=>p.createElement(h,{...e,_mapKey:"layers"});H.propTypes={children:r.node};const G=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),J=e=>p.createElement(g,{type:"shape",...e});J.displayName="MapShapeLayer",J.propTypes={children:function(e,t,n){return P(e,t,n,G)}};const Q=e=>p.createElement(g,{type:"tile",...e});Q.displayName="MapTileLayer";const X=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),Y=e=>p.createElement(g,{type:"bubble",...e});Y.displayName="MapBubbleLayer",Y.propTypes={children:function(e,t,n){return P(e,t,n,X)}};const ee=e=>p.createElement(g,{...e,_mapKey:"tooltip"}),te=e=>p.createElement(g,{type:"marker",...e});te.displayName="MapMarkerLayer",te.propTypes={children:function(e,t,n){return P(e,t,n,ee)}},Object.defineProperty(e,"Extent",{enumerable:!0,get:function(){return o.Extent}}),Object.defineProperty(e,"Location",{enumerable:!0,get:function(){return o.Location}}),e.BeforeResetEvent=I,e.CollectionConfigurationComponent=h,e.ConfigurationComponent=g,e.Map=$,e.MapBubbleLayer=Y,e.MapBubbleLayerTooltip=X,e.MapClickEvent=E,e.MapLayers=H,e.MapMarkerLayer=te,e.MapMarkerLayerTooltip=ee,e.MapShapeLayer=J,e.MapShapeLayerTooltip=G,e.MapTileLayer=Q,e.MapTooltip=q,e.MarkerActivateEvent=b,e.MarkerClickEvent=S,e.MarkerCreatedEvent=M,e.PanEndEvent=x,e.PanEvent=C,e.ResetEvent=T,e.ShapeClickEvent=O,e.ShapeCreatedEvent=w,e.ShapeFeatureCreatedEvent=L,e.ShapeMouseEnterEvent=A,e.ShapeMouseLeaveEvent=K,e.ZoomEndEvent=D,e.ZoomStartEvent=N}));
|
package/index.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ import { Extent } from '@progress/kendo-charts';
|
|
|
15
15
|
import { geometry } from '@progress/kendo-drawing';
|
|
16
16
|
import { Group } from '@progress/kendo-drawing';
|
|
17
17
|
import { InstanceObserver } from '@progress/kendo-charts';
|
|
18
|
-
import { JSX
|
|
18
|
+
import { JSX } from 'react/jsx-runtime';
|
|
19
19
|
import { Location as Location_2 } from '@progress/kendo-charts';
|
|
20
20
|
import { Map as Map_3 } from '@progress/kendo-charts';
|
|
21
21
|
import { MapBeforeResetEvent } from '@progress/kendo-charts';
|
|
@@ -45,6 +45,8 @@ import { MarkerLayerOptions } from '@progress/kendo-charts';
|
|
|
45
45
|
import { Offset } from '@progress/kendo-react-popup';
|
|
46
46
|
import * as React_2 from 'react';
|
|
47
47
|
import { ShapeLayerOptions } from '@progress/kendo-charts';
|
|
48
|
+
import { Store as Store_2 } from '../../store/store';
|
|
49
|
+
import { Store as Store_3 } from './../../store/store';
|
|
48
50
|
import { TileLayerOptions } from '@progress/kendo-charts';
|
|
49
51
|
import { TileUrlTemplateArgs } from '@progress/kendo-charts';
|
|
50
52
|
|
|
@@ -103,8 +105,8 @@ export declare interface BubbleTooltipContext {
|
|
|
103
105
|
*/
|
|
104
106
|
export declare class CollectionConfigurationComponent extends React_2.Component<CollectionConfigurationProps> {
|
|
105
107
|
static contextType: React_2.Context<MapContextType | null>;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
context: React_2.ContextType<typeof MapContext>;
|
|
109
|
+
get optionsStore(): Store_2 | undefined;
|
|
108
110
|
renderChildren(child: any, index: number): React_2.DetailedReactHTMLElement<any, HTMLElement>;
|
|
109
111
|
render(): any;
|
|
110
112
|
}
|
|
@@ -123,9 +125,10 @@ declare interface CollectionConfigurationProps {
|
|
|
123
125
|
*/
|
|
124
126
|
export declare class ConfigurationComponent extends React_2.Component<ConfigurationComponentProps> {
|
|
125
127
|
static contextType: React_2.Context<MapContextType | null>;
|
|
126
|
-
|
|
128
|
+
context: React_2.ContextType<typeof MapContext>;
|
|
127
129
|
childStore: any;
|
|
128
|
-
|
|
130
|
+
get optionsStore(): Store_3 | undefined;
|
|
131
|
+
constructor(props: any);
|
|
129
132
|
render(): any;
|
|
130
133
|
componentDidMount(): void;
|
|
131
134
|
componentDidUpdate(): void;
|
|
@@ -451,14 +454,29 @@ export declare interface MapMarkerLayerTooltipProps {
|
|
|
451
454
|
export declare interface MapProps extends MapOptions {
|
|
452
455
|
/**
|
|
453
456
|
* Represents the `dir` HTML attribute.
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```jsx
|
|
460
|
+
* <Map dir="rtl" />
|
|
461
|
+
* ```
|
|
454
462
|
*/
|
|
455
463
|
dir?: string;
|
|
456
464
|
/**
|
|
457
465
|
* The styles that are applied to the component.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```jsx
|
|
469
|
+
* <Map style={{ height: '500px' }} />
|
|
470
|
+
* ```
|
|
458
471
|
*/
|
|
459
472
|
style?: React_2.CSSProperties;
|
|
460
473
|
/**
|
|
461
474
|
* Sets additional CSS classes to the component.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```jsx
|
|
478
|
+
* <Map className="custom-map-class" />
|
|
479
|
+
* ```
|
|
462
480
|
*/
|
|
463
481
|
className?: string;
|
|
464
482
|
/**
|
|
@@ -583,7 +601,7 @@ export declare class MapTooltip extends React_2.Component<{}, MapTooltipState> {
|
|
|
583
601
|
readonly state: MapTooltipState;
|
|
584
602
|
mapObserver?: InstanceObserver;
|
|
585
603
|
componentDidMount(): void;
|
|
586
|
-
render():
|
|
604
|
+
render(): JSX.Element | null;
|
|
587
605
|
componentWillUnmount(): void;
|
|
588
606
|
onShowTooltip(e: any): void;
|
|
589
607
|
onHideTooltip(): void;
|
package/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { Extent } from '@progress/kendo-charts';
|
|
|
15
15
|
import { geometry } from '@progress/kendo-drawing';
|
|
16
16
|
import { Group } from '@progress/kendo-drawing';
|
|
17
17
|
import { InstanceObserver } from '@progress/kendo-charts';
|
|
18
|
-
import { JSX
|
|
18
|
+
import { JSX } from 'react/jsx-runtime';
|
|
19
19
|
import { Location as Location_2 } from '@progress/kendo-charts';
|
|
20
20
|
import { Map as Map_3 } from '@progress/kendo-charts';
|
|
21
21
|
import { MapBeforeResetEvent } from '@progress/kendo-charts';
|
|
@@ -45,6 +45,8 @@ import { MarkerLayerOptions } from '@progress/kendo-charts';
|
|
|
45
45
|
import { Offset } from '@progress/kendo-react-popup';
|
|
46
46
|
import * as React_2 from 'react';
|
|
47
47
|
import { ShapeLayerOptions } from '@progress/kendo-charts';
|
|
48
|
+
import { Store as Store_2 } from '../../store/store';
|
|
49
|
+
import { Store as Store_3 } from './../../store/store';
|
|
48
50
|
import { TileLayerOptions } from '@progress/kendo-charts';
|
|
49
51
|
import { TileUrlTemplateArgs } from '@progress/kendo-charts';
|
|
50
52
|
|
|
@@ -103,8 +105,8 @@ export declare interface BubbleTooltipContext {
|
|
|
103
105
|
*/
|
|
104
106
|
export declare class CollectionConfigurationComponent extends React_2.Component<CollectionConfigurationProps> {
|
|
105
107
|
static contextType: React_2.Context<MapContextType | null>;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
context: React_2.ContextType<typeof MapContext>;
|
|
109
|
+
get optionsStore(): Store_2 | undefined;
|
|
108
110
|
renderChildren(child: any, index: number): React_2.DetailedReactHTMLElement<any, HTMLElement>;
|
|
109
111
|
render(): any;
|
|
110
112
|
}
|
|
@@ -123,9 +125,10 @@ declare interface CollectionConfigurationProps {
|
|
|
123
125
|
*/
|
|
124
126
|
export declare class ConfigurationComponent extends React_2.Component<ConfigurationComponentProps> {
|
|
125
127
|
static contextType: React_2.Context<MapContextType | null>;
|
|
126
|
-
|
|
128
|
+
context: React_2.ContextType<typeof MapContext>;
|
|
127
129
|
childStore: any;
|
|
128
|
-
|
|
130
|
+
get optionsStore(): Store_3 | undefined;
|
|
131
|
+
constructor(props: any);
|
|
129
132
|
render(): any;
|
|
130
133
|
componentDidMount(): void;
|
|
131
134
|
componentDidUpdate(): void;
|
|
@@ -451,14 +454,29 @@ export declare interface MapMarkerLayerTooltipProps {
|
|
|
451
454
|
export declare interface MapProps extends MapOptions {
|
|
452
455
|
/**
|
|
453
456
|
* Represents the `dir` HTML attribute.
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```jsx
|
|
460
|
+
* <Map dir="rtl" />
|
|
461
|
+
* ```
|
|
454
462
|
*/
|
|
455
463
|
dir?: string;
|
|
456
464
|
/**
|
|
457
465
|
* The styles that are applied to the component.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```jsx
|
|
469
|
+
* <Map style={{ height: '500px' }} />
|
|
470
|
+
* ```
|
|
458
471
|
*/
|
|
459
472
|
style?: React_2.CSSProperties;
|
|
460
473
|
/**
|
|
461
474
|
* Sets additional CSS classes to the component.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```jsx
|
|
478
|
+
* <Map className="custom-map-class" />
|
|
479
|
+
* ```
|
|
462
480
|
*/
|
|
463
481
|
className?: string;
|
|
464
482
|
/**
|
|
@@ -583,7 +601,7 @@ export declare class MapTooltip extends React_2.Component<{}, MapTooltipState> {
|
|
|
583
601
|
readonly state: MapTooltipState;
|
|
584
602
|
mapObserver?: InstanceObserver;
|
|
585
603
|
componentDidMount(): void;
|
|
586
|
-
render():
|
|
604
|
+
render(): JSX.Element | null;
|
|
587
605
|
componentWillUnmount(): void;
|
|
588
606
|
onShowTooltip(e: any): void;
|
|
589
607
|
onHideTooltip(): void;
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-map",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-map",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1745314135,version:"10.2.0-develop.10",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;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "10.2.0-develop.
|
|
13
|
+
publishDate: 1745314135,
|
|
14
|
+
version: "10.2.0-develop.10",
|
|
15
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
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-map",
|
|
3
|
-
"version": "10.2.0-develop.
|
|
3
|
+
"version": "10.2.0-develop.10",
|
|
4
4
|
"description": "KendoReact Map package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-licensing": "^1.5.1",
|
|
30
|
-
"@progress/kendo-react-common": "10.2.0-develop.
|
|
31
|
-
"@progress/kendo-react-popup": "10.2.0-develop.
|
|
30
|
+
"@progress/kendo-react-common": "10.2.0-develop.10",
|
|
31
|
+
"@progress/kendo-react-popup": "10.2.0-develop.10",
|
|
32
32
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
33
33
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
34
34
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"package": {
|
|
57
57
|
"productName": "KendoReact",
|
|
58
58
|
"productCode": "KENDOUIREACT",
|
|
59
|
-
"publishDate":
|
|
59
|
+
"publishDate": 1745314135,
|
|
60
60
|
"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"
|
|
61
61
|
}
|
|
62
62
|
},
|
package/tooltip/Popup.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"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
|
|
8
|
+
"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 e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=v(m),b={horizontal:"fit",vertical:"fit"},S=["k-tooltip","k-map-tooltip"],y="k-tooltip-wrapper",p=class p extends s.Component{constructor(e){super(e),this.context=null,this.element=null,this.onMapMouseLeave=t=>{const{syntheticEvent:o}=t;return!!h.hasParent(o.relatedTarget,this.element)},this.mapObserver=new d.InstanceObserver(this,{onMouseLeave:"onMapMouseLeave"})}componentDidMount(){var e;(e=this.context)==null||e.observersStore.dispatch({type:"add",payload:this.mapObserver})}render(){const{popupShown:e,popupAlign:t,popupOffset:o,popupStyles:a,popupContent:c,className:i}=this.props,l=[...S,i].join(" ").trim();return s.createElement(f.Popup,{animate:!0,popupAlign:t,offset:o,show:e,collision:b,className:y},s.createElement("div",{className:l,style:a,ref:u=>{this.element=u}},c()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.mapObserver})}};p.contextType=O.MapContext;let r=p;exports.TooltipPopup=r;
|
package/tooltip/Popup.mjs
CHANGED
|
@@ -5,26 +5,30 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { InstanceObserver as
|
|
8
|
+
import * as s from "react";
|
|
9
|
+
import { InstanceObserver as l } from "@progress/kendo-charts";
|
|
10
10
|
import { hasParent as h } from "../utils/index.mjs";
|
|
11
11
|
import { Popup as u } from "@progress/kendo-react-popup";
|
|
12
12
|
import { MapContext as f } from "../MapContext.mjs";
|
|
13
|
-
const v = { horizontal: "fit", vertical: "fit" }, d = ["k-tooltip", "k-map-tooltip"], O = "k-tooltip-wrapper",
|
|
14
|
-
constructor(t
|
|
15
|
-
super(t
|
|
16
|
-
const { syntheticEvent:
|
|
17
|
-
return !!h(
|
|
18
|
-
}, this.mapObserver = new
|
|
13
|
+
const v = { horizontal: "fit", vertical: "fit" }, d = ["k-tooltip", "k-map-tooltip"], O = "k-tooltip-wrapper", n = class n extends s.Component {
|
|
14
|
+
constructor(t) {
|
|
15
|
+
super(t), this.context = null, this.element = null, this.onMapMouseLeave = (e) => {
|
|
16
|
+
const { syntheticEvent: o } = e;
|
|
17
|
+
return !!h(o.relatedTarget, this.element);
|
|
18
|
+
}, this.mapObserver = new l(this, {
|
|
19
19
|
onMouseLeave: "onMapMouseLeave"
|
|
20
|
-
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
componentDidMount() {
|
|
23
|
+
var t;
|
|
24
|
+
(t = this.context) == null || t.observersStore.dispatch({
|
|
21
25
|
type: "add",
|
|
22
26
|
payload: this.mapObserver
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
29
|
render() {
|
|
26
|
-
const { popupShown: t, popupAlign: e, popupOffset: o, popupStyles:
|
|
27
|
-
return /* @__PURE__ */
|
|
30
|
+
const { popupShown: t, popupAlign: e, popupOffset: o, popupStyles: p, popupContent: a, className: i } = this.props, m = [...d, i].join(" ").trim();
|
|
31
|
+
return /* @__PURE__ */ s.createElement(
|
|
28
32
|
u,
|
|
29
33
|
{
|
|
30
34
|
animate: !0,
|
|
@@ -34,7 +38,17 @@ const v = { horizontal: "fit", vertical: "fit" }, d = ["k-tooltip", "k-map-toolt
|
|
|
34
38
|
collision: v,
|
|
35
39
|
className: O
|
|
36
40
|
},
|
|
37
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ s.createElement(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: m,
|
|
45
|
+
style: p,
|
|
46
|
+
ref: (c) => {
|
|
47
|
+
this.element = c;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
a()
|
|
51
|
+
)
|
|
38
52
|
);
|
|
39
53
|
}
|
|
40
54
|
componentWillUnmount() {
|
|
@@ -44,8 +58,8 @@ const v = { horizontal: "fit", vertical: "fit" }, d = ["k-tooltip", "k-map-toolt
|
|
|
44
58
|
});
|
|
45
59
|
}
|
|
46
60
|
};
|
|
47
|
-
|
|
48
|
-
let
|
|
61
|
+
n.contextType = f;
|
|
62
|
+
let r = n;
|
|
49
63
|
export {
|
|
50
|
-
|
|
64
|
+
r as TooltipPopup
|
|
51
65
|
};
|