@progress/kendo-react-map 6.1.1 → 7.0.0-develop.2

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.
Files changed (208) hide show
  1. package/LICENSE.md +1 -1
  2. package/{dist/es/Map.d.ts → Map.d.ts} +4 -1
  3. package/{dist/npm/MapContext.d.ts → MapContext.d.ts} +4 -0
  4. package/{dist/es/MapProps.d.ts → MapProps.d.ts} +4 -0
  5. package/{dist/es/common → common}/events.d.ts +4 -0
  6. package/common/map-types.d.ts +5 -0
  7. package/{dist/es/components → components}/BubbleLayer.d.ts +4 -0
  8. package/{dist/es/components → components}/BubbleLayerTooltip.d.ts +4 -0
  9. package/components/Layers.d.ts +13 -0
  10. package/{dist/es/components → components}/MarkerLayer.d.ts +4 -0
  11. package/{dist/es/components → components}/MarkerLayerTooltip.d.ts +4 -0
  12. package/{dist/npm/components → components}/ShapeLayer.d.ts +4 -0
  13. package/{dist/npm/components → components}/ShapeLayerTooltip.d.ts +4 -0
  14. package/components/TileLayer.d.ts +13 -0
  15. package/{dist/npm/components → components}/base/CollectionConfigurationComponent.d.ts +4 -0
  16. package/{dist/es/components → components}/base/ConfigurationComponent.d.ts +4 -0
  17. package/components/index.d.ts +13 -0
  18. package/dist/cdn/js/kendo-react-map.js +5 -1
  19. package/events/base-event.d.ts +18 -0
  20. package/{dist/npm/events → events}/before-reset-event.d.ts +4 -0
  21. package/{dist/npm/events → events}/dom-event.d.ts +4 -1
  22. package/{dist/npm/events → events}/map-click-event.d.ts +4 -0
  23. package/events/map-event-builder.d.ts +10 -0
  24. package/{dist/npm/events → events}/marker-activate-event.d.ts +4 -0
  25. package/{dist/npm/events → events}/marker-click-event.d.ts +4 -0
  26. package/{dist/npm/events → events}/marker-created-event.d.ts +4 -0
  27. package/{dist/es/events → events}/pan-end-event.d.ts +4 -0
  28. package/{dist/es/events → events}/pan-event.d.ts +4 -0
  29. package/{dist/es/events → events}/preventable-event.d.ts +4 -0
  30. package/{dist/es/events → events}/reset-event.d.ts +4 -0
  31. package/{dist/npm/events → events}/shape-click-event.d.ts +4 -0
  32. package/{dist/npm/events → events}/shape-created-event.d.ts +4 -0
  33. package/{dist/es/events → events}/shape-feature-created-event.d.ts +4 -0
  34. package/{dist/es/events → events}/shape-mouse-enter-event.d.ts +4 -0
  35. package/{dist/npm/events → events}/shape-mouse-leave-event.d.ts +4 -0
  36. package/{dist/es/events → events}/zoom-end-event.d.ts +4 -0
  37. package/{dist/npm/events → events}/zoom-start-event.d.ts +4 -0
  38. package/index.d.ts +13 -0
  39. package/index.js +5 -0
  40. package/index.mjs +803 -0
  41. package/package-metadata.d.ts +9 -0
  42. package/package.json +29 -40
  43. package/store/reducer.d.ts +14 -0
  44. package/{dist/npm/store → store}/store.d.ts +4 -0
  45. package/{dist/npm/tooltip → tooltip}/BubbleTooltipContext.d.ts +5 -1
  46. package/{dist/npm/tooltip → tooltip}/MapTooltip.d.ts +6 -2
  47. package/{dist/npm/tooltip → tooltip}/MarkerTooltipContext.d.ts +5 -1
  48. package/{dist/es/tooltip → tooltip}/Popup.d.ts +5 -1
  49. package/tooltip/ShapeTooltipContext.d.ts +22 -0
  50. package/tooltip/index.d.ts +9 -0
  51. package/utils/index.d.ts +13 -0
  52. package/about.md +0 -3
  53. package/dist/es/Map.js +0 -469
  54. package/dist/es/MapContext.d.ts +0 -15
  55. package/dist/es/MapContext.js +0 -6
  56. package/dist/es/MapProps.js +0 -1
  57. package/dist/es/common/events.js +0 -16
  58. package/dist/es/common/map-types.d.ts +0 -1
  59. package/dist/es/common/map-types.js +0 -2
  60. package/dist/es/components/BubbleLayer.js +0 -25
  61. package/dist/es/components/BubbleLayerTooltip.js +0 -17
  62. package/dist/es/components/Layers.d.ts +0 -9
  63. package/dist/es/components/Layers.js +0 -21
  64. package/dist/es/components/MarkerLayer.js +0 -25
  65. package/dist/es/components/MarkerLayerTooltip.js +0 -17
  66. package/dist/es/components/ShapeLayer.d.ts +0 -10
  67. package/dist/es/components/ShapeLayer.js +0 -25
  68. package/dist/es/components/ShapeLayerTooltip.d.ts +0 -15
  69. package/dist/es/components/ShapeLayerTooltip.js +0 -17
  70. package/dist/es/components/TileLayer.d.ts +0 -9
  71. package/dist/es/components/TileLayer.js +0 -18
  72. package/dist/es/components/base/CollectionConfigurationComponent.d.ts +0 -19
  73. package/dist/es/components/base/CollectionConfigurationComponent.js +0 -63
  74. package/dist/es/components/base/ConfigurationComponent.js +0 -86
  75. package/dist/es/components/main.d.ts +0 -9
  76. package/dist/es/components/main.js +0 -9
  77. package/dist/es/defaults.d.ts +0 -1
  78. package/dist/es/defaults.js +0 -15
  79. package/dist/es/events/base-event.d.ts +0 -14
  80. package/dist/es/events/base-event.js +0 -13
  81. package/dist/es/events/before-reset-event.d.ts +0 -12
  82. package/dist/es/events/before-reset-event.js +0 -30
  83. package/dist/es/events/dom-event.d.ts +0 -23
  84. package/dist/es/events/dom-event.js +0 -21
  85. package/dist/es/events/map-click-event.d.ts +0 -20
  86. package/dist/es/events/map-click-event.js +0 -33
  87. package/dist/es/events/map-event-builder.d.ts +0 -6
  88. package/dist/es/events/map-event-builder.js +0 -27
  89. package/dist/es/events/marker-activate-event.d.ts +0 -20
  90. package/dist/es/events/marker-activate-event.js +0 -33
  91. package/dist/es/events/marker-click-event.d.ts +0 -20
  92. package/dist/es/events/marker-click-event.js +0 -33
  93. package/dist/es/events/marker-created-event.d.ts +0 -22
  94. package/dist/es/events/marker-created-event.js +0 -35
  95. package/dist/es/events/pan-end-event.js +0 -34
  96. package/dist/es/events/pan-event.js +0 -34
  97. package/dist/es/events/preventable-event.js +0 -46
  98. package/dist/es/events/reset-event.js +0 -32
  99. package/dist/es/events/shape-click-event.d.ts +0 -25
  100. package/dist/es/events/shape-click-event.js +0 -34
  101. package/dist/es/events/shape-created-event.d.ts +0 -29
  102. package/dist/es/events/shape-created-event.js +0 -38
  103. package/dist/es/events/shape-feature-created-event.js +0 -35
  104. package/dist/es/events/shape-mouse-enter-event.js +0 -37
  105. package/dist/es/events/shape-mouse-leave-event.d.ts +0 -28
  106. package/dist/es/events/shape-mouse-leave-event.js +0 -37
  107. package/dist/es/events/zoom-end-event.js +0 -32
  108. package/dist/es/events/zoom-start-event.d.ts +0 -18
  109. package/dist/es/events/zoom-start-event.js +0 -34
  110. package/dist/es/main.d.ts +0 -9
  111. package/dist/es/main.js +0 -8
  112. package/dist/es/package-metadata.d.ts +0 -5
  113. package/dist/es/package-metadata.js +0 -11
  114. package/dist/es/store/reducer.d.ts +0 -10
  115. package/dist/es/store/reducer.js +0 -84
  116. package/dist/es/store/store.d.ts +0 -22
  117. package/dist/es/store/store.js +0 -22
  118. package/dist/es/tooltip/BubbleTooltipContext.d.ts +0 -22
  119. package/dist/es/tooltip/BubbleTooltipContext.js +0 -1
  120. package/dist/es/tooltip/MapTooltip.d.ts +0 -37
  121. package/dist/es/tooltip/MapTooltip.js +0 -123
  122. package/dist/es/tooltip/MarkerTooltipContext.d.ts +0 -22
  123. package/dist/es/tooltip/MarkerTooltipContext.js +0 -1
  124. package/dist/es/tooltip/Popup.js +0 -76
  125. package/dist/es/tooltip/ShapeTooltipContext.d.ts +0 -18
  126. package/dist/es/tooltip/ShapeTooltipContext.js +0 -1
  127. package/dist/es/tooltip/main.d.ts +0 -5
  128. package/dist/es/tooltip/main.js +0 -2
  129. package/dist/es/utils/main.d.ts +0 -10
  130. package/dist/es/utils/main.js +0 -28
  131. package/dist/npm/Map.d.ts +0 -189
  132. package/dist/npm/Map.js +0 -472
  133. package/dist/npm/MapContext.js +0 -9
  134. package/dist/npm/MapProps.d.ts +0 -100
  135. package/dist/npm/MapProps.js +0 -2
  136. package/dist/npm/common/events.d.ts +0 -15
  137. package/dist/npm/common/events.js +0 -34
  138. package/dist/npm/common/map-types.d.ts +0 -1
  139. package/dist/npm/common/map-types.js +0 -7
  140. package/dist/npm/components/BubbleLayer.d.ts +0 -10
  141. package/dist/npm/components/BubbleLayer.js +0 -28
  142. package/dist/npm/components/BubbleLayerTooltip.d.ts +0 -15
  143. package/dist/npm/components/BubbleLayerTooltip.js +0 -20
  144. package/dist/npm/components/Layers.d.ts +0 -9
  145. package/dist/npm/components/Layers.js +0 -24
  146. package/dist/npm/components/MarkerLayer.d.ts +0 -10
  147. package/dist/npm/components/MarkerLayer.js +0 -28
  148. package/dist/npm/components/MarkerLayerTooltip.d.ts +0 -15
  149. package/dist/npm/components/MarkerLayerTooltip.js +0 -20
  150. package/dist/npm/components/ShapeLayer.js +0 -28
  151. package/dist/npm/components/ShapeLayerTooltip.js +0 -20
  152. package/dist/npm/components/TileLayer.d.ts +0 -9
  153. package/dist/npm/components/TileLayer.js +0 -21
  154. package/dist/npm/components/base/CollectionConfigurationComponent.js +0 -65
  155. package/dist/npm/components/base/ConfigurationComponent.d.ts +0 -24
  156. package/dist/npm/components/base/ConfigurationComponent.js +0 -88
  157. package/dist/npm/components/main.d.ts +0 -9
  158. package/dist/npm/components/main.js +0 -19
  159. package/dist/npm/defaults.d.ts +0 -1
  160. package/dist/npm/defaults.js +0 -17
  161. package/dist/npm/events/base-event.d.ts +0 -14
  162. package/dist/npm/events/base-event.js +0 -16
  163. package/dist/npm/events/before-reset-event.js +0 -33
  164. package/dist/npm/events/dom-event.js +0 -24
  165. package/dist/npm/events/map-click-event.js +0 -36
  166. package/dist/npm/events/map-event-builder.d.ts +0 -6
  167. package/dist/npm/events/map-event-builder.js +0 -30
  168. package/dist/npm/events/marker-activate-event.js +0 -36
  169. package/dist/npm/events/marker-click-event.js +0 -36
  170. package/dist/npm/events/marker-created-event.js +0 -38
  171. package/dist/npm/events/pan-end-event.d.ts +0 -24
  172. package/dist/npm/events/pan-end-event.js +0 -37
  173. package/dist/npm/events/pan-event.d.ts +0 -24
  174. package/dist/npm/events/pan-event.js +0 -37
  175. package/dist/npm/events/preventable-event.d.ts +0 -18
  176. package/dist/npm/events/preventable-event.js +0 -49
  177. package/dist/npm/events/reset-event.d.ts +0 -14
  178. package/dist/npm/events/reset-event.js +0 -35
  179. package/dist/npm/events/shape-click-event.js +0 -37
  180. package/dist/npm/events/shape-created-event.js +0 -41
  181. package/dist/npm/events/shape-feature-created-event.d.ts +0 -29
  182. package/dist/npm/events/shape-feature-created-event.js +0 -38
  183. package/dist/npm/events/shape-mouse-enter-event.d.ts +0 -28
  184. package/dist/npm/events/shape-mouse-enter-event.js +0 -40
  185. package/dist/npm/events/shape-mouse-leave-event.js +0 -40
  186. package/dist/npm/events/zoom-end-event.d.ts +0 -16
  187. package/dist/npm/events/zoom-end-event.js +0 -35
  188. package/dist/npm/events/zoom-start-event.js +0 -37
  189. package/dist/npm/main.d.ts +0 -9
  190. package/dist/npm/main.js +0 -27
  191. package/dist/npm/package-metadata.d.ts +0 -5
  192. package/dist/npm/package-metadata.js +0 -14
  193. package/dist/npm/store/reducer.d.ts +0 -10
  194. package/dist/npm/store/reducer.js +0 -88
  195. package/dist/npm/store/store.js +0 -24
  196. package/dist/npm/tooltip/BubbleTooltipContext.js +0 -2
  197. package/dist/npm/tooltip/MapTooltip.js +0 -126
  198. package/dist/npm/tooltip/MarkerTooltipContext.js +0 -2
  199. package/dist/npm/tooltip/Popup.d.ts +0 -29
  200. package/dist/npm/tooltip/Popup.js +0 -79
  201. package/dist/npm/tooltip/ShapeTooltipContext.d.ts +0 -18
  202. package/dist/npm/tooltip/ShapeTooltipContext.js +0 -2
  203. package/dist/npm/tooltip/main.d.ts +0 -5
  204. package/dist/npm/tooltip/main.js +0 -5
  205. package/dist/npm/utils/main.d.ts +0 -10
  206. package/dist/npm/utils/main.js +0 -32
  207. package/dist/systemjs/kendo-react-map.js +0 -1
  208. package/e2e-next/basic.tests.ts +0 -24
