@ogc-maps/storybook-components 0.14.0 → 0.16.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/LICENSE +661 -0
- package/dist/{BasemapSwitcher-BW7lyZ2Y.js → BasemapSwitcher-DuqVusX0.js} +9 -9
- package/dist/CollapsibleControl-BTIkiTmU.js +60 -0
- package/dist/CoordinateDisplay-BblQ34mS.js +154 -0
- package/dist/{ExportButton-Ck1dESnc.js → ExportButton-C8hCCsav.js} +7 -7
- package/dist/{FeatureDetailPanel-CkFpdEKW.js → FeatureDetailPanel-DgCHiNi9.js} +16 -16
- package/dist/FeatureTooltip-DHjMZC0u.js +49 -0
- package/dist/{LayerPanel-SCdJ8948.js → LayerPanel-BkDbZ66Z.js} +23 -23
- package/dist/Legend-CvBd-v0n.js +285 -0
- package/dist/PropertyList-0EonV_BQ.js +33 -0
- package/dist/SearchPanel-DIb7aYVs.js +725 -0
- package/dist/components/BasemapSwitcher/index.js +1 -1
- package/dist/components/CollapsibleControl/CollapsibleControl.d.ts +4 -1
- package/dist/components/CollapsibleControl/CollapsibleControl.d.ts.map +1 -1
- package/dist/components/CollapsibleControl/index.js +1 -1
- package/dist/components/CompassControl/CompassControl.d.ts +19 -0
- package/dist/components/CompassControl/CompassControl.d.ts.map +1 -0
- package/dist/components/CompassControl/index.d.ts +3 -0
- package/dist/components/CompassControl/index.d.ts.map +1 -0
- package/dist/components/CoordinateDisplay/CoordinateDisplay.d.ts +35 -4
- package/dist/components/CoordinateDisplay/CoordinateDisplay.d.ts.map +1 -1
- package/dist/components/CoordinateDisplay/CoordinateDisplay.test.d.ts +2 -0
- package/dist/components/CoordinateDisplay/CoordinateDisplay.test.d.ts.map +1 -0
- package/dist/components/CoordinateDisplay/index.d.ts +1 -1
- package/dist/components/CoordinateDisplay/index.d.ts.map +1 -1
- package/dist/components/CoordinateDisplay/index.js +5 -3
- package/dist/components/Cql2FilterEditor/Cql2FilterEditor.d.ts +9 -0
- package/dist/components/Cql2FilterEditor/Cql2FilterEditor.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/Cql2Preview.d.ts +6 -0
- package/dist/components/Cql2FilterEditor/Cql2Preview.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/FilterRuleEditor.d.ts +9 -0
- package/dist/components/Cql2FilterEditor/FilterRuleEditor.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/FilterRuleGroupEditor.d.ts +10 -0
- package/dist/components/Cql2FilterEditor/FilterRuleGroupEditor.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/FilterValueInput.d.ts +12 -0
- package/dist/components/Cql2FilterEditor/FilterValueInput.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/ParameterizableField.d.ts +30 -0
- package/dist/components/Cql2FilterEditor/ParameterizableField.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/index.d.ts +2 -0
- package/dist/components/Cql2FilterEditor/index.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/operatorOptions.d.ts +9 -0
- package/dist/components/Cql2FilterEditor/operatorOptions.d.ts.map +1 -0
- package/dist/components/Cql2FilterEditor/styles.d.ts +3 -0
- package/dist/components/Cql2FilterEditor/styles.d.ts.map +1 -0
- package/dist/components/ExportButton/index.js +1 -1
- package/dist/components/ExportModal/ExportModal.d.ts +20 -1
- package/dist/components/ExportModal/ExportModal.d.ts.map +1 -1
- package/dist/components/ExportModal/index.d.ts +1 -1
- package/dist/components/ExportModal/index.d.ts.map +1 -1
- package/dist/components/FeatureDetailPanel/index.js +1 -1
- package/dist/components/FeatureTooltip/index.js +1 -1
- package/dist/components/GlobalSearchBar/GlobalSearchBar.d.ts +25 -0
- package/dist/components/GlobalSearchBar/GlobalSearchBar.d.ts.map +1 -0
- package/dist/components/GlobalSearchBar/GlobalSearchBar.test.d.ts +2 -0
- package/dist/components/GlobalSearchBar/GlobalSearchBar.test.d.ts.map +1 -0
- package/dist/components/GlobalSearchBar/index.d.ts +3 -0
- package/dist/components/GlobalSearchBar/index.d.ts.map +1 -0
- package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.d.ts +22 -0
- package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.d.ts.map +1 -0
- package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.test.d.ts +2 -0
- package/dist/components/GlobalSearchConfigEditor/GlobalSearchConfigEditor.test.d.ts.map +1 -0
- package/dist/components/GlobalSearchConfigEditor/index.d.ts +3 -0
- package/dist/components/GlobalSearchConfigEditor/index.d.ts.map +1 -0
- package/dist/components/ImageryEditor/ImageryEditor.d.ts +0 -1
- package/dist/components/ImageryEditor/ImageryEditor.d.ts.map +1 -1
- package/dist/components/ImageryEditor/index.d.ts +2 -1
- package/dist/components/ImageryEditor/index.d.ts.map +1 -1
- package/dist/components/ImageryPanel/ImageryPanel.d.ts.map +1 -1
- package/dist/components/InfoControl/InfoControl.d.ts +12 -0
- package/dist/components/InfoControl/InfoControl.d.ts.map +1 -0
- package/dist/components/InfoControl/InfoModal.d.ts +16 -0
- package/dist/components/InfoControl/InfoModal.d.ts.map +1 -0
- package/dist/components/InfoControl/index.d.ts +5 -0
- package/dist/components/InfoControl/index.d.ts.map +1 -0
- package/dist/components/LayerEditor/LayerEditor.d.ts +6 -1
- package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/LayerEditor/LayerList.d.ts +8 -1
- package/dist/components/LayerEditor/LayerList.d.ts.map +1 -1
- package/dist/components/LayerEditor/index.d.ts +1 -1
- package/dist/components/LayerEditor/index.d.ts.map +1 -1
- package/dist/components/LayerPanel/index.js +1 -1
- package/dist/components/Legend/Legend.d.ts +7 -1
- package/dist/components/Legend/Legend.d.ts.map +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/PropertyFilterPanel/PropertyFilterPanel.d.ts +21 -0
- package/dist/components/PropertyFilterPanel/PropertyFilterPanel.d.ts.map +1 -0
- package/dist/components/PropertyFilterPanel/index.d.ts +3 -0
- package/dist/components/PropertyFilterPanel/index.d.ts.map +1 -0
- package/dist/components/QueryPanel/QueryPanel.d.ts +14 -0
- package/dist/components/QueryPanel/QueryPanel.d.ts.map +1 -0
- package/dist/components/QueryPanel/index.d.ts +3 -0
- package/dist/components/QueryPanel/index.d.ts.map +1 -0
- package/dist/components/ResultsDrawer/ResultsDrawer.d.ts +29 -4
- package/dist/components/ResultsDrawer/ResultsDrawer.d.ts.map +1 -1
- package/dist/components/ResultsDrawer/index.d.ts +1 -1
- package/dist/components/ResultsDrawer/index.d.ts.map +1 -1
- package/dist/components/ResultsDrawer/tableUtils.d.ts +11 -0
- package/dist/components/ResultsDrawer/tableUtils.d.ts.map +1 -0
- package/dist/components/ScaleBarControl/ScaleBarControl.d.ts +32 -0
- package/dist/components/ScaleBarControl/ScaleBarControl.d.ts.map +1 -0
- package/dist/components/ScaleBarControl/index.d.ts +2 -0
- package/dist/components/ScaleBarControl/index.d.ts.map +1 -0
- package/dist/components/SearchPanel/SearchPanel.d.ts +15 -2
- 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 +3 -1
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
- package/dist/components/SideMenuPanel/SideMenuPanel.d.ts +51 -0
- package/dist/components/SideMenuPanel/SideMenuPanel.d.ts.map +1 -0
- package/dist/components/SideMenuPanel/index.d.ts +3 -0
- package/dist/components/SideMenuPanel/index.d.ts.map +1 -0
- package/dist/components/SourceEditor/SourceEditor.d.ts +3 -1
- package/dist/components/SourceEditor/SourceEditor.d.ts.map +1 -1
- package/dist/components/SourceEditor/SourceList.d.ts +6 -1
- package/dist/components/SourceEditor/SourceList.d.ts.map +1 -1
- package/dist/components/SourceEditor/index.d.ts +1 -1
- package/dist/components/SourceEditor/index.d.ts.map +1 -1
- package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts +8 -3
- package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts.map +1 -1
- package/dist/components/StyleEditor/PropertyField.d.ts +6 -3
- package/dist/components/StyleEditor/PropertyField.d.ts.map +1 -1
- package/dist/components/StyleEditor/PropertyGroup.d.ts +6 -3
- package/dist/components/StyleEditor/PropertyGroup.d.ts.map +1 -1
- package/dist/components/StyleEditor/StyleEditor.d.ts +7 -3
- package/dist/components/StyleEditor/StyleEditor.d.ts.map +1 -1
- package/dist/components/UIConfigEditor/UIConfigEditor.d.ts +13 -2
- package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
- package/dist/components/UserMenu/UserMenu.d.ts +15 -0
- package/dist/components/UserMenu/UserMenu.d.ts.map +1 -0
- package/dist/components/UserMenu/index.d.ts +3 -0
- package/dist/components/UserMenu/index.d.ts.map +1 -0
- package/dist/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/components/index.d.ts +26 -5
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/shared/controlIcons.d.ts +10 -0
- package/dist/components/shared/controlIcons.d.ts.map +1 -0
- package/dist/geo-DUdRIR7u.js +9776 -0
- package/dist/hooks/index.d.ts +5 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +68 -59
- package/dist/hooks/useExport.d.ts +7 -7
- package/dist/hooks/useExport.d.ts.map +1 -1
- package/dist/id-C2J6iu8_.js +11 -0
- package/dist/index-BtQnyWPg.js +3718 -0
- package/dist/main.js +13801 -2600
- package/dist/schemas/config.d.ts +2127 -5011
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +35 -24
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +47 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +56 -33
- package/dist/useSelection-BFHYsPvU.js +224 -0
- package/dist/utils/colorPalettes.d.ts +4 -2
- package/dist/utils/colorPalettes.d.ts.map +1 -1
- package/dist/utils/colorThemes.d.ts +12 -0
- package/dist/utils/colorThemes.d.ts.map +1 -0
- package/dist/utils/cql2.d.ts +34 -5
- package/dist/utils/cql2.d.ts.map +1 -1
- package/dist/utils/exportConverters.d.ts +16 -0
- package/dist/utils/exportConverters.d.ts.map +1 -0
- package/dist/utils/geo.d.ts +59 -0
- package/dist/utils/geo.d.ts.map +1 -1
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +477 -0
- package/dist/utils/ogcApi.d.ts +31 -6
- package/dist/utils/ogcApi.d.ts.map +1 -1
- package/dist/utils/propertyFilters.d.ts +35 -0
- package/dist/utils/propertyFilters.d.ts.map +1 -0
- package/dist/utils/queryParameters.d.ts +23 -0
- package/dist/utils/queryParameters.d.ts.map +1 -0
- package/dist/utils/queryableHelpers.d.ts +4 -0
- package/dist/utils/queryableHelpers.d.ts.map +1 -1
- package/dist/utils/slugify.d.ts +2 -0
- package/dist/utils/slugify.d.ts.map +1 -0
- package/package.json +31 -14
- package/dist/CollapsibleControl-qo9daiD8.js +0 -53
- package/dist/CoordinateDisplay-PxPmVjpm.js +0 -47
- package/dist/FeatureTooltip-DxzN-jnp.js +0 -49
- package/dist/Legend-BLWBzD7Y.js +0 -275
- package/dist/PropertyList-BGXHLVBM.js +0 -33
- package/dist/SearchPanel-4Y12jfuP.js +0 -401
- package/dist/components/PropertyDisplayEditor/__tests__/PropertyDisplayEditor.test.d.ts +0 -2
- package/dist/components/PropertyDisplayEditor/__tests__/PropertyDisplayEditor.test.d.ts.map +0 -1
- package/dist/geo-PA_KiJwy.js +0 -1169
- package/dist/index-Cz_PEKV1.js +0 -3035
- package/dist/schemas/__tests__/config.test.d.ts +0 -2
- package/dist/schemas/__tests__/config.test.d.ts.map +0 -1
- package/dist/utils/__tests__/cql2.test.d.ts +0 -2
- package/dist/utils/__tests__/cql2.test.d.ts.map +0 -1
- package/dist/utils/__tests__/expressionColors.test.d.ts +0 -2
- package/dist/utils/__tests__/expressionColors.test.d.ts.map +0 -1
- package/dist/utils/__tests__/propertyDisplay.test.d.ts +0 -2
- package/dist/utils/__tests__/propertyDisplay.test.d.ts.map +0 -1
- package/dist/utils/__tests__/queryableHelpers.test.d.ts +0 -2
- package/dist/utils/__tests__/queryableHelpers.test.d.ts.map +0 -1
- package/dist/utils/__tests__/wkt.test.d.ts +0 -2
- package/dist/utils/__tests__/wkt.test.d.ts.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
function
|
|
2
|
+
function o({
|
|
3
3
|
basemaps: u,
|
|
4
|
-
activeBasemapId:
|
|
5
|
-
onSelect:
|
|
6
|
-
className:
|
|
4
|
+
activeBasemapId: m,
|
|
5
|
+
onSelect: p,
|
|
6
|
+
className: r
|
|
7
7
|
}) {
|
|
8
8
|
return /* @__PURE__ */ a(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
className: `mapui:flex mapui:gap-2 mapui:flex-wrap ${
|
|
11
|
+
className: `mapui:flex mapui:gap-2 mapui:flex-wrap ${r ?? ""}`,
|
|
12
12
|
role: "group",
|
|
13
13
|
"aria-label": "Basemap selection",
|
|
14
14
|
children: u.map((i) => {
|
|
15
|
-
const e = i.id ===
|
|
15
|
+
const e = i.id === m;
|
|
16
16
|
return /* @__PURE__ */ t(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
type: "button",
|
|
20
|
-
onClick: () =>
|
|
20
|
+
onClick: () => p(i.id),
|
|
21
21
|
"aria-pressed": e,
|
|
22
|
-
className: `mapui:flex mapui:flex-col mapui:items-center mapui:gap-1 mapui:rounded-md mapui:border-2 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:cursor-pointer mapui:transition-colors ${e ? "mapui:border-blue-500 mapui:bg-blue-50 mapui:text-blue-700" : "mapui:border-
|
|
22
|
+
className: `mapui:flex mapui:flex-col mapui:items-center mapui:gap-1 mapui:rounded-md mapui:border-2 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:cursor-pointer mapui:transition-colors ${e ? "mapui:border-blue-500 mapui:bg-blue-50 mapui:text-blue-700" : "mapui:border-slate-200 mapui:bg-white mapui:text-slate-700 hover:mapui:border-slate-300 hover:mapui:bg-slate-50"}`,
|
|
23
23
|
children: [
|
|
24
24
|
i.thumbnail && /* @__PURE__ */ a(
|
|
25
25
|
"img",
|
|
@@ -39,5 +39,5 @@ function l({
|
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
o as B
|
|
43
43
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as t, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f } from "react";
|
|
3
|
+
import { LuX as b } from "react-icons/lu";
|
|
4
|
+
const g = {
|
|
5
|
+
"top-right": "mapui:top-0 mapui:right-full mapui:mr-2",
|
|
6
|
+
"top-left": "mapui:top-0 mapui:left-full mapui:ml-2",
|
|
7
|
+
"bottom-right": "mapui:bottom-0 mapui:right-full mapui:mr-2",
|
|
8
|
+
"bottom-left": "mapui:bottom-0 mapui:left-full mapui:ml-2"
|
|
9
|
+
};
|
|
10
|
+
function C({
|
|
11
|
+
icon: m,
|
|
12
|
+
label: a,
|
|
13
|
+
corner: o = "top-right",
|
|
14
|
+
defaultCollapsed: r = !0,
|
|
15
|
+
collapsed: p,
|
|
16
|
+
onToggle: u,
|
|
17
|
+
children: n,
|
|
18
|
+
className: c = ""
|
|
19
|
+
}) {
|
|
20
|
+
const [d, h] = f(r), e = p !== void 0 ? p : d, s = () => {
|
|
21
|
+
const l = !e;
|
|
22
|
+
u ? u(l) : h(l);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ t("div", { className: `mapui:relative mapui:w-10 mapui:h-10 ${c}`, children: [
|
|
25
|
+
/* @__PURE__ */ i(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: s,
|
|
30
|
+
title: a,
|
|
31
|
+
"aria-label": a,
|
|
32
|
+
className: `mapui:flex mapui:items-center mapui:justify-center mapui:w-10 mapui:h-10 mapui:bg-white mapui:rounded mapui:shadow-md hover:mapui:bg-slate-50 mapui:transition-colors ${e ? "" : "mapui:bg-slate-100"}`,
|
|
33
|
+
children: /* @__PURE__ */ i(m, { size: 20, className: "mapui:text-slate-700" })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ t("div", { className: `mapui:absolute ${g[o]} mapui:z-10 mapui:bg-white/90 mapui:backdrop-blur-sm mapui:rounded-lg mapui:shadow-lg mapui:transition-all mapui:duration-150 mapui:origin-top-right ${e ? "mapui:opacity-0 mapui:scale-95 mapui:pointer-events-none" : "mapui:opacity-100 mapui:scale-100 mapui:pointer-events-auto"}`, children: [
|
|
37
|
+
/* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:p-2 mapui:border-b mapui:border-slate-200", children: [
|
|
38
|
+
/* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
39
|
+
/* @__PURE__ */ i(m, { size: 18, className: "mapui:text-slate-700" }),
|
|
40
|
+
/* @__PURE__ */ i("span", { className: "mapui:text-sm mapui:font-medium mapui:text-slate-700", children: a })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
type: "button",
|
|
46
|
+
onClick: s,
|
|
47
|
+
title: `Collapse ${a}`,
|
|
48
|
+
"aria-label": `Collapse ${a}`,
|
|
49
|
+
className: "mapui:flex mapui:items-center mapui:justify-center mapui:min-w-[44px] mapui:min-h-[44px] mapui:w-8 mapui:h-8 mapui:rounded hover:mapui:bg-slate-100 mapui:transition-colors",
|
|
50
|
+
children: /* @__PURE__ */ i(b, { size: 16, className: "mapui:text-slate-600" })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ i("div", { className: "mapui:p-2", children: n })
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
C
|
|
60
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsxs as N, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w } from "react";
|
|
3
|
+
function W(u, n) {
|
|
4
|
+
return `${u.toFixed(6)}, ${n.toFixed(6)}`;
|
|
5
|
+
}
|
|
6
|
+
function j(u, n) {
|
|
7
|
+
const p = (m, a, i) => {
|
|
8
|
+
const t = m >= 0 ? a : i, e = Math.abs(m), r = Math.floor(e), s = (e - r) * 60, b = Math.floor(s), x = ((s - b) * 60).toFixed(1);
|
|
9
|
+
return `${r}°${b}'${x}"${t}`;
|
|
10
|
+
}, o = p(u, "N", "S"), d = p(n, "E", "W");
|
|
11
|
+
return `${o} ${d}`;
|
|
12
|
+
}
|
|
13
|
+
function z(u, n) {
|
|
14
|
+
const p = (m, a, i) => {
|
|
15
|
+
const t = m >= 0 ? a : i, e = Math.abs(m), r = Math.floor(e), s = ((e - r) * 60).toFixed(3);
|
|
16
|
+
return `${r}° ${s}' ${t}`;
|
|
17
|
+
}, o = p(u, "N", "S"), d = p(n, "E", "W");
|
|
18
|
+
return `${o}, ${d}`;
|
|
19
|
+
}
|
|
20
|
+
function M(u) {
|
|
21
|
+
if (!u) return null;
|
|
22
|
+
const n = u.trim();
|
|
23
|
+
if (!n) return null;
|
|
24
|
+
const p = n.match(/[NSEW]/i), o = p ? p[0].toUpperCase() : null, m = n.replace(/[NSEW]/gi, " ").replace(/[°º*]/g, " ").replace(/['′]/g, " ").replace(/["″]/g, " ").replace(/,/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
25
|
+
if (m.length === 0) return null;
|
|
26
|
+
const a = m.map((t) => Number(t));
|
|
27
|
+
if (a.some((t) => !Number.isFinite(t))) return null;
|
|
28
|
+
let i;
|
|
29
|
+
if (a.length === 1)
|
|
30
|
+
i = a[0];
|
|
31
|
+
else if (a.length === 2) {
|
|
32
|
+
const [t, e] = a;
|
|
33
|
+
if (e < 0) return null;
|
|
34
|
+
const r = Math.abs(t) + e / 60;
|
|
35
|
+
i = t < 0 ? -r : r;
|
|
36
|
+
} else if (a.length === 3) {
|
|
37
|
+
const [t, e, r] = a;
|
|
38
|
+
if (e < 0 || r < 0) return null;
|
|
39
|
+
const s = Math.abs(t) + e / 60 + r / 3600;
|
|
40
|
+
i = t < 0 ? -s : s;
|
|
41
|
+
} else
|
|
42
|
+
return null;
|
|
43
|
+
return o === "S" || o === "W" ? i = -Math.abs(i) : (o === "N" || o === "E") && (i = Math.abs(i)), i;
|
|
44
|
+
}
|
|
45
|
+
function U({
|
|
46
|
+
latitude: u,
|
|
47
|
+
longitude: n,
|
|
48
|
+
activeFormat: p,
|
|
49
|
+
formats: o,
|
|
50
|
+
onFormatChange: d,
|
|
51
|
+
className: m = "",
|
|
52
|
+
onNavigate: a,
|
|
53
|
+
isExpanded: i,
|
|
54
|
+
onToggleExpand: t
|
|
55
|
+
}) {
|
|
56
|
+
const e = o.find((l) => l.id === p), [r, s] = w(!1), b = i ?? r, x = !!a, [C, k] = w(""), [$, E] = w(""), [y, g] = w(null), I = () => {
|
|
57
|
+
const f = (o.findIndex((h) => h.id === p) + 1) % o.length;
|
|
58
|
+
d(o[f].id);
|
|
59
|
+
}, S = (l) => {
|
|
60
|
+
t ? t(l) : s(l), l || g(null);
|
|
61
|
+
}, v = () => {
|
|
62
|
+
x && S(!b);
|
|
63
|
+
}, F = (l) => {
|
|
64
|
+
if (l.preventDefault(), !a) return;
|
|
65
|
+
const f = M(C), h = M($);
|
|
66
|
+
if (f == null || f < -90 || f > 90) {
|
|
67
|
+
g("Latitude must be between -90 and 90");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (h == null || h < -180 || h > 180) {
|
|
71
|
+
g("Longitude must be between -180 and 180");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
g(null), a(f, h), S(!1);
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ N(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: `mapui:bg-black/60 mapui:text-white mapui:text-xs mapui:px-3 mapui:py-1 mapui:flex mapui:flex-col mapui:gap-1 mapui:rounded ${m}`,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ N("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
82
|
+
/* @__PURE__ */ c(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
onClick: I,
|
|
86
|
+
className: "mapui:text-blue-300 hover:mapui:text-blue-200 mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:p-0",
|
|
87
|
+
title: "Click to cycle coordinate format",
|
|
88
|
+
type: "button",
|
|
89
|
+
children: (e == null ? void 0 : e.label) ?? "Unknown"
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
x ? /* @__PURE__ */ c(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: v,
|
|
97
|
+
className: "mapui:font-mono mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:text-inherit mapui:p-0 hover:mapui:text-blue-200",
|
|
98
|
+
title: "Click to go to coordinates",
|
|
99
|
+
"aria-expanded": b,
|
|
100
|
+
children: u !== null && n !== null && e ? e.format(u, n) : "—"
|
|
101
|
+
}
|
|
102
|
+
) : /* @__PURE__ */ c("span", { className: "mapui:font-mono", children: u !== null && n !== null && e ? e.format(u, n) : "—" })
|
|
103
|
+
] }),
|
|
104
|
+
x && b && /* @__PURE__ */ N("form", { onSubmit: F, className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:pt-1", children: [
|
|
105
|
+
/* @__PURE__ */ N("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
106
|
+
/* @__PURE__ */ c("label", { className: "mapui:text-[10px] mapui:uppercase mapui:tracking-wide mapui:opacity-80", htmlFor: "mapui-coord-lat", children: "Lat" }),
|
|
107
|
+
/* @__PURE__ */ c(
|
|
108
|
+
"input",
|
|
109
|
+
{
|
|
110
|
+
id: "mapui-coord-lat",
|
|
111
|
+
type: "text",
|
|
112
|
+
value: C,
|
|
113
|
+
onChange: (l) => k(l.target.value),
|
|
114
|
+
placeholder: "40.7128",
|
|
115
|
+
className: "mapui:bg-white/10 mapui:text-white mapui:rounded mapui:px-1 mapui:py-0.5 mapui:font-mono mapui:w-24 mapui:border mapui:border-white/20 focus:mapui:outline-none focus:mapui:border-blue-300",
|
|
116
|
+
"aria-label": "Latitude",
|
|
117
|
+
autoFocus: !0
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ c("label", { className: "mapui:text-[10px] mapui:uppercase mapui:tracking-wide mapui:opacity-80 mapui:ml-1", htmlFor: "mapui-coord-lng", children: "Lng" }),
|
|
121
|
+
/* @__PURE__ */ c(
|
|
122
|
+
"input",
|
|
123
|
+
{
|
|
124
|
+
id: "mapui-coord-lng",
|
|
125
|
+
type: "text",
|
|
126
|
+
value: $,
|
|
127
|
+
onChange: (l) => E(l.target.value),
|
|
128
|
+
placeholder: "-74.006",
|
|
129
|
+
className: "mapui:bg-white/10 mapui:text-white mapui:rounded mapui:px-1 mapui:py-0.5 mapui:font-mono mapui:w-24 mapui:border mapui:border-white/20 focus:mapui:outline-none focus:mapui:border-blue-300",
|
|
130
|
+
"aria-label": "Longitude"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ c(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "submit",
|
|
137
|
+
className: "mapui:bg-blue-500 hover:mapui:bg-blue-400 mapui:text-white mapui:rounded mapui:px-2 mapui:py-0.5 mapui:ml-1 mapui:cursor-pointer mapui:border-none",
|
|
138
|
+
children: "Go"
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }),
|
|
142
|
+
y && /* @__PURE__ */ c("div", { className: "mapui:text-red-300 mapui:text-[10px]", children: y })
|
|
143
|
+
] })
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
U as C,
|
|
150
|
+
j as a,
|
|
151
|
+
W as b,
|
|
152
|
+
z as f,
|
|
153
|
+
M as p
|
|
154
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
function
|
|
2
|
+
function r({
|
|
3
3
|
icon: e,
|
|
4
4
|
label: i = "Export",
|
|
5
5
|
onExport: o,
|
|
6
|
-
loading:
|
|
7
|
-
disabled:
|
|
6
|
+
loading: u = !1,
|
|
7
|
+
disabled: s = !1,
|
|
8
8
|
className: m = ""
|
|
9
9
|
}) {
|
|
10
|
-
const a =
|
|
10
|
+
const a = s || u;
|
|
11
11
|
return /* @__PURE__ */ t(
|
|
12
12
|
"button",
|
|
13
13
|
{
|
|
14
14
|
type: "button",
|
|
15
15
|
title: i,
|
|
16
16
|
"aria-label": i,
|
|
17
|
-
className: `mapui:flex mapui:items-center mapui:justify-center mapui:w-10 mapui:h-10 mapui:bg-white mapui:rounded mapui:shadow-md mapui:transition-colors ${a ? "mapui:cursor-not-allowed mapui:opacity-50" : "mapui:cursor-pointer hover:mapui:bg-
|
|
17
|
+
className: `mapui:flex mapui:items-center mapui:justify-center mapui:w-10 mapui:h-10 mapui:bg-white mapui:rounded mapui:shadow-md mapui:transition-colors ${a ? "mapui:cursor-not-allowed mapui:opacity-50" : "mapui:cursor-pointer hover:mapui:bg-slate-50"} ${m}`.trim(),
|
|
18
18
|
disabled: a,
|
|
19
19
|
onClick: o,
|
|
20
|
-
children: /* @__PURE__ */ t(e, { size: 20, className: "mapui:text-
|
|
20
|
+
children: /* @__PURE__ */ t(e, { size: 20, className: "mapui:text-slate-700" })
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
r as E
|
|
26
26
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { P as c } from "./PropertyList-
|
|
3
|
-
function
|
|
4
|
-
isOpen:
|
|
2
|
+
import { P as c } from "./PropertyList-0EonV_BQ.js";
|
|
3
|
+
function b({
|
|
4
|
+
isOpen: t,
|
|
5
5
|
onClose: m,
|
|
6
6
|
properties: i,
|
|
7
|
-
title:
|
|
8
|
-
fields:
|
|
9
|
-
labels:
|
|
7
|
+
title: l = "Feature Properties",
|
|
8
|
+
fields: r,
|
|
9
|
+
labels: s,
|
|
10
10
|
variant: e = "panel",
|
|
11
|
-
className:
|
|
11
|
+
className: o = ""
|
|
12
12
|
}) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!t) return null;
|
|
14
14
|
const u = /* @__PURE__ */ p(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
17
|
className: [
|
|
18
|
-
"mapui:flex mapui:flex-col mapui:rounded mapui:border mapui:border-
|
|
18
|
+
"mapui:flex mapui:flex-col mapui:rounded mapui:border mapui:border-slate-200 mapui:bg-white/90 mapui:backdrop-blur-sm mapui:shadow-md",
|
|
19
19
|
e === "modal" ? "mapui:max-h-[80vh] mapui:w-full mapui:max-w-lg" : "mapui:max-h-[calc(100vh-4rem)] mapui:w-72",
|
|
20
|
-
|
|
20
|
+
o
|
|
21
21
|
].filter(Boolean).join(" ").trim(),
|
|
22
|
-
onClick: e === "modal" ? (
|
|
22
|
+
onClick: e === "modal" ? (n) => n.stopPropagation() : void 0,
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */ p("div", { className: "mapui:flex mapui:shrink-0 mapui:items-center mapui:justify-between mapui:border-b mapui:border-
|
|
25
|
-
/* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-
|
|
24
|
+
/* @__PURE__ */ p("div", { className: "mapui:flex mapui:shrink-0 mapui:items-center mapui:justify-between mapui:border-b mapui:border-slate-200 mapui:px-4 mapui:py-3", children: [
|
|
25
|
+
/* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-slate-700", children: l }),
|
|
26
26
|
/* @__PURE__ */ a(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
29
|
onClick: m,
|
|
30
|
-
className: "mapui:flex mapui:h-6 mapui:w-6 mapui:cursor-pointer mapui:items-center mapui:justify-center mapui:rounded mapui:border-0 mapui:bg-transparent mapui:text-lg mapui:leading-none mapui:text-
|
|
30
|
+
className: "mapui:flex mapui:h-6 mapui:w-6 mapui:cursor-pointer mapui:items-center mapui:justify-center mapui:rounded mapui:border-0 mapui:bg-transparent mapui:text-lg mapui:leading-none mapui:text-slate-400 mapui:transition-colors hover:mapui:bg-slate-100 hover:mapui:text-slate-700",
|
|
31
31
|
"aria-label": "Close",
|
|
32
32
|
children: "×"
|
|
33
33
|
}
|
|
34
34
|
)
|
|
35
35
|
] }),
|
|
36
|
-
/* @__PURE__ */ a("div", { className: "mapui:overflow-y-auto mapui:px-4 mapui:py-3", children: i && Object.keys(i).length > 0 ? /* @__PURE__ */ a(c, { properties: i, fields:
|
|
36
|
+
/* @__PURE__ */ a("div", { className: "mapui:overflow-y-auto mapui:px-4 mapui:py-3", children: i && Object.keys(i).length > 0 ? /* @__PURE__ */ a(c, { properties: i, fields: r, labels: s, density: "default" }) : /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-slate-400", children: "No properties available." }) })
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
39
|
);
|
|
@@ -47,5 +47,5 @@ function f({
|
|
|
47
47
|
) : u;
|
|
48
48
|
}
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
b as F
|
|
51
51
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { P as x } from "./PropertyList-0EonV_BQ.js";
|
|
3
|
+
function f({
|
|
4
|
+
title: d,
|
|
5
|
+
properties: p,
|
|
6
|
+
fields: o,
|
|
7
|
+
labels: c,
|
|
8
|
+
features: e,
|
|
9
|
+
maxItems: m = 4,
|
|
10
|
+
className: t = ""
|
|
11
|
+
}) {
|
|
12
|
+
const s = e && e.length > 0 ? e : p ? [{ title: d, properties: p, fields: o, labels: c }] : [];
|
|
13
|
+
return s.length === 0 ? /* @__PURE__ */ a(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: `mapui:rounded mapui:border mapui:border-slate-200 mapui:bg-white/90 mapui:backdrop-blur-sm mapui:px-3 mapui:py-2 mapui:shadow-md ${t}`.trim(),
|
|
17
|
+
children: /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-slate-400", children: "No data" })
|
|
18
|
+
}
|
|
19
|
+
) : /* @__PURE__ */ a(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `mapui:min-w-[140px] mapui:max-w-[240px] mapui:rounded mapui:border mapui:border-slate-200 mapui:bg-white/90 mapui:backdrop-blur-sm mapui:shadow-md ${t}`.trim(),
|
|
23
|
+
children: s.map((i, r) => {
|
|
24
|
+
const u = i.fields ?? Object.keys(i.properties), n = u.length > m, b = u.length - m;
|
|
25
|
+
return /* @__PURE__ */ a("div", { className: r > 0 ? "mapui:border-t mapui:border-slate-200" : "", children: /* @__PURE__ */ l("div", { className: "mapui:px-3 mapui:py-2", children: [
|
|
26
|
+
i.title && /* @__PURE__ */ a("p", { className: "mapui:mb-1.5 mapui:mt-0 mapui:text-xs mapui:font-semibold mapui:text-slate-700", children: i.title }),
|
|
27
|
+
/* @__PURE__ */ a(
|
|
28
|
+
x,
|
|
29
|
+
{
|
|
30
|
+
properties: i.properties,
|
|
31
|
+
fields: i.fields,
|
|
32
|
+
labels: i.labels,
|
|
33
|
+
maxItems: m,
|
|
34
|
+
density: "compact"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
n && /* @__PURE__ */ l("p", { className: "mapui:mb-0 mapui:mt-1 mapui:text-xs mapui:text-slate-400", children: [
|
|
38
|
+
"+",
|
|
39
|
+
b,
|
|
40
|
+
" more"
|
|
41
|
+
] })
|
|
42
|
+
] }) }, r);
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
f as F
|
|
49
|
+
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
1
|
+
import { jsxs as o, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { useState as g, useCallback as m } from "react";
|
|
3
3
|
function E({
|
|
4
|
-
layers:
|
|
4
|
+
layers: c,
|
|
5
5
|
activeLayerIds: f,
|
|
6
6
|
onToggleVisibility: v,
|
|
7
7
|
onReorder: i,
|
|
8
8
|
className: x = "",
|
|
9
9
|
hideTitle: h
|
|
10
10
|
}) {
|
|
11
|
-
const [n,
|
|
11
|
+
const [n, r] = g(null), [D, u] = g(null), b = m(
|
|
12
12
|
(a, e) => {
|
|
13
|
-
|
|
13
|
+
r(e), a.dataTransfer.effectAllowed = "move", a.dataTransfer.setData("text/plain", e);
|
|
14
14
|
},
|
|
15
15
|
[]
|
|
16
16
|
), N = m(
|
|
17
17
|
(a, e) => {
|
|
18
|
-
a.preventDefault(), a.dataTransfer.dropEffect = "move",
|
|
18
|
+
a.preventDefault(), a.dataTransfer.dropEffect = "move", u(e);
|
|
19
19
|
},
|
|
20
20
|
[]
|
|
21
21
|
), O = m(() => {
|
|
22
|
-
|
|
22
|
+
u(null);
|
|
23
23
|
}, []), I = m(
|
|
24
24
|
(a, e) => {
|
|
25
|
-
if (a.preventDefault(),
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const d = [...
|
|
29
|
-
d.splice(
|
|
25
|
+
if (a.preventDefault(), u(null), r(null), !i || !n || n === e) return;
|
|
26
|
+
const s = c.map((w) => w.id), l = s.indexOf(n), t = s.indexOf(e);
|
|
27
|
+
if (l === -1 || t === -1) return;
|
|
28
|
+
const d = [...s];
|
|
29
|
+
d.splice(l, 1), d.splice(t, 0, n), i(d);
|
|
30
30
|
},
|
|
31
|
-
[n,
|
|
31
|
+
[n, c, i]
|
|
32
32
|
), L = m(() => {
|
|
33
|
-
|
|
33
|
+
r(null), u(null);
|
|
34
34
|
}, []);
|
|
35
35
|
return /* @__PURE__ */ o("div", { className: `mapui:flex mapui:flex-col mapui:gap-1 ${x}`.trim(), children: [
|
|
36
|
-
!h && /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
const e = f.includes(a.id),
|
|
36
|
+
!h && /* @__PURE__ */ p("h3", { className: "mapui:m-0 mapui:mb-2 mapui:text-sm mapui:font-semibold mapui:text-slate-700", children: "Layers" }),
|
|
37
|
+
/* @__PURE__ */ p("ul", { className: "mapui:m-0 mapui:list-none mapui:p-0", children: c.map((a) => {
|
|
38
|
+
const e = f.includes(a.id), s = n === a.id, l = D === a.id;
|
|
39
39
|
return /* @__PURE__ */ o(
|
|
40
40
|
"li",
|
|
41
41
|
{
|
|
@@ -48,29 +48,29 @@ function E({
|
|
|
48
48
|
className: [
|
|
49
49
|
"mapui:flex mapui:items-center mapui:gap-2 mapui:rounded mapui:px-2 mapui:py-1.5",
|
|
50
50
|
"mapui:select-none mapui:transition-colors",
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
l ? "mapui:bg-slate-200" : "mapui:bg-transparent hover:mapui:bg-slate-100",
|
|
52
|
+
s ? "mapui:opacity-50" : "mapui:opacity-100"
|
|
53
53
|
].join(" "),
|
|
54
54
|
children: [
|
|
55
|
-
i && /* @__PURE__ */
|
|
55
|
+
i && /* @__PURE__ */ p(
|
|
56
56
|
"span",
|
|
57
57
|
{
|
|
58
|
-
className: "mapui:cursor-grab mapui:text-
|
|
58
|
+
className: "mapui:cursor-grab mapui:text-slate-400 active:mapui:cursor-grabbing",
|
|
59
59
|
"aria-hidden": "true",
|
|
60
60
|
children: "⠿"
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
/* @__PURE__ */ o("label", { className: "mapui:flex mapui:flex-1 mapui:cursor-pointer mapui:items-center mapui:gap-2 mapui:min-w-0", children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ p(
|
|
65
65
|
"input",
|
|
66
66
|
{
|
|
67
67
|
type: "checkbox",
|
|
68
68
|
checked: e,
|
|
69
69
|
onChange: () => v(a.id),
|
|
70
|
-
className: "mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-
|
|
70
|
+
className: "mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-slate-700"
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ p("span", { className: "mapui:text-sm mapui:text-slate-800 mapui:truncate", children: a.label })
|
|
74
74
|
] })
|
|
75
75
|
]
|
|
76
76
|
},
|