@ogc-maps/storybook-components 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FeatureTooltip-DxzN-jnp.js +49 -0
- package/dist/components/FeatureTooltip/FeatureTooltip.d.ts +12 -2
- package/dist/components/FeatureTooltip/FeatureTooltip.d.ts.map +1 -1
- package/dist/components/FeatureTooltip/index.js +1 -1
- package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/LayerEditor/LayerList.d.ts.map +1 -1
- package/dist/components/ResultsDrawer/ResultsDrawer.d.ts +15 -0
- package/dist/components/ResultsDrawer/ResultsDrawer.d.ts.map +1 -0
- package/dist/components/ResultsDrawer/index.d.ts +3 -0
- package/dist/components/ResultsDrawer/index.d.ts.map +1 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts +15 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -0
- package/dist/components/SelectionPanel/index.d.ts +3 -0
- package/dist/components/SelectionPanel/index.d.ts.map +1 -0
- package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
- package/dist/components/admin/CollapsibleSection.d.ts +1 -1
- package/dist/components/admin/CollapsibleSection.d.ts.map +1 -1
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/geo--Ta-t__y.js +1124 -0
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +47 -40
- package/dist/hooks/useSelection.d.ts +14 -0
- package/dist/hooks/useSelection.d.ts.map +1 -0
- package/dist/{index-DA_GGs_P.js → index-CqBeCxon.js} +203 -190
- package/dist/main.js +1494 -1208
- package/dist/schemas/config.d.ts +118 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +22 -20
- 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 +30 -29
- package/dist/utils/boxDraw.d.ts +5 -0
- package/dist/utils/boxDraw.d.ts.map +1 -0
- package/dist/utils/cql2.d.ts +11 -0
- package/dist/utils/cql2.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ogcApi.d.ts +17 -0
- package/dist/utils/ogcApi.d.ts.map +1 -1
- package/dist/utils/selection.d.ts +12 -0
- package/dist/utils/selection.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/FeatureTooltip-Db1LgLQV.js +0 -47
- package/dist/geo-CIJBPCVe.js +0 -1038
package/dist/main.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as
|
|
3
|
-
import { C as
|
|
4
|
-
import { E as
|
|
5
|
-
import { jsx as a, jsxs as l, Fragment as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { F as
|
|
8
|
-
import { F as
|
|
9
|
-
import { L as
|
|
10
|
-
import { L as
|
|
11
|
-
import { LuRuler as Ke, LuPentagon as Qe, LuTrash2 as
|
|
12
|
-
import {
|
|
13
|
-
import { a as
|
|
14
|
-
import { S as
|
|
15
|
-
import { s as
|
|
16
|
-
import { B as
|
|
17
|
-
import './style.css';function
|
|
1
|
+
import { B as $i } from "./BasemapSwitcher-BW7lyZ2Y.js";
|
|
2
|
+
import { C as Bi } from "./CollapsibleControl-qo9daiD8.js";
|
|
3
|
+
import { C as Ui, f as Gi, a as qi } from "./CoordinateDisplay-PxPmVjpm.js";
|
|
4
|
+
import { E as _i } from "./ExportButton-BsNrOvRE.js";
|
|
5
|
+
import { jsx as a, jsxs as l, Fragment as z } from "react/jsx-runtime";
|
|
6
|
+
import { useState as T, useEffect as q, useRef as H, useCallback as Be, useId as ze, useMemo as Ue } from "react";
|
|
7
|
+
import { F as Hi } from "./FeatureDetailPanel-CkFpdEKW.js";
|
|
8
|
+
import { F as Xi } from "./FeatureTooltip-DxzN-jnp.js";
|
|
9
|
+
import { L as Ji } from "./LayerPanel-SCdJ8948.js";
|
|
10
|
+
import { L as Qi } from "./Legend-BLWBzD7Y.js";
|
|
11
|
+
import { LuRuler as Ke, LuPentagon as Qe, LuTrash2 as be, LuMousePointer2 as ea, LuSquareDashedMousePointer as aa, LuList as ia, LuGripHorizontal as ta, LuDownload as ra, LuX as la, LuInfo as pa } from "react-icons/lu";
|
|
12
|
+
import { Y as na, Z as ua, _ as xe, U as Ge, o as qe, n as ye, W as oa, k as ma } from "./geo--Ta-t__y.js";
|
|
13
|
+
import { a as at, b as it, c as tt, d as rt, $ as lt, a0 as pt, a1 as nt, a2 as ut, a3 as ot, a4 as mt, e as st, a5 as ct, f as dt, g as ht, h as gt, i as bt, j as yt, l as ft, m as xt, a6 as wt, a7 as Nt, p as vt, q as kt, r as Ct, s as St, t as Tt, u as Dt, v as Lt, w as At, x as Et, y as It, z as Mt, A as Ft, B as Pt, C as Ot, D as jt, E as $t, F as Rt, G as Bt, a8 as zt, H as Ut, I as Gt, J as qt, K as Wt, L as _t, a9 as Vt, M as Ht, N as Yt, O as Xt, P as Zt, Q as Jt, R as Kt, S as Qt, T as er, V as ar, X as ir } from "./geo--Ta-t__y.js";
|
|
14
|
+
import { S as rr } from "./SearchPanel-4Y12jfuP.js";
|
|
15
|
+
import { s as sa } from "./index-CqBeCxon.js";
|
|
16
|
+
import { B as pr, a as nr, C as ur, b as or, c as mr, D as sr, d as cr, F as dr, e as hr, f as gr, g as br, G as yr, L as fr, h as xr, i as wr, j as Nr, k as vr, l as kr, M as Cr, N as Sr, O as Tr, P as Dr, m as Lr, S as Ar, n as Er, o as Ir, p as Mr, q as Fr, r as Pr, t as Or, u as jr, T as $r, U as Rr, V as Br, v as zr } from "./index-CqBeCxon.js";
|
|
17
|
+
import './style.css';function xi({
|
|
18
18
|
open: e,
|
|
19
|
-
layers:
|
|
20
|
-
availableFormats:
|
|
19
|
+
layers: i,
|
|
20
|
+
availableFormats: t,
|
|
21
21
|
hasActiveFilter: r,
|
|
22
|
-
loading:
|
|
23
|
-
progress:
|
|
24
|
-
error:
|
|
22
|
+
loading: p = !1,
|
|
23
|
+
progress: u,
|
|
24
|
+
error: n,
|
|
25
25
|
onExport: x,
|
|
26
26
|
onClose: s
|
|
27
27
|
}) {
|
|
28
|
-
const [g,
|
|
29
|
-
if (
|
|
30
|
-
e && (
|
|
31
|
-
}, [e,
|
|
32
|
-
const N =
|
|
28
|
+
const [g, d] = T(""), [w, c] = T(""), [o, h] = T(!0);
|
|
29
|
+
if (q(() => {
|
|
30
|
+
e && (d(i.length === 1 ? i[0].id : ""), c(t.length > 0 ? t[0].id : ""), h(!0));
|
|
31
|
+
}, [e, i, t]), !e) return null;
|
|
32
|
+
const N = i.find((m) => m.id === g), v = t.find((m) => m.id === w), C = N != null && r(N.id), E = N != null && v != null && !p, O = () => {
|
|
33
33
|
!N || !v || x({
|
|
34
34
|
layer: N,
|
|
35
35
|
format: v,
|
|
36
|
-
filtered:
|
|
36
|
+
filtered: C ? o : !1
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
return /* @__PURE__ */ a(
|
|
@@ -61,23 +61,23 @@ import './style.css';function nt({
|
|
|
61
61
|
children: "Layer"
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
|
|
64
|
+
i.length === 1 ? /* @__PURE__ */ a("div", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-700", children: i[0].label }) : /* @__PURE__ */ l(
|
|
65
65
|
"select",
|
|
66
66
|
{
|
|
67
67
|
id: "export-layer-select",
|
|
68
68
|
value: g,
|
|
69
|
-
onChange: (m) =>
|
|
69
|
+
onChange: (m) => d(m.target.value),
|
|
70
70
|
className: "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-700",
|
|
71
71
|
children: [
|
|
72
72
|
/* @__PURE__ */ a("option", { value: "", disabled: !0, children: "Select a layer..." }),
|
|
73
|
-
|
|
73
|
+
i.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.label }, m.id))
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }),
|
|
78
78
|
/* @__PURE__ */ l("fieldset", { className: "mapui:mb-4", children: [
|
|
79
79
|
/* @__PURE__ */ a("legend", { className: "mapui:mb-1 mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Format" }),
|
|
80
|
-
/* @__PURE__ */ a("div", { className: "mapui:space-y-1", children:
|
|
80
|
+
/* @__PURE__ */ a("div", { className: "mapui:space-y-1", children: t.map((m) => /* @__PURE__ */ l(
|
|
81
81
|
"label",
|
|
82
82
|
{
|
|
83
83
|
className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2 mapui:rounded mapui:px-2 mapui:py-1.5 hover:mapui:bg-gray-50",
|
|
@@ -105,27 +105,27 @@ import './style.css';function nt({
|
|
|
105
105
|
m.id
|
|
106
106
|
)) })
|
|
107
107
|
] }),
|
|
108
|
-
|
|
108
|
+
C && /* @__PURE__ */ l("label", { className: "mapui:mb-4 mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2", children: [
|
|
109
109
|
/* @__PURE__ */ a(
|
|
110
110
|
"input",
|
|
111
111
|
{
|
|
112
112
|
type: "checkbox",
|
|
113
|
-
checked:
|
|
114
|
-
onChange: (m) =>
|
|
113
|
+
checked: o,
|
|
114
|
+
onChange: (m) => h(m.target.checked),
|
|
115
115
|
className: "mapui:accent-blue-600"
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: "Apply current filters" })
|
|
119
119
|
] }),
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
p && u && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-blue-600", children: u }),
|
|
121
|
+
n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-red-600", children: n }),
|
|
122
122
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:justify-end mapui:gap-2", children: [
|
|
123
123
|
/* @__PURE__ */ a(
|
|
124
124
|
"button",
|
|
125
125
|
{
|
|
126
126
|
type: "button",
|
|
127
127
|
onClick: s,
|
|
128
|
-
disabled:
|
|
128
|
+
disabled: p,
|
|
129
129
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
130
130
|
children: "Cancel"
|
|
131
131
|
}
|
|
@@ -134,13 +134,13 @@ import './style.css';function nt({
|
|
|
134
134
|
"button",
|
|
135
135
|
{
|
|
136
136
|
type: "button",
|
|
137
|
-
onClick:
|
|
137
|
+
onClick: O,
|
|
138
138
|
disabled: !E,
|
|
139
139
|
className: [
|
|
140
140
|
"mapui:rounded mapui:border mapui:border-transparent mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-white",
|
|
141
141
|
E ? "mapui:cursor-pointer mapui:bg-blue-600 hover:mapui:bg-blue-700" : "mapui:cursor-not-allowed mapui:bg-blue-400"
|
|
142
142
|
].join(" "),
|
|
143
|
-
children:
|
|
143
|
+
children: p ? "Exporting..." : "Export"
|
|
144
144
|
}
|
|
145
145
|
)
|
|
146
146
|
] })
|
|
@@ -148,32 +148,32 @@ import './style.css';function nt({
|
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
const
|
|
151
|
+
const ca = [
|
|
152
152
|
{ mode: "distance", icon: Ke, label: "Distance" },
|
|
153
153
|
{ mode: "area", icon: Qe, label: "Area" }
|
|
154
154
|
];
|
|
155
|
-
function
|
|
156
|
-
return e ?
|
|
155
|
+
function da(e, i) {
|
|
156
|
+
return e ? i === 0 ? "Click on the map to start measuring" : e === "distance" ? "Click to add points, double-click to finish" : i < 3 ? "Click to add points (min 3 for area)" : "Click to add points, double-click to close" : "Select a measurement mode";
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function wi({
|
|
159
159
|
mode: e,
|
|
160
|
-
onModeChange:
|
|
161
|
-
points:
|
|
160
|
+
onModeChange: i,
|
|
161
|
+
points: t,
|
|
162
162
|
measurement: r,
|
|
163
|
-
unit:
|
|
164
|
-
onUnitChange:
|
|
165
|
-
onClear:
|
|
163
|
+
unit: p,
|
|
164
|
+
onUnitChange: u,
|
|
165
|
+
onClear: n,
|
|
166
166
|
className: x
|
|
167
167
|
}) {
|
|
168
|
-
const s = e ?
|
|
168
|
+
const s = e ? na[e] : [];
|
|
169
169
|
return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${x ?? ""}`, children: [
|
|
170
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children:
|
|
170
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: ca.map(({ mode: g, icon: d, label: w }) => {
|
|
171
171
|
const c = e === g;
|
|
172
172
|
return /* @__PURE__ */ l(
|
|
173
173
|
"button",
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
176
|
-
onClick: () =>
|
|
176
|
+
onClick: () => i(c ? null : g),
|
|
177
177
|
"aria-label": w,
|
|
178
178
|
"aria-pressed": c,
|
|
179
179
|
className: [
|
|
@@ -181,41 +181,41 @@ function pt({
|
|
|
181
181
|
c ? "mapui:bg-blue-600 mapui:text-white" : "mapui:bg-gray-100 mapui:text-gray-700 hover:mapui:bg-gray-200"
|
|
182
182
|
].join(" "),
|
|
183
183
|
children: [
|
|
184
|
-
/* @__PURE__ */ a(
|
|
184
|
+
/* @__PURE__ */ a(d, { size: 16 }),
|
|
185
185
|
w
|
|
186
186
|
]
|
|
187
187
|
},
|
|
188
188
|
g
|
|
189
189
|
);
|
|
190
190
|
}) }),
|
|
191
|
-
e && /* @__PURE__ */ l(
|
|
192
|
-
/* @__PURE__ */ a("div", { className: "mapui:text-center", children: /* @__PURE__ */ a("div", { className: "mapui:text-2xl mapui:font-semibold mapui:text-gray-900", children: r ?
|
|
191
|
+
e && /* @__PURE__ */ l(z, { children: [
|
|
192
|
+
/* @__PURE__ */ a("div", { className: "mapui:text-center", children: /* @__PURE__ */ a("div", { className: "mapui:text-2xl mapui:font-semibold mapui:text-gray-900", children: r ? ua(r) : "—" }) }),
|
|
193
193
|
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: s.map((g) => {
|
|
194
|
-
const
|
|
194
|
+
const d = p === g;
|
|
195
195
|
return /* @__PURE__ */ a(
|
|
196
196
|
"button",
|
|
197
197
|
{
|
|
198
198
|
type: "button",
|
|
199
|
-
onClick: () =>
|
|
200
|
-
"aria-label": `Unit: ${
|
|
199
|
+
onClick: () => u(g),
|
|
200
|
+
"aria-label": `Unit: ${xe[g]}`,
|
|
201
201
|
className: [
|
|
202
202
|
"mapui:flex-1 mapui:rounded mapui:px-2 mapui:py-1 mapui:text-xs mapui:font-medium mapui:transition-colors",
|
|
203
|
-
|
|
203
|
+
d ? "mapui:bg-blue-100 mapui:text-blue-700" : "mapui:bg-gray-50 mapui:text-gray-500 hover:mapui:bg-gray-100"
|
|
204
204
|
].join(" "),
|
|
205
|
-
children:
|
|
205
|
+
children: xe[g]
|
|
206
206
|
},
|
|
207
207
|
g
|
|
208
208
|
);
|
|
209
209
|
}) }),
|
|
210
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children:
|
|
211
|
-
|
|
210
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children: da(e, t.length) }),
|
|
211
|
+
t.length > 0 && /* @__PURE__ */ l(
|
|
212
212
|
"button",
|
|
213
213
|
{
|
|
214
214
|
type: "button",
|
|
215
|
-
onClick:
|
|
215
|
+
onClick: n,
|
|
216
216
|
className: "mapui:flex mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */ a(
|
|
218
|
+
/* @__PURE__ */ a(be, { size: 14 }),
|
|
219
219
|
"Clear"
|
|
220
220
|
]
|
|
221
221
|
}
|
|
@@ -223,8 +223,218 @@ function pt({
|
|
|
223
223
|
] })
|
|
224
224
|
] });
|
|
225
225
|
}
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
const ha = [
|
|
227
|
+
{ mode: "click", icon: ea, label: "Click" },
|
|
228
|
+
{ mode: "box", icon: aa, label: "Box" }
|
|
229
|
+
];
|
|
230
|
+
function ga(e, i, t) {
|
|
231
|
+
return i ? e ? t === 0 ? e === "click" ? "Click on features to select them" : "Click and drag to draw a selection box" : `${t} feature${t !== 1 ? "s" : ""} selected` : "Choose a selection mode" : "Select a layer to begin";
|
|
232
|
+
}
|
|
233
|
+
function Ni({
|
|
234
|
+
mode: e,
|
|
235
|
+
onModeChange: i,
|
|
236
|
+
layers: t,
|
|
237
|
+
activeLayerId: r,
|
|
238
|
+
onActiveLayerChange: p,
|
|
239
|
+
selectedCount: u,
|
|
240
|
+
onClear: n,
|
|
241
|
+
onViewResults: x,
|
|
242
|
+
className: s
|
|
243
|
+
}) {
|
|
244
|
+
const g = t.filter((d) => d.visible);
|
|
245
|
+
return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${s ?? ""}`, children: [
|
|
246
|
+
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
247
|
+
/* @__PURE__ */ a("label", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Layer" }),
|
|
248
|
+
/* @__PURE__ */ l(
|
|
249
|
+
"select",
|
|
250
|
+
{
|
|
251
|
+
value: r ?? "",
|
|
252
|
+
onChange: (d) => p(d.target.value || null),
|
|
253
|
+
className: "mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1.5 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500",
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ a("option", { value: "", children: "Select a layer…" }),
|
|
256
|
+
g.map((d) => /* @__PURE__ */ a("option", { value: d.id, children: d.label }, d.id))
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] }),
|
|
261
|
+
r && /* @__PURE__ */ l(z, { children: [
|
|
262
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: ha.map(({ mode: d, icon: w, label: c }) => {
|
|
263
|
+
const o = e === d;
|
|
264
|
+
return /* @__PURE__ */ l(
|
|
265
|
+
"button",
|
|
266
|
+
{
|
|
267
|
+
type: "button",
|
|
268
|
+
onClick: () => i(o ? null : d),
|
|
269
|
+
"aria-label": c,
|
|
270
|
+
"aria-pressed": o,
|
|
271
|
+
className: [
|
|
272
|
+
"mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:transition-colors",
|
|
273
|
+
o ? "mapui:bg-blue-600 mapui:text-white" : "mapui:bg-gray-100 mapui:text-gray-700 hover:mapui:bg-gray-200"
|
|
274
|
+
].join(" "),
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ a(w, { size: 16 }),
|
|
277
|
+
c
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
d
|
|
281
|
+
);
|
|
282
|
+
}) }),
|
|
283
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children: ga(e, r, u) }),
|
|
284
|
+
u > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
285
|
+
/* @__PURE__ */ l(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
type: "button",
|
|
289
|
+
onClick: x,
|
|
290
|
+
className: "mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1.5 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ a(ia, { size: 14 }),
|
|
293
|
+
"View Results"
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
/* @__PURE__ */ l(
|
|
298
|
+
"button",
|
|
299
|
+
{
|
|
300
|
+
type: "button",
|
|
301
|
+
onClick: n,
|
|
302
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ a(be, { size: 14 }),
|
|
305
|
+
"Clear"
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
] })
|
|
310
|
+
] })
|
|
311
|
+
] });
|
|
312
|
+
}
|
|
313
|
+
function ba(e) {
|
|
314
|
+
return e == null ? "--" : typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
315
|
+
}
|
|
316
|
+
const ya = 200, fa = 0.6, xa = 300;
|
|
317
|
+
function vi({
|
|
318
|
+
open: e,
|
|
319
|
+
features: i,
|
|
320
|
+
columns: t,
|
|
321
|
+
title: r = "Results",
|
|
322
|
+
onClose: p,
|
|
323
|
+
onExport: u,
|
|
324
|
+
onFeatureClick: n,
|
|
325
|
+
onClearSelection: x
|
|
326
|
+
}) {
|
|
327
|
+
const [s, g] = T(xa), d = H(!1), w = H(0), c = H(0), o = Be((N) => {
|
|
328
|
+
N.preventDefault(), d.current = !0, w.current = N.clientY, c.current = s;
|
|
329
|
+
}, [s]);
|
|
330
|
+
if (q(() => {
|
|
331
|
+
if (!e) return;
|
|
332
|
+
const N = (C) => {
|
|
333
|
+
if (!d.current) return;
|
|
334
|
+
const E = window.innerHeight * fa, O = w.current - C.clientY, m = Math.min(E, Math.max(ya, c.current + O));
|
|
335
|
+
g(m);
|
|
336
|
+
}, v = () => {
|
|
337
|
+
d.current = !1;
|
|
338
|
+
};
|
|
339
|
+
return window.addEventListener("mousemove", N), window.addEventListener("mouseup", v), () => {
|
|
340
|
+
window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", v);
|
|
341
|
+
};
|
|
342
|
+
}, [e]), !e) return null;
|
|
343
|
+
const h = t ?? (i.length > 0 ? Object.keys(i[0].properties).filter((N) => N !== "geometry") : []);
|
|
344
|
+
return /* @__PURE__ */ l(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
className: "mapui:absolute mapui:bottom-0 mapui:left-0 mapui:right-0 mapui:z-20 mapui:bg-white mapui:shadow-[0_-4px_12px_rgba(0,0,0,0.15)] mapui:flex mapui:flex-col",
|
|
348
|
+
style: { height: s },
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ a(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:h-3 mapui:cursor-ns-resize mapui:bg-gray-100 mapui:border-b mapui:border-gray-200 hover:mapui:bg-gray-200",
|
|
354
|
+
onMouseDown: o,
|
|
355
|
+
children: /* @__PURE__ */ a(ta, { size: 14, className: "mapui:text-gray-400" })
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:px-4 mapui:py-2 mapui:border-b mapui:border-gray-200 mapui:shrink-0", children: [
|
|
359
|
+
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
360
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-semibold mapui:text-gray-800", children: r }),
|
|
361
|
+
/* @__PURE__ */ a("span", { className: "mapui:rounded-full mapui:bg-blue-100 mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:font-medium mapui:text-blue-700", children: i.length })
|
|
362
|
+
] }),
|
|
363
|
+
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
364
|
+
u && /* @__PURE__ */ a(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
type: "button",
|
|
368
|
+
onClick: u,
|
|
369
|
+
title: "Export",
|
|
370
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
371
|
+
children: /* @__PURE__ */ a(ra, { size: 16 })
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
x && /* @__PURE__ */ a(
|
|
375
|
+
"button",
|
|
376
|
+
{
|
|
377
|
+
type: "button",
|
|
378
|
+
onClick: x,
|
|
379
|
+
title: "Clear selection",
|
|
380
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
381
|
+
children: /* @__PURE__ */ a(be, { size: 16 })
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ a(
|
|
385
|
+
"button",
|
|
386
|
+
{
|
|
387
|
+
type: "button",
|
|
388
|
+
onClick: p,
|
|
389
|
+
title: "Close",
|
|
390
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
391
|
+
children: /* @__PURE__ */ a(la, { size: 16 })
|
|
392
|
+
}
|
|
393
|
+
)
|
|
394
|
+
] })
|
|
395
|
+
] }),
|
|
396
|
+
/* @__PURE__ */ a("div", { className: "mapui:overflow-auto mapui:flex-1", children: i.length === 0 ? /* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-center mapui:h-full mapui:text-sm mapui:text-gray-400", children: "No features to display" }) : /* @__PURE__ */ l("table", { className: "mapui:w-full mapui:text-xs mapui:border-collapse", children: [
|
|
397
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ l("tr", { className: "mapui:bg-gray-50 mapui:sticky mapui:top-0", children: [
|
|
398
|
+
/* @__PURE__ */ a("th", { className: "mapui:px-3 mapui:py-2 mapui:text-left mapui:font-medium mapui:text-gray-600 mapui:border-b mapui:border-gray-200", children: "#" }),
|
|
399
|
+
h.map((N) => /* @__PURE__ */ a(
|
|
400
|
+
"th",
|
|
401
|
+
{
|
|
402
|
+
className: "mapui:px-3 mapui:py-2 mapui:text-left mapui:font-medium mapui:text-gray-600 mapui:border-b mapui:border-gray-200 mapui:whitespace-nowrap",
|
|
403
|
+
children: N
|
|
404
|
+
},
|
|
405
|
+
N
|
|
406
|
+
))
|
|
407
|
+
] }) }),
|
|
408
|
+
/* @__PURE__ */ a("tbody", { children: i.map((N, v) => /* @__PURE__ */ l(
|
|
409
|
+
"tr",
|
|
410
|
+
{
|
|
411
|
+
onClick: () => n == null ? void 0 : n(v),
|
|
412
|
+
className: [
|
|
413
|
+
n ? "mapui:cursor-pointer" : "",
|
|
414
|
+
v % 2 === 0 ? "mapui:bg-white" : "mapui:bg-gray-50",
|
|
415
|
+
"hover:mapui:bg-blue-50"
|
|
416
|
+
].join(" "),
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ a("td", { className: "mapui:px-3 mapui:py-1.5 mapui:text-gray-400 mapui:border-b mapui:border-gray-100", children: v + 1 }),
|
|
419
|
+
h.map((C) => /* @__PURE__ */ a(
|
|
420
|
+
"td",
|
|
421
|
+
{
|
|
422
|
+
className: "mapui:px-3 mapui:py-1.5 mapui:text-gray-700 mapui:border-b mapui:border-gray-100 mapui:whitespace-nowrap",
|
|
423
|
+
children: ba(N.properties[C])
|
|
424
|
+
},
|
|
425
|
+
C
|
|
426
|
+
))
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
v
|
|
430
|
+
)) })
|
|
431
|
+
] }) })
|
|
432
|
+
]
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function wa({ text: e, id: i }) {
|
|
437
|
+
const t = ze(), r = i ?? t;
|
|
228
438
|
return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
|
|
229
439
|
/* @__PURE__ */ a(
|
|
230
440
|
"span",
|
|
@@ -233,7 +443,7 @@ function oa({ text: e, id: t }) {
|
|
|
233
443
|
"aria-label": "Info",
|
|
234
444
|
"aria-describedby": r,
|
|
235
445
|
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",
|
|
236
|
-
children: /* @__PURE__ */ a(
|
|
446
|
+
children: /* @__PURE__ */ a(pa, { className: "mapui:h-3.5 mapui:w-3.5" })
|
|
237
447
|
}
|
|
238
448
|
),
|
|
239
449
|
/* @__PURE__ */ l(
|
|
@@ -250,28 +460,28 @@ function oa({ text: e, id: t }) {
|
|
|
250
460
|
)
|
|
251
461
|
] });
|
|
252
462
|
}
|
|
253
|
-
function
|
|
463
|
+
function S({ label: e, error: i, required: t, description: r, htmlFor: p, children: u }) {
|
|
254
464
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
255
465
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
256
|
-
/* @__PURE__ */ l("label", { htmlFor:
|
|
466
|
+
/* @__PURE__ */ l("label", { htmlFor: p, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
|
|
257
467
|
e,
|
|
258
|
-
|
|
468
|
+
t && /* @__PURE__ */ a("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
|
|
259
469
|
] }),
|
|
260
|
-
r && /* @__PURE__ */ a(
|
|
470
|
+
r && /* @__PURE__ */ a(wa, { text: r })
|
|
261
471
|
] }),
|
|
262
|
-
|
|
263
|
-
|
|
472
|
+
u,
|
|
473
|
+
i && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: i })
|
|
264
474
|
] });
|
|
265
475
|
}
|
|
266
|
-
function
|
|
476
|
+
function Z({ value: e, onChange: i, label: t }) {
|
|
267
477
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
268
478
|
/* @__PURE__ */ a(
|
|
269
479
|
"input",
|
|
270
480
|
{
|
|
271
481
|
type: "color",
|
|
272
482
|
value: e,
|
|
273
|
-
onChange: (r) =>
|
|
274
|
-
"aria-label":
|
|
483
|
+
onChange: (r) => i(r.target.value),
|
|
484
|
+
"aria-label": t ?? "Color",
|
|
275
485
|
className: "mapui:h-8 mapui:w-10 mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:p-0.5"
|
|
276
486
|
}
|
|
277
487
|
),
|
|
@@ -280,10 +490,10 @@ function H({ value: e, onChange: t, label: i }) {
|
|
|
280
490
|
}
|
|
281
491
|
function re({
|
|
282
492
|
open: e,
|
|
283
|
-
title:
|
|
284
|
-
description:
|
|
493
|
+
title: i,
|
|
494
|
+
description: t,
|
|
285
495
|
onConfirm: r,
|
|
286
|
-
onCancel:
|
|
496
|
+
onCancel: p
|
|
287
497
|
}) {
|
|
288
498
|
return e ? /* @__PURE__ */ a(
|
|
289
499
|
"div",
|
|
@@ -299,7 +509,7 @@ function re({
|
|
|
299
509
|
{
|
|
300
510
|
id: "confirm-dialog-title",
|
|
301
511
|
className: "mapui:m-0 mapui:mb-2 mapui:text-base mapui:font-semibold mapui:text-gray-900",
|
|
302
|
-
children:
|
|
512
|
+
children: i
|
|
303
513
|
}
|
|
304
514
|
),
|
|
305
515
|
/* @__PURE__ */ a(
|
|
@@ -307,7 +517,7 @@ function re({
|
|
|
307
517
|
{
|
|
308
518
|
id: "confirm-dialog-description",
|
|
309
519
|
className: "mapui:m-0 mapui:mb-6 mapui:text-sm mapui:text-gray-600",
|
|
310
|
-
children:
|
|
520
|
+
children: t
|
|
311
521
|
}
|
|
312
522
|
),
|
|
313
523
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:justify-end mapui:gap-2", children: [
|
|
@@ -315,7 +525,7 @@ function re({
|
|
|
315
525
|
"button",
|
|
316
526
|
{
|
|
317
527
|
type: "button",
|
|
318
|
-
onClick:
|
|
528
|
+
onClick: p,
|
|
319
529
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
320
530
|
children: "Cancel"
|
|
321
531
|
}
|
|
@@ -336,67 +546,67 @@ function re({
|
|
|
336
546
|
}
|
|
337
547
|
function X({
|
|
338
548
|
title: e,
|
|
339
|
-
children:
|
|
340
|
-
defaultOpen:
|
|
549
|
+
children: i,
|
|
550
|
+
defaultOpen: t = !1,
|
|
341
551
|
badge: r
|
|
342
552
|
}) {
|
|
343
|
-
const [
|
|
553
|
+
const [p, u] = T(t);
|
|
344
554
|
return /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-200", children: [
|
|
345
555
|
/* @__PURE__ */ l(
|
|
346
556
|
"button",
|
|
347
557
|
{
|
|
348
558
|
type: "button",
|
|
349
|
-
onClick: () =>
|
|
559
|
+
onClick: () => u((n) => !n),
|
|
350
560
|
className: "mapui:flex mapui:w-full mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:rounded mapui:border-none mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-100",
|
|
351
561
|
children: [
|
|
352
562
|
/* @__PURE__ */ l("span", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
353
563
|
e,
|
|
354
564
|
r !== void 0 && r > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded-full mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: r })
|
|
355
565
|
] }),
|
|
356
|
-
/* @__PURE__ */ a("span", { "aria-hidden": "true", children:
|
|
566
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: p ? "▲" : "▼" })
|
|
357
567
|
]
|
|
358
568
|
}
|
|
359
569
|
),
|
|
360
|
-
|
|
570
|
+
p && /* @__PURE__ */ a("div", { className: "mapui:p-3", children: i })
|
|
361
571
|
] });
|
|
362
572
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
573
|
+
const ee = "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";
|
|
574
|
+
function we({
|
|
365
575
|
value: e,
|
|
366
|
-
onChange:
|
|
367
|
-
onTestConnection:
|
|
576
|
+
onChange: i,
|
|
577
|
+
onTestConnection: t,
|
|
368
578
|
testStatus: r = "idle",
|
|
369
|
-
testError:
|
|
579
|
+
testError: p
|
|
370
580
|
}) {
|
|
371
|
-
const
|
|
581
|
+
const u = (n) => i({ ...e, ...n });
|
|
372
582
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
373
|
-
/* @__PURE__ */ a(
|
|
583
|
+
/* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
374
584
|
"input",
|
|
375
585
|
{
|
|
376
586
|
type: "text",
|
|
377
587
|
value: e.id,
|
|
378
|
-
onChange: (
|
|
588
|
+
onChange: (n) => u({ id: n.target.value }),
|
|
379
589
|
placeholder: "my-source",
|
|
380
|
-
className:
|
|
590
|
+
className: ee
|
|
381
591
|
}
|
|
382
592
|
) }),
|
|
383
|
-
/* @__PURE__ */ l(
|
|
593
|
+
/* @__PURE__ */ l(S, { label: "URL", required: !0, children: [
|
|
384
594
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
385
595
|
/* @__PURE__ */ a(
|
|
386
596
|
"input",
|
|
387
597
|
{
|
|
388
598
|
type: "url",
|
|
389
599
|
value: e.url,
|
|
390
|
-
onChange: (
|
|
600
|
+
onChange: (n) => u({ url: n.target.value }),
|
|
391
601
|
placeholder: "https://example.com/ogcapi",
|
|
392
|
-
className: `${
|
|
602
|
+
className: `${ee} mapui:flex-1`
|
|
393
603
|
}
|
|
394
604
|
),
|
|
395
|
-
|
|
605
|
+
t && /* @__PURE__ */ a(
|
|
396
606
|
"button",
|
|
397
607
|
{
|
|
398
608
|
type: "button",
|
|
399
|
-
onClick: () =>
|
|
609
|
+
onClick: () => t(e.url),
|
|
400
610
|
disabled: r === "loading" || !e.url,
|
|
401
611
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-500 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-sm mapui:text-blue-600 hover:mapui:bg-blue-50 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
402
612
|
children: r === "loading" ? "Testing…" : "Test Connection"
|
|
@@ -404,26 +614,26 @@ function xe({
|
|
|
404
614
|
)
|
|
405
615
|
] }),
|
|
406
616
|
r === "success" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-green-600", children: "Connection successful" }),
|
|
407
|
-
r === "error" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-600", children:
|
|
617
|
+
r === "error" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-600", children: p ?? "Connection failed" })
|
|
408
618
|
] }),
|
|
409
|
-
/* @__PURE__ */ a(
|
|
619
|
+
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
410
620
|
"input",
|
|
411
621
|
{
|
|
412
622
|
type: "text",
|
|
413
623
|
value: e.label ?? "",
|
|
414
|
-
onChange: (
|
|
624
|
+
onChange: (n) => u({ label: n.target.value || void 0 }),
|
|
415
625
|
placeholder: "My OGC API Source",
|
|
416
|
-
className:
|
|
626
|
+
className: ee
|
|
417
627
|
}
|
|
418
628
|
) }),
|
|
419
|
-
/* @__PURE__ */ a(
|
|
629
|
+
/* @__PURE__ */ a(S, { label: "Tile Matrix Set ID", children: /* @__PURE__ */ a(
|
|
420
630
|
"input",
|
|
421
631
|
{
|
|
422
632
|
type: "text",
|
|
423
633
|
value: e.tileMatrixSetId ?? "WebMercatorQuad",
|
|
424
|
-
onChange: (
|
|
634
|
+
onChange: (n) => u({ tileMatrixSetId: n.target.value || void 0 }),
|
|
425
635
|
placeholder: "WebMercatorQuad",
|
|
426
|
-
className:
|
|
636
|
+
className: ee
|
|
427
637
|
}
|
|
428
638
|
) })
|
|
429
639
|
] });
|
|
@@ -434,21 +644,21 @@ const le = () => ({
|
|
|
434
644
|
label: void 0,
|
|
435
645
|
tileMatrixSetId: "WebMercatorQuad"
|
|
436
646
|
});
|
|
437
|
-
function
|
|
438
|
-
const [
|
|
439
|
-
w((
|
|
647
|
+
function ki({ sources: e, onChange: i }) {
|
|
648
|
+
const [t, r] = T(null), [p, u] = T(null), [n, x] = T(!1), [s, g] = T(le()), [d, w] = T({}), [c, o] = T({}), [h, N] = T(null), v = async (m, L) => {
|
|
649
|
+
w((F) => ({ ...F, [m]: "loading" }));
|
|
440
650
|
try {
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
} catch (
|
|
444
|
-
w((
|
|
651
|
+
const F = await fetch(`${L}/conformance`);
|
|
652
|
+
F.ok ? w((b) => ({ ...b, [m]: "success" })) : (w((b) => ({ ...b, [m]: "error" })), o((b) => ({ ...b, [m]: `HTTP ${F.status}` })));
|
|
653
|
+
} catch (F) {
|
|
654
|
+
w((b) => ({ ...b, [m]: "error" })), o((b) => ({ ...b, [m]: F instanceof Error ? F.message : "Network error" }));
|
|
445
655
|
}
|
|
446
|
-
},
|
|
447
|
-
|
|
656
|
+
}, C = () => {
|
|
657
|
+
p && (i(e.map((m) => m.id === t ? p : m)), r(null), u(null));
|
|
448
658
|
}, E = () => {
|
|
449
|
-
|
|
450
|
-
},
|
|
451
|
-
|
|
659
|
+
i([...e, s]), x(!1), g(le());
|
|
660
|
+
}, O = (m) => {
|
|
661
|
+
i(e.filter((L) => L.id !== m)), N(null);
|
|
452
662
|
};
|
|
453
663
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
454
664
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -465,19 +675,19 @@ function ot({ sources: e, onChange: t }) {
|
|
|
465
675
|
}
|
|
466
676
|
)
|
|
467
677
|
] }),
|
|
468
|
-
e.length === 0 && !
|
|
678
|
+
e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
|
|
469
679
|
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((m) => /* @__PURE__ */ a(
|
|
470
680
|
"li",
|
|
471
681
|
{
|
|
472
682
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white mapui:p-3",
|
|
473
|
-
children:
|
|
683
|
+
children: t === m.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
474
684
|
/* @__PURE__ */ a(
|
|
475
|
-
|
|
685
|
+
we,
|
|
476
686
|
{
|
|
477
|
-
value:
|
|
478
|
-
onChange:
|
|
479
|
-
onTestConnection: (
|
|
480
|
-
testStatus:
|
|
687
|
+
value: p ?? m,
|
|
688
|
+
onChange: u,
|
|
689
|
+
onTestConnection: (L) => v(`edit-${m.id}`, L),
|
|
690
|
+
testStatus: d[`edit-${m.id}`],
|
|
481
691
|
testError: c[`edit-${m.id}`]
|
|
482
692
|
}
|
|
483
693
|
),
|
|
@@ -486,8 +696,8 @@ function ot({ sources: e, onChange: t }) {
|
|
|
486
696
|
"button",
|
|
487
697
|
{
|
|
488
698
|
type: "button",
|
|
489
|
-
onClick:
|
|
490
|
-
disabled: !(
|
|
699
|
+
onClick: C,
|
|
700
|
+
disabled: !(p != null && p.id) || !(p != null && p.url),
|
|
491
701
|
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",
|
|
492
702
|
children: "Save"
|
|
493
703
|
}
|
|
@@ -497,7 +707,7 @@ function ot({ sources: e, onChange: t }) {
|
|
|
497
707
|
{
|
|
498
708
|
type: "button",
|
|
499
709
|
onClick: () => {
|
|
500
|
-
r(null),
|
|
710
|
+
r(null), u(null);
|
|
501
711
|
},
|
|
502
712
|
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",
|
|
503
713
|
children: "Cancel"
|
|
@@ -519,7 +729,7 @@ function ot({ sources: e, onChange: t }) {
|
|
|
519
729
|
{
|
|
520
730
|
type: "button",
|
|
521
731
|
onClick: () => {
|
|
522
|
-
r(m.id),
|
|
732
|
+
r(m.id), u(m);
|
|
523
733
|
},
|
|
524
734
|
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",
|
|
525
735
|
children: "Edit"
|
|
@@ -539,15 +749,15 @@ function ot({ sources: e, onChange: t }) {
|
|
|
539
749
|
},
|
|
540
750
|
m.id
|
|
541
751
|
)) }),
|
|
542
|
-
|
|
752
|
+
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
543
753
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
|
|
544
754
|
/* @__PURE__ */ a(
|
|
545
|
-
|
|
755
|
+
we,
|
|
546
756
|
{
|
|
547
757
|
value: s,
|
|
548
758
|
onChange: g,
|
|
549
759
|
onTestConnection: (m) => v("new", m),
|
|
550
|
-
testStatus:
|
|
760
|
+
testStatus: d.new,
|
|
551
761
|
testError: c.new
|
|
552
762
|
}
|
|
553
763
|
),
|
|
@@ -576,30 +786,30 @@ function ot({ sources: e, onChange: t }) {
|
|
|
576
786
|
/* @__PURE__ */ a(
|
|
577
787
|
re,
|
|
578
788
|
{
|
|
579
|
-
open:
|
|
789
|
+
open: h !== null,
|
|
580
790
|
title: "Remove Source",
|
|
581
791
|
description: "Are you sure you want to remove this source? Any layers using it will be affected.",
|
|
582
|
-
onConfirm: () =>
|
|
792
|
+
onConfirm: () => h && O(h),
|
|
583
793
|
onCancel: () => N(null)
|
|
584
794
|
}
|
|
585
795
|
)
|
|
586
796
|
] });
|
|
587
797
|
}
|
|
588
|
-
function
|
|
798
|
+
function Ci({
|
|
589
799
|
sourceUrl: e,
|
|
590
|
-
selectedCollectionIds:
|
|
591
|
-
onSelect:
|
|
800
|
+
selectedCollectionIds: i,
|
|
801
|
+
onSelect: t,
|
|
592
802
|
onDeselect: r
|
|
593
803
|
}) {
|
|
594
|
-
const { collections:
|
|
595
|
-
return
|
|
804
|
+
const { collections: p, loading: u, error: n } = Ge(e || null);
|
|
805
|
+
return u ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
|
|
596
806
|
/* @__PURE__ */ a("span", { className: "mapui:inline-block mapui:h-4 mapui:w-4 mapui:animate-spin mapui:rounded-full mapui:border-2 mapui:border-gray-300 mapui:border-t-blue-600" }),
|
|
597
807
|
"Loading collections…"
|
|
598
|
-
] }) :
|
|
808
|
+
] }) : n ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
|
|
599
809
|
"Failed to load collections: ",
|
|
600
|
-
|
|
601
|
-
] }) :
|
|
602
|
-
const s =
|
|
810
|
+
n.message
|
|
811
|
+
] }) : p.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: p.map((x) => {
|
|
812
|
+
const s = i.includes(x.id);
|
|
603
813
|
return /* @__PURE__ */ l(
|
|
604
814
|
"li",
|
|
605
815
|
{
|
|
@@ -611,7 +821,7 @@ function ut({
|
|
|
611
821
|
type: "checkbox",
|
|
612
822
|
id: `collection-${x.id}`,
|
|
613
823
|
checked: s,
|
|
614
|
-
onChange: () => s ? r(x.id) :
|
|
824
|
+
onChange: () => s ? r(x.id) : t(x.id),
|
|
615
825
|
className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
|
|
616
826
|
}
|
|
617
827
|
),
|
|
@@ -633,35 +843,35 @@ function ut({
|
|
|
633
843
|
);
|
|
634
844
|
}) });
|
|
635
845
|
}
|
|
636
|
-
function
|
|
637
|
-
const [r,
|
|
638
|
-
if (!
|
|
639
|
-
if (!e) return
|
|
846
|
+
function Na({ value: e, onChange: i, availableIcons: t }) {
|
|
847
|
+
const [r, p] = T(!1), [u, n] = T(-1), x = H(null), s = ze(), g = u >= 0 ? `${s}-option-${u}` : void 0, d = Ue(() => {
|
|
848
|
+
if (!t || t.length === 0) return [];
|
|
849
|
+
if (!e) return t;
|
|
640
850
|
const v = e.toLowerCase();
|
|
641
|
-
return
|
|
642
|
-
}, [
|
|
851
|
+
return t.filter((C) => C.toLowerCase().includes(v));
|
|
852
|
+
}, [t, e]), w = r && d.length > 0, c = Be(
|
|
643
853
|
(v) => {
|
|
644
|
-
|
|
854
|
+
i(v), p(!1), n(-1);
|
|
645
855
|
},
|
|
646
|
-
[
|
|
647
|
-
),
|
|
648
|
-
|
|
649
|
-
},
|
|
650
|
-
w && (v.key === "ArrowDown" ? (v.preventDefault(),
|
|
856
|
+
[i]
|
|
857
|
+
), o = (v) => {
|
|
858
|
+
i(v.target.value), p(!0), n(-1);
|
|
859
|
+
}, h = (v) => {
|
|
860
|
+
w && (v.key === "ArrowDown" ? (v.preventDefault(), n((C) => Math.min(C + 1, d.length - 1))) : v.key === "ArrowUp" ? (v.preventDefault(), n((C) => Math.max(C - 1, 0))) : v.key === "Enter" && u >= 0 ? (v.preventDefault(), c(d[u])) : v.key === "Escape" && (p(!1), n(-1)));
|
|
651
861
|
};
|
|
652
|
-
|
|
653
|
-
const v = (
|
|
654
|
-
x.current && !x.current.contains(
|
|
862
|
+
q(() => {
|
|
863
|
+
const v = (C) => {
|
|
864
|
+
x.current && !x.current.contains(C.target) && (p(!1), n(-1));
|
|
655
865
|
};
|
|
656
866
|
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
657
867
|
}, []);
|
|
658
868
|
const N = "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";
|
|
659
|
-
return !
|
|
869
|
+
return !t || t.length === 0 ? /* @__PURE__ */ a(
|
|
660
870
|
"input",
|
|
661
871
|
{
|
|
662
872
|
type: "text",
|
|
663
873
|
value: e,
|
|
664
|
-
onChange: (v) =>
|
|
874
|
+
onChange: (v) => i(v.target.value || ""),
|
|
665
875
|
placeholder: "icon-name",
|
|
666
876
|
className: N
|
|
667
877
|
}
|
|
@@ -677,9 +887,9 @@ function ua({ value: e, onChange: t, availableIcons: i }) {
|
|
|
677
887
|
"aria-autocomplete": "list",
|
|
678
888
|
"aria-controls": s,
|
|
679
889
|
"aria-activedescendant": g,
|
|
680
|
-
onChange:
|
|
681
|
-
onFocus: () =>
|
|
682
|
-
onKeyDown:
|
|
890
|
+
onChange: o,
|
|
891
|
+
onFocus: () => p(!0),
|
|
892
|
+
onKeyDown: h,
|
|
683
893
|
className: N
|
|
684
894
|
}
|
|
685
895
|
),
|
|
@@ -689,25 +899,25 @@ function ua({ value: e, onChange: t, availableIcons: i }) {
|
|
|
689
899
|
id: s,
|
|
690
900
|
role: "listbox",
|
|
691
901
|
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",
|
|
692
|
-
children:
|
|
902
|
+
children: d.map((v, C) => /* @__PURE__ */ a(
|
|
693
903
|
"li",
|
|
694
904
|
{
|
|
695
|
-
id: `${s}-option-${
|
|
905
|
+
id: `${s}-option-${C}`,
|
|
696
906
|
role: "option",
|
|
697
|
-
"aria-selected":
|
|
907
|
+
"aria-selected": C === u,
|
|
698
908
|
onMouseDown: (E) => {
|
|
699
909
|
E.preventDefault(), c(v);
|
|
700
910
|
},
|
|
701
|
-
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${
|
|
911
|
+
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${C === u ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
|
|
702
912
|
children: v
|
|
703
913
|
},
|
|
704
|
-
`${
|
|
914
|
+
`${C}-${v}`
|
|
705
915
|
))
|
|
706
916
|
}
|
|
707
917
|
)
|
|
708
918
|
] });
|
|
709
919
|
}
|
|
710
|
-
const
|
|
920
|
+
const Ne = [
|
|
711
921
|
"#4e79a7",
|
|
712
922
|
"#f28e2b",
|
|
713
923
|
"#e15759",
|
|
@@ -719,222 +929,222 @@ const we = [
|
|
|
719
929
|
"#9c755f",
|
|
720
930
|
"#bab0ac"
|
|
721
931
|
];
|
|
722
|
-
function
|
|
723
|
-
return
|
|
932
|
+
function pe(e) {
|
|
933
|
+
return Ne[e % Ne.length];
|
|
724
934
|
}
|
|
725
|
-
function
|
|
935
|
+
function va(e) {
|
|
726
936
|
return e[0] === "interpolate" ? "interpolate" : "match";
|
|
727
937
|
}
|
|
728
|
-
function
|
|
729
|
-
const
|
|
730
|
-
for (let
|
|
731
|
-
r.push({ value: String(e[
|
|
732
|
-
return { property:
|
|
938
|
+
function ka(e) {
|
|
939
|
+
const i = Array.isArray(e[1]) ? e[1][1] ?? "" : "", t = e[e.length - 1] ?? "#000000", r = [];
|
|
940
|
+
for (let p = 2; p < e.length - 1; p += 2)
|
|
941
|
+
r.push({ value: String(e[p] ?? ""), color: e[p + 1] ?? "#000000" });
|
|
942
|
+
return { property: i, pairs: r, fallback: t };
|
|
733
943
|
}
|
|
734
|
-
function
|
|
944
|
+
function ve(e, i, t) {
|
|
735
945
|
const r = ["match", ["get", e]];
|
|
736
|
-
for (const
|
|
737
|
-
r.push(
|
|
738
|
-
return r.push(
|
|
946
|
+
for (const p of i)
|
|
947
|
+
r.push(p.value, p.color);
|
|
948
|
+
return r.push(t), r;
|
|
739
949
|
}
|
|
740
|
-
function
|
|
741
|
-
const
|
|
742
|
-
let
|
|
743
|
-
Array.isArray(
|
|
950
|
+
function ne(e) {
|
|
951
|
+
const i = e[2];
|
|
952
|
+
let t = "";
|
|
953
|
+
Array.isArray(i) && (i[0] === "to-number" && Array.isArray(i[1]) ? t = i[1][1] ?? "" : t = i[1] ?? "");
|
|
744
954
|
const r = [];
|
|
745
|
-
for (let
|
|
746
|
-
r.push({ stop: Number(e[
|
|
747
|
-
return { property:
|
|
748
|
-
}
|
|
749
|
-
function
|
|
750
|
-
const
|
|
751
|
-
for (const r of
|
|
752
|
-
|
|
753
|
-
return
|
|
955
|
+
for (let p = 3; p < e.length; p += 2)
|
|
956
|
+
r.push({ stop: Number(e[p] ?? 0), color: e[p + 1] ?? "#000000" });
|
|
957
|
+
return { property: t, stops: r };
|
|
958
|
+
}
|
|
959
|
+
function ke(e, i) {
|
|
960
|
+
const t = ["interpolate", ["linear"], ["to-number", ["get", e]]];
|
|
961
|
+
for (const r of i)
|
|
962
|
+
t.push(r.stop, r.color);
|
|
963
|
+
return t;
|
|
754
964
|
}
|
|
755
|
-
function
|
|
756
|
-
return e.map((
|
|
965
|
+
function Ce(e) {
|
|
966
|
+
return e.map((i) => ({ stopText: String(i.stop), color: i.color }));
|
|
757
967
|
}
|
|
758
|
-
function
|
|
759
|
-
return e.map((
|
|
760
|
-
if (
|
|
761
|
-
const r = parseFloat(
|
|
968
|
+
function Ca(e) {
|
|
969
|
+
return e.map((i, t) => {
|
|
970
|
+
if (i.stopText.trim() === "") return "Value required";
|
|
971
|
+
const r = parseFloat(i.stopText);
|
|
762
972
|
if (isNaN(r)) return "Must be a number";
|
|
763
|
-
if (
|
|
764
|
-
const
|
|
765
|
-
if (!isNaN(
|
|
973
|
+
if (t > 0) {
|
|
974
|
+
const p = parseFloat(e[t - 1].stopText);
|
|
975
|
+
if (!isNaN(p) && r <= p) return "Must be greater than previous stop";
|
|
766
976
|
}
|
|
767
977
|
return "";
|
|
768
978
|
});
|
|
769
979
|
}
|
|
770
|
-
function
|
|
771
|
-
const
|
|
772
|
-
for (const
|
|
773
|
-
const r = parseFloat(
|
|
980
|
+
function Sa(e) {
|
|
981
|
+
const i = [];
|
|
982
|
+
for (const t of e) {
|
|
983
|
+
const r = parseFloat(t.stopText);
|
|
774
984
|
if (isNaN(r)) return null;
|
|
775
|
-
|
|
985
|
+
i.push({ stop: r, color: t.color });
|
|
776
986
|
}
|
|
777
|
-
return
|
|
987
|
+
return i;
|
|
778
988
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
989
|
+
const ae = "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", ue = "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", Se = "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";
|
|
990
|
+
function Ta({
|
|
781
991
|
value: e,
|
|
782
|
-
onChange:
|
|
783
|
-
availableProperties:
|
|
992
|
+
onChange: i,
|
|
993
|
+
availableProperties: t = [],
|
|
784
994
|
onFetchDistinctValues: r
|
|
785
995
|
}) {
|
|
786
|
-
const [
|
|
787
|
-
const
|
|
788
|
-
return
|
|
789
|
-
}), [
|
|
790
|
-
|
|
791
|
-
if (E.current !== e &&
|
|
792
|
-
const
|
|
793
|
-
|
|
996
|
+
const [p, u] = T(() => va(e)), [n, x] = T(!1), s = ka(e), g = p === "match" ? s.property : "", d = p === "match" ? s.pairs : [], w = p === "match" ? s.fallback : "#000000", [c, o] = T(() => {
|
|
997
|
+
const f = ne(e);
|
|
998
|
+
return Ce(f.stops);
|
|
999
|
+
}), [h, N] = T(() => p === "interpolate" ? ne(e).property : ""), [v, C] = T([]), E = H(e);
|
|
1000
|
+
q(() => {
|
|
1001
|
+
if (E.current !== e && p === "interpolate") {
|
|
1002
|
+
const f = ne(e);
|
|
1003
|
+
o(Ce(f.stops)), N(f.property), C([]);
|
|
794
1004
|
}
|
|
795
1005
|
E.current = e;
|
|
796
|
-
}, [e,
|
|
797
|
-
const
|
|
798
|
-
(
|
|
799
|
-
), m =
|
|
800
|
-
(
|
|
801
|
-
),
|
|
802
|
-
|
|
803
|
-
},
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
},
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
}, P = (
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
},
|
|
814
|
-
const D =
|
|
815
|
-
|
|
1006
|
+
}, [e, p]);
|
|
1007
|
+
const O = t.filter(
|
|
1008
|
+
(f) => !f.type || f.type === "string"
|
|
1009
|
+
), m = t.filter(
|
|
1010
|
+
(f) => f.type === "number" || f.type === "integer"
|
|
1011
|
+
), L = (f, D, I) => {
|
|
1012
|
+
i(ve(f, D, I));
|
|
1013
|
+
}, F = (f) => {
|
|
1014
|
+
L(f, d, w);
|
|
1015
|
+
}, b = (f) => {
|
|
1016
|
+
L(g, d, f);
|
|
1017
|
+
}, M = (f, D) => {
|
|
1018
|
+
const I = d.map((A, B) => B === f ? { ...A, value: D } : A);
|
|
1019
|
+
L(g, I, w);
|
|
1020
|
+
}, P = (f, D) => {
|
|
1021
|
+
const I = d.map((A, B) => B === f ? { ...A, color: D } : A);
|
|
1022
|
+
L(g, I, w);
|
|
1023
|
+
}, y = (f) => {
|
|
1024
|
+
const D = d.filter((I, A) => A !== f);
|
|
1025
|
+
L(g, D, w);
|
|
816
1026
|
}, k = () => {
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
},
|
|
1027
|
+
const f = [...d, { value: "", color: pe(d.length) }];
|
|
1028
|
+
L(g, f, w);
|
|
1029
|
+
}, j = async () => {
|
|
820
1030
|
if (!(!r || !g)) {
|
|
821
1031
|
x(!0);
|
|
822
1032
|
try {
|
|
823
|
-
const D = (await r(g)).map((
|
|
824
|
-
value:
|
|
825
|
-
color:
|
|
1033
|
+
const D = (await r(g)).map((I, A) => ({
|
|
1034
|
+
value: I,
|
|
1035
|
+
color: pe(A)
|
|
826
1036
|
}));
|
|
827
|
-
|
|
1037
|
+
L(g, D, w);
|
|
828
1038
|
} finally {
|
|
829
1039
|
x(!1);
|
|
830
1040
|
}
|
|
831
1041
|
}
|
|
832
|
-
}, R = (
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
835
|
-
const
|
|
836
|
-
|
|
1042
|
+
}, R = (f, D) => {
|
|
1043
|
+
const I = Ca(D);
|
|
1044
|
+
if (C(I), f && D.length >= 2 && I.every((A) => !A)) {
|
|
1045
|
+
const A = Sa(D);
|
|
1046
|
+
A && i(ke(f, A));
|
|
837
1047
|
}
|
|
838
|
-
},
|
|
839
|
-
N(
|
|
840
|
-
},
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
},
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
}, J = (
|
|
847
|
-
const D = c.filter((
|
|
848
|
-
|
|
1048
|
+
}, W = (f) => {
|
|
1049
|
+
N(f), R(f, c);
|
|
1050
|
+
}, U = (f, D) => {
|
|
1051
|
+
const I = c.map((A, B) => B === f ? { ...A, stopText: D } : A);
|
|
1052
|
+
o(I), R(h, I);
|
|
1053
|
+
}, G = (f, D) => {
|
|
1054
|
+
const I = c.map((A, B) => B === f ? { ...A, color: D } : A);
|
|
1055
|
+
o(I), R(h, I);
|
|
1056
|
+
}, J = (f) => {
|
|
1057
|
+
const D = c.filter((I, A) => A !== f);
|
|
1058
|
+
o(D), R(h, D);
|
|
849
1059
|
}, K = () => {
|
|
850
1060
|
var B;
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
}, Q = (
|
|
854
|
-
|
|
1061
|
+
const f = ((B = c[c.length - 1]) == null ? void 0 : B.stopText) ?? "0", D = parseFloat(f), I = isNaN(D) ? 0 : D + 10, A = [...c, { stopText: String(I), color: pe(c.length) }];
|
|
1062
|
+
o(A), R(h, A);
|
|
1063
|
+
}, Q = (f) => {
|
|
1064
|
+
u(f), f === "match" ? i(ve("", [], "#000000")) : (o([]), N(""), C([]), i(ke("", [])));
|
|
855
1065
|
};
|
|
856
1066
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
857
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((
|
|
1067
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((f) => /* @__PURE__ */ a(
|
|
858
1068
|
"button",
|
|
859
1069
|
{
|
|
860
1070
|
type: "button",
|
|
861
|
-
onClick: () => Q(
|
|
1071
|
+
onClick: () => Q(f),
|
|
862
1072
|
className: [
|
|
863
1073
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-xs mapui:capitalize mapui:outline-none",
|
|
864
1074
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
865
|
-
|
|
1075
|
+
p === f ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
866
1076
|
].join(" "),
|
|
867
|
-
children:
|
|
1077
|
+
children: f === "match" ? "Categorical" : "Gradient"
|
|
868
1078
|
},
|
|
869
|
-
|
|
1079
|
+
f
|
|
870
1080
|
)) }),
|
|
871
|
-
|
|
1081
|
+
p === "match" && /* @__PURE__ */ l(z, { children: [
|
|
872
1082
|
/* @__PURE__ */ l(
|
|
873
1083
|
"select",
|
|
874
1084
|
{
|
|
875
1085
|
value: g,
|
|
876
|
-
onChange: (
|
|
877
|
-
className:
|
|
1086
|
+
onChange: (f) => F(f.target.value),
|
|
1087
|
+
className: ae,
|
|
878
1088
|
children: [
|
|
879
1089
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
880
|
-
|
|
1090
|
+
O.map((f) => /* @__PURE__ */ a("option", { value: f.name, children: f.title ?? f.name }, f.name))
|
|
881
1091
|
]
|
|
882
1092
|
}
|
|
883
1093
|
),
|
|
884
|
-
|
|
1094
|
+
d.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: d.map((f, D) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
885
1095
|
/* @__PURE__ */ a(
|
|
886
1096
|
"input",
|
|
887
1097
|
{
|
|
888
1098
|
type: "text",
|
|
889
|
-
value:
|
|
890
|
-
onChange: (
|
|
1099
|
+
value: f.value,
|
|
1100
|
+
onChange: (I) => M(D, I.target.value),
|
|
891
1101
|
placeholder: "value",
|
|
892
|
-
className: `${
|
|
1102
|
+
className: `${ae} mapui:flex-1`
|
|
893
1103
|
}
|
|
894
1104
|
),
|
|
895
1105
|
/* @__PURE__ */ a(
|
|
896
|
-
|
|
1106
|
+
Z,
|
|
897
1107
|
{
|
|
898
|
-
value:
|
|
899
|
-
onChange: (
|
|
900
|
-
label: `Color for "${
|
|
1108
|
+
value: f.color,
|
|
1109
|
+
onChange: (I) => P(D, I),
|
|
1110
|
+
label: `Color for "${f.value}"`
|
|
901
1111
|
}
|
|
902
1112
|
),
|
|
903
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () =>
|
|
1113
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => y(D), className: Se, children: "×" })
|
|
904
1114
|
] }, D)) }),
|
|
905
1115
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
906
1116
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500 mapui:shrink-0", children: "Fallback:" }),
|
|
907
|
-
/* @__PURE__ */ a(
|
|
1117
|
+
/* @__PURE__ */ a(Z, { value: w, onChange: b, label: "Fallback color" })
|
|
908
1118
|
] }),
|
|
909
1119
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
910
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: k, className:
|
|
1120
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: k, className: ue, children: "+ Add value" }),
|
|
911
1121
|
r && g && /* @__PURE__ */ a(
|
|
912
1122
|
"button",
|
|
913
1123
|
{
|
|
914
1124
|
type: "button",
|
|
915
|
-
onClick:
|
|
916
|
-
disabled:
|
|
917
|
-
className:
|
|
918
|
-
children:
|
|
1125
|
+
onClick: j,
|
|
1126
|
+
disabled: n,
|
|
1127
|
+
className: ue,
|
|
1128
|
+
children: n ? "Loading…" : "Auto-populate"
|
|
919
1129
|
}
|
|
920
1130
|
)
|
|
921
1131
|
] })
|
|
922
1132
|
] }),
|
|
923
|
-
|
|
1133
|
+
p === "interpolate" && /* @__PURE__ */ l(z, { children: [
|
|
924
1134
|
/* @__PURE__ */ l(
|
|
925
1135
|
"select",
|
|
926
1136
|
{
|
|
927
|
-
value:
|
|
928
|
-
onChange: (
|
|
929
|
-
className:
|
|
1137
|
+
value: h,
|
|
1138
|
+
onChange: (f) => W(f.target.value),
|
|
1139
|
+
className: ae,
|
|
930
1140
|
children: [
|
|
931
1141
|
/* @__PURE__ */ a("option", { value: "", children: "Select a numeric property…" }),
|
|
932
|
-
m.map((
|
|
1142
|
+
m.map((f) => /* @__PURE__ */ a("option", { value: f.name, children: f.title ?? f.name }, f.name))
|
|
933
1143
|
]
|
|
934
1144
|
}
|
|
935
1145
|
),
|
|
936
|
-
c.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: c.map((
|
|
937
|
-
const
|
|
1146
|
+
c.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: c.map((f, D) => {
|
|
1147
|
+
const I = v[D];
|
|
938
1148
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
939
1149
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
940
1150
|
/* @__PURE__ */ a(
|
|
@@ -942,44 +1152,44 @@ function ha({
|
|
|
942
1152
|
{
|
|
943
1153
|
type: "text",
|
|
944
1154
|
inputMode: "numeric",
|
|
945
|
-
value:
|
|
946
|
-
onChange: (
|
|
1155
|
+
value: f.stopText,
|
|
1156
|
+
onChange: (A) => U(D, A.target.value),
|
|
947
1157
|
placeholder: "stop",
|
|
948
|
-
className: `${
|
|
1158
|
+
className: `${ae} mapui:w-24`
|
|
949
1159
|
}
|
|
950
1160
|
),
|
|
951
1161
|
/* @__PURE__ */ a(
|
|
952
|
-
|
|
1162
|
+
Z,
|
|
953
1163
|
{
|
|
954
|
-
value:
|
|
955
|
-
onChange: (
|
|
956
|
-
label: `Color at stop ${
|
|
1164
|
+
value: f.color,
|
|
1165
|
+
onChange: (A) => G(D, A),
|
|
1166
|
+
label: `Color at stop ${f.stopText}`
|
|
957
1167
|
}
|
|
958
1168
|
),
|
|
959
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () => J(D), className:
|
|
1169
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => J(D), className: Se, children: "×" })
|
|
960
1170
|
] }),
|
|
961
|
-
|
|
1171
|
+
I && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-500", children: I })
|
|
962
1172
|
] }, D);
|
|
963
1173
|
}) }),
|
|
964
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: K, className:
|
|
1174
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: K, className: ue, children: "+ Add stop" })
|
|
965
1175
|
] })
|
|
966
1176
|
] });
|
|
967
1177
|
}
|
|
968
|
-
const
|
|
969
|
-
function
|
|
1178
|
+
const Y = "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";
|
|
1179
|
+
function Da({
|
|
970
1180
|
value: e,
|
|
971
|
-
onChange:
|
|
1181
|
+
onChange: i
|
|
972
1182
|
}) {
|
|
973
|
-
const
|
|
1183
|
+
const t = (e == null ? void 0 : e[0]) ?? 0, r = (e == null ? void 0 : e[1]) ?? 0;
|
|
974
1184
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
975
1185
|
/* @__PURE__ */ a(
|
|
976
1186
|
"input",
|
|
977
1187
|
{
|
|
978
1188
|
type: "number",
|
|
979
1189
|
step: 0.5,
|
|
980
|
-
value:
|
|
981
|
-
onChange: (
|
|
982
|
-
className: `${
|
|
1190
|
+
value: t,
|
|
1191
|
+
onChange: (p) => i([parseFloat(p.target.value) || 0, r]),
|
|
1192
|
+
className: `${Y} mapui:w-20`,
|
|
983
1193
|
"aria-label": "X",
|
|
984
1194
|
placeholder: "X"
|
|
985
1195
|
}
|
|
@@ -990,19 +1200,19 @@ function ga({
|
|
|
990
1200
|
type: "number",
|
|
991
1201
|
step: 0.5,
|
|
992
1202
|
value: r,
|
|
993
|
-
onChange: (
|
|
994
|
-
className: `${
|
|
1203
|
+
onChange: (p) => i([t, parseFloat(p.target.value) || 0]),
|
|
1204
|
+
className: `${Y} mapui:w-20`,
|
|
995
1205
|
"aria-label": "Y",
|
|
996
1206
|
placeholder: "Y"
|
|
997
1207
|
}
|
|
998
1208
|
)
|
|
999
1209
|
] });
|
|
1000
1210
|
}
|
|
1001
|
-
function
|
|
1211
|
+
function La({
|
|
1002
1212
|
value: e,
|
|
1003
|
-
onChange:
|
|
1213
|
+
onChange: i
|
|
1004
1214
|
}) {
|
|
1005
|
-
const
|
|
1215
|
+
const t = e ?? 1;
|
|
1006
1216
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1007
1217
|
/* @__PURE__ */ a(
|
|
1008
1218
|
"input",
|
|
@@ -1011,26 +1221,26 @@ function ba({
|
|
|
1011
1221
|
min: 0,
|
|
1012
1222
|
max: 1,
|
|
1013
1223
|
step: 0.01,
|
|
1014
|
-
value:
|
|
1015
|
-
onChange: (r) =>
|
|
1224
|
+
value: t,
|
|
1225
|
+
onChange: (r) => i(parseFloat(r.target.value)),
|
|
1016
1226
|
className: "mapui:flex-1"
|
|
1017
1227
|
}
|
|
1018
1228
|
),
|
|
1019
|
-
/* @__PURE__ */ a("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children:
|
|
1229
|
+
/* @__PURE__ */ a("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children: t.toFixed(2) })
|
|
1020
1230
|
] });
|
|
1021
1231
|
}
|
|
1022
|
-
function
|
|
1232
|
+
function Te({
|
|
1023
1233
|
def: e,
|
|
1024
|
-
value:
|
|
1025
|
-
onChange:
|
|
1234
|
+
value: i,
|
|
1235
|
+
onChange: t,
|
|
1026
1236
|
availableIcons: r,
|
|
1027
|
-
availableProperties:
|
|
1028
|
-
onFetchDistinctValues:
|
|
1237
|
+
availableProperties: p,
|
|
1238
|
+
onFetchDistinctValues: u
|
|
1029
1239
|
}) {
|
|
1030
|
-
var
|
|
1240
|
+
var n, x;
|
|
1031
1241
|
switch (e.widget) {
|
|
1032
1242
|
case "color": {
|
|
1033
|
-
const s = Array.isArray(
|
|
1243
|
+
const s = Array.isArray(i), g = s ? i[i.length - 1] ?? "#000000" : "#000000";
|
|
1034
1244
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:w-full", children: [
|
|
1035
1245
|
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-end", children: /* @__PURE__ */ a(
|
|
1036
1246
|
"button",
|
|
@@ -1038,7 +1248,7 @@ function Se({
|
|
|
1038
1248
|
type: "button",
|
|
1039
1249
|
title: s ? "Switch to static color" : "Switch to data-driven color",
|
|
1040
1250
|
onClick: () => {
|
|
1041
|
-
|
|
1251
|
+
t(s ? g : ["match", ["get", ""], g]);
|
|
1042
1252
|
},
|
|
1043
1253
|
className: [
|
|
1044
1254
|
"mapui:cursor-pointer mapui:rounded mapui:border mapui:px-1.5 mapui:py-0.5 mapui:font-mono mapui:text-xs mapui:outline-none",
|
|
@@ -1049,18 +1259,18 @@ function Se({
|
|
|
1049
1259
|
}
|
|
1050
1260
|
) }),
|
|
1051
1261
|
s ? /* @__PURE__ */ a(
|
|
1052
|
-
|
|
1262
|
+
Ta,
|
|
1053
1263
|
{
|
|
1054
|
-
value:
|
|
1055
|
-
onChange: (
|
|
1056
|
-
availableProperties:
|
|
1057
|
-
onFetchDistinctValues:
|
|
1264
|
+
value: i,
|
|
1265
|
+
onChange: (d) => t(d),
|
|
1266
|
+
availableProperties: p,
|
|
1267
|
+
onFetchDistinctValues: u
|
|
1058
1268
|
}
|
|
1059
1269
|
) : /* @__PURE__ */ a(
|
|
1060
|
-
|
|
1270
|
+
Z,
|
|
1061
1271
|
{
|
|
1062
|
-
value:
|
|
1063
|
-
onChange:
|
|
1272
|
+
value: i ?? "#000000",
|
|
1273
|
+
onChange: t,
|
|
1064
1274
|
label: e.label
|
|
1065
1275
|
}
|
|
1066
1276
|
)
|
|
@@ -1068,10 +1278,10 @@ function Se({
|
|
|
1068
1278
|
}
|
|
1069
1279
|
case "opacity":
|
|
1070
1280
|
return /* @__PURE__ */ a(
|
|
1071
|
-
|
|
1281
|
+
La,
|
|
1072
1282
|
{
|
|
1073
|
-
value:
|
|
1074
|
-
onChange:
|
|
1283
|
+
value: i,
|
|
1284
|
+
onChange: t
|
|
1075
1285
|
}
|
|
1076
1286
|
);
|
|
1077
1287
|
case "number":
|
|
@@ -1082,9 +1292,9 @@ function Se({
|
|
|
1082
1292
|
min: e.min,
|
|
1083
1293
|
max: e.max,
|
|
1084
1294
|
step: e.step ?? 1,
|
|
1085
|
-
value:
|
|
1086
|
-
onChange: (s) =>
|
|
1087
|
-
className:
|
|
1295
|
+
value: i ?? e.min ?? 0,
|
|
1296
|
+
onChange: (s) => t(parseFloat(s.target.value) || 0),
|
|
1297
|
+
className: Y
|
|
1088
1298
|
}
|
|
1089
1299
|
);
|
|
1090
1300
|
case "boolean":
|
|
@@ -1092,8 +1302,8 @@ function Se({
|
|
|
1092
1302
|
"input",
|
|
1093
1303
|
{
|
|
1094
1304
|
type: "checkbox",
|
|
1095
|
-
checked:
|
|
1096
|
-
onChange: (s) =>
|
|
1305
|
+
checked: i ?? !1,
|
|
1306
|
+
onChange: (s) => t(s.target.checked),
|
|
1097
1307
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1098
1308
|
}
|
|
1099
1309
|
);
|
|
@@ -1101,44 +1311,44 @@ function Se({
|
|
|
1101
1311
|
return /* @__PURE__ */ a(
|
|
1102
1312
|
"select",
|
|
1103
1313
|
{
|
|
1104
|
-
value:
|
|
1105
|
-
onChange: (s) =>
|
|
1106
|
-
className:
|
|
1314
|
+
value: i ?? ((n = e.options) == null ? void 0 : n[0]) ?? "",
|
|
1315
|
+
onChange: (s) => t(s.target.value),
|
|
1316
|
+
className: Y,
|
|
1107
1317
|
children: (x = e.options) == null ? void 0 : x.map((s) => /* @__PURE__ */ a("option", { value: s, children: s }, s))
|
|
1108
1318
|
}
|
|
1109
1319
|
);
|
|
1110
1320
|
case "translate":
|
|
1111
1321
|
return /* @__PURE__ */ a(
|
|
1112
|
-
|
|
1322
|
+
Da,
|
|
1113
1323
|
{
|
|
1114
|
-
value:
|
|
1115
|
-
onChange:
|
|
1324
|
+
value: i,
|
|
1325
|
+
onChange: t
|
|
1116
1326
|
}
|
|
1117
1327
|
);
|
|
1118
1328
|
case "dasharray":
|
|
1119
1329
|
case "stringArray": {
|
|
1120
|
-
const s =
|
|
1330
|
+
const s = i, g = s ? s.join(", ") : "";
|
|
1121
1331
|
return /* @__PURE__ */ a(
|
|
1122
1332
|
"input",
|
|
1123
1333
|
{
|
|
1124
1334
|
type: "text",
|
|
1125
1335
|
value: g,
|
|
1126
|
-
onChange: (
|
|
1127
|
-
const w =
|
|
1336
|
+
onChange: (d) => {
|
|
1337
|
+
const w = d.target.value.trim();
|
|
1128
1338
|
if (!w) {
|
|
1129
|
-
|
|
1339
|
+
t(void 0);
|
|
1130
1340
|
return;
|
|
1131
1341
|
}
|
|
1132
1342
|
if (e.widget === "dasharray") {
|
|
1133
|
-
const c = w.split(",").map((
|
|
1134
|
-
|
|
1343
|
+
const c = w.split(",").map((o) => parseFloat(o.trim())).filter((o) => !isNaN(o));
|
|
1344
|
+
t(c.length > 0 ? c : void 0);
|
|
1135
1345
|
} else {
|
|
1136
|
-
const c = w.split(",").map((
|
|
1137
|
-
|
|
1346
|
+
const c = w.split(",").map((o) => o.trim()).filter(Boolean);
|
|
1347
|
+
t(c.length > 0 ? c : void 0);
|
|
1138
1348
|
}
|
|
1139
1349
|
},
|
|
1140
1350
|
placeholder: e.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
|
|
1141
|
-
className:
|
|
1351
|
+
className: Y
|
|
1142
1352
|
}
|
|
1143
1353
|
);
|
|
1144
1354
|
}
|
|
@@ -1147,17 +1357,17 @@ function Se({
|
|
|
1147
1357
|
"input",
|
|
1148
1358
|
{
|
|
1149
1359
|
type: "text",
|
|
1150
|
-
value:
|
|
1151
|
-
onChange: (s) =>
|
|
1152
|
-
className:
|
|
1360
|
+
value: i ?? "",
|
|
1361
|
+
onChange: (s) => t(s.target.value || void 0),
|
|
1362
|
+
className: Y
|
|
1153
1363
|
}
|
|
1154
1364
|
);
|
|
1155
1365
|
case "icon-image":
|
|
1156
1366
|
return /* @__PURE__ */ a(
|
|
1157
|
-
|
|
1367
|
+
Na,
|
|
1158
1368
|
{
|
|
1159
|
-
value:
|
|
1160
|
-
onChange: (s) =>
|
|
1369
|
+
value: i ?? "",
|
|
1370
|
+
onChange: (s) => t(s ?? void 0),
|
|
1161
1371
|
availableIcons: r
|
|
1162
1372
|
}
|
|
1163
1373
|
);
|
|
@@ -1165,135 +1375,135 @@ function Se({
|
|
|
1165
1375
|
return null;
|
|
1166
1376
|
}
|
|
1167
1377
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1378
|
+
function Aa({ def: e, value: i, onChange: t, availableIcons: r, availableProperties: p, onFetchDistinctValues: u }) {
|
|
1379
|
+
const n = e.enableDefault !== void 0, x = i !== void 0;
|
|
1380
|
+
if (n && e.widget === "boolean") {
|
|
1171
1381
|
const s = !e.enableDefault;
|
|
1172
|
-
return /* @__PURE__ */ a(
|
|
1382
|
+
return /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
1173
1383
|
"input",
|
|
1174
1384
|
{
|
|
1175
1385
|
type: "checkbox",
|
|
1176
|
-
checked:
|
|
1386
|
+
checked: i === s,
|
|
1177
1387
|
onChange: (g) => {
|
|
1178
|
-
|
|
1388
|
+
t(e.key, g.target.checked ? s : void 0);
|
|
1179
1389
|
},
|
|
1180
1390
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1181
1391
|
}
|
|
1182
1392
|
) });
|
|
1183
1393
|
}
|
|
1184
|
-
return
|
|
1394
|
+
return n ? /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1185
1395
|
/* @__PURE__ */ a(
|
|
1186
1396
|
"input",
|
|
1187
1397
|
{
|
|
1188
1398
|
type: "checkbox",
|
|
1189
1399
|
checked: x,
|
|
1190
1400
|
onChange: (s) => {
|
|
1191
|
-
|
|
1401
|
+
t(e.key, s.target.checked ? e.enableDefault : void 0);
|
|
1192
1402
|
},
|
|
1193
1403
|
className: "mapui:h-4 mapui:w-4 mapui:shrink-0 mapui:accent-blue-600"
|
|
1194
1404
|
}
|
|
1195
1405
|
),
|
|
1196
1406
|
x && /* @__PURE__ */ a(
|
|
1197
|
-
|
|
1407
|
+
Te,
|
|
1198
1408
|
{
|
|
1199
1409
|
def: e,
|
|
1200
|
-
value:
|
|
1201
|
-
onChange: (s) =>
|
|
1410
|
+
value: i,
|
|
1411
|
+
onChange: (s) => t(e.key, s),
|
|
1202
1412
|
availableIcons: r,
|
|
1203
|
-
availableProperties:
|
|
1204
|
-
onFetchDistinctValues:
|
|
1413
|
+
availableProperties: p,
|
|
1414
|
+
onFetchDistinctValues: u
|
|
1205
1415
|
}
|
|
1206
1416
|
)
|
|
1207
|
-
] }) }) : /* @__PURE__ */ a(
|
|
1208
|
-
|
|
1417
|
+
] }) }) : /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
1418
|
+
Te,
|
|
1209
1419
|
{
|
|
1210
1420
|
def: e,
|
|
1211
|
-
value:
|
|
1212
|
-
onChange: (s) =>
|
|
1421
|
+
value: i,
|
|
1422
|
+
onChange: (s) => t(e.key, s),
|
|
1213
1423
|
availableIcons: r,
|
|
1214
|
-
availableProperties:
|
|
1215
|
-
onFetchDistinctValues:
|
|
1424
|
+
availableProperties: p,
|
|
1425
|
+
onFetchDistinctValues: u
|
|
1216
1426
|
}
|
|
1217
1427
|
) });
|
|
1218
1428
|
}
|
|
1219
|
-
function
|
|
1429
|
+
function De({
|
|
1220
1430
|
title: e,
|
|
1221
|
-
properties:
|
|
1222
|
-
values:
|
|
1431
|
+
properties: i,
|
|
1432
|
+
values: t,
|
|
1223
1433
|
onChange: r,
|
|
1224
|
-
defaultOpen:
|
|
1225
|
-
availableIcons:
|
|
1226
|
-
availableProperties:
|
|
1434
|
+
defaultOpen: p = !1,
|
|
1435
|
+
availableIcons: u,
|
|
1436
|
+
availableProperties: n,
|
|
1227
1437
|
onFetchDistinctValues: x
|
|
1228
1438
|
}) {
|
|
1229
|
-
const s =
|
|
1230
|
-
(g) => g.enableDefault !== void 0 &&
|
|
1439
|
+
const s = i.filter(
|
|
1440
|
+
(g) => g.enableDefault !== void 0 && t[g.key] !== void 0
|
|
1231
1441
|
).length;
|
|
1232
|
-
return /* @__PURE__ */ a(X, { title: e, defaultOpen:
|
|
1233
|
-
|
|
1442
|
+
return /* @__PURE__ */ a(X, { title: e, defaultOpen: p, badge: s || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: i.map((g) => /* @__PURE__ */ a(
|
|
1443
|
+
Aa,
|
|
1234
1444
|
{
|
|
1235
1445
|
def: g,
|
|
1236
|
-
value:
|
|
1446
|
+
value: t[g.key],
|
|
1237
1447
|
onChange: r,
|
|
1238
|
-
availableIcons:
|
|
1239
|
-
availableProperties:
|
|
1448
|
+
availableIcons: u,
|
|
1449
|
+
availableProperties: n,
|
|
1240
1450
|
onFetchDistinctValues: x
|
|
1241
1451
|
},
|
|
1242
1452
|
g.key
|
|
1243
1453
|
)) }) });
|
|
1244
1454
|
}
|
|
1245
|
-
function
|
|
1455
|
+
function V(e) {
|
|
1246
1456
|
return Array.isArray(e);
|
|
1247
1457
|
}
|
|
1248
|
-
function
|
|
1458
|
+
function Ea(e) {
|
|
1249
1459
|
return e[0] === "match" ? "match" : e[0] === "interpolate" ? "interpolate" : null;
|
|
1250
1460
|
}
|
|
1251
|
-
function
|
|
1461
|
+
function We(e) {
|
|
1252
1462
|
if (e[0] === "match") {
|
|
1253
|
-
const
|
|
1463
|
+
const i = [];
|
|
1254
1464
|
for (let r = 3; r < e.length; r += 2)
|
|
1255
|
-
typeof e[r] == "string" &&
|
|
1256
|
-
const
|
|
1257
|
-
return typeof
|
|
1465
|
+
typeof e[r] == "string" && i.push(e[r]);
|
|
1466
|
+
const t = e[e.length - 1];
|
|
1467
|
+
return typeof t == "string" && i.push(t), i;
|
|
1258
1468
|
}
|
|
1259
1469
|
if (e[0] === "interpolate") {
|
|
1260
|
-
const
|
|
1261
|
-
for (let
|
|
1262
|
-
typeof e[
|
|
1263
|
-
return
|
|
1470
|
+
const i = [];
|
|
1471
|
+
for (let t = 4; t < e.length; t += 2)
|
|
1472
|
+
typeof e[t] == "string" && i.push(e[t]);
|
|
1473
|
+
return i;
|
|
1264
1474
|
}
|
|
1265
1475
|
return [];
|
|
1266
1476
|
}
|
|
1267
|
-
function
|
|
1477
|
+
function Ia(e) {
|
|
1268
1478
|
if (e[0] === "match") {
|
|
1269
|
-
const
|
|
1479
|
+
const i = [];
|
|
1270
1480
|
for (let r = 2; r < e.length - 1; r += 2) {
|
|
1271
|
-
const
|
|
1272
|
-
typeof
|
|
1481
|
+
const p = String(e[r]), u = e[r + 1];
|
|
1482
|
+
typeof u == "string" && i.push({ label: p, color: u });
|
|
1273
1483
|
}
|
|
1274
|
-
const
|
|
1275
|
-
return typeof
|
|
1484
|
+
const t = e[e.length - 1];
|
|
1485
|
+
return typeof t == "string" && i.push({ label: "Other", color: t }), i;
|
|
1276
1486
|
}
|
|
1277
1487
|
if (e[0] === "interpolate") {
|
|
1278
|
-
const
|
|
1279
|
-
for (let
|
|
1280
|
-
const r = String(e[
|
|
1281
|
-
typeof
|
|
1488
|
+
const i = [];
|
|
1489
|
+
for (let t = 3; t < e.length; t += 2) {
|
|
1490
|
+
const r = String(e[t]), p = e[t + 1];
|
|
1491
|
+
typeof p == "string" && i.push({ label: r, color: p });
|
|
1282
1492
|
}
|
|
1283
|
-
return
|
|
1493
|
+
return i;
|
|
1284
1494
|
}
|
|
1285
1495
|
return [];
|
|
1286
1496
|
}
|
|
1287
|
-
function
|
|
1288
|
-
const
|
|
1289
|
-
if (Array.isArray(
|
|
1290
|
-
if (
|
|
1291
|
-
if (
|
|
1292
|
-
return
|
|
1497
|
+
function Ma(e) {
|
|
1498
|
+
const i = e[0] === "match" ? e[1] : e[0] === "interpolate" ? e[2] : null;
|
|
1499
|
+
if (Array.isArray(i)) {
|
|
1500
|
+
if (i[0] === "get" && typeof i[1] == "string") return i[1];
|
|
1501
|
+
if (i[0] === "to-number" && Array.isArray(i[1]) && i[1][0] === "get")
|
|
1502
|
+
return i[1][1] ?? null;
|
|
1293
1503
|
}
|
|
1294
1504
|
return null;
|
|
1295
1505
|
}
|
|
1296
|
-
function
|
|
1506
|
+
function Fa(e) {
|
|
1297
1507
|
switch (e.type) {
|
|
1298
1508
|
case "fill":
|
|
1299
1509
|
return e.paint["fill-color"] ?? "#000000";
|
|
@@ -1305,7 +1515,7 @@ function Na(e) {
|
|
|
1305
1515
|
return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
|
|
1306
1516
|
}
|
|
1307
1517
|
}
|
|
1308
|
-
function
|
|
1518
|
+
function Pa(e) {
|
|
1309
1519
|
switch (e.type) {
|
|
1310
1520
|
case "fill":
|
|
1311
1521
|
return "square";
|
|
@@ -1316,34 +1526,34 @@ function va(e) {
|
|
|
1316
1526
|
return "circle";
|
|
1317
1527
|
}
|
|
1318
1528
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const
|
|
1321
|
-
if (
|
|
1529
|
+
function oe({ expr: e, height: i }) {
|
|
1530
|
+
const t = We(e);
|
|
1531
|
+
if (t.length === 0)
|
|
1322
1532
|
return /* @__PURE__ */ a(
|
|
1323
1533
|
"div",
|
|
1324
1534
|
{
|
|
1325
|
-
style: { width: "100%", height:
|
|
1535
|
+
style: { width: "100%", height: i ?? 32, background: "#e5e7eb", borderRadius: 4 },
|
|
1326
1536
|
title: "Expression (no preview)"
|
|
1327
1537
|
}
|
|
1328
1538
|
);
|
|
1329
|
-
const r = e[0] === "interpolate",
|
|
1539
|
+
const r = e[0] === "interpolate", p = r ? `linear-gradient(to right, ${t.join(", ")})` : t.map((u, n) => `${u} ${n / t.length * 100}% ${(n + 1) / t.length * 100}%`).join(", ");
|
|
1330
1540
|
return /* @__PURE__ */ a(
|
|
1331
1541
|
"div",
|
|
1332
1542
|
{
|
|
1333
1543
|
style: {
|
|
1334
1544
|
width: "100%",
|
|
1335
|
-
height:
|
|
1336
|
-
background: r ?
|
|
1545
|
+
height: i ?? 32,
|
|
1546
|
+
background: r ? p : `linear-gradient(to right, ${p})`,
|
|
1337
1547
|
borderRadius: 4
|
|
1338
1548
|
},
|
|
1339
1549
|
title: "Data-driven color expression"
|
|
1340
1550
|
}
|
|
1341
1551
|
);
|
|
1342
1552
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return typeof e == "string" ? e :
|
|
1553
|
+
function Le(e, i) {
|
|
1554
|
+
return typeof e == "string" ? e : V(e) ? We(e)[0] ?? i : i;
|
|
1345
1555
|
}
|
|
1346
|
-
function
|
|
1556
|
+
function Oa({ style: e }) {
|
|
1347
1557
|
if (e.type === "fill") {
|
|
1348
1558
|
const r = e.paint["fill-color"];
|
|
1349
1559
|
return /* @__PURE__ */ a(
|
|
@@ -1351,7 +1561,7 @@ function ka({ style: e }) {
|
|
|
1351
1561
|
{
|
|
1352
1562
|
className: "mapui:h-8 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:overflow-hidden",
|
|
1353
1563
|
"aria-label": "Style preview",
|
|
1354
|
-
children:
|
|
1564
|
+
children: V(r) ? /* @__PURE__ */ a(oe, { expr: r, height: 32 }) : /* @__PURE__ */ a(
|
|
1355
1565
|
"div",
|
|
1356
1566
|
{
|
|
1357
1567
|
style: {
|
|
@@ -1359,7 +1569,7 @@ function ka({ style: e }) {
|
|
|
1359
1569
|
height: "100%",
|
|
1360
1570
|
backgroundColor: r,
|
|
1361
1571
|
opacity: e.paint["fill-opacity"],
|
|
1362
|
-
outline: e.paint["fill-outline-color"] && !
|
|
1572
|
+
outline: e.paint["fill-outline-color"] && !V(e.paint["fill-outline-color"]) ? `2px solid ${e.paint["fill-outline-color"]}` : void 0
|
|
1363
1573
|
}
|
|
1364
1574
|
}
|
|
1365
1575
|
)
|
|
@@ -1373,7 +1583,7 @@ function ka({ style: e }) {
|
|
|
1373
1583
|
{
|
|
1374
1584
|
className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:rounded mapui:border mapui:border-gray-200 mapui:px-2",
|
|
1375
1585
|
"aria-label": "Style preview",
|
|
1376
|
-
children:
|
|
1586
|
+
children: V(r) ? /* @__PURE__ */ a(oe, { expr: r, height: e.paint["line-width"] }) : /* @__PURE__ */ a(
|
|
1377
1587
|
"div",
|
|
1378
1588
|
{
|
|
1379
1589
|
style: {
|
|
@@ -1388,29 +1598,29 @@ function ka({ style: e }) {
|
|
|
1388
1598
|
);
|
|
1389
1599
|
}
|
|
1390
1600
|
if (e.type === "circle") {
|
|
1391
|
-
const r = e.paint["circle-color"],
|
|
1601
|
+
const r = e.paint["circle-color"], p = e.paint["circle-radius"] * 2;
|
|
1392
1602
|
return /* @__PURE__ */ a(
|
|
1393
1603
|
"div",
|
|
1394
1604
|
{
|
|
1395
1605
|
className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
|
|
1396
1606
|
"aria-label": "Style preview",
|
|
1397
|
-
children:
|
|
1607
|
+
children: V(r) ? /* @__PURE__ */ a("div", { style: { width: p, height: p, borderRadius: "50%", overflow: "hidden" }, children: /* @__PURE__ */ a(oe, { expr: r, height: p }) }) : /* @__PURE__ */ a(
|
|
1398
1608
|
"div",
|
|
1399
1609
|
{
|
|
1400
1610
|
style: {
|
|
1401
|
-
width:
|
|
1402
|
-
height:
|
|
1611
|
+
width: p,
|
|
1612
|
+
height: p,
|
|
1403
1613
|
backgroundColor: r,
|
|
1404
1614
|
opacity: e.paint["circle-opacity"],
|
|
1405
1615
|
borderRadius: "50%",
|
|
1406
|
-
border: e.paint["circle-stroke-color"] && !
|
|
1616
|
+
border: e.paint["circle-stroke-color"] && !V(e.paint["circle-stroke-color"]) ? `${e.paint["circle-stroke-width"] ?? 1}px solid ${e.paint["circle-stroke-color"]}` : void 0
|
|
1407
1617
|
}
|
|
1408
1618
|
}
|
|
1409
1619
|
)
|
|
1410
1620
|
}
|
|
1411
1621
|
);
|
|
1412
1622
|
}
|
|
1413
|
-
const
|
|
1623
|
+
const i = Le(e.paint["text-color"], "#333333"), t = Le(e.paint["icon-color"], "#333333");
|
|
1414
1624
|
return /* @__PURE__ */ a(
|
|
1415
1625
|
"div",
|
|
1416
1626
|
{
|
|
@@ -1420,7 +1630,7 @@ function ka({ style: e }) {
|
|
|
1420
1630
|
"span",
|
|
1421
1631
|
{
|
|
1422
1632
|
style: {
|
|
1423
|
-
color:
|
|
1633
|
+
color: i ?? t ?? "#333333",
|
|
1424
1634
|
fontSize: "1.1rem",
|
|
1425
1635
|
fontWeight: 600
|
|
1426
1636
|
},
|
|
@@ -1430,7 +1640,7 @@ function ka({ style: e }) {
|
|
|
1430
1640
|
}
|
|
1431
1641
|
);
|
|
1432
1642
|
}
|
|
1433
|
-
const
|
|
1643
|
+
const ja = [
|
|
1434
1644
|
// Appearance (paint)
|
|
1435
1645
|
{ key: "fill-color", label: "Fill Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1436
1646
|
{ key: "fill-opacity", label: "Fill Opacity", widget: "opacity", group: "Appearance", category: "paint" },
|
|
@@ -1442,7 +1652,7 @@ const Ca = [
|
|
|
1442
1652
|
{ 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.' },
|
|
1443
1653
|
// Sorting (layout)
|
|
1444
1654
|
{ 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." }
|
|
1445
|
-
],
|
|
1655
|
+
], $a = [
|
|
1446
1656
|
// Appearance (paint)
|
|
1447
1657
|
{ key: "line-color", label: "Line Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1448
1658
|
{ key: "line-width", label: "Line Width", widget: "number", group: "Appearance", category: "paint", min: 0, step: 0.5 },
|
|
@@ -1463,7 +1673,7 @@ const Ca = [
|
|
|
1463
1673
|
{ 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.' },
|
|
1464
1674
|
// Sorting (layout)
|
|
1465
1675
|
{ 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." }
|
|
1466
|
-
],
|
|
1676
|
+
], Ra = [
|
|
1467
1677
|
// Appearance (paint)
|
|
1468
1678
|
{ key: "circle-color", label: "Circle Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1469
1679
|
{ key: "circle-radius", label: "Radius", widget: "number", group: "Appearance", category: "paint", min: 0, step: 1 },
|
|
@@ -1481,7 +1691,7 @@ const Ca = [
|
|
|
1481
1691
|
{ 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).' },
|
|
1482
1692
|
// Sorting (layout)
|
|
1483
1693
|
{ 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." }
|
|
1484
|
-
],
|
|
1694
|
+
], Ba = [
|
|
1485
1695
|
// Icon Appearance (paint)
|
|
1486
1696
|
{ key: "icon-color", label: "Icon Color", widget: "color", group: "Icon Appearance", category: "paint", enableDefault: "#000000" },
|
|
1487
1697
|
{ key: "icon-opacity", label: "Icon Opacity", widget: "opacity", group: "Icon Appearance", category: "paint", enableDefault: 1 },
|
|
@@ -1530,194 +1740,194 @@ const Ca = [
|
|
|
1530
1740
|
{ 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." },
|
|
1531
1741
|
{ 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." },
|
|
1532
1742
|
{ 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.' }
|
|
1533
|
-
],
|
|
1534
|
-
fill:
|
|
1535
|
-
line:
|
|
1536
|
-
circle:
|
|
1537
|
-
symbol:
|
|
1743
|
+
], za = {
|
|
1744
|
+
fill: ja,
|
|
1745
|
+
line: $a,
|
|
1746
|
+
circle: Ra,
|
|
1747
|
+
symbol: Ba
|
|
1538
1748
|
};
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1749
|
+
function Ua(e) {
|
|
1750
|
+
return za[e] ?? [];
|
|
1541
1751
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const
|
|
1544
|
-
for (const
|
|
1545
|
-
t
|
|
1546
|
-
return
|
|
1752
|
+
function Ae(e) {
|
|
1753
|
+
const i = {};
|
|
1754
|
+
for (const t of e)
|
|
1755
|
+
i[t.group] || (i[t.group] = []), i[t.group].push(t);
|
|
1756
|
+
return i;
|
|
1547
1757
|
}
|
|
1548
1758
|
const ge = {
|
|
1549
1759
|
type: "fill",
|
|
1550
1760
|
paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 }
|
|
1551
|
-
},
|
|
1761
|
+
}, Ga = {
|
|
1552
1762
|
type: "line",
|
|
1553
1763
|
paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
|
|
1554
|
-
},
|
|
1764
|
+
}, _e = {
|
|
1555
1765
|
type: "circle",
|
|
1556
1766
|
paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
|
|
1557
|
-
},
|
|
1767
|
+
}, qa = {
|
|
1558
1768
|
type: "symbol",
|
|
1559
1769
|
paint: { "text-color": "#333333" },
|
|
1560
1770
|
layout: { "text-field": "{name}", "text-size": 14 }
|
|
1561
|
-
},
|
|
1771
|
+
}, Wa = {
|
|
1562
1772
|
layout: { "icon-image": "" }
|
|
1563
1773
|
};
|
|
1564
|
-
function
|
|
1774
|
+
function Ee(e) {
|
|
1565
1775
|
if (e.type !== "symbol") return "text";
|
|
1566
|
-
const
|
|
1567
|
-
return
|
|
1776
|
+
const i = e.layout ?? {}, t = "icon-image" in i, r = "text-field" in i;
|
|
1777
|
+
return t && r ? "both" : t ? "icon" : "text";
|
|
1568
1778
|
}
|
|
1569
|
-
const
|
|
1779
|
+
const _a = "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", ie = {
|
|
1570
1780
|
fill: "Fill",
|
|
1571
1781
|
line: "Line",
|
|
1572
1782
|
circle: "Circle",
|
|
1573
1783
|
symbol: "Symbol"
|
|
1574
|
-
},
|
|
1575
|
-
function
|
|
1576
|
-
const x = r ?? (
|
|
1577
|
-
|
|
1578
|
-
g(
|
|
1784
|
+
}, Va = ["text", "icon", "both"];
|
|
1785
|
+
function Ha({ value: e, onChange: i, suggestedType: t, suggestedTypes: r, availableIcons: p, availableProperties: u, onFetchDistinctValues: n }) {
|
|
1786
|
+
const x = r ?? (t ? [t] : []), [s, g] = T(() => Ee(e));
|
|
1787
|
+
q(() => {
|
|
1788
|
+
g(Ee(e));
|
|
1579
1789
|
}, [e.type]);
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
}, w = (
|
|
1583
|
-
if (
|
|
1584
|
-
const
|
|
1585
|
-
let
|
|
1586
|
-
|
|
1790
|
+
const d = (b) => {
|
|
1791
|
+
i(b === "fill" ? ge : b === "line" ? Ga : b === "circle" ? _e : qa);
|
|
1792
|
+
}, w = (b) => {
|
|
1793
|
+
if (b === s) return;
|
|
1794
|
+
const M = e.paint ?? {}, P = e.layout ?? {};
|
|
1795
|
+
let y = { ...M }, k = { ...P };
|
|
1796
|
+
b === "icon" ? (y = Object.fromEntries(Object.entries(y).filter(([j]) => !j.startsWith("text-"))), k = Object.fromEntries(Object.entries(k).filter(([j]) => !j.startsWith("text-"))), "icon-image" in k || (k["icon-image"] = Wa.layout["icon-image"])) : b === "text" && (y = Object.fromEntries(Object.entries(y).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 y || (y["text-color"] = "#333333")), g(b), i({
|
|
1587
1797
|
...e,
|
|
1588
|
-
paint:
|
|
1798
|
+
paint: y,
|
|
1589
1799
|
layout: Object.keys(k).length > 0 ? k : void 0
|
|
1590
1800
|
});
|
|
1591
|
-
}, c = (
|
|
1592
|
-
const P = { ...e.paint, [
|
|
1593
|
-
for (const
|
|
1594
|
-
P[
|
|
1595
|
-
|
|
1596
|
-
},
|
|
1597
|
-
const
|
|
1598
|
-
for (const k of Object.keys(
|
|
1599
|
-
|
|
1600
|
-
|
|
1801
|
+
}, c = (b, M) => {
|
|
1802
|
+
const P = { ...e.paint, [b]: M };
|
|
1803
|
+
for (const y of Object.keys(P))
|
|
1804
|
+
P[y] === void 0 && delete P[y];
|
|
1805
|
+
i({ ...e, paint: P });
|
|
1806
|
+
}, o = (b, M) => {
|
|
1807
|
+
const y = { ...e.layout ?? {}, [b]: M };
|
|
1808
|
+
for (const k of Object.keys(y))
|
|
1809
|
+
y[k] === void 0 && delete y[k];
|
|
1810
|
+
i({
|
|
1601
1811
|
...e,
|
|
1602
|
-
layout: Object.keys(
|
|
1812
|
+
layout: Object.keys(y).length > 0 ? y : void 0
|
|
1603
1813
|
});
|
|
1604
1814
|
};
|
|
1605
|
-
let
|
|
1606
|
-
e.type === "symbol" && (s === "text" ?
|
|
1607
|
-
const N =
|
|
1815
|
+
let h = Ua(e.type);
|
|
1816
|
+
e.type === "symbol" && (s === "text" ? h = h.filter((b) => !b.key.startsWith("icon-")) : s === "icon" && (h = h.filter((b) => !b.key.startsWith("text-"))));
|
|
1817
|
+
const N = h.filter((b) => b.category === "paint"), v = h.filter((b) => b.category === "layout"), C = Ae(N), E = Ae(v), O = e.paint, m = e.layout ?? {}, L = Object.keys(C), F = Object.keys(E);
|
|
1608
1818
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1609
1819
|
x.length > 0 && !x.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: [
|
|
1610
1820
|
/* @__PURE__ */ l("span", { children: [
|
|
1611
1821
|
"Detected geometry is suitable for",
|
|
1612
1822
|
" ",
|
|
1613
|
-
x.map((
|
|
1614
|
-
|
|
1615
|
-
/* @__PURE__ */ a("strong", { children:
|
|
1616
|
-
] },
|
|
1823
|
+
x.map((b, M) => /* @__PURE__ */ l("span", { children: [
|
|
1824
|
+
M > 0 && (M === x.length - 1 ? " or " : ", "),
|
|
1825
|
+
/* @__PURE__ */ a("strong", { children: ie[b] })
|
|
1826
|
+
] }, b)),
|
|
1617
1827
|
" ",
|
|
1618
1828
|
"style."
|
|
1619
1829
|
] }),
|
|
1620
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: x.map((
|
|
1830
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: x.map((b) => /* @__PURE__ */ a(
|
|
1621
1831
|
"button",
|
|
1622
1832
|
{
|
|
1623
1833
|
type: "button",
|
|
1624
|
-
onClick: () =>
|
|
1834
|
+
onClick: () => d(b),
|
|
1625
1835
|
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",
|
|
1626
|
-
children:
|
|
1836
|
+
children: ie[b]
|
|
1627
1837
|
},
|
|
1628
|
-
|
|
1838
|
+
b
|
|
1629
1839
|
)) })
|
|
1630
1840
|
] }),
|
|
1631
|
-
/* @__PURE__ */ a(
|
|
1841
|
+
/* @__PURE__ */ a(S, { label: "Style Type", children: /* @__PURE__ */ a(
|
|
1632
1842
|
"select",
|
|
1633
1843
|
{
|
|
1634
1844
|
value: e.type,
|
|
1635
|
-
onChange: (
|
|
1636
|
-
className:
|
|
1637
|
-
children: Object.keys(
|
|
1845
|
+
onChange: (b) => d(b.target.value),
|
|
1846
|
+
className: _a,
|
|
1847
|
+
children: Object.keys(ie).map((b) => /* @__PURE__ */ a("option", { value: b, children: ie[b] }, b))
|
|
1638
1848
|
}
|
|
1639
1849
|
) }),
|
|
1640
|
-
e.type === "symbol" && /* @__PURE__ */ a(
|
|
1850
|
+
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: Va.map((b) => /* @__PURE__ */ a(
|
|
1641
1851
|
"button",
|
|
1642
1852
|
{
|
|
1643
1853
|
type: "button",
|
|
1644
|
-
onClick: () => w(
|
|
1854
|
+
onClick: () => w(b),
|
|
1645
1855
|
className: [
|
|
1646
1856
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-sm mapui:capitalize mapui:outline-none",
|
|
1647
1857
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
1648
|
-
s ===
|
|
1858
|
+
s === b ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
1649
1859
|
].join(" "),
|
|
1650
|
-
children:
|
|
1860
|
+
children: b === "both" ? "Both" : b.charAt(0).toUpperCase() + b.slice(1)
|
|
1651
1861
|
},
|
|
1652
|
-
|
|
1862
|
+
b
|
|
1653
1863
|
)) }) }),
|
|
1654
1864
|
/* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
|
|
1655
1865
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
|
|
1656
|
-
/* @__PURE__ */ a(
|
|
1866
|
+
/* @__PURE__ */ a(Oa, { style: e })
|
|
1657
1867
|
] }),
|
|
1658
|
-
|
|
1868
|
+
F.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1659
1869
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
|
|
1660
|
-
|
|
1661
|
-
|
|
1870
|
+
F.map((b, M) => /* @__PURE__ */ a(
|
|
1871
|
+
De,
|
|
1662
1872
|
{
|
|
1663
|
-
title:
|
|
1664
|
-
properties: E[
|
|
1873
|
+
title: b,
|
|
1874
|
+
properties: E[b],
|
|
1665
1875
|
values: m,
|
|
1666
|
-
onChange:
|
|
1667
|
-
defaultOpen:
|
|
1668
|
-
availableIcons:
|
|
1669
|
-
availableProperties:
|
|
1670
|
-
onFetchDistinctValues:
|
|
1876
|
+
onChange: o,
|
|
1877
|
+
defaultOpen: M === 0,
|
|
1878
|
+
availableIcons: p,
|
|
1879
|
+
availableProperties: u,
|
|
1880
|
+
onFetchDistinctValues: n
|
|
1671
1881
|
},
|
|
1672
|
-
|
|
1882
|
+
b
|
|
1673
1883
|
))
|
|
1674
1884
|
] }),
|
|
1675
|
-
|
|
1885
|
+
L.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1676
1886
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
|
|
1677
|
-
|
|
1678
|
-
|
|
1887
|
+
L.map((b) => /* @__PURE__ */ a(
|
|
1888
|
+
De,
|
|
1679
1889
|
{
|
|
1680
|
-
title:
|
|
1681
|
-
properties:
|
|
1682
|
-
values:
|
|
1890
|
+
title: b,
|
|
1891
|
+
properties: C[b],
|
|
1892
|
+
values: O,
|
|
1683
1893
|
onChange: c,
|
|
1684
1894
|
defaultOpen: !1,
|
|
1685
|
-
availableIcons:
|
|
1686
|
-
availableProperties:
|
|
1687
|
-
onFetchDistinctValues:
|
|
1895
|
+
availableIcons: p,
|
|
1896
|
+
availableProperties: u,
|
|
1897
|
+
onFetchDistinctValues: n
|
|
1688
1898
|
},
|
|
1689
|
-
|
|
1899
|
+
b
|
|
1690
1900
|
))
|
|
1691
1901
|
] })
|
|
1692
1902
|
] });
|
|
1693
1903
|
}
|
|
1694
|
-
const
|
|
1695
|
-
function
|
|
1904
|
+
const Ie = "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";
|
|
1905
|
+
function Ya({ value: e, onChange: i }) {
|
|
1696
1906
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1697
|
-
/* @__PURE__ */ a(
|
|
1907
|
+
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
1698
1908
|
"input",
|
|
1699
1909
|
{
|
|
1700
1910
|
type: "text",
|
|
1701
1911
|
value: e.label,
|
|
1702
|
-
onChange: (
|
|
1912
|
+
onChange: (t) => i({ ...e, label: t.target.value }),
|
|
1703
1913
|
placeholder: "Legend entry label",
|
|
1704
|
-
className:
|
|
1914
|
+
className: Ie
|
|
1705
1915
|
}
|
|
1706
1916
|
) }),
|
|
1707
|
-
/* @__PURE__ */ a(
|
|
1708
|
-
|
|
1917
|
+
/* @__PURE__ */ a(S, { label: "Color", children: /* @__PURE__ */ a(
|
|
1918
|
+
Z,
|
|
1709
1919
|
{
|
|
1710
1920
|
value: e.color,
|
|
1711
|
-
onChange: (
|
|
1921
|
+
onChange: (t) => i({ ...e, color: t }),
|
|
1712
1922
|
label: "Entry color"
|
|
1713
1923
|
}
|
|
1714
1924
|
) }),
|
|
1715
|
-
/* @__PURE__ */ a(
|
|
1925
|
+
/* @__PURE__ */ a(S, { label: "Shape", children: /* @__PURE__ */ l(
|
|
1716
1926
|
"select",
|
|
1717
1927
|
{
|
|
1718
1928
|
value: e.shape ?? "square",
|
|
1719
|
-
onChange: (
|
|
1720
|
-
className:
|
|
1929
|
+
onChange: (t) => i({ ...e, shape: t.target.value }),
|
|
1930
|
+
className: Ie,
|
|
1721
1931
|
children: [
|
|
1722
1932
|
/* @__PURE__ */ a("option", { value: "square", children: "Square" }),
|
|
1723
1933
|
/* @__PURE__ */ a("option", { value: "circle", children: "Circle" }),
|
|
@@ -1727,43 +1937,43 @@ function ja({ value: e, onChange: t }) {
|
|
|
1727
1937
|
) })
|
|
1728
1938
|
] });
|
|
1729
1939
|
}
|
|
1730
|
-
const
|
|
1731
|
-
function
|
|
1732
|
-
const r = (e == null ? void 0 : e.entries) ?? [],
|
|
1733
|
-
if (!
|
|
1940
|
+
const Me = () => ({ label: "", color: "#4a90d9", shape: "square" }), me = 8, Fe = "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";
|
|
1941
|
+
function Xa({ value: e, onChange: i, styles: t }) {
|
|
1942
|
+
const r = (e == null ? void 0 : e.entries) ?? [], p = (e == null ? void 0 : e.displayMode) ?? "simple", u = Ue(() => {
|
|
1943
|
+
if (!t || t.length === 0) return null;
|
|
1734
1944
|
const c = [];
|
|
1735
|
-
let
|
|
1736
|
-
for (const N of
|
|
1737
|
-
const v =
|
|
1738
|
-
if (
|
|
1739
|
-
const E =
|
|
1945
|
+
let o = "simple", h = null;
|
|
1946
|
+
for (const N of t) {
|
|
1947
|
+
const v = Fa(N), C = Pa(N);
|
|
1948
|
+
if (V(v)) {
|
|
1949
|
+
const E = Ea(v);
|
|
1740
1950
|
if (!E) continue;
|
|
1741
|
-
const
|
|
1742
|
-
c.push(...
|
|
1743
|
-
} else typeof v == "string" && c.length === 0 && c.push({ label: N.type, color: v, shape:
|
|
1951
|
+
const O = Ia(v).map((m) => ({ label: m.label, color: m.color, shape: C }));
|
|
1952
|
+
c.push(...O), E === "interpolate" ? (o = "gradient", h || (h = Ma(v))) : o === "simple" && (o = "categorical");
|
|
1953
|
+
} else typeof v == "string" && c.length === 0 && c.push({ label: N.type, color: v, shape: C });
|
|
1744
1954
|
}
|
|
1745
|
-
return c.length === 0 ? null : { entries: c, mode:
|
|
1746
|
-
}, [
|
|
1747
|
-
|
|
1748
|
-
}, x = (c,
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1955
|
+
return c.length === 0 ? null : { entries: c, mode: o, property: h };
|
|
1956
|
+
}, [t]), n = () => {
|
|
1957
|
+
i({ ...e, entries: [...r, Me()] });
|
|
1958
|
+
}, x = (c, o) => {
|
|
1959
|
+
const h = r.map((N, v) => v === c ? o : N);
|
|
1960
|
+
i({ ...e, entries: h });
|
|
1751
1961
|
}, s = (c) => {
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1962
|
+
const o = r.filter((h, N) => N !== c);
|
|
1963
|
+
i(o.length > 0 ? { ...e, entries: o } : void 0);
|
|
1754
1964
|
}, g = (c) => {
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1757
|
-
|
|
1758
|
-
entries:
|
|
1759
|
-
displayMode:
|
|
1760
|
-
...
|
|
1761
|
-
...
|
|
1965
|
+
i(c ? { entries: [Me()] } : void 0);
|
|
1966
|
+
}, d = () => {
|
|
1967
|
+
u && i({
|
|
1968
|
+
entries: u.entries,
|
|
1969
|
+
displayMode: u.mode,
|
|
1970
|
+
...u.mode === "gradient" && u.property ? { gradientProperty: u.property } : {},
|
|
1971
|
+
...u.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
|
|
1762
1972
|
});
|
|
1763
1973
|
}, w = (c) => {
|
|
1764
1974
|
if (!e) return;
|
|
1765
|
-
const
|
|
1766
|
-
c !== "categorical" && delete
|
|
1975
|
+
const o = { ...e, displayMode: c };
|
|
1976
|
+
c !== "categorical" && delete o.showLabelsCollapsed, c !== "categorical" && c !== "gradient" && delete o.showColorBar, c !== "gradient" && delete o.gradientProperty, c === "simple" && delete o.showDisclosureArrow, i(o);
|
|
1767
1977
|
};
|
|
1768
1978
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1769
1979
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -1779,10 +1989,10 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1779
1989
|
),
|
|
1780
1990
|
/* @__PURE__ */ a("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
|
|
1781
1991
|
] }),
|
|
1782
|
-
e === void 0 &&
|
|
1783
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children:
|
|
1992
|
+
e === void 0 && u && u.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
1993
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: u.mode !== "simple" ? `This layer uses data-driven colors (${u.entries.length} ${u.entries.length === 1 ? "category" : "categories"})` : `This layer has ${u.entries.length} style ${u.entries.length === 1 ? "color" : "colors"}` }),
|
|
1784
1994
|
/* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
|
|
1785
|
-
|
|
1995
|
+
u.entries.slice(0, me).map((c, o) => /* @__PURE__ */ l(
|
|
1786
1996
|
"div",
|
|
1787
1997
|
{
|
|
1788
1998
|
className: "mapui:flex mapui:items-center mapui:gap-1",
|
|
@@ -1798,11 +2008,11 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1798
2008
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children: c.label })
|
|
1799
2009
|
]
|
|
1800
2010
|
},
|
|
1801
|
-
`${c.label}-${
|
|
2011
|
+
`${c.label}-${o}`
|
|
1802
2012
|
)),
|
|
1803
|
-
|
|
2013
|
+
u.entries.length > me && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
|
|
1804
2014
|
"+",
|
|
1805
|
-
|
|
2015
|
+
u.entries.length - me,
|
|
1806
2016
|
" more"
|
|
1807
2017
|
] })
|
|
1808
2018
|
] }),
|
|
@@ -1810,20 +2020,20 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1810
2020
|
"button",
|
|
1811
2021
|
{
|
|
1812
2022
|
type: "button",
|
|
1813
|
-
onClick:
|
|
2023
|
+
onClick: d,
|
|
1814
2024
|
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",
|
|
1815
2025
|
children: "Generate from Style"
|
|
1816
2026
|
}
|
|
1817
2027
|
)
|
|
1818
2028
|
] }),
|
|
1819
|
-
e !== void 0 && /* @__PURE__ */ l(
|
|
2029
|
+
e !== void 0 && /* @__PURE__ */ l(z, { children: [
|
|
1820
2030
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1821
2031
|
/* @__PURE__ */ a("label", { htmlFor: "legend-display-mode", className: "mapui:text-sm mapui:text-gray-700", children: "Display Mode" }),
|
|
1822
2032
|
/* @__PURE__ */ l(
|
|
1823
2033
|
"select",
|
|
1824
2034
|
{
|
|
1825
2035
|
id: "legend-display-mode",
|
|
1826
|
-
value:
|
|
2036
|
+
value: p,
|
|
1827
2037
|
onChange: (c) => w(c.target.value),
|
|
1828
2038
|
className: Fe,
|
|
1829
2039
|
children: [
|
|
@@ -1834,46 +2044,46 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1834
2044
|
}
|
|
1835
2045
|
)
|
|
1836
2046
|
] }),
|
|
1837
|
-
|
|
2047
|
+
p === "categorical" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1838
2048
|
/* @__PURE__ */ a(
|
|
1839
2049
|
"input",
|
|
1840
2050
|
{
|
|
1841
2051
|
type: "checkbox",
|
|
1842
2052
|
id: "legend-show-labels-collapsed",
|
|
1843
2053
|
checked: e.showLabelsCollapsed ?? !1,
|
|
1844
|
-
onChange: (c) =>
|
|
2054
|
+
onChange: (c) => i({ ...e, showLabelsCollapsed: c.target.checked }),
|
|
1845
2055
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1846
2056
|
}
|
|
1847
2057
|
),
|
|
1848
2058
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-labels-collapsed", className: "mapui:text-sm mapui:text-gray-700", children: "Show labels in collapsed view" })
|
|
1849
2059
|
] }),
|
|
1850
|
-
(
|
|
2060
|
+
(p === "categorical" || p === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1851
2061
|
/* @__PURE__ */ a(
|
|
1852
2062
|
"input",
|
|
1853
2063
|
{
|
|
1854
2064
|
type: "checkbox",
|
|
1855
2065
|
id: "legend-show-color-bar",
|
|
1856
2066
|
checked: e.showColorBar !== !1,
|
|
1857
|
-
onChange: (c) =>
|
|
2067
|
+
onChange: (c) => i({ ...e, showColorBar: c.target.checked }),
|
|
1858
2068
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1859
2069
|
}
|
|
1860
2070
|
),
|
|
1861
2071
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-color-bar", className: "mapui:text-sm mapui:text-gray-700", children: "Show color bar" })
|
|
1862
2072
|
] }),
|
|
1863
|
-
(
|
|
2073
|
+
(p === "categorical" || p === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1864
2074
|
/* @__PURE__ */ a(
|
|
1865
2075
|
"input",
|
|
1866
2076
|
{
|
|
1867
2077
|
type: "checkbox",
|
|
1868
2078
|
id: "legend-show-disclosure-arrow",
|
|
1869
2079
|
checked: e.showDisclosureArrow !== !1,
|
|
1870
|
-
onChange: (c) =>
|
|
2080
|
+
onChange: (c) => i({ ...e, showDisclosureArrow: c.target.checked }),
|
|
1871
2081
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1872
2082
|
}
|
|
1873
2083
|
),
|
|
1874
2084
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-disclosure-arrow", className: "mapui:text-sm mapui:text-gray-700", children: "Show disclosure arrow" })
|
|
1875
2085
|
] }),
|
|
1876
|
-
|
|
2086
|
+
p === "gradient" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1877
2087
|
/* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Label" }),
|
|
1878
2088
|
/* @__PURE__ */ a(
|
|
1879
2089
|
"input",
|
|
@@ -1881,13 +2091,13 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1881
2091
|
type: "text",
|
|
1882
2092
|
id: "legend-gradient-property",
|
|
1883
2093
|
value: e.gradientProperty ?? "",
|
|
1884
|
-
onChange: (c) =>
|
|
2094
|
+
onChange: (c) => i({ ...e, gradientProperty: c.target.value || void 0 }),
|
|
1885
2095
|
placeholder: "e.g. Population",
|
|
1886
2096
|
className: Fe
|
|
1887
2097
|
}
|
|
1888
2098
|
)
|
|
1889
2099
|
] }),
|
|
1890
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: r.map((c,
|
|
2100
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: r.map((c, o) => /* @__PURE__ */ l(
|
|
1891
2101
|
"li",
|
|
1892
2102
|
{
|
|
1893
2103
|
className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:p-3",
|
|
@@ -1895,48 +2105,48 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1895
2105
|
/* @__PURE__ */ l("div", { className: "mapui:mb-2 mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
1896
2106
|
/* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: [
|
|
1897
2107
|
"Entry ",
|
|
1898
|
-
|
|
2108
|
+
o + 1
|
|
1899
2109
|
] }),
|
|
1900
2110
|
/* @__PURE__ */ a(
|
|
1901
2111
|
"button",
|
|
1902
2112
|
{
|
|
1903
2113
|
type: "button",
|
|
1904
|
-
onClick: () => s(
|
|
2114
|
+
onClick: () => s(o),
|
|
1905
2115
|
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",
|
|
1906
2116
|
children: "Remove"
|
|
1907
2117
|
}
|
|
1908
2118
|
)
|
|
1909
2119
|
] }),
|
|
1910
2120
|
/* @__PURE__ */ a(
|
|
1911
|
-
|
|
2121
|
+
Ya,
|
|
1912
2122
|
{
|
|
1913
2123
|
value: c,
|
|
1914
|
-
onChange: (
|
|
2124
|
+
onChange: (h) => x(o, h)
|
|
1915
2125
|
}
|
|
1916
2126
|
)
|
|
1917
2127
|
]
|
|
1918
2128
|
},
|
|
1919
|
-
|
|
2129
|
+
o
|
|
1920
2130
|
)) }),
|
|
1921
2131
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
1922
2132
|
/* @__PURE__ */ a(
|
|
1923
2133
|
"button",
|
|
1924
2134
|
{
|
|
1925
2135
|
type: "button",
|
|
1926
|
-
onClick:
|
|
2136
|
+
onClick: n,
|
|
1927
2137
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
1928
2138
|
children: "+ Add Entry"
|
|
1929
2139
|
}
|
|
1930
2140
|
),
|
|
1931
|
-
|
|
2141
|
+
u && u.entries.length > 0 && /* @__PURE__ */ l(
|
|
1932
2142
|
"button",
|
|
1933
2143
|
{
|
|
1934
2144
|
type: "button",
|
|
1935
|
-
onClick:
|
|
2145
|
+
onClick: d,
|
|
1936
2146
|
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",
|
|
1937
2147
|
children: [
|
|
1938
2148
|
"Populate from Style (",
|
|
1939
|
-
|
|
2149
|
+
u.entries.length,
|
|
1940
2150
|
" entries)"
|
|
1941
2151
|
]
|
|
1942
2152
|
}
|
|
@@ -1945,46 +2155,46 @@ function $a({ value: e, onChange: t, styles: i }) {
|
|
|
1945
2155
|
] })
|
|
1946
2156
|
] });
|
|
1947
2157
|
}
|
|
1948
|
-
function
|
|
2158
|
+
function Pe({
|
|
1949
2159
|
options: e,
|
|
1950
|
-
onChange:
|
|
1951
|
-
placeholder:
|
|
2160
|
+
onChange: i,
|
|
2161
|
+
placeholder: t,
|
|
1952
2162
|
className: r
|
|
1953
2163
|
}) {
|
|
1954
|
-
const [
|
|
1955
|
-
return
|
|
1956
|
-
|
|
2164
|
+
const [p, u] = T(() => (e == null ? void 0 : e.join(", ")) ?? "");
|
|
2165
|
+
return q(() => {
|
|
2166
|
+
u((e == null ? void 0 : e.join(", ")) ?? "");
|
|
1957
2167
|
}, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
|
|
1958
2168
|
"input",
|
|
1959
2169
|
{
|
|
1960
2170
|
type: "text",
|
|
1961
|
-
value:
|
|
1962
|
-
onChange: (x) =>
|
|
2171
|
+
value: p,
|
|
2172
|
+
onChange: (x) => u(x.target.value),
|
|
1963
2173
|
onBlur: () => {
|
|
1964
|
-
const x =
|
|
1965
|
-
|
|
2174
|
+
const x = p.trim(), s = x ? x.split(",").map((g) => g.trim()).filter(Boolean) : void 0;
|
|
2175
|
+
i(s), u((s == null ? void 0 : s.join(", ")) ?? "");
|
|
1966
2176
|
},
|
|
1967
|
-
placeholder:
|
|
2177
|
+
placeholder: t,
|
|
1968
2178
|
className: r
|
|
1969
2179
|
}
|
|
1970
2180
|
);
|
|
1971
2181
|
}
|
|
1972
|
-
const $ = "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",
|
|
2182
|
+
const $ = "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", Za = {
|
|
1973
2183
|
text: { type: "text", property: "", label: "", autocomplete: !1 },
|
|
1974
2184
|
number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
|
|
1975
2185
|
datetime: { type: "datetime", property: "", label: "", range: !1 },
|
|
1976
2186
|
select: { type: "select", property: "", label: "" }
|
|
1977
2187
|
};
|
|
1978
|
-
function
|
|
1979
|
-
const r = (
|
|
1980
|
-
|
|
1981
|
-
},
|
|
2188
|
+
function Ja({ value: e, onChange: i, availableProperties: t }) {
|
|
2189
|
+
const r = (n) => {
|
|
2190
|
+
i({ ...Za[n], property: e.property, label: e.label });
|
|
2191
|
+
}, p = (n) => i({ ...e, ...n }), u = t && t.length > 0;
|
|
1982
2192
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1983
|
-
/* @__PURE__ */ a(
|
|
2193
|
+
/* @__PURE__ */ a(S, { label: "Field Type", children: /* @__PURE__ */ l(
|
|
1984
2194
|
"select",
|
|
1985
2195
|
{
|
|
1986
2196
|
value: e.type,
|
|
1987
|
-
onChange: (
|
|
2197
|
+
onChange: (n) => r(n.target.value),
|
|
1988
2198
|
className: $,
|
|
1989
2199
|
children: [
|
|
1990
2200
|
/* @__PURE__ */ a("option", { value: "text", children: "Text" }),
|
|
@@ -1994,15 +2204,15 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
1994
2204
|
]
|
|
1995
2205
|
}
|
|
1996
2206
|
) }),
|
|
1997
|
-
/* @__PURE__ */ a(
|
|
2207
|
+
/* @__PURE__ */ a(S, { label: "Property", required: !0, children: u ? /* @__PURE__ */ l(
|
|
1998
2208
|
"select",
|
|
1999
2209
|
{
|
|
2000
2210
|
value: e.property,
|
|
2001
|
-
onChange: (
|
|
2211
|
+
onChange: (n) => p({ property: n.target.value }),
|
|
2002
2212
|
className: $,
|
|
2003
2213
|
children: [
|
|
2004
2214
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
2005
|
-
|
|
2215
|
+
t.map((n) => /* @__PURE__ */ a("option", { value: n.name, children: n.title ?? n.name }, n.name))
|
|
2006
2216
|
]
|
|
2007
2217
|
}
|
|
2008
2218
|
) : /* @__PURE__ */ a(
|
|
@@ -2010,32 +2220,32 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2010
2220
|
{
|
|
2011
2221
|
type: "text",
|
|
2012
2222
|
value: e.property,
|
|
2013
|
-
onChange: (
|
|
2223
|
+
onChange: (n) => p({ property: n.target.value }),
|
|
2014
2224
|
placeholder: "e.g. name",
|
|
2015
2225
|
className: $
|
|
2016
2226
|
}
|
|
2017
2227
|
) }),
|
|
2018
|
-
/* @__PURE__ */ a(
|
|
2228
|
+
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
2019
2229
|
"input",
|
|
2020
2230
|
{
|
|
2021
2231
|
type: "text",
|
|
2022
2232
|
value: e.label,
|
|
2023
|
-
onChange: (
|
|
2233
|
+
onChange: (n) => p({ label: n.target.value }),
|
|
2024
2234
|
placeholder: "Display label",
|
|
2025
2235
|
className: $
|
|
2026
2236
|
}
|
|
2027
2237
|
) }),
|
|
2028
|
-
/* @__PURE__ */ a(
|
|
2238
|
+
/* @__PURE__ */ a(S, { label: "Placeholder", children: /* @__PURE__ */ a(
|
|
2029
2239
|
"input",
|
|
2030
2240
|
{
|
|
2031
2241
|
type: "text",
|
|
2032
2242
|
value: e.placeholder ?? "",
|
|
2033
|
-
onChange: (
|
|
2243
|
+
onChange: (n) => p({ placeholder: n.target.value || void 0 }),
|
|
2034
2244
|
placeholder: "Input placeholder text",
|
|
2035
2245
|
className: $
|
|
2036
2246
|
}
|
|
2037
2247
|
) }),
|
|
2038
|
-
e.type === "text" && /* @__PURE__ */ l(
|
|
2248
|
+
e.type === "text" && /* @__PURE__ */ l(z, { children: [
|
|
2039
2249
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2040
2250
|
/* @__PURE__ */ a(
|
|
2041
2251
|
"input",
|
|
@@ -2043,7 +2253,7 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2043
2253
|
type: "checkbox",
|
|
2044
2254
|
id: "text-autocomplete",
|
|
2045
2255
|
checked: e.autocomplete ?? !1,
|
|
2046
|
-
onChange: (
|
|
2256
|
+
onChange: (n) => i({ ...e, autocomplete: n.target.checked }),
|
|
2047
2257
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2048
2258
|
}
|
|
2049
2259
|
),
|
|
@@ -2056,7 +2266,7 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2056
2266
|
type: "checkbox",
|
|
2057
2267
|
id: "text-prefetch",
|
|
2058
2268
|
checked: e.prefetch ?? !1,
|
|
2059
|
-
onChange: (
|
|
2269
|
+
onChange: (n) => i({ ...e, prefetch: n.target.checked }),
|
|
2060
2270
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2061
2271
|
}
|
|
2062
2272
|
),
|
|
@@ -2069,30 +2279,30 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2069
2279
|
type: "checkbox",
|
|
2070
2280
|
id: "text-zoomTo",
|
|
2071
2281
|
checked: e.zoomTo ?? !1,
|
|
2072
|
-
onChange: (
|
|
2282
|
+
onChange: (n) => i({ ...e, zoomTo: n.target.checked }),
|
|
2073
2283
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2074
2284
|
}
|
|
2075
2285
|
),
|
|
2076
2286
|
/* @__PURE__ */ a("label", { htmlFor: "text-zoomTo", className: "mapui:text-sm mapui:text-gray-700", children: "Zoom to Result" })
|
|
2077
2287
|
] }),
|
|
2078
|
-
/* @__PURE__ */ a(
|
|
2079
|
-
|
|
2288
|
+
/* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
|
|
2289
|
+
Pe,
|
|
2080
2290
|
{
|
|
2081
2291
|
options: e.options,
|
|
2082
|
-
onChange: (
|
|
2292
|
+
onChange: (n) => i({ ...e, options: n }),
|
|
2083
2293
|
placeholder: "option1, option2",
|
|
2084
2294
|
className: $
|
|
2085
2295
|
}
|
|
2086
2296
|
) })
|
|
2087
2297
|
] }),
|
|
2088
|
-
e.type === "number" && /* @__PURE__ */ l(
|
|
2089
|
-
/* @__PURE__ */ a(
|
|
2298
|
+
e.type === "number" && /* @__PURE__ */ l(z, { children: [
|
|
2299
|
+
/* @__PURE__ */ a(S, { label: "Input Mode", children: /* @__PURE__ */ l(
|
|
2090
2300
|
"select",
|
|
2091
2301
|
{
|
|
2092
2302
|
value: e.inputMode ?? "input",
|
|
2093
|
-
onChange: (
|
|
2303
|
+
onChange: (n) => i({
|
|
2094
2304
|
...e,
|
|
2095
|
-
inputMode:
|
|
2305
|
+
inputMode: n.target.value
|
|
2096
2306
|
}),
|
|
2097
2307
|
className: $,
|
|
2098
2308
|
children: [
|
|
@@ -2101,13 +2311,13 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2101
2311
|
]
|
|
2102
2312
|
}
|
|
2103
2313
|
) }),
|
|
2104
|
-
/* @__PURE__ */ a(
|
|
2314
|
+
/* @__PURE__ */ a(S, { label: "Operator", children: /* @__PURE__ */ l(
|
|
2105
2315
|
"select",
|
|
2106
2316
|
{
|
|
2107
2317
|
value: e.operator ?? "eq",
|
|
2108
|
-
onChange: (
|
|
2318
|
+
onChange: (n) => i({
|
|
2109
2319
|
...e,
|
|
2110
|
-
operator:
|
|
2320
|
+
operator: n.target.value
|
|
2111
2321
|
}),
|
|
2112
2322
|
className: $,
|
|
2113
2323
|
children: [
|
|
@@ -2120,13 +2330,13 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2120
2330
|
]
|
|
2121
2331
|
}
|
|
2122
2332
|
) }),
|
|
2123
|
-
/* @__PURE__ */ a(
|
|
2333
|
+
/* @__PURE__ */ a(S, { label: "Operator Labels", children: /* @__PURE__ */ l(
|
|
2124
2334
|
"select",
|
|
2125
2335
|
{
|
|
2126
2336
|
value: e.operatorLabelStyle ?? "symbol",
|
|
2127
|
-
onChange: (
|
|
2337
|
+
onChange: (n) => i({
|
|
2128
2338
|
...e,
|
|
2129
|
-
operatorLabelStyle:
|
|
2339
|
+
operatorLabelStyle: n.target.value
|
|
2130
2340
|
}),
|
|
2131
2341
|
className: $,
|
|
2132
2342
|
children: [
|
|
@@ -2142,45 +2352,45 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2142
2352
|
type: "checkbox",
|
|
2143
2353
|
id: "number-show-range",
|
|
2144
2354
|
checked: e.showRange ?? !1,
|
|
2145
|
-
onChange: (
|
|
2355
|
+
onChange: (n) => i({ ...e, showRange: n.target.checked }),
|
|
2146
2356
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2147
2357
|
}
|
|
2148
2358
|
),
|
|
2149
2359
|
/* @__PURE__ */ a("label", { htmlFor: "number-show-range", className: "mapui:text-sm mapui:text-gray-700", children: "Show Range on Slider" })
|
|
2150
2360
|
] }),
|
|
2151
2361
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-3 mapui:gap-2", children: [
|
|
2152
|
-
/* @__PURE__ */ a(
|
|
2362
|
+
/* @__PURE__ */ a(S, { label: "Min", children: /* @__PURE__ */ a(
|
|
2153
2363
|
"input",
|
|
2154
2364
|
{
|
|
2155
2365
|
type: "number",
|
|
2156
2366
|
value: e.min ?? "",
|
|
2157
|
-
onChange: (
|
|
2367
|
+
onChange: (n) => i({
|
|
2158
2368
|
...e,
|
|
2159
|
-
min:
|
|
2369
|
+
min: n.target.value ? parseFloat(n.target.value) : void 0
|
|
2160
2370
|
}),
|
|
2161
2371
|
className: $
|
|
2162
2372
|
}
|
|
2163
2373
|
) }),
|
|
2164
|
-
/* @__PURE__ */ a(
|
|
2374
|
+
/* @__PURE__ */ a(S, { label: "Max", children: /* @__PURE__ */ a(
|
|
2165
2375
|
"input",
|
|
2166
2376
|
{
|
|
2167
2377
|
type: "number",
|
|
2168
2378
|
value: e.max ?? "",
|
|
2169
|
-
onChange: (
|
|
2379
|
+
onChange: (n) => i({
|
|
2170
2380
|
...e,
|
|
2171
|
-
max:
|
|
2381
|
+
max: n.target.value ? parseFloat(n.target.value) : void 0
|
|
2172
2382
|
}),
|
|
2173
2383
|
className: $
|
|
2174
2384
|
}
|
|
2175
2385
|
) }),
|
|
2176
|
-
/* @__PURE__ */ a(
|
|
2386
|
+
/* @__PURE__ */ a(S, { label: "Step", children: /* @__PURE__ */ a(
|
|
2177
2387
|
"input",
|
|
2178
2388
|
{
|
|
2179
2389
|
type: "number",
|
|
2180
2390
|
value: e.step ?? "",
|
|
2181
|
-
onChange: (
|
|
2391
|
+
onChange: (n) => i({
|
|
2182
2392
|
...e,
|
|
2183
|
-
step:
|
|
2393
|
+
step: n.target.value ? parseFloat(n.target.value) : void 0
|
|
2184
2394
|
}),
|
|
2185
2395
|
className: $
|
|
2186
2396
|
}
|
|
@@ -2194,13 +2404,13 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2194
2404
|
type: "checkbox",
|
|
2195
2405
|
id: "datetime-range",
|
|
2196
2406
|
checked: e.range ?? !1,
|
|
2197
|
-
onChange: (
|
|
2407
|
+
onChange: (n) => i({ ...e, range: n.target.checked }),
|
|
2198
2408
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2199
2409
|
}
|
|
2200
2410
|
),
|
|
2201
2411
|
/* @__PURE__ */ a("label", { htmlFor: "datetime-range", className: "mapui:text-sm mapui:text-gray-700", children: "Date Range" })
|
|
2202
2412
|
] }),
|
|
2203
|
-
e.type === "select" && /* @__PURE__ */ l(
|
|
2413
|
+
e.type === "select" && /* @__PURE__ */ l(z, { children: [
|
|
2204
2414
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2205
2415
|
/* @__PURE__ */ a(
|
|
2206
2416
|
"input",
|
|
@@ -2208,7 +2418,7 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2208
2418
|
type: "checkbox",
|
|
2209
2419
|
id: "select-prefetch",
|
|
2210
2420
|
checked: e.prefetch ?? !1,
|
|
2211
|
-
onChange: (
|
|
2421
|
+
onChange: (n) => i({ ...e, prefetch: n.target.checked }),
|
|
2212
2422
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2213
2423
|
}
|
|
2214
2424
|
),
|
|
@@ -2221,17 +2431,17 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2221
2431
|
type: "checkbox",
|
|
2222
2432
|
id: "select-zoomTo",
|
|
2223
2433
|
checked: e.zoomTo ?? !1,
|
|
2224
|
-
onChange: (
|
|
2434
|
+
onChange: (n) => i({ ...e, zoomTo: n.target.checked }),
|
|
2225
2435
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2226
2436
|
}
|
|
2227
2437
|
),
|
|
2228
2438
|
/* @__PURE__ */ a("label", { htmlFor: "select-zoomTo", className: "mapui:text-sm mapui:text-gray-700", children: "Zoom to Result" })
|
|
2229
2439
|
] }),
|
|
2230
|
-
/* @__PURE__ */ a(
|
|
2231
|
-
|
|
2440
|
+
/* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
|
|
2441
|
+
Pe,
|
|
2232
2442
|
{
|
|
2233
2443
|
options: e.options,
|
|
2234
|
-
onChange: (
|
|
2444
|
+
onChange: (n) => i({ ...e, options: n }),
|
|
2235
2445
|
placeholder: "option1, option2",
|
|
2236
2446
|
className: $
|
|
2237
2447
|
}
|
|
@@ -2239,32 +2449,32 @@ function Ba({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2239
2449
|
] })
|
|
2240
2450
|
] });
|
|
2241
2451
|
}
|
|
2242
|
-
const
|
|
2452
|
+
const Ka = () => ({
|
|
2243
2453
|
type: "text",
|
|
2244
2454
|
property: "",
|
|
2245
2455
|
label: "",
|
|
2246
2456
|
autocomplete: !1
|
|
2247
2457
|
});
|
|
2248
|
-
function
|
|
2249
|
-
const [r,
|
|
2250
|
-
const
|
|
2251
|
-
|
|
2252
|
-
},
|
|
2253
|
-
|
|
2254
|
-
}, x = (
|
|
2255
|
-
|
|
2256
|
-
}, s = (
|
|
2257
|
-
if (
|
|
2458
|
+
function Qa({ fields: e, onChange: i, availableProperties: t }) {
|
|
2459
|
+
const [r, p] = T(null), u = () => {
|
|
2460
|
+
const d = [...e, Ka()];
|
|
2461
|
+
i(d), p(d.length - 1);
|
|
2462
|
+
}, n = (d, w) => {
|
|
2463
|
+
i(e.map((c, o) => o === d ? w : c));
|
|
2464
|
+
}, x = (d) => {
|
|
2465
|
+
i(e.filter((w, c) => c !== d)), p(null);
|
|
2466
|
+
}, s = (d) => {
|
|
2467
|
+
if (d === 0) return;
|
|
2258
2468
|
const w = [...e];
|
|
2259
|
-
[w[
|
|
2260
|
-
}, g = (
|
|
2261
|
-
if (
|
|
2469
|
+
[w[d - 1], w[d]] = [w[d], w[d - 1]], i(w), p(d - 1);
|
|
2470
|
+
}, g = (d) => {
|
|
2471
|
+
if (d === e.length - 1) return;
|
|
2262
2472
|
const w = [...e];
|
|
2263
|
-
[w[
|
|
2473
|
+
[w[d], w[d + 1]] = [w[d + 1], w[d]], i(w), p(d + 1);
|
|
2264
2474
|
};
|
|
2265
2475
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2266
2476
|
e.length === 0 && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
|
|
2267
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
2477
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((d, w) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
|
|
2268
2478
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
|
|
2269
2479
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
2270
2480
|
/* @__PURE__ */ a(
|
|
@@ -2294,11 +2504,11 @@ function qa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
2294
2504
|
"button",
|
|
2295
2505
|
{
|
|
2296
2506
|
type: "button",
|
|
2297
|
-
onClick: () =>
|
|
2507
|
+
onClick: () => p(r === w ? null : w),
|
|
2298
2508
|
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",
|
|
2299
2509
|
children: [
|
|
2300
|
-
/* @__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:
|
|
2301
|
-
|
|
2510
|
+
/* @__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: d.type }),
|
|
2511
|
+
d.label || d.property || "Untitled field"
|
|
2302
2512
|
]
|
|
2303
2513
|
}
|
|
2304
2514
|
),
|
|
@@ -2314,11 +2524,11 @@ function qa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
2314
2524
|
)
|
|
2315
2525
|
] }),
|
|
2316
2526
|
r === w && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
2317
|
-
|
|
2527
|
+
Ja,
|
|
2318
2528
|
{
|
|
2319
|
-
value:
|
|
2320
|
-
onChange: (c) =>
|
|
2321
|
-
availableProperties:
|
|
2529
|
+
value: d,
|
|
2530
|
+
onChange: (c) => n(w, c),
|
|
2531
|
+
availableProperties: t
|
|
2322
2532
|
}
|
|
2323
2533
|
) })
|
|
2324
2534
|
] }, w)) }),
|
|
@@ -2326,61 +2536,61 @@ function qa({ fields: e, onChange: t, availableProperties: i }) {
|
|
|
2326
2536
|
"button",
|
|
2327
2537
|
{
|
|
2328
2538
|
type: "button",
|
|
2329
|
-
onClick:
|
|
2539
|
+
onClick: u,
|
|
2330
2540
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
2331
2541
|
children: "+ Add Search Field"
|
|
2332
2542
|
}
|
|
2333
2543
|
)
|
|
2334
2544
|
] });
|
|
2335
2545
|
}
|
|
2336
|
-
function
|
|
2337
|
-
return Object.entries(e).map(([
|
|
2338
|
-
key:
|
|
2339
|
-
label:
|
|
2340
|
-
visible:
|
|
2546
|
+
function ei(e) {
|
|
2547
|
+
return Object.entries(e).map(([i, t]) => ({
|
|
2548
|
+
key: i,
|
|
2549
|
+
label: t.label ?? "",
|
|
2550
|
+
visible: t.visible ?? !0
|
|
2341
2551
|
}));
|
|
2342
2552
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const
|
|
2345
|
-
for (const
|
|
2346
|
-
t
|
|
2347
|
-
visible:
|
|
2348
|
-
...
|
|
2553
|
+
function ai(e) {
|
|
2554
|
+
const i = {};
|
|
2555
|
+
for (const t of e)
|
|
2556
|
+
i[t.key] = {
|
|
2557
|
+
visible: t.visible,
|
|
2558
|
+
...t.label ? { label: t.label } : {}
|
|
2349
2559
|
};
|
|
2350
|
-
return
|
|
2560
|
+
return i;
|
|
2351
2561
|
}
|
|
2352
2562
|
const se = "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";
|
|
2353
|
-
function
|
|
2354
|
-
const r =
|
|
2355
|
-
|
|
2356
|
-
}, x = (
|
|
2357
|
-
|
|
2358
|
-
}, s = (
|
|
2359
|
-
|
|
2360
|
-
}, g = (
|
|
2361
|
-
const N =
|
|
2362
|
-
|
|
2363
|
-
},
|
|
2364
|
-
if (
|
|
2365
|
-
const
|
|
2366
|
-
[
|
|
2367
|
-
}, w = (
|
|
2368
|
-
if (
|
|
2369
|
-
const
|
|
2370
|
-
[
|
|
2563
|
+
function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
2564
|
+
const r = ei(e), p = t && t.length > 0, u = (o) => i(ai(o)), n = () => {
|
|
2565
|
+
u([...r, { key: "", label: "", visible: !0 }]);
|
|
2566
|
+
}, x = (o) => {
|
|
2567
|
+
u(r.filter((h, N) => N !== o));
|
|
2568
|
+
}, s = (o, h) => {
|
|
2569
|
+
u(r.map((N, v) => v === o ? { ...N, ...h } : N));
|
|
2570
|
+
}, g = (o, h) => {
|
|
2571
|
+
const N = t == null ? void 0 : t.find((C) => C.name === h), v = (N == null ? void 0 : N.title) ?? r[o].label;
|
|
2572
|
+
u(r.map((C, E) => E === o ? { ...C, key: h, label: v } : C));
|
|
2573
|
+
}, d = (o) => {
|
|
2574
|
+
if (o === 0) return;
|
|
2575
|
+
const h = [...r];
|
|
2576
|
+
[h[o - 1], h[o]] = [h[o], h[o - 1]], u(h);
|
|
2577
|
+
}, w = (o) => {
|
|
2578
|
+
if (o === r.length - 1) return;
|
|
2579
|
+
const h = [...r];
|
|
2580
|
+
[h[o], h[o + 1]] = [h[o + 1], h[o]], u(h);
|
|
2371
2581
|
}, c = () => {
|
|
2372
|
-
if (!
|
|
2373
|
-
const
|
|
2374
|
-
key:
|
|
2375
|
-
label:
|
|
2582
|
+
if (!t) return;
|
|
2583
|
+
const o = t.map((h) => ({
|
|
2584
|
+
key: h.name,
|
|
2585
|
+
label: h.title ?? "",
|
|
2376
2586
|
visible: !0
|
|
2377
2587
|
}));
|
|
2378
|
-
o
|
|
2588
|
+
u(o);
|
|
2379
2589
|
};
|
|
2380
2590
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2381
|
-
r.length === 0 ? /* @__PURE__ */ l(
|
|
2591
|
+
r.length === 0 ? /* @__PURE__ */ l(z, { children: [
|
|
2382
2592
|
/* @__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." }),
|
|
2383
|
-
|
|
2593
|
+
p && /* @__PURE__ */ a(
|
|
2384
2594
|
"button",
|
|
2385
2595
|
{
|
|
2386
2596
|
type: "button",
|
|
@@ -2389,20 +2599,20 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2389
2599
|
children: "Populate from API metadata"
|
|
2390
2600
|
}
|
|
2391
2601
|
)
|
|
2392
|
-
] }) : /* @__PURE__ */ l(
|
|
2602
|
+
] }) : /* @__PURE__ */ l(z, { children: [
|
|
2393
2603
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:items-center mapui:gap-2 mapui:px-8", style: { gridTemplateColumns: "1fr 1fr auto" }, children: [
|
|
2394
|
-
/* @__PURE__ */ a(
|
|
2395
|
-
/* @__PURE__ */ a(
|
|
2604
|
+
/* @__PURE__ */ a(S, { label: "Property Key", children: /* @__PURE__ */ a("span", {}) }),
|
|
2605
|
+
/* @__PURE__ */ a(S, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
|
|
2396
2606
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
|
|
2397
2607
|
] }),
|
|
2398
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((
|
|
2608
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((o, h) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
|
|
2399
2609
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
2400
2610
|
/* @__PURE__ */ a(
|
|
2401
2611
|
"button",
|
|
2402
2612
|
{
|
|
2403
2613
|
type: "button",
|
|
2404
|
-
onClick: () =>
|
|
2405
|
-
disabled:
|
|
2614
|
+
onClick: () => d(h),
|
|
2615
|
+
disabled: h === 0,
|
|
2406
2616
|
"aria-label": "Move up",
|
|
2407
2617
|
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",
|
|
2408
2618
|
children: "▲"
|
|
@@ -2412,8 +2622,8 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2412
2622
|
"button",
|
|
2413
2623
|
{
|
|
2414
2624
|
type: "button",
|
|
2415
|
-
onClick: () => w(
|
|
2416
|
-
disabled:
|
|
2625
|
+
onClick: () => w(h),
|
|
2626
|
+
disabled: h === r.length - 1,
|
|
2417
2627
|
"aria-label": "Move down",
|
|
2418
2628
|
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",
|
|
2419
2629
|
children: "▼"
|
|
@@ -2421,24 +2631,24 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2421
2631
|
)
|
|
2422
2632
|
] }),
|
|
2423
2633
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:flex-1 mapui:items-center mapui:gap-2", style: { gridTemplateColumns: "1fr 1fr auto auto" }, children: [
|
|
2424
|
-
|
|
2634
|
+
p ? /* @__PURE__ */ l(
|
|
2425
2635
|
"select",
|
|
2426
2636
|
{
|
|
2427
|
-
value:
|
|
2428
|
-
onChange: (N) => g(
|
|
2637
|
+
value: o.key,
|
|
2638
|
+
onChange: (N) => g(h, N.target.value),
|
|
2429
2639
|
"aria-label": "Property key",
|
|
2430
2640
|
className: se,
|
|
2431
2641
|
children: [
|
|
2432
2642
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
2433
|
-
|
|
2643
|
+
t.map((N) => /* @__PURE__ */ a("option", { value: N.name, children: N.title ?? N.name }, N.name))
|
|
2434
2644
|
]
|
|
2435
2645
|
}
|
|
2436
2646
|
) : /* @__PURE__ */ a(
|
|
2437
2647
|
"input",
|
|
2438
2648
|
{
|
|
2439
2649
|
type: "text",
|
|
2440
|
-
value:
|
|
2441
|
-
onChange: (N) => s(
|
|
2650
|
+
value: o.key,
|
|
2651
|
+
onChange: (N) => s(h, { key: N.target.value }),
|
|
2442
2652
|
placeholder: "property_name",
|
|
2443
2653
|
"aria-label": "Property key",
|
|
2444
2654
|
className: se
|
|
@@ -2448,8 +2658,8 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2448
2658
|
"input",
|
|
2449
2659
|
{
|
|
2450
2660
|
type: "text",
|
|
2451
|
-
value:
|
|
2452
|
-
onChange: (N) => s(
|
|
2661
|
+
value: o.label,
|
|
2662
|
+
onChange: (N) => s(h, { label: N.target.value }),
|
|
2453
2663
|
placeholder: "Friendly name",
|
|
2454
2664
|
"aria-label": "Display label",
|
|
2455
2665
|
className: se
|
|
@@ -2459,8 +2669,8 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2459
2669
|
"input",
|
|
2460
2670
|
{
|
|
2461
2671
|
type: "checkbox",
|
|
2462
|
-
checked:
|
|
2463
|
-
onChange: (N) => s(
|
|
2672
|
+
checked: o.visible,
|
|
2673
|
+
onChange: (N) => s(h, { visible: N.target.checked }),
|
|
2464
2674
|
"aria-label": "Visible",
|
|
2465
2675
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2466
2676
|
}
|
|
@@ -2469,229 +2679,229 @@ function Wa({ value: e, onChange: t, availableProperties: i }) {
|
|
|
2469
2679
|
"button",
|
|
2470
2680
|
{
|
|
2471
2681
|
type: "button",
|
|
2472
|
-
onClick: () => x(
|
|
2682
|
+
onClick: () => x(h),
|
|
2473
2683
|
"aria-label": "Remove property",
|
|
2474
2684
|
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",
|
|
2475
2685
|
children: "Remove"
|
|
2476
2686
|
}
|
|
2477
2687
|
)
|
|
2478
2688
|
] })
|
|
2479
|
-
] },
|
|
2689
|
+
] }, h)) })
|
|
2480
2690
|
] }),
|
|
2481
2691
|
/* @__PURE__ */ a(
|
|
2482
2692
|
"button",
|
|
2483
2693
|
{
|
|
2484
2694
|
type: "button",
|
|
2485
|
-
onClick:
|
|
2695
|
+
onClick: n,
|
|
2486
2696
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
2487
2697
|
children: "+ Add Property"
|
|
2488
2698
|
}
|
|
2489
2699
|
)
|
|
2490
2700
|
] });
|
|
2491
2701
|
}
|
|
2492
|
-
const
|
|
2493
|
-
function
|
|
2494
|
-
return !!e.$ref &&
|
|
2702
|
+
const Ve = /geojson\.org\/schema\/(\w+)\.json/;
|
|
2703
|
+
function ti(e) {
|
|
2704
|
+
return !!e.$ref && Ve.test(e.$ref);
|
|
2495
2705
|
}
|
|
2496
|
-
function
|
|
2497
|
-
const
|
|
2498
|
-
return
|
|
2706
|
+
function He(e) {
|
|
2707
|
+
const i = Ve.exec(e);
|
|
2708
|
+
return i ? i[1] : null;
|
|
2499
2709
|
}
|
|
2500
|
-
function
|
|
2501
|
-
const
|
|
2502
|
-
return
|
|
2503
|
-
}
|
|
2504
|
-
function
|
|
2505
|
-
const
|
|
2506
|
-
return
|
|
2507
|
-
}
|
|
2508
|
-
function
|
|
2509
|
-
for (const
|
|
2510
|
-
if (
|
|
2511
|
-
const
|
|
2512
|
-
if (
|
|
2710
|
+
function Ye(e) {
|
|
2711
|
+
const i = e.toLowerCase();
|
|
2712
|
+
return i.includes("polygon") ? "fill" : i.includes("linestring") ? "line" : i.includes("point") ? "circle" : null;
|
|
2713
|
+
}
|
|
2714
|
+
function fe(e) {
|
|
2715
|
+
const i = e.toLowerCase();
|
|
2716
|
+
return i.includes("polygon") ? ["fill", "line"] : i.includes("linestring") ? ["line"] : i.includes("point") ? ["circle", "symbol"] : [];
|
|
2717
|
+
}
|
|
2718
|
+
function ri(e) {
|
|
2719
|
+
for (const i of Object.values(e.properties))
|
|
2720
|
+
if (i.$ref) {
|
|
2721
|
+
const t = He(i.$ref);
|
|
2722
|
+
if (t) return Ye(t);
|
|
2513
2723
|
}
|
|
2514
2724
|
return null;
|
|
2515
2725
|
}
|
|
2516
|
-
function
|
|
2517
|
-
for (const
|
|
2518
|
-
if (
|
|
2519
|
-
const
|
|
2520
|
-
if (
|
|
2726
|
+
function Xe(e) {
|
|
2727
|
+
for (const i of Object.values(e.properties))
|
|
2728
|
+
if (i.$ref) {
|
|
2729
|
+
const t = He(i.$ref);
|
|
2730
|
+
if (t) return fe(t);
|
|
2521
2731
|
}
|
|
2522
2732
|
return [];
|
|
2523
2733
|
}
|
|
2524
|
-
function
|
|
2525
|
-
return Object.entries(e.properties).filter(([,
|
|
2526
|
-
name:
|
|
2527
|
-
title:
|
|
2528
|
-
type:
|
|
2529
|
-
format:
|
|
2530
|
-
enum:
|
|
2531
|
-
minimum:
|
|
2532
|
-
maximum:
|
|
2734
|
+
function li(e) {
|
|
2735
|
+
return Object.entries(e.properties).filter(([, i]) => !ti(i)).map(([i, t]) => ({
|
|
2736
|
+
name: i,
|
|
2737
|
+
title: t.title,
|
|
2738
|
+
type: t.type,
|
|
2739
|
+
format: t.format,
|
|
2740
|
+
enum: t.enum,
|
|
2741
|
+
minimum: t.minimum,
|
|
2742
|
+
maximum: t.maximum
|
|
2533
2743
|
}));
|
|
2534
2744
|
}
|
|
2535
|
-
function
|
|
2536
|
-
var
|
|
2537
|
-
const
|
|
2745
|
+
function Ze(e) {
|
|
2746
|
+
var t;
|
|
2747
|
+
const i = /* @__PURE__ */ new Set();
|
|
2538
2748
|
for (const r of e)
|
|
2539
|
-
(
|
|
2540
|
-
return Array.from(
|
|
2541
|
-
}
|
|
2542
|
-
function
|
|
2543
|
-
const
|
|
2544
|
-
for (const
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2749
|
+
(t = r.geometry) != null && t.type && i.add(r.geometry.type);
|
|
2750
|
+
return Array.from(i);
|
|
2751
|
+
}
|
|
2752
|
+
function pi(e) {
|
|
2753
|
+
const i = /* @__PURE__ */ new Set();
|
|
2754
|
+
for (const p of e) {
|
|
2755
|
+
const u = p.toLowerCase();
|
|
2756
|
+
u.includes("polygon") ? i.add("polygon") : u.includes("linestring") ? i.add("line") : u.includes("point") && i.add("point");
|
|
2547
2757
|
}
|
|
2548
|
-
const
|
|
2549
|
-
return
|
|
2758
|
+
const t = i.size > 1, r = [];
|
|
2759
|
+
return i.has("polygon") && r.push({
|
|
2550
2760
|
type: "fill",
|
|
2551
2761
|
paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 },
|
|
2552
|
-
...
|
|
2553
|
-
}),
|
|
2762
|
+
...t ? { geometryFilter: ["Polygon", "MultiPolygon"] } : {}
|
|
2763
|
+
}), i.has("line") && r.push({
|
|
2554
2764
|
type: "line",
|
|
2555
2765
|
paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 },
|
|
2556
|
-
...
|
|
2557
|
-
}),
|
|
2766
|
+
...t ? { geometryFilter: ["LineString", "MultiLineString"] } : {}
|
|
2767
|
+
}), i.has("point") && r.push({
|
|
2558
2768
|
type: "circle",
|
|
2559
2769
|
paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 },
|
|
2560
|
-
...
|
|
2770
|
+
...t ? { geometryFilter: ["Point", "MultiPoint"] } : {}
|
|
2561
2771
|
}), r;
|
|
2562
2772
|
}
|
|
2563
|
-
async function
|
|
2564
|
-
var
|
|
2773
|
+
async function Si(e, i) {
|
|
2774
|
+
var t, r;
|
|
2565
2775
|
try {
|
|
2566
|
-
const
|
|
2567
|
-
if (
|
|
2776
|
+
const p = await qe(e, i), u = ri(p);
|
|
2777
|
+
if (u) return u;
|
|
2568
2778
|
} catch {
|
|
2569
2779
|
}
|
|
2570
2780
|
try {
|
|
2571
|
-
const
|
|
2572
|
-
if (typeof
|
|
2781
|
+
const u = (r = (t = (await ye(e, i, { limit: 1 })).features[0]) == null ? void 0 : t.geometry) == null ? void 0 : r.type;
|
|
2782
|
+
if (typeof u == "string") return Ye(u);
|
|
2573
2783
|
} catch {
|
|
2574
2784
|
}
|
|
2575
2785
|
return null;
|
|
2576
2786
|
}
|
|
2577
|
-
async function
|
|
2787
|
+
async function Ti(e, i) {
|
|
2578
2788
|
try {
|
|
2579
|
-
const
|
|
2789
|
+
const t = await qe(e, i), r = Xe(t);
|
|
2580
2790
|
if (r.length > 0) return r;
|
|
2581
2791
|
} catch {
|
|
2582
2792
|
}
|
|
2583
2793
|
try {
|
|
2584
|
-
const
|
|
2585
|
-
for (const
|
|
2586
|
-
for (const
|
|
2587
|
-
|
|
2588
|
-
return Array.from(
|
|
2794
|
+
const t = await ye(e, i, { limit: 20 }), r = Ze(t.features), p = /* @__PURE__ */ new Set();
|
|
2795
|
+
for (const u of r)
|
|
2796
|
+
for (const n of fe(u))
|
|
2797
|
+
p.add(n);
|
|
2798
|
+
return Array.from(p);
|
|
2589
2799
|
} catch {
|
|
2590
2800
|
}
|
|
2591
2801
|
return [];
|
|
2592
2802
|
}
|
|
2593
|
-
function
|
|
2594
|
-
return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (
|
|
2803
|
+
function Di(e) {
|
|
2804
|
+
return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (i) => i.toUpperCase());
|
|
2595
2805
|
}
|
|
2596
|
-
function
|
|
2806
|
+
function ni(e, i, t) {
|
|
2597
2807
|
const r = [...e ?? []];
|
|
2598
|
-
return r[
|
|
2808
|
+
return r[i] = t, r;
|
|
2599
2809
|
}
|
|
2600
|
-
function
|
|
2601
|
-
return (e ?? []).filter((
|
|
2810
|
+
function ui(e, i) {
|
|
2811
|
+
return (e ?? []).filter((t, r) => r !== i);
|
|
2602
2812
|
}
|
|
2603
|
-
const
|
|
2604
|
-
function
|
|
2605
|
-
var
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
const x =
|
|
2611
|
-
return
|
|
2813
|
+
const _ = "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";
|
|
2814
|
+
function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
2815
|
+
var O;
|
|
2816
|
+
const p = (m) => i({ ...e, ...m }), u = H(e);
|
|
2817
|
+
u.current = e;
|
|
2818
|
+
const n = H(i);
|
|
2819
|
+
n.current = i;
|
|
2820
|
+
const x = t.find((m) => m.id === e.sourceId), s = (x == null ? void 0 : x.url) ?? null, g = e.collection || null, { collections: d, loading: w } = Ge(s), { queryables: c, loading: o } = oa(s, g), h = c ? li(c) : [], [N, v] = T([]), [C, E] = T([]);
|
|
2821
|
+
return q(() => {
|
|
2612
2822
|
if (!c) {
|
|
2613
2823
|
v([]), E([]);
|
|
2614
2824
|
return;
|
|
2615
2825
|
}
|
|
2616
|
-
const m = (
|
|
2617
|
-
var
|
|
2618
|
-
const P =
|
|
2619
|
-
v(P), E(
|
|
2620
|
-
},
|
|
2621
|
-
if (
|
|
2622
|
-
const
|
|
2623
|
-
for (const
|
|
2624
|
-
|
|
2625
|
-
m(
|
|
2826
|
+
const m = (b, M) => {
|
|
2827
|
+
var y;
|
|
2828
|
+
const P = pi(b);
|
|
2829
|
+
v(P), E(M), P.length > 0 && !((y = u.current.styles) != null && y.length) && n.current({ ...u.current, styles: P });
|
|
2830
|
+
}, L = Xe(c);
|
|
2831
|
+
if (L.length > 0) {
|
|
2832
|
+
const b = [];
|
|
2833
|
+
for (const M of L)
|
|
2834
|
+
M === "fill" ? b.push("Polygon") : M === "line" ? b.push("LineString") : (M === "circle" || M === "symbol") && b.push("Point");
|
|
2835
|
+
m(b, L);
|
|
2626
2836
|
return;
|
|
2627
2837
|
}
|
|
2628
2838
|
if (!s || !g) {
|
|
2629
2839
|
v([]), E([]);
|
|
2630
2840
|
return;
|
|
2631
2841
|
}
|
|
2632
|
-
let
|
|
2633
|
-
return
|
|
2634
|
-
if (
|
|
2635
|
-
const
|
|
2636
|
-
if (
|
|
2842
|
+
let F = !1;
|
|
2843
|
+
return ye(s, g, { limit: 20 }).then((b) => {
|
|
2844
|
+
if (F) return;
|
|
2845
|
+
const M = Ze(b.features);
|
|
2846
|
+
if (M.length > 0) {
|
|
2637
2847
|
const P = /* @__PURE__ */ new Set();
|
|
2638
|
-
for (const
|
|
2639
|
-
for (const k of
|
|
2640
|
-
m(
|
|
2848
|
+
for (const y of M)
|
|
2849
|
+
for (const k of fe(y)) P.add(k);
|
|
2850
|
+
m(M, Array.from(P));
|
|
2641
2851
|
} else
|
|
2642
2852
|
v([]), E([]);
|
|
2643
2853
|
}).catch(() => {
|
|
2644
|
-
|
|
2854
|
+
F || (v([]), E([]));
|
|
2645
2855
|
}), () => {
|
|
2646
|
-
|
|
2856
|
+
F = !0;
|
|
2647
2857
|
};
|
|
2648
|
-
}, [c, s, g]),
|
|
2858
|
+
}, [c, s, g]), q(() => {
|
|
2649
2859
|
v([]), E([]);
|
|
2650
2860
|
}, [s, g]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2651
2861
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
|
|
2652
|
-
/* @__PURE__ */ a(
|
|
2862
|
+
/* @__PURE__ */ a(S, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
|
|
2653
2863
|
"input",
|
|
2654
2864
|
{
|
|
2655
2865
|
type: "text",
|
|
2656
2866
|
value: e.id,
|
|
2657
|
-
onChange: (m) =>
|
|
2867
|
+
onChange: (m) => p({ id: m.target.value }),
|
|
2658
2868
|
placeholder: "my-layer",
|
|
2659
|
-
className:
|
|
2869
|
+
className: _
|
|
2660
2870
|
}
|
|
2661
2871
|
) }),
|
|
2662
|
-
/* @__PURE__ */ a(
|
|
2872
|
+
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
2663
2873
|
"input",
|
|
2664
2874
|
{
|
|
2665
2875
|
type: "text",
|
|
2666
2876
|
value: e.label,
|
|
2667
|
-
onChange: (m) =>
|
|
2877
|
+
onChange: (m) => p({ label: m.target.value }),
|
|
2668
2878
|
placeholder: "My Layer",
|
|
2669
|
-
className:
|
|
2879
|
+
className: _
|
|
2670
2880
|
}
|
|
2671
2881
|
) })
|
|
2672
2882
|
] }),
|
|
2673
|
-
/* @__PURE__ */ a(
|
|
2883
|
+
/* @__PURE__ */ a(S, { label: "Source", required: !0, children: /* @__PURE__ */ l(
|
|
2674
2884
|
"select",
|
|
2675
2885
|
{
|
|
2676
2886
|
value: e.sourceId,
|
|
2677
|
-
onChange: (m) =>
|
|
2678
|
-
className:
|
|
2887
|
+
onChange: (m) => p({ sourceId: m.target.value }),
|
|
2888
|
+
className: _,
|
|
2679
2889
|
children: [
|
|
2680
2890
|
/* @__PURE__ */ a("option", { value: "", children: "Select a source…" }),
|
|
2681
|
-
|
|
2891
|
+
t.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.label ?? m.id }, m.id))
|
|
2682
2892
|
]
|
|
2683
2893
|
}
|
|
2684
2894
|
) }),
|
|
2685
|
-
/* @__PURE__ */ l(
|
|
2686
|
-
|
|
2895
|
+
/* @__PURE__ */ l(S, { label: "Collection", required: !0, children: [
|
|
2896
|
+
d.length > 0 ? /* @__PURE__ */ l(
|
|
2687
2897
|
"select",
|
|
2688
2898
|
{
|
|
2689
2899
|
value: e.collection,
|
|
2690
|
-
onChange: (m) =>
|
|
2691
|
-
className:
|
|
2900
|
+
onChange: (m) => p({ collection: m.target.value }),
|
|
2901
|
+
className: _,
|
|
2692
2902
|
children: [
|
|
2693
2903
|
/* @__PURE__ */ a("option", { value: "", children: "Select a collection…" }),
|
|
2694
|
-
|
|
2904
|
+
d.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.title ?? m.id }, m.id))
|
|
2695
2905
|
]
|
|
2696
2906
|
}
|
|
2697
2907
|
) : /* @__PURE__ */ a(
|
|
@@ -2699,14 +2909,14 @@ function Pe({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2699
2909
|
{
|
|
2700
2910
|
type: "text",
|
|
2701
2911
|
value: e.collection,
|
|
2702
|
-
onChange: (m) =>
|
|
2912
|
+
onChange: (m) => p({ collection: m.target.value }),
|
|
2703
2913
|
placeholder: w ? "Loading collections…" : "collection-id",
|
|
2704
|
-
className:
|
|
2914
|
+
className: _
|
|
2705
2915
|
}
|
|
2706
2916
|
),
|
|
2707
|
-
|
|
2917
|
+
o && /* @__PURE__ */ a("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
|
|
2708
2918
|
] }),
|
|
2709
|
-
/* @__PURE__ */ a(
|
|
2919
|
+
/* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((m) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
|
|
2710
2920
|
/* @__PURE__ */ a(
|
|
2711
2921
|
"input",
|
|
2712
2922
|
{
|
|
@@ -2714,7 +2924,7 @@ function Pe({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2714
2924
|
name: `data-mode-${e.id}`,
|
|
2715
2925
|
value: m,
|
|
2716
2926
|
checked: e.dataMode === m,
|
|
2717
|
-
onChange: () =>
|
|
2927
|
+
onChange: () => p({ dataMode: m }),
|
|
2718
2928
|
className: "mapui:accent-blue-600"
|
|
2719
2929
|
}
|
|
2720
2930
|
),
|
|
@@ -2727,78 +2937,112 @@ function Pe({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
|
|
|
2727
2937
|
type: "checkbox",
|
|
2728
2938
|
id: "layer-visible",
|
|
2729
2939
|
checked: e.visible,
|
|
2730
|
-
onChange: (m) =>
|
|
2940
|
+
onChange: (m) => p({ visible: m.target.checked }),
|
|
2731
2941
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2732
2942
|
}
|
|
2733
2943
|
),
|
|
2734
2944
|
/* @__PURE__ */ a("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
|
|
2735
2945
|
] }),
|
|
2946
|
+
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
|
|
2947
|
+
/* @__PURE__ */ a(S, { label: "Min Zoom", children: /* @__PURE__ */ a(
|
|
2948
|
+
"input",
|
|
2949
|
+
{
|
|
2950
|
+
type: "number",
|
|
2951
|
+
min: 0,
|
|
2952
|
+
max: 24,
|
|
2953
|
+
step: 1,
|
|
2954
|
+
value: e.minZoom ?? "",
|
|
2955
|
+
onChange: (m) => {
|
|
2956
|
+
const L = m.target.valueAsNumber;
|
|
2957
|
+
p({ minZoom: isNaN(L) ? void 0 : L });
|
|
2958
|
+
},
|
|
2959
|
+
placeholder: "0",
|
|
2960
|
+
className: _
|
|
2961
|
+
}
|
|
2962
|
+
) }),
|
|
2963
|
+
/* @__PURE__ */ a(S, { label: "Max Zoom", children: /* @__PURE__ */ a(
|
|
2964
|
+
"input",
|
|
2965
|
+
{
|
|
2966
|
+
type: "number",
|
|
2967
|
+
min: 0,
|
|
2968
|
+
max: 24,
|
|
2969
|
+
step: 1,
|
|
2970
|
+
value: e.maxZoom ?? "",
|
|
2971
|
+
onChange: (m) => {
|
|
2972
|
+
const L = m.target.valueAsNumber;
|
|
2973
|
+
p({ maxZoom: isNaN(L) ? void 0 : L });
|
|
2974
|
+
},
|
|
2975
|
+
placeholder: "24",
|
|
2976
|
+
className: _
|
|
2977
|
+
}
|
|
2978
|
+
) })
|
|
2979
|
+
] }),
|
|
2736
2980
|
/* @__PURE__ */ a(X, { title: "Style", children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-4", children: [
|
|
2737
|
-
(e.styles ?? [ge]).map((m,
|
|
2738
|
-
var
|
|
2981
|
+
(e.styles ?? [ge]).map((m, L) => {
|
|
2982
|
+
var F;
|
|
2739
2983
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2740
|
-
m.geometryFilter && m.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: m.geometryFilter.map((
|
|
2984
|
+
m.geometryFilter && m.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: m.geometryFilter.map((b) => /* @__PURE__ */ a(
|
|
2741
2985
|
"span",
|
|
2742
2986
|
{
|
|
2743
2987
|
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",
|
|
2744
|
-
children:
|
|
2988
|
+
children: b
|
|
2745
2989
|
},
|
|
2746
|
-
|
|
2990
|
+
b
|
|
2747
2991
|
)) }),
|
|
2748
2992
|
/* @__PURE__ */ a(
|
|
2749
|
-
|
|
2993
|
+
Ha,
|
|
2750
2994
|
{
|
|
2751
2995
|
value: m,
|
|
2752
|
-
onChange: (
|
|
2753
|
-
suggestedTypes:
|
|
2996
|
+
onChange: (b) => p({ styles: ni(e.styles, L, b) }),
|
|
2997
|
+
suggestedTypes: C,
|
|
2754
2998
|
availableIcons: r,
|
|
2755
|
-
availableProperties:
|
|
2756
|
-
onFetchDistinctValues: s && g ? (
|
|
2999
|
+
availableProperties: h,
|
|
3000
|
+
onFetchDistinctValues: s && g ? (b) => ma(s, g, b, { fetchAll: !0 }) : void 0
|
|
2757
3001
|
}
|
|
2758
3002
|
),
|
|
2759
|
-
(((
|
|
3003
|
+
(((F = e.styles) == null ? void 0 : F.length) ?? 0) > 0 && /* @__PURE__ */ a(
|
|
2760
3004
|
"button",
|
|
2761
3005
|
{
|
|
2762
3006
|
type: "button",
|
|
2763
|
-
onClick: () =>
|
|
3007
|
+
onClick: () => p({ styles: ui(e.styles, L) }),
|
|
2764
3008
|
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",
|
|
2765
3009
|
children: "Remove style"
|
|
2766
3010
|
}
|
|
2767
3011
|
)
|
|
2768
|
-
] },
|
|
3012
|
+
] }, L);
|
|
2769
3013
|
}),
|
|
2770
3014
|
/* @__PURE__ */ a(
|
|
2771
3015
|
"button",
|
|
2772
3016
|
{
|
|
2773
3017
|
type: "button",
|
|
2774
|
-
onClick: () =>
|
|
3018
|
+
onClick: () => p({ styles: [...e.styles ?? [ge], _e] }),
|
|
2775
3019
|
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",
|
|
2776
3020
|
children: "+ Add style"
|
|
2777
3021
|
}
|
|
2778
3022
|
)
|
|
2779
3023
|
] }) }),
|
|
2780
3024
|
/* @__PURE__ */ a(X, { title: "Legend", children: /* @__PURE__ */ a(
|
|
2781
|
-
|
|
3025
|
+
Xa,
|
|
2782
3026
|
{
|
|
2783
3027
|
value: e.legend,
|
|
2784
|
-
onChange: (m) =>
|
|
3028
|
+
onChange: (m) => p({ legend: m }),
|
|
2785
3029
|
styles: e.styles
|
|
2786
3030
|
}
|
|
2787
3031
|
) }),
|
|
2788
3032
|
/* @__PURE__ */ a(X, { title: "Search Fields", children: /* @__PURE__ */ a(
|
|
2789
|
-
|
|
3033
|
+
Qa,
|
|
2790
3034
|
{
|
|
2791
|
-
fields: ((
|
|
2792
|
-
onChange: (m) =>
|
|
2793
|
-
availableProperties:
|
|
3035
|
+
fields: ((O = e.search) == null ? void 0 : O.fields) ?? [],
|
|
3036
|
+
onChange: (m) => p({ search: m.length > 0 ? { fields: m } : void 0 }),
|
|
3037
|
+
availableProperties: h
|
|
2794
3038
|
}
|
|
2795
3039
|
) }),
|
|
2796
3040
|
/* @__PURE__ */ a(X, { title: "Property Display", children: /* @__PURE__ */ a(
|
|
2797
|
-
|
|
3041
|
+
ii,
|
|
2798
3042
|
{
|
|
2799
3043
|
value: e.propertyDisplay ?? {},
|
|
2800
|
-
onChange: (m) =>
|
|
2801
|
-
availableProperties:
|
|
3044
|
+
onChange: (m) => p({ propertyDisplay: Object.keys(m).length > 0 ? m : void 0 }),
|
|
3045
|
+
availableProperties: h
|
|
2802
3046
|
}
|
|
2803
3047
|
) })
|
|
2804
3048
|
] });
|
|
@@ -2811,37 +3055,37 @@ const ce = () => ({
|
|
|
2811
3055
|
visible: !0,
|
|
2812
3056
|
dataMode: "vector-tiles"
|
|
2813
3057
|
});
|
|
2814
|
-
function
|
|
2815
|
-
const [
|
|
2816
|
-
|
|
2817
|
-
},
|
|
2818
|
-
|
|
2819
|
-
}, E = (
|
|
2820
|
-
|
|
2821
|
-
},
|
|
2822
|
-
if (
|
|
3058
|
+
function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
3059
|
+
const [p, u] = T(null), [n, x] = T(!1), [s, g] = T(ce()), [d, w] = T(null), [c, o] = T(null), [h, N] = T(null), v = () => {
|
|
3060
|
+
i([...e, s]), x(!1), g(ce());
|
|
3061
|
+
}, C = (y) => {
|
|
3062
|
+
i(e.map((k) => k.id === p ? y : k));
|
|
3063
|
+
}, E = (y) => {
|
|
3064
|
+
i(e.filter((k) => k.id !== y)), w(null), p === y && u(null);
|
|
3065
|
+
}, O = (y) => {
|
|
3066
|
+
if (y === 0) return;
|
|
2823
3067
|
const k = [...e];
|
|
2824
|
-
[k[
|
|
2825
|
-
}, m = (
|
|
2826
|
-
if (
|
|
3068
|
+
[k[y - 1], k[y]] = [k[y], k[y - 1]], i(k);
|
|
3069
|
+
}, m = (y) => {
|
|
3070
|
+
if (y === e.length - 1) return;
|
|
2827
3071
|
const k = [...e];
|
|
2828
|
-
[k[
|
|
2829
|
-
},
|
|
2830
|
-
|
|
2831
|
-
},
|
|
2832
|
-
|
|
2833
|
-
},
|
|
3072
|
+
[k[y], k[y + 1]] = [k[y + 1], k[y]], i(k);
|
|
3073
|
+
}, L = (y, k) => {
|
|
3074
|
+
o(k), y.dataTransfer.effectAllowed = "move", y.dataTransfer.setData("text/plain", k);
|
|
3075
|
+
}, F = (y, k) => {
|
|
3076
|
+
y.preventDefault(), y.dataTransfer.dropEffect = "move", N(k);
|
|
3077
|
+
}, b = () => {
|
|
2834
3078
|
N(null);
|
|
2835
|
-
},
|
|
2836
|
-
|
|
2837
|
-
const
|
|
2838
|
-
if (
|
|
2839
|
-
const R = e.findIndex((
|
|
2840
|
-
if (R === -1 ||
|
|
2841
|
-
const
|
|
2842
|
-
|
|
3079
|
+
}, M = (y, k) => {
|
|
3080
|
+
y.preventDefault(), N(null);
|
|
3081
|
+
const j = c;
|
|
3082
|
+
if (o(null), !j || j === k) return;
|
|
3083
|
+
const R = e.findIndex((G) => G.id === j), W = e.findIndex((G) => G.id === k);
|
|
3084
|
+
if (R === -1 || W === -1) return;
|
|
3085
|
+
const U = [...e];
|
|
3086
|
+
U.splice(R, 1), U.splice(W, 0, e[R]), i(U);
|
|
2843
3087
|
}, P = () => {
|
|
2844
|
-
|
|
3088
|
+
o(null), N(null);
|
|
2845
3089
|
};
|
|
2846
3090
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2847
3091
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -2858,23 +3102,23 @@ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2858
3102
|
}
|
|
2859
3103
|
)
|
|
2860
3104
|
] }),
|
|
2861
|
-
e.length === 0 && !
|
|
2862
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
2863
|
-
var
|
|
2864
|
-
const
|
|
3105
|
+
e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
|
|
3106
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((y, k) => {
|
|
3107
|
+
var U, G, J, K, Q;
|
|
3108
|
+
const j = c === y.id, R = h === y.id, W = p === y.id;
|
|
2865
3109
|
return /* @__PURE__ */ l(
|
|
2866
3110
|
"li",
|
|
2867
3111
|
{
|
|
2868
|
-
draggable: !
|
|
2869
|
-
onDragStart:
|
|
2870
|
-
onDragOver: (
|
|
2871
|
-
onDragLeave:
|
|
2872
|
-
onDrop: (
|
|
3112
|
+
draggable: !W,
|
|
3113
|
+
onDragStart: W ? void 0 : (f) => L(f, y.id),
|
|
3114
|
+
onDragOver: (f) => F(f, y.id),
|
|
3115
|
+
onDragLeave: b,
|
|
3116
|
+
onDrop: (f) => M(f, y.id),
|
|
2873
3117
|
onDragEnd: P,
|
|
2874
3118
|
className: [
|
|
2875
3119
|
"mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
|
|
2876
3120
|
R ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
|
|
2877
|
-
|
|
3121
|
+
j ? "mapui:opacity-50" : "mapui:opacity-100"
|
|
2878
3122
|
].join(" "),
|
|
2879
3123
|
children: [
|
|
2880
3124
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:gap-2 mapui:px-3 mapui:py-2", children: [
|
|
@@ -2884,7 +3128,7 @@ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2884
3128
|
"button",
|
|
2885
3129
|
{
|
|
2886
3130
|
type: "button",
|
|
2887
|
-
onClick: () =>
|
|
3131
|
+
onClick: () => O(k),
|
|
2888
3132
|
disabled: k === 0,
|
|
2889
3133
|
"aria-label": "Move layer up",
|
|
2890
3134
|
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",
|
|
@@ -2912,18 +3156,24 @@ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2912
3156
|
}
|
|
2913
3157
|
),
|
|
2914
3158
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
|
|
2915
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
2916
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3159
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: y.label || y.id }),
|
|
3160
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: y.collection }),
|
|
2917
3161
|
/* @__PURE__ */ l("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
|
|
2918
|
-
/* @__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:
|
|
2919
|
-
(((
|
|
2920
|
-
|
|
2921
|
-
(((J = (
|
|
2922
|
-
|
|
3162
|
+
/* @__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: y.dataMode }),
|
|
3163
|
+
(((U = y.styles) == null ? void 0 : U.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: y.styles.map((f) => f.type).join(" · ") }),
|
|
3164
|
+
y.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" }),
|
|
3165
|
+
(((J = (G = y.search) == null ? void 0 : G.fields) == null ? void 0 : J.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: [
|
|
3166
|
+
y.search.fields.length,
|
|
2923
3167
|
" search fields"
|
|
2924
3168
|
] }),
|
|
2925
|
-
(
|
|
2926
|
-
|
|
3169
|
+
(y.minZoom != null || y.maxZoom != null) && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-cyan-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-cyan-700", children: [
|
|
3170
|
+
"z",
|
|
3171
|
+
y.minZoom ?? 0,
|
|
3172
|
+
"–",
|
|
3173
|
+
y.maxZoom ?? 24
|
|
3174
|
+
] }),
|
|
3175
|
+
(((Q = (K = y.legend) == null ? void 0 : K.entries) == null ? void 0 : Q.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: [
|
|
3176
|
+
y.legend.entries.length,
|
|
2927
3177
|
" legend entries"
|
|
2928
3178
|
] })
|
|
2929
3179
|
] })
|
|
@@ -2934,44 +3184,44 @@ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
2934
3184
|
"button",
|
|
2935
3185
|
{
|
|
2936
3186
|
type: "button",
|
|
2937
|
-
onClick: () =>
|
|
3187
|
+
onClick: () => u(p === y.id ? null : y.id),
|
|
2938
3188
|
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",
|
|
2939
|
-
children:
|
|
3189
|
+
children: p === y.id ? "Close" : "Edit"
|
|
2940
3190
|
}
|
|
2941
3191
|
),
|
|
2942
3192
|
/* @__PURE__ */ a(
|
|
2943
3193
|
"button",
|
|
2944
3194
|
{
|
|
2945
3195
|
type: "button",
|
|
2946
|
-
onClick: () => w(
|
|
3196
|
+
onClick: () => w(y.id),
|
|
2947
3197
|
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",
|
|
2948
3198
|
children: "Remove"
|
|
2949
3199
|
}
|
|
2950
3200
|
)
|
|
2951
3201
|
] })
|
|
2952
3202
|
] }),
|
|
2953
|
-
|
|
2954
|
-
|
|
3203
|
+
p === y.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
3204
|
+
Oe,
|
|
2955
3205
|
{
|
|
2956
|
-
value:
|
|
2957
|
-
onChange:
|
|
2958
|
-
availableSources:
|
|
3206
|
+
value: y,
|
|
3207
|
+
onChange: C,
|
|
3208
|
+
availableSources: t,
|
|
2959
3209
|
availableIcons: r
|
|
2960
3210
|
}
|
|
2961
3211
|
) })
|
|
2962
3212
|
]
|
|
2963
3213
|
},
|
|
2964
|
-
|
|
3214
|
+
y.id
|
|
2965
3215
|
);
|
|
2966
3216
|
}) }),
|
|
2967
|
-
|
|
3217
|
+
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
2968
3218
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
|
|
2969
3219
|
/* @__PURE__ */ a(
|
|
2970
|
-
|
|
3220
|
+
Oe,
|
|
2971
3221
|
{
|
|
2972
3222
|
value: s,
|
|
2973
3223
|
onChange: g,
|
|
2974
|
-
availableSources:
|
|
3224
|
+
availableSources: t,
|
|
2975
3225
|
availableIcons: r
|
|
2976
3226
|
}
|
|
2977
3227
|
),
|
|
@@ -3000,56 +3250,56 @@ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r })
|
|
|
3000
3250
|
/* @__PURE__ */ a(
|
|
3001
3251
|
re,
|
|
3002
3252
|
{
|
|
3003
|
-
open:
|
|
3253
|
+
open: d !== null,
|
|
3004
3254
|
title: "Remove Layer",
|
|
3005
3255
|
description: "Are you sure you want to remove this layer from the configuration?",
|
|
3006
|
-
onConfirm: () =>
|
|
3256
|
+
onConfirm: () => d && E(d),
|
|
3007
3257
|
onCancel: () => w(null)
|
|
3008
3258
|
}
|
|
3009
3259
|
)
|
|
3010
3260
|
] });
|
|
3011
3261
|
}
|
|
3012
3262
|
const te = "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";
|
|
3013
|
-
function
|
|
3014
|
-
const
|
|
3263
|
+
function je({ value: e, onChange: i }) {
|
|
3264
|
+
const t = (r) => i({ ...e, ...r });
|
|
3015
3265
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3016
|
-
/* @__PURE__ */ a(
|
|
3266
|
+
/* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
3017
3267
|
"input",
|
|
3018
3268
|
{
|
|
3019
3269
|
type: "text",
|
|
3020
3270
|
value: e.id,
|
|
3021
|
-
onChange: (r) =>
|
|
3271
|
+
onChange: (r) => t({ id: r.target.value }),
|
|
3022
3272
|
placeholder: "osm",
|
|
3023
3273
|
className: te
|
|
3024
3274
|
}
|
|
3025
3275
|
) }),
|
|
3026
|
-
/* @__PURE__ */ a(
|
|
3276
|
+
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
3027
3277
|
"input",
|
|
3028
3278
|
{
|
|
3029
3279
|
type: "text",
|
|
3030
3280
|
value: e.label,
|
|
3031
|
-
onChange: (r) =>
|
|
3281
|
+
onChange: (r) => t({ label: r.target.value }),
|
|
3032
3282
|
placeholder: "OpenStreetMap",
|
|
3033
3283
|
className: te
|
|
3034
3284
|
}
|
|
3035
3285
|
) }),
|
|
3036
|
-
/* @__PURE__ */ a(
|
|
3286
|
+
/* @__PURE__ */ a(S, { label: "Style URL", required: !0, children: /* @__PURE__ */ a(
|
|
3037
3287
|
"input",
|
|
3038
3288
|
{
|
|
3039
3289
|
type: "url",
|
|
3040
3290
|
value: e.url,
|
|
3041
|
-
onChange: (r) =>
|
|
3291
|
+
onChange: (r) => t({ url: r.target.value }),
|
|
3042
3292
|
placeholder: "https://example.com/style.json",
|
|
3043
3293
|
className: te
|
|
3044
3294
|
}
|
|
3045
3295
|
) }),
|
|
3046
|
-
/* @__PURE__ */ l(
|
|
3296
|
+
/* @__PURE__ */ l(S, { label: "Thumbnail URL (optional)", children: [
|
|
3047
3297
|
/* @__PURE__ */ a(
|
|
3048
3298
|
"input",
|
|
3049
3299
|
{
|
|
3050
3300
|
type: "url",
|
|
3051
3301
|
value: e.thumbnail ?? "",
|
|
3052
|
-
onChange: (r) =>
|
|
3302
|
+
onChange: (r) => t({ thumbnail: r.target.value || void 0 }),
|
|
3053
3303
|
placeholder: "https://example.com/thumbnail.png",
|
|
3054
3304
|
className: te
|
|
3055
3305
|
}
|
|
@@ -3066,13 +3316,13 @@ function Oe({ value: e, onChange: t }) {
|
|
|
3066
3316
|
] });
|
|
3067
3317
|
}
|
|
3068
3318
|
const de = () => ({ id: "", label: "", url: "" });
|
|
3069
|
-
function
|
|
3070
|
-
const [
|
|
3071
|
-
|
|
3319
|
+
function Ai({ basemaps: e, onChange: i }) {
|
|
3320
|
+
const [t, r] = T(null), [p, u] = T(!1), [n, x] = T(de()), [s, g] = T(null), d = (o) => {
|
|
3321
|
+
i(e.map((h) => h.id === t ? o : h));
|
|
3072
3322
|
}, w = () => {
|
|
3073
|
-
|
|
3074
|
-
}, c = (
|
|
3075
|
-
|
|
3323
|
+
i([...e, n]), u(!1), x(de());
|
|
3324
|
+
}, c = (o) => {
|
|
3325
|
+
i(e.filter((h) => h.id !== o)), g(null);
|
|
3076
3326
|
};
|
|
3077
3327
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3078
3328
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -3082,68 +3332,68 @@ function ht({ basemaps: e, onChange: t }) {
|
|
|
3082
3332
|
{
|
|
3083
3333
|
type: "button",
|
|
3084
3334
|
onClick: () => {
|
|
3085
|
-
|
|
3335
|
+
u(!0), x(de());
|
|
3086
3336
|
},
|
|
3087
3337
|
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",
|
|
3088
3338
|
children: "+ Add Basemap"
|
|
3089
3339
|
}
|
|
3090
3340
|
)
|
|
3091
3341
|
] }),
|
|
3092
|
-
e.length === 0 && !
|
|
3093
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
3342
|
+
e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No basemaps configured." }),
|
|
3343
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((o) => /* @__PURE__ */ l(
|
|
3094
3344
|
"li",
|
|
3095
3345
|
{
|
|
3096
3346
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
|
|
3097
3347
|
children: [
|
|
3098
3348
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
|
|
3099
|
-
|
|
3349
|
+
o.thumbnail && /* @__PURE__ */ a(
|
|
3100
3350
|
"img",
|
|
3101
3351
|
{
|
|
3102
|
-
src:
|
|
3352
|
+
src: o.thumbnail,
|
|
3103
3353
|
alt: "",
|
|
3104
3354
|
className: "mapui:h-10 mapui:w-14 mapui:shrink-0 mapui:rounded mapui:object-cover"
|
|
3105
3355
|
}
|
|
3106
3356
|
),
|
|
3107
3357
|
/* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
|
|
3108
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3109
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3358
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: o.label || o.id }),
|
|
3359
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: o.url })
|
|
3110
3360
|
] }),
|
|
3111
3361
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
|
|
3112
3362
|
/* @__PURE__ */ a(
|
|
3113
3363
|
"button",
|
|
3114
3364
|
{
|
|
3115
3365
|
type: "button",
|
|
3116
|
-
onClick: () => r(
|
|
3366
|
+
onClick: () => r(t === o.id ? null : o.id),
|
|
3117
3367
|
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",
|
|
3118
|
-
children:
|
|
3368
|
+
children: t === o.id ? "Close" : "Edit"
|
|
3119
3369
|
}
|
|
3120
3370
|
),
|
|
3121
3371
|
/* @__PURE__ */ a(
|
|
3122
3372
|
"button",
|
|
3123
3373
|
{
|
|
3124
3374
|
type: "button",
|
|
3125
|
-
onClick: () => g(
|
|
3375
|
+
onClick: () => g(o.id),
|
|
3126
3376
|
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",
|
|
3127
3377
|
children: "Remove"
|
|
3128
3378
|
}
|
|
3129
3379
|
)
|
|
3130
3380
|
] })
|
|
3131
3381
|
] }),
|
|
3132
|
-
|
|
3382
|
+
t === o.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(je, { value: o, onChange: d }) })
|
|
3133
3383
|
]
|
|
3134
3384
|
},
|
|
3135
|
-
|
|
3385
|
+
o.id
|
|
3136
3386
|
)) }),
|
|
3137
|
-
|
|
3387
|
+
p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
3138
3388
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
|
|
3139
|
-
/* @__PURE__ */ a(
|
|
3389
|
+
/* @__PURE__ */ a(je, { value: n, onChange: x }),
|
|
3140
3390
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
3141
3391
|
/* @__PURE__ */ a(
|
|
3142
3392
|
"button",
|
|
3143
3393
|
{
|
|
3144
3394
|
type: "button",
|
|
3145
3395
|
onClick: w,
|
|
3146
|
-
disabled: !
|
|
3396
|
+
disabled: !n.id || !n.url,
|
|
3147
3397
|
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",
|
|
3148
3398
|
children: "Save"
|
|
3149
3399
|
}
|
|
@@ -3152,7 +3402,7 @@ function ht({ basemaps: e, onChange: t }) {
|
|
|
3152
3402
|
"button",
|
|
3153
3403
|
{
|
|
3154
3404
|
type: "button",
|
|
3155
|
-
onClick: () =>
|
|
3405
|
+
onClick: () => u(!1),
|
|
3156
3406
|
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",
|
|
3157
3407
|
children: "Cancel"
|
|
3158
3408
|
}
|
|
@@ -3171,29 +3421,29 @@ function ht({ basemaps: e, onChange: t }) {
|
|
|
3171
3421
|
)
|
|
3172
3422
|
] });
|
|
3173
3423
|
}
|
|
3174
|
-
const
|
|
3175
|
-
function
|
|
3176
|
-
const
|
|
3424
|
+
const $e = "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";
|
|
3425
|
+
function Re({ value: e, onChange: i }) {
|
|
3426
|
+
const t = (r) => i({ ...e, ...r });
|
|
3177
3427
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3178
|
-
/* @__PURE__ */ a(
|
|
3428
|
+
/* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
3179
3429
|
"input",
|
|
3180
3430
|
{
|
|
3181
3431
|
type: "text",
|
|
3182
3432
|
value: e.id,
|
|
3183
|
-
onChange: (r) =>
|
|
3433
|
+
onChange: (r) => t({ id: r.target.value }),
|
|
3184
3434
|
placeholder: "my-sprites",
|
|
3185
|
-
className:
|
|
3435
|
+
className: $e
|
|
3186
3436
|
}
|
|
3187
3437
|
) }),
|
|
3188
|
-
/* @__PURE__ */ l(
|
|
3438
|
+
/* @__PURE__ */ l(S, { label: "Sprite URL", required: !0, children: [
|
|
3189
3439
|
/* @__PURE__ */ a(
|
|
3190
3440
|
"input",
|
|
3191
3441
|
{
|
|
3192
3442
|
type: "url",
|
|
3193
3443
|
value: e.url,
|
|
3194
|
-
onChange: (r) =>
|
|
3444
|
+
onChange: (r) => t({ url: r.target.value }),
|
|
3195
3445
|
placeholder: "https://example.com/sprites/sprite",
|
|
3196
|
-
className:
|
|
3446
|
+
className: $e
|
|
3197
3447
|
}
|
|
3198
3448
|
),
|
|
3199
3449
|
/* @__PURE__ */ l("p", { className: "mapui:mt-1 mapui:text-xs mapui:text-gray-400", children: [
|
|
@@ -3206,21 +3456,21 @@ function $e({ value: e, onChange: t }) {
|
|
|
3206
3456
|
] })
|
|
3207
3457
|
] });
|
|
3208
3458
|
}
|
|
3209
|
-
const he = () => ({ id: "", url: "" }),
|
|
3459
|
+
const he = () => ({ id: "", url: "" }), oi = (e) => {
|
|
3210
3460
|
try {
|
|
3211
3461
|
return new URL(e), !0;
|
|
3212
3462
|
} catch {
|
|
3213
3463
|
return !1;
|
|
3214
3464
|
}
|
|
3215
3465
|
};
|
|
3216
|
-
function
|
|
3217
|
-
const [
|
|
3218
|
-
|
|
3466
|
+
function Ei({ sprites: e, onChange: i }) {
|
|
3467
|
+
const [t, r] = T(null), [p, u] = T(!1), [n, x] = T(he()), [s, g] = T(null), d = (o) => {
|
|
3468
|
+
i(e.map((h, N) => N === t ? o : h));
|
|
3219
3469
|
}, w = () => {
|
|
3220
|
-
|
|
3221
|
-
}, c = (
|
|
3222
|
-
const
|
|
3223
|
-
|
|
3470
|
+
i([...e, n]), u(!1), x(he());
|
|
3471
|
+
}, c = (o) => {
|
|
3472
|
+
const h = e.findIndex((N) => N.id === o);
|
|
3473
|
+
i(e.filter((N) => N.id !== o)), t !== null && (h === t ? r(null) : h < t && r(t - 1)), g(null);
|
|
3224
3474
|
};
|
|
3225
3475
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3226
3476
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -3230,60 +3480,60 @@ function gt({ sprites: e, onChange: t }) {
|
|
|
3230
3480
|
{
|
|
3231
3481
|
type: "button",
|
|
3232
3482
|
onClick: () => {
|
|
3233
|
-
|
|
3483
|
+
u(!0), x(he());
|
|
3234
3484
|
},
|
|
3235
3485
|
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",
|
|
3236
3486
|
children: "+ Add Sprite Sheet"
|
|
3237
3487
|
}
|
|
3238
3488
|
)
|
|
3239
3489
|
] }),
|
|
3240
|
-
e.length === 0 && !
|
|
3241
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
3490
|
+
e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No custom sprite sheets. Basemap icons are available automatically." }),
|
|
3491
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((o, h) => /* @__PURE__ */ l(
|
|
3242
3492
|
"li",
|
|
3243
3493
|
{
|
|
3244
3494
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
|
|
3245
3495
|
children: [
|
|
3246
3496
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
|
|
3247
3497
|
/* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
|
|
3248
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3249
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3498
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: o.id }),
|
|
3499
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: o.url })
|
|
3250
3500
|
] }),
|
|
3251
3501
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
|
|
3252
3502
|
/* @__PURE__ */ a(
|
|
3253
3503
|
"button",
|
|
3254
3504
|
{
|
|
3255
3505
|
type: "button",
|
|
3256
|
-
onClick: () => r(
|
|
3506
|
+
onClick: () => r(t === h ? null : h),
|
|
3257
3507
|
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",
|
|
3258
|
-
children:
|
|
3508
|
+
children: t === h ? "Close" : "Edit"
|
|
3259
3509
|
}
|
|
3260
3510
|
),
|
|
3261
3511
|
/* @__PURE__ */ a(
|
|
3262
3512
|
"button",
|
|
3263
3513
|
{
|
|
3264
3514
|
type: "button",
|
|
3265
|
-
onClick: () => g(
|
|
3515
|
+
onClick: () => g(o.id),
|
|
3266
3516
|
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",
|
|
3267
3517
|
children: "Remove"
|
|
3268
3518
|
}
|
|
3269
3519
|
)
|
|
3270
3520
|
] })
|
|
3271
3521
|
] }),
|
|
3272
|
-
|
|
3522
|
+
t === h && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Re, { value: o, onChange: d }) })
|
|
3273
3523
|
]
|
|
3274
3524
|
},
|
|
3275
|
-
|
|
3525
|
+
h
|
|
3276
3526
|
)) }),
|
|
3277
|
-
|
|
3527
|
+
p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
3278
3528
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
|
|
3279
|
-
/* @__PURE__ */ a(
|
|
3529
|
+
/* @__PURE__ */ a(Re, { value: n, onChange: x }),
|
|
3280
3530
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
3281
3531
|
/* @__PURE__ */ a(
|
|
3282
3532
|
"button",
|
|
3283
3533
|
{
|
|
3284
3534
|
type: "button",
|
|
3285
3535
|
onClick: w,
|
|
3286
|
-
disabled: !
|
|
3536
|
+
disabled: !n.id || !n.url || !oi(n.url) || e.some((o) => o.id === n.id),
|
|
3287
3537
|
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",
|
|
3288
3538
|
children: "Save"
|
|
3289
3539
|
}
|
|
@@ -3292,7 +3542,7 @@ function gt({ sprites: e, onChange: t }) {
|
|
|
3292
3542
|
"button",
|
|
3293
3543
|
{
|
|
3294
3544
|
type: "button",
|
|
3295
|
-
onClick: () =>
|
|
3545
|
+
onClick: () => u(!1),
|
|
3296
3546
|
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",
|
|
3297
3547
|
children: "Cancel"
|
|
3298
3548
|
}
|
|
@@ -3311,7 +3561,7 @@ function gt({ sprites: e, onChange: t }) {
|
|
|
3311
3561
|
)
|
|
3312
3562
|
] });
|
|
3313
3563
|
}
|
|
3314
|
-
const
|
|
3564
|
+
const mi = [
|
|
3315
3565
|
{ key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
|
|
3316
3566
|
{ key: "showLegend", label: "Legend", description: "Map legend" },
|
|
3317
3567
|
{ key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
|
|
@@ -3321,34 +3571,35 @@ const Qa = [
|
|
|
3321
3571
|
{ key: "showFeatureTooltip", label: "Feature Tooltip", description: "Hover tooltip on features" },
|
|
3322
3572
|
{ key: "showExportButton", label: "Export Button", description: "Export data as CSV" },
|
|
3323
3573
|
{ key: "showLegendOpacity", label: "Legend Opacity", description: "Expand legend with opacity sliders" },
|
|
3324
|
-
{ key: "showMeasureTool", label: "Measure Tool", description: "Measure distances and areas on the map" }
|
|
3574
|
+
{ key: "showMeasureTool", label: "Measure Tool", description: "Measure distances and areas on the map" },
|
|
3575
|
+
{ key: "showSelectionTool", label: "Selection Tool", description: "Select features by click or box draw" }
|
|
3325
3576
|
];
|
|
3326
|
-
function
|
|
3327
|
-
const
|
|
3328
|
-
|
|
3577
|
+
function Ii({ value: e, onChange: i }) {
|
|
3578
|
+
const t = (r, p) => {
|
|
3579
|
+
i({ ...e, [r]: p });
|
|
3329
3580
|
};
|
|
3330
3581
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
3331
3582
|
/* @__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." }),
|
|
3332
|
-
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children:
|
|
3333
|
-
const
|
|
3583
|
+
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: mi.map(({ key: r, label: p, description: u }) => {
|
|
3584
|
+
const n = e[r];
|
|
3334
3585
|
return /* @__PURE__ */ l(
|
|
3335
3586
|
"label",
|
|
3336
3587
|
{
|
|
3337
3588
|
className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:gap-3 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-2 hover:mapui:bg-gray-50",
|
|
3338
3589
|
children: [
|
|
3339
3590
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
3340
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3341
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children:
|
|
3591
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: p }),
|
|
3592
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: u })
|
|
3342
3593
|
] }),
|
|
3343
3594
|
/* @__PURE__ */ l("div", { className: "mapui:relative mapui:flex mapui:shrink-0 mapui:items-center", children: [
|
|
3344
3595
|
/* @__PURE__ */ a(
|
|
3345
3596
|
"input",
|
|
3346
3597
|
{
|
|
3347
3598
|
type: "checkbox",
|
|
3348
|
-
checked:
|
|
3349
|
-
onChange: (x) =>
|
|
3599
|
+
checked: n,
|
|
3600
|
+
onChange: (x) => t(r, x.target.checked),
|
|
3350
3601
|
className: "mapui:sr-only",
|
|
3351
|
-
"aria-label":
|
|
3602
|
+
"aria-label": p
|
|
3352
3603
|
}
|
|
3353
3604
|
),
|
|
3354
3605
|
/* @__PURE__ */ a(
|
|
@@ -3356,14 +3607,14 @@ function bt({ value: e, onChange: t }) {
|
|
|
3356
3607
|
{
|
|
3357
3608
|
className: [
|
|
3358
3609
|
"mapui:relative mapui:h-5 mapui:w-9 mapui:rounded-full mapui:transition-colors",
|
|
3359
|
-
|
|
3610
|
+
n ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
|
|
3360
3611
|
].join(" "),
|
|
3361
3612
|
children: /* @__PURE__ */ a(
|
|
3362
3613
|
"div",
|
|
3363
3614
|
{
|
|
3364
3615
|
className: [
|
|
3365
3616
|
"mapui:absolute mapui:top-0.5 mapui:h-4 mapui:w-4 mapui:rounded-full mapui:bg-white mapui:shadow mapui:transition-transform",
|
|
3366
|
-
|
|
3617
|
+
n ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
|
|
3367
3618
|
].join(" ")
|
|
3368
3619
|
}
|
|
3369
3620
|
)
|
|
@@ -3377,46 +3628,46 @@ function bt({ value: e, onChange: t }) {
|
|
|
3377
3628
|
}) })
|
|
3378
3629
|
] });
|
|
3379
3630
|
}
|
|
3380
|
-
const
|
|
3631
|
+
const Je = [
|
|
3381
3632
|
{ key: "latitude", label: "Latitude", min: -90, max: 90, step: 1e-6, placeholder: "0" },
|
|
3382
3633
|
{ key: "longitude", label: "Longitude", min: -180, max: 180, step: 1e-6, placeholder: "0" },
|
|
3383
3634
|
{ key: "zoom", label: "Zoom", min: 0, max: 24, step: 0.1, placeholder: "2" },
|
|
3384
3635
|
{ key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
|
|
3385
3636
|
{ key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
|
|
3386
3637
|
];
|
|
3387
|
-
function
|
|
3388
|
-
const
|
|
3389
|
-
if (
|
|
3390
|
-
if (isNaN(
|
|
3391
|
-
if (
|
|
3392
|
-
if (
|
|
3638
|
+
function si(e, i) {
|
|
3639
|
+
const t = Je.find((r) => r.key === e);
|
|
3640
|
+
if (t) {
|
|
3641
|
+
if (isNaN(i)) return "Must be a number";
|
|
3642
|
+
if (i < t.min) return `Must be at least ${t.min}`;
|
|
3643
|
+
if (i > t.max) return `Must be at most ${t.max}`;
|
|
3393
3644
|
}
|
|
3394
3645
|
}
|
|
3395
|
-
const
|
|
3396
|
-
function
|
|
3397
|
-
const
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3646
|
+
const ci = "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";
|
|
3647
|
+
function Mi({ value: e, onChange: i }) {
|
|
3648
|
+
const t = (r, p) => {
|
|
3649
|
+
const u = parseFloat(p);
|
|
3650
|
+
i({ ...e, [r]: isNaN(u) ? 0 : u });
|
|
3400
3651
|
};
|
|
3401
|
-
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children:
|
|
3402
|
-
const g =
|
|
3403
|
-
return /* @__PURE__ */ a(
|
|
3652
|
+
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Je.map(({ key: r, label: p, min: u, max: n, step: x, placeholder: s }) => {
|
|
3653
|
+
const g = si(r, e[r]);
|
|
3654
|
+
return /* @__PURE__ */ a(S, { label: p, error: g, children: /* @__PURE__ */ a(
|
|
3404
3655
|
"input",
|
|
3405
3656
|
{
|
|
3406
3657
|
type: "number",
|
|
3407
|
-
min:
|
|
3408
|
-
max:
|
|
3658
|
+
min: u,
|
|
3659
|
+
max: n,
|
|
3409
3660
|
step: x,
|
|
3410
3661
|
value: e[r],
|
|
3411
3662
|
placeholder: s,
|
|
3412
|
-
onChange: (
|
|
3413
|
-
className: `${
|
|
3663
|
+
onChange: (d) => t(r, d.target.value),
|
|
3664
|
+
className: `${ci} ${g ? "mapui:border-red-400" : ""}`
|
|
3414
3665
|
}
|
|
3415
3666
|
) }, r);
|
|
3416
3667
|
}) });
|
|
3417
3668
|
}
|
|
3418
|
-
function
|
|
3419
|
-
const
|
|
3669
|
+
function Fi({ config: e }) {
|
|
3670
|
+
const i = sa(e);
|
|
3420
3671
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3421
3672
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
3422
3673
|
/* @__PURE__ */ a(
|
|
@@ -3424,170 +3675,205 @@ function ft({ config: e }) {
|
|
|
3424
3675
|
{
|
|
3425
3676
|
className: [
|
|
3426
3677
|
"mapui:inline-flex mapui:items-center mapui:rounded-full mapui:px-2.5 mapui:py-0.5 mapui:text-xs mapui:font-semibold",
|
|
3427
|
-
|
|
3678
|
+
i.success ? "mapui:bg-green-100 mapui:text-green-800" : "mapui:bg-red-100 mapui:text-red-800"
|
|
3428
3679
|
].join(" "),
|
|
3429
|
-
children:
|
|
3680
|
+
children: i.success ? "Valid" : "Invalid"
|
|
3430
3681
|
}
|
|
3431
3682
|
),
|
|
3432
3683
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: "MapConfig validation" })
|
|
3433
3684
|
] }),
|
|
3434
|
-
!
|
|
3685
|
+
!i.success && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3", children: [
|
|
3435
3686
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:font-semibold mapui:text-red-700", children: "Validation Errors" }),
|
|
3436
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children:
|
|
3437
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-red-600", children:
|
|
3438
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-800", children:
|
|
3687
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: i.error.errors.map((t, r) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
3688
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-red-600", children: t.path.join(" > ") || "root" }),
|
|
3689
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-800", children: t.message })
|
|
3439
3690
|
] }, r)) })
|
|
3440
3691
|
] }),
|
|
3441
3692
|
/* @__PURE__ */ a("div", { className: "mapui:overflow-auto mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-gray-50", children: /* @__PURE__ */ a("pre", { className: "mapui:m-0 mapui:p-3 mapui:text-xs mapui:text-gray-800 mapui:whitespace-pre", children: JSON.stringify(e, null, 2) }) })
|
|
3442
3693
|
] });
|
|
3443
3694
|
}
|
|
3695
|
+
function di(e, i) {
|
|
3696
|
+
const [t, r] = e, [p, u] = i;
|
|
3697
|
+
return {
|
|
3698
|
+
type: "Polygon",
|
|
3699
|
+
coordinates: [[
|
|
3700
|
+
[t, r],
|
|
3701
|
+
[p, r],
|
|
3702
|
+
[p, u],
|
|
3703
|
+
[t, u],
|
|
3704
|
+
[t, r]
|
|
3705
|
+
]]
|
|
3706
|
+
};
|
|
3707
|
+
}
|
|
3708
|
+
function Pi(e, i) {
|
|
3709
|
+
return {
|
|
3710
|
+
type: "Feature",
|
|
3711
|
+
properties: {},
|
|
3712
|
+
geometry: di(e, i)
|
|
3713
|
+
};
|
|
3714
|
+
}
|
|
3444
3715
|
export {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3716
|
+
pr as BasemapConfigSchema,
|
|
3717
|
+
je as BasemapEditor,
|
|
3718
|
+
Ai as BasemapList,
|
|
3719
|
+
$i as BasemapSwitcher,
|
|
3720
|
+
nr as BrandingConfigSchema,
|
|
3721
|
+
ur as CircleLayoutSchema,
|
|
3722
|
+
or as CirclePaintSchema,
|
|
3723
|
+
mr as CircleStyleSchema,
|
|
3724
|
+
Bi as CollapsibleControl,
|
|
3725
|
+
X as CollapsibleSection,
|
|
3726
|
+
Ci as CollectionBrowser,
|
|
3727
|
+
Z as ColorPicker,
|
|
3728
|
+
Fi as ConfigPreview,
|
|
3456
3729
|
re as ConfirmDialog,
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3730
|
+
Ui as CoordinateDisplay,
|
|
3731
|
+
sr as DEFAULT_HEADER_COLOR,
|
|
3732
|
+
cr as DatetimeSearchFieldSchema,
|
|
3733
|
+
_i as ExportButton,
|
|
3734
|
+
xi as ExportModal,
|
|
3735
|
+
Hi as FeatureDetailPanel,
|
|
3736
|
+
Xi as FeatureTooltip,
|
|
3737
|
+
dr as FillLayoutSchema,
|
|
3738
|
+
hr as FillPaintSchema,
|
|
3739
|
+
gr as FillStyleSchema,
|
|
3740
|
+
br as FilterConfigSchema,
|
|
3741
|
+
S as FormField,
|
|
3742
|
+
yr as GeometryTypeSchema,
|
|
3743
|
+
fr as LayerConfigSchema,
|
|
3744
|
+
Oe as LayerEditor,
|
|
3745
|
+
Li as LayerList,
|
|
3746
|
+
Ji as LayerPanel,
|
|
3747
|
+
Qi as Legend,
|
|
3748
|
+
xr as LegendConfigSchema,
|
|
3749
|
+
Xa as LegendEditor,
|
|
3750
|
+
Ya as LegendEntryEditor,
|
|
3751
|
+
wr as LegendEntrySchema,
|
|
3752
|
+
Nr as LineLayoutSchema,
|
|
3753
|
+
vr as LinePaintSchema,
|
|
3754
|
+
kr as LineStyleSchema,
|
|
3755
|
+
Cr as MapConfigSchema,
|
|
3756
|
+
wi as MeasurePanel,
|
|
3757
|
+
Sr as NumberSearchFieldSchema,
|
|
3758
|
+
Tr as OgcApiSourceSchema,
|
|
3759
|
+
Dr as PropertyDisplayConfigSchema,
|
|
3760
|
+
ii as PropertyDisplayEditor,
|
|
3761
|
+
Lr as PropertyDisplaySchema,
|
|
3762
|
+
vi as ResultsDrawer,
|
|
3763
|
+
Ar as SearchConfigSchema,
|
|
3764
|
+
Ja as SearchFieldEditor,
|
|
3765
|
+
Qa as SearchFieldList,
|
|
3766
|
+
Er as SearchFieldSchema,
|
|
3767
|
+
rr as SearchPanel,
|
|
3768
|
+
Ir as SelectSearchFieldSchema,
|
|
3769
|
+
Ni as SelectionPanel,
|
|
3770
|
+
we as SourceEditor,
|
|
3771
|
+
ki as SourceList,
|
|
3772
|
+
Re as SpriteSourceEditor,
|
|
3773
|
+
Ei as SpriteSourceList,
|
|
3774
|
+
Mr as SpriteSourceSchema,
|
|
3775
|
+
Fr as StyleConfigSchema,
|
|
3776
|
+
Ha as StyleEditor,
|
|
3777
|
+
Pr as SymbolLayoutSchema,
|
|
3778
|
+
Or as SymbolPaintSchema,
|
|
3779
|
+
jr as SymbolStyleSchema,
|
|
3780
|
+
$r as TextSearchFieldSchema,
|
|
3781
|
+
Ii as UIConfigEditor,
|
|
3782
|
+
Rr as UIConfigSchema,
|
|
3783
|
+
na as UNITS_FOR_MODE,
|
|
3784
|
+
xe as UNIT_LABELS,
|
|
3785
|
+
Br as ViewConfigSchema,
|
|
3786
|
+
Mi as ViewEditor,
|
|
3787
|
+
at as and,
|
|
3788
|
+
it as bboxFromGeometry,
|
|
3789
|
+
tt as between,
|
|
3790
|
+
Pi as buildBoxDrawData,
|
|
3791
|
+
di as buildBoxPolygon,
|
|
3792
|
+
pi as buildDefaultStylesForGeometryTypes,
|
|
3793
|
+
rt as buildGeometryFilter,
|
|
3794
|
+
lt as buildMeasureGeometryData,
|
|
3795
|
+
pt as buildMeasurePointsData,
|
|
3796
|
+
nt as calculateArea,
|
|
3797
|
+
ut as calculateDistance,
|
|
3798
|
+
ot as calculateMeasurement,
|
|
3799
|
+
_e as defaultCircle,
|
|
3521
3800
|
ge as defaultFill,
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3801
|
+
Ga as defaultLine,
|
|
3802
|
+
qa as defaultSymbol,
|
|
3803
|
+
mt as defaultUnitForMode,
|
|
3804
|
+
Xe as detectGeometryStyleTypesFromQueryables,
|
|
3805
|
+
ri as detectGeometryTypeFromQueryables,
|
|
3806
|
+
Ze as detectGeometryTypesFromFeatures,
|
|
3807
|
+
Si as detectStyleTypeForCollection,
|
|
3808
|
+
Ti as detectStyleTypesForCollection,
|
|
3809
|
+
st as downloadBlob,
|
|
3810
|
+
ct as downloadCsv,
|
|
3811
|
+
dt as eq,
|
|
3812
|
+
We as expressionColors,
|
|
3813
|
+
Ia as expressionEntries,
|
|
3814
|
+
Ma as expressionPropertyName,
|
|
3815
|
+
Ea as expressionType,
|
|
3816
|
+
He as extractGeometryType,
|
|
3817
|
+
ht as featuresToCsv,
|
|
3818
|
+
gt as fetchCollectionDetail,
|
|
3819
|
+
bt as fetchCollections,
|
|
3820
|
+
yt as fetchConformance,
|
|
3821
|
+
ma as fetchDistinctValues,
|
|
3822
|
+
ft as fetchFeatureById,
|
|
3823
|
+
xt as fetchFeatureCount,
|
|
3824
|
+
ye as fetchFeatures,
|
|
3545
3825
|
qe as fetchQueryables,
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3826
|
+
wt as fetchSpriteNames,
|
|
3827
|
+
Nt as fetchSpriteUrlFromStyle,
|
|
3828
|
+
vt as fetchTileJson,
|
|
3829
|
+
Gi as formatDMS,
|
|
3830
|
+
qi as formatDecimal,
|
|
3831
|
+
ua as formatMeasurement,
|
|
3832
|
+
kt as fromSimpleFilters,
|
|
3833
|
+
Ct as fromStructuredFilters,
|
|
3834
|
+
Ye as geometryTypeToStyleType,
|
|
3835
|
+
fe as geometryTypeToStyleTypes,
|
|
3836
|
+
pe as getColorFromPalette,
|
|
3837
|
+
St as getCql2FilteredVectorTileUrl,
|
|
3838
|
+
Tt as getFilteredVectorTileUrl,
|
|
3839
|
+
Fa as getPrimaryColor,
|
|
3840
|
+
Pa as getShapeForStyleType,
|
|
3841
|
+
Dt as getTileJsonUrl,
|
|
3842
|
+
Lt as getVectorTileSourceKey,
|
|
3843
|
+
At as getVectorTileUrl,
|
|
3844
|
+
Et as gt,
|
|
3845
|
+
It as gte,
|
|
3846
|
+
Di as humanizePropertyName,
|
|
3847
|
+
Mt as inList,
|
|
3848
|
+
V as isExpression,
|
|
3849
|
+
ti as isGeometryProperty,
|
|
3850
|
+
Ft as isNull,
|
|
3851
|
+
Pt as like,
|
|
3852
|
+
Ot as lt,
|
|
3853
|
+
jt as lte,
|
|
3854
|
+
$t as neq,
|
|
3855
|
+
Rt as not,
|
|
3856
|
+
Bt as or,
|
|
3857
|
+
zt as resolveAvailableIcons,
|
|
3858
|
+
Ut as resolvePropertyDisplay,
|
|
3859
|
+
Gt as resolveStyleWithSprites,
|
|
3860
|
+
qt as sDwithin,
|
|
3861
|
+
Wt as sIntersects,
|
|
3862
|
+
_t as sWithin,
|
|
3863
|
+
sa as safeValidateMapConfig,
|
|
3864
|
+
Vt as selectedFeatureKey,
|
|
3865
|
+
Ht as serializeCql2,
|
|
3866
|
+
Yt as tAfter,
|
|
3867
|
+
Xt as tBefore,
|
|
3868
|
+
Zt as tDuring,
|
|
3869
|
+
li as toAvailableProperties,
|
|
3870
|
+
Jt as useCsvExport,
|
|
3871
|
+
Kt as useExport,
|
|
3872
|
+
Qt as useMeasure,
|
|
3873
|
+
er as useOgcCollectionDetail,
|
|
3874
|
+
Ge as useOgcCollections,
|
|
3875
|
+
ar as useOgcFeatures,
|
|
3876
|
+
oa as useOgcQueryables,
|
|
3877
|
+
ir as useSelection,
|
|
3878
|
+
zr as validateMapConfig
|
|
3593
3879
|
};
|