@hybridcore/ui 1.6.26 → 1.6.28

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.
@@ -0,0 +1,260 @@
1
+ import { styled as a, List as u, ButtonBase as L, alpha as g, Typography as l, Box as f } from "@mui/material";
2
+ import { resolvePaletteColor as s } from "../metric-card/helpers.js";
3
+ import { Widget as p } from "../widget/styled.js";
4
+ const e = {
5
+ shouldForwardProp: (t) => t !== "ownerState"
6
+ }, m = a(p.Root, {
7
+ name: "HCDataList",
8
+ slot: "Root",
9
+ ...e
10
+ })(() => ({
11
+ overflow: "hidden"
12
+ })), C = a(p.Header, {
13
+ name: "HCDataList",
14
+ slot: "Header",
15
+ ...e
16
+ })(({ theme: t, ownerState: o }) => ({
17
+ display: "flex",
18
+ alignItems: "center",
19
+ justifyContent: "space-between",
20
+ gap: t.spacing(2),
21
+ padding: t.spacing(1.75, 2),
22
+ // Separates the header from the first row, as the dashboard cards are drawn. Same
23
+ // rule the rows use between themselves, so the whole card reads as one ruled list.
24
+ borderBottom: `1px solid ${t.palette.divider}`,
25
+ // Clears the widget store's floating menu trigger (absolute, top/right 8px) and
26
+ // the error badge that parks beside it, so neither lands on the header content.
27
+ ...o.headerGutter && {
28
+ paddingRight: typeof o.headerGutter == "number" ? o.headerGutter : 44
29
+ }
30
+ })), y = ({ theme: t }) => ({
31
+ ...t.typography.body2,
32
+ color: t.palette.primary.main,
33
+ fontWeight: 500,
34
+ background: "none",
35
+ border: "none",
36
+ cursor: "pointer",
37
+ textDecoration: "none",
38
+ borderRadius: t.shape.borderRadius,
39
+ padding: t.spacing(0.25, 0.5),
40
+ flex: "0 0 auto",
41
+ "&:hover": {
42
+ textDecoration: "underline"
43
+ }
44
+ }), H = a("button", {
45
+ name: "HCDataList",
46
+ slot: "HeaderAction"
47
+ })(y), I = a("a", {
48
+ name: "HCDataList",
49
+ slot: "HeaderAction"
50
+ })(y), w = a(p.Content, {
51
+ name: "HCDataList",
52
+ slot: "Content",
53
+ ...e
54
+ })(() => ({
55
+ overflow: "hidden"
56
+ })), v = a(u, {
57
+ name: "HCDataList",
58
+ slot: "List",
59
+ ...e
60
+ })(() => ({
61
+ flex: 1,
62
+ overflowY: "auto",
63
+ padding: 0
64
+ })), h = a("li", {
65
+ name: "HCDataList",
66
+ slot: "Item",
67
+ ...e
68
+ })(({ theme: t, ownerState: o }) => ({
69
+ display: "flex",
70
+ alignItems: "center",
71
+ gap: t.spacing(1.5),
72
+ padding: t.spacing(o.dense ? 1 : 1.5, 2),
73
+ listStyle: "none",
74
+ ...o.divider && {
75
+ "& + &": {
76
+ borderTop: `1px solid ${t.palette.divider}`
77
+ }
78
+ }
79
+ })), B = a(L, {
80
+ name: "HCDataList",
81
+ slot: "ItemButton"
82
+ })(({ theme: t }) => ({
83
+ flex: "1 1 auto",
84
+ minWidth: 0,
85
+ display: "flex",
86
+ alignItems: "center",
87
+ gap: t.spacing(1.5),
88
+ justifyContent: "flex-start",
89
+ textAlign: "left",
90
+ borderRadius: t.shape.borderRadius,
91
+ padding: t.spacing(0.5),
92
+ margin: t.spacing(-0.5),
93
+ "&:hover": {
94
+ backgroundColor: t.palette.action.hover
95
+ },
96
+ "&.Mui-disabled": {
97
+ opacity: t.palette.action.disabledOpacity
98
+ }
99
+ })), R = a("span", {
100
+ name: "HCDataList",
101
+ slot: "ItemStart",
102
+ shouldForwardProp: (t) => t !== "ownerState" && t !== "iconColor" && t !== "iconBackground"
103
+ })(({ theme: t, ownerState: o, iconColor: r, iconBackground: d }) => {
104
+ const i = s(t, r) ?? t.palette.text.secondary, n = {
105
+ flex: "0 0 auto",
106
+ display: "inline-flex",
107
+ alignItems: "center",
108
+ justifyContent: "center",
109
+ color: i
110
+ };
111
+ if (o.iconShape === "plain") return n;
112
+ const c = o.dense ? 32 : 40;
113
+ return {
114
+ ...n,
115
+ width: c,
116
+ height: c,
117
+ // The dashboard's alert rows use a solid disc with a light glyph; a state that
118
+ // sets only `color` gets a tint of that color instead of a hard-coded grey.
119
+ backgroundColor: s(t, d) ?? g(i, 0.12),
120
+ borderRadius: o.iconShape === "circle" ? "50%" : t.shape.borderRadius
121
+ };
122
+ }), M = a("span", {
123
+ name: "HCDataList",
124
+ slot: "ItemMain",
125
+ ...e
126
+ })(() => ({
127
+ flex: "1 1 auto",
128
+ minWidth: 0,
129
+ display: "flex",
130
+ flexDirection: "column"
131
+ })), k = a(l, {
132
+ name: "HCDataList",
133
+ slot: "ItemTitle"
134
+ })(({ theme: t }) => ({
135
+ ...t.typography.subtitle2,
136
+ color: t.palette.text.primary,
137
+ // Rows live in a resizable widget grid with no character limit — clip to one line
138
+ // so a long title never reflows the row. Full text on hover.
139
+ whiteSpace: "nowrap",
140
+ overflow: "hidden",
141
+ textOverflow: "ellipsis"
142
+ })), P = a(l, {
143
+ name: "HCDataList",
144
+ slot: "ItemMeta",
145
+ ...e
146
+ })(({ theme: t, ownerState: o }) => ({
147
+ ...t.typography.body2,
148
+ color: t.palette.text.secondary,
149
+ marginTop: t.spacing(0.25),
150
+ ...o.descriptionLines > 0 && {
151
+ display: "-webkit-box",
152
+ WebkitBoxOrient: "vertical",
153
+ WebkitLineClamp: o.descriptionLines,
154
+ overflow: "hidden"
155
+ }
156
+ })), T = a("span", {
157
+ name: "HCDataList",
158
+ slot: "ItemEnd",
159
+ ...e
160
+ })(({ theme: t, ownerState: o }) => ({
161
+ flex: "0 0 auto",
162
+ display: "flex",
163
+ alignItems: "center",
164
+ justifyContent: "flex-end",
165
+ gap: t.spacing(1),
166
+ // A bar needs room to read as a bar; a badge should only take the width it needs.
167
+ ...o.endSlot === "progress" && {
168
+ flex: "0 1 45%",
169
+ minWidth: 120
170
+ }
171
+ })), W = a("span", {
172
+ name: "HCDataList",
173
+ slot: "Badge",
174
+ shouldForwardProp: (t) => t !== "badgeColor" && t !== "badgeBackground" && t !== "badgeBorder"
175
+ })(({ theme: t, badgeColor: o, badgeBackground: r, badgeBorder: d }) => {
176
+ const i = s(t, o) ?? t.palette.text.secondary, n = s(t, d);
177
+ return {
178
+ ...t.typography.caption,
179
+ display: "inline-flex",
180
+ alignItems: "center",
181
+ whiteSpace: "nowrap",
182
+ color: i,
183
+ // Filled tint by default; an outlined chip is opt-in per state via `borderColor`,
184
+ // which is how the design's two chip styles differ.
185
+ backgroundColor: s(t, r) ?? (n ? "transparent" : g(i, 0.12)),
186
+ border: `1px solid ${n ?? "transparent"}`,
187
+ borderRadius: 999,
188
+ padding: t.spacing(0.5, 1.25),
189
+ fontWeight: 500,
190
+ lineHeight: 1.2
191
+ };
192
+ }), S = a(l, {
193
+ name: "HCDataList",
194
+ slot: "ItemEnd"
195
+ })(({ theme: t }) => ({
196
+ ...t.typography.body2,
197
+ color: t.palette.text.primary,
198
+ fontWeight: 500,
199
+ whiteSpace: "nowrap"
200
+ })), j = a(f, {
201
+ name: "HCDataList",
202
+ slot: "Empty",
203
+ ...e
204
+ })(({ theme: t }) => ({
205
+ flex: 1,
206
+ display: "flex",
207
+ alignItems: "center",
208
+ justifyContent: "center",
209
+ padding: t.spacing(4, 2),
210
+ color: t.palette.text.secondary,
211
+ ...t.typography.body2
212
+ })), A = a("li", {
213
+ name: "HCDataList",
214
+ slot: "LoadMore",
215
+ ...e
216
+ })(({ theme: t }) => ({
217
+ listStyle: "none",
218
+ display: "flex",
219
+ alignItems: "center",
220
+ justifyContent: "center",
221
+ minHeight: t.spacing(5),
222
+ color: t.palette.text.secondary
223
+ })), E = a("div", {
224
+ name: "HCDataList",
225
+ slot: "Pagination",
226
+ ...e
227
+ })(({ theme: t }) => ({
228
+ flex: "0 0 auto",
229
+ borderTop: `1px solid ${t.palette.divider}`,
230
+ ".MuiToolbar-root": {
231
+ minHeight: 24,
232
+ paddingLeft: t.spacing(1)
233
+ },
234
+ ".MuiTablePagination-actions .MuiButtonBase-root": {
235
+ padding: t.spacing(0.5)
236
+ },
237
+ ".MuiTablePagination-displayedRows": {
238
+ lineHeight: 1
239
+ }
240
+ }));
241
+ export {
242
+ W as DataListBadge,
243
+ w as DataListContent,
244
+ j as DataListEmpty,
245
+ S as DataListEndLabel,
246
+ C as DataListHeader,
247
+ H as DataListHeaderActionButton,
248
+ I as DataListHeaderActionLink,
249
+ B as DataListItemButton,
250
+ T as DataListItemEnd,
251
+ M as DataListItemMain,
252
+ P as DataListItemMeta,
253
+ h as DataListItemRow,
254
+ R as DataListItemStart,
255
+ k as DataListItemTitle,
256
+ v as DataListList,
257
+ A as DataListLoadMore,
258
+ E as DataListPagination,
259
+ m as DataListRoot
260
+ };
@@ -21,7 +21,11 @@ const H = (i) => {
21
21
  zoom: 3,
22
22
  options: {
23
23
  cssPosition: "absolute",
24
- controls: { zoom: !1 }
24
+ controls: { zoom: !1 },
25
+ // The widget sits in a scrollable dashboard: swallowing the wheel would
26
+ // trap the page scroll on the map. Zoom stays available through
27
+ // `Controls` and double-click.
28
+ interactions: { mouseWheelZoom: !1 }
25
29
  },
26
30
  onInit: a.onInit
27
31
  }
