col-browser 2.3.2 → 2.3.4

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-BzwnK_GR.js";
6
+ import { D as A } from "./chunks/Distributions-D_4NAlfr.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.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "Catalogue of Life browse and search React components",
5
5
  "main": "umd/col-browser.js",
6
6
  "module": "es/index.js",
@@ -74960,17 +74960,25 @@ html body {
74960
74960
  });
74961
74961
  __publicField(this, "render", () => {
74962
74962
  const { referenceId: referenceId2, referenceIndexMap, trigger } = this.props;
74963
+ const maxInline = this.props.maxInline || 4;
74963
74964
  const refIds = !isArray(referenceId2) ? [referenceId2] : referenceId2;
74964
- let icon = referenceIndexMap && get(referenceIndexMap, refIds[0]) ? refIds.map((r2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
74965
- "a",
74966
- {
74967
- className: "col-reference-link",
74968
- href: `#col-reference-${r2}`,
74969
- onClick: (e2) => this.scrollToReference(e2, r2),
74970
- children: `[${referenceIndexMap[r2]}]`
74971
- },
74972
- r2
74973
- )) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, { style: { cursor: "pointer" } });
74965
+ let icon = referenceIndexMap && get(referenceIndexMap, refIds[0]) ? (() => {
74966
+ const shown = refIds.slice(0, maxInline);
74967
+ const overflow = refIds.length - shown.length;
74968
+ return [
74969
+ ...shown.map((r2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
74970
+ "a",
74971
+ {
74972
+ className: "col-reference-link",
74973
+ href: `#col-reference-${r2}`,
74974
+ onClick: (e2) => this.scrollToReference(e2, r2),
74975
+ children: `[${referenceIndexMap[r2]}]`
74976
+ },
74977
+ r2
74978
+ )),
74979
+ overflow > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "col-reference-link", children: ` +${overflow}` }, "overflow") : null
74980
+ ];
74981
+ })() : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, { style: { cursor: "pointer" } });
74974
74982
  return referenceId2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: `reference_${referenceId2}`, style: this.props.style, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
74975
74983
  Popover,
74976
74984
  {
@@ -87235,7 +87243,7 @@ html body {
87235
87243
  }
87236
87244
  }
87237
87245
  render() {
87238
- var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
87246
+ var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
87239
87247
  const {
87240
87248
  datasetKey,
87241
87249
  showDistributionMap,
@@ -87557,49 +87565,58 @@ html body {
87557
87565
  get(taxon, "accordingToDate") && `, ${dayjs(get(taxon, "accordingToDate")).format("LL")}`
87558
87566
  ] }) }) }),
87559
87567
  get(taxon, "scrutinizer") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md * 2, label: "Taxonomic scrutiny", children: `${get(taxon, "scrutinizer")}${get(taxon, "scrutinizerDate") ? ", " + get(taxon, "scrutinizerDate") : ""}` }) }),
