@ogc-maps/storybook-components 0.8.0 → 0.9.0
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/Legend-CwaZA84A.js +273 -0
- package/dist/components/Legend/Legend.d.ts.map +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/LegendEditor/LegendEditor.d.ts.map +1 -1
- package/dist/{index-RzZtWlUz.js → index-UmK2u6Yd.js} +187 -185
- package/dist/main.js +194 -168
- package/dist/schemas/config.d.ts +36 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/Legend-BiRyrZL1.js +0 -239
package/dist/main.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { B as rt } from "./BasemapSwitcher-BW7lyZ2Y.js";
|
|
2
2
|
import { C as nt } from "./CollapsibleControl-CGRNPpCw.js";
|
|
3
|
-
import { C as
|
|
3
|
+
import { C as pt, f as ut, a as mt } from "./CoordinateDisplay-PxPmVjpm.js";
|
|
4
4
|
import { E as ct } from "./ExportButton-CLsWoW4m.js";
|
|
5
5
|
import { F as ht } from "./FeatureDetailPanel-CkFpdEKW.js";
|
|
6
6
|
import { F as bt } from "./FeatureTooltip-Db1LgLQV.js";
|
|
7
7
|
import { L as ft } from "./LayerPanel-SCdJ8948.js";
|
|
8
|
-
import { L as wt } from "./Legend-
|
|
8
|
+
import { L as wt } from "./Legend-CwaZA84A.js";
|
|
9
9
|
import { S as Nt } from "./SearchPanel-DtLXMoVs.js";
|
|
10
10
|
import { jsxs as l, jsx as a, Fragment as q } from "react/jsx-runtime";
|
|
11
11
|
import { useId as Ie, useState as A, useRef as ue, useMemo as Ee, useCallback as We, useEffect as X } from "react";
|
|
12
12
|
import { LuInfo as ze } from "react-icons/lu";
|
|
13
13
|
import { J as Fe, j as Pe, i as se, L as Ve, g as _e } from "./cql2-DOJnQwcv.js";
|
|
14
|
-
import { a as Ct, b as St, M as Dt, e as Tt, N as Lt, f as At, c as It, d as Et, h as Ft, O as Pt, P as Mt, k as Ot, l as jt, m as $t, n as Rt, o as Bt, p as qt, q as Ut, r as Gt, s as Wt, t as zt, u as Vt, v as _t, w as Yt, x as Xt, y as Ht, z as Jt, A as Kt, Q as Qt, B as Zt, C as ei, D as ai, E as ti, F as ii, G as ri, H as li, I as ni, K as
|
|
15
|
-
import { s as Ye } from "./index-
|
|
16
|
-
import { B as ui, C as mi, a as si, b as ci, D as di, F as hi, c as gi, d as bi, e as yi, G as fi, L as xi, f as wi, g as vi, h as Ni, i as ki, j as Ci, M as Si, N as Di, O as Ti, P as Li, k as Ai, S as Ii, l as Ei, m as Fi, n as Pi, o as Mi, p as Oi, q as ji, r as $i, T as Ri, U as Bi, V as qi, v as Ui } from "./index-
|
|
14
|
+
import { a as Ct, b as St, M as Dt, e as Tt, N as Lt, f as At, c as It, d as Et, h as Ft, O as Pt, P as Mt, k as Ot, l as jt, m as $t, n as Rt, o as Bt, p as qt, q as Ut, r as Gt, s as Wt, t as zt, u as Vt, v as _t, w as Yt, x as Xt, y as Ht, z as Jt, A as Kt, Q as Qt, B as Zt, C as ei, D as ai, E as ti, F as ii, G as ri, H as li, I as ni, K as oi } from "./cql2-DOJnQwcv.js";
|
|
15
|
+
import { s as Ye } from "./index-UmK2u6Yd.js";
|
|
16
|
+
import { B as ui, C as mi, a as si, b as ci, D as di, F as hi, c as gi, d as bi, e as yi, G as fi, L as xi, f as wi, g as vi, h as Ni, i as ki, j as Ci, M as Si, N as Di, O as Ti, P as Li, k as Ai, S as Ii, l as Ei, m as Fi, n as Pi, o as Mi, p as Oi, q as ji, r as $i, T as Ri, U as Bi, V as qi, v as Ui } from "./index-UmK2u6Yd.js";
|
|
17
17
|
import './style.css';function Xe({ text: e, id: t }) {
|
|
18
18
|
const i = Ie(), r = t ?? i;
|
|
19
19
|
return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
|
|
@@ -41,7 +41,7 @@ import './style.css';function Xe({ text: e, id: t }) {
|
|
|
41
41
|
)
|
|
42
42
|
] });
|
|
43
43
|
}
|
|
44
|
-
function D({ label: e, error: t, required: i, description: r, htmlFor: n, children:
|
|
44
|
+
function D({ label: e, error: t, required: i, description: r, htmlFor: n, children: p }) {
|
|
45
45
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
46
46
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
47
47
|
/* @__PURE__ */ l("label", { htmlFor: n, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
|
|
@@ -50,7 +50,7 @@ function D({ label: e, error: t, required: i, description: r, htmlFor: n, childr
|
|
|
50
50
|
] }),
|
|
51
51
|
r && /* @__PURE__ */ a(Xe, { text: r })
|
|
52
52
|
] }),
|
|
53
|
-
|
|
53
|
+
p,
|
|
54
54
|
t && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: t })
|
|
55
55
|
] });
|
|
56
56
|
}
|
|
@@ -131,13 +131,13 @@ function _({
|
|
|
131
131
|
defaultOpen: i = !1,
|
|
132
132
|
badge: r
|
|
133
133
|
}) {
|
|
134
|
-
const [n,
|
|
134
|
+
const [n, p] = A(i);
|
|
135
135
|
return /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-200", children: [
|
|
136
136
|
/* @__PURE__ */ l(
|
|
137
137
|
"button",
|
|
138
138
|
{
|
|
139
139
|
type: "button",
|
|
140
|
-
onClick: () =>
|
|
140
|
+
onClick: () => p((o) => !o),
|
|
141
141
|
className: "mapui:flex mapui:w-full mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:rounded mapui:border-none mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-100",
|
|
142
142
|
children: [
|
|
143
143
|
/* @__PURE__ */ l("span", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -159,14 +159,14 @@ function ce({
|
|
|
159
159
|
testStatus: r = "idle",
|
|
160
160
|
testError: n
|
|
161
161
|
}) {
|
|
162
|
-
const
|
|
162
|
+
const p = (o) => t({ ...e, ...o });
|
|
163
163
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
164
164
|
/* @__PURE__ */ a(D, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
165
165
|
"input",
|
|
166
166
|
{
|
|
167
167
|
type: "text",
|
|
168
168
|
value: e.id,
|
|
169
|
-
onChange: (
|
|
169
|
+
onChange: (o) => p({ id: o.target.value }),
|
|
170
170
|
placeholder: "my-source",
|
|
171
171
|
className: H
|
|
172
172
|
}
|
|
@@ -178,7 +178,7 @@ function ce({
|
|
|
178
178
|
{
|
|
179
179
|
type: "url",
|
|
180
180
|
value: e.url,
|
|
181
|
-
onChange: (
|
|
181
|
+
onChange: (o) => p({ url: o.target.value }),
|
|
182
182
|
placeholder: "https://example.com/ogcapi",
|
|
183
183
|
className: `${H} mapui:flex-1`
|
|
184
184
|
}
|
|
@@ -202,7 +202,7 @@ function ce({
|
|
|
202
202
|
{
|
|
203
203
|
type: "text",
|
|
204
204
|
value: e.label ?? "",
|
|
205
|
-
onChange: (
|
|
205
|
+
onChange: (o) => p({ label: o.target.value || void 0 }),
|
|
206
206
|
placeholder: "My OGC API Source",
|
|
207
207
|
className: H
|
|
208
208
|
}
|
|
@@ -212,7 +212,7 @@ function ce({
|
|
|
212
212
|
{
|
|
213
213
|
type: "text",
|
|
214
214
|
value: e.tileMatrixSetId ?? "WebMercatorQuad",
|
|
215
|
-
onChange: (
|
|
215
|
+
onChange: (o) => p({ tileMatrixSetId: o.target.value || void 0 }),
|
|
216
216
|
placeholder: "WebMercatorQuad",
|
|
217
217
|
className: H
|
|
218
218
|
}
|
|
@@ -226,7 +226,7 @@ const ee = () => ({
|
|
|
226
226
|
tileMatrixSetId: "WebMercatorQuad"
|
|
227
227
|
});
|
|
228
228
|
function Va({ sources: e, onChange: t }) {
|
|
229
|
-
const [i, r] = A(null), [n,
|
|
229
|
+
const [i, r] = A(null), [n, p] = A(null), [o, b] = A(!1), [m, w] = A(ee()), [d, f] = A({}), [c, u] = A({}), [s, v] = A(null), N = async (C, L) => {
|
|
230
230
|
f((E) => ({ ...E, [C]: "loading" }));
|
|
231
231
|
try {
|
|
232
232
|
const E = await fetch(`${L}/conformance`);
|
|
@@ -235,7 +235,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
235
235
|
f((y) => ({ ...y, [C]: "error" })), u((y) => ({ ...y, [C]: E instanceof Error ? E.message : "Network error" }));
|
|
236
236
|
}
|
|
237
237
|
}, S = () => {
|
|
238
|
-
n && (t(e.map((C) => C.id === i ? n : C)), r(null),
|
|
238
|
+
n && (t(e.map((C) => C.id === i ? n : C)), r(null), p(null));
|
|
239
239
|
}, x = () => {
|
|
240
240
|
t([...e, m]), b(!1), w(ee());
|
|
241
241
|
}, P = (C) => {
|
|
@@ -256,7 +256,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
258
|
] }),
|
|
259
|
-
e.length === 0 && !
|
|
259
|
+
e.length === 0 && !o && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
|
|
260
260
|
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((C) => /* @__PURE__ */ a(
|
|
261
261
|
"li",
|
|
262
262
|
{
|
|
@@ -266,7 +266,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
266
266
|
ce,
|
|
267
267
|
{
|
|
268
268
|
value: n ?? C,
|
|
269
|
-
onChange:
|
|
269
|
+
onChange: p,
|
|
270
270
|
onTestConnection: (L) => N(`edit-${C.id}`, L),
|
|
271
271
|
testStatus: d[`edit-${C.id}`],
|
|
272
272
|
testError: c[`edit-${C.id}`]
|
|
@@ -288,7 +288,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
290
|
onClick: () => {
|
|
291
|
-
r(null),
|
|
291
|
+
r(null), p(null);
|
|
292
292
|
},
|
|
293
293
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
294
294
|
children: "Cancel"
|
|
@@ -310,7 +310,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
310
310
|
{
|
|
311
311
|
type: "button",
|
|
312
312
|
onClick: () => {
|
|
313
|
-
r(C.id),
|
|
313
|
+
r(C.id), p(C);
|
|
314
314
|
},
|
|
315
315
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
316
316
|
children: "Edit"
|
|
@@ -330,7 +330,7 @@ function Va({ sources: e, onChange: t }) {
|
|
|
330
330
|
},
|
|
331
331
|
C.id
|
|
332
332
|
)) }),
|
|
333
|
-
|
|
333
|
+
o && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
334
334
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
|
|
335
335
|
/* @__PURE__ */ a(
|
|
336
336
|
ce,
|
|
@@ -382,13 +382,13 @@ function _a({
|
|
|
382
382
|
onSelect: i,
|
|
383
383
|
onDeselect: r
|
|
384
384
|
}) {
|
|
385
|
-
const { collections: n, loading:
|
|
386
|
-
return
|
|
385
|
+
const { collections: n, loading: p, error: o } = Fe(e || null);
|
|
386
|
+
return p ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
|
|
387
387
|
/* @__PURE__ */ a("span", { className: "mapui:inline-block mapui:h-4 mapui:w-4 mapui:animate-spin mapui:rounded-full mapui:border-2 mapui:border-gray-300 mapui:border-t-blue-600" }),
|
|
388
388
|
"Loading collections…"
|
|
389
|
-
] }) :
|
|
389
|
+
] }) : o ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
|
|
390
390
|
"Failed to load collections: ",
|
|
391
|
-
|
|
391
|
+
o.message
|
|
392
392
|
] }) : n.length === 0 ? /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: n.map((b) => {
|
|
393
393
|
const m = t.includes(b.id);
|
|
394
394
|
return /* @__PURE__ */ l(
|
|
@@ -425,24 +425,24 @@ function _a({
|
|
|
425
425
|
}) });
|
|
426
426
|
}
|
|
427
427
|
function He({ value: e, onChange: t, availableIcons: i }) {
|
|
428
|
-
const [r, n] = A(!1), [
|
|
428
|
+
const [r, n] = A(!1), [p, o] = A(-1), b = ue(null), m = Ie(), w = p >= 0 ? `${m}-option-${p}` : void 0, d = Ee(() => {
|
|
429
429
|
if (!i || i.length === 0) return [];
|
|
430
430
|
if (!e) return i;
|
|
431
431
|
const N = e.toLowerCase();
|
|
432
432
|
return i.filter((S) => S.toLowerCase().includes(N));
|
|
433
433
|
}, [i, e]), f = r && d.length > 0, c = We(
|
|
434
434
|
(N) => {
|
|
435
|
-
t(N), n(!1),
|
|
435
|
+
t(N), n(!1), o(-1);
|
|
436
436
|
},
|
|
437
437
|
[t]
|
|
438
438
|
), u = (N) => {
|
|
439
|
-
t(N.target.value), n(!0),
|
|
439
|
+
t(N.target.value), n(!0), o(-1);
|
|
440
440
|
}, s = (N) => {
|
|
441
|
-
f && (N.key === "ArrowDown" ? (N.preventDefault(),
|
|
441
|
+
f && (N.key === "ArrowDown" ? (N.preventDefault(), o((S) => Math.min(S + 1, d.length - 1))) : N.key === "ArrowUp" ? (N.preventDefault(), o((S) => Math.max(S - 1, 0))) : N.key === "Enter" && p >= 0 ? (N.preventDefault(), c(d[p])) : N.key === "Escape" && (n(!1), o(-1)));
|
|
442
442
|
};
|
|
443
443
|
X(() => {
|
|
444
444
|
const N = (S) => {
|
|
445
|
-
b.current && !b.current.contains(S.target) && (n(!1),
|
|
445
|
+
b.current && !b.current.contains(S.target) && (n(!1), o(-1));
|
|
446
446
|
};
|
|
447
447
|
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
448
448
|
}, []);
|
|
@@ -485,11 +485,11 @@ function He({ value: e, onChange: t, availableIcons: i }) {
|
|
|
485
485
|
{
|
|
486
486
|
id: `${m}-option-${S}`,
|
|
487
487
|
role: "option",
|
|
488
|
-
"aria-selected": S ===
|
|
488
|
+
"aria-selected": S === p,
|
|
489
489
|
onMouseDown: (x) => {
|
|
490
490
|
x.preventDefault(), c(N);
|
|
491
491
|
},
|
|
492
|
-
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${S ===
|
|
492
|
+
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${S === p ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
|
|
493
493
|
children: N
|
|
494
494
|
},
|
|
495
495
|
`${S}-${N}`
|
|
@@ -547,7 +547,7 @@ function Ze({
|
|
|
547
547
|
availableProperties: i = [],
|
|
548
548
|
onFetchDistinctValues: r
|
|
549
549
|
}) {
|
|
550
|
-
const [n,
|
|
550
|
+
const [n, p] = A(() => Je(e)), [o, b] = A(!1), m = Ke(e), w = Qe(e), d = n === "match" ? m.property : "", f = n === "match" ? m.pairs : [], c = n === "match" ? m.fallback : "#000000", u = n === "interpolate" ? w.property : "", s = n === "interpolate" ? w.stops : [], v = i.filter(
|
|
551
551
|
(h) => !h.type || h.type === "string"
|
|
552
552
|
), N = i.filter(
|
|
553
553
|
(h) => h.type === "number" || h.type === "integer"
|
|
@@ -600,7 +600,7 @@ function Ze({
|
|
|
600
600
|
const h = ((I = s[s.length - 1]) == null ? void 0 : I.stop) ?? 0, T = [...s, { stop: h + 10, color: ae(s.length) }];
|
|
601
601
|
M(u, T);
|
|
602
602
|
}, B = (h) => {
|
|
603
|
-
|
|
603
|
+
p(h), t(h === "match" ? he("", [], "#000000") : ge("", []));
|
|
604
604
|
};
|
|
605
605
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
606
606
|
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((h) => /* @__PURE__ */ a(
|
|
@@ -662,9 +662,9 @@ function Ze({
|
|
|
662
662
|
{
|
|
663
663
|
type: "button",
|
|
664
664
|
onClick: $,
|
|
665
|
-
disabled:
|
|
665
|
+
disabled: o,
|
|
666
666
|
className: te,
|
|
667
|
-
children:
|
|
667
|
+
children: o ? "Loading…" : "Auto-populate"
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] })
|
|
@@ -767,9 +767,9 @@ function ye({
|
|
|
767
767
|
onChange: i,
|
|
768
768
|
availableIcons: r,
|
|
769
769
|
availableProperties: n,
|
|
770
|
-
onFetchDistinctValues:
|
|
770
|
+
onFetchDistinctValues: p
|
|
771
771
|
}) {
|
|
772
|
-
var
|
|
772
|
+
var o, b;
|
|
773
773
|
switch (e.widget) {
|
|
774
774
|
case "color": {
|
|
775
775
|
const m = Array.isArray(t), w = m ? t[t.length - 1] ?? "#000000" : "#000000";
|
|
@@ -796,7 +796,7 @@ function ye({
|
|
|
796
796
|
value: t,
|
|
797
797
|
onChange: (d) => i(d),
|
|
798
798
|
availableProperties: n,
|
|
799
|
-
onFetchDistinctValues:
|
|
799
|
+
onFetchDistinctValues: p
|
|
800
800
|
}
|
|
801
801
|
) : /* @__PURE__ */ a(
|
|
802
802
|
Y,
|
|
@@ -843,7 +843,7 @@ function ye({
|
|
|
843
843
|
return /* @__PURE__ */ a(
|
|
844
844
|
"select",
|
|
845
845
|
{
|
|
846
|
-
value: t ?? ((
|
|
846
|
+
value: t ?? ((o = e.options) == null ? void 0 : o[0]) ?? "",
|
|
847
847
|
onChange: (m) => i(m.target.value),
|
|
848
848
|
className: z,
|
|
849
849
|
children: (b = e.options) == null ? void 0 : b.map((m) => /* @__PURE__ */ a("option", { value: m, children: m }, m))
|
|
@@ -907,9 +907,9 @@ function ye({
|
|
|
907
907
|
return null;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
function ta({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues:
|
|
911
|
-
const
|
|
912
|
-
if (
|
|
910
|
+
function ta({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues: p }) {
|
|
911
|
+
const o = e.enableDefault !== void 0, b = t !== void 0;
|
|
912
|
+
if (o && e.widget === "boolean") {
|
|
913
913
|
const m = !e.enableDefault;
|
|
914
914
|
return /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
915
915
|
"input",
|
|
@@ -923,7 +923,7 @@ function ta({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
923
923
|
}
|
|
924
924
|
) });
|
|
925
925
|
}
|
|
926
|
-
return
|
|
926
|
+
return o ? /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
927
927
|
/* @__PURE__ */ a(
|
|
928
928
|
"input",
|
|
929
929
|
{
|
|
@@ -943,7 +943,7 @@ function ta({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
943
943
|
onChange: (m) => i(e.key, m),
|
|
944
944
|
availableIcons: r,
|
|
945
945
|
availableProperties: n,
|
|
946
|
-
onFetchDistinctValues:
|
|
946
|
+
onFetchDistinctValues: p
|
|
947
947
|
}
|
|
948
948
|
)
|
|
949
949
|
] }) }) : /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
@@ -954,7 +954,7 @@ function ta({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
954
954
|
onChange: (m) => i(e.key, m),
|
|
955
955
|
availableIcons: r,
|
|
956
956
|
availableProperties: n,
|
|
957
|
-
onFetchDistinctValues:
|
|
957
|
+
onFetchDistinctValues: p
|
|
958
958
|
}
|
|
959
959
|
) });
|
|
960
960
|
}
|
|
@@ -964,8 +964,8 @@ function fe({
|
|
|
964
964
|
values: i,
|
|
965
965
|
onChange: r,
|
|
966
966
|
defaultOpen: n = !1,
|
|
967
|
-
availableIcons:
|
|
968
|
-
availableProperties:
|
|
967
|
+
availableIcons: p,
|
|
968
|
+
availableProperties: o,
|
|
969
969
|
onFetchDistinctValues: b
|
|
970
970
|
}) {
|
|
971
971
|
const m = t.filter(
|
|
@@ -977,8 +977,8 @@ function fe({
|
|
|
977
977
|
def: w,
|
|
978
978
|
value: i[w.key],
|
|
979
979
|
onChange: r,
|
|
980
|
-
availableIcons:
|
|
981
|
-
availableProperties:
|
|
980
|
+
availableIcons: p,
|
|
981
|
+
availableProperties: o,
|
|
982
982
|
onFetchDistinctValues: b
|
|
983
983
|
},
|
|
984
984
|
w.key
|
|
@@ -1010,8 +1010,8 @@ function ra(e) {
|
|
|
1010
1010
|
if (e[0] === "match") {
|
|
1011
1011
|
const t = [];
|
|
1012
1012
|
for (let r = 2; r < e.length - 1; r += 2) {
|
|
1013
|
-
const n = String(e[r]),
|
|
1014
|
-
typeof
|
|
1013
|
+
const n = String(e[r]), p = e[r + 1];
|
|
1014
|
+
typeof p == "string" && t.push({ label: n, color: p });
|
|
1015
1015
|
}
|
|
1016
1016
|
const i = e[e.length - 1];
|
|
1017
1017
|
return typeof i == "string" && t.push({ label: "Other", color: i }), t;
|
|
@@ -1042,7 +1042,7 @@ function na(e) {
|
|
|
1042
1042
|
return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function oa(e) {
|
|
1046
1046
|
switch (e.type) {
|
|
1047
1047
|
case "fill":
|
|
1048
1048
|
return "square";
|
|
@@ -1063,7 +1063,7 @@ function ie({ expr: e, height: t }) {
|
|
|
1063
1063
|
title: "Expression (no preview)"
|
|
1064
1064
|
}
|
|
1065
1065
|
);
|
|
1066
|
-
const r = e[0] === "interpolate", n = r ? `linear-gradient(to right, ${i.join(", ")})` : i.map((
|
|
1066
|
+
const r = e[0] === "interpolate", n = r ? `linear-gradient(to right, ${i.join(", ")})` : i.map((p, o) => `${p} ${o / i.length * 100}% ${(o + 1) / i.length * 100}%`).join(", ");
|
|
1067
1067
|
return /* @__PURE__ */ a(
|
|
1068
1068
|
"div",
|
|
1069
1069
|
{
|
|
@@ -1080,7 +1080,7 @@ function ie({ expr: e, height: t }) {
|
|
|
1080
1080
|
function xe(e, t) {
|
|
1081
1081
|
return typeof e == "string" ? e : W(e) ? Me(e)[0] ?? t : t;
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function pa({ style: e }) {
|
|
1084
1084
|
if (e.type === "fill") {
|
|
1085
1085
|
const r = e.paint["fill-color"];
|
|
1086
1086
|
return /* @__PURE__ */ a(
|
|
@@ -1309,7 +1309,7 @@ const fa = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py
|
|
|
1309
1309
|
circle: "Circle",
|
|
1310
1310
|
symbol: "Symbol"
|
|
1311
1311
|
}, xa = ["text", "icon", "both"];
|
|
1312
|
-
function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties:
|
|
1312
|
+
function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties: p, onFetchDistinctValues: o }) {
|
|
1313
1313
|
const b = r ?? (i ? [i] : []), [m, w] = A(() => ve(e));
|
|
1314
1314
|
X(() => {
|
|
1315
1315
|
w(ve(e));
|
|
@@ -1390,7 +1390,7 @@ function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availa
|
|
|
1390
1390
|
)) }) }),
|
|
1391
1391
|
/* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
|
|
1392
1392
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
|
|
1393
|
-
/* @__PURE__ */ a(
|
|
1393
|
+
/* @__PURE__ */ a(pa, { style: e })
|
|
1394
1394
|
] }),
|
|
1395
1395
|
E.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1396
1396
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
|
|
@@ -1403,8 +1403,8 @@ function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availa
|
|
|
1403
1403
|
onChange: u,
|
|
1404
1404
|
defaultOpen: $ === 0,
|
|
1405
1405
|
availableIcons: n,
|
|
1406
|
-
availableProperties:
|
|
1407
|
-
onFetchDistinctValues:
|
|
1406
|
+
availableProperties: p,
|
|
1407
|
+
onFetchDistinctValues: o
|
|
1408
1408
|
},
|
|
1409
1409
|
y
|
|
1410
1410
|
))
|
|
@@ -1420,8 +1420,8 @@ function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availa
|
|
|
1420
1420
|
onChange: c,
|
|
1421
1421
|
defaultOpen: !1,
|
|
1422
1422
|
availableIcons: n,
|
|
1423
|
-
availableProperties:
|
|
1424
|
-
onFetchDistinctValues:
|
|
1423
|
+
availableProperties: p,
|
|
1424
|
+
onFetchDistinctValues: o
|
|
1425
1425
|
},
|
|
1426
1426
|
y
|
|
1427
1427
|
))
|
|
@@ -1466,12 +1466,12 @@ function va({ value: e, onChange: t }) {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
const ke = () => ({ label: "", color: "#4a90d9", shape: "square" }), re = 8, Ce = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
1468
1468
|
function Na({ value: e, onChange: t, styles: i }) {
|
|
1469
|
-
const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple",
|
|
1469
|
+
const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", p = Ee(() => {
|
|
1470
1470
|
if (!i || i.length === 0) return null;
|
|
1471
1471
|
const c = [];
|
|
1472
1472
|
let u = "simple", s = null;
|
|
1473
1473
|
for (const v of i) {
|
|
1474
|
-
const N = na(v), S =
|
|
1474
|
+
const N = na(v), S = oa(v);
|
|
1475
1475
|
if (W(N)) {
|
|
1476
1476
|
const x = ia(N);
|
|
1477
1477
|
if (!x) continue;
|
|
@@ -1480,7 +1480,7 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1480
1480
|
} else typeof N == "string" && c.push({ label: v.type, color: N, shape: S });
|
|
1481
1481
|
}
|
|
1482
1482
|
return c.length === 0 ? null : { entries: c, mode: u, property: s };
|
|
1483
|
-
}, [i]),
|
|
1483
|
+
}, [i]), o = () => {
|
|
1484
1484
|
t({ ...e, entries: [...r, ke()] });
|
|
1485
1485
|
}, b = (c, u) => {
|
|
1486
1486
|
const s = r.map((v, N) => N === c ? u : v);
|
|
@@ -1491,16 +1491,16 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1491
1491
|
}, w = (c) => {
|
|
1492
1492
|
t(c ? { entries: [ke()] } : void 0);
|
|
1493
1493
|
}, d = () => {
|
|
1494
|
-
|
|
1495
|
-
entries:
|
|
1496
|
-
displayMode:
|
|
1497
|
-
...
|
|
1498
|
-
...
|
|
1494
|
+
p && t({
|
|
1495
|
+
entries: p.entries,
|
|
1496
|
+
displayMode: p.mode,
|
|
1497
|
+
...p.mode === "gradient" && p.property ? { gradientProperty: p.property } : {},
|
|
1498
|
+
...p.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
|
|
1499
1499
|
});
|
|
1500
1500
|
}, f = (c) => {
|
|
1501
1501
|
if (!e) return;
|
|
1502
1502
|
const u = { ...e, displayMode: c };
|
|
1503
|
-
c !== "categorical" && delete u.showLabelsCollapsed, c !== "gradient" && delete u.gradientProperty, t(u);
|
|
1503
|
+
c !== "categorical" && delete u.showLabelsCollapsed, c !== "categorical" && delete u.showColorBar, c !== "gradient" && delete u.gradientProperty, c === "simple" && delete u.showDisclosureArrow, t(u);
|
|
1504
1504
|
};
|
|
1505
1505
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1506
1506
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -1516,10 +1516,10 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1516
1516
|
),
|
|
1517
1517
|
/* @__PURE__ */ a("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
|
|
1518
1518
|
] }),
|
|
1519
|
-
e === void 0 &&
|
|
1520
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children:
|
|
1519
|
+
e === void 0 && p && p.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
1520
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: p.mode !== "simple" ? `This layer uses data-driven colors (${p.entries.length} ${p.entries.length === 1 ? "category" : "categories"})` : `This layer has ${p.entries.length} style ${p.entries.length === 1 ? "color" : "colors"}` }),
|
|
1521
1521
|
/* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
|
|
1522
|
-
|
|
1522
|
+
p.entries.slice(0, re).map((c, u) => /* @__PURE__ */ l(
|
|
1523
1523
|
"div",
|
|
1524
1524
|
{
|
|
1525
1525
|
className: "mapui:flex mapui:items-center mapui:gap-1",
|
|
@@ -1537,9 +1537,9 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1537
1537
|
},
|
|
1538
1538
|
`${c.label}-${u}`
|
|
1539
1539
|
)),
|
|
1540
|
-
|
|
1540
|
+
p.entries.length > re && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
|
|
1541
1541
|
"+",
|
|
1542
|
-
|
|
1542
|
+
p.entries.length - re,
|
|
1543
1543
|
" more"
|
|
1544
1544
|
] })
|
|
1545
1545
|
] }),
|
|
@@ -1584,6 +1584,32 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1584
1584
|
),
|
|
1585
1585
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-labels-collapsed", className: "mapui:text-sm mapui:text-gray-700", children: "Show labels in collapsed view" })
|
|
1586
1586
|
] }),
|
|
1587
|
+
n === "categorical" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1588
|
+
/* @__PURE__ */ a(
|
|
1589
|
+
"input",
|
|
1590
|
+
{
|
|
1591
|
+
type: "checkbox",
|
|
1592
|
+
id: "legend-show-color-bar",
|
|
1593
|
+
checked: e.showColorBar !== !1,
|
|
1594
|
+
onChange: (c) => t({ ...e, showColorBar: c.target.checked }),
|
|
1595
|
+
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1596
|
+
}
|
|
1597
|
+
),
|
|
1598
|
+
/* @__PURE__ */ a("label", { htmlFor: "legend-show-color-bar", className: "mapui:text-sm mapui:text-gray-700", children: "Show color bar" })
|
|
1599
|
+
] }),
|
|
1600
|
+
(n === "categorical" || n === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1601
|
+
/* @__PURE__ */ a(
|
|
1602
|
+
"input",
|
|
1603
|
+
{
|
|
1604
|
+
type: "checkbox",
|
|
1605
|
+
id: "legend-show-disclosure-arrow",
|
|
1606
|
+
checked: e.showDisclosureArrow !== !1,
|
|
1607
|
+
onChange: (c) => t({ ...e, showDisclosureArrow: c.target.checked }),
|
|
1608
|
+
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1609
|
+
}
|
|
1610
|
+
),
|
|
1611
|
+
/* @__PURE__ */ a("label", { htmlFor: "legend-show-disclosure-arrow", className: "mapui:text-sm mapui:text-gray-700", children: "Show disclosure arrow" })
|
|
1612
|
+
] }),
|
|
1587
1613
|
n === "gradient" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1588
1614
|
/* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Property" }),
|
|
1589
1615
|
/* @__PURE__ */ a(
|
|
@@ -1634,12 +1660,12 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1634
1660
|
"button",
|
|
1635
1661
|
{
|
|
1636
1662
|
type: "button",
|
|
1637
|
-
onClick:
|
|
1663
|
+
onClick: o,
|
|
1638
1664
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
1639
1665
|
children: "+ Add Entry"
|
|
1640
1666
|
}
|
|
1641
1667
|
),
|
|
1642
|
-
|
|
1668
|
+
p && p.entries.length > 0 && /* @__PURE__ */ l(
|
|
1643
1669
|
"button",
|
|
1644
1670
|
{
|
|
1645
1671
|
type: "button",
|
|
@@ -1647,7 +1673,7 @@ function Na({ value: e, onChange: t, styles: i }) {
|
|
|
1647
1673
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-50",
|
|
1648
1674
|
children: [
|
|
1649
1675
|
"Populate from Style (",
|
|
1650
|
-
|
|
1676
|
+
p.entries.length,
|
|
1651
1677
|
" entries)"
|
|
1652
1678
|
]
|
|
1653
1679
|
}
|
|
@@ -1662,18 +1688,18 @@ function Se({
|
|
|
1662
1688
|
placeholder: i,
|
|
1663
1689
|
className: r
|
|
1664
1690
|
}) {
|
|
1665
|
-
const [n,
|
|
1691
|
+
const [n, p] = A(() => (e == null ? void 0 : e.join(", ")) ?? "");
|
|
1666
1692
|
return X(() => {
|
|
1667
|
-
|
|
1693
|
+
p((e == null ? void 0 : e.join(", ")) ?? "");
|
|
1668
1694
|
}, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
|
|
1669
1695
|
"input",
|
|
1670
1696
|
{
|
|
1671
1697
|
type: "text",
|
|
1672
1698
|
value: n,
|
|
1673
|
-
onChange: (b) =>
|
|
1699
|
+
onChange: (b) => p(b.target.value),
|
|
1674
1700
|
onBlur: () => {
|
|
1675
1701
|
const b = n.trim(), m = b ? b.split(",").map((w) => w.trim()).filter(Boolean) : void 0;
|
|
1676
|
-
t(m),
|
|
1702
|
+
t(m), p((m == null ? void 0 : m.join(", ")) ?? "");
|
|
1677
1703
|
},
|
|
1678
1704
|
placeholder: i,
|
|
1679
1705
|
className: r
|
|
@@ -1687,15 +1713,15 @@ const R = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-
|
|
|
1687
1713
|
select: { type: "select", property: "", label: "" }
|
|
1688
1714
|
};
|
|
1689
1715
|
function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
1690
|
-
const r = (
|
|
1691
|
-
t({ ...ka[
|
|
1692
|
-
}, n = (
|
|
1716
|
+
const r = (o) => {
|
|
1717
|
+
t({ ...ka[o], property: e.property, label: e.label });
|
|
1718
|
+
}, n = (o) => t({ ...e, ...o }), p = i && i.length > 0;
|
|
1693
1719
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1694
1720
|
/* @__PURE__ */ a(D, { label: "Field Type", children: /* @__PURE__ */ l(
|
|
1695
1721
|
"select",
|
|
1696
1722
|
{
|
|
1697
1723
|
value: e.type,
|
|
1698
|
-
onChange: (
|
|
1724
|
+
onChange: (o) => r(o.target.value),
|
|
1699
1725
|
className: R,
|
|
1700
1726
|
children: [
|
|
1701
1727
|
/* @__PURE__ */ a("option", { value: "text", children: "Text" }),
|
|
@@ -1705,15 +1731,15 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1705
1731
|
]
|
|
1706
1732
|
}
|
|
1707
1733
|
) }),
|
|
1708
|
-
/* @__PURE__ */ a(D, { label: "Property", required: !0, children:
|
|
1734
|
+
/* @__PURE__ */ a(D, { label: "Property", required: !0, children: p ? /* @__PURE__ */ l(
|
|
1709
1735
|
"select",
|
|
1710
1736
|
{
|
|
1711
1737
|
value: e.property,
|
|
1712
|
-
onChange: (
|
|
1738
|
+
onChange: (o) => n({ property: o.target.value }),
|
|
1713
1739
|
className: R,
|
|
1714
1740
|
children: [
|
|
1715
1741
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
1716
|
-
i.map((
|
|
1742
|
+
i.map((o) => /* @__PURE__ */ a("option", { value: o.name, children: o.title ?? o.name }, o.name))
|
|
1717
1743
|
]
|
|
1718
1744
|
}
|
|
1719
1745
|
) : /* @__PURE__ */ a(
|
|
@@ -1721,7 +1747,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1721
1747
|
{
|
|
1722
1748
|
type: "text",
|
|
1723
1749
|
value: e.property,
|
|
1724
|
-
onChange: (
|
|
1750
|
+
onChange: (o) => n({ property: o.target.value }),
|
|
1725
1751
|
placeholder: "e.g. name",
|
|
1726
1752
|
className: R
|
|
1727
1753
|
}
|
|
@@ -1731,7 +1757,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1731
1757
|
{
|
|
1732
1758
|
type: "text",
|
|
1733
1759
|
value: e.label,
|
|
1734
|
-
onChange: (
|
|
1760
|
+
onChange: (o) => n({ label: o.target.value }),
|
|
1735
1761
|
placeholder: "Display label",
|
|
1736
1762
|
className: R
|
|
1737
1763
|
}
|
|
@@ -1741,7 +1767,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1741
1767
|
{
|
|
1742
1768
|
type: "text",
|
|
1743
1769
|
value: e.placeholder ?? "",
|
|
1744
|
-
onChange: (
|
|
1770
|
+
onChange: (o) => n({ placeholder: o.target.value || void 0 }),
|
|
1745
1771
|
placeholder: "Input placeholder text",
|
|
1746
1772
|
className: R
|
|
1747
1773
|
}
|
|
@@ -1754,7 +1780,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1754
1780
|
type: "checkbox",
|
|
1755
1781
|
id: "text-autocomplete",
|
|
1756
1782
|
checked: e.autocomplete ?? !1,
|
|
1757
|
-
onChange: (
|
|
1783
|
+
onChange: (o) => t({ ...e, autocomplete: o.target.checked }),
|
|
1758
1784
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1759
1785
|
}
|
|
1760
1786
|
),
|
|
@@ -1767,7 +1793,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1767
1793
|
type: "checkbox",
|
|
1768
1794
|
id: "text-prefetch",
|
|
1769
1795
|
checked: e.prefetch ?? !1,
|
|
1770
|
-
onChange: (
|
|
1796
|
+
onChange: (o) => t({ ...e, prefetch: o.target.checked }),
|
|
1771
1797
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1772
1798
|
}
|
|
1773
1799
|
),
|
|
@@ -1777,7 +1803,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1777
1803
|
Se,
|
|
1778
1804
|
{
|
|
1779
1805
|
options: e.options,
|
|
1780
|
-
onChange: (
|
|
1806
|
+
onChange: (o) => t({ ...e, options: o }),
|
|
1781
1807
|
placeholder: "option1, option2",
|
|
1782
1808
|
className: R
|
|
1783
1809
|
}
|
|
@@ -1788,9 +1814,9 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1788
1814
|
"select",
|
|
1789
1815
|
{
|
|
1790
1816
|
value: e.inputMode ?? "input",
|
|
1791
|
-
onChange: (
|
|
1817
|
+
onChange: (o) => t({
|
|
1792
1818
|
...e,
|
|
1793
|
-
inputMode:
|
|
1819
|
+
inputMode: o.target.value
|
|
1794
1820
|
}),
|
|
1795
1821
|
className: R,
|
|
1796
1822
|
children: [
|
|
@@ -1803,9 +1829,9 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1803
1829
|
"select",
|
|
1804
1830
|
{
|
|
1805
1831
|
value: e.operator ?? "eq",
|
|
1806
|
-
onChange: (
|
|
1832
|
+
onChange: (o) => t({
|
|
1807
1833
|
...e,
|
|
1808
|
-
operator:
|
|
1834
|
+
operator: o.target.value
|
|
1809
1835
|
}),
|
|
1810
1836
|
className: R,
|
|
1811
1837
|
children: [
|
|
@@ -1824,9 +1850,9 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1824
1850
|
{
|
|
1825
1851
|
type: "number",
|
|
1826
1852
|
value: e.min ?? "",
|
|
1827
|
-
onChange: (
|
|
1853
|
+
onChange: (o) => t({
|
|
1828
1854
|
...e,
|
|
1829
|
-
min:
|
|
1855
|
+
min: o.target.value ? parseFloat(o.target.value) : void 0
|
|
1830
1856
|
}),
|
|
1831
1857
|
className: R
|
|
1832
1858
|
}
|
|
@@ -1836,9 +1862,9 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1836
1862
|
{
|
|
1837
1863
|
type: "number",
|
|
1838
1864
|
value: e.max ?? "",
|
|
1839
|
-
onChange: (
|
|
1865
|
+
onChange: (o) => t({
|
|
1840
1866
|
...e,
|
|
1841
|
-
max:
|
|
1867
|
+
max: o.target.value ? parseFloat(o.target.value) : void 0
|
|
1842
1868
|
}),
|
|
1843
1869
|
className: R
|
|
1844
1870
|
}
|
|
@@ -1848,9 +1874,9 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1848
1874
|
{
|
|
1849
1875
|
type: "number",
|
|
1850
1876
|
value: e.step ?? "",
|
|
1851
|
-
onChange: (
|
|
1877
|
+
onChange: (o) => t({
|
|
1852
1878
|
...e,
|
|
1853
|
-
step:
|
|
1879
|
+
step: o.target.value ? parseFloat(o.target.value) : void 0
|
|
1854
1880
|
}),
|
|
1855
1881
|
className: R
|
|
1856
1882
|
}
|
|
@@ -1864,7 +1890,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1864
1890
|
type: "checkbox",
|
|
1865
1891
|
id: "datetime-range",
|
|
1866
1892
|
checked: e.range ?? !1,
|
|
1867
|
-
onChange: (
|
|
1893
|
+
onChange: (o) => t({ ...e, range: o.target.checked }),
|
|
1868
1894
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1869
1895
|
}
|
|
1870
1896
|
),
|
|
@@ -1878,7 +1904,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1878
1904
|
type: "checkbox",
|
|
1879
1905
|
id: "select-prefetch",
|
|
1880
1906
|
checked: e.prefetch ?? !1,
|
|
1881
|
-
onChange: (
|
|
1907
|
+
onChange: (o) => t({ ...e, prefetch: o.target.checked }),
|
|
1882
1908
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1883
1909
|
}
|
|
1884
1910
|
),
|
|
@@ -1888,7 +1914,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1888
1914
|
Se,
|
|
1889
1915
|
{
|
|
1890
1916
|
options: e.options,
|
|
1891
|
-
onChange: (
|
|
1917
|
+
onChange: (o) => t({ ...e, options: o }),
|
|
1892
1918
|
placeholder: "option1, option2",
|
|
1893
1919
|
className: R
|
|
1894
1920
|
}
|
|
@@ -1903,10 +1929,10 @@ const Sa = () => ({
|
|
|
1903
1929
|
autocomplete: !1
|
|
1904
1930
|
});
|
|
1905
1931
|
function Da({ fields: e, onChange: t, availableProperties: i }) {
|
|
1906
|
-
const [r, n] = A(null),
|
|
1932
|
+
const [r, n] = A(null), p = () => {
|
|
1907
1933
|
const d = [...e, Sa()];
|
|
1908
1934
|
t(d), n(d.length - 1);
|
|
1909
|
-
},
|
|
1935
|
+
}, o = (d, f) => {
|
|
1910
1936
|
t(e.map((c, u) => u === d ? f : c));
|
|
1911
1937
|
}, b = (d) => {
|
|
1912
1938
|
t(e.filter((f, c) => c !== d)), n(null);
|
|
@@ -1974,7 +2000,7 @@ function Da({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1974
2000
|
Ca,
|
|
1975
2001
|
{
|
|
1976
2002
|
value: d,
|
|
1977
|
-
onChange: (c) =>
|
|
2003
|
+
onChange: (c) => o(f, c),
|
|
1978
2004
|
availableProperties: i
|
|
1979
2005
|
}
|
|
1980
2006
|
) })
|
|
@@ -1983,7 +2009,7 @@ function Da({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1983
2009
|
"button",
|
|
1984
2010
|
{
|
|
1985
2011
|
type: "button",
|
|
1986
|
-
onClick:
|
|
2012
|
+
onClick: p,
|
|
1987
2013
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
1988
2014
|
children: "+ Add Search Field"
|
|
1989
2015
|
}
|
|
@@ -2008,23 +2034,23 @@ function La(e) {
|
|
|
2008
2034
|
}
|
|
2009
2035
|
const le = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
2010
2036
|
function Aa({ value: e, onChange: t, availableProperties: i }) {
|
|
2011
|
-
const r = Ta(e), n = i && i.length > 0,
|
|
2012
|
-
|
|
2037
|
+
const r = Ta(e), n = i && i.length > 0, p = (u) => t(La(u)), o = () => {
|
|
2038
|
+
p([...r, { key: "", label: "", visible: !0 }]);
|
|
2013
2039
|
}, b = (u) => {
|
|
2014
|
-
|
|
2040
|
+
p(r.filter((s, v) => v !== u));
|
|
2015
2041
|
}, m = (u, s) => {
|
|
2016
|
-
|
|
2042
|
+
p(r.map((v, N) => N === u ? { ...v, ...s } : v));
|
|
2017
2043
|
}, w = (u, s) => {
|
|
2018
2044
|
const v = i == null ? void 0 : i.find((S) => S.name === s), N = (v == null ? void 0 : v.title) ?? r[u].label;
|
|
2019
|
-
|
|
2045
|
+
p(r.map((S, x) => x === u ? { ...S, key: s, label: N } : S));
|
|
2020
2046
|
}, d = (u) => {
|
|
2021
2047
|
if (u === 0) return;
|
|
2022
2048
|
const s = [...r];
|
|
2023
|
-
[s[u - 1], s[u]] = [s[u], s[u - 1]],
|
|
2049
|
+
[s[u - 1], s[u]] = [s[u], s[u - 1]], p(s);
|
|
2024
2050
|
}, f = (u) => {
|
|
2025
2051
|
if (u === r.length - 1) return;
|
|
2026
2052
|
const s = [...r];
|
|
2027
|
-
[s[u], s[u + 1]] = [s[u + 1], s[u]],
|
|
2053
|
+
[s[u], s[u + 1]] = [s[u + 1], s[u]], p(s);
|
|
2028
2054
|
}, c = () => {
|
|
2029
2055
|
if (!i) return;
|
|
2030
2056
|
const u = i.map((s) => ({
|
|
@@ -2032,7 +2058,7 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2032
2058
|
label: s.title ?? "",
|
|
2033
2059
|
visible: !0
|
|
2034
2060
|
}));
|
|
2035
|
-
|
|
2061
|
+
p(u);
|
|
2036
2062
|
};
|
|
2037
2063
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2038
2064
|
r.length === 0 ? /* @__PURE__ */ l(q, { children: [
|
|
@@ -2139,7 +2165,7 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2139
2165
|
"button",
|
|
2140
2166
|
{
|
|
2141
2167
|
type: "button",
|
|
2142
|
-
onClick:
|
|
2168
|
+
onClick: o,
|
|
2143
2169
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
2144
2170
|
children: "+ Add Property"
|
|
2145
2171
|
}
|
|
@@ -2199,8 +2225,8 @@ function Ue(e) {
|
|
|
2199
2225
|
function Pa(e) {
|
|
2200
2226
|
const t = /* @__PURE__ */ new Set();
|
|
2201
2227
|
for (const n of e) {
|
|
2202
|
-
const
|
|
2203
|
-
|
|
2228
|
+
const p = n.toLowerCase();
|
|
2229
|
+
p.includes("polygon") ? t.add("polygon") : p.includes("linestring") ? t.add("line") : p.includes("point") && t.add("point");
|
|
2204
2230
|
}
|
|
2205
2231
|
const i = t.size > 1, r = [];
|
|
2206
2232
|
return t.has("polygon") && r.push({
|
|
@@ -2220,13 +2246,13 @@ function Pa(e) {
|
|
|
2220
2246
|
async function Ya(e, t) {
|
|
2221
2247
|
var i, r;
|
|
2222
2248
|
try {
|
|
2223
|
-
const n = await Pe(e, t),
|
|
2224
|
-
if (
|
|
2249
|
+
const n = await Pe(e, t), p = Ea(n);
|
|
2250
|
+
if (p) return p;
|
|
2225
2251
|
} catch {
|
|
2226
2252
|
}
|
|
2227
2253
|
try {
|
|
2228
|
-
const
|
|
2229
|
-
if (typeof
|
|
2254
|
+
const p = (r = (i = (await se(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
|
|
2255
|
+
if (typeof p == "string") return Re(p);
|
|
2230
2256
|
} catch {
|
|
2231
2257
|
}
|
|
2232
2258
|
return null;
|
|
@@ -2239,9 +2265,9 @@ async function Xa(e, t) {
|
|
|
2239
2265
|
}
|
|
2240
2266
|
try {
|
|
2241
2267
|
const i = await se(e, t, { limit: 20 }), r = Ue(i.features), n = /* @__PURE__ */ new Set();
|
|
2242
|
-
for (const
|
|
2243
|
-
for (const
|
|
2244
|
-
n.add(
|
|
2268
|
+
for (const p of r)
|
|
2269
|
+
for (const o of Be(p))
|
|
2270
|
+
n.add(o);
|
|
2245
2271
|
return Array.from(n);
|
|
2246
2272
|
} catch {
|
|
2247
2273
|
}
|
|
@@ -2260,10 +2286,10 @@ function Oa(e, t) {
|
|
|
2260
2286
|
const V = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
2261
2287
|
function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
2262
2288
|
var S;
|
|
2263
|
-
const n = (x) => t({ ...e, ...x }),
|
|
2264
|
-
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2289
|
+
const n = (x) => t({ ...e, ...x }), p = ue(e);
|
|
2290
|
+
p.current = e;
|
|
2291
|
+
const o = ue(t);
|
|
2292
|
+
o.current = t;
|
|
2267
2293
|
const b = i.find((x) => x.id === e.sourceId), m = (b == null ? void 0 : b.url) ?? null, w = e.collection || null, { collections: d, loading: f } = Fe(m), { queryables: c, loading: u } = Ve(m, w), s = c ? Fa(c) : [], [v, N] = A([]);
|
|
2268
2294
|
return X(() => {
|
|
2269
2295
|
if (!c) {
|
|
@@ -2273,7 +2299,7 @@ function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2273
2299
|
const x = (L) => {
|
|
2274
2300
|
var y;
|
|
2275
2301
|
const E = Pa(L);
|
|
2276
|
-
N(E), E.length > 0 && !((y =
|
|
2302
|
+
N(E), E.length > 0 && !((y = p.current.styles) != null && y.length) && o.current({ ...p.current, styles: E });
|
|
2277
2303
|
}, P = qe(c);
|
|
2278
2304
|
if (P.length > 0) {
|
|
2279
2305
|
const L = [];
|
|
@@ -2463,12 +2489,12 @@ const ne = () => ({
|
|
|
2463
2489
|
dataMode: "vector-tiles"
|
|
2464
2490
|
});
|
|
2465
2491
|
function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
2466
|
-
const [n,
|
|
2492
|
+
const [n, p] = A(null), [o, b] = A(!1), [m, w] = A(ne()), [d, f] = A(null), [c, u] = A(null), [s, v] = A(null), N = () => {
|
|
2467
2493
|
t([...e, m]), b(!1), w(ne());
|
|
2468
2494
|
}, S = (g) => {
|
|
2469
2495
|
t(e.map((k) => k.id === n ? g : k));
|
|
2470
2496
|
}, x = (g) => {
|
|
2471
|
-
t(e.filter((k) => k.id !== g)), f(null), n === g &&
|
|
2497
|
+
t(e.filter((k) => k.id !== g)), f(null), n === g && p(null);
|
|
2472
2498
|
}, P = (g) => {
|
|
2473
2499
|
if (g === 0) return;
|
|
2474
2500
|
const k = [...e];
|
|
@@ -2509,7 +2535,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2509
2535
|
}
|
|
2510
2536
|
)
|
|
2511
2537
|
] }),
|
|
2512
|
-
e.length === 0 && !
|
|
2538
|
+
e.length === 0 && !o && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
|
|
2513
2539
|
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((g, k) => {
|
|
2514
2540
|
var B, h, T, I, F;
|
|
2515
2541
|
const O = c === g.id, U = s === g.id, G = n === g.id;
|
|
@@ -2585,7 +2611,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2585
2611
|
"button",
|
|
2586
2612
|
{
|
|
2587
2613
|
type: "button",
|
|
2588
|
-
onClick: () =>
|
|
2614
|
+
onClick: () => p(n === g.id ? null : g.id),
|
|
2589
2615
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
2590
2616
|
children: n === g.id ? "Close" : "Edit"
|
|
2591
2617
|
}
|
|
@@ -2615,7 +2641,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2615
2641
|
g.id
|
|
2616
2642
|
);
|
|
2617
2643
|
}) }),
|
|
2618
|
-
|
|
2644
|
+
o && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2619
2645
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
|
|
2620
2646
|
/* @__PURE__ */ a(
|
|
2621
2647
|
De,
|
|
@@ -2716,12 +2742,12 @@ function Te({ value: e, onChange: t }) {
|
|
|
2716
2742
|
] })
|
|
2717
2743
|
] });
|
|
2718
2744
|
}
|
|
2719
|
-
const
|
|
2745
|
+
const oe = () => ({ id: "", label: "", url: "" });
|
|
2720
2746
|
function Ka({ basemaps: e, onChange: t }) {
|
|
2721
|
-
const [i, r] = A(null), [n,
|
|
2747
|
+
const [i, r] = A(null), [n, p] = A(!1), [o, b] = A(oe()), [m, w] = A(null), d = (u) => {
|
|
2722
2748
|
t(e.map((s) => s.id === i ? u : s));
|
|
2723
2749
|
}, f = () => {
|
|
2724
|
-
t([...e,
|
|
2750
|
+
t([...e, o]), p(!1), b(oe());
|
|
2725
2751
|
}, c = (u) => {
|
|
2726
2752
|
t(e.filter((s) => s.id !== u)), w(null);
|
|
2727
2753
|
};
|
|
@@ -2733,7 +2759,7 @@ function Ka({ basemaps: e, onChange: t }) {
|
|
|
2733
2759
|
{
|
|
2734
2760
|
type: "button",
|
|
2735
2761
|
onClick: () => {
|
|
2736
|
-
|
|
2762
|
+
p(!0), b(oe());
|
|
2737
2763
|
},
|
|
2738
2764
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
2739
2765
|
children: "+ Add Basemap"
|
|
@@ -2787,14 +2813,14 @@ function Ka({ basemaps: e, onChange: t }) {
|
|
|
2787
2813
|
)) }),
|
|
2788
2814
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2789
2815
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
|
|
2790
|
-
/* @__PURE__ */ a(Te, { value:
|
|
2816
|
+
/* @__PURE__ */ a(Te, { value: o, onChange: b }),
|
|
2791
2817
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
2792
2818
|
/* @__PURE__ */ a(
|
|
2793
2819
|
"button",
|
|
2794
2820
|
{
|
|
2795
2821
|
type: "button",
|
|
2796
2822
|
onClick: f,
|
|
2797
|
-
disabled: !
|
|
2823
|
+
disabled: !o.id || !o.url,
|
|
2798
2824
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
2799
2825
|
children: "Save"
|
|
2800
2826
|
}
|
|
@@ -2803,7 +2829,7 @@ function Ka({ basemaps: e, onChange: t }) {
|
|
|
2803
2829
|
"button",
|
|
2804
2830
|
{
|
|
2805
2831
|
type: "button",
|
|
2806
|
-
onClick: () =>
|
|
2832
|
+
onClick: () => p(!1),
|
|
2807
2833
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
2808
2834
|
children: "Cancel"
|
|
2809
2835
|
}
|
|
@@ -2857,7 +2883,7 @@ function Ae({ value: e, onChange: t }) {
|
|
|
2857
2883
|
] })
|
|
2858
2884
|
] });
|
|
2859
2885
|
}
|
|
2860
|
-
const
|
|
2886
|
+
const pe = () => ({ id: "", url: "" }), ja = (e) => {
|
|
2861
2887
|
try {
|
|
2862
2888
|
return new URL(e), !0;
|
|
2863
2889
|
} catch {
|
|
@@ -2865,10 +2891,10 @@ const oe = () => ({ id: "", url: "" }), ja = (e) => {
|
|
|
2865
2891
|
}
|
|
2866
2892
|
};
|
|
2867
2893
|
function Qa({ sprites: e, onChange: t }) {
|
|
2868
|
-
const [i, r] = A(null), [n,
|
|
2894
|
+
const [i, r] = A(null), [n, p] = A(!1), [o, b] = A(pe()), [m, w] = A(null), d = (u) => {
|
|
2869
2895
|
t(e.map((s, v) => v === i ? u : s));
|
|
2870
2896
|
}, f = () => {
|
|
2871
|
-
t([...e,
|
|
2897
|
+
t([...e, o]), p(!1), b(pe());
|
|
2872
2898
|
}, c = (u) => {
|
|
2873
2899
|
const s = e.findIndex((v) => v.id === u);
|
|
2874
2900
|
t(e.filter((v) => v.id !== u)), i !== null && (s === i ? r(null) : s < i && r(i - 1)), w(null);
|
|
@@ -2881,7 +2907,7 @@ function Qa({ sprites: e, onChange: t }) {
|
|
|
2881
2907
|
{
|
|
2882
2908
|
type: "button",
|
|
2883
2909
|
onClick: () => {
|
|
2884
|
-
|
|
2910
|
+
p(!0), b(pe());
|
|
2885
2911
|
},
|
|
2886
2912
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
2887
2913
|
children: "+ Add Sprite Sheet"
|
|
@@ -2927,14 +2953,14 @@ function Qa({ sprites: e, onChange: t }) {
|
|
|
2927
2953
|
)) }),
|
|
2928
2954
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2929
2955
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
|
|
2930
|
-
/* @__PURE__ */ a(Ae, { value:
|
|
2956
|
+
/* @__PURE__ */ a(Ae, { value: o, onChange: b }),
|
|
2931
2957
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
2932
2958
|
/* @__PURE__ */ a(
|
|
2933
2959
|
"button",
|
|
2934
2960
|
{
|
|
2935
2961
|
type: "button",
|
|
2936
2962
|
onClick: f,
|
|
2937
|
-
disabled: !
|
|
2963
|
+
disabled: !o.id || !o.url || !ja(o.url) || e.some((u) => u.id === o.id),
|
|
2938
2964
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
2939
2965
|
children: "Save"
|
|
2940
2966
|
}
|
|
@@ -2943,7 +2969,7 @@ function Qa({ sprites: e, onChange: t }) {
|
|
|
2943
2969
|
"button",
|
|
2944
2970
|
{
|
|
2945
2971
|
type: "button",
|
|
2946
|
-
onClick: () =>
|
|
2972
|
+
onClick: () => p(!1),
|
|
2947
2973
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
2948
2974
|
children: "Cancel"
|
|
2949
2975
|
}
|
|
@@ -2979,8 +3005,8 @@ function Za({ value: e, onChange: t }) {
|
|
|
2979
3005
|
};
|
|
2980
3006
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
2981
3007
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-2 mapui:text-xs mapui:text-gray-500", children: "Enable or disable UI panels and controls." }),
|
|
2982
|
-
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: $a.map(({ key: r, label: n, description:
|
|
2983
|
-
const
|
|
3008
|
+
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: $a.map(({ key: r, label: n, description: p }) => {
|
|
3009
|
+
const o = e[r];
|
|
2984
3010
|
return /* @__PURE__ */ l(
|
|
2985
3011
|
"label",
|
|
2986
3012
|
{
|
|
@@ -2988,14 +3014,14 @@ function Za({ value: e, onChange: t }) {
|
|
|
2988
3014
|
children: [
|
|
2989
3015
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
2990
3016
|
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: n }),
|
|
2991
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children:
|
|
3017
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: p })
|
|
2992
3018
|
] }),
|
|
2993
3019
|
/* @__PURE__ */ l("div", { className: "mapui:relative mapui:flex mapui:shrink-0 mapui:items-center", children: [
|
|
2994
3020
|
/* @__PURE__ */ a(
|
|
2995
3021
|
"input",
|
|
2996
3022
|
{
|
|
2997
3023
|
type: "checkbox",
|
|
2998
|
-
checked:
|
|
3024
|
+
checked: o,
|
|
2999
3025
|
onChange: (b) => i(r, b.target.checked),
|
|
3000
3026
|
className: "mapui:sr-only",
|
|
3001
3027
|
"aria-label": n
|
|
@@ -3006,14 +3032,14 @@ function Za({ value: e, onChange: t }) {
|
|
|
3006
3032
|
{
|
|
3007
3033
|
className: [
|
|
3008
3034
|
"mapui:relative mapui:h-5 mapui:w-9 mapui:rounded-full mapui:transition-colors",
|
|
3009
|
-
|
|
3035
|
+
o ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
|
|
3010
3036
|
].join(" "),
|
|
3011
3037
|
children: /* @__PURE__ */ a(
|
|
3012
3038
|
"div",
|
|
3013
3039
|
{
|
|
3014
3040
|
className: [
|
|
3015
3041
|
"mapui:absolute mapui:top-0.5 mapui:h-4 mapui:w-4 mapui:rounded-full mapui:bg-white mapui:shadow mapui:transition-transform",
|
|
3016
|
-
|
|
3042
|
+
o ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
|
|
3017
3043
|
].join(" ")
|
|
3018
3044
|
}
|
|
3019
3045
|
)
|
|
@@ -3045,17 +3071,17 @@ function Ra(e, t) {
|
|
|
3045
3071
|
const Ba = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
3046
3072
|
function et({ value: e, onChange: t }) {
|
|
3047
3073
|
const i = (r, n) => {
|
|
3048
|
-
const
|
|
3049
|
-
t({ ...e, [r]: isNaN(
|
|
3074
|
+
const p = parseFloat(n);
|
|
3075
|
+
t({ ...e, [r]: isNaN(p) ? 0 : p });
|
|
3050
3076
|
};
|
|
3051
|
-
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min:
|
|
3077
|
+
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min: p, max: o, step: b, placeholder: m }) => {
|
|
3052
3078
|
const w = Ra(r, e[r]);
|
|
3053
3079
|
return /* @__PURE__ */ a(D, { label: n, error: w, children: /* @__PURE__ */ a(
|
|
3054
3080
|
"input",
|
|
3055
3081
|
{
|
|
3056
3082
|
type: "number",
|
|
3057
|
-
min:
|
|
3058
|
-
max:
|
|
3083
|
+
min: p,
|
|
3084
|
+
max: o,
|
|
3059
3085
|
step: b,
|
|
3060
3086
|
value: e[r],
|
|
3061
3087
|
placeholder: m,
|
|
@@ -3104,7 +3130,7 @@ export {
|
|
|
3104
3130
|
Y as ColorPicker,
|
|
3105
3131
|
at as ConfigPreview,
|
|
3106
3132
|
Z as ConfirmDialog,
|
|
3107
|
-
|
|
3133
|
+
pt as CoordinateDisplay,
|
|
3108
3134
|
di as DatetimeSearchFieldSchema,
|
|
3109
3135
|
ct as ExportButton,
|
|
3110
3136
|
ht as FeatureDetailPanel,
|
|
@@ -3194,7 +3220,7 @@ export {
|
|
|
3194
3220
|
Rt as getCql2FilteredVectorTileUrl,
|
|
3195
3221
|
Bt as getFilteredVectorTileUrl,
|
|
3196
3222
|
na as getPrimaryColor,
|
|
3197
|
-
|
|
3223
|
+
oa as getShapeForStyleType,
|
|
3198
3224
|
qt as getTileJsonUrl,
|
|
3199
3225
|
Ut as getVectorTileUrl,
|
|
3200
3226
|
Gt as gt,
|
|
@@ -3222,7 +3248,7 @@ export {
|
|
|
3222
3248
|
li as useCsvExport,
|
|
3223
3249
|
ni as useOgcCollectionDetail,
|
|
3224
3250
|
Fe as useOgcCollections,
|
|
3225
|
-
|
|
3251
|
+
oi as useOgcFeatures,
|
|
3226
3252
|
Ve as useOgcQueryables,
|
|
3227
3253
|
Ui as validateMapConfig
|
|
3228
3254
|
};
|