@ogc-maps/storybook-components 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ExportButton-D2xn4G74.js → ExportButton-CLsWoW4m.js} +17 -17
- package/dist/{LayerPanel-K00X2QUj.js → LayerPanel-BHpb8dbm.js} +17 -16
- package/dist/SearchPanel-DCY01Wa-.js +363 -0
- package/dist/components/ExportButton/index.js +1 -1
- package/dist/components/LayerPanel/LayerPanel.d.ts +2 -1
- package/dist/components/LayerPanel/LayerPanel.d.ts.map +1 -1
- package/dist/components/LayerPanel/index.js +1 -1
- package/dist/components/SearchPanel/AutocompleteInput.d.ts +12 -0
- package/dist/components/SearchPanel/AutocompleteInput.d.ts.map +1 -0
- package/dist/components/SearchPanel/DateRangeInput.d.ts +11 -0
- package/dist/components/SearchPanel/DateRangeInput.d.ts.map +1 -0
- package/dist/components/SearchPanel/NumberInput.d.ts +11 -0
- package/dist/components/SearchPanel/NumberInput.d.ts.map +1 -0
- package/dist/components/SearchPanel/SearchPanel.d.ts +8 -4
- package/dist/components/SearchPanel/SearchPanel.d.ts.map +1 -1
- package/dist/components/SearchPanel/index.js +1 -1
- package/dist/cql2-BaKDic7B.js +288 -0
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +31 -11
- package/dist/hooks/useCsvExport.d.ts +2 -1
- package/dist/hooks/useCsvExport.d.ts.map +1 -1
- package/dist/index-BLgVA46J.js +2854 -0
- package/dist/main.js +72 -48
- package/dist/schemas/config.d.ts +836 -64
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.js +21 -2822
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +17 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +20 -16
- package/dist/utils/__tests__/cql2.test.d.ts +2 -0
- package/dist/utils/__tests__/cql2.test.d.ts.map +1 -0
- package/dist/utils/cql2.d.ts +75 -0
- package/dist/utils/cql2.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ogcApi.d.ts +24 -7
- package/dist/utils/ogcApi.d.ts.map +1 -1
- package/package.json +4 -2
- package/dist/SearchPanel-CFVQV6JJ.js +0 -135
- package/dist/ogcApi-BuXSs9i0.js +0 -48
- package/dist/useCsvExport-wr7hy0P-.js +0 -101
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { useState as f, useEffect as U, useCallback as O } from "react";
|
|
2
|
+
function h(e) {
|
|
3
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
4
|
+
}
|
|
5
|
+
async function j(e) {
|
|
6
|
+
const t = await fetch(e);
|
|
7
|
+
if (!t.ok)
|
|
8
|
+
throw new Error(`OGC API request failed: ${t.status} ${t.statusText} (${e})`);
|
|
9
|
+
return t.json();
|
|
10
|
+
}
|
|
11
|
+
async function R(e) {
|
|
12
|
+
const t = `${h(e)}/collections?f=json`;
|
|
13
|
+
return (await j(t)).collections;
|
|
14
|
+
}
|
|
15
|
+
async function w(e, t, n = {}) {
|
|
16
|
+
var a;
|
|
17
|
+
const o = h(e), r = new URLSearchParams({ f: "geojson" });
|
|
18
|
+
if (n.limit != null && r.set("limit", String(n.limit)), n.offset != null && r.set("offset", String(n.offset)), n.bbox && r.set("bbox", n.bbox.join(",")), (a = n.properties) != null && a.length && r.set("properties", n.properties.join(",")), n.datetime && r.set("datetime", n.datetime), n.cql2Filter)
|
|
19
|
+
r.set("filter-lang", "cql2-json"), r.set("filter", JSON.stringify(n.cql2Filter));
|
|
20
|
+
else if (n.filter)
|
|
21
|
+
for (const [c, i] of Object.entries(n.filter))
|
|
22
|
+
r.set(c, String(i));
|
|
23
|
+
const s = `${o}/collections/${encodeURIComponent(t)}/items?${r}`;
|
|
24
|
+
return j(s);
|
|
25
|
+
}
|
|
26
|
+
async function Q(e, t) {
|
|
27
|
+
const o = `${h(e)}/collections/${encodeURIComponent(t)}/queryables?f=schemajson`;
|
|
28
|
+
return j(o);
|
|
29
|
+
}
|
|
30
|
+
function V(e, t, n = "WebMercatorQuad") {
|
|
31
|
+
return `${h(e)}/collections/${encodeURIComponent(t)}/tiles/${encodeURIComponent(n)}/tilejson.json`;
|
|
32
|
+
}
|
|
33
|
+
function W(e, t, n = "WebMercatorQuad") {
|
|
34
|
+
return `${h(e)}/collections/${encodeURIComponent(t)}/tiles/${encodeURIComponent(n)}/{z}/{x}/{y}`;
|
|
35
|
+
}
|
|
36
|
+
function A(e, t, n, o = "WebMercatorQuad") {
|
|
37
|
+
const s = `${h(e)}/collections/${encodeURIComponent(t)}/tiles/${encodeURIComponent(o)}/{z}/{x}/{y}`;
|
|
38
|
+
if (!n || Object.keys(n).length === 0) return s;
|
|
39
|
+
const a = new URLSearchParams();
|
|
40
|
+
for (const [c, i] of Object.entries(n))
|
|
41
|
+
a.set(c, String(i));
|
|
42
|
+
return `${s}?${a}`;
|
|
43
|
+
}
|
|
44
|
+
async function B(e, t, n, o) {
|
|
45
|
+
var c;
|
|
46
|
+
const r = o != null && o.query ? { op: "like", args: [{ property: n }, `%${o.query}%`] } : void 0, s = await w(e, t, {
|
|
47
|
+
properties: [n],
|
|
48
|
+
limit: (o == null ? void 0 : o.limit) ?? 50,
|
|
49
|
+
cql2Filter: r
|
|
50
|
+
}), a = /* @__PURE__ */ new Set();
|
|
51
|
+
for (const i of s.features) {
|
|
52
|
+
const u = (c = i.properties) == null ? void 0 : c[n];
|
|
53
|
+
u != null && typeof u == "string" && a.add(u);
|
|
54
|
+
}
|
|
55
|
+
return Array.from(a).sort();
|
|
56
|
+
}
|
|
57
|
+
function D(e, t, n, o = "WebMercatorQuad") {
|
|
58
|
+
const s = `${h(e)}/collections/${encodeURIComponent(t)}/tiles/${encodeURIComponent(o)}/{z}/{x}/{y}`;
|
|
59
|
+
if (!n) return s;
|
|
60
|
+
const a = new URLSearchParams({
|
|
61
|
+
"filter-lang": "cql2-json",
|
|
62
|
+
filter: JSON.stringify(n)
|
|
63
|
+
});
|
|
64
|
+
return `${s}?${a}`;
|
|
65
|
+
}
|
|
66
|
+
function _(e) {
|
|
67
|
+
const [t, n] = f([]), [o, r] = f(!1), [s, a] = f(null);
|
|
68
|
+
return U(() => {
|
|
69
|
+
if (!e) return;
|
|
70
|
+
let c = !1;
|
|
71
|
+
return r(!0), a(null), R(e).then((i) => {
|
|
72
|
+
c || n(i);
|
|
73
|
+
}).catch((i) => {
|
|
74
|
+
c || a(i instanceof Error ? i : new Error(String(i)));
|
|
75
|
+
}).finally(() => {
|
|
76
|
+
c || r(!1);
|
|
77
|
+
}), () => {
|
|
78
|
+
c = !0;
|
|
79
|
+
};
|
|
80
|
+
}, [e]), { collections: t, loading: o, error: s };
|
|
81
|
+
}
|
|
82
|
+
function G(e, t, n = {}) {
|
|
83
|
+
const [o, r] = f([]), [s, a] = f(!1), [c, i] = f(null), [u, g] = f(!1), d = JSON.stringify(n);
|
|
84
|
+
return U(() => {
|
|
85
|
+
if (!e || !t) return;
|
|
86
|
+
let b = !1;
|
|
87
|
+
a(!0), i(null);
|
|
88
|
+
const m = JSON.parse(d);
|
|
89
|
+
return w(e, t, m).then((l) => {
|
|
90
|
+
if (!b) {
|
|
91
|
+
r(l.features);
|
|
92
|
+
const $ = m.limit ?? 10, S = m.offset ?? 0;
|
|
93
|
+
l.numberMatched != null ? g(S + l.features.length < l.numberMatched) : g(l.features.length >= $);
|
|
94
|
+
}
|
|
95
|
+
}).catch((l) => {
|
|
96
|
+
b || (i(l instanceof Error ? l : new Error(String(l))), r([]), g(!1));
|
|
97
|
+
}).finally(() => {
|
|
98
|
+
b || a(!1);
|
|
99
|
+
}), () => {
|
|
100
|
+
b = !0;
|
|
101
|
+
};
|
|
102
|
+
}, [e, t, d]), { features: o, loading: s, error: c, hasMore: u };
|
|
103
|
+
}
|
|
104
|
+
function C(e, t) {
|
|
105
|
+
return e.includes('"') || e.includes(t) || e.includes(`
|
|
106
|
+
`) ? `"${e.replace(/"/g, '""')}"` : e;
|
|
107
|
+
}
|
|
108
|
+
function M(e, t) {
|
|
109
|
+
const n = (e.properties ?? {})[t];
|
|
110
|
+
return n == null ? "" : typeof n == "object" ? JSON.stringify(n) : String(n);
|
|
111
|
+
}
|
|
112
|
+
function k(e, t = {}) {
|
|
113
|
+
const { fields: n, includeGeometry: o = !1, delimiter: r = "," } = t;
|
|
114
|
+
if (e.length === 0) return "";
|
|
115
|
+
const s = n ?? [...new Set(e.flatMap((i) => Object.keys(i.properties ?? {})))], a = o ? [...s, "geometry"] : s, c = e.map((i) => {
|
|
116
|
+
const u = s.map(
|
|
117
|
+
(g) => C(M(i, g), r)
|
|
118
|
+
);
|
|
119
|
+
return o && u.push(C(JSON.stringify(i.geometry), r)), u.join(r);
|
|
120
|
+
});
|
|
121
|
+
return [a.map((i) => C(i, r)).join(r), ...c].join(`
|
|
122
|
+
`);
|
|
123
|
+
}
|
|
124
|
+
function E(e, t) {
|
|
125
|
+
const n = new Blob([e], { type: "text/csv;charset=utf-8;" }), o = URL.createObjectURL(n), r = document.createElement("a");
|
|
126
|
+
r.href = o, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(o);
|
|
127
|
+
}
|
|
128
|
+
function K({
|
|
129
|
+
baseUrl: e,
|
|
130
|
+
limit: t = 1e3,
|
|
131
|
+
csvOptions: n
|
|
132
|
+
}) {
|
|
133
|
+
const [o, r] = f(!1), [s, a] = f(null);
|
|
134
|
+
return { exportCsv: O(
|
|
135
|
+
async (i, u = `${i}.csv`, g) => {
|
|
136
|
+
r(!0), a(null);
|
|
137
|
+
const d = [], b = Math.min(t, 1e3);
|
|
138
|
+
let m = 0;
|
|
139
|
+
try {
|
|
140
|
+
for (; d.length < t; ) {
|
|
141
|
+
const $ = t - d.length, S = Math.min(b, $), p = await w(e, i, {
|
|
142
|
+
limit: S,
|
|
143
|
+
offset: m,
|
|
144
|
+
cql2Filter: g
|
|
145
|
+
});
|
|
146
|
+
if (d.push(...p.features), m += p.features.length, p.features.length < S || p.numberMatched != null && m >= p.numberMatched) break;
|
|
147
|
+
}
|
|
148
|
+
const l = k(d, n);
|
|
149
|
+
E(l, u);
|
|
150
|
+
} catch (l) {
|
|
151
|
+
a(l instanceof Error ? l : new Error(String(l)));
|
|
152
|
+
} finally {
|
|
153
|
+
r(!1);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
[e, t, n]
|
|
157
|
+
), loading: o, error: s };
|
|
158
|
+
}
|
|
159
|
+
function y(e, t) {
|
|
160
|
+
return { op: "=", args: [{ property: e }, t] };
|
|
161
|
+
}
|
|
162
|
+
function H(e, t) {
|
|
163
|
+
return { op: "<>", args: [{ property: e }, t] };
|
|
164
|
+
}
|
|
165
|
+
function q(e, t) {
|
|
166
|
+
return { op: ">", args: [{ property: e }, t] };
|
|
167
|
+
}
|
|
168
|
+
function L(e, t) {
|
|
169
|
+
return { op: ">=", args: [{ property: e }, t] };
|
|
170
|
+
}
|
|
171
|
+
function F(e, t) {
|
|
172
|
+
return { op: "<", args: [{ property: e }, t] };
|
|
173
|
+
}
|
|
174
|
+
function I(e, t) {
|
|
175
|
+
return { op: "<=", args: [{ property: e }, t] };
|
|
176
|
+
}
|
|
177
|
+
function J(e, t, n) {
|
|
178
|
+
return { op: "between", args: [{ property: e }, t, n] };
|
|
179
|
+
}
|
|
180
|
+
function X(e, t) {
|
|
181
|
+
return { op: "like", args: [{ property: e }, t] };
|
|
182
|
+
}
|
|
183
|
+
function Y(e, t) {
|
|
184
|
+
return { op: "in", args: [{ property: e }, t] };
|
|
185
|
+
}
|
|
186
|
+
function Z(e) {
|
|
187
|
+
return { op: "isNull", args: [{ property: e }] };
|
|
188
|
+
}
|
|
189
|
+
function x(...e) {
|
|
190
|
+
const t = e.filter((n) => n != null);
|
|
191
|
+
return t.length === 0 ? null : t.length === 1 ? t[0] : { op: "and", args: t };
|
|
192
|
+
}
|
|
193
|
+
function ee(...e) {
|
|
194
|
+
const t = e.filter((n) => n != null);
|
|
195
|
+
return t.length === 0 ? null : t.length === 1 ? t[0] : { op: "or", args: t };
|
|
196
|
+
}
|
|
197
|
+
function te(e) {
|
|
198
|
+
return { op: "not", args: [e] };
|
|
199
|
+
}
|
|
200
|
+
function N(e, t) {
|
|
201
|
+
return { op: "t_after", args: [{ property: e }, t] };
|
|
202
|
+
}
|
|
203
|
+
function z(e, t) {
|
|
204
|
+
return { op: "t_before", args: [{ property: e }, t] };
|
|
205
|
+
}
|
|
206
|
+
function T(e, t, n) {
|
|
207
|
+
const o = "date" in t ? t.date : t.timestamp, r = "date" in n ? n.date : n.timestamp;
|
|
208
|
+
return { op: "t_during", args: [{ property: e }, { interval: [o, r] }] };
|
|
209
|
+
}
|
|
210
|
+
function ne(e) {
|
|
211
|
+
const t = Object.entries(e).filter(([, n]) => n !== void 0 && n !== "").map(([n, o]) => y(n, o));
|
|
212
|
+
return x(...t);
|
|
213
|
+
}
|
|
214
|
+
function re(e, t) {
|
|
215
|
+
const n = new Map(t.map((r) => [r.property, r])), o = Object.entries(e).map(([r, s]) => {
|
|
216
|
+
if (s === void 0) return null;
|
|
217
|
+
const a = n.get(r);
|
|
218
|
+
if (typeof s == "string")
|
|
219
|
+
return s === "" ? null : (a == null ? void 0 : a.type) === "datetime" ? y(r, { timestamp: s }) : y(r, s);
|
|
220
|
+
if (typeof s == "number")
|
|
221
|
+
return y(r, s);
|
|
222
|
+
if (typeof s == "object") {
|
|
223
|
+
if ("start" in s || "end" in s) {
|
|
224
|
+
const { start: c, end: i } = s;
|
|
225
|
+
return c && i ? T(r, { timestamp: c }, { timestamp: i }) : c ? N(r, { timestamp: c }) : i ? z(r, { timestamp: i }) : null;
|
|
226
|
+
}
|
|
227
|
+
if ("value" in s && "operator" in s) {
|
|
228
|
+
const { value: c, operator: i } = s;
|
|
229
|
+
if (c == null || String(c) === "") return null;
|
|
230
|
+
switch (i) {
|
|
231
|
+
case "gt":
|
|
232
|
+
return q(r, c);
|
|
233
|
+
case "lt":
|
|
234
|
+
return F(r, c);
|
|
235
|
+
case "gte":
|
|
236
|
+
return L(r, c);
|
|
237
|
+
case "lte":
|
|
238
|
+
return I(r, c);
|
|
239
|
+
default:
|
|
240
|
+
return y(r, c);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if ("min" in s && "max" in s) {
|
|
244
|
+
const { min: c, max: i } = s;
|
|
245
|
+
return c === void 0 || i === void 0 ? null : J(r, c, i);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
});
|
|
250
|
+
return x(...o);
|
|
251
|
+
}
|
|
252
|
+
function se(e) {
|
|
253
|
+
return JSON.stringify(e);
|
|
254
|
+
}
|
|
255
|
+
export {
|
|
256
|
+
T as A,
|
|
257
|
+
K as B,
|
|
258
|
+
_ as C,
|
|
259
|
+
G as D,
|
|
260
|
+
E,
|
|
261
|
+
k as F,
|
|
262
|
+
x as a,
|
|
263
|
+
J as b,
|
|
264
|
+
B as c,
|
|
265
|
+
w as d,
|
|
266
|
+
y as e,
|
|
267
|
+
R as f,
|
|
268
|
+
Q as g,
|
|
269
|
+
ne as h,
|
|
270
|
+
re as i,
|
|
271
|
+
D as j,
|
|
272
|
+
A as k,
|
|
273
|
+
V as l,
|
|
274
|
+
W as m,
|
|
275
|
+
q as n,
|
|
276
|
+
L as o,
|
|
277
|
+
Y as p,
|
|
278
|
+
Z as q,
|
|
279
|
+
X as r,
|
|
280
|
+
F as s,
|
|
281
|
+
I as t,
|
|
282
|
+
H as u,
|
|
283
|
+
te as v,
|
|
284
|
+
ee as w,
|
|
285
|
+
se as x,
|
|
286
|
+
N as y,
|
|
287
|
+
z
|
|
288
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { SearchField } from '../types';
|
|
|
2
2
|
export { useOgcCollections, type UseOgcCollectionsResult } from './useOgcCollections';
|
|
3
3
|
export { useOgcFeatures, type UseOgcFeaturesResult } from './useOgcFeatures';
|
|
4
4
|
export { useCsvExport, type UseCsvExportOptions, type UseCsvExportResult } from './useCsvExport';
|
|
5
|
-
export type { OgcApiSource, LayerConfig, MapConfig, UIConfig, ViewConfig, StyleConfig, FilterConfig, LegendConfig, SearchConfig, SearchField, } from '../types';
|
|
5
|
+
export type { OgcApiSource, LayerConfig, MapConfig, UIConfig, ViewConfig, StyleConfig, FilterConfig, LegendConfig, SearchConfig, SearchField, TextSearchField, NumberSearchField, DatetimeSearchField, SelectSearchField, } from '../types';
|
|
6
6
|
export type SearchFieldType = SearchField['type'];
|
|
7
|
-
export { fetchCollections, fetchFeatures, fetchQueryables, getFilteredVectorTileUrl, getTileJsonUrl, getVectorTileUrl, type OgcCollection, type OgcCollectionsResponse, type GeoJsonFeature, type OgcFeatureCollection, type OgcQueryables, type QueryableProperty, type FetchFeaturesOptions, } from '../utils/ogcApi';
|
|
7
|
+
export { fetchCollections, fetchFeatures, fetchQueryables, fetchDistinctValues, getFilteredVectorTileUrl, getCql2FilteredVectorTileUrl, getTileJsonUrl, getVectorTileUrl, type OgcCollection, type OgcCollectionsResponse, type GeoJsonFeature, type OgcFeatureCollection, type OgcQueryables, type QueryableProperty, type FetchFeaturesOptions, } from '../utils/ogcApi';
|
|
8
|
+
export { eq, neq, gt, gte, lt, lte, between, like, inList, isNull, and, or, not, tAfter, tBefore, tDuring, fromSimpleFilters, fromStructuredFilters, serializeCql2, type CQL2Expression, type CQL2PropertyRef, type CQL2Date, type CQL2Timestamp, type CQL2Interval, } from '../utils/cql2';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,4BAA4B,EAC5B,cAAc,EACd,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,EAAE,EACF,GAAG,EACH,EAAE,EACF,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,GAAG,EACH,EAAE,EACF,GAAG,EACH,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
import { u as t,
|
|
2
|
-
import { f as o, a as c, b as u, g as f, c as g, d as i } from "../ogcApi-BuXSs9i0.js";
|
|
1
|
+
import { a, b as t, e as l, f as r, c as i, d as o, g as c, h as u, i as n, j as f, k as g, l as C, m as F, n as d, o as h, p as m, q, r as p, s as T, t as U, u as V, v as b, w as x, x as D, y as k, z as v, A as w, B as y, C as z, D as A } from "../cql2-BaKDic7B.js";
|
|
3
2
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
a as and,
|
|
4
|
+
t as between,
|
|
5
|
+
l as eq,
|
|
6
|
+
r as fetchCollections,
|
|
7
|
+
i as fetchDistinctValues,
|
|
8
|
+
o as fetchFeatures,
|
|
9
|
+
c as fetchQueryables,
|
|
10
|
+
u as fromSimpleFilters,
|
|
11
|
+
n as fromStructuredFilters,
|
|
12
|
+
f as getCql2FilteredVectorTileUrl,
|
|
13
|
+
g as getFilteredVectorTileUrl,
|
|
14
|
+
C as getTileJsonUrl,
|
|
15
|
+
F as getVectorTileUrl,
|
|
16
|
+
d as gt,
|
|
17
|
+
h as gte,
|
|
18
|
+
m as inList,
|
|
19
|
+
q as isNull,
|
|
20
|
+
p as like,
|
|
21
|
+
T as lt,
|
|
22
|
+
U as lte,
|
|
23
|
+
V as neq,
|
|
24
|
+
b as not,
|
|
25
|
+
x as or,
|
|
26
|
+
D as serializeCql2,
|
|
27
|
+
k as tAfter,
|
|
28
|
+
v as tBefore,
|
|
29
|
+
w as tDuring,
|
|
30
|
+
y as useCsvExport,
|
|
31
|
+
z as useOgcCollections,
|
|
32
|
+
A as useOgcFeatures
|
|
13
33
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CsvExportOptions } from '../utils/csvExport';
|
|
2
|
+
import { CQL2Expression } from '../utils/cql2';
|
|
2
3
|
export interface UseCsvExportOptions {
|
|
3
4
|
baseUrl: string;
|
|
4
5
|
limit?: number;
|
|
5
6
|
csvOptions?: CsvExportOptions;
|
|
6
7
|
}
|
|
7
8
|
export interface UseCsvExportResult {
|
|
8
|
-
exportCsv: (collectionId: string, filename?: string) => Promise<void>;
|
|
9
|
+
exportCsv: (collectionId: string, filename?: string, cql2Filter?: CQL2Expression) => Promise<void>;
|
|
9
10
|
loading: boolean;
|
|
10
11
|
error: Error | null;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCsvExport.d.ts","sourceRoot":"","sources":["../../src/hooks/useCsvExport.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useCsvExport.d.ts","sourceRoot":"","sources":["../../src/hooks/useCsvExport.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnG,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAY,EACZ,UAAU,GACX,EAAE,mBAAmB,GAAG,kBAAkB,CA4C1C"}
|