87560
- get(sourceDataset, "title") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Source", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "inline-block" }, children: [
87561
- ((_n = info == null ? void 0 : info.usage) == null ? void 0 : _n.merged) && /* @__PURE__ */ jsxRuntimeExports.jsx(
87562
- MergedDataBadge,
87563
- {
87564
- createdBy: (_o = info == null ? void 0 : info.usage) == null ? void 0 : _o.createdBy,
87565
- datasetKey: (_p = info == null ? void 0 : info.usage) == null ? void 0 : _p.datasetKey,
87566
- verbatimSourceKey: (_q = info == null ? void 0 : info.usage) == null ? void 0 : _q.verbatimSourceKey,
87567
- sourceDatasetKey: (_r = info == null ? void 0 : info.source) == null ? void 0 : _r.sourceDatasetKey,
87568
- sourceId: (_s = info == null ? void 0 : info.source) == null ? void 0 : _s.sourceId
87569
- }
87570
- ),
87571
- " ",
87572
- ((_t = info == null ? void 0 : info.source) == null ? void 0 : _t.sourceId) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
87573
- "a",
87574
- {
87575
- href: `https://www.checklistbank.org/dataset/${(_u = info == null ? void 0 : info.source) == null ? void 0 : _u.sourceDatasetKey}/taxon/${(_v = info == null ? void 0 : info.source) == null ? void 0 : _v.sourceId}`,
87576
- children: get(sourceDataset, "alias")
87577
- }
87578
- ) : get(sourceDataset, "alias"),
87579
- ": ",
87580
- /* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "source", args: get(sourceDataset, "key"), children: get(sourceDataset, "title") }),
87581
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { marginLeft: "10px" }, children: get(sourceDataset, "completeness") && get(sourceDataset, "completeness") + "%" }),
87582
- get(sourceDataset, "confidence") && /* @__PURE__ */ jsxRuntimeExports.jsx(
87583
- Rate,
87584
- {
87585
- style: { marginLeft: "10px" },
87586
- value: get(sourceDataset, "confidence"),
87587
- disabled: true
87588
- }
87589
- )
87590
- ] }) }),
87568
+ get(sourceDataset, "title") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Source", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
87569
+ "div",
87570
+ {
87571
+ style: {
87572
+ display: "inline-block",
87573
+ paddingLeft: ((_n = info == null ? void 0 : info.usage) == null ? void 0 : _n.merged) ? "22px" : 0
87574
+ },
87575
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
87576
+ XrGutter,
87577
+ {
87578
+ merged: (_o = info == null ? void 0 : info.usage) == null ? void 0 : _o.merged,
87579
+ createdBy: (_p = info == null ? void 0 : info.usage) == null ? void 0 : _p.createdBy,
87580
+ datasetKey: (_q = info == null ? void 0 : info.usage) == null ? void 0 : _q.datasetKey,
87581
+ verbatimSourceKey: (_r = info == null ? void 0 : info.usage) == null ? void 0 : _r.verbatimSourceKey,
87582
+ sourceDatasetKey: (_s = info == null ? void 0 : info.source) == null ? void 0 : _s.sourceDatasetKey,
87583
+ sourceId: (_t = info == null ? void 0 : info.source) == null ? void 0 : _t.sourceId,
87584
+ children: [
87585
+ ((_u = info == null ? void 0 : info.source) == null ? void 0 : _u.sourceId) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
87586
+ "a",
87587
+ {
87588
+ href: `https://www.checklistbank.org/dataset/${(_v = info == null ? void 0 : info.source) == null ? void 0 : _v.sourceDatasetKey}/taxon/${(_w = info == null ? void 0 : info.source) == null ? void 0 : _w.sourceId}`,
87589
+ children: get(sourceDataset, "alias")
87590
+ }
87591
+ ) : get(sourceDataset, "alias"),
87592
+ ": ",
87593
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "source", args: get(sourceDataset, "key"), children: get(sourceDataset, "title") }),
87594
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { marginLeft: "10px" }, children: get(sourceDataset, "completeness") && get(sourceDataset, "completeness") + "%" }),
87595
+ get(sourceDataset, "confidence") && /* @__PURE__ */ jsxRuntimeExports.jsx(
87596
+ Rate,
87597
+ {
87598
+ style: { marginLeft: "10px" },
87599
+ value: get(sourceDataset, "confidence"),
87600
+ disabled: true
87601
+ }
87602
+ )
87603
+ ]
87604
+ }
87605
+ )
87606
+ }
87607
+ ) }),
87591
87608
  get(taxon, "link") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Original record", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: get(taxon, "link"), children: get(taxon, "link") }) }),
87592
- ((_w = info == null ? void 0 : info.source) == null ? void 0 : _w.secondarySources) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Secondary Sources", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SecondarySources, { info, datasetKey }) }),
87609
+ ((_x = info == null ? void 0 : info.source) == null ? void 0 : _x.secondarySources) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Secondary Sources", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SecondarySources, { info, datasetKey }) }),
87593
87610
  get(info, "references") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "References", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
87594
87611
  ReferencesTable,
87595
87612
  {
87596
87613
  referenceIndexMap,
87597
- primarySourceDatasetKey: (_x = info == null ? void 0 : info.source) == null ? void 0 : _x.sourceDatasetKey,
87614
+ primarySourceDatasetKey: (_y = info == null ? void 0 : info.source) == null ? void 0 : _y.sourceDatasetKey,
87598
87615
  data: get(info, "references"),
87599
87616
  style: { marginTop: "-3px" }
87600
87617
  }
87601
87618
  ) }),
87602
- ((_z = (_y = window == null ? void 0 : window.location) == null ? void 0 : _y.hostname) == null ? void 0 : _z.endsWith("catalogueoflife.org")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Feedback, { taxonKey: (_B = (_A = this == null ? void 0 : this.state) == null ? void 0 : _A.taxon) == null ? void 0 : _B.id, datasetKey: this.props.datasetKey }) })
87619
+ ((_A = (_z = window == null ? void 0 : window.location) == null ? void 0 : _z.hostname) == null ? void 0 : _A.endsWith("catalogueoflife.org")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Feedback, { taxonKey: (_C = (_B = this == null ? void 0 : this.state) == null ? void 0 : _B.taxon) == null ? void 0 : _C.id, datasetKey: this.props.datasetKey }) })
87603
87620
  ]
87604
87621
  }
87605
87622
  ) });