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