@ogc-maps/storybook-components 0.6.2 → 0.7.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/{Legend-B6uIqOSw.js → Legend-DNjVLgsd.js} +20 -20
- package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/{index-B4i0zJXf.js → index-RzZtWlUz.js} +259 -238
- package/dist/main.js +795 -723
- package/dist/schemas/__tests__/config.test.d.ts +2 -0
- package/dist/schemas/__tests__/config.test.d.ts.map +1 -0
- package/dist/schemas/config.d.ts +398 -313
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +19 -18
- package/dist/utils/__tests__/queryableHelpers.test.d.ts +2 -0
- package/dist/utils/__tests__/queryableHelpers.test.d.ts.map +1 -0
- package/dist/utils/queryableHelpers.d.ts +16 -2
- package/dist/utils/queryableHelpers.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ const w = {
|
|
|
8
8
|
symbol: "icon-opacity"
|
|
9
9
|
};
|
|
10
10
|
function v(i) {
|
|
11
|
-
var n;
|
|
12
|
-
const m = i.
|
|
11
|
+
var n, l;
|
|
12
|
+
const m = (n = i.styles) == null ? void 0 : n[0];
|
|
13
13
|
if (!m) return 1;
|
|
14
14
|
const e = w[m.type];
|
|
15
15
|
if (!e) return 1;
|
|
16
|
-
const u = (
|
|
16
|
+
const u = (l = m.paint) == null ? void 0 : l[e];
|
|
17
17
|
return typeof u == "number" ? u : 1;
|
|
18
18
|
}
|
|
19
19
|
function g({ color: i, shape: m }) {
|
|
@@ -70,8 +70,8 @@ function L({
|
|
|
70
70
|
expanded: e,
|
|
71
71
|
onToggle: u
|
|
72
72
|
}) {
|
|
73
|
-
var
|
|
74
|
-
const { entries: n, showLabelsCollapsed:
|
|
73
|
+
var s, d;
|
|
74
|
+
const { entries: n, showLabelsCollapsed: l } = i;
|
|
75
75
|
return /* @__PURE__ */ p("div", { children: [
|
|
76
76
|
/* @__PURE__ */ p(
|
|
77
77
|
"button",
|
|
@@ -94,8 +94,8 @@ function L({
|
|
|
94
94
|
style: { background: k(n) }
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */ a("span", { className: "mapui:truncate", children: (
|
|
97
|
+
l && !e && /* @__PURE__ */ p("div", { className: "mapui:mt-1 mapui:flex mapui:justify-between mapui:text-[10px] mapui:text-gray-500 mapui:max-w-32", children: [
|
|
98
|
+
/* @__PURE__ */ a("span", { className: "mapui:truncate", children: (s = n[0]) == null ? void 0 : s.label }),
|
|
99
99
|
n.length > 1 && /* @__PURE__ */ a("span", { className: "mapui:truncate", children: (d = n[n.length - 1]) == null ? void 0 : d.label })
|
|
100
100
|
] })
|
|
101
101
|
] }),
|
|
@@ -118,7 +118,7 @@ function E({
|
|
|
118
118
|
expanded: e,
|
|
119
119
|
onToggle: u
|
|
120
120
|
}) {
|
|
121
|
-
const { entries: n, gradientProperty:
|
|
121
|
+
const { entries: n, gradientProperty: l } = i;
|
|
122
122
|
return /* @__PURE__ */ p("div", { children: [
|
|
123
123
|
/* @__PURE__ */ p(
|
|
124
124
|
"button",
|
|
@@ -141,7 +141,7 @@ function E({
|
|
|
141
141
|
}
|
|
142
142
|
) }),
|
|
143
143
|
e && /* @__PURE__ */ p("div", { className: "mapui:mt-1 mapui:ml-4 mapui:text-xs mapui:text-gray-600", children: [
|
|
144
|
-
|
|
144
|
+
l && /* @__PURE__ */ a("div", { className: "mapui:font-medium mapui:mb-1", children: l }),
|
|
145
145
|
n.length >= 2 && /* @__PURE__ */ p("div", { className: "mapui:flex mapui:justify-between mapui:max-w-32", children: [
|
|
146
146
|
/* @__PURE__ */ a("span", { children: n[0].label }),
|
|
147
147
|
/* @__PURE__ */ a("span", { children: n[n.length - 1].label })
|
|
@@ -174,11 +174,11 @@ function j({
|
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
176
176
|
function G({ layers: i, visibleLayerIds: m, onOpacityChange: e, className: u }) {
|
|
177
|
-
const [n,
|
|
177
|
+
const [n, l] = f(/* @__PURE__ */ new Set()), [s, d] = f(!1), c = i.filter((t) => m.includes(t.id));
|
|
178
178
|
function h(t) {
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
return
|
|
179
|
+
l((o) => {
|
|
180
|
+
const r = new Set(o);
|
|
181
|
+
return r.has(t) ? r.delete(t) : r.add(t), r;
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
const x = c.filter((t) => t.legend !== void 0);
|
|
@@ -195,15 +195,15 @@ function G({ layers: i, visibleLayerIds: m, onOpacityChange: e, className: u })
|
|
|
195
195
|
type: "button",
|
|
196
196
|
className: "mapui:bg-transparent mapui:border-none mapui:p-0 mapui:cursor-pointer mapui:text-gray-400 hover:mapui:text-gray-600 mapui:text-sm",
|
|
197
197
|
onClick: () => d((t) => !t),
|
|
198
|
-
"aria-label":
|
|
199
|
-
children:
|
|
198
|
+
"aria-label": s ? "Collapse legend" : "Expand legend",
|
|
199
|
+
children: s ? /* @__PURE__ */ a(N, {}) : /* @__PURE__ */ a(y, {})
|
|
200
200
|
}
|
|
201
201
|
)
|
|
202
202
|
] }),
|
|
203
|
-
/* @__PURE__ */ a("ul", { className: `mapui:m-0 mapui:list-none mapui:p-0 ${
|
|
204
|
-
const o = t.legend,
|
|
203
|
+
/* @__PURE__ */ a("ul", { className: `mapui:m-0 mapui:list-none mapui:p-0 ${s ? "mapui:space-y-1.5" : "mapui:space-y-2"}`, children: x.map((t) => {
|
|
204
|
+
const o = t.legend, r = o.displayMode ?? "simple", b = s || n.has(t.id);
|
|
205
205
|
return /* @__PURE__ */ p("li", { children: [
|
|
206
|
-
|
|
206
|
+
r === "categorical" ? /* @__PURE__ */ a(
|
|
207
207
|
L,
|
|
208
208
|
{
|
|
209
209
|
legend: o,
|
|
@@ -211,7 +211,7 @@ function G({ layers: i, visibleLayerIds: m, onOpacityChange: e, className: u })
|
|
|
211
211
|
expanded: b,
|
|
212
212
|
onToggle: () => h(t.id)
|
|
213
213
|
}
|
|
214
|
-
) :
|
|
214
|
+
) : r === "gradient" ? /* @__PURE__ */ a(
|
|
215
215
|
E,
|
|
216
216
|
{
|
|
217
217
|
legend: o,
|
|
@@ -220,7 +220,7 @@ function G({ layers: i, visibleLayerIds: m, onOpacityChange: e, className: u })
|
|
|
220
220
|
onToggle: () => h(t.id)
|
|
221
221
|
}
|
|
222
222
|
) : /* @__PURE__ */ a(C, { legend: o, label: t.label }),
|
|
223
|
-
|
|
223
|
+
s && e && /* @__PURE__ */ a(
|
|
224
224
|
j,
|
|
225
225
|
{
|
|
226
226
|
layerId: t.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LayerEditor/LayerEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"LayerEditor.d.ts","sourceRoot":"","sources":["../../../src/components/LayerEditor/LayerEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAkC,MAAM,aAAa,CAAC;AA2B7F,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAKD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,gBAAgB,2CAuQlG"}
|