package/index.mjs ADDED
@@ -0,0 +1,803 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as i from "react";
6
+ import { canUseDOM as A, validatePackage as _, IconsContext as D } from "@progress/kendo-react-common";
7
+ import * as C from "prop-types";
8
+ import { InstanceObserver as m, Map as N } from "@progress/kendo-charts";
9
+ import { Extent as ke, Location as Le } from "@progress/kendo-charts";
10
+ import { Popup as U } from "@progress/kendo-react-popup";
11
+ import { mapMarkerTargetIcon as K, mapMarkerIcon as R, plusIcon as z, minusIcon as j, caretAltUpIcon as V, caretAltDownIcon as B, caretAltLeftIcon as $, caretAltRightIcon as F } from "@progress/kendo-svg-icons";
12
+ const u = i.createContext(null);
13
+ u.displayName = "MapContext";
14
+ class b extends i.Component {
15
+ constructor(e, t) {
16
+ super(e, t), this.optionsStore = t.optionsStore;
17
+ }
18
+ renderChildren(e, t) {
19
+ const { children: s } = e.props, { _mapKey: r, _parentStore: a } = this.props, o = {
20
+ ...e.props,
21
+ _mapCollectionIdxKey: `${r}_${t}`,
22
+ _parentStore: a
23
+ };
24
+ return i.cloneElement(e, o, s);
25
+ }
26
+ render() {
27
+ const { _mapKey: e, _parentStore: t, children: s } = this.props;
28
+ return (t || this.optionsStore).dispatch({
29
+ mapKey: e,
30
+ payload: []
31
+ }), i.Children.map(s, (a, o) => i.isValidElement(a) ? this.renderChildren(a, o) : a);
32
+ }
33
+ }
34
+ b.contextType = u;
35
+ const W = (n) => {
36
+ let e, t = [];
37
+ const s = () => e, r = (o) => {
38
+ e = n(e, o), A && t.forEach((p) => p());
39
+ }, a = (o) => (t.push(o), () => t = t.filter((p) => p !== o));
40
+ return r({}), { getState: s, dispatch: r, subscribe: a };
41
+ }, y = W, M = (n, e) => e.mapCollectionIdxKey ? g.collectionConfigurationItem(n, e) : e.mapKey ? g.configurationItem(n, e) : {}, Z = (n, e) => {
42
+ if (e.type)
43
+ switch (e.type) {
44
+ case "add":
45
+ return [...n, e.payload];
46
+ case "remove":
47
+ return n.filter((t) => t !== e.payload);
48
+ default:
49
+ return n;
50
+ }
51
+ else
52
+ return [];
53
+ }, g = {
54
+ configurationItem(n, e) {
55
+ return Object.assign(n, {
56
+ [e.mapKey]: e.payload
57
+ });
58
+ },
59
+ collectionConfigurationItem(n, e) {
60
+ let t = !1;
61
+ const [s, r] = e.mapCollectionIdxKey.split("_"), a = n[s].map((o, p) => parseInt(r, 10) === p ? (t = !0, e.payload) : o);
62
+ return t === !1 && a.splice(parseInt(r, 10), 0, e.payload), Object.assign(n, {
63
+ [s]: a
64
+ });
65
+ },
66
+ themeItem(n, e) {
67
+ let t = {}, s = Object.assign(t, n);
68
+ const { field: r, value: a } = e.payload, o = r.split(".");
69
+ let p = o.shift();
70
+ for (; o.length > 0; )
71
+ t = t[p] = t[p] || {}, p = o.shift();
72
+ return t[p] = a, s;
73
+ }
74
+ };
75
+ class h extends i.Component {
76
+ constructor(e, t) {
77
+ super(e, t), this.optionsStore = t.optionsStore, this.childStore = y(M);
78
+ }
79
+ render() {
80
+ const { children: e } = this.props;
81
+ return e !== void 0 ? i.Children.map(e, (t) => i.isValidElement(t) ? this.renderChildren(t) : t) : null;
82
+ }
83
+ componentDidMount() {
84
+ this.dispatch();
85
+ }
86
+ componentDidUpdate() {
87
+ this.dispatch();
88
+ }
89
+ dispatch() {
90
+ const { _mapKey: e, _mapCollectionIdxKey: t, _parentStore: s, children: r, ...a } = this.props;
91
+ (s || this.optionsStore).dispatch({
92
+ mapKey: e,
93
+ mapCollectionIdxKey: t,
94
+ payload: Object.assign({}, a, this.childStore.getState())
95
+ });
96
+ }
97
+ renderChildren(e) {
98
+ const { children: t } = e.props, s = {
99
+ ...e.props,
100
+ _parentStore: this.childStore
101
+ };
102
+ return i.cloneElement(e, s, t);
103
+ }
104
+ }
105
+ h.contextType = u;
106
+ class c {
107
+ /**
108
+ * @hidden
109
+ */
110
+ constructor(e) {
111
+ this.target = e;
112
+ }
113
+ }
114
+ class H extends c {
115
+ /**
116
+ * @hidden
117
+ */
118
+ constructor(e, t) {
119
+ super(t);
120
+ }
121
+ }
122
+ class q extends c {
123
+ /**
124
+ * @hidden
125
+ */
126
+ constructor(e, t) {
127
+ super(t), this.location = e.location, this.originalEvent = e.originalEvent;
128
+ }
129
+ }
130
+ class G extends c {
131
+ /**
132
+ * @hidden
133
+ */
134
+ constructor(e, t) {
135
+ super(t), this.marker = e.marker, this.layer = e.layer;
136
+ }
137
+ }
138
+ class J extends c {
139
+ /**
140
+ * @hidden
141
+ */
142
+ constructor(e, t) {
143
+ super(t), this.marker = e.marker, this.layer = e.layer;
144
+ }
145
+ }
146
+ class x extends c {
147
+ constructor() {
148
+ super(...arguments), this.prevented = !1;
149
+ }
150
+ /* eslint-disable max-len */
151
+ /**
152
+ * Prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
153
+ */
154
+ preventDefault() {
155
+ this.prevented = !0;
156
+ }
157
+ /**
158
+ * Returns `true` if the event was prevented by any of its subscribers.
159
+ *
160
+ * @returns `true` if the default action was prevented.
161
+ * Otherwise, returns `false`.
162
+ */
163
+ isDefaultPrevented() {
164
+ return this.prevented;
165
+ }
166
+ }
167
+ class Q extends x {
168
+ /**
169
+ * @hidden
170
+ */
171
+ constructor(e, t) {
172
+ super(t), this.marker = e.marker, this.layer = e.layer;
173
+ }
174
+ }
175
+ class X extends c {
176
+ /**
177
+ * @hidden
178
+ */
179
+ constructor(e, t) {
180
+ super(t), this.origin = e.origin, this.center = e.center, this.originalEvent = e.originalEvent;
181
+ }
182
+ }
183
+ class Y extends c {
184
+ /**
185
+ * @hidden
186
+ */
187
+ constructor(e, t) {
188
+ super(t), this.origin = e.origin, this.center = e.center, this.originalEvent = e.originalEvent;
189
+ }
190
+ }
191
+ class ee extends c {
192
+ /**
193
+ * @hidden
194
+ */
195
+ constructor(e, t) {
196
+ super(t);
197
+ }
198
+ }
199
+ class te extends c {
200
+ /**
201
+ * @hidden
202
+ */
203
+ constructor(e, t) {
204
+ super(t), this.layer = e.layer, this.shape = e.shape, this.originalEvent = e.originalEvent;
205
+ }
206
+ }
207
+ class ne extends c {
208
+ /**
209
+ * @hidden
210
+ */
211
+ constructor(e, t) {
212
+ 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);
213
+ }
214
+ }
215
+ class se extends c {
216
+ /**
217
+ * @hidden
218
+ */
219
+ constructor(e, t) {
220
+ super(t), this.dataItem = e.dataItem, this.layer = e.layer, this.group = e.group, this.properties = e.properties;
221
+ }
222
+ }
223
+ class re extends c {
224
+ /**
225
+ * @hidden
226
+ */
227
+ constructor(e, t) {
228
+ super(t), this.layer = e.layer, this.shape = e.shape, this.originalEvent = e.originalEvent;
229
+ }
230
+ }
231
+ class oe extends c {
232
+ /**
233
+ * @hidden
234
+ */
235
+ constructor(e, t) {
236
+ super(t), this.layer = e.layer, this.shape = e.shape, this.originalEvent = e.originalEvent;
237
+ }
238
+ }
239
+ class ae extends c {
240
+ /**
241
+ * @hidden
242
+ */
243
+ constructor(e, t) {
244
+ super(t), this.originalEvent = e.originalEvent;
245
+ }
246
+ }
247
+ class ie extends x {
248
+ /**
249
+ * @hidden
250
+ */
251
+ constructor(e, t) {
252
+ super(t), this.originalEvent = e.originalEvent;
253
+ }
254
+ }
255
+ const I = {
256
+ beforeReset: H,
257
+ mapClick: q,
258
+ markerActivate: G,
259
+ markerClick: J,
260
+ markerCreated: Q,
261
+ panEnd: X,
262
+ pan: Y,
263
+ reset: ee,
264
+ shapeClick: te,
265
+ shapeCreated: ne,
266
+ shapeFeatureCreated: se,
267
+ shapeMouseEnter: re,
268
+ shapeMouseLeave: oe,
269
+ zoomEnd: ae,
270
+ zoomStart: ie
271
+ };
272
+ function pe(n, e, t) {
273
+ if (I[n])
274
+ return new I[n](e, t);
275
+ }
276
+ function ce(n, e) {
277
+ let t = n;
278
+ for (; t && t !== e; )
279
+ t = t.parentNode;
280
+ return !!t;
281
+ }
282
+ function f(n, e, t, s) {
283
+ const r = n[e];
284
+ if (r && Array.isArray(r)) {
285
+ for (let a of r)
286
+ if (!a.type || a.type !== s)
287
+ return new Error(
288
+ `${t} children should be Array of type ${s.displayName}.`
289
+ );
290
+ }
291
+ return null;
292
+ }
293
+ const le = { horizontal: "fit", vertical: "fit" }, he = ["k-tooltip", "k-map-tooltip"], ue = "k-tooltip-wrapper";
294
+ class T extends i.Component {
295
+ constructor(e, t) {
296
+ super(e, t), this.context = null, this.element = null, this.onMapMouseLeave = (s) => {
297
+ const { syntheticEvent: r } = s;
298
+ return !!ce(r.relatedTarget, this.element);
299
+ }, this.mapObserver = new m(this, {
300
+ onMouseLeave: "onMapMouseLeave"
301
+ }), t.observersStore.dispatch({
302
+ type: "add",
303
+ payload: this.mapObserver
304
+ });
305
+ }
306
+ render() {
307
+ const { popupShown: e, popupAlign: t, popupOffset: s, popupStyles: r, popupContent: a, className: o } = this.props, p = [...he, o].join(" ").trim();
308
+ return /* @__PURE__ */ i.createElement(
309
+ U,
310
+ {
311
+ animate: !0,
312
+ popupAlign: t,
313
+ offset: s,
314
+ show: e,
315
+ collision: le,
316
+ className: ue
317
+ },
318
+ /* @__PURE__ */ i.createElement(
319
+ "div",
320
+ {
321
+ className: p,
322
+ style: r,
323
+ ref: (d) => this.element = d
324
+ },
325
+ a()
326
+ )
327
+ );
328
+ }
329
+ componentWillUnmount() {
330
+ this.context.observersStore.dispatch({
331
+ type: "remove",
332
+ payload: this.mapObserver
333
+ });
334
+ }
335
+ }
336
+ T.contextType = u;
337
+ class k extends i.Component {
338
+ constructor() {
339
+ super(...arguments), this.context = null, this.state = {
340
+ popupShown: !1
341
+ };
342
+ }
343
+ componentDidMount() {
344
+ this.mapObserver = new m(this, {
345
+ showTooltip: "onShowTooltip",
346
+ hideTooltip: "onHideTooltip"
347
+ }), this.context.observersStore.dispatch({
348
+ type: "add",
349
+ payload: this.mapObserver
350
+ });
351
+ }
352
+ render() {
353
+ const { popupContext: e, shared: t, className: s, ...r } = this.state;
354
+ if (!e || !this.state.popupShown)
355
+ return null;
356
+ const a = e.layerIndex, o = this.findRenderFunctionByLayer(a);
357
+ if (!o)
358
+ return null;
359
+ const p = () => /* @__PURE__ */ i.createElement("div", { className: "k-tooltip-content" }, o(e)), l = `k-map-${e.type}-tooltip`;
360
+ return /* @__PURE__ */ i.createElement(
361
+ T,
362
+ {
363
+ ...r,
364
+ popupContent: p,
365
+ className: l
366
+ }
367
+ );
368
+ }
369
+ componentWillUnmount() {
370
+ this.context.observersStore.dispatch({
371
+ type: "remove",
372
+ payload: this.mapObserver
373
+ });
374
+ }
375
+ onShowTooltip(e) {
376
+ const { anchor: t, className: s } = e;
377
+ let r = this.createTooltipContext(e);
378
+ this.setState({
379
+ popupShown: !0,
380
+ popupAlign: { vertical: "bottom", horizontal: "center" },
381
+ popupOffset: t,
382
+ popupContext: r,
383
+ popupStyles: { position: "relative" },
384
+ className: s
385
+ });
386
+ }
387
+ onHideTooltip() {
388
+ this.setState({
389
+ popupShown: !1,
390
+ popupStyles: {},
391
+ className: void 0
392
+ });
393
+ }
394
+ createTooltipContext(e) {
395
+ return e;
396
+ }
397
+ findRenderFunctionByLayer(e) {
398
+ const t = this.context.optionsStore.getState().layers;
399
+ return t !== void 0 && Array.isArray(t) && t[e] !== void 0 && t[e].hasOwnProperty("tooltip") && t[e].tooltip.hasOwnProperty("render") ? t[e].tooltip.render : null;
400
+ }
401
+ }
402
+ k.contextType = u;
403
+ const me = {
404
+ name: "@progress/kendo-react-map",
405
+ productName: "KendoReact",
406
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
407
+ publishDate: 1700573632,
408
+ version: "",
409
+ 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"
410
+ };
411
+ class de {
412
+ /**
413
+ * @hidden
414
+ */
415
+ constructor(e, t) {
416
+ this.sender = e, this.syntheticEvent = t;
417
+ }
418
+ }
419
+ function ve(n, e) {
420
+ return new de(n, e);
421
+ }
422
+ const E = {
423
+ mapMarkerTargetIcon: K,
424
+ mapMarkerIcon: R,
425
+ plusIcon: z,
426
+ minusIcon: j,
427
+ caretAltUpIcon: V,
428
+ caretAltDownIcon: B,
429
+ caretAltLeftIcon: $,
430
+ caretAltRightIcon: F
431
+ }, S = "svg";
432
+ class L extends i.Component {
433
+ constructor(e) {
434
+ super(e), this.mapInstance = null, this._element = null, this.optionsStore = {}, this.optionsUnsubscriber = Function.prototype, this.observersStore = {}, this.iconsType = S, this.svgIcons = E, this.onInit = (t) => {
435
+ this.mapInstance = t.sender;
436
+ }, this.onRender = (t) => {
437
+ this.mapInstance !== null && this.trigger("render", t);
438
+ }, this.onMapMouseLeave = (t) => {
439
+ const s = ve(this, t);
440
+ this.triggerDomEvent("onMouseLeave", s) ? t.preventDefault() : this.mapInstance !== null && this.mapInstance.hideTooltip();
441
+ }, _(me), this.optionsStore = y(M), this.observersStore = y(Z), this.childrenObserver = new m(this, { onMouseLeave: "onChildMouseLeave" }), this.contextValue = {
442
+ optionsStore: this.optionsStore,
443
+ observersStore: this.observersStore,
444
+ childrenObserver: this.childrenObserver
445
+ }, this.mapObserver = new m(this, {
446
+ // render: 'onRender',
447
+ init: "onInit"
448
+ });
449
+ }
450
+ /**
451
+ * @hidden
452
+ */
453
+ get element() {
454
+ return this._element;
455
+ }
456
+ /**
457
+ * @hidden
458
+ */
459
+ componentDidMount() {
460
+ this.instantiateCoreMap(), this.optionsUnsubscriber = this.optionsStore.subscribe(this.refresh.bind(this));
461
+ }
462
+ /**
463
+ * @hidden
464
+ */
465
+ componentWillUnmount() {
466
+ this.optionsUnsubscriber(), this.mapInstance !== null && (this.mapInstance.destroy(), this.mapInstance = null);
467
+ }
468
+ /**
469
+ * @hidden
470
+ */
471
+ componentDidUpdate(e) {
472
+ const { dir: t, children: s, ...r } = this.props;
473
+ this.mapInstance !== null && (Object.entries(e).filter((o) => o[0] !== "dir" && o[0] !== "children").some((o) => {
474
+ const [p, l] = o;
475
+ return !(r.hasOwnProperty(p) && r[p] === l);
476
+ }) && this.refresh(), e.dir);
477
+ }
478
+ /**
479
+ * @hidden
480
+ */
481
+ render() {
482
+ const { style: e = {}, className: t, children: s } = this.props, r = Object.assign({}, e, { position: "relative" }), a = i.createElement(
483
+ "div",
484
+ {
485
+ className: t,
486
+ style: r,
487
+ key: "mapElement"
488
+ },
489
+ /* @__PURE__ */ i.createElement(
490
+ "div",
491
+ {
492
+ ref: (o) => this._element = o,
493
+ className: "k-map",
494
+ onMouseLeave: this.onMapMouseLeave
495
+ },
496
+ s
497
+ )
498
+ );
499
+ return /* @__PURE__ */ i.createElement(D.Consumer, null, (o) => /* @__PURE__ */ i.createElement(u.Provider, { value: this.contextValue }, /* @__PURE__ */ i.createElement(k, { key: "tooltip" }), a, this.setIcons(o)));
500
+ }
501
+ /**
502
+ * @hidden
503
+ */
504
+ getMapOptions() {
505
+ const {
506
+ center: e,
507
+ controls: t,
508
+ minZoom: s,
509
+ maxZoom: r,
510
+ minSize: a,
511
+ pannable: o,
512
+ wraparound: p,
513
+ zoom: l,
514
+ zoomable: d
515
+ } = this.props;
516
+ let v = {
517
+ center: e,
518
+ controls: t,
519
+ minZoom: s,
520
+ maxZoom: r,
521
+ minSize: a,
522
+ pannable: o,
523
+ wraparound: p,
524
+ zoom: l,
525
+ zoomable: d,
526
+ icons: {
527
+ type: this.iconsType,
528
+ svgIcons: this.svgIcons
529
+ }
530
+ };
531
+ return v = Object.assign(v, this.optionsStore.getState()), v;
532
+ }
533
+ /**
534
+ * The marker layers instances.
535
+ */
536
+ get layers() {
537
+ var e;
538
+ return (e = this.mapInstance) == null ? void 0 : e.layers;
539
+ }
540
+ /**
541
+ * Gets the extent (visible area) of the map.
542
+ */
543
+ get extent() {
544
+ var e;
545
+ return (e = this.mapInstance) == null ? void 0 : e.extent();
546
+ }
547
+ /**
548
+ * Sets the extent (visible area) of the map.
549
+ */
550
+ set extent(e) {
551
+ var t;
552
+ (t = this.mapInstance) == null || t.extent(e);
553
+ }
554
+ /**
555
+ * Detects the size of the container and redraws the Map.
556
+ * Resizing is automatic unless you set the `resizeRateLimit` option to `0`.
557
+ */
558
+ resize() {
559
+ }
560
+ /**
561
+ * Retrieves the size of the visible portion of the map.
562
+ *
563
+ * @returns The size (width and height) of the visible portion of the map.
564
+ */
565
+ viewSize() {
566
+ var e;
567
+ return (e = this.mapInstance) == null ? void 0 : e.viewSize();
568
+ }
569
+ /**
570
+ * Returns the event coordinates relative to the map element. Offset coordinates are not synchronized to a particular location on the map.
571
+ *
572
+ * @param e The mouse event.
573
+ * @returns The event coordinates relative to the map element.
574
+ */
575
+ eventOffset(e) {
576
+ var t;
577
+ return (t = this.mapInstance) == null ? void 0 : t.eventOffset(e);
578
+ }
579
+ /**
580
+ * Retrieves projected (layer) coordinates that correspond to this mouse event.
581
+ * Layer coordinates are absolute and change only when the zoom level is changed.
582
+ *
583
+ * @param e The mouse event.
584
+ * @returns The projected (layer) coordinates that correspond to this event.
585
+ */
586
+ eventToLayer(e) {
587
+ var t;
588
+ return (t = this.mapInstance) == null ? void 0 : t.eventToLayer(e);
589
+ }
590
+ /**
591
+ * Retrieves the geographic location that correspond to this mouse event.
592
+ *
593
+ * @param e The mouse event.
594
+ * @returns The geographic location that correspond to this mouse event.
595
+ */
596
+ eventToLocation(e) {
597
+ var t;
598
+ return (t = this.mapInstance) == null ? void 0 : t.eventToLocation(e);
599
+ }
600
+ /**
601
+ * Retrieves relative (view) coordinates that correspond to this mouse event.
602
+ * Layer elements positioned on these coordinates will appear under the mouse cursor.
603
+ * View coordinates are no longer valid after a map reset.
604
+ *
605
+ * @param e The mouse event.
606
+ * @returns The relative (view) coordinates that correspond to this mouse event.
607
+ */
608
+ eventToView(e) {
609
+ var t;
610
+ return (t = this.mapInstance) == null ? void 0 : t.eventToView(e);
611
+ }
612
+ /**
613
+ * Transforms layer (projected) coordinates to geographical location.
614
+ *
615
+ * @param point The layer (projected) coordinates. An array argument is assumed to be in x, y order.
616
+ * @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
617
+ * @returns The geographic location that corresponds to the layer coordinates.
618
+ */
619
+ layerToLocation(e, t) {
620
+ var s;
621
+ return (s = this.mapInstance) == null ? void 0 : s.layerToLocation(e, t);
622
+ }
623
+ /**
624
+ * Returns the layer (projected) coordinates that correspond to a geographical location.
625
+ *
626
+ * @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
627
+ * @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
628
+ * @returns The layer (projected) coordinates.
629
+ */
630
+ locationToLayer(e, t) {
631
+ var s;
632
+ return (s = this.mapInstance) == null ? void 0 : s.locationToLayer(e, t);
633
+ }
634
+ /**
635
+ * Returns the view (relative) coordinates that correspond to a geographical location.
636
+ *
637
+ * @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
638
+ * @returns The view coordinates that correspond to a geographical location.
639
+ */
640
+ locationToView(e) {
641
+ var t;
642
+ return (t = this.mapInstance) == null ? void 0 : t.locationToView(e);
643
+ }
644
+ /**
645
+ * Returns the geographical location that correspond to the view (relative) coordinates.
646
+ *
647
+ * @param point The view coordinates. An array argument is assumed to be in x, y order.
648
+ * @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
649
+ * @returns The geographic location that corresponds to the view coordinates.
650
+ */
651
+ viewToLocation(e, t) {
652
+ var s;
653
+ return (s = this.mapInstance) == null ? void 0 : s.viewToLocation(e, t);
654
+ }
655
+ /**
656
+ * Load markers in the Map. This method will clear the current markers and show the new ones.
657
+ *
658
+ * @param newMarkers An array of markers.
659
+ */
660
+ loadMarkers(e) {
661
+ const t = this.mapInstance.markers;
662
+ t && t._load(e);
663
+ }
664
+ /**
665
+ * @hidden
666
+ */
667
+ refresh() {
668
+ if (this.mapInstance !== null) {
669
+ const e = this.getMapOptions();
670
+ this.props.onRefresh ? this.props.onRefresh.call(void 0, e, this.mapInstance) : this.mapInstance.setOptions(e);
671
+ }
672
+ }
673
+ /**
674
+ * @hidden
675
+ */
676
+ instantiateCoreMap() {
677
+ const e = this.getMapOptions();
678
+ this.mapInstance = new N(
679
+ this.element,
680
+ e,
681
+ {},
682
+ {
683
+ // rtl: this.getDirection(dir),
684
+ observer: this.mapObserver,
685
+ sender: this
686
+ }
687
+ );
688
+ }
689
+ /* Triggers public dom event handlers */
690
+ /**
691
+ * @hidden
692
+ */
693
+ trigger(e, t) {
694
+ const s = e === "click" ? "mapClick" : e, r = pe(s, t, this), a = "on" + s.charAt(0).toUpperCase() + s.slice(1), o = this.observersStore.getState();
695
+ let p = !1;
696
+ for (let l = 0; l < o.length; l++)
697
+ o[l].trigger(s, t) && (p = !0);
698
+ return p === !1 && r && this.props.hasOwnProperty(a) ? (this.props[a].call(void 0, r), r.isDefaultPrevented && r.isDefaultPrevented()) : p;
699
+ }
700
+ /* Used by (event)InstanceObserver to check the wrapper for supported events */
701
+ /**
702
+ * @hidden
703
+ */
704
+ requiresHandlers(e) {
705
+ for (let t = 0; t < e.length; t++) {
706
+ const s = e[t], r = "on" + s.charAt(0).toUpperCase() + s.slice(1);
707
+ if (this.props.hasOwnProperty(r))
708
+ return !0;
709
+ }
710
+ return !1;
711
+ }
712
+ /**
713
+ * @hidden
714
+ */
715
+ triggerDomEvent(e, t) {
716
+ const s = this.observersStore.getState();
717
+ let r = !1;
718
+ for (let a = 0; a < s.length; a++)
719
+ s[a].trigger(e, t) && (r = !0);
720
+ return r;
721
+ }
722
+ setIcons(e) {
723
+ const { type: t, icons: s = {} } = e, r = { ...E }, a = {
724
+ mapMarkerTargetIcon: s.mapMarkerTargetIcon,
725
+ mapMarkerIcon: s.mapMarkerIcon,
726
+ plusIcon: s.plusIcon,
727
+ minusIcon: s.minusIcon,
728
+ caretAltUpIcon: s.caretAltUpIcon,
729
+ caretAltDownIcon: s.caretAltDownIcon,
730
+ caretAltLeftIcon: s.caretAltLeftIcon,
731
+ caretAltRightIcon: s.caretAltRightIcon
732
+ };
733
+ let o;
734
+ for (o in a)
735
+ if (a[o]) {
736
+ const p = a[o];
737
+ p && typeof p != "string" && (r[o] = p);
738
+ }
739
+ return this.svgIcons = r, this.iconsType = t || S, null;
740
+ }
741
+ }
742
+ L.propTypes = {
743
+ dir: C.string
744
+ };
745
+ L.defaultProps = {};
746
+ const ye = (n) => /* @__PURE__ */ i.createElement(b, { ...n, _mapKey: "layers" });
747
+ ye.propTypes = {
748
+ children: C.node
749
+ };
750
+ const fe = (n) => /* @__PURE__ */ i.createElement(h, { ...n, _mapKey: "tooltip" }), O = (n) => /* @__PURE__ */ i.createElement(h, { type: "shape", ...n });
751
+ O.displayName = "MapShapeLayer";
752
+ O.propTypes = {
753
+ children: function(n, e, t) {
754
+ return f(n, e, t, fe);
755
+ }
756
+ };
757
+ const ge = (n) => /* @__PURE__ */ i.createElement(h, { type: "tile", ...n });
758
+ ge.displayName = "MapTileLayer";
759
+ const Ie = (n) => /* @__PURE__ */ i.createElement(h, { ...n, _mapKey: "tooltip" }), w = (n) => /* @__PURE__ */ i.createElement(h, { type: "bubble", ...n });
760
+ w.displayName = "MapBubbleLayer";
761
+ w.propTypes = {
762
+ children: function(n, e, t) {
763
+ return f(n, e, t, Ie);
764
+ }
765
+ };
766
+ const Ee = (n) => /* @__PURE__ */ i.createElement(h, { ...n, _mapKey: "tooltip" }), P = (n) => /* @__PURE__ */ i.createElement(h, { type: "marker", ...n });
767
+ P.displayName = "MapMarkerLayer";
768
+ P.propTypes = {
769
+ children: function(n, e, t) {
770
+ return f(n, e, t, Ee);
771
+ }
772
+ };
773
+ export {
774
+ H as BeforeResetEvent,
775
+ b as CollectionConfigurationComponent,
776
+ h as ConfigurationComponent,
777
+ ke as Extent,
778
+ Le as Location,
779
+ L as Map,
780
+ w as MapBubbleLayer,
781
+ Ie as MapBubbleLayerTooltip,
782
+ q as MapClickEvent,
783
+ ye as MapLayers,
784
+ P as MapMarkerLayer,
785
+ Ee as MapMarkerLayerTooltip,
786
+ O as MapShapeLayer,
787
+ fe as MapShapeLayerTooltip,
788
+ ge as MapTileLayer,
789
+ k as MapTooltip,
790
+ G as MarkerActivateEvent,
791
+ J as MarkerClickEvent,
792
+ Q as MarkerCreatedEvent,
793
+ X as PanEndEvent,
794
+ Y as PanEvent,
795
+ ee as ResetEvent,
796
+ te as ShapeClickEvent,
797
+ ne as ShapeCreatedEvent,
798
+ se as ShapeFeatureCreatedEvent,
799
+ re as ShapeMouseEnterEvent,
800
+ oe as ShapeMouseLeaveEvent,
801
+ ae as ZoomEndEvent,
802
+ ie as ZoomStartEvent
803
+ };