@ogc-maps/storybook-components 0.6.1 → 0.7.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/README.md +2 -0
- package/dist/{Legend-B6uIqOSw.js → Legend-DNjVLgsd.js} +20 -20
- package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/cql2-DOJnQwcv.js +440 -0
- package/dist/hooks/index.js +1 -1
- package/dist/{index-B4i0zJXf.js → index-RzZtWlUz.js} +259 -238
- package/dist/main.js +795 -723
- package/dist/schemas/__tests__/config.test.d.ts +2 -0
- package/dist/schemas/__tests__/config.test.d.ts.map +1 -0
- package/dist/schemas/config.d.ts +398 -313
- 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.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +19 -18
- package/dist/utils/__tests__/queryableHelpers.test.d.ts +2 -0
- package/dist/utils/__tests__/queryableHelpers.test.d.ts.map +1 -0
- package/dist/utils/__tests__/wkt.test.d.ts +2 -0
- package/dist/utils/__tests__/wkt.test.d.ts.map +1 -0
- package/dist/utils/csvExport.d.ts.map +1 -1
- package/dist/utils/queryableHelpers.d.ts +16 -2
- package/dist/utils/queryableHelpers.d.ts.map +1 -1
- package/dist/utils/wkt.d.ts +2 -0
- package/dist/utils/wkt.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/cql2-onoyCbps.js +0 -413
package/dist/main.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as
|
|
3
|
-
import { C as
|
|
4
|
-
import { E as
|
|
5
|
-
import { F as
|
|
6
|
-
import { F as
|
|
7
|
-
import { L as
|
|
8
|
-
import { L as
|
|
9
|
-
import { S as
|
|
10
|
-
import { jsxs as l, jsx as a, Fragment as
|
|
11
|
-
import { useId as
|
|
12
|
-
import { LuInfo as
|
|
13
|
-
import { J as Fe, j as
|
|
14
|
-
import { a as
|
|
15
|
-
import { s as
|
|
16
|
-
import { B as
|
|
17
|
-
import './style.css';function
|
|
18
|
-
const i =
|
|
1
|
+
import { B as rt } from "./BasemapSwitcher-BW7lyZ2Y.js";
|
|
2
|
+
import { C as nt } from "./CollapsibleControl-VFUTWb_5.js";
|
|
3
|
+
import { C as ot, f as ut, a as mt } from "./CoordinateDisplay-PxPmVjpm.js";
|
|
4
|
+
import { E as ct } from "./ExportButton-CLsWoW4m.js";
|
|
5
|
+
import { F as ht } from "./FeatureDetailPanel-CkFpdEKW.js";
|
|
6
|
+
import { F as bt } from "./FeatureTooltip-Db1LgLQV.js";
|
|
7
|
+
import { L as ft } from "./LayerPanel-SCdJ8948.js";
|
|
8
|
+
import { L as wt } from "./Legend-DNjVLgsd.js";
|
|
9
|
+
import { S as Nt } from "./SearchPanel-DCY01Wa-.js";
|
|
10
|
+
import { jsxs as l, jsx as a, Fragment as q } from "react/jsx-runtime";
|
|
11
|
+
import { useId as Ie, useState as A, useRef as ue, useMemo as Ee, useCallback as We, useEffect as X } from "react";
|
|
12
|
+
import { LuInfo as ze } from "react-icons/lu";
|
|
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 pi } from "./cql2-DOJnQwcv.js";
|
|
15
|
+
import { s as Ye } from "./index-RzZtWlUz.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-RzZtWlUz.js";
|
|
17
|
+
import './style.css';function Xe({ text: e, id: t }) {
|
|
18
|
+
const i = Ie(), r = t ?? i;
|
|
19
19
|
return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
|
|
20
20
|
/* @__PURE__ */ a(
|
|
21
21
|
"span",
|
|
@@ -24,7 +24,7 @@ import './style.css';function He({ text: e, id: t }) {
|
|
|
24
24
|
"aria-label": "Info",
|
|
25
25
|
"aria-describedby": r,
|
|
26
26
|
className: "mapui:inline-flex mapui:items-center mapui:text-gray-400 mapui:cursor-default hover:mapui:text-gray-600 focus:mapui:text-gray-600 focus:mapui:outline-none",
|
|
27
|
-
children: /* @__PURE__ */ a(
|
|
27
|
+
children: /* @__PURE__ */ a(ze, { className: "mapui:h-3.5 mapui:w-3.5" })
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
30
|
/* @__PURE__ */ l(
|
|
@@ -48,7 +48,7 @@ function S({ label: e, error: t, required: i, description: r, htmlFor: n, childr
|
|
|
48
48
|
e,
|
|
49
49
|
i && /* @__PURE__ */ a("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
|
|
50
50
|
] }),
|
|
51
|
-
r && /* @__PURE__ */ a(
|
|
51
|
+
r && /* @__PURE__ */ a(Xe, { text: r })
|
|
52
52
|
] }),
|
|
53
53
|
o,
|
|
54
54
|
t && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: t })
|
|
@@ -131,7 +131,7 @@ function _({
|
|
|
131
131
|
defaultOpen: i = !1,
|
|
132
132
|
badge: r
|
|
133
133
|
}) {
|
|
134
|
-
const [n, o] =
|
|
134
|
+
const [n, o] = 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",
|
|
@@ -152,7 +152,7 @@ function _({
|
|
|
152
152
|
] });
|
|
153
153
|
}
|
|
154
154
|
const H = "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";
|
|
155
|
-
function
|
|
155
|
+
function ce({
|
|
156
156
|
value: e,
|
|
157
157
|
onChange: t,
|
|
158
158
|
onTestConnection: i,
|
|
@@ -225,21 +225,21 @@ const ee = () => ({
|
|
|
225
225
|
label: void 0,
|
|
226
226
|
tileMatrixSetId: "WebMercatorQuad"
|
|
227
227
|
});
|
|
228
|
-
function
|
|
229
|
-
const [i, r] =
|
|
230
|
-
f((
|
|
228
|
+
function Va({ sources: e, onChange: t }) {
|
|
229
|
+
const [i, r] = A(null), [n, o] = A(null), [p, y] = A(!1), [m, x] = A(ee()), [h, f] = A({}), [d, u] = A({}), [s, v] = A(null), N = async (C, F) => {
|
|
230
|
+
f((T) => ({ ...T, [C]: "loading" }));
|
|
231
231
|
try {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
} catch (
|
|
235
|
-
f((
|
|
232
|
+
const T = await fetch(`${F}/conformance`);
|
|
233
|
+
T.ok ? f((c) => ({ ...c, [C]: "success" })) : (f((c) => ({ ...c, [C]: "error" })), u((c) => ({ ...c, [C]: `HTTP ${T.status}` })));
|
|
234
|
+
} catch (T) {
|
|
235
|
+
f((c) => ({ ...c, [C]: "error" })), u((c) => ({ ...c, [C]: T instanceof Error ? T.message : "Network error" }));
|
|
236
236
|
}
|
|
237
237
|
}, D = () => {
|
|
238
238
|
n && (t(e.map((C) => C.id === i ? n : C)), r(null), o(null));
|
|
239
|
-
},
|
|
240
|
-
t([...e, m]),
|
|
241
|
-
},
|
|
242
|
-
t(e.filter((
|
|
239
|
+
}, M = () => {
|
|
240
|
+
t([...e, m]), y(!1), x(ee());
|
|
241
|
+
}, w = (C) => {
|
|
242
|
+
t(e.filter((F) => F.id !== C)), v(null);
|
|
243
243
|
};
|
|
244
244
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
245
245
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -249,7 +249,7 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
249
249
|
{
|
|
250
250
|
type: "button",
|
|
251
251
|
onClick: () => {
|
|
252
|
-
|
|
252
|
+
y(!0), x(ee());
|
|
253
253
|
},
|
|
254
254
|
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",
|
|
255
255
|
children: "+ Add Source"
|
|
@@ -263,13 +263,13 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
263
263
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white mapui:p-3",
|
|
264
264
|
children: i === C.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
265
265
|
/* @__PURE__ */ a(
|
|
266
|
-
|
|
266
|
+
ce,
|
|
267
267
|
{
|
|
268
268
|
value: n ?? C,
|
|
269
269
|
onChange: o,
|
|
270
|
-
onTestConnection: (
|
|
271
|
-
testStatus:
|
|
272
|
-
testError:
|
|
270
|
+
onTestConnection: (F) => N(`edit-${C.id}`, F),
|
|
271
|
+
testStatus: h[`edit-${C.id}`],
|
|
272
|
+
testError: d[`edit-${C.id}`]
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
275
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
@@ -333,13 +333,13 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
333
333
|
p && /* @__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,
|
|
337
337
|
{
|
|
338
338
|
value: m,
|
|
339
|
-
onChange:
|
|
340
|
-
onTestConnection: (C) =>
|
|
341
|
-
testStatus:
|
|
342
|
-
testError:
|
|
339
|
+
onChange: x,
|
|
340
|
+
onTestConnection: (C) => N("new", C),
|
|
341
|
+
testStatus: h.new,
|
|
342
|
+
testError: d.new
|
|
343
343
|
}
|
|
344
344
|
),
|
|
345
345
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
@@ -347,7 +347,7 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
347
347
|
"button",
|
|
348
348
|
{
|
|
349
349
|
type: "button",
|
|
350
|
-
onClick:
|
|
350
|
+
onClick: M,
|
|
351
351
|
disabled: !m.id || !m.url,
|
|
352
352
|
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",
|
|
353
353
|
children: "Save"
|
|
@@ -357,7 +357,7 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
357
357
|
"button",
|
|
358
358
|
{
|
|
359
359
|
type: "button",
|
|
360
|
-
onClick: () =>
|
|
360
|
+
onClick: () => y(!1),
|
|
361
361
|
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",
|
|
362
362
|
children: "Cancel"
|
|
363
363
|
}
|
|
@@ -370,13 +370,13 @@ function Ua({ sources: e, onChange: t }) {
|
|
|
370
370
|
open: s !== null,
|
|
371
371
|
title: "Remove Source",
|
|
372
372
|
description: "Are you sure you want to remove this source? Any layers using it will be affected.",
|
|
373
|
-
onConfirm: () => s &&
|
|
373
|
+
onConfirm: () => s && w(s),
|
|
374
374
|
onCancel: () => v(null)
|
|
375
375
|
}
|
|
376
376
|
)
|
|
377
377
|
] });
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function _a({
|
|
380
380
|
sourceUrl: e,
|
|
381
381
|
selectedCollectionIds: t,
|
|
382
382
|
onSelect: i,
|
|
@@ -389,8 +389,8 @@ function Wa({
|
|
|
389
389
|
] }) : p ? /* @__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
|
p.message
|
|
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((
|
|
393
|
-
const m = t.includes(
|
|
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((y) => {
|
|
393
|
+
const m = t.includes(y.id);
|
|
394
394
|
return /* @__PURE__ */ l(
|
|
395
395
|
"li",
|
|
396
396
|
{
|
|
@@ -400,51 +400,51 @@ function Wa({
|
|
|
400
400
|
"input",
|
|
401
401
|
{
|
|
402
402
|
type: "checkbox",
|
|
403
|
-
id: `collection-${
|
|
403
|
+
id: `collection-${y.id}`,
|
|
404
404
|
checked: m,
|
|
405
|
-
onChange: () => m ? r(
|
|
405
|
+
onChange: () => m ? r(y.id) : i(y.id),
|
|
406
406
|
className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
|
|
407
407
|
}
|
|
408
408
|
),
|
|
409
409
|
/* @__PURE__ */ l(
|
|
410
410
|
"label",
|
|
411
411
|
{
|
|
412
|
-
htmlFor: `collection-${
|
|
412
|
+
htmlFor: `collection-${y.id}`,
|
|
413
413
|
className: "mapui:flex mapui:cursor-pointer mapui:flex-col mapui:gap-0.5",
|
|
414
414
|
children: [
|
|
415
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
416
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
417
|
-
|
|
415
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: y.title ?? y.id }),
|
|
416
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: y.id }),
|
|
417
|
+
y.description && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: y.description })
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
)
|
|
421
421
|
]
|
|
422
422
|
},
|
|
423
|
-
|
|
423
|
+
y.id
|
|
424
424
|
);
|
|
425
425
|
}) });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
const [r, n] =
|
|
427
|
+
function He({ value: e, onChange: t, availableIcons: i }) {
|
|
428
|
+
const [r, n] = A(!1), [o, p] = A(-1), y = ue(null), m = Ie(), x = o >= 0 ? `${m}-option-${o}` : void 0, h = Ee(() => {
|
|
429
429
|
if (!i || i.length === 0) return [];
|
|
430
430
|
if (!e) return i;
|
|
431
|
-
const
|
|
432
|
-
return i.filter((D) => D.toLowerCase().includes(
|
|
433
|
-
}, [i, e]), f = r &&
|
|
434
|
-
(
|
|
435
|
-
t(
|
|
431
|
+
const N = e.toLowerCase();
|
|
432
|
+
return i.filter((D) => D.toLowerCase().includes(N));
|
|
433
|
+
}, [i, e]), f = r && h.length > 0, d = We(
|
|
434
|
+
(N) => {
|
|
435
|
+
t(N), n(!1), p(-1);
|
|
436
436
|
},
|
|
437
437
|
[t]
|
|
438
|
-
), u = (
|
|
439
|
-
t(
|
|
440
|
-
}, s = (
|
|
441
|
-
f && (
|
|
438
|
+
), u = (N) => {
|
|
439
|
+
t(N.target.value), n(!0), p(-1);
|
|
440
|
+
}, s = (N) => {
|
|
441
|
+
f && (N.key === "ArrowDown" ? (N.preventDefault(), p((D) => Math.min(D + 1, h.length - 1))) : N.key === "ArrowUp" ? (N.preventDefault(), p((D) => Math.max(D - 1, 0))) : N.key === "Enter" && o >= 0 ? (N.preventDefault(), d(h[o])) : N.key === "Escape" && (n(!1), p(-1)));
|
|
442
442
|
};
|
|
443
443
|
X(() => {
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const N = (D) => {
|
|
445
|
+
y.current && !y.current.contains(D.target) && (n(!1), p(-1));
|
|
446
446
|
};
|
|
447
|
-
return document.addEventListener("mousedown",
|
|
447
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
448
448
|
}, []);
|
|
449
449
|
const v = "mapui:w-full 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";
|
|
450
450
|
return !i || i.length === 0 ? /* @__PURE__ */ a(
|
|
@@ -452,11 +452,11 @@ function Je({ value: e, onChange: t, availableIcons: i }) {
|
|
|
452
452
|
{
|
|
453
453
|
type: "text",
|
|
454
454
|
value: e,
|
|
455
|
-
onChange: (
|
|
455
|
+
onChange: (N) => t(N.target.value || ""),
|
|
456
456
|
placeholder: "icon-name",
|
|
457
457
|
className: v
|
|
458
458
|
}
|
|
459
|
-
) : /* @__PURE__ */ l("div", { ref:
|
|
459
|
+
) : /* @__PURE__ */ l("div", { ref: y, className: "mapui:relative", children: [
|
|
460
460
|
/* @__PURE__ */ a(
|
|
461
461
|
"input",
|
|
462
462
|
{
|
|
@@ -467,7 +467,7 @@ function Je({ value: e, onChange: t, availableIcons: i }) {
|
|
|
467
467
|
"aria-expanded": f,
|
|
468
468
|
"aria-autocomplete": "list",
|
|
469
469
|
"aria-controls": m,
|
|
470
|
-
"aria-activedescendant":
|
|
470
|
+
"aria-activedescendant": x,
|
|
471
471
|
onChange: u,
|
|
472
472
|
onFocus: () => n(!0),
|
|
473
473
|
onKeyDown: s,
|
|
@@ -480,25 +480,25 @@ function Je({ value: e, onChange: t, availableIcons: i }) {
|
|
|
480
480
|
id: m,
|
|
481
481
|
role: "listbox",
|
|
482
482
|
className: "mapui:absolute mapui:z-10 mapui:mt-1 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:shadow-lg mapui:max-h-48 mapui:overflow-y-auto mapui:p-0 mapui:m-0 mapui:list-none",
|
|
483
|
-
children:
|
|
483
|
+
children: h.map((N, D) => /* @__PURE__ */ a(
|
|
484
484
|
"li",
|
|
485
485
|
{
|
|
486
486
|
id: `${m}-option-${D}`,
|
|
487
487
|
role: "option",
|
|
488
488
|
"aria-selected": D === o,
|
|
489
|
-
onMouseDown: (
|
|
490
|
-
|
|
489
|
+
onMouseDown: (M) => {
|
|
490
|
+
M.preventDefault(), d(N);
|
|
491
491
|
},
|
|
492
492
|
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${D === o ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
|
|
493
|
-
children:
|
|
493
|
+
children: N
|
|
494
494
|
},
|
|
495
|
-
`${D}-${
|
|
495
|
+
`${D}-${N}`
|
|
496
496
|
))
|
|
497
497
|
}
|
|
498
498
|
)
|
|
499
499
|
] });
|
|
500
500
|
}
|
|
501
|
-
const
|
|
501
|
+
const de = [
|
|
502
502
|
"#4e79a7",
|
|
503
503
|
"#f28e2b",
|
|
504
504
|
"#e15759",
|
|
@@ -511,132 +511,132 @@ const he = [
|
|
|
511
511
|
"#bab0ac"
|
|
512
512
|
];
|
|
513
513
|
function ae(e) {
|
|
514
|
-
return
|
|
514
|
+
return de[e % de.length];
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Je(e) {
|
|
517
517
|
return e[0] === "interpolate" ? "interpolate" : "match";
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ke(e) {
|
|
520
520
|
const t = Array.isArray(e[1]) ? e[1][1] ?? "" : "", i = e[e.length - 1] ?? "#000000", r = [];
|
|
521
521
|
for (let n = 2; n < e.length - 1; n += 2)
|
|
522
522
|
r.push({ value: String(e[n] ?? ""), color: e[n + 1] ?? "#000000" });
|
|
523
523
|
return { property: t, pairs: r, fallback: i };
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function he(e, t, i) {
|
|
526
526
|
const r = ["match", ["get", e]];
|
|
527
527
|
for (const n of t)
|
|
528
528
|
r.push(n.value, n.color);
|
|
529
529
|
return r.push(i), r;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Qe(e) {
|
|
532
532
|
const t = Array.isArray(e[2]) ? e[2][1] ?? "" : "", i = [];
|
|
533
533
|
for (let r = 3; r < e.length; r += 2)
|
|
534
534
|
i.push({ stop: Number(e[r] ?? 0), color: e[r + 1] ?? "#000000" });
|
|
535
535
|
return { property: t, stops: i };
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function ge(e, t) {
|
|
538
538
|
const i = ["interpolate", ["linear"], ["get", e]];
|
|
539
539
|
for (const r of t)
|
|
540
540
|
i.push(r.stop, r.color);
|
|
541
541
|
return i;
|
|
542
542
|
}
|
|
543
|
-
const J = "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", te = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
544
|
-
function
|
|
543
|
+
const J = "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", te = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50", be = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50";
|
|
544
|
+
function Ze({
|
|
545
545
|
value: e,
|
|
546
546
|
onChange: t,
|
|
547
547
|
availableProperties: i = [],
|
|
548
548
|
onFetchDistinctValues: r
|
|
549
549
|
}) {
|
|
550
|
-
const [n, o] =
|
|
551
|
-
(
|
|
552
|
-
),
|
|
553
|
-
(
|
|
554
|
-
), D = (
|
|
555
|
-
t(
|
|
556
|
-
},
|
|
557
|
-
D(
|
|
558
|
-
},
|
|
559
|
-
D(
|
|
560
|
-
}, C = (
|
|
561
|
-
const I = f.map((
|
|
562
|
-
D(
|
|
563
|
-
},
|
|
564
|
-
const I = f.map((
|
|
565
|
-
D(
|
|
566
|
-
},
|
|
567
|
-
const
|
|
568
|
-
D(
|
|
569
|
-
},
|
|
570
|
-
const
|
|
571
|
-
D(
|
|
572
|
-
},
|
|
573
|
-
if (!(!r || !
|
|
574
|
-
|
|
550
|
+
const [n, o] = A(() => Je(e)), [p, y] = A(!1), m = Ke(e), x = Qe(e), h = n === "match" ? m.property : "", f = n === "match" ? m.pairs : [], d = n === "match" ? m.fallback : "#000000", u = n === "interpolate" ? x.property : "", s = n === "interpolate" ? x.stops : [], v = i.filter(
|
|
551
|
+
(g) => !g.type || g.type === "string"
|
|
552
|
+
), N = i.filter(
|
|
553
|
+
(g) => g.type === "number" || g.type === "integer"
|
|
554
|
+
), D = (g, L, I) => {
|
|
555
|
+
t(he(g, L, I));
|
|
556
|
+
}, M = (g) => {
|
|
557
|
+
D(g, f, d);
|
|
558
|
+
}, w = (g) => {
|
|
559
|
+
D(h, f, g);
|
|
560
|
+
}, C = (g, L) => {
|
|
561
|
+
const I = f.map((E, $) => $ === g ? { ...E, value: L } : E);
|
|
562
|
+
D(h, I, d);
|
|
563
|
+
}, F = (g, L) => {
|
|
564
|
+
const I = f.map((E, $) => $ === g ? { ...E, color: L } : E);
|
|
565
|
+
D(h, I, d);
|
|
566
|
+
}, T = (g) => {
|
|
567
|
+
const L = f.filter((I, E) => E !== g);
|
|
568
|
+
D(h, L, d);
|
|
569
|
+
}, c = () => {
|
|
570
|
+
const g = [...f, { value: "", color: ae(f.length) }];
|
|
571
|
+
D(h, g, d);
|
|
572
|
+
}, P = async () => {
|
|
573
|
+
if (!(!r || !h)) {
|
|
574
|
+
y(!0);
|
|
575
575
|
try {
|
|
576
|
-
const
|
|
576
|
+
const L = (await r(h)).map((I, E) => ({
|
|
577
577
|
value: I,
|
|
578
|
-
color: ae(
|
|
578
|
+
color: ae(E)
|
|
579
579
|
}));
|
|
580
|
-
D(
|
|
580
|
+
D(h, L, d);
|
|
581
581
|
} finally {
|
|
582
|
-
|
|
582
|
+
y(!1);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
},
|
|
586
|
-
t(
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
const I = s.map((
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
const I = s.map((
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
},
|
|
585
|
+
}, O = (g, L) => {
|
|
586
|
+
t(ge(g, L));
|
|
587
|
+
}, b = (g) => {
|
|
588
|
+
O(g, s);
|
|
589
|
+
}, k = (g, L) => {
|
|
590
|
+
const I = s.map((E, $) => $ === g ? { ...E, stop: L } : E);
|
|
591
|
+
O(u, I);
|
|
592
|
+
}, j = (g, L) => {
|
|
593
|
+
const I = s.map((E, $) => $ === g ? { ...E, color: L } : E);
|
|
594
|
+
O(u, I);
|
|
595
|
+
}, U = (g) => {
|
|
596
|
+
const L = s.filter((I, E) => E !== g);
|
|
597
|
+
O(u, L);
|
|
598
|
+
}, G = () => {
|
|
599
599
|
var I;
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
},
|
|
603
|
-
o(
|
|
600
|
+
const g = ((I = s[s.length - 1]) == null ? void 0 : I.stop) ?? 0, L = [...s, { stop: g + 10, color: ae(s.length) }];
|
|
601
|
+
O(u, L);
|
|
602
|
+
}, B = (g) => {
|
|
603
|
+
o(g), t(g === "match" ? he("", [], "#000000") : ge("", []));
|
|
604
604
|
};
|
|
605
605
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
606
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((
|
|
606
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((g) => /* @__PURE__ */ a(
|
|
607
607
|
"button",
|
|
608
608
|
{
|
|
609
609
|
type: "button",
|
|
610
|
-
onClick: () =>
|
|
610
|
+
onClick: () => B(g),
|
|
611
611
|
className: [
|
|
612
612
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-xs mapui:capitalize mapui:outline-none",
|
|
613
613
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
614
|
-
n ===
|
|
614
|
+
n === g ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
615
615
|
].join(" "),
|
|
616
|
-
children:
|
|
616
|
+
children: g === "match" ? "Categorical" : "Gradient"
|
|
617
617
|
},
|
|
618
|
-
|
|
618
|
+
g
|
|
619
619
|
)) }),
|
|
620
|
-
n === "match" && /* @__PURE__ */ l(
|
|
620
|
+
n === "match" && /* @__PURE__ */ l(q, { children: [
|
|
621
621
|
/* @__PURE__ */ l(
|
|
622
622
|
"select",
|
|
623
623
|
{
|
|
624
|
-
value:
|
|
625
|
-
onChange: (
|
|
624
|
+
value: h,
|
|
625
|
+
onChange: (g) => M(g.target.value),
|
|
626
626
|
className: J,
|
|
627
627
|
children: [
|
|
628
628
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
629
|
-
v.map((
|
|
629
|
+
v.map((g) => /* @__PURE__ */ a("option", { value: g.name, children: g.title ?? g.name }, g.name))
|
|
630
630
|
]
|
|
631
631
|
}
|
|
632
632
|
),
|
|
633
|
-
f.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: f.map((
|
|
633
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: f.map((g, L) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
634
634
|
/* @__PURE__ */ a(
|
|
635
635
|
"input",
|
|
636
636
|
{
|
|
637
637
|
type: "text",
|
|
638
|
-
value:
|
|
639
|
-
onChange: (I) => C(
|
|
638
|
+
value: g.value,
|
|
639
|
+
onChange: (I) => C(L, I.target.value),
|
|
640
640
|
placeholder: "value",
|
|
641
641
|
className: `${J} mapui:flex-1`
|
|
642
642
|
}
|
|
@@ -644,24 +644,24 @@ function ea({
|
|
|
644
644
|
/* @__PURE__ */ a(
|
|
645
645
|
Y,
|
|
646
646
|
{
|
|
647
|
-
value:
|
|
648
|
-
onChange: (I) =>
|
|
649
|
-
label: `Color for "${
|
|
647
|
+
value: g.color,
|
|
648
|
+
onChange: (I) => F(L, I),
|
|
649
|
+
label: `Color for "${g.value}"`
|
|
650
650
|
}
|
|
651
651
|
),
|
|
652
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () =>
|
|
653
|
-
] },
|
|
652
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => T(L), className: be, children: "×" })
|
|
653
|
+
] }, L)) }),
|
|
654
654
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
655
655
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500 mapui:shrink-0", children: "Fallback:" }),
|
|
656
|
-
/* @__PURE__ */ a(Y, { value:
|
|
656
|
+
/* @__PURE__ */ a(Y, { value: d, onChange: w, label: "Fallback color" })
|
|
657
657
|
] }),
|
|
658
658
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
659
|
-
/* @__PURE__ */ a("button", { type: "button", onClick:
|
|
660
|
-
r &&
|
|
659
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: c, className: te, children: "+ Add value" }),
|
|
660
|
+
r && h && /* @__PURE__ */ a(
|
|
661
661
|
"button",
|
|
662
662
|
{
|
|
663
663
|
type: "button",
|
|
664
|
-
onClick:
|
|
664
|
+
onClick: P,
|
|
665
665
|
disabled: p,
|
|
666
666
|
className: te,
|
|
667
667
|
children: p ? "Loading…" : "Auto-populate"
|
|
@@ -669,26 +669,26 @@ function ea({
|
|
|
669
669
|
)
|
|
670
670
|
] })
|
|
671
671
|
] }),
|
|
672
|
-
n === "interpolate" && /* @__PURE__ */ l(
|
|
672
|
+
n === "interpolate" && /* @__PURE__ */ l(q, { children: [
|
|
673
673
|
/* @__PURE__ */ l(
|
|
674
674
|
"select",
|
|
675
675
|
{
|
|
676
676
|
value: u,
|
|
677
|
-
onChange: (
|
|
677
|
+
onChange: (g) => b(g.target.value),
|
|
678
678
|
className: J,
|
|
679
679
|
children: [
|
|
680
680
|
/* @__PURE__ */ a("option", { value: "", children: "Select a numeric property…" }),
|
|
681
|
-
|
|
681
|
+
N.map((g) => /* @__PURE__ */ a("option", { value: g.name, children: g.title ?? g.name }, g.name))
|
|
682
682
|
]
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
|
-
s.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: s.map((
|
|
685
|
+
s.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: s.map((g, L) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
686
686
|
/* @__PURE__ */ a(
|
|
687
687
|
"input",
|
|
688
688
|
{
|
|
689
689
|
type: "number",
|
|
690
|
-
value:
|
|
691
|
-
onChange: (I) =>
|
|
690
|
+
value: g.stop,
|
|
691
|
+
onChange: (I) => k(L, parseFloat(I.target.value) || 0),
|
|
692
692
|
placeholder: "stop",
|
|
693
693
|
className: `${J} mapui:w-24`
|
|
694
694
|
}
|
|
@@ -696,19 +696,19 @@ function ea({
|
|
|
696
696
|
/* @__PURE__ */ a(
|
|
697
697
|
Y,
|
|
698
698
|
{
|
|
699
|
-
value:
|
|
700
|
-
onChange: (I) =>
|
|
701
|
-
label: `Color at stop ${
|
|
699
|
+
value: g.color,
|
|
700
|
+
onChange: (I) => j(L, I),
|
|
701
|
+
label: `Color at stop ${g.stop}`
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () =>
|
|
705
|
-
] },
|
|
706
|
-
/* @__PURE__ */ a("button", { type: "button", onClick:
|
|
704
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => U(L), className: be, children: "×" })
|
|
705
|
+
] }, L)) }),
|
|
706
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: G, className: te, children: "+ Add stop" })
|
|
707
707
|
] })
|
|
708
708
|
] });
|
|
709
709
|
}
|
|
710
710
|
const z = "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";
|
|
711
|
-
function
|
|
711
|
+
function ea({
|
|
712
712
|
value: e,
|
|
713
713
|
onChange: t
|
|
714
714
|
}) {
|
|
@@ -740,7 +740,7 @@ function aa({
|
|
|
740
740
|
)
|
|
741
741
|
] });
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function aa({
|
|
744
744
|
value: e,
|
|
745
745
|
onChange: t
|
|
746
746
|
}) {
|
|
@@ -761,7 +761,7 @@ function ta({
|
|
|
761
761
|
/* @__PURE__ */ a("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children: i.toFixed(2) })
|
|
762
762
|
] });
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function ye({
|
|
765
765
|
def: e,
|
|
766
766
|
value: t,
|
|
767
767
|
onChange: i,
|
|
@@ -769,10 +769,10 @@ function fe({
|
|
|
769
769
|
availableProperties: n,
|
|
770
770
|
onFetchDistinctValues: o
|
|
771
771
|
}) {
|
|
772
|
-
var p,
|
|
772
|
+
var p, y;
|
|
773
773
|
switch (e.widget) {
|
|
774
774
|
case "color": {
|
|
775
|
-
const m = Array.isArray(t),
|
|
775
|
+
const m = Array.isArray(t), x = m ? t[t.length - 1] ?? "#000000" : "#000000";
|
|
776
776
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:w-full", children: [
|
|
777
777
|
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-end", children: /* @__PURE__ */ a(
|
|
778
778
|
"button",
|
|
@@ -780,7 +780,7 @@ function fe({
|
|
|
780
780
|
type: "button",
|
|
781
781
|
title: m ? "Switch to static color" : "Switch to data-driven color",
|
|
782
782
|
onClick: () => {
|
|
783
|
-
i(m ?
|
|
783
|
+
i(m ? x : ["match", ["get", ""], x]);
|
|
784
784
|
},
|
|
785
785
|
className: [
|
|
786
786
|
"mapui:cursor-pointer mapui:rounded mapui:border mapui:px-1.5 mapui:py-0.5 mapui:font-mono mapui:text-xs mapui:outline-none",
|
|
@@ -791,10 +791,10 @@ function fe({
|
|
|
791
791
|
}
|
|
792
792
|
) }),
|
|
793
793
|
m ? /* @__PURE__ */ a(
|
|
794
|
-
|
|
794
|
+
Ze,
|
|
795
795
|
{
|
|
796
796
|
value: t,
|
|
797
|
-
onChange: (
|
|
797
|
+
onChange: (h) => i(h),
|
|
798
798
|
availableProperties: n,
|
|
799
799
|
onFetchDistinctValues: o
|
|
800
800
|
}
|
|
@@ -810,7 +810,7 @@ function fe({
|
|
|
810
810
|
}
|
|
811
811
|
case "opacity":
|
|
812
812
|
return /* @__PURE__ */ a(
|
|
813
|
-
|
|
813
|
+
aa,
|
|
814
814
|
{
|
|
815
815
|
value: t,
|
|
816
816
|
onChange: i
|
|
@@ -846,12 +846,12 @@ function fe({
|
|
|
846
846
|
value: t ?? ((p = e.options) == null ? void 0 : p[0]) ?? "",
|
|
847
847
|
onChange: (m) => i(m.target.value),
|
|
848
848
|
className: z,
|
|
849
|
-
children: (
|
|
849
|
+
children: (y = e.options) == null ? void 0 : y.map((m) => /* @__PURE__ */ a("option", { value: m, children: m }, m))
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
852
|
case "translate":
|
|
853
853
|
return /* @__PURE__ */ a(
|
|
854
|
-
|
|
854
|
+
ea,
|
|
855
855
|
{
|
|
856
856
|
value: t,
|
|
857
857
|
onChange: i
|
|
@@ -859,24 +859,24 @@ function fe({
|
|
|
859
859
|
);
|
|
860
860
|
case "dasharray":
|
|
861
861
|
case "stringArray": {
|
|
862
|
-
const m = t,
|
|
862
|
+
const m = t, x = m ? m.join(", ") : "";
|
|
863
863
|
return /* @__PURE__ */ a(
|
|
864
864
|
"input",
|
|
865
865
|
{
|
|
866
866
|
type: "text",
|
|
867
|
-
value:
|
|
868
|
-
onChange: (
|
|
869
|
-
const f =
|
|
867
|
+
value: x,
|
|
868
|
+
onChange: (h) => {
|
|
869
|
+
const f = h.target.value.trim();
|
|
870
870
|
if (!f) {
|
|
871
871
|
i(void 0);
|
|
872
872
|
return;
|
|
873
873
|
}
|
|
874
874
|
if (e.widget === "dasharray") {
|
|
875
|
-
const
|
|
876
|
-
i(
|
|
875
|
+
const d = f.split(",").map((u) => parseFloat(u.trim())).filter((u) => !isNaN(u));
|
|
876
|
+
i(d.length > 0 ? d : void 0);
|
|
877
877
|
} else {
|
|
878
|
-
const
|
|
879
|
-
i(
|
|
878
|
+
const d = f.split(",").map((u) => u.trim()).filter(Boolean);
|
|
879
|
+
i(d.length > 0 ? d : void 0);
|
|
880
880
|
}
|
|
881
881
|
},
|
|
882
882
|
placeholder: e.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
|
|
@@ -896,7 +896,7 @@ function fe({
|
|
|
896
896
|
);
|
|
897
897
|
case "icon-image":
|
|
898
898
|
return /* @__PURE__ */ a(
|
|
899
|
-
|
|
899
|
+
He,
|
|
900
900
|
{
|
|
901
901
|
value: t ?? "",
|
|
902
902
|
onChange: (m) => i(m ?? void 0),
|
|
@@ -907,8 +907,8 @@ function fe({
|
|
|
907
907
|
return null;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
const p = e.enableDefault !== void 0,
|
|
910
|
+
function ta({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues: o }) {
|
|
911
|
+
const p = e.enableDefault !== void 0, y = t !== void 0;
|
|
912
912
|
if (p && e.widget === "boolean") {
|
|
913
913
|
const m = !e.enableDefault;
|
|
914
914
|
return /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
@@ -916,8 +916,8 @@ function ia({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
916
916
|
{
|
|
917
917
|
type: "checkbox",
|
|
918
918
|
checked: t === m,
|
|
919
|
-
onChange: (
|
|
920
|
-
i(e.key,
|
|
919
|
+
onChange: (x) => {
|
|
920
|
+
i(e.key, x.target.checked ? m : void 0);
|
|
921
921
|
},
|
|
922
922
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
923
923
|
}
|
|
@@ -928,15 +928,15 @@ function ia({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
928
928
|
"input",
|
|
929
929
|
{
|
|
930
930
|
type: "checkbox",
|
|
931
|
-
checked:
|
|
931
|
+
checked: y,
|
|
932
932
|
onChange: (m) => {
|
|
933
933
|
i(e.key, m.target.checked ? e.enableDefault : void 0);
|
|
934
934
|
},
|
|
935
935
|
className: "mapui:h-4 mapui:w-4 mapui:shrink-0 mapui:accent-blue-600"
|
|
936
936
|
}
|
|
937
937
|
),
|
|
938
|
-
|
|
939
|
-
|
|
938
|
+
y && /* @__PURE__ */ a(
|
|
939
|
+
ye,
|
|
940
940
|
{
|
|
941
941
|
def: e,
|
|
942
942
|
value: t,
|
|
@@ -947,7 +947,7 @@ function ia({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
947
947
|
}
|
|
948
948
|
)
|
|
949
949
|
] }) }) : /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
950
|
-
|
|
950
|
+
ye,
|
|
951
951
|
{
|
|
952
952
|
def: e,
|
|
953
953
|
value: t,
|
|
@@ -958,7 +958,7 @@ function ia({ def: e, value: t, onChange: i, availableIcons: r, availablePropert
|
|
|
958
958
|
}
|
|
959
959
|
) });
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function fe({
|
|
962
962
|
title: e,
|
|
963
963
|
properties: t,
|
|
964
964
|
values: i,
|
|
@@ -966,31 +966,31 @@ function xe({
|
|
|
966
966
|
defaultOpen: n = !1,
|
|
967
967
|
availableIcons: o,
|
|
968
968
|
availableProperties: p,
|
|
969
|
-
onFetchDistinctValues:
|
|
969
|
+
onFetchDistinctValues: y
|
|
970
970
|
}) {
|
|
971
971
|
const m = t.filter(
|
|
972
|
-
(
|
|
972
|
+
(x) => x.enableDefault !== void 0 && i[x.key] !== void 0
|
|
973
973
|
).length;
|
|
974
|
-
return /* @__PURE__ */ a(_, { title: e, defaultOpen: n, badge: m || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: t.map((
|
|
975
|
-
|
|
974
|
+
return /* @__PURE__ */ a(_, { title: e, defaultOpen: n, badge: m || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: t.map((x) => /* @__PURE__ */ a(
|
|
975
|
+
ta,
|
|
976
976
|
{
|
|
977
|
-
def:
|
|
978
|
-
value: i[
|
|
977
|
+
def: x,
|
|
978
|
+
value: i[x.key],
|
|
979
979
|
onChange: r,
|
|
980
980
|
availableIcons: o,
|
|
981
981
|
availableProperties: p,
|
|
982
|
-
onFetchDistinctValues:
|
|
982
|
+
onFetchDistinctValues: y
|
|
983
983
|
},
|
|
984
|
-
|
|
984
|
+
x.key
|
|
985
985
|
)) }) });
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function W(e) {
|
|
988
988
|
return Array.isArray(e);
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function ia(e) {
|
|
991
991
|
return e[0] === "match" ? "match" : e[0] === "interpolate" ? "interpolate" : null;
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function Me(e) {
|
|
994
994
|
if (e[0] === "match") {
|
|
995
995
|
const t = [];
|
|
996
996
|
for (let r = 3; r < e.length; r += 2)
|
|
@@ -1006,7 +1006,7 @@ function Oe(e) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return [];
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
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) {
|
|
@@ -1026,11 +1026,11 @@ function la(e) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return [];
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function la(e) {
|
|
1030
1030
|
const t = e[0] === "match" ? e[1] : e[0] === "interpolate" ? e[2] : null;
|
|
1031
1031
|
return Array.isArray(t) && t[0] === "get" && typeof t[1] == "string" ? t[1] : null;
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1033
|
+
function na(e) {
|
|
1034
1034
|
switch (e.type) {
|
|
1035
1035
|
case "fill":
|
|
1036
1036
|
return e.paint["fill-color"] ?? "#000000";
|
|
@@ -1042,7 +1042,7 @@ function pa(e) {
|
|
|
1042
1042
|
return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function pa(e) {
|
|
1046
1046
|
switch (e.type) {
|
|
1047
1047
|
case "fill":
|
|
1048
1048
|
return "square";
|
|
@@ -1054,7 +1054,7 @@ function oa(e) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
function ie({ expr: e, height: t }) {
|
|
1057
|
-
const i =
|
|
1057
|
+
const i = Me(e);
|
|
1058
1058
|
if (i.length === 0)
|
|
1059
1059
|
return /* @__PURE__ */ a(
|
|
1060
1060
|
"div",
|
|
@@ -1077,10 +1077,10 @@ function ie({ expr: e, height: t }) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
);
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return typeof e == "string" ? e :
|
|
1080
|
+
function xe(e, t) {
|
|
1081
|
+
return typeof e == "string" ? e : W(e) ? Me(e)[0] ?? t : t;
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function oa({ style: e }) {
|
|
1084
1084
|
if (e.type === "fill") {
|
|
1085
1085
|
const r = e.paint["fill-color"];
|
|
1086
1086
|
return /* @__PURE__ */ a(
|
|
@@ -1088,7 +1088,7 @@ function ua({ style: e }) {
|
|
|
1088
1088
|
{
|
|
1089
1089
|
className: "mapui:h-8 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:overflow-hidden",
|
|
1090
1090
|
"aria-label": "Style preview",
|
|
1091
|
-
children:
|
|
1091
|
+
children: W(r) ? /* @__PURE__ */ a(ie, { expr: r, height: 32 }) : /* @__PURE__ */ a(
|
|
1092
1092
|
"div",
|
|
1093
1093
|
{
|
|
1094
1094
|
style: {
|
|
@@ -1096,7 +1096,7 @@ function ua({ style: e }) {
|
|
|
1096
1096
|
height: "100%",
|
|
1097
1097
|
backgroundColor: r,
|
|
1098
1098
|
opacity: e.paint["fill-opacity"],
|
|
1099
|
-
outline: e.paint["fill-outline-color"] && !
|
|
1099
|
+
outline: e.paint["fill-outline-color"] && !W(e.paint["fill-outline-color"]) ? `2px solid ${e.paint["fill-outline-color"]}` : void 0
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
)
|
|
@@ -1110,7 +1110,7 @@ function ua({ style: e }) {
|
|
|
1110
1110
|
{
|
|
1111
1111
|
className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:rounded mapui:border mapui:border-gray-200 mapui:px-2",
|
|
1112
1112
|
"aria-label": "Style preview",
|
|
1113
|
-
children:
|
|
1113
|
+
children: W(r) ? /* @__PURE__ */ a(ie, { expr: r, height: e.paint["line-width"] }) : /* @__PURE__ */ a(
|
|
1114
1114
|
"div",
|
|
1115
1115
|
{
|
|
1116
1116
|
style: {
|
|
@@ -1131,7 +1131,7 @@ function ua({ style: e }) {
|
|
|
1131
1131
|
{
|
|
1132
1132
|
className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
|
|
1133
1133
|
"aria-label": "Style preview",
|
|
1134
|
-
children:
|
|
1134
|
+
children: W(r) ? /* @__PURE__ */ a("div", { style: { width: n, height: n, borderRadius: "50%", overflow: "hidden" }, children: /* @__PURE__ */ a(ie, { expr: r, height: n }) }) : /* @__PURE__ */ a(
|
|
1135
1135
|
"div",
|
|
1136
1136
|
{
|
|
1137
1137
|
style: {
|
|
@@ -1140,14 +1140,14 @@ function ua({ style: e }) {
|
|
|
1140
1140
|
backgroundColor: r,
|
|
1141
1141
|
opacity: e.paint["circle-opacity"],
|
|
1142
1142
|
borderRadius: "50%",
|
|
1143
|
-
border: e.paint["circle-stroke-color"] && !
|
|
1143
|
+
border: e.paint["circle-stroke-color"] && !W(e.paint["circle-stroke-color"]) ? `${e.paint["circle-stroke-width"] ?? 1}px solid ${e.paint["circle-stroke-color"]}` : void 0
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
)
|
|
1147
1147
|
}
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
|
-
const t =
|
|
1150
|
+
const t = xe(e.paint["text-color"], "#333333"), i = xe(e.paint["icon-color"], "#333333");
|
|
1151
1151
|
return /* @__PURE__ */ a(
|
|
1152
1152
|
"div",
|
|
1153
1153
|
{
|
|
@@ -1167,7 +1167,7 @@ function ua({ style: e }) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
);
|
|
1169
1169
|
}
|
|
1170
|
-
const
|
|
1170
|
+
const ua = [
|
|
1171
1171
|
// Appearance (paint)
|
|
1172
1172
|
{ key: "fill-color", label: "Fill Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1173
1173
|
{ key: "fill-opacity", label: "Fill Opacity", widget: "opacity", group: "Appearance", category: "paint" },
|
|
@@ -1179,7 +1179,7 @@ const ma = [
|
|
|
1179
1179
|
{ key: "fill-translate-anchor", label: "Translate Anchor", widget: "enum", group: "Transform", category: "paint", options: ["map", "viewport"], enableDefault: "map", description: '"map" moves the fill with the map when panning; "viewport" keeps the offset fixed on screen.' },
|
|
1180
1180
|
// Sorting (layout)
|
|
1181
1181
|
{ key: "fill-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1182
|
-
],
|
|
1182
|
+
], ma = [
|
|
1183
1183
|
// Appearance (paint)
|
|
1184
1184
|
{ key: "line-color", label: "Line Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1185
1185
|
{ key: "line-width", label: "Line Width", widget: "number", group: "Appearance", category: "paint", min: 0, step: 0.5 },
|
|
@@ -1200,7 +1200,7 @@ const ma = [
|
|
|
1200
1200
|
{ key: "line-round-limit", label: "Round Limit", widget: "number", group: "Cap & Join", category: "layout", step: 0.1, enableDefault: 1.05, description: 'When line-join is "round", angles sharper than this threshold (in radians) are bevelled instead of rounded.' },
|
|
1201
1201
|
// Sorting (layout)
|
|
1202
1202
|
{ key: "line-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1203
|
-
],
|
|
1203
|
+
], sa = [
|
|
1204
1204
|
// Appearance (paint)
|
|
1205
1205
|
{ key: "circle-color", label: "Circle Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1206
1206
|
{ key: "circle-radius", label: "Radius", widget: "number", group: "Appearance", category: "paint", min: 0, step: 1 },
|
|
@@ -1218,7 +1218,7 @@ const ma = [
|
|
|
1218
1218
|
{ key: "circle-pitch-alignment", label: "Pitch Alignment", widget: "enum", group: "Alignment", category: "paint", options: ["map", "viewport"], enableDefault: "viewport", description: '"map" orients circles flat on the map surface; "viewport" keeps circles facing the screen (default).' },
|
|
1219
1219
|
// Sorting (layout)
|
|
1220
1220
|
{ key: "circle-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1221
|
-
],
|
|
1221
|
+
], ca = [
|
|
1222
1222
|
// Icon Appearance (paint)
|
|
1223
1223
|
{ key: "icon-color", label: "Icon Color", widget: "color", group: "Icon Appearance", category: "paint", enableDefault: "#000000" },
|
|
1224
1224
|
{ key: "icon-opacity", label: "Icon Opacity", widget: "opacity", group: "Icon Appearance", category: "paint", enableDefault: 1 },
|
|
@@ -1267,16 +1267,16 @@ const ma = [
|
|
|
1267
1267
|
{ key: "symbol-avoid-edges", label: "Avoid Edges", widget: "boolean", group: "Placement", category: "layout", enableDefault: !1, description: "When enabled, symbols near tile edges are hidden to avoid being clipped or doubled at tile boundaries." },
|
|
1268
1268
|
{ key: "symbol-sort-key", label: "Sort Key", widget: "number", group: "Placement", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are prioritised in collision detection and drawn on top within this layer." },
|
|
1269
1269
|
{ key: "symbol-z-order", label: "Z-Order", widget: "enum", group: "Placement", category: "layout", options: ["auto", "viewport-y", "source"], enableDefault: "auto", description: '"viewport-y" renders symbols in top-to-bottom screen order (closer = higher); "source" preserves data source order; "auto" uses "viewport-y" when sort-key is unset.' }
|
|
1270
|
-
],
|
|
1271
|
-
fill:
|
|
1272
|
-
line:
|
|
1273
|
-
circle:
|
|
1274
|
-
symbol:
|
|
1270
|
+
], da = {
|
|
1271
|
+
fill: ua,
|
|
1272
|
+
line: ma,
|
|
1273
|
+
circle: sa,
|
|
1274
|
+
symbol: ca
|
|
1275
1275
|
};
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1276
|
+
function ha(e) {
|
|
1277
|
+
return da[e] ?? [];
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function we(e) {
|
|
1280
1280
|
const t = {};
|
|
1281
1281
|
for (const i of e)
|
|
1282
1282
|
t[i.group] || (t[i.group] = []), t[i.group].push(i);
|
|
@@ -1285,151 +1285,151 @@ function ve(e) {
|
|
|
1285
1285
|
const me = {
|
|
1286
1286
|
type: "fill",
|
|
1287
1287
|
paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 }
|
|
1288
|
-
},
|
|
1288
|
+
}, ga = {
|
|
1289
1289
|
type: "line",
|
|
1290
1290
|
paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
|
|
1291
|
-
},
|
|
1291
|
+
}, Oe = {
|
|
1292
1292
|
type: "circle",
|
|
1293
1293
|
paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
|
|
1294
|
-
},
|
|
1294
|
+
}, ba = {
|
|
1295
1295
|
type: "symbol",
|
|
1296
1296
|
paint: { "text-color": "#333333" },
|
|
1297
1297
|
layout: { "text-field": "{name}", "text-size": 14 }
|
|
1298
|
-
},
|
|
1298
|
+
}, ya = {
|
|
1299
1299
|
layout: { "icon-image": "" }
|
|
1300
1300
|
};
|
|
1301
|
-
function
|
|
1301
|
+
function ve(e) {
|
|
1302
1302
|
if (e.type !== "symbol") return "text";
|
|
1303
1303
|
const t = e.layout ?? {}, i = "icon-image" in t, r = "text-field" in t;
|
|
1304
1304
|
return i && r ? "both" : i ? "icon" : "text";
|
|
1305
1305
|
}
|
|
1306
|
-
const
|
|
1306
|
+
const fa = "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", K = {
|
|
1307
1307
|
fill: "Fill",
|
|
1308
1308
|
line: "Line",
|
|
1309
1309
|
circle: "Circle",
|
|
1310
1310
|
symbol: "Symbol"
|
|
1311
|
-
},
|
|
1312
|
-
function
|
|
1313
|
-
const
|
|
1311
|
+
}, xa = ["text", "icon", "both"];
|
|
1312
|
+
function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties: o, onFetchDistinctValues: p }) {
|
|
1313
|
+
const y = r ?? (i ? [i] : []), [m, x] = A(() => ve(e));
|
|
1314
1314
|
X(() => {
|
|
1315
|
-
|
|
1315
|
+
x(ve(e));
|
|
1316
1316
|
}, [e.type]);
|
|
1317
|
-
const
|
|
1318
|
-
t(
|
|
1319
|
-
}, f = (
|
|
1320
|
-
if (
|
|
1321
|
-
const
|
|
1322
|
-
let
|
|
1323
|
-
|
|
1317
|
+
const h = (c) => {
|
|
1318
|
+
t(c === "fill" ? me : c === "line" ? ga : c === "circle" ? Oe : ba);
|
|
1319
|
+
}, f = (c) => {
|
|
1320
|
+
if (c === m) return;
|
|
1321
|
+
const P = e.paint ?? {}, O = e.layout ?? {};
|
|
1322
|
+
let b = { ...P }, k = { ...O };
|
|
1323
|
+
c === "icon" ? (b = Object.fromEntries(Object.entries(b).filter(([j]) => !j.startsWith("text-"))), k = Object.fromEntries(Object.entries(k).filter(([j]) => !j.startsWith("text-"))), "icon-image" in k || (k["icon-image"] = ya.layout["icon-image"])) : c === "text" && (b = Object.fromEntries(Object.entries(b).filter(([j]) => !j.startsWith("icon-"))), k = Object.fromEntries(Object.entries(k).filter(([j]) => !j.startsWith("icon-"))), "text-field" in k || (k["text-field"] = "{name}"), "text-size" in k || (k["text-size"] = 14), "text-color" in b || (b["text-color"] = "#333333")), x(c), t({
|
|
1324
1324
|
...e,
|
|
1325
|
-
paint:
|
|
1326
|
-
layout: Object.keys(
|
|
1325
|
+
paint: b,
|
|
1326
|
+
layout: Object.keys(k).length > 0 ? k : void 0
|
|
1327
1327
|
});
|
|
1328
|
-
},
|
|
1329
|
-
const
|
|
1330
|
-
for (const
|
|
1331
|
-
|
|
1332
|
-
t({ ...e, paint:
|
|
1333
|
-
}, u = (
|
|
1334
|
-
const
|
|
1335
|
-
for (const
|
|
1336
|
-
|
|
1328
|
+
}, d = (c, P) => {
|
|
1329
|
+
const O = { ...e.paint, [c]: P };
|
|
1330
|
+
for (const b of Object.keys(O))
|
|
1331
|
+
O[b] === void 0 && delete O[b];
|
|
1332
|
+
t({ ...e, paint: O });
|
|
1333
|
+
}, u = (c, P) => {
|
|
1334
|
+
const b = { ...e.layout ?? {}, [c]: P };
|
|
1335
|
+
for (const k of Object.keys(b))
|
|
1336
|
+
b[k] === void 0 && delete b[k];
|
|
1337
1337
|
t({
|
|
1338
1338
|
...e,
|
|
1339
|
-
layout: Object.keys(
|
|
1339
|
+
layout: Object.keys(b).length > 0 ? b : void 0
|
|
1340
1340
|
});
|
|
1341
1341
|
};
|
|
1342
|
-
let s =
|
|
1343
|
-
e.type === "symbol" && (m === "text" ? s = s.filter((
|
|
1344
|
-
const v = s.filter((
|
|
1342
|
+
let s = ha(e.type);
|
|
1343
|
+
e.type === "symbol" && (m === "text" ? s = s.filter((c) => !c.key.startsWith("icon-")) : m === "icon" && (s = s.filter((c) => !c.key.startsWith("text-"))));
|
|
1344
|
+
const v = s.filter((c) => c.category === "paint"), N = s.filter((c) => c.category === "layout"), D = we(v), M = we(N), w = e.paint, C = e.layout ?? {}, F = Object.keys(D), T = Object.keys(M);
|
|
1345
1345
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1346
|
-
|
|
1346
|
+
y.length > 0 && !y.includes(e.type) && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-blue-800", children: [
|
|
1347
1347
|
/* @__PURE__ */ l("span", { children: [
|
|
1348
1348
|
"Detected geometry is suitable for",
|
|
1349
1349
|
" ",
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
/* @__PURE__ */ a("strong", { children: K[
|
|
1353
|
-
] },
|
|
1350
|
+
y.map((c, P) => /* @__PURE__ */ l("span", { children: [
|
|
1351
|
+
P > 0 && (P === y.length - 1 ? " or " : ", "),
|
|
1352
|
+
/* @__PURE__ */ a("strong", { children: K[c] })
|
|
1353
|
+
] }, c)),
|
|
1354
1354
|
" ",
|
|
1355
1355
|
"style."
|
|
1356
1356
|
] }),
|
|
1357
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children:
|
|
1357
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: y.map((c) => /* @__PURE__ */ a(
|
|
1358
1358
|
"button",
|
|
1359
1359
|
{
|
|
1360
1360
|
type: "button",
|
|
1361
|
-
onClick: () =>
|
|
1361
|
+
onClick: () => h(c),
|
|
1362
1362
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-400 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
1363
|
-
children: K[
|
|
1363
|
+
children: K[c]
|
|
1364
1364
|
},
|
|
1365
|
-
|
|
1365
|
+
c
|
|
1366
1366
|
)) })
|
|
1367
1367
|
] }),
|
|
1368
1368
|
/* @__PURE__ */ a(S, { label: "Style Type", children: /* @__PURE__ */ a(
|
|
1369
1369
|
"select",
|
|
1370
1370
|
{
|
|
1371
1371
|
value: e.type,
|
|
1372
|
-
onChange: (
|
|
1373
|
-
className:
|
|
1374
|
-
children: Object.keys(K).map((
|
|
1372
|
+
onChange: (c) => h(c.target.value),
|
|
1373
|
+
className: fa,
|
|
1374
|
+
children: Object.keys(K).map((c) => /* @__PURE__ */ a("option", { value: c, children: K[c] }, c))
|
|
1375
1375
|
}
|
|
1376
1376
|
) }),
|
|
1377
|
-
e.type === "symbol" && /* @__PURE__ */ a(S, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children:
|
|
1377
|
+
e.type === "symbol" && /* @__PURE__ */ a(S, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: xa.map((c) => /* @__PURE__ */ a(
|
|
1378
1378
|
"button",
|
|
1379
1379
|
{
|
|
1380
1380
|
type: "button",
|
|
1381
|
-
onClick: () => f(
|
|
1381
|
+
onClick: () => f(c),
|
|
1382
1382
|
className: [
|
|
1383
1383
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-sm mapui:capitalize mapui:outline-none",
|
|
1384
1384
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
1385
|
-
m ===
|
|
1385
|
+
m === c ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
1386
1386
|
].join(" "),
|
|
1387
|
-
children:
|
|
1387
|
+
children: c === "both" ? "Both" : c.charAt(0).toUpperCase() + c.slice(1)
|
|
1388
1388
|
},
|
|
1389
|
-
|
|
1389
|
+
c
|
|
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(oa, { style: e })
|
|
1394
1394
|
] }),
|
|
1395
|
-
|
|
1395
|
+
T.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" }),
|
|
1397
|
-
|
|
1398
|
-
|
|
1397
|
+
T.map((c, P) => /* @__PURE__ */ a(
|
|
1398
|
+
fe,
|
|
1399
1399
|
{
|
|
1400
|
-
title:
|
|
1401
|
-
properties:
|
|
1400
|
+
title: c,
|
|
1401
|
+
properties: M[c],
|
|
1402
1402
|
values: C,
|
|
1403
1403
|
onChange: u,
|
|
1404
|
-
defaultOpen:
|
|
1404
|
+
defaultOpen: P === 0,
|
|
1405
1405
|
availableIcons: n,
|
|
1406
1406
|
availableProperties: o,
|
|
1407
1407
|
onFetchDistinctValues: p
|
|
1408
1408
|
},
|
|
1409
|
-
|
|
1409
|
+
c
|
|
1410
1410
|
))
|
|
1411
1411
|
] }),
|
|
1412
|
-
|
|
1412
|
+
F.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1413
1413
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
|
|
1414
|
-
|
|
1415
|
-
|
|
1414
|
+
F.map((c) => /* @__PURE__ */ a(
|
|
1415
|
+
fe,
|
|
1416
1416
|
{
|
|
1417
|
-
title:
|
|
1418
|
-
properties: D[
|
|
1419
|
-
values:
|
|
1420
|
-
onChange:
|
|
1417
|
+
title: c,
|
|
1418
|
+
properties: D[c],
|
|
1419
|
+
values: w,
|
|
1420
|
+
onChange: d,
|
|
1421
1421
|
defaultOpen: !1,
|
|
1422
1422
|
availableIcons: n,
|
|
1423
1423
|
availableProperties: o,
|
|
1424
1424
|
onFetchDistinctValues: p
|
|
1425
1425
|
},
|
|
1426
|
-
|
|
1426
|
+
c
|
|
1427
1427
|
))
|
|
1428
1428
|
] })
|
|
1429
1429
|
] });
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
function
|
|
1431
|
+
const Ne = "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";
|
|
1432
|
+
function va({ value: e, onChange: t }) {
|
|
1433
1433
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1434
1434
|
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
1435
1435
|
"input",
|
|
@@ -1438,7 +1438,7 @@ function wa({ value: e, onChange: t }) {
|
|
|
1438
1438
|
value: e.label,
|
|
1439
1439
|
onChange: (i) => t({ ...e, label: i.target.value }),
|
|
1440
1440
|
placeholder: "Legend entry label",
|
|
1441
|
-
className:
|
|
1441
|
+
className: Ne
|
|
1442
1442
|
}
|
|
1443
1443
|
) }),
|
|
1444
1444
|
/* @__PURE__ */ a(S, { label: "Color", children: /* @__PURE__ */ a(
|
|
@@ -1454,7 +1454,7 @@ function wa({ value: e, onChange: t }) {
|
|
|
1454
1454
|
{
|
|
1455
1455
|
value: e.shape ?? "square",
|
|
1456
1456
|
onChange: (i) => t({ ...e, shape: i.target.value }),
|
|
1457
|
-
className:
|
|
1457
|
+
className: Ne,
|
|
1458
1458
|
children: [
|
|
1459
1459
|
/* @__PURE__ */ a("option", { value: "square", children: "Square" }),
|
|
1460
1460
|
/* @__PURE__ */ a("option", { value: "circle", children: "Circle" }),
|
|
@@ -1464,45 +1464,45 @@ function wa({ value: e, onChange: t }) {
|
|
|
1464
1464
|
) })
|
|
1465
1465
|
] });
|
|
1466
1466
|
}
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", o =
|
|
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
|
+
function Na({ value: e, onChange: t, style: i }) {
|
|
1469
|
+
const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", o = Ee(() => {
|
|
1470
1470
|
if (!i) return null;
|
|
1471
|
-
const
|
|
1472
|
-
if (!
|
|
1473
|
-
const u =
|
|
1471
|
+
const d = na(i);
|
|
1472
|
+
if (!W(d)) return null;
|
|
1473
|
+
const u = ia(d);
|
|
1474
1474
|
if (!u) return null;
|
|
1475
|
-
const s =
|
|
1475
|
+
const s = pa(i);
|
|
1476
1476
|
return {
|
|
1477
|
-
entries:
|
|
1478
|
-
label:
|
|
1479
|
-
color:
|
|
1477
|
+
entries: ra(d).map((N) => ({
|
|
1478
|
+
label: N.label,
|
|
1479
|
+
color: N.color,
|
|
1480
1480
|
shape: s
|
|
1481
1481
|
})),
|
|
1482
1482
|
mode: u === "interpolate" ? "gradient" : "categorical",
|
|
1483
|
-
property:
|
|
1483
|
+
property: la(d)
|
|
1484
1484
|
};
|
|
1485
1485
|
}, [i]), p = () => {
|
|
1486
|
-
t({ ...e, entries: [...r,
|
|
1487
|
-
},
|
|
1488
|
-
const s = r.map((v,
|
|
1486
|
+
t({ ...e, entries: [...r, ke()] });
|
|
1487
|
+
}, y = (d, u) => {
|
|
1488
|
+
const s = r.map((v, N) => N === d ? u : v);
|
|
1489
1489
|
t({ ...e, entries: s });
|
|
1490
|
-
}, m = (
|
|
1491
|
-
const u = r.filter((s, v) => v !==
|
|
1490
|
+
}, m = (d) => {
|
|
1491
|
+
const u = r.filter((s, v) => v !== d);
|
|
1492
1492
|
t(u.length > 0 ? { ...e, entries: u } : void 0);
|
|
1493
|
-
},
|
|
1494
|
-
t(
|
|
1495
|
-
},
|
|
1493
|
+
}, x = (d) => {
|
|
1494
|
+
t(d ? { entries: [ke()] } : void 0);
|
|
1495
|
+
}, h = () => {
|
|
1496
1496
|
o && t({
|
|
1497
1497
|
entries: o.entries,
|
|
1498
1498
|
displayMode: o.mode,
|
|
1499
1499
|
...o.mode === "gradient" && o.property ? { gradientProperty: o.property } : {},
|
|
1500
1500
|
...o.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
|
|
1501
1501
|
});
|
|
1502
|
-
}, f = (
|
|
1502
|
+
}, f = (d) => {
|
|
1503
1503
|
if (!e) return;
|
|
1504
|
-
const u = { ...e, displayMode:
|
|
1505
|
-
|
|
1504
|
+
const u = { ...e, displayMode: d };
|
|
1505
|
+
d !== "categorical" && delete u.showLabelsCollapsed, d !== "gradient" && delete u.gradientProperty, t(u);
|
|
1506
1506
|
};
|
|
1507
1507
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1508
1508
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -1512,7 +1512,7 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1512
1512
|
type: "checkbox",
|
|
1513
1513
|
id: "legend-enabled",
|
|
1514
1514
|
checked: e !== void 0,
|
|
1515
|
-
onChange: (
|
|
1515
|
+
onChange: (d) => x(d.target.checked),
|
|
1516
1516
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1517
1517
|
}
|
|
1518
1518
|
),
|
|
@@ -1527,23 +1527,23 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1527
1527
|
")"
|
|
1528
1528
|
] }),
|
|
1529
1529
|
/* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
|
|
1530
|
-
o.entries.slice(0, re).map((
|
|
1530
|
+
o.entries.slice(0, re).map((d, u) => /* @__PURE__ */ l(
|
|
1531
1531
|
"div",
|
|
1532
1532
|
{
|
|
1533
1533
|
className: "mapui:flex mapui:items-center mapui:gap-1",
|
|
1534
|
-
title:
|
|
1534
|
+
title: d.label,
|
|
1535
1535
|
children: [
|
|
1536
1536
|
/* @__PURE__ */ a(
|
|
1537
1537
|
"span",
|
|
1538
1538
|
{
|
|
1539
1539
|
className: "mapui:inline-block mapui:h-3 mapui:w-3 mapui:rounded-sm mapui:shrink-0",
|
|
1540
|
-
style: { backgroundColor:
|
|
1540
|
+
style: { backgroundColor: d.color }
|
|
1541
1541
|
}
|
|
1542
1542
|
),
|
|
1543
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children:
|
|
1543
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children: d.label })
|
|
1544
1544
|
]
|
|
1545
1545
|
},
|
|
1546
|
-
`${
|
|
1546
|
+
`${d.label}-${u}`
|
|
1547
1547
|
)),
|
|
1548
1548
|
o.entries.length > re && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
|
|
1549
1549
|
"+",
|
|
@@ -1555,13 +1555,13 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1555
1555
|
"button",
|
|
1556
1556
|
{
|
|
1557
1557
|
type: "button",
|
|
1558
|
-
onClick:
|
|
1558
|
+
onClick: h,
|
|
1559
1559
|
className: "mapui:mt-2 mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
1560
1560
|
children: "Generate from Style"
|
|
1561
1561
|
}
|
|
1562
1562
|
)
|
|
1563
1563
|
] }),
|
|
1564
|
-
e !== void 0 && /* @__PURE__ */ l(
|
|
1564
|
+
e !== void 0 && /* @__PURE__ */ l(q, { children: [
|
|
1565
1565
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1566
1566
|
/* @__PURE__ */ a("label", { htmlFor: "legend-display-mode", className: "mapui:text-sm mapui:text-gray-700", children: "Display Mode" }),
|
|
1567
1567
|
/* @__PURE__ */ l(
|
|
@@ -1569,8 +1569,8 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1569
1569
|
{
|
|
1570
1570
|
id: "legend-display-mode",
|
|
1571
1571
|
value: n,
|
|
1572
|
-
onChange: (
|
|
1573
|
-
className:
|
|
1572
|
+
onChange: (d) => f(d.target.value),
|
|
1573
|
+
className: Ce,
|
|
1574
1574
|
children: [
|
|
1575
1575
|
/* @__PURE__ */ a("option", { value: "simple", children: "Simple" }),
|
|
1576
1576
|
/* @__PURE__ */ a("option", { value: "categorical", children: "Categorical" }),
|
|
@@ -1586,7 +1586,7 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1586
1586
|
type: "checkbox",
|
|
1587
1587
|
id: "legend-show-labels-collapsed",
|
|
1588
1588
|
checked: e.showLabelsCollapsed ?? !1,
|
|
1589
|
-
onChange: (
|
|
1589
|
+
onChange: (d) => t({ ...e, showLabelsCollapsed: d.target.checked }),
|
|
1590
1590
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1591
1591
|
}
|
|
1592
1592
|
),
|
|
@@ -1600,13 +1600,13 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1600
1600
|
type: "text",
|
|
1601
1601
|
id: "legend-gradient-property",
|
|
1602
1602
|
value: e.gradientProperty ?? "",
|
|
1603
|
-
onChange: (
|
|
1603
|
+
onChange: (d) => t({ ...e, gradientProperty: d.target.value || void 0 }),
|
|
1604
1604
|
placeholder: "e.g. POP_EST",
|
|
1605
|
-
className:
|
|
1605
|
+
className: Ce
|
|
1606
1606
|
}
|
|
1607
1607
|
)
|
|
1608
1608
|
] }),
|
|
1609
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: r.map((
|
|
1609
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: r.map((d, u) => /* @__PURE__ */ l(
|
|
1610
1610
|
"li",
|
|
1611
1611
|
{
|
|
1612
1612
|
className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:p-3",
|
|
@@ -1627,10 +1627,10 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1627
1627
|
)
|
|
1628
1628
|
] }),
|
|
1629
1629
|
/* @__PURE__ */ a(
|
|
1630
|
-
|
|
1630
|
+
va,
|
|
1631
1631
|
{
|
|
1632
|
-
value:
|
|
1633
|
-
onChange: (s) =>
|
|
1632
|
+
value: d,
|
|
1633
|
+
onChange: (s) => y(u, s)
|
|
1634
1634
|
}
|
|
1635
1635
|
)
|
|
1636
1636
|
]
|
|
@@ -1651,7 +1651,7 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1651
1651
|
"button",
|
|
1652
1652
|
{
|
|
1653
1653
|
type: "button",
|
|
1654
|
-
onClick:
|
|
1654
|
+
onClick: h,
|
|
1655
1655
|
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",
|
|
1656
1656
|
children: [
|
|
1657
1657
|
"Populate from Style (",
|
|
@@ -1664,13 +1664,13 @@ function va({ value: e, onChange: t, style: i }) {
|
|
|
1664
1664
|
] })
|
|
1665
1665
|
] });
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function Se({
|
|
1668
1668
|
options: e,
|
|
1669
1669
|
onChange: t,
|
|
1670
1670
|
placeholder: i,
|
|
1671
1671
|
className: r
|
|
1672
1672
|
}) {
|
|
1673
|
-
const [n, o] =
|
|
1673
|
+
const [n, o] = A(() => (e == null ? void 0 : e.join(", ")) ?? "");
|
|
1674
1674
|
return X(() => {
|
|
1675
1675
|
o((e == null ? void 0 : e.join(", ")) ?? "");
|
|
1676
1676
|
}, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
|
|
@@ -1678,9 +1678,9 @@ function De({
|
|
|
1678
1678
|
{
|
|
1679
1679
|
type: "text",
|
|
1680
1680
|
value: n,
|
|
1681
|
-
onChange: (
|
|
1681
|
+
onChange: (y) => o(y.target.value),
|
|
1682
1682
|
onBlur: () => {
|
|
1683
|
-
const
|
|
1683
|
+
const y = n.trim(), m = y ? y.split(",").map((x) => x.trim()).filter(Boolean) : void 0;
|
|
1684
1684
|
t(m), o((m == null ? void 0 : m.join(", ")) ?? "");
|
|
1685
1685
|
},
|
|
1686
1686
|
placeholder: i,
|
|
@@ -1688,15 +1688,15 @@ function De({
|
|
|
1688
1688
|
}
|
|
1689
1689
|
);
|
|
1690
1690
|
}
|
|
1691
|
-
const
|
|
1691
|
+
const R = "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", ka = {
|
|
1692
1692
|
text: { type: "text", property: "", label: "", autocomplete: !1 },
|
|
1693
1693
|
number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
|
|
1694
1694
|
datetime: { type: "datetime", property: "", label: "", range: !1 },
|
|
1695
1695
|
select: { type: "select", property: "", label: "" }
|
|
1696
1696
|
};
|
|
1697
|
-
function
|
|
1697
|
+
function Ca({ value: e, onChange: t, availableProperties: i }) {
|
|
1698
1698
|
const r = (p) => {
|
|
1699
|
-
t({ ...
|
|
1699
|
+
t({ ...ka[p], property: e.property, label: e.label });
|
|
1700
1700
|
}, n = (p) => t({ ...e, ...p }), o = i && i.length > 0;
|
|
1701
1701
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1702
1702
|
/* @__PURE__ */ a(S, { label: "Field Type", children: /* @__PURE__ */ l(
|
|
@@ -1704,7 +1704,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1704
1704
|
{
|
|
1705
1705
|
value: e.type,
|
|
1706
1706
|
onChange: (p) => r(p.target.value),
|
|
1707
|
-
className:
|
|
1707
|
+
className: R,
|
|
1708
1708
|
children: [
|
|
1709
1709
|
/* @__PURE__ */ a("option", { value: "text", children: "Text" }),
|
|
1710
1710
|
/* @__PURE__ */ a("option", { value: "number", children: "Number" }),
|
|
@@ -1718,7 +1718,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1718
1718
|
{
|
|
1719
1719
|
value: e.property,
|
|
1720
1720
|
onChange: (p) => n({ property: p.target.value }),
|
|
1721
|
-
className:
|
|
1721
|
+
className: R,
|
|
1722
1722
|
children: [
|
|
1723
1723
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
1724
1724
|
i.map((p) => /* @__PURE__ */ a("option", { value: p.name, children: p.title ?? p.name }, p.name))
|
|
@@ -1731,7 +1731,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1731
1731
|
value: e.property,
|
|
1732
1732
|
onChange: (p) => n({ property: p.target.value }),
|
|
1733
1733
|
placeholder: "e.g. name",
|
|
1734
|
-
className:
|
|
1734
|
+
className: R
|
|
1735
1735
|
}
|
|
1736
1736
|
) }),
|
|
1737
1737
|
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
@@ -1741,7 +1741,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1741
1741
|
value: e.label,
|
|
1742
1742
|
onChange: (p) => n({ label: p.target.value }),
|
|
1743
1743
|
placeholder: "Display label",
|
|
1744
|
-
className:
|
|
1744
|
+
className: R
|
|
1745
1745
|
}
|
|
1746
1746
|
) }),
|
|
1747
1747
|
/* @__PURE__ */ a(S, { label: "Placeholder", children: /* @__PURE__ */ a(
|
|
@@ -1751,10 +1751,10 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1751
1751
|
value: e.placeholder ?? "",
|
|
1752
1752
|
onChange: (p) => n({ placeholder: p.target.value || void 0 }),
|
|
1753
1753
|
placeholder: "Input placeholder text",
|
|
1754
|
-
className:
|
|
1754
|
+
className: R
|
|
1755
1755
|
}
|
|
1756
1756
|
) }),
|
|
1757
|
-
e.type === "text" && /* @__PURE__ */ l(
|
|
1757
|
+
e.type === "text" && /* @__PURE__ */ l(q, { children: [
|
|
1758
1758
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1759
1759
|
/* @__PURE__ */ a(
|
|
1760
1760
|
"input",
|
|
@@ -1782,16 +1782,16 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1782
1782
|
/* @__PURE__ */ a("label", { htmlFor: "text-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
|
|
1783
1783
|
] }),
|
|
1784
1784
|
/* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
|
|
1785
|
-
|
|
1785
|
+
Se,
|
|
1786
1786
|
{
|
|
1787
1787
|
options: e.options,
|
|
1788
1788
|
onChange: (p) => t({ ...e, options: p }),
|
|
1789
1789
|
placeholder: "option1, option2",
|
|
1790
|
-
className:
|
|
1790
|
+
className: R
|
|
1791
1791
|
}
|
|
1792
1792
|
) })
|
|
1793
1793
|
] }),
|
|
1794
|
-
e.type === "number" && /* @__PURE__ */ l(
|
|
1794
|
+
e.type === "number" && /* @__PURE__ */ l(q, { children: [
|
|
1795
1795
|
/* @__PURE__ */ a(S, { label: "Input Mode", children: /* @__PURE__ */ l(
|
|
1796
1796
|
"select",
|
|
1797
1797
|
{
|
|
@@ -1800,7 +1800,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1800
1800
|
...e,
|
|
1801
1801
|
inputMode: p.target.value
|
|
1802
1802
|
}),
|
|
1803
|
-
className:
|
|
1803
|
+
className: R,
|
|
1804
1804
|
children: [
|
|
1805
1805
|
/* @__PURE__ */ a("option", { value: "input", children: "Input" }),
|
|
1806
1806
|
/* @__PURE__ */ a("option", { value: "slider", children: "Slider" })
|
|
@@ -1815,7 +1815,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1815
1815
|
...e,
|
|
1816
1816
|
operator: p.target.value
|
|
1817
1817
|
}),
|
|
1818
|
-
className:
|
|
1818
|
+
className: R,
|
|
1819
1819
|
children: [
|
|
1820
1820
|
/* @__PURE__ */ a("option", { value: "eq", children: "Equal (=)" }),
|
|
1821
1821
|
/* @__PURE__ */ a("option", { value: "gt", children: "Greater Than (>)" }),
|
|
@@ -1836,7 +1836,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1836
1836
|
...e,
|
|
1837
1837
|
min: p.target.value ? parseFloat(p.target.value) : void 0
|
|
1838
1838
|
}),
|
|
1839
|
-
className:
|
|
1839
|
+
className: R
|
|
1840
1840
|
}
|
|
1841
1841
|
) }),
|
|
1842
1842
|
/* @__PURE__ */ a(S, { label: "Max", children: /* @__PURE__ */ a(
|
|
@@ -1848,7 +1848,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1848
1848
|
...e,
|
|
1849
1849
|
max: p.target.value ? parseFloat(p.target.value) : void 0
|
|
1850
1850
|
}),
|
|
1851
|
-
className:
|
|
1851
|
+
className: R
|
|
1852
1852
|
}
|
|
1853
1853
|
) }),
|
|
1854
1854
|
/* @__PURE__ */ a(S, { label: "Step", children: /* @__PURE__ */ a(
|
|
@@ -1860,7 +1860,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1860
1860
|
...e,
|
|
1861
1861
|
step: p.target.value ? parseFloat(p.target.value) : void 0
|
|
1862
1862
|
}),
|
|
1863
|
-
className:
|
|
1863
|
+
className: R
|
|
1864
1864
|
}
|
|
1865
1865
|
) })
|
|
1866
1866
|
] })
|
|
@@ -1878,7 +1878,7 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1878
1878
|
),
|
|
1879
1879
|
/* @__PURE__ */ a("label", { htmlFor: "datetime-range", className: "mapui:text-sm mapui:text-gray-700", children: "Date Range" })
|
|
1880
1880
|
] }),
|
|
1881
|
-
e.type === "select" && /* @__PURE__ */ l(
|
|
1881
|
+
e.type === "select" && /* @__PURE__ */ l(q, { children: [
|
|
1882
1882
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1883
1883
|
/* @__PURE__ */ a(
|
|
1884
1884
|
"input",
|
|
@@ -1893,43 +1893,43 @@ function ka({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1893
1893
|
/* @__PURE__ */ a("label", { htmlFor: "select-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
|
|
1894
1894
|
] }),
|
|
1895
1895
|
/* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
|
|
1896
|
-
|
|
1896
|
+
Se,
|
|
1897
1897
|
{
|
|
1898
1898
|
options: e.options,
|
|
1899
1899
|
onChange: (p) => t({ ...e, options: p }),
|
|
1900
1900
|
placeholder: "option1, option2",
|
|
1901
|
-
className:
|
|
1901
|
+
className: R
|
|
1902
1902
|
}
|
|
1903
1903
|
) })
|
|
1904
1904
|
] })
|
|
1905
1905
|
] });
|
|
1906
1906
|
}
|
|
1907
|
-
const
|
|
1907
|
+
const Sa = () => ({
|
|
1908
1908
|
type: "text",
|
|
1909
1909
|
property: "",
|
|
1910
1910
|
label: "",
|
|
1911
1911
|
autocomplete: !1
|
|
1912
1912
|
});
|
|
1913
|
-
function
|
|
1914
|
-
const [r, n] =
|
|
1915
|
-
const
|
|
1916
|
-
t(
|
|
1917
|
-
}, p = (
|
|
1918
|
-
t(e.map((
|
|
1919
|
-
},
|
|
1920
|
-
t(e.filter((f,
|
|
1921
|
-
}, m = (
|
|
1922
|
-
if (
|
|
1913
|
+
function Da({ fields: e, onChange: t, availableProperties: i }) {
|
|
1914
|
+
const [r, n] = A(null), o = () => {
|
|
1915
|
+
const h = [...e, Sa()];
|
|
1916
|
+
t(h), n(h.length - 1);
|
|
1917
|
+
}, p = (h, f) => {
|
|
1918
|
+
t(e.map((d, u) => u === h ? f : d));
|
|
1919
|
+
}, y = (h) => {
|
|
1920
|
+
t(e.filter((f, d) => d !== h)), n(null);
|
|
1921
|
+
}, m = (h) => {
|
|
1922
|
+
if (h === 0) return;
|
|
1923
1923
|
const f = [...e];
|
|
1924
|
-
[f[
|
|
1925
|
-
},
|
|
1926
|
-
if (
|
|
1924
|
+
[f[h - 1], f[h]] = [f[h], f[h - 1]], t(f), n(h - 1);
|
|
1925
|
+
}, x = (h) => {
|
|
1926
|
+
if (h === e.length - 1) return;
|
|
1927
1927
|
const f = [...e];
|
|
1928
|
-
[f[
|
|
1928
|
+
[f[h], f[h + 1]] = [f[h + 1], f[h]], t(f), n(h + 1);
|
|
1929
1929
|
};
|
|
1930
1930
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1931
1931
|
e.length === 0 && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
|
|
1932
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
1932
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((h, f) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
|
|
1933
1933
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
|
|
1934
1934
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
1935
1935
|
/* @__PURE__ */ a(
|
|
@@ -1947,7 +1947,7 @@ function Sa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1947
1947
|
"button",
|
|
1948
1948
|
{
|
|
1949
1949
|
type: "button",
|
|
1950
|
-
onClick: () =>
|
|
1950
|
+
onClick: () => x(f),
|
|
1951
1951
|
disabled: f === e.length - 1,
|
|
1952
1952
|
"aria-label": "Move down",
|
|
1953
1953
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
@@ -1962,8 +1962,8 @@ function Sa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1962
1962
|
onClick: () => n(r === f ? null : f),
|
|
1963
1963
|
className: "mapui:flex-1 mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:text-left mapui:text-sm mapui:font-medium mapui:text-gray-800",
|
|
1964
1964
|
children: [
|
|
1965
|
-
/* @__PURE__ */ a("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children:
|
|
1966
|
-
|
|
1965
|
+
/* @__PURE__ */ a("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: h.type }),
|
|
1966
|
+
h.label || h.property || "Untitled field"
|
|
1967
1967
|
]
|
|
1968
1968
|
}
|
|
1969
1969
|
),
|
|
@@ -1971,7 +1971,7 @@ function Sa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1971
1971
|
"button",
|
|
1972
1972
|
{
|
|
1973
1973
|
type: "button",
|
|
1974
|
-
onClick: () =>
|
|
1974
|
+
onClick: () => y(f),
|
|
1975
1975
|
"aria-label": "Remove field",
|
|
1976
1976
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
1977
1977
|
children: "Remove"
|
|
@@ -1979,10 +1979,10 @@ function Sa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1979
1979
|
)
|
|
1980
1980
|
] }),
|
|
1981
1981
|
r === f && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
1982
|
-
|
|
1982
|
+
Ca,
|
|
1983
1983
|
{
|
|
1984
|
-
value:
|
|
1985
|
-
onChange: (
|
|
1984
|
+
value: h,
|
|
1985
|
+
onChange: (d) => p(f, d),
|
|
1986
1986
|
availableProperties: i
|
|
1987
1987
|
}
|
|
1988
1988
|
) })
|
|
@@ -1998,14 +1998,14 @@ function Sa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
1998
1998
|
)
|
|
1999
1999
|
] });
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function Ta(e) {
|
|
2002
2002
|
return Object.entries(e).map(([t, i]) => ({
|
|
2003
2003
|
key: t,
|
|
2004
2004
|
label: i.label ?? "",
|
|
2005
2005
|
visible: i.visible ?? !0
|
|
2006
2006
|
}));
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function La(e) {
|
|
2009
2009
|
const t = {};
|
|
2010
2010
|
for (const i of e)
|
|
2011
2011
|
t[i.key] = {
|
|
@@ -2015,17 +2015,17 @@ function Ta(e) {
|
|
|
2015
2015
|
return t;
|
|
2016
2016
|
}
|
|
2017
2017
|
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";
|
|
2018
|
-
function
|
|
2019
|
-
const r =
|
|
2018
|
+
function Aa({ value: e, onChange: t, availableProperties: i }) {
|
|
2019
|
+
const r = Ta(e), n = i && i.length > 0, o = (u) => t(La(u)), p = () => {
|
|
2020
2020
|
o([...r, { key: "", label: "", visible: !0 }]);
|
|
2021
|
-
},
|
|
2021
|
+
}, y = (u) => {
|
|
2022
2022
|
o(r.filter((s, v) => v !== u));
|
|
2023
2023
|
}, m = (u, s) => {
|
|
2024
|
-
o(r.map((v,
|
|
2025
|
-
},
|
|
2026
|
-
const v = i == null ? void 0 : i.find((D) => D.name === s),
|
|
2027
|
-
o(r.map((D,
|
|
2028
|
-
},
|
|
2024
|
+
o(r.map((v, N) => N === u ? { ...v, ...s } : v));
|
|
2025
|
+
}, x = (u, s) => {
|
|
2026
|
+
const v = i == null ? void 0 : i.find((D) => D.name === s), N = (v == null ? void 0 : v.title) ?? r[u].label;
|
|
2027
|
+
o(r.map((D, M) => M === u ? { ...D, key: s, label: N } : D));
|
|
2028
|
+
}, h = (u) => {
|
|
2029
2029
|
if (u === 0) return;
|
|
2030
2030
|
const s = [...r];
|
|
2031
2031
|
[s[u - 1], s[u]] = [s[u], s[u - 1]], o(s);
|
|
@@ -2033,7 +2033,7 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2033
2033
|
if (u === r.length - 1) return;
|
|
2034
2034
|
const s = [...r];
|
|
2035
2035
|
[s[u], s[u + 1]] = [s[u + 1], s[u]], o(s);
|
|
2036
|
-
},
|
|
2036
|
+
}, d = () => {
|
|
2037
2037
|
if (!i) return;
|
|
2038
2038
|
const u = i.map((s) => ({
|
|
2039
2039
|
key: s.name,
|
|
@@ -2043,18 +2043,18 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2043
2043
|
o(u);
|
|
2044
2044
|
};
|
|
2045
2045
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2046
|
-
r.length === 0 ? /* @__PURE__ */ l(
|
|
2046
|
+
r.length === 0 ? /* @__PURE__ */ l(q, { children: [
|
|
2047
2047
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No property display rules configured. All properties will be shown." }),
|
|
2048
2048
|
n && /* @__PURE__ */ a(
|
|
2049
2049
|
"button",
|
|
2050
2050
|
{
|
|
2051
2051
|
type: "button",
|
|
2052
|
-
onClick:
|
|
2052
|
+
onClick: d,
|
|
2053
2053
|
className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-blue-50 mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
2054
2054
|
children: "Populate from API metadata"
|
|
2055
2055
|
}
|
|
2056
2056
|
)
|
|
2057
|
-
] }) : /* @__PURE__ */ l(
|
|
2057
|
+
] }) : /* @__PURE__ */ l(q, { children: [
|
|
2058
2058
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:items-center mapui:gap-2 mapui:px-8", style: { gridTemplateColumns: "1fr 1fr auto" }, children: [
|
|
2059
2059
|
/* @__PURE__ */ a(S, { label: "Property Key", children: /* @__PURE__ */ a("span", {}) }),
|
|
2060
2060
|
/* @__PURE__ */ a(S, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
|
|
@@ -2066,7 +2066,7 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2066
2066
|
"button",
|
|
2067
2067
|
{
|
|
2068
2068
|
type: "button",
|
|
2069
|
-
onClick: () =>
|
|
2069
|
+
onClick: () => h(s),
|
|
2070
2070
|
disabled: s === 0,
|
|
2071
2071
|
"aria-label": "Move up",
|
|
2072
2072
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
@@ -2090,7 +2090,7 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2090
2090
|
"select",
|
|
2091
2091
|
{
|
|
2092
2092
|
value: u.key,
|
|
2093
|
-
onChange: (v) =>
|
|
2093
|
+
onChange: (v) => x(s, v.target.value),
|
|
2094
2094
|
"aria-label": "Property key",
|
|
2095
2095
|
className: le,
|
|
2096
2096
|
children: [
|
|
@@ -2134,7 +2134,7 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2134
2134
|
"button",
|
|
2135
2135
|
{
|
|
2136
2136
|
type: "button",
|
|
2137
|
-
onClick: () =>
|
|
2137
|
+
onClick: () => y(s),
|
|
2138
2138
|
"aria-label": "Remove property",
|
|
2139
2139
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2140
2140
|
children: "Remove"
|
|
@@ -2154,39 +2154,39 @@ function La({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2154
2154
|
)
|
|
2155
2155
|
] });
|
|
2156
2156
|
}
|
|
2157
|
-
const
|
|
2157
|
+
const je = /geojson\.org\/schema\/(\w+)\.json/;
|
|
2158
2158
|
function Ia(e) {
|
|
2159
|
-
return !!e.$ref &&
|
|
2159
|
+
return !!e.$ref && je.test(e.$ref);
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const t =
|
|
2161
|
+
function $e(e) {
|
|
2162
|
+
const t = je.exec(e);
|
|
2163
2163
|
return t ? t[1] : null;
|
|
2164
2164
|
}
|
|
2165
|
-
function
|
|
2165
|
+
function Re(e) {
|
|
2166
2166
|
const t = e.toLowerCase();
|
|
2167
2167
|
return t.includes("polygon") ? "fill" : t.includes("linestring") ? "line" : t.includes("point") ? "circle" : null;
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function Be(e) {
|
|
2170
2170
|
const t = e.toLowerCase();
|
|
2171
2171
|
return t.includes("polygon") ? ["fill"] : t.includes("linestring") ? ["line"] : t.includes("point") ? ["circle", "symbol"] : [];
|
|
2172
2172
|
}
|
|
2173
|
-
function
|
|
2173
|
+
function Ea(e) {
|
|
2174
2174
|
for (const t of Object.values(e.properties))
|
|
2175
2175
|
if (t.$ref) {
|
|
2176
|
-
const i =
|
|
2177
|
-
if (i) return
|
|
2176
|
+
const i = $e(t.$ref);
|
|
2177
|
+
if (i) return Re(i);
|
|
2178
2178
|
}
|
|
2179
2179
|
return null;
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function qe(e) {
|
|
2182
2182
|
for (const t of Object.values(e.properties))
|
|
2183
2183
|
if (t.$ref) {
|
|
2184
|
-
const i =
|
|
2185
|
-
if (i) return
|
|
2184
|
+
const i = $e(t.$ref);
|
|
2185
|
+
if (i) return Be(i);
|
|
2186
2186
|
}
|
|
2187
2187
|
return [];
|
|
2188
2188
|
}
|
|
2189
|
-
function
|
|
2189
|
+
function Fa(e) {
|
|
2190
2190
|
return Object.entries(e.properties).filter(([, t]) => !Ia(t)).map(([t, i]) => ({
|
|
2191
2191
|
name: t,
|
|
2192
2192
|
title: i.title,
|
|
@@ -2197,87 +2197,123 @@ function Ea(e) {
|
|
|
2197
2197
|
maximum: i.maximum
|
|
2198
2198
|
}));
|
|
2199
2199
|
}
|
|
2200
|
-
|
|
2200
|
+
function Ue(e) {
|
|
2201
|
+
var i;
|
|
2202
|
+
const t = /* @__PURE__ */ new Set();
|
|
2203
|
+
for (const r of e)
|
|
2204
|
+
(i = r.geometry) != null && i.type && t.add(r.geometry.type);
|
|
2205
|
+
return Array.from(t);
|
|
2206
|
+
}
|
|
2207
|
+
function Pa(e) {
|
|
2208
|
+
const t = /* @__PURE__ */ new Set();
|
|
2209
|
+
for (const n of e) {
|
|
2210
|
+
const o = n.toLowerCase();
|
|
2211
|
+
o.includes("polygon") ? t.add("polygon") : o.includes("linestring") ? t.add("line") : o.includes("point") && t.add("point");
|
|
2212
|
+
}
|
|
2213
|
+
const i = t.size > 1, r = [];
|
|
2214
|
+
return t.has("polygon") && r.push({
|
|
2215
|
+
type: "fill",
|
|
2216
|
+
paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 },
|
|
2217
|
+
...i ? { geometryFilter: ["Polygon", "MultiPolygon"] } : {}
|
|
2218
|
+
}), t.has("line") && r.push({
|
|
2219
|
+
type: "line",
|
|
2220
|
+
paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 },
|
|
2221
|
+
...i ? { geometryFilter: ["LineString", "MultiLineString"] } : {}
|
|
2222
|
+
}), t.has("point") && r.push({
|
|
2223
|
+
type: "circle",
|
|
2224
|
+
paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 },
|
|
2225
|
+
...i ? { geometryFilter: ["Point", "MultiPoint"] } : {}
|
|
2226
|
+
}), r;
|
|
2227
|
+
}
|
|
2228
|
+
async function Ya(e, t) {
|
|
2201
2229
|
var i, r;
|
|
2202
2230
|
try {
|
|
2203
|
-
const n = await
|
|
2231
|
+
const n = await Pe(e, t), o = Ea(n);
|
|
2204
2232
|
if (o) return o;
|
|
2205
2233
|
} catch {
|
|
2206
2234
|
}
|
|
2207
2235
|
try {
|
|
2208
2236
|
const o = (r = (i = (await se(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
|
|
2209
|
-
if (typeof o == "string") return
|
|
2237
|
+
if (typeof o == "string") return Re(o);
|
|
2210
2238
|
} catch {
|
|
2211
2239
|
}
|
|
2212
2240
|
return null;
|
|
2213
2241
|
}
|
|
2214
|
-
async function
|
|
2215
|
-
var i, r;
|
|
2242
|
+
async function Xa(e, t) {
|
|
2216
2243
|
try {
|
|
2217
|
-
const
|
|
2218
|
-
if (
|
|
2244
|
+
const i = await Pe(e, t), r = qe(i);
|
|
2245
|
+
if (r.length > 0) return r;
|
|
2219
2246
|
} catch {
|
|
2220
2247
|
}
|
|
2221
2248
|
try {
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2249
|
+
const i = await se(e, t, { limit: 20 }), r = Ue(i.features), n = /* @__PURE__ */ new Set();
|
|
2250
|
+
for (const o of r)
|
|
2251
|
+
for (const p of Be(o))
|
|
2252
|
+
n.add(p);
|
|
2253
|
+
return Array.from(n);
|
|
2224
2254
|
} catch {
|
|
2225
2255
|
}
|
|
2226
2256
|
return [];
|
|
2227
2257
|
}
|
|
2228
|
-
function
|
|
2258
|
+
function Ha(e) {
|
|
2229
2259
|
return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (t) => t.toUpperCase());
|
|
2230
2260
|
}
|
|
2261
|
+
function Ma(e, t, i) {
|
|
2262
|
+
const r = [...e ?? []];
|
|
2263
|
+
return r[t] = i, r;
|
|
2264
|
+
}
|
|
2265
|
+
function Oa(e, t) {
|
|
2266
|
+
return (e ?? []).filter((i, r) => r !== t);
|
|
2267
|
+
}
|
|
2231
2268
|
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";
|
|
2232
|
-
function
|
|
2233
|
-
var D;
|
|
2234
|
-
const n = (
|
|
2269
|
+
function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
2270
|
+
var D, M;
|
|
2271
|
+
const n = (w) => t({ ...e, ...w }), o = ue(e);
|
|
2235
2272
|
o.current = e;
|
|
2236
2273
|
const p = ue(t);
|
|
2237
2274
|
p.current = t;
|
|
2238
|
-
const
|
|
2275
|
+
const y = i.find((w) => w.id === e.sourceId), m = (y == null ? void 0 : y.url) ?? null, x = e.collection || null, { collections: h, loading: f } = Fe(m), { queryables: d, loading: u } = Ve(m, x), s = d ? Fa(d) : [], [v, N] = A([]);
|
|
2239
2276
|
return X(() => {
|
|
2240
|
-
if (!
|
|
2241
|
-
|
|
2277
|
+
if (!d) {
|
|
2278
|
+
N([]);
|
|
2242
2279
|
return;
|
|
2243
2280
|
}
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2281
|
+
const w = (T) => {
|
|
2282
|
+
var P;
|
|
2283
|
+
const c = Pa(T);
|
|
2284
|
+
N(c), c.length > 0 && !((P = o.current.styles) != null && P.length) && p.current({ ...o.current, styles: c });
|
|
2285
|
+
}, C = qe(d);
|
|
2286
|
+
if (C.length > 0) {
|
|
2287
|
+
const T = [];
|
|
2288
|
+
for (const c of C)
|
|
2289
|
+
c === "fill" ? T.push("Polygon") : c === "line" ? T.push("LineString") : (c === "circle" || c === "symbol") && T.push("Point");
|
|
2290
|
+
w(T);
|
|
2254
2291
|
return;
|
|
2255
2292
|
}
|
|
2256
|
-
if (!m || !
|
|
2257
|
-
|
|
2293
|
+
if (!m || !x) {
|
|
2294
|
+
N([]);
|
|
2258
2295
|
return;
|
|
2259
2296
|
}
|
|
2260
|
-
let
|
|
2261
|
-
return se(m,
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
x(typeof E == "string" ? ce(E) : []);
|
|
2297
|
+
let F = !1;
|
|
2298
|
+
return se(m, x, { limit: 20 }).then((T) => {
|
|
2299
|
+
if (F) return;
|
|
2300
|
+
const c = Ue(T.features);
|
|
2301
|
+
c.length > 0 ? w(c) : N([]);
|
|
2266
2302
|
}).catch(() => {
|
|
2267
|
-
|
|
2303
|
+
F || N([]);
|
|
2268
2304
|
}), () => {
|
|
2269
|
-
|
|
2305
|
+
F = !0;
|
|
2270
2306
|
};
|
|
2271
|
-
}, [
|
|
2272
|
-
|
|
2273
|
-
}, [m,
|
|
2307
|
+
}, [d, m, x]), X(() => {
|
|
2308
|
+
N([]);
|
|
2309
|
+
}, [m, x]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2274
2310
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
|
|
2275
2311
|
/* @__PURE__ */ a(S, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
|
|
2276
2312
|
"input",
|
|
2277
2313
|
{
|
|
2278
2314
|
type: "text",
|
|
2279
2315
|
value: e.id,
|
|
2280
|
-
onChange: (
|
|
2316
|
+
onChange: (w) => n({ id: w.target.value }),
|
|
2281
2317
|
placeholder: "my-layer",
|
|
2282
2318
|
className: V
|
|
2283
2319
|
}
|
|
@@ -2287,7 +2323,7 @@ function Te({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2287
2323
|
{
|
|
2288
2324
|
type: "text",
|
|
2289
2325
|
value: e.label,
|
|
2290
|
-
onChange: (
|
|
2326
|
+
onChange: (w) => n({ label: w.target.value }),
|
|
2291
2327
|
placeholder: "My Layer",
|
|
2292
2328
|
className: V
|
|
2293
2329
|
}
|
|
@@ -2297,24 +2333,24 @@ function Te({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2297
2333
|
"select",
|
|
2298
2334
|
{
|
|
2299
2335
|
value: e.sourceId,
|
|
2300
|
-
onChange: (
|
|
2336
|
+
onChange: (w) => n({ sourceId: w.target.value }),
|
|
2301
2337
|
className: V,
|
|
2302
2338
|
children: [
|
|
2303
2339
|
/* @__PURE__ */ a("option", { value: "", children: "Select a source…" }),
|
|
2304
|
-
i.map((
|
|
2340
|
+
i.map((w) => /* @__PURE__ */ a("option", { value: w.id, children: w.label ?? w.id }, w.id))
|
|
2305
2341
|
]
|
|
2306
2342
|
}
|
|
2307
2343
|
) }),
|
|
2308
2344
|
/* @__PURE__ */ l(S, { label: "Collection", required: !0, children: [
|
|
2309
|
-
|
|
2345
|
+
h.length > 0 ? /* @__PURE__ */ l(
|
|
2310
2346
|
"select",
|
|
2311
2347
|
{
|
|
2312
2348
|
value: e.collection,
|
|
2313
|
-
onChange: (
|
|
2349
|
+
onChange: (w) => n({ collection: w.target.value }),
|
|
2314
2350
|
className: V,
|
|
2315
2351
|
children: [
|
|
2316
2352
|
/* @__PURE__ */ a("option", { value: "", children: "Select a collection…" }),
|
|
2317
|
-
|
|
2353
|
+
h.map((w) => /* @__PURE__ */ a("option", { value: w.id, children: w.title ?? w.id }, w.id))
|
|
2318
2354
|
]
|
|
2319
2355
|
}
|
|
2320
2356
|
) : /* @__PURE__ */ a(
|
|
@@ -2322,27 +2358,27 @@ function Te({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2322
2358
|
{
|
|
2323
2359
|
type: "text",
|
|
2324
2360
|
value: e.collection,
|
|
2325
|
-
onChange: (
|
|
2361
|
+
onChange: (w) => n({ collection: w.target.value }),
|
|
2326
2362
|
placeholder: f ? "Loading collections…" : "collection-id",
|
|
2327
2363
|
className: V
|
|
2328
2364
|
}
|
|
2329
2365
|
),
|
|
2330
2366
|
u && /* @__PURE__ */ a("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
|
|
2331
2367
|
] }),
|
|
2332
|
-
/* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((
|
|
2368
|
+
/* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((w) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
|
|
2333
2369
|
/* @__PURE__ */ a(
|
|
2334
2370
|
"input",
|
|
2335
2371
|
{
|
|
2336
2372
|
type: "radio",
|
|
2337
2373
|
name: `data-mode-${e.id}`,
|
|
2338
|
-
value:
|
|
2339
|
-
checked: e.dataMode ===
|
|
2340
|
-
onChange: () => n({ dataMode:
|
|
2374
|
+
value: w,
|
|
2375
|
+
checked: e.dataMode === w,
|
|
2376
|
+
onChange: () => n({ dataMode: w }),
|
|
2341
2377
|
className: "mapui:accent-blue-600"
|
|
2342
2378
|
}
|
|
2343
2379
|
),
|
|
2344
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children:
|
|
2345
|
-
] },
|
|
2380
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: w })
|
|
2381
|
+
] }, w)) }) }),
|
|
2346
2382
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2347
2383
|
/* @__PURE__ */ a(
|
|
2348
2384
|
"input",
|
|
@@ -2350,44 +2386,77 @@ function Te({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2350
2386
|
type: "checkbox",
|
|
2351
2387
|
id: "layer-visible",
|
|
2352
2388
|
checked: e.visible,
|
|
2353
|
-
onChange: (
|
|
2389
|
+
onChange: (w) => n({ visible: w.target.checked }),
|
|
2354
2390
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2355
2391
|
}
|
|
2356
2392
|
),
|
|
2357
2393
|
/* @__PURE__ */ a("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
|
|
2358
2394
|
] }),
|
|
2359
|
-
/* @__PURE__ */ a(_, { title: "Style", children: /* @__PURE__ */
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2395
|
+
/* @__PURE__ */ a(_, { title: "Style", children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-4", children: [
|
|
2396
|
+
(e.styles ?? [me]).map((w, C) => {
|
|
2397
|
+
var F;
|
|
2398
|
+
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2399
|
+
w.geometryFilter && w.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: w.geometryFilter.map((T) => /* @__PURE__ */ a(
|
|
2400
|
+
"span",
|
|
2401
|
+
{
|
|
2402
|
+
className: "mapui:rounded mapui:bg-indigo-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-indigo-700",
|
|
2403
|
+
children: T
|
|
2404
|
+
},
|
|
2405
|
+
T
|
|
2406
|
+
)) }),
|
|
2407
|
+
/* @__PURE__ */ a(
|
|
2408
|
+
wa,
|
|
2409
|
+
{
|
|
2410
|
+
value: w,
|
|
2411
|
+
onChange: (T) => n({ styles: Ma(e.styles, C, T) }),
|
|
2412
|
+
suggestedTypes: v.map((T) => T.type),
|
|
2413
|
+
availableIcons: r,
|
|
2414
|
+
availableProperties: s,
|
|
2415
|
+
onFetchDistinctValues: m && x ? (T) => _e(m, x, T, { limit: 1e3 }) : void 0
|
|
2416
|
+
}
|
|
2417
|
+
),
|
|
2418
|
+
(((F = e.styles) == null ? void 0 : F.length) ?? 0) > 1 && /* @__PURE__ */ a(
|
|
2419
|
+
"button",
|
|
2420
|
+
{
|
|
2421
|
+
type: "button",
|
|
2422
|
+
onClick: () => n({ styles: Oa(e.styles, C) }),
|
|
2423
|
+
className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2424
|
+
children: "Remove style"
|
|
2425
|
+
}
|
|
2426
|
+
)
|
|
2427
|
+
] }, C);
|
|
2428
|
+
}),
|
|
2429
|
+
/* @__PURE__ */ a(
|
|
2430
|
+
"button",
|
|
2431
|
+
{
|
|
2432
|
+
type: "button",
|
|
2433
|
+
onClick: () => n({ styles: [...e.styles ?? [me], Oe] }),
|
|
2434
|
+
className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
2435
|
+
children: "+ Add style"
|
|
2436
|
+
}
|
|
2437
|
+
)
|
|
2438
|
+
] }) }),
|
|
2370
2439
|
/* @__PURE__ */ a(_, { title: "Legend", children: /* @__PURE__ */ a(
|
|
2371
|
-
|
|
2440
|
+
Na,
|
|
2372
2441
|
{
|
|
2373
2442
|
value: e.legend,
|
|
2374
|
-
onChange: (
|
|
2375
|
-
style: e.
|
|
2443
|
+
onChange: (w) => n({ legend: w }),
|
|
2444
|
+
style: (D = e.styles) == null ? void 0 : D[0]
|
|
2376
2445
|
}
|
|
2377
2446
|
) }),
|
|
2378
2447
|
/* @__PURE__ */ a(_, { title: "Search Fields", children: /* @__PURE__ */ a(
|
|
2379
|
-
|
|
2448
|
+
Da,
|
|
2380
2449
|
{
|
|
2381
|
-
fields: ((
|
|
2382
|
-
onChange: (
|
|
2450
|
+
fields: ((M = e.search) == null ? void 0 : M.fields) ?? [],
|
|
2451
|
+
onChange: (w) => n({ search: w.length > 0 ? { fields: w } : void 0 }),
|
|
2383
2452
|
availableProperties: s
|
|
2384
2453
|
}
|
|
2385
2454
|
) }),
|
|
2386
2455
|
/* @__PURE__ */ a(_, { title: "Property Display", children: /* @__PURE__ */ a(
|
|
2387
|
-
|
|
2456
|
+
Aa,
|
|
2388
2457
|
{
|
|
2389
2458
|
value: e.propertyDisplay ?? {},
|
|
2390
|
-
onChange: (
|
|
2459
|
+
onChange: (w) => n({ propertyDisplay: Object.keys(w).length > 0 ? w : void 0 }),
|
|
2391
2460
|
availableProperties: s
|
|
2392
2461
|
}
|
|
2393
2462
|
) })
|
|
@@ -2401,36 +2470,36 @@ const ne = () => ({
|
|
|
2401
2470
|
visible: !0,
|
|
2402
2471
|
dataMode: "vector-tiles"
|
|
2403
2472
|
});
|
|
2404
|
-
function
|
|
2405
|
-
const [n, o] =
|
|
2406
|
-
t([...e, m]),
|
|
2407
|
-
}, D = (
|
|
2408
|
-
t(e.map((
|
|
2409
|
-
},
|
|
2410
|
-
t(e.filter((
|
|
2411
|
-
},
|
|
2412
|
-
if (
|
|
2413
|
-
const
|
|
2414
|
-
[
|
|
2415
|
-
}, C = (
|
|
2416
|
-
if (
|
|
2417
|
-
const
|
|
2418
|
-
[
|
|
2419
|
-
},
|
|
2420
|
-
u(
|
|
2421
|
-
},
|
|
2422
|
-
|
|
2423
|
-
},
|
|
2473
|
+
function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
2474
|
+
const [n, o] = A(null), [p, y] = A(!1), [m, x] = A(ne()), [h, f] = A(null), [d, u] = A(null), [s, v] = A(null), N = () => {
|
|
2475
|
+
t([...e, m]), y(!1), x(ne());
|
|
2476
|
+
}, D = (b) => {
|
|
2477
|
+
t(e.map((k) => k.id === n ? b : k));
|
|
2478
|
+
}, M = (b) => {
|
|
2479
|
+
t(e.filter((k) => k.id !== b)), f(null), n === b && o(null);
|
|
2480
|
+
}, w = (b) => {
|
|
2481
|
+
if (b === 0) return;
|
|
2482
|
+
const k = [...e];
|
|
2483
|
+
[k[b - 1], k[b]] = [k[b], k[b - 1]], t(k);
|
|
2484
|
+
}, C = (b) => {
|
|
2485
|
+
if (b === e.length - 1) return;
|
|
2486
|
+
const k = [...e];
|
|
2487
|
+
[k[b], k[b + 1]] = [k[b + 1], k[b]], t(k);
|
|
2488
|
+
}, F = (b, k) => {
|
|
2489
|
+
u(k), b.dataTransfer.effectAllowed = "move", b.dataTransfer.setData("text/plain", k);
|
|
2490
|
+
}, T = (b, k) => {
|
|
2491
|
+
b.preventDefault(), b.dataTransfer.dropEffect = "move", v(k);
|
|
2492
|
+
}, c = () => {
|
|
2424
2493
|
v(null);
|
|
2425
|
-
},
|
|
2426
|
-
|
|
2427
|
-
const
|
|
2428
|
-
if (u(null), !
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
},
|
|
2494
|
+
}, P = (b, k) => {
|
|
2495
|
+
b.preventDefault(), v(null);
|
|
2496
|
+
const j = d;
|
|
2497
|
+
if (u(null), !j || j === k) return;
|
|
2498
|
+
const U = e.findIndex((g) => g.id === j), G = e.findIndex((g) => g.id === k);
|
|
2499
|
+
if (U === -1 || G === -1) return;
|
|
2500
|
+
const B = [...e];
|
|
2501
|
+
B.splice(U, 1), B.splice(G, 0, e[U]), t(B);
|
|
2502
|
+
}, O = () => {
|
|
2434
2503
|
u(null), v(null);
|
|
2435
2504
|
};
|
|
2436
2505
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
@@ -2441,7 +2510,7 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2441
2510
|
{
|
|
2442
2511
|
type: "button",
|
|
2443
2512
|
onClick: () => {
|
|
2444
|
-
|
|
2513
|
+
y(!0), x(ne());
|
|
2445
2514
|
},
|
|
2446
2515
|
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",
|
|
2447
2516
|
children: "+ Add Layer"
|
|
@@ -2449,22 +2518,22 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2449
2518
|
)
|
|
2450
2519
|
] }),
|
|
2451
2520
|
e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
|
|
2452
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
2453
|
-
var
|
|
2454
|
-
const
|
|
2521
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((b, k) => {
|
|
2522
|
+
var B, g, L, I, E;
|
|
2523
|
+
const j = d === b.id, U = s === b.id, G = n === b.id;
|
|
2455
2524
|
return /* @__PURE__ */ l(
|
|
2456
2525
|
"li",
|
|
2457
2526
|
{
|
|
2458
|
-
draggable: !
|
|
2459
|
-
onDragStart:
|
|
2460
|
-
onDragOver: (
|
|
2461
|
-
onDragLeave:
|
|
2462
|
-
onDrop: (
|
|
2463
|
-
onDragEnd:
|
|
2527
|
+
draggable: !G,
|
|
2528
|
+
onDragStart: G ? void 0 : ($) => F($, b.id),
|
|
2529
|
+
onDragOver: ($) => T($, b.id),
|
|
2530
|
+
onDragLeave: c,
|
|
2531
|
+
onDrop: ($) => P($, b.id),
|
|
2532
|
+
onDragEnd: O,
|
|
2464
2533
|
className: [
|
|
2465
2534
|
"mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
|
|
2466
|
-
|
|
2467
|
-
|
|
2535
|
+
U ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
|
|
2536
|
+
j ? "mapui:opacity-50" : "mapui:opacity-100"
|
|
2468
2537
|
].join(" "),
|
|
2469
2538
|
children: [
|
|
2470
2539
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:gap-2 mapui:px-3 mapui:py-2", children: [
|
|
@@ -2474,8 +2543,8 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2474
2543
|
"button",
|
|
2475
2544
|
{
|
|
2476
2545
|
type: "button",
|
|
2477
|
-
onClick: () =>
|
|
2478
|
-
disabled:
|
|
2546
|
+
onClick: () => w(k),
|
|
2547
|
+
disabled: k === 0,
|
|
2479
2548
|
"aria-label": "Move layer up",
|
|
2480
2549
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2481
2550
|
children: "▲"
|
|
@@ -2485,8 +2554,8 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2485
2554
|
"button",
|
|
2486
2555
|
{
|
|
2487
2556
|
type: "button",
|
|
2488
|
-
onClick: () => C(
|
|
2489
|
-
disabled:
|
|
2557
|
+
onClick: () => C(k),
|
|
2558
|
+
disabled: k === e.length - 1,
|
|
2490
2559
|
"aria-label": "Move layer down",
|
|
2491
2560
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2492
2561
|
children: "▼"
|
|
@@ -2502,18 +2571,18 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2502
2571
|
}
|
|
2503
2572
|
),
|
|
2504
2573
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
|
|
2505
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
2506
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
2574
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: b.label || b.id }),
|
|
2575
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: b.collection }),
|
|
2507
2576
|
/* @__PURE__ */ l("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
|
|
2508
|
-
/* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children:
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
(((
|
|
2512
|
-
|
|
2577
|
+
/* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: b.dataMode }),
|
|
2578
|
+
(((B = b.styles) == null ? void 0 : B.length) ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: b.styles.map(($) => $.type).join(" · ") }),
|
|
2579
|
+
b.visible === !1 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
|
|
2580
|
+
(((L = (g = b.search) == null ? void 0 : g.fields) == null ? void 0 : L.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
|
|
2581
|
+
b.search.fields.length,
|
|
2513
2582
|
" search fields"
|
|
2514
2583
|
] }),
|
|
2515
|
-
(((
|
|
2516
|
-
|
|
2584
|
+
(((E = (I = b.legend) == null ? void 0 : I.entries) == null ? void 0 : E.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
|
|
2585
|
+
b.legend.entries.length,
|
|
2517
2586
|
" legend entries"
|
|
2518
2587
|
] })
|
|
2519
2588
|
] })
|
|
@@ -2524,26 +2593,26 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2524
2593
|
"button",
|
|
2525
2594
|
{
|
|
2526
2595
|
type: "button",
|
|
2527
|
-
onClick: () => o(n ===
|
|
2596
|
+
onClick: () => o(n === b.id ? null : b.id),
|
|
2528
2597
|
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",
|
|
2529
|
-
children: n ===
|
|
2598
|
+
children: n === b.id ? "Close" : "Edit"
|
|
2530
2599
|
}
|
|
2531
2600
|
),
|
|
2532
2601
|
/* @__PURE__ */ a(
|
|
2533
2602
|
"button",
|
|
2534
2603
|
{
|
|
2535
2604
|
type: "button",
|
|
2536
|
-
onClick: () => f(
|
|
2605
|
+
onClick: () => f(b.id),
|
|
2537
2606
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2538
2607
|
children: "Remove"
|
|
2539
2608
|
}
|
|
2540
2609
|
)
|
|
2541
2610
|
] })
|
|
2542
2611
|
] }),
|
|
2543
|
-
n ===
|
|
2544
|
-
|
|
2612
|
+
n === b.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
2613
|
+
De,
|
|
2545
2614
|
{
|
|
2546
|
-
value:
|
|
2615
|
+
value: b,
|
|
2547
2616
|
onChange: D,
|
|
2548
2617
|
availableSources: i,
|
|
2549
2618
|
availableIcons: r
|
|
@@ -2551,16 +2620,16 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2551
2620
|
) })
|
|
2552
2621
|
]
|
|
2553
2622
|
},
|
|
2554
|
-
|
|
2623
|
+
b.id
|
|
2555
2624
|
);
|
|
2556
2625
|
}) }),
|
|
2557
2626
|
p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2558
2627
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
|
|
2559
2628
|
/* @__PURE__ */ a(
|
|
2560
|
-
|
|
2629
|
+
De,
|
|
2561
2630
|
{
|
|
2562
2631
|
value: m,
|
|
2563
|
-
onChange:
|
|
2632
|
+
onChange: x,
|
|
2564
2633
|
availableSources: i,
|
|
2565
2634
|
availableIcons: r
|
|
2566
2635
|
}
|
|
@@ -2570,7 +2639,7 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2570
2639
|
"button",
|
|
2571
2640
|
{
|
|
2572
2641
|
type: "button",
|
|
2573
|
-
onClick:
|
|
2642
|
+
onClick: N,
|
|
2574
2643
|
disabled: !m.id || !m.sourceId || !m.collection,
|
|
2575
2644
|
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",
|
|
2576
2645
|
children: "Save"
|
|
@@ -2580,7 +2649,7 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2580
2649
|
"button",
|
|
2581
2650
|
{
|
|
2582
2651
|
type: "button",
|
|
2583
|
-
onClick: () =>
|
|
2652
|
+
onClick: () => y(!1),
|
|
2584
2653
|
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",
|
|
2585
2654
|
children: "Cancel"
|
|
2586
2655
|
}
|
|
@@ -2590,17 +2659,17 @@ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2590
2659
|
/* @__PURE__ */ a(
|
|
2591
2660
|
Z,
|
|
2592
2661
|
{
|
|
2593
|
-
open:
|
|
2662
|
+
open: h !== null,
|
|
2594
2663
|
title: "Remove Layer",
|
|
2595
2664
|
description: "Are you sure you want to remove this layer from the configuration?",
|
|
2596
|
-
onConfirm: () =>
|
|
2665
|
+
onConfirm: () => h && M(h),
|
|
2597
2666
|
onCancel: () => f(null)
|
|
2598
2667
|
}
|
|
2599
2668
|
)
|
|
2600
2669
|
] });
|
|
2601
2670
|
}
|
|
2602
2671
|
const Q = "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";
|
|
2603
|
-
function
|
|
2672
|
+
function Te({ value: e, onChange: t }) {
|
|
2604
2673
|
const i = (r) => t({ ...e, ...r });
|
|
2605
2674
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2606
2675
|
/* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
@@ -2656,13 +2725,13 @@ function Le({ value: e, onChange: t }) {
|
|
|
2656
2725
|
] });
|
|
2657
2726
|
}
|
|
2658
2727
|
const pe = () => ({ id: "", label: "", url: "" });
|
|
2659
|
-
function
|
|
2660
|
-
const [i, r] =
|
|
2728
|
+
function Ka({ basemaps: e, onChange: t }) {
|
|
2729
|
+
const [i, r] = A(null), [n, o] = A(!1), [p, y] = A(pe()), [m, x] = A(null), h = (u) => {
|
|
2661
2730
|
t(e.map((s) => s.id === i ? u : s));
|
|
2662
2731
|
}, f = () => {
|
|
2663
|
-
t([...e, p]), o(!1),
|
|
2664
|
-
},
|
|
2665
|
-
t(e.filter((s) => s.id !== u)),
|
|
2732
|
+
t([...e, p]), o(!1), y(pe());
|
|
2733
|
+
}, d = (u) => {
|
|
2734
|
+
t(e.filter((s) => s.id !== u)), x(null);
|
|
2666
2735
|
};
|
|
2667
2736
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2668
2737
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -2672,7 +2741,7 @@ function Ya({ basemaps: e, onChange: t }) {
|
|
|
2672
2741
|
{
|
|
2673
2742
|
type: "button",
|
|
2674
2743
|
onClick: () => {
|
|
2675
|
-
o(!0),
|
|
2744
|
+
o(!0), y(pe());
|
|
2676
2745
|
},
|
|
2677
2746
|
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",
|
|
2678
2747
|
children: "+ Add Basemap"
|
|
@@ -2712,21 +2781,21 @@ function Ya({ basemaps: e, onChange: t }) {
|
|
|
2712
2781
|
"button",
|
|
2713
2782
|
{
|
|
2714
2783
|
type: "button",
|
|
2715
|
-
onClick: () =>
|
|
2784
|
+
onClick: () => x(u.id),
|
|
2716
2785
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2717
2786
|
children: "Remove"
|
|
2718
2787
|
}
|
|
2719
2788
|
)
|
|
2720
2789
|
] })
|
|
2721
2790
|
] }),
|
|
2722
|
-
i === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
2791
|
+
i === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Te, { value: u, onChange: h }) })
|
|
2723
2792
|
]
|
|
2724
2793
|
},
|
|
2725
2794
|
u.id
|
|
2726
2795
|
)) }),
|
|
2727
2796
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2728
2797
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
|
|
2729
|
-
/* @__PURE__ */ a(
|
|
2798
|
+
/* @__PURE__ */ a(Te, { value: p, onChange: y }),
|
|
2730
2799
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
2731
2800
|
/* @__PURE__ */ a(
|
|
2732
2801
|
"button",
|
|
@@ -2755,13 +2824,13 @@ function Ya({ basemaps: e, onChange: t }) {
|
|
|
2755
2824
|
open: m !== null,
|
|
2756
2825
|
title: "Remove Basemap",
|
|
2757
2826
|
description: "Are you sure you want to remove this basemap from the configuration?",
|
|
2758
|
-
onConfirm: () => m &&
|
|
2759
|
-
onCancel: () =>
|
|
2827
|
+
onConfirm: () => m && d(m),
|
|
2828
|
+
onCancel: () => x(null)
|
|
2760
2829
|
}
|
|
2761
2830
|
)
|
|
2762
2831
|
] });
|
|
2763
2832
|
}
|
|
2764
|
-
const
|
|
2833
|
+
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";
|
|
2765
2834
|
function Ae({ value: e, onChange: t }) {
|
|
2766
2835
|
const i = (r) => t({ ...e, ...r });
|
|
2767
2836
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
@@ -2772,7 +2841,7 @@ function Ae({ value: e, onChange: t }) {
|
|
|
2772
2841
|
value: e.id,
|
|
2773
2842
|
onChange: (r) => i({ id: r.target.value }),
|
|
2774
2843
|
placeholder: "my-sprites",
|
|
2775
|
-
className:
|
|
2844
|
+
className: Le
|
|
2776
2845
|
}
|
|
2777
2846
|
) }),
|
|
2778
2847
|
/* @__PURE__ */ l(S, { label: "Sprite URL", required: !0, children: [
|
|
@@ -2783,7 +2852,7 @@ function Ae({ value: e, onChange: t }) {
|
|
|
2783
2852
|
value: e.url,
|
|
2784
2853
|
onChange: (r) => i({ url: r.target.value }),
|
|
2785
2854
|
placeholder: "https://example.com/sprites/sprite",
|
|
2786
|
-
className:
|
|
2855
|
+
className: Le
|
|
2787
2856
|
}
|
|
2788
2857
|
),
|
|
2789
2858
|
/* @__PURE__ */ l("p", { className: "mapui:mt-1 mapui:text-xs mapui:text-gray-400", children: [
|
|
@@ -2796,21 +2865,21 @@ function Ae({ value: e, onChange: t }) {
|
|
|
2796
2865
|
] })
|
|
2797
2866
|
] });
|
|
2798
2867
|
}
|
|
2799
|
-
const oe = () => ({ id: "", url: "" }),
|
|
2868
|
+
const oe = () => ({ id: "", url: "" }), ja = (e) => {
|
|
2800
2869
|
try {
|
|
2801
2870
|
return new URL(e), !0;
|
|
2802
2871
|
} catch {
|
|
2803
2872
|
return !1;
|
|
2804
2873
|
}
|
|
2805
2874
|
};
|
|
2806
|
-
function
|
|
2807
|
-
const [i, r] =
|
|
2875
|
+
function Qa({ sprites: e, onChange: t }) {
|
|
2876
|
+
const [i, r] = A(null), [n, o] = A(!1), [p, y] = A(oe()), [m, x] = A(null), h = (u) => {
|
|
2808
2877
|
t(e.map((s, v) => v === i ? u : s));
|
|
2809
2878
|
}, f = () => {
|
|
2810
|
-
t([...e, p]), o(!1),
|
|
2811
|
-
},
|
|
2879
|
+
t([...e, p]), o(!1), y(oe());
|
|
2880
|
+
}, d = (u) => {
|
|
2812
2881
|
const s = e.findIndex((v) => v.id === u);
|
|
2813
|
-
t(e.filter((v) => v.id !== u)), i !== null && (s === i ? r(null) : s < i && r(i - 1)),
|
|
2882
|
+
t(e.filter((v) => v.id !== u)), i !== null && (s === i ? r(null) : s < i && r(i - 1)), x(null);
|
|
2814
2883
|
};
|
|
2815
2884
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2816
2885
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -2820,7 +2889,7 @@ function Xa({ sprites: e, onChange: t }) {
|
|
|
2820
2889
|
{
|
|
2821
2890
|
type: "button",
|
|
2822
2891
|
onClick: () => {
|
|
2823
|
-
o(!0),
|
|
2892
|
+
o(!0), y(oe());
|
|
2824
2893
|
},
|
|
2825
2894
|
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",
|
|
2826
2895
|
children: "+ Add Sprite Sheet"
|
|
@@ -2852,28 +2921,28 @@ function Xa({ sprites: e, onChange: t }) {
|
|
|
2852
2921
|
"button",
|
|
2853
2922
|
{
|
|
2854
2923
|
type: "button",
|
|
2855
|
-
onClick: () =>
|
|
2924
|
+
onClick: () => x(u.id),
|
|
2856
2925
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2857
2926
|
children: "Remove"
|
|
2858
2927
|
}
|
|
2859
2928
|
)
|
|
2860
2929
|
] })
|
|
2861
2930
|
] }),
|
|
2862
|
-
i === s && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Ae, { value: u, onChange:
|
|
2931
|
+
i === s && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Ae, { value: u, onChange: h }) })
|
|
2863
2932
|
]
|
|
2864
2933
|
},
|
|
2865
2934
|
s
|
|
2866
2935
|
)) }),
|
|
2867
2936
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2868
2937
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
|
|
2869
|
-
/* @__PURE__ */ a(Ae, { value: p, onChange:
|
|
2938
|
+
/* @__PURE__ */ a(Ae, { value: p, onChange: y }),
|
|
2870
2939
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
2871
2940
|
/* @__PURE__ */ a(
|
|
2872
2941
|
"button",
|
|
2873
2942
|
{
|
|
2874
2943
|
type: "button",
|
|
2875
2944
|
onClick: f,
|
|
2876
|
-
disabled: !p.id || !p.url || !
|
|
2945
|
+
disabled: !p.id || !p.url || !ja(p.url) || e.some((u) => u.id === p.id),
|
|
2877
2946
|
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",
|
|
2878
2947
|
children: "Save"
|
|
2879
2948
|
}
|
|
@@ -2895,13 +2964,13 @@ function Xa({ sprites: e, onChange: t }) {
|
|
|
2895
2964
|
open: m !== null,
|
|
2896
2965
|
title: "Remove Sprite Sheet",
|
|
2897
2966
|
description: "Are you sure you want to remove this sprite sheet from the configuration?",
|
|
2898
|
-
onConfirm: () => m &&
|
|
2899
|
-
onCancel: () =>
|
|
2967
|
+
onConfirm: () => m && d(m),
|
|
2968
|
+
onCancel: () => x(null)
|
|
2900
2969
|
}
|
|
2901
2970
|
)
|
|
2902
2971
|
] });
|
|
2903
2972
|
}
|
|
2904
|
-
const
|
|
2973
|
+
const $a = [
|
|
2905
2974
|
{ key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
|
|
2906
2975
|
{ key: "showLegend", label: "Legend", description: "Map legend" },
|
|
2907
2976
|
{ key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
|
|
@@ -2912,13 +2981,13 @@ const Fa = [
|
|
|
2912
2981
|
{ key: "showExportButton", label: "Export Button", description: "Export data as CSV" },
|
|
2913
2982
|
{ key: "showLegendOpacity", label: "Legend Opacity", description: "Expand legend with opacity sliders" }
|
|
2914
2983
|
];
|
|
2915
|
-
function
|
|
2984
|
+
function Za({ value: e, onChange: t }) {
|
|
2916
2985
|
const i = (r, n) => {
|
|
2917
2986
|
t({ ...e, [r]: n });
|
|
2918
2987
|
};
|
|
2919
2988
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
2920
2989
|
/* @__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." }),
|
|
2921
|
-
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children:
|
|
2990
|
+
/* @__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: o }) => {
|
|
2922
2991
|
const p = e[r];
|
|
2923
2992
|
return /* @__PURE__ */ l(
|
|
2924
2993
|
"label",
|
|
@@ -2935,7 +3004,7 @@ function Ha({ value: e, onChange: t }) {
|
|
|
2935
3004
|
{
|
|
2936
3005
|
type: "checkbox",
|
|
2937
3006
|
checked: p,
|
|
2938
|
-
onChange: (
|
|
3007
|
+
onChange: (y) => i(r, y.target.checked),
|
|
2939
3008
|
className: "mapui:sr-only",
|
|
2940
3009
|
"aria-label": n
|
|
2941
3010
|
}
|
|
@@ -2973,7 +3042,7 @@ const Ge = [
|
|
|
2973
3042
|
{ key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
|
|
2974
3043
|
{ key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
|
|
2975
3044
|
];
|
|
2976
|
-
function
|
|
3045
|
+
function Ra(e, t) {
|
|
2977
3046
|
const i = Ge.find((r) => r.key === e);
|
|
2978
3047
|
if (i) {
|
|
2979
3048
|
if (isNaN(t)) return "Must be a number";
|
|
@@ -2981,31 +3050,31 @@ function Ma(e, t) {
|
|
|
2981
3050
|
if (t > i.max) return `Must be at most ${i.max}`;
|
|
2982
3051
|
}
|
|
2983
3052
|
}
|
|
2984
|
-
const
|
|
2985
|
-
function
|
|
3053
|
+
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";
|
|
3054
|
+
function et({ value: e, onChange: t }) {
|
|
2986
3055
|
const i = (r, n) => {
|
|
2987
3056
|
const o = parseFloat(n);
|
|
2988
3057
|
t({ ...e, [r]: isNaN(o) ? 0 : o });
|
|
2989
3058
|
};
|
|
2990
|
-
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min: o, max: p, step:
|
|
2991
|
-
const
|
|
2992
|
-
return /* @__PURE__ */ a(S, { label: n, error:
|
|
3059
|
+
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min: o, max: p, step: y, placeholder: m }) => {
|
|
3060
|
+
const x = Ra(r, e[r]);
|
|
3061
|
+
return /* @__PURE__ */ a(S, { label: n, error: x, children: /* @__PURE__ */ a(
|
|
2993
3062
|
"input",
|
|
2994
3063
|
{
|
|
2995
3064
|
type: "number",
|
|
2996
3065
|
min: o,
|
|
2997
3066
|
max: p,
|
|
2998
|
-
step:
|
|
3067
|
+
step: y,
|
|
2999
3068
|
value: e[r],
|
|
3000
3069
|
placeholder: m,
|
|
3001
|
-
onChange: (
|
|
3002
|
-
className: `${
|
|
3070
|
+
onChange: (h) => i(r, h.target.value),
|
|
3071
|
+
className: `${Ba} ${x ? "mapui:border-red-400" : ""}`
|
|
3003
3072
|
}
|
|
3004
3073
|
) }, r);
|
|
3005
3074
|
}) });
|
|
3006
3075
|
}
|
|
3007
|
-
function
|
|
3008
|
-
const t =
|
|
3076
|
+
function at({ config: e }) {
|
|
3077
|
+
const t = Ye(e);
|
|
3009
3078
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3010
3079
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
3011
3080
|
/* @__PURE__ */ a(
|
|
@@ -3031,134 +3100,137 @@ function Ka({ config: e }) {
|
|
|
3031
3100
|
] });
|
|
3032
3101
|
}
|
|
3033
3102
|
export {
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3103
|
+
ui as BasemapConfigSchema,
|
|
3104
|
+
Te as BasemapEditor,
|
|
3105
|
+
Ka as BasemapList,
|
|
3106
|
+
rt as BasemapSwitcher,
|
|
3107
|
+
mi as CircleLayoutSchema,
|
|
3108
|
+
si as CirclePaintSchema,
|
|
3109
|
+
ci as CircleStyleSchema,
|
|
3110
|
+
nt as CollapsibleControl,
|
|
3111
|
+
_a as CollectionBrowser,
|
|
3043
3112
|
Y as ColorPicker,
|
|
3044
|
-
|
|
3113
|
+
at as ConfigPreview,
|
|
3045
3114
|
Z as ConfirmDialog,
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3115
|
+
ot as CoordinateDisplay,
|
|
3116
|
+
di as DatetimeSearchFieldSchema,
|
|
3117
|
+
ct as ExportButton,
|
|
3118
|
+
ht as FeatureDetailPanel,
|
|
3119
|
+
bt as FeatureTooltip,
|
|
3120
|
+
hi as FillLayoutSchema,
|
|
3121
|
+
gi as FillPaintSchema,
|
|
3122
|
+
bi as FillStyleSchema,
|
|
3123
|
+
yi as FilterConfigSchema,
|
|
3055
3124
|
S as FormField,
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3125
|
+
fi as GeometryTypeSchema,
|
|
3126
|
+
xi as LayerConfigSchema,
|
|
3127
|
+
De as LayerEditor,
|
|
3128
|
+
Ja as LayerList,
|
|
3129
|
+
ft as LayerPanel,
|
|
3130
|
+
wt as Legend,
|
|
3131
|
+
wi as LegendConfigSchema,
|
|
3132
|
+
Na as LegendEditor,
|
|
3133
|
+
va as LegendEntryEditor,
|
|
3134
|
+
vi as LegendEntrySchema,
|
|
3135
|
+
Ni as LineLayoutSchema,
|
|
3136
|
+
ki as LinePaintSchema,
|
|
3137
|
+
Ci as LineStyleSchema,
|
|
3138
|
+
Si as MapConfigSchema,
|
|
3139
|
+
Di as NumberSearchFieldSchema,
|
|
3140
|
+
Ti as OgcApiSourceSchema,
|
|
3141
|
+
Li as PropertyDisplayConfigSchema,
|
|
3142
|
+
Aa as PropertyDisplayEditor,
|
|
3143
|
+
Ai as PropertyDisplaySchema,
|
|
3144
|
+
Ii as SearchConfigSchema,
|
|
3145
|
+
Ca as SearchFieldEditor,
|
|
3146
|
+
Da as SearchFieldList,
|
|
3147
|
+
Ei as SearchFieldSchema,
|
|
3148
|
+
Nt as SearchPanel,
|
|
3149
|
+
Fi as SelectSearchFieldSchema,
|
|
3150
|
+
ce as SourceEditor,
|
|
3151
|
+
Va as SourceList,
|
|
3082
3152
|
Ae as SpriteSourceEditor,
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3153
|
+
Qa as SpriteSourceList,
|
|
3154
|
+
Pi as SpriteSourceSchema,
|
|
3155
|
+
Mi as StyleConfigSchema,
|
|
3156
|
+
wa as StyleEditor,
|
|
3157
|
+
Oi as SymbolLayoutSchema,
|
|
3158
|
+
ji as SymbolPaintSchema,
|
|
3159
|
+
$i as SymbolStyleSchema,
|
|
3160
|
+
Ri as TextSearchFieldSchema,
|
|
3161
|
+
Za as UIConfigEditor,
|
|
3162
|
+
Bi as UIConfigSchema,
|
|
3163
|
+
qi as ViewConfigSchema,
|
|
3164
|
+
et as ViewEditor,
|
|
3165
|
+
Ct as and,
|
|
3166
|
+
St as between,
|
|
3167
|
+
Pa as buildDefaultStylesForGeometryTypes,
|
|
3168
|
+
Oe as defaultCircle,
|
|
3098
3169
|
me as defaultFill,
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3170
|
+
ga as defaultLine,
|
|
3171
|
+
ba as defaultSymbol,
|
|
3172
|
+
qe as detectGeometryStyleTypesFromQueryables,
|
|
3173
|
+
Ea as detectGeometryTypeFromQueryables,
|
|
3174
|
+
Ue as detectGeometryTypesFromFeatures,
|
|
3175
|
+
Ya as detectStyleTypeForCollection,
|
|
3176
|
+
Xa as detectStyleTypesForCollection,
|
|
3177
|
+
Dt as downloadCsv,
|
|
3178
|
+
Tt as eq,
|
|
3179
|
+
Me as expressionColors,
|
|
3180
|
+
ra as expressionEntries,
|
|
3181
|
+
la as expressionPropertyName,
|
|
3182
|
+
ia as expressionType,
|
|
3183
|
+
$e as extractGeometryType,
|
|
3184
|
+
Lt as featuresToCsv,
|
|
3185
|
+
At as fetchCollectionDetail,
|
|
3186
|
+
It as fetchCollections,
|
|
3187
|
+
Et as fetchConformance,
|
|
3188
|
+
_e as fetchDistinctValues,
|
|
3189
|
+
Ft as fetchFeatureCount,
|
|
3118
3190
|
se as fetchFeatures,
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3191
|
+
Pe as fetchQueryables,
|
|
3192
|
+
Pt as fetchSpriteNames,
|
|
3193
|
+
Mt as fetchSpriteUrlFromStyle,
|
|
3194
|
+
Ot as fetchTileJson,
|
|
3195
|
+
ut as formatDMS,
|
|
3196
|
+
mt as formatDecimal,
|
|
3197
|
+
jt as fromSimpleFilters,
|
|
3198
|
+
$t as fromStructuredFilters,
|
|
3199
|
+
Re as geometryTypeToStyleType,
|
|
3200
|
+
Be as geometryTypeToStyleTypes,
|
|
3129
3201
|
ae as getColorFromPalette,
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3202
|
+
Rt as getCql2FilteredVectorTileUrl,
|
|
3203
|
+
Bt as getFilteredVectorTileUrl,
|
|
3204
|
+
na as getPrimaryColor,
|
|
3205
|
+
pa as getShapeForStyleType,
|
|
3206
|
+
qt as getTileJsonUrl,
|
|
3207
|
+
Ut as getVectorTileUrl,
|
|
3208
|
+
Gt as gt,
|
|
3209
|
+
Wt as gte,
|
|
3210
|
+
Ha as humanizePropertyName,
|
|
3211
|
+
zt as inList,
|
|
3212
|
+
W as isExpression,
|
|
3141
3213
|
Ia as isGeometryProperty,
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3214
|
+
Vt as isNull,
|
|
3215
|
+
_t as like,
|
|
3216
|
+
Yt as lt,
|
|
3217
|
+
Xt as lte,
|
|
3218
|
+
Ht as neq,
|
|
3219
|
+
Jt as not,
|
|
3220
|
+
Kt as or,
|
|
3221
|
+
Qt as resolveAvailableIcons,
|
|
3222
|
+
Zt as resolvePropertyDisplay,
|
|
3223
|
+
ei as resolveStyleWithSprites,
|
|
3224
|
+
Ye as safeValidateMapConfig,
|
|
3225
|
+
ai as serializeCql2,
|
|
3226
|
+
ti as tAfter,
|
|
3227
|
+
ii as tBefore,
|
|
3228
|
+
ri as tDuring,
|
|
3229
|
+
Fa as toAvailableProperties,
|
|
3230
|
+
li as useCsvExport,
|
|
3231
|
+
ni as useOgcCollectionDetail,
|
|
3160
3232
|
Fe as useOgcCollections,
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3233
|
+
pi as useOgcFeatures,
|
|
3234
|
+
Ve as useOgcQueryables,
|
|
3235
|
+
Ui as validateMapConfig
|
|
3164
3236
|
};
|