@@ -1,108 +1,119 @@
1
- import { useThemeProps as Q, useTheme as X } from "@mui/material";
2
- import { V as B } from "../../Vector-BmuhQO4p.js";
3
- import { t as V } from "../../Source-BSZST_GH.js";
4
- import { V as T } from "../../Vector-DfTqQEln.js";
5
- import { uniqueId as C, isEmpty as O, values as z } from "lodash";
6
- import { useRef as m, useState as N, useEffect as G } from "react";
7
- import { createMapboxLayer as Y } from "../map/helpers/mapbox.js";
8
- import { parse as U } from "../map/helpers/wkt.js";
9
- import { W as K } from "../../WKT-2wsDT-nq.js";
10
- import { S as j, I as _ } from "../../Text-ChJRuaD8.js";
11
- const $ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAADNCAMAAAAmPqoJAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAohQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ro2BGQAAANh0Uk5TABA4XICDn6e/y9/Pq4dkPBgoWHyjx+v/8zQEGkx/seTntIJPHSxwr++3eAqO1JJQDgFDhYlHBQhAkeHmlkVOnvRTAgtbrPxgSD6dRCDeJmHAxmebu9zjdwwumaBWwchdE37q8DuuQmLbam7odnv7CQ0VkyHDj2niJK2G8sw5pRJxomyLP0uqswZXqb4w97V5NRxo1yeMxA91+C1a5f3KjXLSvbzO7h8lUS8X2Zea/qHCsMVv2tDpPdFUhJzJc5VSuKQbbbLsdGM2Ht1Z1SM37RQDqPFmZYEzh2hhYQAAC0NJREFUeJzNnQ1UFNcVx+cKKOAHu0BslSY1ftRDbSs0p0I4Ao1gbBRpNaaLVpEYCIqkGjXERKM2iTZHaSqpVoNGiYpVjtFgYo/aqE1NY6icVmrUnGiSNtWEtEZEQBABu7OfM7vz8d67b2b2fzzZndl33/1lmZ15H/fdBwJXgUuC51+3EN4p9GmPBrjO1wuviuweXhU3LXCrZyB8wccXD+gEkbaDoGCUWPAS3iEaeoSTo4nGoR0+6kH6REGParZ91o/BbqDzf/QMwi87dDLA572YrW+MAvgbqzErdMqFzhhWnx61fvsLxpsKG3QqwCds/mQaDnCSxY4FOgO+ovnpaSnxw+/DcWoraugs54+ogdqNhvokHr1DaUILPagJeykHqzX9MJ0BHfRD0MX1W/aqO+UQTXEa6JyGJOa7lI4i4xMOkpcmhx7XH04x4JAqDa7UkZYlhrZlvcdGQ6z0Y6T3JELoMddH/4WZhlSZAHuICpJBT4djGBpiZR//kqQYEfRMOIqDIdYEeJ2gFAF0AQDVDQmlnDONV3QL6UMX7rTxoCFWLlTqFdGFtt/qzweGWHbbBzol9KCL4QAvGGJlxm3SLqADXQL7+MEQy569QfNzTejksWcvcKUhlePtyRUaH2tBL3wtmjcNse4a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 props: Z, name: "HCDataMap" }), { data: A, payload: l, onPayloadUpdate: H, accessToken: D, sx: w, ...R } = q, p = X(), g = m(C("map-")), t = m(null), c = m(null), d = m(null), n = m(null), f = m(), [x, E] = N(!1), [L, M] = N(null), P = () => {
13
- if (!x || !t.current || !A || O(A) || !d.current)
1
+ import { useThemeProps as C, useTheme as O } from "@mui/material";
2
+ import { V as U } from "../../Vector-BmuhQO4p.js";
3
+ import { t as Y } from "../../Source-BSZST_GH.js";
4
+ import { V as K } from "../../Vector-DfTqQEln.js";
5
+ import { uniqueId as j, isEmpty as _, values as L, isEqual as $ } from "lodash";
6
+ import { useRef as n, useEffect as b, useState as w } from "react";
7
+ import { createMapboxLayer as ee } from "../map/helpers/mapbox.js";
8
+ import { parse as te } from "../map/helpers/wkt.js";
9
+ import { W as re } from "../../WKT-2wsDT-nq.js";
10
+ import { S as oe, I as ae } from "../../Text-ChJRuaD8.js";
11
+ const ne = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAADNCAMAAAAmPqoJAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAohQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ro2BGQAAANh0Uk5TABA4XICDn6e/y9/Pq4dkPBgoWHyjx+v/8zQEGkx/seTntIJPHSxwr++3eAqO1JJQDgFDhYlHBQhAkeHmlkVOnvRTAgtbrPxgSD6dRCDeJmHAxmebu9zjdwwumaBWwchdE37q8DuuQmLbam7odnv7CQ0VkyHDj2niJK2G8sw5pRJxomyLP0uqswZXqb4w97V5NRxo1yeMxA91+C1a5f3KjXLSvbz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0mmV/GelH4dEXpVHaFKEcphc5KHS/cpzwaqZ5vbNN4yFVK2TVVIMq0I/+bnROzDo6U+7FbKDuqSe0y8l3drh3+XPqcZkaCQitN+0Mr+prWiJ6mda2ROtpNZi1k4Ebx21JrNOyn2rqLWZ9fYJsIZah1l3RwYrqPWYCfa+MJ1al5lglxGzqfWZSfZzMZeagJlo5xwzqUmYybb7MY+aiJlwYyWzqMmYSbewMoeakJl4szAzqEmZyXc4M56amJliLzmjqcmZaXbtM5aagplqq0EjqWmY6TZ1NI6aiplyJ0qjqOmYaff8NIaakpkW2hBqWmZqaAOoqZnpoblT0zMzQHOmZmBmgeZKzcLMBM2RmomZDZobNRszIzQnakZmVmgu1KzMzNAcqJmZ2aHR1OzMCGgkNYIZA42ixjCjoBHUKGYcNDM1jhkJzUiNZMZCM1FjmdHQDNRoZjw0NTWemQM0JTUHZh7QVNQ8mLlAC3lvkobmt0agMi94xGe/u8FXydL1tOWobl1MI16b9J0box+cPyyJ0/Z63HYWzHlH7xKBb/CK1uG3HeJg22NawbWOjEIel7NLPPdwLJ94Wm1datTK1ER+jvhuPAmJN5WWe5ZVNvLYP8HvhmdlTqVcrPxSnjrAfjUhkirpur54Q4uy9Sqo7Cp13ilKqpqjoC9lzhIC/R8ayIzTAQpU0QAAAABJRU5ErkJggg==", ce = [-170, -65, 170, 65], qe = (S) => {
12
+ const q = C({ props: S, name: "HCDataMap" }), { data: l, payload: g, onPayloadUpdate: y, accessToken: P, sx: W, ...v } = q, m = O(), M = n(j("map-")), o = n(null), u = n(null), i = n(null), c = n(null), d = n(), A = n(!1), x = n(!1), h = n(null), p = n({ payload: g, onPayloadUpdate: y });
13
+ b(() => {
14
+ p.current = { payload: g, onPayloadUpdate: y };
15
+ });
16
+ const [z, I] = w(!1), [k, J] = w(null), X = () => {
17
+ if (!z || !o.current || !l || _(l) || !i.current)
14
18
  return;
15
- const r = new K(), o = A.filter((e) => {
16
- const a = z(e.variables.geometry)[0];
19
+ const e = new re(), t = l.filter((r) => {
20
+ const a = L(r.variables.geometry)[0];
17
21
  try {
18
- return U(a), !0;
22
+ return te(a), !0;
19
23
  } catch {
20
24
  return !1;
21
25
  }
22
- }).map((e) => {
23
- const a = z(e.variables.geometry)[0], u = r.readFeature(a, {
26
+ }).map((r) => {
27
+ const a = L(r.variables.geometry)[0], s = e.readFeature(a, {
24
28
  dataProjection: "EPSG:4326",
25
29
  featureProjection: "EPSG:3857"
26
30
  });
27
- return u.set("title", e.title), u;
31
+ return s.set("title", r.title), s;
28
32
  });
29
- d.current.clear(), d.current.addFeatures(o);
30
- }, y = () => {
31
- var e;
32
- if (!t.current) return;
33
- const r = (e = t.current) == null ? void 0 : e.getBoundingBox(), o = {
34
- ...l,
35
- boundingBox: r
33
+ i.current.clear(), i.current.addFeatures(t);
34
+ }, N = () => {
35
+ if (!A.current || !o.current) return !1;
36
+ const e = o.current.getSize();
37
+ return !!(e && e[0] > 0 && e[1] > 0);
38
+ }, R = () => {
39
+ if (!o.current || !N()) return;
40
+ const e = o.current.getBoundingBox(), t = {
41
+ ...p.current.payload,
42
+ boundingBox: e
36
43
  };
37
- H(o);
38
- }, S = () => {
39
- f.current && clearTimeout(f.current), f.current = setTimeout(() => {
40
- var r;
41
- (r = t.current) == null || r.updateSize(), c.current && c.current.map.resize();
44
+ $(t, h.current) || (h.current = t, p.current.onPayloadUpdate(t));
45
+ }, D = () => {
46
+ var r, a;
47
+ if (x.current || !N()) return;
48
+ const e = (r = p.current.payload) == null ? void 0 : r.boundingBox, t = e ? [
49
+ e.bottomLeft.longitude,
50
+ e.bottomLeft.latitude,
51
+ e.topRight.longitude,
52
+ e.topRight.latitude
53
+ ] : ce;
54
+ (a = o.current) == null || a.centerToExtent(
55
+ Y(t, "EPSG:4326", "EPSG:3857")
56
+ ), x.current = !0, R();
57
+ }, F = () => {
58
+ d.current && clearTimeout(d.current), d.current = setTimeout(() => {
59
+ var e;
60
+ A.current && ((e = o.current) == null || e.updateSize(), u.current && u.current.map.resize(), D());
42
61
  }, 100);
43
- }, W = () => {
44
- var r, o;
45
- (r = t.current) == null || r.on("movestart", () => {
46
- n.current && (clearTimeout(n.current), n.current = null);
47
- }), (o = t.current) == null || o.on("moveend", () => {
48
- n.current && (clearTimeout(n.current), n.current = null), n.current = setTimeout(y, 500);
62
+ }, Q = () => {
63
+ var e, t;
64
+ (e = o.current) == null || e.on("movestart", () => {
65
+ c.current && (clearTimeout(c.current), c.current = null);
66
+ }), (t = o.current) == null || t.on("moveend", () => {
67
+ c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(R, 500);
49
68
  });
50
- }, k = () => {
51
- var u, J, h;
52
- const r = p.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", o = Y({
53
- id: g.current,
69
+ }, B = () => {
70
+ var s, G, Z;
71
+ const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ee({
72
+ id: M.current,
54
73
  center: [0, 0],
55
- style: r,
56
- accessToken: D
74
+ style: e,
75
+ accessToken: P
57
76
  });
58
- (u = t.current) == null || u.addLayer(o.layer), c.current = o;
59
- const e = new T(), a = new B({
60
- source: e,
61
- style: new j({
62
- image: new _({
77
+ (s = o.current) == null || s.addLayer(t.layer), u.current = t;
78
+ const r = new K(), a = new U({
79
+ source: r,
80
+ style: new oe({
81
+ image: new ae({
63
82
  anchor: [0.5, 1],
64
- src: $,
83
+ src: ne,
65
84
  scale: 0.1,
66
- color: p.palette.primary.main
85
+ color: m.palette.primary.main
67
86
  })
68
87
  })
69
88
  });
70
- if ((J = t.current) == null || J.addLayer(a), d.current = e, E(!0), W(), y(), (h = t.current) == null || h.on("pointermove", (s) => {
71
- var b;
72
- const i = (b = t.current) == null ? void 0 : b.forEachFeatureAtPixel(s.pixel, 4);
73
- M(i ? {
74
- text: i.get("title"),
75
- x: s.pixel[0],
76
- y: s.pixel[1]
89
+ (G = o.current) == null || G.addLayer(a), i.current = r, A.current = !0, I(!0), Q(), (Z = o.current) == null || Z.on("pointermove", (f) => {
90
+ var E;
91
+ const H = (E = o.current) == null ? void 0 : E.forEachFeatureAtPixel(f.pixel, 4);
92
+ J(H ? {
93
+ text: H.get("title"),
94
+ x: f.pixel[0],
95
+ y: f.pixel[1]
77
96
  } : null);
78
- }), l != null && l.boundingBox && t.current) {
79
- const { bottomLeft: s, topRight: i } = l.boundingBox, b = [
80
- s.longitude,
81
- s.latitude,
82
- i.longitude,
83
- i.latitude
84
- ], F = V(b, "EPSG:4326", "EPSG:3857");
85
- t.current.centerToExtent(F);
86
- }
87
- }, v = () => {
88
- var e, a;
89
- if (!c.current) return;
90
- const r = p.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", o = ((a = (e = c.current.layer.getSource()) == null ? void 0 : e.getMapboxMap) == null ? void 0 : a.call(e)) || c.current.map;
91
- o && o.setStyle(r);
97
+ }), D();
98
+ }, V = () => {
99
+ var r, a;
100
+ if (!u.current) return;
101
+ const e = m.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", t = ((a = (r = u.current.layer.getSource()) == null ? void 0 : r.getMapboxMap) == null ? void 0 : a.call(r)) || u.current.map;
102
+ t && t.setStyle(e);
92
103
  };
93
- G(() => (P(), () => {
94
- }), [A, x]), G(() => (v(), () => {
95
- }), [p.palette.mode]);
96
- const I = { ...q };
104
+ b(() => (X(), () => {
105
+ }), [l, z]), b(() => (V(), () => {
106
+ }), [m.palette.mode]);
107
+ const T = { ...q };
97
108
  return {
98
- refs: { mapRef: t, mapId: g },
99
- state: { tooltip: L },
100
- actions: { onInit: k, onMapResize: S },
101
- ownerState: I,
102
- sx: w,
103
- other: R
109
+ refs: { mapRef: o, mapId: M },
110
+ state: { tooltip: k },
111
+ actions: { onInit: B, onMapResize: F },
112
+ ownerState: T,
113
+ sx: W,
114
+ other: v
104
115
  };
105
116
  };
106
117
  export {
107
- le as useDataMapLogic
118
+ qe as useDataMapLogic
108
119
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { Typography as d } from "@mui/material";
3
- import { useEffect as l } from "react";
2
+ import { Typography as l } from "@mui/material";
3
+ import { useEffect as d } from "react";
4
4
  import { u } from "../../index.esm-DAf19hyR.js";
5
5
  import { Map as h } from "../map/index.js";
6
6
  import { Controls as M } from "./components/controls/index.js";
@@ -8,27 +8,31 @@ import { Legend as R } from "./components/legend/index.js";
8
8
  import { useHeatMapLogic as g } from "./logic.js";
9
9
  import { HeatMapRoot as H, HeatMapHeader as z, HeatMapContent as x } from "./styled.js";
10
10
  const E = (r) => {
11
- const { refs: t, actions: i, gradient: p, ownerState: o, sx: s, other: f } = g(r), { width: n, height: a, ref: c } = u();
12
- return l(() => (n && a && i.onMapResize(), () => {
13
- }), [n, a]), /* @__PURE__ */ m(H, { ownerState: o, sx: s, ref: c, ...f, children: [
14
- /* @__PURE__ */ e(z, { ownerState: o, children: /* @__PURE__ */ e(d, { variant: "h3", children: r.title }) }),
15
- /* @__PURE__ */ m(x, { ownerState: o, children: [
11
+ const { refs: o, actions: i, gradient: s, ownerState: t, sx: p, other: f } = g(r), { width: n, height: a, ref: c } = u();
12
+ return d(() => (n && a && i.onMapResize(), () => {
13
+ }), [n, a]), /* @__PURE__ */ m(H, { ownerState: t, sx: p, ref: c, ...f, children: [
14
+ /* @__PURE__ */ e(z, { ownerState: t, children: /* @__PURE__ */ e(l, { variant: "h3", children: r.title }) }),
15
+ /* @__PURE__ */ m(x, { ownerState: t, children: [
16
16
  /* @__PURE__ */ e(
17
17
  h,
18
18
  {
19
- id: t.mapId.current,
20
- ref: t.mapRef,
19
+ id: o.mapId.current,
20
+ ref: o.mapRef,
21
21
  center: { latitude: 0, longitude: 0 },
22
22
  zoom: 3,
23
23
  options: {
24
24
  cssPosition: "absolute",
25
- controls: { zoom: !1 }
25
+ controls: { zoom: !1 },
26
+ // The widget sits in a scrollable dashboard: swallowing the wheel would
27
+ // trap the page scroll on the map. Zoom stays available through
28
+ // `Controls` and double-click.
29
+ interactions: { mouseWheelZoom: !1 }
26
30
  },
27
31
  onInit: i.onInit
28
32
  }
29
33
  ),
30
- /* @__PURE__ */ e(R, { gradient: p }),
31
- /* @__PURE__ */ e(M, { mapRef: t.mapRef.current })
34
+ /* @__PURE__ */ e(R, { gradient: s }),
35
+ /* @__PURE__ */ e(M, { mapRef: o.mapRef.current })
32
36
  ] })
33
37
  ] });
34
38
  };