@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
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v } from "react";
|
|
3
|
+
import { LuMinimize2 as I, LuMaximize2 as E } from "react-icons/lu";
|
|
4
|
+
import { MdOutlineKeyboardArrowDown as C, MdOutlineKeyboardArrowRight as L } from "react-icons/md";
|
|
5
|
+
const M = {
|
|
6
|
+
fill: "fill-opacity",
|
|
7
|
+
line: "line-opacity",
|
|
8
|
+
circle: "circle-opacity",
|
|
9
|
+
symbol: "icon-opacity"
|
|
10
|
+
};
|
|
11
|
+
function S(t) {
|
|
12
|
+
var m, u;
|
|
13
|
+
const a = (m = t.styles) == null ? void 0 : m[0];
|
|
14
|
+
if (!a) return 1;
|
|
15
|
+
const n = M[a.type];
|
|
16
|
+
if (!n) return 1;
|
|
17
|
+
const i = (u = a.paint) == null ? void 0 : u[n];
|
|
18
|
+
return typeof i == "number" ? i : 1;
|
|
19
|
+
}
|
|
20
|
+
function N({ color: t, shape: a }) {
|
|
21
|
+
const n = a ?? "square";
|
|
22
|
+
let i;
|
|
23
|
+
return n === "circle" ? i = /* @__PURE__ */ e(
|
|
24
|
+
"span",
|
|
25
|
+
{
|
|
26
|
+
className: "mapui:inline-block mapui:h-3 mapui:w-3 mapui:rounded-full",
|
|
27
|
+
style: { backgroundColor: t }
|
|
28
|
+
}
|
|
29
|
+
) : n === "line" ? i = /* @__PURE__ */ e(
|
|
30
|
+
"span",
|
|
31
|
+
{
|
|
32
|
+
className: "mapui:inline-block mapui:h-0.5 mapui:w-4 mapui:rounded-full",
|
|
33
|
+
style: { backgroundColor: t }
|
|
34
|
+
}
|
|
35
|
+
) : i = /* @__PURE__ */ e(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: "mapui:inline-block mapui:h-3 mapui:w-3 mapui:rounded-sm",
|
|
39
|
+
style: { backgroundColor: t }
|
|
40
|
+
}
|
|
41
|
+
), /* @__PURE__ */ e("span", { className: "mapui:inline-flex mapui:items-center mapui:justify-center mapui:w-5 mapui:shrink-0", children: i });
|
|
42
|
+
}
|
|
43
|
+
function j(t) {
|
|
44
|
+
return `linear-gradient(to right, ${t.map((a, n) => `${a.color} ${n / t.length * 100}% ${(n + 1) / t.length * 100}%`).join(", ")})`;
|
|
45
|
+
}
|
|
46
|
+
function A(t) {
|
|
47
|
+
return `linear-gradient(to right, ${t.map((a) => a.color).join(", ")})`;
|
|
48
|
+
}
|
|
49
|
+
function $(t) {
|
|
50
|
+
const a = t.trim();
|
|
51
|
+
let n, i, m;
|
|
52
|
+
if (/^#[0-9a-f]{3}$/i.test(a))
|
|
53
|
+
n = parseInt(a[1] + a[1], 16), i = parseInt(a[2] + a[2], 16), m = parseInt(a[3] + a[3], 16);
|
|
54
|
+
else if (/^#[0-9a-f]{6}$/i.test(a))
|
|
55
|
+
n = parseInt(a.slice(1, 3), 16), i = parseInt(a.slice(3, 5), 16), m = parseInt(a.slice(5, 7), 16);
|
|
56
|
+
else
|
|
57
|
+
return null;
|
|
58
|
+
const u = n / 255, h = i / 255, p = m / 255, f = Math.max(u, h, p), w = Math.min(u, h, p), x = f - w;
|
|
59
|
+
if (x === 0) return 0;
|
|
60
|
+
let r = 0;
|
|
61
|
+
return f === u ? r = ((h - p) / x + 6) % 6 : f === h ? r = (p - u) / x + 2 : r = (u - h) / x + 4, r * 60;
|
|
62
|
+
}
|
|
63
|
+
function B(t) {
|
|
64
|
+
return [...t].sort((a, n) => {
|
|
65
|
+
const i = $(a.color), m = $(n.color);
|
|
66
|
+
return i === null && m === null ? 0 : i === null ? 1 : m === null ? -1 : i - m;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function D({ legend: t, label: a, hasArrowColumn: n }) {
|
|
70
|
+
const { entries: i } = t, m = n ? /* @__PURE__ */ e("span", { className: "mapui:w-5 mapui:shrink-0" }) : null;
|
|
71
|
+
return i.length === 1 ? /* @__PURE__ */ d("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:min-w-0", children: [
|
|
72
|
+
m,
|
|
73
|
+
/* @__PURE__ */ e(N, { color: i[0].color, shape: i[0].shape }),
|
|
74
|
+
/* @__PURE__ */ e("span", { className: "mapui:text-slate-700 mapui:truncate", children: i[0].label || a })
|
|
75
|
+
] }) : /* @__PURE__ */ d("div", { children: [
|
|
76
|
+
/* @__PURE__ */ e("div", { className: "mapui:mb-1 mapui:text-xs mapui:font-medium mapui:text-slate-600", children: a }),
|
|
77
|
+
/* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:space-y-1 mapui:p-0 mapui:pl-1", children: i.map((u, h) => /* @__PURE__ */ d(
|
|
78
|
+
"li",
|
|
79
|
+
{
|
|
80
|
+
className: "mapui:flex mapui:items-center mapui:gap-2 mapui:min-w-0",
|
|
81
|
+
children: [
|
|
82
|
+
m,
|
|
83
|
+
/* @__PURE__ */ e(N, { color: u.color, shape: u.shape }),
|
|
84
|
+
/* @__PURE__ */ e("span", { className: "mapui:text-slate-700 mapui:truncate", children: u.label })
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
`${u.label}-${h}`
|
|
88
|
+
)) })
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
function T({
|
|
92
|
+
legend: t,
|
|
93
|
+
label: a,
|
|
94
|
+
expanded: n,
|
|
95
|
+
onToggle: i,
|
|
96
|
+
hasArrowColumn: m
|
|
97
|
+
}) {
|
|
98
|
+
const { entries: u } = t, h = t.showColorBar !== !1, p = t.showDisclosureArrow !== !1, f = t.showLabelsCollapsed ?? !1, w = u.filter((g, s, l) => l.findIndex((o) => o.color === g.color) === s), x = B(w), r = /* @__PURE__ */ e("span", { className: "mapui:inline-flex mapui:items-center mapui:justify-center mapui:w-5 mapui:shrink-0", children: /* @__PURE__ */ e("span", { className: "mapui:text-slate-400", children: n ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(L, {}) }) }), b = /* @__PURE__ */ d(y, { children: [
|
|
99
|
+
m && (p ? r : /* @__PURE__ */ e("span", { className: "mapui:w-5 mapui:shrink-0" })),
|
|
100
|
+
h ? /* @__PURE__ */ e(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: "mapui:h-3 mapui:w-5 mapui:rounded-sm mapui:shrink-0",
|
|
104
|
+
style: { background: j(x) }
|
|
105
|
+
}
|
|
106
|
+
) : !m && p ? r : /* @__PURE__ */ e("span", { className: "mapui:w-5 mapui:shrink-0" }),
|
|
107
|
+
/* @__PURE__ */ e("span", { className: "mapui:truncate", children: a })
|
|
108
|
+
] });
|
|
109
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
110
|
+
p ? /* @__PURE__ */ e(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
type: "button",
|
|
114
|
+
className: "mapui:flex mapui:items-center mapui:gap-2 mapui:bg-transparent mapui:border-none mapui:p-0 mapui:cursor-pointer mapui:text-left mapui:text-slate-700 mapui:text-sm mapui:font-medium mapui:min-w-0",
|
|
115
|
+
onClick: i,
|
|
116
|
+
"aria-expanded": n,
|
|
117
|
+
children: b
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ e("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:text-slate-700 mapui:text-sm mapui:font-medium mapui:min-w-0", children: b }),
|
|
120
|
+
(n || f) && /* @__PURE__ */ e("ul", { className: `mapui:m-0 mapui:mt-1 mapui:list-none mapui:space-y-1 mapui:p-0 mapui:max-h-48 mapui:overflow-y-auto${p ? " mapui:ml-7" : ""}`, children: u.map((g, s) => /* @__PURE__ */ d(
|
|
121
|
+
"li",
|
|
122
|
+
{
|
|
123
|
+
className: "mapui:flex mapui:items-center mapui:gap-2 mapui:min-w-0",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ e(N, { color: g.color, shape: g.shape }),
|
|
126
|
+
/* @__PURE__ */ e("span", { className: "mapui:text-slate-700 mapui:truncate mapui:text-xs", children: g.label })
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
`${g.label}-${s}`
|
|
130
|
+
)) })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
function G({
|
|
134
|
+
legend: t,
|
|
135
|
+
label: a,
|
|
136
|
+
expanded: n,
|
|
137
|
+
onToggle: i,
|
|
138
|
+
hasArrowColumn: m
|
|
139
|
+
}) {
|
|
140
|
+
const { entries: u, gradientProperty: h } = t, p = t.showColorBar !== !1, f = t.showDisclosureArrow !== !1, w = /* @__PURE__ */ e("span", { className: "mapui:inline-flex mapui:items-center mapui:justify-center mapui:w-5 mapui:shrink-0", children: /* @__PURE__ */ e("span", { className: "mapui:text-slate-400", children: n ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(L, {}) }) }), x = /* @__PURE__ */ d(y, { children: [
|
|
141
|
+
m && (f ? w : /* @__PURE__ */ e("span", { className: "mapui:w-5 mapui:shrink-0" })),
|
|
142
|
+
p ? /* @__PURE__ */ e(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: "mapui:h-3 mapui:w-5 mapui:rounded-sm mapui:shrink-0",
|
|
146
|
+
style: { background: A(u) }
|
|
147
|
+
}
|
|
148
|
+
) : !m && f ? w : /* @__PURE__ */ e("span", { className: "mapui:w-5 mapui:shrink-0" }),
|
|
149
|
+
/* @__PURE__ */ e("span", { className: "mapui:truncate", children: a })
|
|
150
|
+
] });
|
|
151
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
152
|
+
f ? /* @__PURE__ */ e(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
type: "button",
|
|
156
|
+
className: "mapui:flex mapui:items-center mapui:gap-2 mapui:bg-transparent mapui:border-none mapui:p-0 mapui:cursor-pointer mapui:text-left mapui:text-slate-700 mapui:text-sm mapui:font-medium",
|
|
157
|
+
onClick: i,
|
|
158
|
+
"aria-expanded": n,
|
|
159
|
+
children: x
|
|
160
|
+
}
|
|
161
|
+
) : /* @__PURE__ */ e("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:text-slate-700 mapui:text-sm mapui:font-medium", children: x }),
|
|
162
|
+
n && /* @__PURE__ */ d(y, { children: [
|
|
163
|
+
h && /* @__PURE__ */ e("div", { className: `mapui:mt-1 mapui:text-xs mapui:font-medium mapui:text-slate-600${f ? " mapui:ml-7" : ""}`, children: h }),
|
|
164
|
+
/* @__PURE__ */ e("ul", { className: `mapui:m-0 mapui:mt-1 mapui:list-none mapui:space-y-1 mapui:p-0${f ? " mapui:ml-7" : ""}`, children: u.map((r, b) => /* @__PURE__ */ d(
|
|
165
|
+
"li",
|
|
166
|
+
{
|
|
167
|
+
className: "mapui:flex mapui:items-center mapui:gap-2 mapui:min-w-0",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ e(N, { color: r.color, shape: r.shape }),
|
|
170
|
+
/* @__PURE__ */ e("span", { className: "mapui:text-slate-700 mapui:truncate mapui:text-xs", children: r.label })
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
`${r.label}-${b}`
|
|
174
|
+
)) })
|
|
175
|
+
] })
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
function K({
|
|
179
|
+
layerId: t,
|
|
180
|
+
opacity: a,
|
|
181
|
+
onChange: n,
|
|
182
|
+
hasArrowColumn: i
|
|
183
|
+
}) {
|
|
184
|
+
return /* @__PURE__ */ d("div", { className: `mapui:flex mapui:items-center mapui:gap-1.5 mapui:mt-0.5 ${i ? "mapui:ml-14" : "mapui:ml-7"}`, children: [
|
|
185
|
+
/* @__PURE__ */ e(
|
|
186
|
+
"input",
|
|
187
|
+
{
|
|
188
|
+
type: "range",
|
|
189
|
+
min: 0,
|
|
190
|
+
max: 1,
|
|
191
|
+
step: 0.01,
|
|
192
|
+
value: a,
|
|
193
|
+
onChange: (m) => n(t, parseFloat(m.target.value)),
|
|
194
|
+
className: "range-sm mapui:w-14"
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ d("span", { className: "mapui:text-[9px] mapui:text-slate-400 mapui:w-6 mapui:text-right mapui:tabular-nums", children: [
|
|
198
|
+
Math.round(a * 100),
|
|
199
|
+
"%"
|
|
200
|
+
] })
|
|
201
|
+
] });
|
|
202
|
+
}
|
|
203
|
+
function P({ layers: t, visibleLayerIds: a, legendOrder: n, onOpacityChange: i, className: m }) {
|
|
204
|
+
const [u, h] = v(/* @__PURE__ */ new Set()), [p, f] = v(!1), w = t.filter((s) => a.includes(s.id));
|
|
205
|
+
function x(s) {
|
|
206
|
+
h((l) => {
|
|
207
|
+
const o = new Set(l);
|
|
208
|
+
return o.has(s) ? o.delete(s) : o.add(s), o;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const r = w.filter((s) => s.legend !== void 0), b = (() => {
|
|
212
|
+
if (!n || n.length === 0) return r;
|
|
213
|
+
const s = new Map(r.map((c) => [c.id, c])), l = [], o = /* @__PURE__ */ new Set();
|
|
214
|
+
for (const c of n) {
|
|
215
|
+
const k = s.get(c);
|
|
216
|
+
k && !o.has(c) && (l.push(k), o.add(c));
|
|
217
|
+
}
|
|
218
|
+
for (const c of r)
|
|
219
|
+
o.has(c.id) || l.push(c);
|
|
220
|
+
return l;
|
|
221
|
+
})();
|
|
222
|
+
if (b.length === 0)
|
|
223
|
+
return null;
|
|
224
|
+
const g = b.some((s) => {
|
|
225
|
+
const l = s.legend, o = l.displayMode ?? "simple", c = l.showDisclosureArrow !== !1;
|
|
226
|
+
return o === "gradient" || o === "categorical" ? c && l.showColorBar !== !1 : !1;
|
|
227
|
+
});
|
|
228
|
+
return /* @__PURE__ */ d(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
className: `mapui:rounded-lg mapui:bg-white mapui:p-3 mapui:shadow-md mapui:text-sm${m ? ` ${m}` : ""}`,
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ d("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:mb-2", children: [
|
|
234
|
+
/* @__PURE__ */ e("h3", { className: "mapui:m-0 mapui:text-xs mapui:font-semibold mapui:uppercase mapui:tracking-wide mapui:text-slate-500", children: "Legend" }),
|
|
235
|
+
i && /* @__PURE__ */ e(
|
|
236
|
+
"button",
|
|
237
|
+
{
|
|
238
|
+
type: "button",
|
|
239
|
+
className: "mapui:bg-transparent mapui:border-none mapui:p-0 mapui:cursor-pointer mapui:text-slate-400 hover:mapui:text-slate-600 mapui:text-sm",
|
|
240
|
+
onClick: () => f((s) => !s),
|
|
241
|
+
"aria-label": p ? "Collapse legend" : "Expand legend",
|
|
242
|
+
children: p ? /* @__PURE__ */ e(I, {}) : /* @__PURE__ */ e(E, {})
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] }),
|
|
246
|
+
/* @__PURE__ */ e("ul", { className: `mapui:m-0 mapui:list-none mapui:p-0 ${p ? "mapui:space-y-1.5" : "mapui:space-y-2"}`, children: b.map((s) => {
|
|
247
|
+
const l = s.legend, o = l.displayMode ?? "simple", c = p || u.has(s.id);
|
|
248
|
+
return /* @__PURE__ */ d("li", { children: [
|
|
249
|
+
o === "categorical" ? /* @__PURE__ */ e(
|
|
250
|
+
T,
|
|
251
|
+
{
|
|
252
|
+
legend: l,
|
|
253
|
+
label: s.label,
|
|
254
|
+
expanded: c,
|
|
255
|
+
onToggle: () => x(s.id),
|
|
256
|
+
hasArrowColumn: g
|
|
257
|
+
}
|
|
258
|
+
) : o === "gradient" ? /* @__PURE__ */ e(
|
|
259
|
+
G,
|
|
260
|
+
{
|
|
261
|
+
legend: l,
|
|
262
|
+
label: s.label,
|
|
263
|
+
expanded: c,
|
|
264
|
+
onToggle: () => x(s.id),
|
|
265
|
+
hasArrowColumn: g
|
|
266
|
+
}
|
|
267
|
+
) : /* @__PURE__ */ e(D, { legend: l, label: s.label, hasArrowColumn: g }),
|
|
268
|
+
p && i && /* @__PURE__ */ e(
|
|
269
|
+
K,
|
|
270
|
+
{
|
|
271
|
+
layerId: s.id,
|
|
272
|
+
opacity: S(s),
|
|
273
|
+
onChange: i,
|
|
274
|
+
hasArrowColumn: g
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
] }, s.id);
|
|
278
|
+
}) })
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
export {
|
|
284
|
+
P as L
|
|
285
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
function p(i) {
|
|
3
|
+
return i == null ? "--" : typeof i == "boolean" ? i ? "Yes" : "No" : Array.isArray(i) ? i.map(p).join(", ") : typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
4
|
+
}
|
|
5
|
+
function f({
|
|
6
|
+
properties: i,
|
|
7
|
+
fields: d,
|
|
8
|
+
labels: m,
|
|
9
|
+
maxItems: n,
|
|
10
|
+
density: e = "default",
|
|
11
|
+
className: u = ""
|
|
12
|
+
}) {
|
|
13
|
+
const s = d ?? Object.keys(i), c = n != null ? s.slice(0, n) : s;
|
|
14
|
+
return e === "compact" ? /* @__PURE__ */ a("dl", { className: `mapui:m-0 mapui:text-xs ${u}`.trim(), children: c.map((t) => /* @__PURE__ */ r("div", { className: "mapui:flex mapui:gap-1 mapui:py-0.5", children: [
|
|
15
|
+
/* @__PURE__ */ r("dt", { className: "mapui:shrink-0 mapui:font-medium mapui:text-slate-500", children: [
|
|
16
|
+
(m == null ? void 0 : m[t]) ?? t,
|
|
17
|
+
":"
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ a("dd", { className: "mapui:m-0 mapui:truncate mapui:text-slate-800", children: p(i[t]) })
|
|
20
|
+
] }, t)) }) : /* @__PURE__ */ a(
|
|
21
|
+
"dl",
|
|
22
|
+
{
|
|
23
|
+
className: `mapui:m-0 mapui:grid mapui:grid-cols-2 mapui:gap-x-4 mapui:gap-y-2 mapui:text-sm ${u}`.trim(),
|
|
24
|
+
children: c.map((t) => /* @__PURE__ */ r("div", { className: "mapui:contents", children: [
|
|
25
|
+
/* @__PURE__ */ a("dt", { className: "mapui:break-words mapui:font-medium mapui:text-slate-500", children: (m == null ? void 0 : m[t]) ?? t }),
|
|
26
|
+
/* @__PURE__ */ a("dd", { className: "mapui:m-0 mapui:break-words mapui:text-slate-800", children: p(i[t]) })
|
|
27
|
+
] }, t))
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
f as P
|
|
33
|
+
};
|