@carto/ps-react-ui 4.17.1 → 4.17.3
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/components.js +1 -1
- package/dist/legend/stores.js +1 -1
- package/dist/{legend-store-registry-Bo8U_qWM.js → legend-store-registry-p1tSwJXH.js} +151 -147
- package/dist/legend-store-registry-p1tSwJXH.js.map +1 -0
- package/dist/legend.js +670 -562
- package/dist/legend.js.map +1 -1
- package/dist/smart-tooltip-DFV6GD8R.js +40 -0
- package/dist/smart-tooltip-DFV6GD8R.js.map +1 -0
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +2 -2
- package/dist/types/legend/components/legend-group/styles.d.ts +44 -16
- package/dist/types/legend/components/legend-row/styles.d.ts +37 -0
- package/dist/types/legend/components/legend-sortable/styles.d.ts +4 -3
- package/dist/widgets/wrapper.js +1 -1
- package/dist/widgets-v2.js +1 -1
- package/package.json +3 -3
- package/src/components/smart-tooltip/smart-tooltip.tsx +25 -10
- package/src/legend/components/legend-actions/legend-actions.tsx +2 -2
- package/src/legend/components/legend-group/legend-group.tsx +3 -1
- package/src/legend/components/legend-group/styles.ts +77 -32
- package/src/legend/components/legend-row/legend-row.tsx +13 -8
- package/src/legend/components/legend-row/styles.ts +59 -4
- package/src/legend/components/legend-sortable/styles.ts +13 -4
- package/src/legend/stores/legend-store-registry.ts +28 -4
- package/src/legend/stores/legend-store.test.ts +23 -0
- package/dist/legend-store-registry-Bo8U_qWM.js.map +0 -1
- package/dist/smart-tooltip-D4vwQpFf.js +0 -37
- package/dist/smart-tooltip-D4vwQpFf.js.map +0 -1
package/dist/components.js
CHANGED
|
@@ -8,7 +8,7 @@ import { d as Be } from "./cjs-D4KH3azB.js";
|
|
|
8
8
|
import { T as ke } from "./tooltip-BDnrRKrp.js";
|
|
9
9
|
import { s as no } from "./tooltip-BDnrRKrp.js";
|
|
10
10
|
import { LockOutlined as kt, DeleteOutlined as Tt, Close as Ue, Search as Mt, ArrowDropDown as At, MyLocationOutlined as It, LocationDisabledOutlined as Lt, CropFreeOutlined as Dt, AddOutlined as Pt, RemoveOutlined as Rt } from "@mui/icons-material";
|
|
11
|
-
import { S as Ot } from "./smart-tooltip-
|
|
11
|
+
import { S as Ot } from "./smart-tooltip-DFV6GD8R.js";
|
|
12
12
|
import { C as so } from "./copy-button-DGL1tyli.js";
|
|
13
13
|
const Et = [], $t = {};
|
|
14
14
|
function Wl(t) {
|
package/dist/legend/stores.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as r, c as a, a as t, d as l, g as o, h as d, r as L, s as g, b as n, e as c, f as u, i, j as p, k as S, l as y, m as G, u as b, n as h, o as C, p as f } from "../legend-store-registry-
|
|
1
|
+
import { L as r, c as a, a as t, d as l, g as o, h as d, r as L, s as g, b as n, e as c, f as u, i, j as p, k as S, l as y, m as G, u as b, n as h, o as C, p as f } from "../legend-store-registry-p1tSwJXH.js";
|
|
2
2
|
export {
|
|
3
3
|
r as LegendContext,
|
|
4
4
|
a as clearAllLegendStores,
|
|
@@ -29,17 +29,17 @@ function ne(e) {
|
|
|
29
29
|
return Object.keys(e.groups).length > 0;
|
|
30
30
|
}
|
|
31
31
|
function le(e) {
|
|
32
|
-
const r = (o) => O(e, o).filter((
|
|
32
|
+
const r = (o) => O(e, o).filter((t) => t.visible), n = [];
|
|
33
33
|
for (const o of E(e)) {
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const t = r(o.id);
|
|
35
|
+
t.length > 0 && n.push({
|
|
36
36
|
group: o,
|
|
37
|
-
layers:
|
|
37
|
+
layers: t
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
layers:
|
|
40
|
+
const s = r(void 0);
|
|
41
|
+
return s.length > 0 && n.push({
|
|
42
|
+
layers: s
|
|
43
43
|
}), n;
|
|
44
44
|
}
|
|
45
45
|
function ce(e, r) {
|
|
@@ -49,12 +49,12 @@ function ce(e, r) {
|
|
|
49
49
|
!!n.helperText : !1;
|
|
50
50
|
}
|
|
51
51
|
function ue(e, r) {
|
|
52
|
-
let n = !1,
|
|
52
|
+
let n = !1, s = !1;
|
|
53
53
|
for (const o of O(e, r))
|
|
54
|
-
o.visible ? n = !0 :
|
|
55
|
-
return n &&
|
|
54
|
+
o.visible ? n = !0 : s = !0;
|
|
55
|
+
return n && s ? "mixed" : s ? "hidden" : "visible";
|
|
56
56
|
}
|
|
57
|
-
const p = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(),
|
|
57
|
+
const p = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set(), H = () => {
|
|
58
58
|
try {
|
|
59
59
|
return !1;
|
|
60
60
|
} catch {
|
|
@@ -86,37 +86,37 @@ function R(e, r) {
|
|
|
86
86
|
collapsedBeforeHide: r
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
89
|
+
function I(e, r, n) {
|
|
90
|
+
const s = e.findIndex((i) => i.id === r);
|
|
91
|
+
if (s === -1) return null;
|
|
92
92
|
const o = Math.max(0, Math.min(e.length - 1, n));
|
|
93
|
-
if (o ===
|
|
94
|
-
const
|
|
95
|
-
|
|
93
|
+
if (o === s) return null;
|
|
94
|
+
const t = [...e], [l] = t.splice(s, 1);
|
|
95
|
+
t.splice(o, 0, l);
|
|
96
96
|
const c = /* @__PURE__ */ new Map();
|
|
97
|
-
return
|
|
98
|
-
i.order !==
|
|
97
|
+
return t.forEach((i, d) => {
|
|
98
|
+
i.order !== d && c.set(i.id, d);
|
|
99
99
|
}), c.size > 0 ? c : null;
|
|
100
100
|
}
|
|
101
101
|
function h(e, r, n) {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
102
|
+
const s = e.layers[r];
|
|
103
|
+
return s ? {
|
|
104
104
|
layers: {
|
|
105
105
|
...e.layers,
|
|
106
106
|
[r]: {
|
|
107
|
-
...
|
|
107
|
+
...s,
|
|
108
108
|
...n
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
} : {};
|
|
112
112
|
}
|
|
113
113
|
function T(e, r, n) {
|
|
114
|
-
const
|
|
115
|
-
return
|
|
114
|
+
const s = e.groups[r];
|
|
115
|
+
return s ? {
|
|
116
116
|
groups: {
|
|
117
117
|
...e.groups,
|
|
118
118
|
[r]: {
|
|
119
|
-
...
|
|
119
|
+
...s,
|
|
120
120
|
...n
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -125,36 +125,36 @@ function T(e, r, n) {
|
|
|
125
125
|
function U(e, r) {
|
|
126
126
|
if (!r || !e || e === r) return r;
|
|
127
127
|
const n = r.map((o) => {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
128
|
+
const t = e.find((l) => l.id === o.id);
|
|
129
|
+
return t && t.active !== o.active && o.options.includes(t.active) ? {
|
|
130
130
|
...o,
|
|
131
|
-
active:
|
|
131
|
+
active: t.active
|
|
132
132
|
} : o;
|
|
133
133
|
});
|
|
134
|
-
return e.length === n.length && n.every((o,
|
|
135
|
-
const l = e[
|
|
134
|
+
return e.length === n.length && n.every((o, t) => {
|
|
135
|
+
const l = e[t];
|
|
136
136
|
return l.id === o.id && l.title === o.title && l.options === o.options && l.active === o.active;
|
|
137
137
|
}) ? e : n;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function W(e, r) {
|
|
140
140
|
return !j(e) || !j(r) || e.type !== r.type || e.key !== r.key ? !1 : v(e.props, r.props);
|
|
141
141
|
}
|
|
142
142
|
function v(e, r) {
|
|
143
143
|
const n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(r)]);
|
|
144
|
-
for (const
|
|
145
|
-
if (!Object.is(e[
|
|
144
|
+
for (const s of n)
|
|
145
|
+
if (!Object.is(e[s], r[s]) && !W(e[s], r[s]))
|
|
146
146
|
return !1;
|
|
147
147
|
return !0;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function L(e, r) {
|
|
150
150
|
const n = /* @__PURE__ */ new Map();
|
|
151
|
-
for (const
|
|
152
|
-
const o = r(
|
|
153
|
-
|
|
151
|
+
for (const s of e) {
|
|
152
|
+
const o = r(s.merged), t = n.get(o);
|
|
153
|
+
t ? t.push(s) : n.set(o, [s]);
|
|
154
154
|
}
|
|
155
|
-
for (const
|
|
156
|
-
|
|
157
|
-
o.merged.order =
|
|
155
|
+
for (const s of n.values())
|
|
156
|
+
s.sort((o, t) => o.merged.order - t.merged.order || o.index - t.index).forEach((o, t) => {
|
|
157
|
+
o.merged.order = t;
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
function V(e, r, n) {
|
|
@@ -168,118 +168,122 @@ function V(e, r, n) {
|
|
|
168
168
|
order: e?.order ?? r.order ?? n
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function M(e, r, n) {
|
|
171
|
+
function M(e, r, n, s) {
|
|
172
172
|
return {
|
|
173
173
|
...r,
|
|
174
|
-
collapsed: e?.collapsed ?? r.collapsed ?? !
|
|
174
|
+
collapsed: e?.collapsed ?? r.collapsed ?? !s,
|
|
175
175
|
collapsedBeforeHide: e?.collapsedBeforeHide,
|
|
176
176
|
order: e?.order ?? r.order ?? n
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const
|
|
179
|
+
function k(e, r, n) {
|
|
180
|
+
const s = r.map((u, a) => ({
|
|
181
181
|
index: a,
|
|
182
182
|
merged: V(e.layers[u.id], u, a)
|
|
183
183
|
}));
|
|
184
|
-
|
|
185
|
-
const o =
|
|
184
|
+
L(s, (u) => u.groupId);
|
|
185
|
+
const o = new Set(s.filter(({
|
|
186
|
+
merged: u
|
|
187
|
+
}) => u.visible && u.groupId != null).map(({
|
|
188
|
+
merged: u
|
|
189
|
+
}) => u.groupId)), t = n.map((u, a) => ({
|
|
186
190
|
index: a,
|
|
187
|
-
merged: M(e.groups[u.id], u, a)
|
|
191
|
+
merged: M(e.groups[u.id], u, a, o.has(u.id))
|
|
188
192
|
}));
|
|
189
|
-
|
|
193
|
+
L(t, () => {
|
|
190
194
|
});
|
|
191
|
-
let
|
|
192
|
-
const
|
|
195
|
+
let l = s.length !== Object.keys(e.layers).length;
|
|
196
|
+
const c = {};
|
|
193
197
|
for (const {
|
|
194
198
|
merged: u
|
|
195
|
-
} of
|
|
199
|
+
} of s) {
|
|
196
200
|
const a = e.layers[u.id];
|
|
197
|
-
a && v(a, u) ?
|
|
201
|
+
a && v(a, u) ? c[u.id] = a : (c[u.id] = u, l = !0);
|
|
198
202
|
}
|
|
199
|
-
let
|
|
200
|
-
const
|
|
203
|
+
let i = t.length !== Object.keys(e.groups).length;
|
|
204
|
+
const d = {};
|
|
201
205
|
for (const {
|
|
202
206
|
merged: u
|
|
203
|
-
} of
|
|
207
|
+
} of t) {
|
|
204
208
|
const a = e.groups[u.id];
|
|
205
|
-
a && v(a, u) ?
|
|
209
|
+
a && v(a, u) ? d[u.id] = a : (d[u.id] = u, i = !0);
|
|
206
210
|
}
|
|
207
|
-
return !
|
|
208
|
-
layers:
|
|
209
|
-
groups:
|
|
211
|
+
return !l && !i ? {} : {
|
|
212
|
+
layers: l ? c : e.layers,
|
|
213
|
+
groups: i ? d : e.groups
|
|
210
214
|
};
|
|
211
215
|
}
|
|
212
216
|
function m(e, r, n) {
|
|
213
|
-
const
|
|
217
|
+
const s = Object.values(r).map((l, c) => ({
|
|
214
218
|
index: c,
|
|
215
219
|
merged: {
|
|
216
220
|
...l
|
|
217
221
|
}
|
|
218
222
|
}));
|
|
219
|
-
|
|
220
|
-
let o =
|
|
221
|
-
const
|
|
223
|
+
L(s, n);
|
|
224
|
+
let o = s.length !== Object.keys(e).length;
|
|
225
|
+
const t = {};
|
|
222
226
|
for (const {
|
|
223
227
|
merged: l
|
|
224
|
-
} of
|
|
228
|
+
} of s) {
|
|
225
229
|
const c = e[l.id];
|
|
226
|
-
c && v(c, l) ?
|
|
230
|
+
c && v(c, l) ? t[l.id] = c : (t[l.id] = l, o = !0);
|
|
227
231
|
}
|
|
228
|
-
return o ?
|
|
232
|
+
return o ? t : null;
|
|
229
233
|
}
|
|
230
|
-
function
|
|
231
|
-
const n = Object.values(e.layers).filter((
|
|
234
|
+
function F(e, r) {
|
|
235
|
+
const n = Object.values(e.layers).filter((t) => t.groupId === r.groupId && t.id !== r.id).length, s = V(e.layers[r.id], r, n), o = m(e.layers, {
|
|
232
236
|
...e.layers,
|
|
233
|
-
[r.id]:
|
|
234
|
-
}, (
|
|
237
|
+
[r.id]: s
|
|
238
|
+
}, (t) => t.groupId);
|
|
235
239
|
return o ? {
|
|
236
240
|
layers: o
|
|
237
241
|
} : {};
|
|
238
242
|
}
|
|
239
|
-
function
|
|
243
|
+
function J(e, r) {
|
|
240
244
|
if (!e.layers[r]) return {};
|
|
241
245
|
const n = {
|
|
242
246
|
...e.layers
|
|
243
247
|
};
|
|
244
248
|
delete n[r];
|
|
245
|
-
const
|
|
246
|
-
return
|
|
247
|
-
layers:
|
|
249
|
+
const s = m(e.layers, n, (o) => o.groupId);
|
|
250
|
+
return s ? {
|
|
251
|
+
layers: s
|
|
248
252
|
} : {};
|
|
249
253
|
}
|
|
250
|
-
function
|
|
251
|
-
const n = Object.values(e.groups).filter((
|
|
254
|
+
function K(e, r) {
|
|
255
|
+
const n = Object.values(e.groups).filter((l) => l.id !== r.id).length, s = Object.values(e.layers).some((l) => l.groupId === r.id && l.visible), o = M(e.groups[r.id], r, n, s), t = m(e.groups, {
|
|
252
256
|
...e.groups,
|
|
253
|
-
[r.id]:
|
|
257
|
+
[r.id]: o
|
|
254
258
|
}, () => {
|
|
255
259
|
});
|
|
256
|
-
return
|
|
257
|
-
groups:
|
|
260
|
+
return t ? {
|
|
261
|
+
groups: t
|
|
258
262
|
} : {};
|
|
259
263
|
}
|
|
260
|
-
function
|
|
264
|
+
function N(e, r) {
|
|
261
265
|
if (!e.groups[r]) return {};
|
|
262
266
|
const n = {
|
|
263
267
|
...e.groups
|
|
264
268
|
};
|
|
265
269
|
delete n[r];
|
|
266
|
-
const
|
|
270
|
+
const s = m(e.groups, n, () => {
|
|
267
271
|
}), o = Object.values(e.layers).filter((c) => c.groupId === r);
|
|
268
|
-
if (o.length === 0) return
|
|
269
|
-
groups:
|
|
272
|
+
if (o.length === 0) return s ? {
|
|
273
|
+
groups: s
|
|
270
274
|
} : {};
|
|
271
|
-
const
|
|
275
|
+
const t = {
|
|
272
276
|
...e.layers
|
|
273
277
|
};
|
|
274
278
|
for (const c of o)
|
|
275
|
-
|
|
279
|
+
t[c.id] = {
|
|
276
280
|
...c,
|
|
277
281
|
groupId: void 0
|
|
278
282
|
};
|
|
279
|
-
const l = m(e.layers,
|
|
283
|
+
const l = m(e.layers, t, (c) => c.groupId);
|
|
280
284
|
return {
|
|
281
|
-
...
|
|
282
|
-
groups:
|
|
285
|
+
...s ? {
|
|
286
|
+
groups: s
|
|
283
287
|
} : {},
|
|
284
288
|
...l ? {
|
|
285
289
|
layers: l
|
|
@@ -287,79 +291,79 @@ function Q(e, r) {
|
|
|
287
291
|
};
|
|
288
292
|
}
|
|
289
293
|
function ie(e, r = {}) {
|
|
290
|
-
const n =
|
|
294
|
+
const n = k({
|
|
291
295
|
layers: {},
|
|
292
296
|
groups: {}
|
|
293
297
|
}, r.layers ?? [], r.groups ?? []);
|
|
294
|
-
return $()(q((
|
|
298
|
+
return $()(q((s) => ({
|
|
295
299
|
layers: n.layers ?? {},
|
|
296
300
|
groups: n.groups ?? {},
|
|
297
|
-
setVisibility: (o,
|
|
298
|
-
const c = l.layers[o], i = c && w(c,
|
|
301
|
+
setVisibility: (o, t) => s((l) => {
|
|
302
|
+
const c = l.layers[o], i = c && w(c, t);
|
|
299
303
|
return i ? h(l, o, i) : {};
|
|
300
304
|
}, !1, "setVisibility"),
|
|
301
|
-
setOpacity: (o,
|
|
302
|
-
opacity: _(
|
|
305
|
+
setOpacity: (o, t) => s((l) => h(l, o, {
|
|
306
|
+
opacity: _(t)
|
|
303
307
|
}), !1, "setOpacity"),
|
|
304
|
-
setCollapsed: (o,
|
|
308
|
+
setCollapsed: (o, t) => s((l) => {
|
|
305
309
|
const c = l.layers[o];
|
|
306
|
-
return c ? h(l, o, R(c,
|
|
310
|
+
return c ? h(l, o, R(c, t)) : {};
|
|
307
311
|
}, !1, "setCollapsed"),
|
|
308
|
-
setSectionValue: (o,
|
|
309
|
-
const i = c.layers[o],
|
|
310
|
-
if (!i?.sections || !
|
|
312
|
+
setSectionValue: (o, t, l) => s((c) => {
|
|
313
|
+
const i = c.layers[o], d = i?.sections?.find((a) => a.id === t);
|
|
314
|
+
if (!i?.sections || !d || d.active === l || !d.options.includes(l))
|
|
311
315
|
return {};
|
|
312
|
-
const
|
|
313
|
-
...
|
|
316
|
+
const u = i.sections.map((a) => a.id === t ? {
|
|
317
|
+
...a,
|
|
314
318
|
active: l
|
|
315
|
-
} :
|
|
319
|
+
} : a);
|
|
316
320
|
return h(c, o, {
|
|
317
|
-
sections:
|
|
321
|
+
sections: u
|
|
318
322
|
});
|
|
319
323
|
}, !1, "setSectionValue"),
|
|
320
|
-
moveLayer: (o,
|
|
324
|
+
moveLayer: (o, t) => s((l) => {
|
|
321
325
|
const c = l.layers[o];
|
|
322
326
|
if (!c) return {};
|
|
323
|
-
const i = O(l, c.groupId),
|
|
324
|
-
if (!
|
|
325
|
-
const
|
|
327
|
+
const i = O(l, c.groupId), d = I(i, o, t);
|
|
328
|
+
if (!d) return {};
|
|
329
|
+
const u = {
|
|
326
330
|
...l.layers
|
|
327
331
|
};
|
|
328
|
-
for (const [
|
|
329
|
-
a
|
|
330
|
-
...a
|
|
332
|
+
for (const [a, g] of d)
|
|
333
|
+
u[a] = {
|
|
334
|
+
...u[a],
|
|
331
335
|
order: g
|
|
332
336
|
};
|
|
333
337
|
return {
|
|
334
|
-
layers:
|
|
338
|
+
layers: u
|
|
335
339
|
};
|
|
336
340
|
}, !1, "moveLayer"),
|
|
337
|
-
setGroupVisibility: (o,
|
|
341
|
+
setGroupVisibility: (o, t) => s((l) => {
|
|
338
342
|
const c = l.groups[o];
|
|
339
343
|
if (!c) return {};
|
|
340
|
-
const i = Object.values(l.layers).filter((f) => f.groupId === o),
|
|
341
|
-
if (i.length === 0 || !
|
|
342
|
-
const
|
|
344
|
+
const i = Object.values(l.layers).filter((f) => f.groupId === o), d = i.some((f) => f.visible);
|
|
345
|
+
if (i.length === 0 || !t && !d) return {};
|
|
346
|
+
const u = {
|
|
343
347
|
...l.layers
|
|
344
348
|
};
|
|
345
|
-
let
|
|
349
|
+
let a = !1;
|
|
346
350
|
for (const f of i) {
|
|
347
|
-
const G = w(f,
|
|
348
|
-
G && (
|
|
351
|
+
const G = w(f, t);
|
|
352
|
+
G && (u[f.id] = {
|
|
349
353
|
...f,
|
|
350
354
|
...G
|
|
351
|
-
},
|
|
355
|
+
}, a = !0);
|
|
352
356
|
}
|
|
353
|
-
if (!
|
|
357
|
+
if (!a) return {};
|
|
354
358
|
let g = null;
|
|
355
|
-
return !
|
|
359
|
+
return !t && d ? g = {
|
|
356
360
|
collapsed: !0,
|
|
357
361
|
collapsedBeforeHide: c.collapsed
|
|
358
|
-
} :
|
|
362
|
+
} : t && !d && (g = {
|
|
359
363
|
collapsed: c.collapsedBeforeHide ?? !1,
|
|
360
364
|
collapsedBeforeHide: void 0
|
|
361
365
|
}), {
|
|
362
|
-
layers:
|
|
366
|
+
layers: u,
|
|
363
367
|
...g ? {
|
|
364
368
|
groups: {
|
|
365
369
|
...l.groups,
|
|
@@ -371,37 +375,37 @@ function ie(e, r = {}) {
|
|
|
371
375
|
} : {}
|
|
372
376
|
};
|
|
373
377
|
}, !1, "setGroupVisibility"),
|
|
374
|
-
setGroupCollapsed: (o,
|
|
378
|
+
setGroupCollapsed: (o, t) => s((l) => {
|
|
375
379
|
if (!l.groups[o]) return {};
|
|
376
|
-
const i = Object.values(l.layers).filter((
|
|
377
|
-
return T(l, o,
|
|
378
|
-
collapsed:
|
|
379
|
-
collapsedBeforeHide:
|
|
380
|
+
const i = Object.values(l.layers).filter((u) => u.groupId === o), d = i.length > 0 && i.every((u) => !u.visible);
|
|
381
|
+
return T(l, o, d ? {
|
|
382
|
+
collapsed: t,
|
|
383
|
+
collapsedBeforeHide: t
|
|
380
384
|
} : {
|
|
381
|
-
collapsed:
|
|
385
|
+
collapsed: t
|
|
382
386
|
});
|
|
383
387
|
}, !1, "setGroupCollapsed"),
|
|
384
|
-
moveGroup: (o,
|
|
388
|
+
moveGroup: (o, t) => s((l) => {
|
|
385
389
|
if (!l.groups[o]) return {};
|
|
386
|
-
const c =
|
|
390
|
+
const c = I(E(l), o, t);
|
|
387
391
|
if (!c) return {};
|
|
388
392
|
const i = {
|
|
389
393
|
...l.groups
|
|
390
394
|
};
|
|
391
|
-
for (const [
|
|
392
|
-
i[
|
|
393
|
-
...i[
|
|
394
|
-
order:
|
|
395
|
+
for (const [d, u] of c)
|
|
396
|
+
i[d] = {
|
|
397
|
+
...i[d],
|
|
398
|
+
order: u
|
|
395
399
|
};
|
|
396
400
|
return {
|
|
397
401
|
groups: i
|
|
398
402
|
};
|
|
399
403
|
}, !1, "moveGroup"),
|
|
400
|
-
setLegendLayer: (o) =>
|
|
401
|
-
removeLegendLayer: (o) =>
|
|
402
|
-
setLegendGroup: (o) =>
|
|
403
|
-
removeLegendGroup: (o) =>
|
|
404
|
-
_sync: (o,
|
|
404
|
+
setLegendLayer: (o) => s((t) => F(t, o), !1, "setLegendLayer"),
|
|
405
|
+
removeLegendLayer: (o) => s((t) => J(t, o), !1, "removeLegendLayer"),
|
|
406
|
+
setLegendGroup: (o) => s((t) => K(t, o), !1, "setLegendGroup"),
|
|
407
|
+
removeLegendGroup: (o) => s((t) => N(t, o), !1, "removeLegendGroup"),
|
|
408
|
+
_sync: (o, t) => s((l) => k(l, o, t), !1, "_sync")
|
|
405
409
|
}), {
|
|
406
410
|
name: `legend-${e}`,
|
|
407
411
|
enabled: H()
|
|
@@ -419,7 +423,7 @@ function de(e) {
|
|
|
419
423
|
p.delete(e);
|
|
420
424
|
}
|
|
421
425
|
function fe() {
|
|
422
|
-
p.clear(), y.clear(),
|
|
426
|
+
p.clear(), y.clear(), b.clear();
|
|
423
427
|
}
|
|
424
428
|
function pe(e, r) {
|
|
425
429
|
p.set(e, r);
|
|
@@ -427,7 +431,7 @@ function pe(e, r) {
|
|
|
427
431
|
function ge(e, r) {
|
|
428
432
|
p.set(e, r);
|
|
429
433
|
const n = (y.get(e) ?? 0) + 1;
|
|
430
|
-
y.set(e, n), n > 1 && H() && !
|
|
434
|
+
y.set(e, n), n > 1 && H() && !b.has(e) && (console.warn(`[legend] Duplicate <Legend.Provider id="${e}"> detected. Multiple providers sharing an id will race on prop sync. Use unique ids per legend panel.`), b.add(e));
|
|
431
435
|
}
|
|
432
436
|
function ye(e, r) {
|
|
433
437
|
const n = (y.get(e) ?? 1) - 1;
|
|
@@ -435,13 +439,13 @@ function ye(e, r) {
|
|
|
435
439
|
}
|
|
436
440
|
function me(e, r) {
|
|
437
441
|
const n = B(2);
|
|
438
|
-
let
|
|
439
|
-
return n[0] !== e ? (
|
|
442
|
+
let s;
|
|
443
|
+
return n[0] !== e ? (s = x(e), n[0] = e, n[1] = s) : s = n[1], C(s, r);
|
|
440
444
|
}
|
|
441
445
|
function he(e, r) {
|
|
442
446
|
const n = B(2);
|
|
443
|
-
let
|
|
444
|
-
return n[0] !== e ? (
|
|
447
|
+
let s;
|
|
448
|
+
return n[0] !== e ? (s = x(e), n[0] = e, n[1] = s) : s = n[1], C(s, D(r));
|
|
445
449
|
}
|
|
446
450
|
export {
|
|
447
451
|
z as L,
|
|
@@ -465,4 +469,4 @@ export {
|
|
|
465
469
|
te as s,
|
|
466
470
|
ye as u
|
|
467
471
|
};
|
|
468
|
-
//# sourceMappingURL=legend-store-registry-
|
|
472
|
+
//# sourceMappingURL=legend-store-registry-p1tSwJXH.js.map
|