@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,401 +0,0 @@
|
|
|
1
|
-
import { jsxs as x, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useState as I, useRef as A, useId as S, useMemo as E, useCallback as R, useEffect as D } from "react";
|
|
3
|
-
function V({
|
|
4
|
-
value: e,
|
|
5
|
-
onChange: p,
|
|
6
|
-
suggestions: u,
|
|
7
|
-
onQueryChange: b,
|
|
8
|
-
placeholder: f = "",
|
|
9
|
-
className: o = "",
|
|
10
|
-
id: g
|
|
11
|
-
}) {
|
|
12
|
-
const [y, h] = I(!1), [l, i] = I(-1), c = A(null), v = S(), a = l >= 0 ? `${v}-option-${l}` : void 0, n = E(
|
|
13
|
-
() => u.filter((s) => s.toLowerCase().includes(e.toLowerCase())),
|
|
14
|
-
[u, e]
|
|
15
|
-
), N = y && n.length > 0, t = R(
|
|
16
|
-
(s) => {
|
|
17
|
-
p(s), b == null || b(s), h(!1), i(-1);
|
|
18
|
-
},
|
|
19
|
-
[p, b]
|
|
20
|
-
), r = (s) => {
|
|
21
|
-
const d = s.target.value;
|
|
22
|
-
p(d), b == null || b(d), h(!0), i(-1);
|
|
23
|
-
}, $ = (s) => {
|
|
24
|
-
N && (s.key === "ArrowDown" ? (s.preventDefault(), i((d) => Math.min(d + 1, n.length - 1))) : s.key === "ArrowUp" ? (s.preventDefault(), i((d) => Math.max(d - 1, 0))) : s.key === "Enter" && l >= 0 ? (s.preventDefault(), t(n[l])) : s.key === "Escape" && (h(!1), i(-1)));
|
|
25
|
-
};
|
|
26
|
-
return D(() => {
|
|
27
|
-
const s = (d) => {
|
|
28
|
-
c.current && !c.current.contains(d.target) && (h(!1), i(-1));
|
|
29
|
-
};
|
|
30
|
-
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
31
|
-
}, []), /* @__PURE__ */ x("div", { ref: c, className: `mapui:relative ${o}`.trim(), children: [
|
|
32
|
-
/* @__PURE__ */ m(
|
|
33
|
-
"input",
|
|
34
|
-
{
|
|
35
|
-
id: g,
|
|
36
|
-
type: "text",
|
|
37
|
-
value: e,
|
|
38
|
-
placeholder: f,
|
|
39
|
-
role: "combobox",
|
|
40
|
-
"aria-expanded": N,
|
|
41
|
-
"aria-autocomplete": "list",
|
|
42
|
-
"aria-controls": v,
|
|
43
|
-
"aria-activedescendant": a,
|
|
44
|
-
onChange: r,
|
|
45
|
-
onFocus: () => h(!0),
|
|
46
|
-
onKeyDown: $,
|
|
47
|
-
className: "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"
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
N && /* @__PURE__ */ m(
|
|
51
|
-
"ul",
|
|
52
|
-
{
|
|
53
|
-
id: v,
|
|
54
|
-
role: "listbox",
|
|
55
|
-
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",
|
|
56
|
-
children: n.map((s, d) => /* @__PURE__ */ m(
|
|
57
|
-
"li",
|
|
58
|
-
{
|
|
59
|
-
id: `${v}-option-${d}`,
|
|
60
|
-
role: "option",
|
|
61
|
-
"aria-selected": d === l,
|
|
62
|
-
onMouseDown: (w) => {
|
|
63
|
-
w.preventDefault(), t(s);
|
|
64
|
-
},
|
|
65
|
-
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm ${d === l ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
|
|
66
|
-
children: s
|
|
67
|
-
},
|
|
68
|
-
`${d}-${s}`
|
|
69
|
-
))
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] });
|
|
73
|
-
}
|
|
74
|
-
function k({
|
|
75
|
-
startValue: e,
|
|
76
|
-
endValue: p,
|
|
77
|
-
onStartChange: u,
|
|
78
|
-
onEndChange: b,
|
|
79
|
-
className: f = "",
|
|
80
|
-
id: o
|
|
81
|
-
}) {
|
|
82
|
-
const g = S(), y = o ?? g, h = `${y}-start`, l = `${y}-end`, i = "mapui:flex-1 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";
|
|
83
|
-
return /* @__PURE__ */ x("div", { className: `mapui:flex mapui:flex-col mapui:gap-1.5 ${f}`.trim(), children: [
|
|
84
|
-
/* @__PURE__ */ x("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
85
|
-
/* @__PURE__ */ m("label", { htmlFor: h, className: "mapui:text-xs mapui:text-gray-400 mapui:w-8", children: "From" }),
|
|
86
|
-
/* @__PURE__ */ m(
|
|
87
|
-
"input",
|
|
88
|
-
{
|
|
89
|
-
id: h,
|
|
90
|
-
type: "datetime-local",
|
|
91
|
-
value: e,
|
|
92
|
-
onChange: (c) => u(c.target.value),
|
|
93
|
-
"aria-label": "Start date",
|
|
94
|
-
className: i
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
] }),
|
|
98
|
-
/* @__PURE__ */ x("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
99
|
-
/* @__PURE__ */ m("label", { htmlFor: l, className: "mapui:text-xs mapui:text-gray-400 mapui:w-8", children: "To" }),
|
|
100
|
-
/* @__PURE__ */ m(
|
|
101
|
-
"input",
|
|
102
|
-
{
|
|
103
|
-
id: l,
|
|
104
|
-
type: "datetime-local",
|
|
105
|
-
value: p,
|
|
106
|
-
onChange: (c) => b(c.target.value),
|
|
107
|
-
"aria-label": "End date",
|
|
108
|
-
className: i
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
] })
|
|
112
|
-
] });
|
|
113
|
-
}
|
|
114
|
-
const q = {
|
|
115
|
-
eq: "=",
|
|
116
|
-
gt: ">",
|
|
117
|
-
lt: "<",
|
|
118
|
-
gte: ">=",
|
|
119
|
-
lte: "<=",
|
|
120
|
-
between: "between"
|
|
121
|
-
}, z = {
|
|
122
|
-
eq: "equal to",
|
|
123
|
-
gt: "greater than",
|
|
124
|
-
lt: "less than",
|
|
125
|
-
gte: "greater than or equal to",
|
|
126
|
-
lte: "less than or equal to",
|
|
127
|
-
between: "between"
|
|
128
|
-
}, L = ["eq", "gt", "lt", "gte", "lte", "between"];
|
|
129
|
-
function M(e, p) {
|
|
130
|
-
if (e && typeof e == "object") {
|
|
131
|
-
if ("operator" in e) return e.operator;
|
|
132
|
-
if ("min" in e) return "between";
|
|
133
|
-
}
|
|
134
|
-
return p;
|
|
135
|
-
}
|
|
136
|
-
const j = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", B = "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 mapui:bg-white";
|
|
137
|
-
function _({ field: e, value: p, onChange: u, className: b = "", id: f }) {
|
|
138
|
-
const [o, g] = I(
|
|
139
|
-
() => M(p, e.operator)
|
|
140
|
-
);
|
|
141
|
-
D(() => {
|
|
142
|
-
g(M(p, e.operator));
|
|
143
|
-
}, [p, e.operator]);
|
|
144
|
-
const y = o === "between", h = e.inputMode === "slider" ? L.filter((t) => t !== "between") : L, l = (t) => {
|
|
145
|
-
if (g(t), t === "between")
|
|
146
|
-
u(void 0);
|
|
147
|
-
else if (y)
|
|
148
|
-
u(void 0);
|
|
149
|
-
else if (p && typeof p == "object" && "value" in p) {
|
|
150
|
-
const r = p.value;
|
|
151
|
-
u({ value: r, operator: t });
|
|
152
|
-
}
|
|
153
|
-
}, i = (t) => {
|
|
154
|
-
u(t === "" ? void 0 : { value: Number(t), operator: o });
|
|
155
|
-
}, c = (t) => {
|
|
156
|
-
const r = p && typeof p == "object" && "max" in p ? p.max : void 0;
|
|
157
|
-
u(t === "" ? r === void 0 ? void 0 : { min: e.min ?? 0, max: r } : { min: Number(t), max: r ?? e.max ?? 0 });
|
|
158
|
-
}, v = (t) => {
|
|
159
|
-
const r = p && typeof p == "object" && "min" in p ? p.min : void 0;
|
|
160
|
-
u(t === "" ? r === void 0 ? void 0 : { min: r, max: e.max ?? 0 } : { min: r ?? e.min ?? 0, max: Number(t) });
|
|
161
|
-
}, a = p && typeof p == "object" && "value" in p ? String(p.value) : "", n = p && typeof p == "object" && "min" in p ? String(p.min) : "", N = p && typeof p == "object" && "max" in p ? String(p.max) : "";
|
|
162
|
-
return /* @__PURE__ */ x("div", { className: `mapui:flex mapui:flex-col mapui:gap-1.5 ${b}`.trim(), children: [
|
|
163
|
-
/* @__PURE__ */ m(
|
|
164
|
-
"select",
|
|
165
|
-
{
|
|
166
|
-
value: o,
|
|
167
|
-
onChange: (t) => l(t.target.value),
|
|
168
|
-
"aria-label": `${e.label} operator`,
|
|
169
|
-
className: B,
|
|
170
|
-
children: h.map((t) => /* @__PURE__ */ m("option", { value: t, children: (e.operatorLabelStyle === "word" ? z : q)[t] }, t))
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
y ? (
|
|
174
|
-
/* Between: min + max inputs */
|
|
175
|
-
/* @__PURE__ */ x("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
176
|
-
/* @__PURE__ */ m(
|
|
177
|
-
"input",
|
|
178
|
-
{
|
|
179
|
-
type: "number",
|
|
180
|
-
value: n,
|
|
181
|
-
placeholder: e.min !== void 0 ? String(e.min) : "Min",
|
|
182
|
-
min: e.min,
|
|
183
|
-
max: e.max,
|
|
184
|
-
step: e.step,
|
|
185
|
-
onChange: (t) => c(t.target.value),
|
|
186
|
-
"aria-label": `${e.label} minimum`,
|
|
187
|
-
className: `${j} mapui:w-1/2`
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
/* @__PURE__ */ m(
|
|
191
|
-
"input",
|
|
192
|
-
{
|
|
193
|
-
type: "number",
|
|
194
|
-
value: N,
|
|
195
|
-
placeholder: e.max !== void 0 ? String(e.max) : "Max",
|
|
196
|
-
min: e.min,
|
|
197
|
-
max: e.max,
|
|
198
|
-
step: e.step,
|
|
199
|
-
onChange: (t) => v(t.target.value),
|
|
200
|
-
"aria-label": `${e.label} maximum`,
|
|
201
|
-
className: `${j} mapui:w-1/2`
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
] })
|
|
205
|
-
) : e.inputMode === "slider" ? (
|
|
206
|
-
/* Slider */
|
|
207
|
-
e.showRange ? /* @__PURE__ */ x("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
208
|
-
/* @__PURE__ */ x("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
209
|
-
/* @__PURE__ */ m("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:whitespace-nowrap", children: e.min ?? 0 }),
|
|
210
|
-
/* @__PURE__ */ m(
|
|
211
|
-
"input",
|
|
212
|
-
{
|
|
213
|
-
type: "range",
|
|
214
|
-
value: a !== "" ? a : e.min ?? 0,
|
|
215
|
-
min: e.min ?? 0,
|
|
216
|
-
max: e.max ?? 100,
|
|
217
|
-
step: e.step ?? 1,
|
|
218
|
-
onChange: (t) => i(t.target.value),
|
|
219
|
-
"aria-label": e.label,
|
|
220
|
-
className: "mapui:flex-1"
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
/* @__PURE__ */ m("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:whitespace-nowrap", children: e.max ?? 100 })
|
|
224
|
-
] }),
|
|
225
|
-
/* @__PURE__ */ m("span", { className: "mapui:text-xs mapui:text-gray-600 mapui:text-center", children: a !== "" ? a : e.min ?? 0 })
|
|
226
|
-
] }) : /* @__PURE__ */ x("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
227
|
-
/* @__PURE__ */ m(
|
|
228
|
-
"input",
|
|
229
|
-
{
|
|
230
|
-
type: "range",
|
|
231
|
-
value: a !== "" ? a : e.min ?? 0,
|
|
232
|
-
min: e.min ?? 0,
|
|
233
|
-
max: e.max ?? 100,
|
|
234
|
-
step: e.step ?? 1,
|
|
235
|
-
onChange: (t) => i(t.target.value),
|
|
236
|
-
"aria-label": e.label,
|
|
237
|
-
className: "mapui:flex-1"
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ m("span", { className: "mapui:text-xs mapui:text-gray-600 mapui:min-w-12 mapui:whitespace-nowrap mapui:text-right", children: a !== "" ? a : e.min ?? 0 })
|
|
241
|
-
] })
|
|
242
|
-
) : (
|
|
243
|
-
/* Number input */
|
|
244
|
-
/* @__PURE__ */ m(
|
|
245
|
-
"input",
|
|
246
|
-
{
|
|
247
|
-
id: f,
|
|
248
|
-
type: "number",
|
|
249
|
-
value: a,
|
|
250
|
-
placeholder: e.placeholder ?? "",
|
|
251
|
-
min: e.min,
|
|
252
|
-
max: e.max,
|
|
253
|
-
step: e.step,
|
|
254
|
-
onChange: (t) => i(t.target.value),
|
|
255
|
-
className: j
|
|
256
|
-
}
|
|
257
|
-
)
|
|
258
|
-
)
|
|
259
|
-
] });
|
|
260
|
-
}
|
|
261
|
-
function K(e) {
|
|
262
|
-
return e === void 0 || e === "" || e === null ? !1 : typeof e == "object" && "start" in e && "end" in e ? e.start !== "" || e.end !== "" : !0;
|
|
263
|
-
}
|
|
264
|
-
function H({
|
|
265
|
-
layers: e,
|
|
266
|
-
activeFilters: p,
|
|
267
|
-
onFilterChange: u,
|
|
268
|
-
onClearFilters: b,
|
|
269
|
-
autocompleteSuggestions: f = {},
|
|
270
|
-
onZoomToFeature: o,
|
|
271
|
-
onFetchSuggestions: g,
|
|
272
|
-
className: y = "",
|
|
273
|
-
hideTitle: h
|
|
274
|
-
}) {
|
|
275
|
-
const l = E(
|
|
276
|
-
() => e.filter((i) => {
|
|
277
|
-
var c;
|
|
278
|
-
return (c = i.search) == null ? void 0 : c.fields.length;
|
|
279
|
-
}),
|
|
280
|
-
[e]
|
|
281
|
-
);
|
|
282
|
-
return D(() => {
|
|
283
|
-
if (g)
|
|
284
|
-
for (const i of l)
|
|
285
|
-
for (const c of i.search.fields)
|
|
286
|
-
c.type === "select" && c.prefetch && g(i.id, c.property, "", { prefetch: !0 });
|
|
287
|
-
}, [l, g]), l.length === 0 ? /* @__PURE__ */ x("div", { className: `mapui:flex mapui:flex-col mapui:gap-1 ${y}`.trim(), children: [
|
|
288
|
-
!h && /* @__PURE__ */ m("h3", { className: "mapui:m-0 mapui:mb-2 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Search & Filter" }),
|
|
289
|
-
/* @__PURE__ */ m("p", { className: "mapui:m-0 mapui:text-xs mapui:text-gray-500", children: "No searchable layers configured." })
|
|
290
|
-
] }) : /* @__PURE__ */ x("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${y}`.trim(), children: [
|
|
291
|
-
!h && /* @__PURE__ */ m("h3", { className: "mapui:m-0 mapui:mb-2 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Search & Filter" }),
|
|
292
|
-
l.map((i) => {
|
|
293
|
-
const c = p[i.id] ?? {}, v = Object.values(c).some(K);
|
|
294
|
-
return /* @__PURE__ */ x("div", { className: "mapui:flex mapui:flex-col mapui:gap-3 mapui:border-b mapui:border-gray-100 mapui:pb-3 last:mapui:border-0", children: [
|
|
295
|
-
/* @__PURE__ */ x("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
296
|
-
/* @__PURE__ */ m("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-600", children: i.label }),
|
|
297
|
-
v && /* @__PURE__ */ m(
|
|
298
|
-
"button",
|
|
299
|
-
{
|
|
300
|
-
type: "button",
|
|
301
|
-
onClick: () => b(i.id),
|
|
302
|
-
className: "mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:p-0 mapui:text-xs mapui:text-blue-600 hover:mapui:text-blue-800",
|
|
303
|
-
children: "Clear"
|
|
304
|
-
}
|
|
305
|
-
)
|
|
306
|
-
] }),
|
|
307
|
-
i.search.fields.map((a) => {
|
|
308
|
-
const n = c[a.property], N = `${i.id}:${a.property}`, t = `search-${i.id}-${a.property}`;
|
|
309
|
-
return /* @__PURE__ */ x("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
310
|
-
/* @__PURE__ */ m("label", { htmlFor: t, className: "mapui:text-xs mapui:text-gray-500", children: a.label }),
|
|
311
|
-
a.type === "text" && a.autocomplete ? /* @__PURE__ */ m(
|
|
312
|
-
V,
|
|
313
|
-
{
|
|
314
|
-
id: t,
|
|
315
|
-
value: n ?? "",
|
|
316
|
-
onChange: (r) => {
|
|
317
|
-
u(i.id, a.property, r || void 0), r && a.zoomTo && (o == null || o(i.id, a.property, r));
|
|
318
|
-
},
|
|
319
|
-
suggestions: [.../* @__PURE__ */ new Set([
|
|
320
|
-
...f[N] ?? [],
|
|
321
|
-
...a.options ?? []
|
|
322
|
-
])],
|
|
323
|
-
onQueryChange: (r) => g == null ? void 0 : g(i.id, a.property, r, { prefetch: a.prefetch }),
|
|
324
|
-
placeholder: a.placeholder ?? ""
|
|
325
|
-
}
|
|
326
|
-
) : a.type === "text" ? /* @__PURE__ */ m(
|
|
327
|
-
"input",
|
|
328
|
-
{
|
|
329
|
-
id: t,
|
|
330
|
-
type: "text",
|
|
331
|
-
value: n ?? "",
|
|
332
|
-
placeholder: a.placeholder ?? "",
|
|
333
|
-
onChange: (r) => u(i.id, a.property, r.target.value || void 0),
|
|
334
|
-
onBlur: (r) => {
|
|
335
|
-
r.target.value && a.zoomTo && (o == null || o(i.id, a.property, r.target.value));
|
|
336
|
-
},
|
|
337
|
-
onKeyDown: (r) => {
|
|
338
|
-
r.key === "Enter" && r.target.value && a.zoomTo && (o == null || o(i.id, a.property, r.target.value));
|
|
339
|
-
},
|
|
340
|
-
className: "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"
|
|
341
|
-
}
|
|
342
|
-
) : a.type === "datetime" && a.range ? /* @__PURE__ */ m(
|
|
343
|
-
k,
|
|
344
|
-
{
|
|
345
|
-
id: t,
|
|
346
|
-
startValue: n && typeof n == "object" && "start" in n ? n.start : "",
|
|
347
|
-
endValue: n && typeof n == "object" && "end" in n ? n.end : "",
|
|
348
|
-
onStartChange: (r) => u(i.id, a.property, {
|
|
349
|
-
start: r,
|
|
350
|
-
end: n && typeof n == "object" && "end" in n ? n.end : ""
|
|
351
|
-
}),
|
|
352
|
-
onEndChange: (r) => u(i.id, a.property, {
|
|
353
|
-
start: n && typeof n == "object" && "start" in n ? n.start : "",
|
|
354
|
-
end: r
|
|
355
|
-
})
|
|
356
|
-
}
|
|
357
|
-
) : a.type === "datetime" ? /* @__PURE__ */ m(
|
|
358
|
-
"input",
|
|
359
|
-
{
|
|
360
|
-
id: t,
|
|
361
|
-
type: "datetime-local",
|
|
362
|
-
value: n ?? "",
|
|
363
|
-
onChange: (r) => u(i.id, a.property, r.target.value || void 0),
|
|
364
|
-
className: "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"
|
|
365
|
-
}
|
|
366
|
-
) : a.type === "number" ? /* @__PURE__ */ m(
|
|
367
|
-
_,
|
|
368
|
-
{
|
|
369
|
-
id: t,
|
|
370
|
-
field: a,
|
|
371
|
-
value: n,
|
|
372
|
-
onChange: (r) => u(i.id, a.property, r)
|
|
373
|
-
}
|
|
374
|
-
) : a.type === "select" ? (() => {
|
|
375
|
-
const r = a, $ = f[N] ?? [], s = r.options ?? [], d = [.../* @__PURE__ */ new Set([...$, ...s])];
|
|
376
|
-
return /* @__PURE__ */ x(
|
|
377
|
-
"select",
|
|
378
|
-
{
|
|
379
|
-
id: t,
|
|
380
|
-
value: n ?? "",
|
|
381
|
-
onChange: (w) => {
|
|
382
|
-
const O = w.target.value || void 0;
|
|
383
|
-
u(i.id, a.property, O), O && a.zoomTo && (o == null || o(i.id, a.property, O));
|
|
384
|
-
},
|
|
385
|
-
className: "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",
|
|
386
|
-
children: [
|
|
387
|
-
/* @__PURE__ */ m("option", { value: "", children: a.placeholder ?? "Select..." }),
|
|
388
|
-
d.map((w) => /* @__PURE__ */ m("option", { value: w, children: w }, w))
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
|
-
);
|
|
392
|
-
})() : null
|
|
393
|
-
] }, a.property);
|
|
394
|
-
})
|
|
395
|
-
] }, i.id);
|
|
396
|
-
})
|
|
397
|
-
] });
|
|
398
|
-
}
|
|
399
|
-
export {
|
|
400
|
-
H as S
|
|
401
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyDisplayEditor.test.d.ts","sourceRoot":"","sources":["../../../../src/components/PropertyDisplayEditor/__tests__/PropertyDisplayEditor.test.ts"],"names":[],"mappings":""}
|