@progress/kendo-react-map 11.0.0-develop.2 → 11.0.0-develop.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-map.js +1 -1
- package/index.d.mts +27 -0
- package/index.d.ts +27 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
|
@@ -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{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:"11.0.0-develop.2",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}));
|
|
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:"11.0.0-develop.21",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
|
@@ -170,6 +170,9 @@ export { Location_2 as Location }
|
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* Supported children components are: {@link MapLayers}.
|
|
173
176
|
*/
|
|
174
177
|
declare class Map_2 extends React_2.Component<MapProps, {}> {
|
|
175
178
|
/**
|
|
@@ -351,6 +354,12 @@ declare class Map_2 extends React_2.Component<MapProps, {}> {
|
|
|
351
354
|
}
|
|
352
355
|
export { Map_2 as Map }
|
|
353
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Represents the KendoReact MapBubbleLayer component.
|
|
359
|
+
*
|
|
360
|
+
* @remarks
|
|
361
|
+
* Supported children components are: {@link MapBubbleLayerTooltip}.
|
|
362
|
+
*/
|
|
354
363
|
export declare const MapBubbleLayer: React_2.FunctionComponent<MapBubbleLayerProps>;
|
|
355
364
|
|
|
356
365
|
/**
|
|
@@ -414,6 +423,12 @@ export { MapLayer }
|
|
|
414
423
|
|
|
415
424
|
export { MapLayerOptions }
|
|
416
425
|
|
|
426
|
+
/**
|
|
427
|
+
* Represents the KendoReact MapLayers component.
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* Supported children components are: {@link MapShapeLayer}, {@link MapBubbleLayer}, {@link MapMarkerLayer}, {@link MapTileLayer}.
|
|
431
|
+
*/
|
|
417
432
|
export declare const MapLayers: React_2.FunctionComponent<MapLayersProps>;
|
|
418
433
|
|
|
419
434
|
/**
|
|
@@ -425,6 +440,12 @@ export declare interface MapLayersProps {
|
|
|
425
440
|
|
|
426
441
|
export { MapMarker }
|
|
427
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Represents the KendoReact MapMarkerLayer component.
|
|
445
|
+
*
|
|
446
|
+
* @remarks
|
|
447
|
+
* Supported children components are: {@link MapMarkerLayerTooltip}.
|
|
448
|
+
*/
|
|
428
449
|
export declare const MapMarkerLayer: React_2.FunctionComponent<MapMarkerLayerProps>;
|
|
429
450
|
|
|
430
451
|
/**
|
|
@@ -561,6 +582,12 @@ export declare interface MapProps extends MapOptions {
|
|
|
561
582
|
onZoomEnd?: (event: ZoomEndEvent) => void;
|
|
562
583
|
}
|
|
563
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Represents the KendoReact MapShapeLayer component.
|
|
587
|
+
*
|
|
588
|
+
* @remarks
|
|
589
|
+
* Supported children components are: {@link MapShapeLayerTooltip}.
|
|
590
|
+
*/
|
|
564
591
|
export declare const MapShapeLayer: React_2.FunctionComponent<MapShapeLayerProps>;
|
|
565
592
|
|
|
566
593
|
/**
|
package/index.d.ts
CHANGED
|
@@ -170,6 +170,9 @@ export { Location_2 as Location }
|
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* Supported children components are: {@link MapLayers}.
|
|
173
176
|
*/
|
|
174
177
|
declare class Map_2 extends React_2.Component<MapProps, {}> {
|
|
175
178
|
/**
|
|
@@ -351,6 +354,12 @@ declare class Map_2 extends React_2.Component<MapProps, {}> {
|
|
|
351
354
|
}
|
|
352
355
|
export { Map_2 as Map }
|
|
353
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Represents the KendoReact MapBubbleLayer component.
|
|
359
|
+
*
|
|
360
|
+
* @remarks
|
|
361
|
+
* Supported children components are: {@link MapBubbleLayerTooltip}.
|
|
362
|
+
*/
|
|
354
363
|
export declare const MapBubbleLayer: React_2.FunctionComponent<MapBubbleLayerProps>;
|
|
355
364
|
|
|
356
365
|
/**
|
|
@@ -414,6 +423,12 @@ export { MapLayer }
|
|
|
414
423
|
|
|
415
424
|
export { MapLayerOptions }
|
|
416
425
|
|
|
426
|
+
/**
|
|
427
|
+
* Represents the KendoReact MapLayers component.
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* Supported children components are: {@link MapShapeLayer}, {@link MapBubbleLayer}, {@link MapMarkerLayer}, {@link MapTileLayer}.
|
|
431
|
+
*/
|
|
417
432
|
export declare const MapLayers: React_2.FunctionComponent<MapLayersProps>;
|
|
418
433
|
|
|
419
434
|
/**
|
|
@@ -425,6 +440,12 @@ export declare interface MapLayersProps {
|
|
|
425
440
|
|
|
426
441
|
export { MapMarker }
|
|
427
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Represents the KendoReact MapMarkerLayer component.
|
|
445
|
+
*
|
|
446
|
+
* @remarks
|
|
447
|
+
* Supported children components are: {@link MapMarkerLayerTooltip}.
|
|
448
|
+
*/
|
|
428
449
|
export declare const MapMarkerLayer: React_2.FunctionComponent<MapMarkerLayerProps>;
|
|
429
450
|
|
|
430
451
|
/**
|
|
@@ -561,6 +582,12 @@ export declare interface MapProps extends MapOptions {
|
|
|
561
582
|
onZoomEnd?: (event: ZoomEndEvent) => void;
|
|
562
583
|
}
|
|
563
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Represents the KendoReact MapShapeLayer component.
|
|
587
|
+
*
|
|
588
|
+
* @remarks
|
|
589
|
+
* Supported children components are: {@link MapShapeLayerTooltip}.
|
|
590
|
+
*/
|
|
564
591
|
export declare const MapShapeLayer: React_2.FunctionComponent<MapShapeLayerProps>;
|
|
565
592
|
|
|
566
593
|
/**
|
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: 1747664761,version:"11.0.0-develop.21",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: "11.0.0-develop.
|
|
13
|
+
publishDate: 1747664761,
|
|
14
|
+
version: "11.0.0-develop.21",
|
|
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": "11.0.0-develop.
|
|
3
|
+
"version": "11.0.0-develop.21",
|
|
4
4
|
"description": "KendoReact Map package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
|
-
"@progress/kendo-licensing": "^1.
|
|
30
|
-
"@progress/kendo-react-common": "11.0.0-develop.
|
|
31
|
-
"@progress/kendo-react-popup": "11.0.0-develop.
|
|
29
|
+
"@progress/kendo-licensing": "^1.6.0",
|
|
30
|
+
"@progress/kendo-react-common": "11.0.0-develop.21",
|
|
31
|
+
"@progress/kendo-react-popup": "11.0.0-develop.21",
|
|
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": 1747664761,
|
|
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
|
},
|