col-browser 2.2.2 → 2.2.3

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.
@@ -3,7 +3,7 @@ import { j as i } from "./chunks/jsx-runtime-BzflLqGi.js";
3
3
  import { useState as s, useEffect as $ } from "react";
4
4
  import { s as D, c as l, R as T, b as g } from "./chunks/router-CssZk5qZ.js";
5
5
  import { Row as k, Col as v, Spin as w } from "antd";
6
- import { D as A } from "./chunks/Distributions-Cwl_75VG.js";
6
+ import { D as A } from "./chunks/Distributions-CLwWAH98.js";
7
7
  const C = ({
8
8
  taxonId: o,
9
9
  datasetKey: n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "col-browser",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Catalogue of Life browse and search React components",
5
5
  "main": "umd/col-browser.js",
6
6
  "module": "es/index.js",
@@ -104,7 +104,7 @@
104
104
  "terser": "^5.48.0",
105
105
  "typescript": "^6.0.0",
106
106
  "vite": "^6.4.2",
107
- "vitest": "^3.2.4"
107
+ "vitest": "^4.1.8"
108
108
  },
109
109
  "author": "",
110
110
  "homepage": "",
@@ -79100,49 +79100,54 @@ html body {
79100
79100
  if (!showMap && !hasAnyRecords) return null;
79101
79101
  const unmappable = baseUnmappable + fetchFailures;
79102
79102
  const showToggle = hasAnyRecords;
79103
- const activeView = showMap && showToggle ? view : showMap ? "map" : "list";
79104
- const body = activeView === "map" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
79105
- showToggle ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
79106
- Radio.Group,
79107
- {
79108
- size: "small",
79109
- value: view,
79110
- onChange: (e2) => setView(e2.target.value),
79111
- style: { marginBottom: 8 },
79112
- children: [
79113
- /* @__PURE__ */ jsxRuntimeExports.jsx(Radio.Button, { value: "map", children: "Map" }),
79114
- /* @__PURE__ */ jsxRuntimeExports.jsx(Radio.Button, { value: "list", children: "List" })
79115
- ]
79116
- }
79117
- ) : (
79118
- // Reserve the vertical space the Map/List toggle would occupy so the
79119
- // map's top edge lines up with the "Distributions" label.
79120
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: 24, marginBottom: 8 } })
79121
- ),
79122
- /* @__PURE__ */ jsxRuntimeExports.jsx(
79123
- DistributionsMap,
79124
- {
79125
- records: mappable,
79126
- onUnmappable: setFetchFailures,
79127
- datasetKey,
79128
- focalTaxon,
79129
- rankOrder,
79130
- gbifChecklistKey,
79131
- gbifAvailable
79132
- }
79133
- ),
79134
- showToggle && unmappable > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 6 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { onClick: () => setView("list"), style: { cursor: "pointer" }, children: [
79135
- "+",
79136
- unmappable,
79137
- " distribution",
79138
- unmappable === 1 ? "" : "s",
79139
- " not on map"
79140
- ] }) })
79141
- ] }) : (
79142
- // List view: either the user toggled to it, or there is no map to show.
79143
- /* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data })
79144
- );
79145
- const content = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: style2, children: body });
79103
+ let body;
79104
+ if (!showMap) {
79105
+ body = /* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data });
79106
+ } else {
79107
+ const activeView = showToggle ? view : "map";
79108
+ body = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
79109
+ showToggle ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
79110
+ Radio.Group,
79111
+ {
79112
+ size: "small",
79113
+ value: activeView,
79114
+ onChange: (e2) => setView(e2.target.value),
79115
+ style: { marginBottom: 8 },
79116
+ children: [
79117
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Radio.Button, { value: "map", children: "Map" }),
79118
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Radio.Button, { value: "list", children: "List" })
79119
+ ]
79120
+ }
79121
+ ) : (
79122
+ // Reserve the vertical space the Map/List toggle would occupy so the
79123
+ // map's top edge lines up with the "Distributions" label.
79124
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: 24, marginBottom: 8 } })
79125
+ ),
79126
+ activeView === "map" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
79127
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
79128
+ DistributionsMap,
79129
+ {
79130
+ records: mappable,
79131
+ onUnmappable: setFetchFailures,
79132
+ datasetKey,
79133
+ focalTaxon,
79134
+ rankOrder,
79135
+ gbifChecklistKey,
79136
+ gbifAvailable
79137
+ }
79138
+ ),
79139
+ showToggle && unmappable > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 6 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { onClick: () => setView("list"), style: { cursor: "pointer" }, children: [
79140
+ "+",
79141
+ unmappable,
79142
+ " distribution",
79143
+ unmappable === 1 ? "" : "s",
79144
+ " not on map"
79145
+ ] }) })
79146
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data })
79147
+ ] });
79148
+ }
79149
+ const mapNudge = label && showMap ? { marginTop: -3 } : null;
79150
+ const content = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...mapNudge, ...style2 }, children: body });
79146
79151
  return label ? /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md2, label, children: content }) : content;
79147
79152
  };
79148
79153
  const rankStyle = {
@@ -87579,7 +87584,6 @@ html body {
87579
87584
  /* @__PURE__ */ jsxRuntimeExports.jsx(
87580
87585
  DistributionsTable,
87581
87586
  {
87582
- style: { marginTop: "-3px" },
87583
87587
  label: "Distributions",
87584
87588
  md,
87585
87589
  data: (info == null ? void 0 : info.distributions) || [],