col-browser 2.3.0 → 2.3.2
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/es/chunks/{Distributions-BWucAjsL.js → Distributions-BzwnK_GR.js} +2 -2
- package/es/chunks/{Distributions-BWucAjsL.js.map → Distributions-BzwnK_GR.js.map} +1 -1
- package/es/chunks/MergedDataBadge-CdQ7RzDt.js +82 -0
- package/es/chunks/MergedDataBadge-CdQ7RzDt.js.map +1 -0
- package/es/chunks/XrGutter-CG0gAVhH.js +23 -0
- package/es/chunks/XrGutter-CG0gAVhH.js.map +1 -0
- package/es/search.js +153 -154
- package/es/search.js.map +1 -1
- package/es/sourceDatasetList.js +17 -21
- package/es/sourceDatasetList.js.map +1 -1
- package/es/taxon.js +637 -625
- package/es/taxon.js.map +1 -1
- package/es/taxonDistribution.js +1 -1
- package/es/tree.js +1 -1
- package/package.json +1 -1
- package/umd/col-browser.js +206 -235
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +4 -4
- package/umd/col-browser.min.js.map +1 -1
- package/es/chunks/MergedDataBadge-DsTsn5Xu.js +0 -134
- package/es/chunks/MergedDataBadge-DsTsn5Xu.js.map +0 -1
package/es/search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ut = Object.defineProperty;
|
|
2
|
-
var ct = (r, i,
|
|
3
|
-
var c = (r, i,
|
|
2
|
+
var ct = (r, i, a) => i in r ? ut(r, i, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[i] = a;
|
|
3
|
+
var c = (r, i, a) => ct(r, typeof i != "symbol" ? i + "" : i, a);
|
|
4
4
|
import { a as ht } from "./chunks/withDatasetKey-BgMY05XE.js";
|
|
5
5
|
import { c as j, w as dt } from "./chunks/config-BPRXv9x8.js";
|
|
6
6
|
import { j as s } from "./chunks/jsx-runtime-BzflLqGi.js";
|
|
@@ -9,50 +9,50 @@ import f from "react";
|
|
|
9
9
|
import { L as S, c as b, s as pt, R as mt, b as gt } from "./chunks/router-CssZk5qZ.js";
|
|
10
10
|
import { a as ft } from "./chunks/dataset-DvQG4NjA.js";
|
|
11
11
|
import { a as xt } from "./chunks/enumeration-yDQXSZsf.js";
|
|
12
|
-
import { r as St, w as
|
|
13
|
-
import { Input as G, Form as
|
|
12
|
+
import { r as St, w as vt } from "./chunks/storage-BgdCo9fV.js";
|
|
13
|
+
import { Input as G, Form as R, Select as k, Row as x, Col as g, AutoComplete as K, Radio as yt, Alert as jt, Button as I, Table as bt } from "antd";
|
|
14
14
|
import Ct from "query-string";
|
|
15
|
-
import { isArray as
|
|
16
|
-
import { E as
|
|
17
|
-
import { C as F, N as
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
15
|
+
import { isArray as O, startCase as m, snakeCase as M, get as u, initial as z, debounce as At, isEqual as Dt, isEmpty as Tt, merge as $t, forEach as Et } from "lodash-es";
|
|
16
|
+
import { E as Ot } from "./chunks/ErrorMsg-K8k5PPTp.js";
|
|
17
|
+
import { C as F, N as wt } from "./chunks/DatasetCitation-bkPmDDYB.js";
|
|
18
|
+
import Nt from "react-highlight-words";
|
|
19
|
+
import { X as Rt } from "./chunks/XrGutter-CG0gAVhH.js";
|
|
20
20
|
import { I as P } from "./chunks/AntdIcon-B1nMlqyh.js";
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
return
|
|
21
|
+
var kt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" };
|
|
22
|
+
function w() {
|
|
23
|
+
return w = Object.assign ? Object.assign.bind() : function(r) {
|
|
24
24
|
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
-
var
|
|
26
|
-
for (var
|
|
27
|
-
Object.prototype.hasOwnProperty.call(
|
|
25
|
+
var a = arguments[i];
|
|
26
|
+
for (var e in a)
|
|
27
|
+
Object.prototype.hasOwnProperty.call(a, e) && (r[e] = a[e]);
|
|
28
28
|
}
|
|
29
29
|
return r;
|
|
30
|
-
},
|
|
30
|
+
}, w.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const _t = (r, i) => /* @__PURE__ */ C.createElement(P, w({}, r, {
|
|
33
33
|
ref: i,
|
|
34
|
-
icon:
|
|
35
|
-
})), U = /* @__PURE__ */ C.forwardRef(
|
|
34
|
+
icon: kt
|
|
35
|
+
})), U = /* @__PURE__ */ C.forwardRef(_t);
|
|
36
36
|
process.env.NODE_ENV !== "production" && (U.displayName = "DownOutlined");
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return
|
|
37
|
+
var Bt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, name: "up", theme: "outlined" };
|
|
38
|
+
function N() {
|
|
39
|
+
return N = Object.assign ? Object.assign.bind() : function(r) {
|
|
40
40
|
for (var i = 1; i < arguments.length; i++) {
|
|
41
|
-
var
|
|
42
|
-
for (var
|
|
43
|
-
Object.prototype.hasOwnProperty.call(
|
|
41
|
+
var a = arguments[i];
|
|
42
|
+
for (var e in a)
|
|
43
|
+
Object.prototype.hasOwnProperty.call(a, e) && (r[e] = a[e]);
|
|
44
44
|
}
|
|
45
45
|
return r;
|
|
46
|
-
},
|
|
46
|
+
}, N.apply(this, arguments);
|
|
47
47
|
}
|
|
48
|
-
const It = (r, i) => /* @__PURE__ */ C.createElement(P,
|
|
48
|
+
const It = (r, i) => /* @__PURE__ */ C.createElement(P, N({}, r, {
|
|
49
49
|
ref: i,
|
|
50
|
-
icon:
|
|
50
|
+
icon: Bt
|
|
51
51
|
})), Y = /* @__PURE__ */ C.forwardRef(It);
|
|
52
52
|
process.env.NODE_ENV !== "production" && (Y.displayName = "UpOutlined");
|
|
53
|
-
const T = ["family", "superfamily", "order", "subclass", "class", "superclass", "subphylum", "phylum"], H = ({ classification: r, maxParents: i = r.length, truncate:
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
53
|
+
const T = ["family", "superfamily", "order", "subclass", "class", "superclass", "subphylum", "phylum"], H = ({ classification: r, maxParents: i = r.length, truncate: a }) => {
|
|
54
|
+
const e = r.slice(Math.max(r.length - i));
|
|
55
|
+
if (a) {
|
|
56
56
|
const n = r.reduce((h, d) => (h[d.rank] = d, h), {}), o = n.kingdom;
|
|
57
57
|
let l;
|
|
58
58
|
for (let h = 0; h < T.length; h++)
|
|
@@ -66,19 +66,19 @@ const T = ["family", "superfamily", "order", "subclass", "class", "superclass",
|
|
|
66
66
|
/* @__PURE__ */ s.jsx(S, { to: "taxon", args: l.id, children: l.name })
|
|
67
67
|
] }) : o ? /* @__PURE__ */ s.jsx(S, { to: "taxon", args: o.id, children: o.name }) : null;
|
|
68
68
|
} else
|
|
69
|
-
return
|
|
69
|
+
return e.map((n, o) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
|
|
70
70
|
/* @__PURE__ */ s.jsx(S, { to: "taxon", args: n.id, children: n.name }),
|
|
71
|
-
!Object.is(
|
|
71
|
+
!Object.is(e.length - 1, o) && " > "
|
|
72
72
|
] }, o));
|
|
73
73
|
}, Mt = G.Search;
|
|
74
74
|
class Ft extends f.Component {
|
|
75
|
-
constructor(
|
|
76
|
-
super(
|
|
75
|
+
constructor(a) {
|
|
76
|
+
super(a);
|
|
77
77
|
c(this, "componentDidMount", () => {
|
|
78
78
|
this.props.defaultValue && this.setState({ search: this.props.defaultValue });
|
|
79
79
|
});
|
|
80
|
-
c(this, "componentDidUpdate", (
|
|
81
|
-
|
|
80
|
+
c(this, "componentDidUpdate", (a) => {
|
|
81
|
+
a.defaultValue !== this.props.defaultValue && this.setState({ search: this.props.defaultValue });
|
|
82
82
|
});
|
|
83
83
|
c(this, "resetSearch", () => {
|
|
84
84
|
this.setState({ search: "" }, () => {
|
|
@@ -91,8 +91,8 @@ class Ft extends f.Component {
|
|
|
91
91
|
style: this.props.style || null,
|
|
92
92
|
placeholder: "Search query",
|
|
93
93
|
value: this.state.search,
|
|
94
|
-
onSearch: (
|
|
95
|
-
onChange: (
|
|
94
|
+
onSearch: (a) => this.props.onSearch(this.state.search),
|
|
95
|
+
onChange: (a) => this.setState({ search: a.target.value }),
|
|
96
96
|
addonAfter: this.props.addonAfter,
|
|
97
97
|
allowClear: !0,
|
|
98
98
|
autoFocus: !0
|
|
@@ -103,7 +103,7 @@ class Ft extends f.Component {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
const Lt =
|
|
106
|
+
const Lt = R.Item, L = k.Option, Vt = {
|
|
107
107
|
labelCol: {
|
|
108
108
|
xs: { span: 24 },
|
|
109
109
|
sm: { span: 24 },
|
|
@@ -116,31 +116,31 @@ const Lt = N.Item, L = R.Option, Vt = {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
class p extends f.Component {
|
|
119
|
-
constructor(
|
|
120
|
-
super(
|
|
121
|
-
c(this, "handleChange", (
|
|
122
|
-
this.setState({ selected:
|
|
123
|
-
this.props.onChange(
|
|
119
|
+
constructor(a) {
|
|
120
|
+
super(a);
|
|
121
|
+
c(this, "handleChange", (a) => {
|
|
122
|
+
this.setState({ selected: a }, () => {
|
|
123
|
+
this.props.onChange(a);
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
c(this, "render", () => {
|
|
127
|
-
const { defaultValue:
|
|
127
|
+
const { defaultValue: a, label: e, vocab: n } = this.props, { randomID: o } = this.state, l = /* @__PURE__ */ new Set([...n.map((d) => d.value)]);
|
|
128
128
|
let h;
|
|
129
|
-
return
|
|
129
|
+
return a && O(a) ? h = a.filter((d) => l.has(d)) : a && (h = [a].filter((d) => l.has(d))), /* @__PURE__ */ s.jsx(
|
|
130
130
|
Lt,
|
|
131
131
|
{
|
|
132
132
|
...Vt,
|
|
133
|
-
label:
|
|
133
|
+
label: e,
|
|
134
134
|
style: { marginBottom: "8px", width: "100%" },
|
|
135
|
-
children: /* @__PURE__ */ s.jsx("div", { id: `${M(
|
|
136
|
-
|
|
135
|
+
children: /* @__PURE__ */ s.jsx("div", { id: `${M(e)}_${o}`, children: /* @__PURE__ */ s.jsx(
|
|
136
|
+
k,
|
|
137
137
|
{
|
|
138
138
|
showSearch: !0,
|
|
139
139
|
mode: "multiple",
|
|
140
140
|
placeholder: "Please select",
|
|
141
141
|
value: h,
|
|
142
142
|
onChange: this.handleChange,
|
|
143
|
-
getPopupContainer: () => document.getElementById(`${M(
|
|
143
|
+
getPopupContainer: () => document.getElementById(`${M(e)}_${o}`),
|
|
144
144
|
children: n.map((d) => typeof d == "string" ? /* @__PURE__ */ s.jsx(L, { value: d, children: m(d) }, d) : /* @__PURE__ */ s.jsx(L, { value: d.value, children: d.label }, d.value))
|
|
145
145
|
}
|
|
146
146
|
) })
|
|
@@ -153,7 +153,7 @@ class p extends f.Component {
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
const Gt = ({ issues: r, usage: i, classification:
|
|
156
|
+
const Gt = ({ issues: r, usage: i, classification: a, vernacularNames: e, issueMap: n }) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
|
|
157
157
|
u(i, "id") && /* @__PURE__ */ s.jsxs(x, { style: { marginBottom: "10px" }, children: [
|
|
158
158
|
/* @__PURE__ */ s.jsx(
|
|
159
159
|
g,
|
|
@@ -169,7 +169,7 @@ const Gt = ({ issues: r, usage: i, classification: e, vernacularNames: a, issueM
|
|
|
169
169
|
),
|
|
170
170
|
/* @__PURE__ */ s.jsx(g, { span: 18, children: u(i, "id") })
|
|
171
171
|
] }),
|
|
172
|
-
|
|
172
|
+
a && /* @__PURE__ */ s.jsxs(x, { style: { marginBottom: "10px" }, children: [
|
|
173
173
|
/* @__PURE__ */ s.jsx(
|
|
174
174
|
g,
|
|
175
175
|
{
|
|
@@ -185,11 +185,11 @@ const Gt = ({ issues: r, usage: i, classification: e, vernacularNames: a, issueM
|
|
|
185
185
|
/* @__PURE__ */ s.jsx(g, { span: 18, children: /* @__PURE__ */ s.jsx(
|
|
186
186
|
H,
|
|
187
187
|
{
|
|
188
|
-
classification: z(
|
|
188
|
+
classification: z(a)
|
|
189
189
|
}
|
|
190
190
|
) })
|
|
191
191
|
] }),
|
|
192
|
-
|
|
192
|
+
e && /* @__PURE__ */ s.jsxs(x, { children: [
|
|
193
193
|
/* @__PURE__ */ s.jsx(
|
|
194
194
|
g,
|
|
195
195
|
{
|
|
@@ -202,51 +202,51 @@ const Gt = ({ issues: r, usage: i, classification: e, vernacularNames: a, issueM
|
|
|
202
202
|
children: "Vernacular:"
|
|
203
203
|
}
|
|
204
204
|
),
|
|
205
|
-
/* @__PURE__ */ s.jsx(g, { span: 18, style: { paddingBottom: "12px" }, children:
|
|
205
|
+
/* @__PURE__ */ s.jsx(g, { span: 18, style: { paddingBottom: "12px" }, children: e.slice(0, 8).map((o) => o.name).join(", ") })
|
|
206
206
|
] })
|
|
207
207
|
] });
|
|
208
208
|
K.Option;
|
|
209
209
|
class Kt extends f.Component {
|
|
210
|
-
constructor(
|
|
211
|
-
super(
|
|
210
|
+
constructor(a) {
|
|
211
|
+
super(a);
|
|
212
212
|
c(this, "componentDidMount", () => {
|
|
213
|
-
const { defaultDatasetKey: e } = this.props;
|
|
214
|
-
e && this.setDefaultValue(e);
|
|
215
|
-
});
|
|
216
|
-
c(this, "componentDidUpdate", (e) => {
|
|
217
213
|
const { defaultDatasetKey: a } = this.props;
|
|
218
|
-
a &&
|
|
214
|
+
a && this.setDefaultValue(a);
|
|
215
|
+
});
|
|
216
|
+
c(this, "componentDidUpdate", (a) => {
|
|
217
|
+
const { defaultDatasetKey: e } = this.props;
|
|
218
|
+
e && e !== a.defaultDatasetKey ? this.setDefaultValue(e) : a.defaultDatasetKey && !e && this.setState({ value: "" });
|
|
219
219
|
});
|
|
220
|
-
c(this, "setDefaultValue", (
|
|
221
|
-
b(`${j.dataApi}dataset/${
|
|
222
|
-
this.setState({ value: u(
|
|
220
|
+
c(this, "setDefaultValue", (a) => {
|
|
221
|
+
b(`${j.dataApi}dataset/${a}`).then((e) => {
|
|
222
|
+
this.setState({ value: u(e, "data.title") || "" }), this.props.onSelectDataset(e.data);
|
|
223
223
|
});
|
|
224
224
|
});
|
|
225
|
-
c(this, "getDatasets", (
|
|
226
|
-
const { contributesTo:
|
|
227
|
-
b(`${j.dataApi}dataset?q=${
|
|
225
|
+
c(this, "getDatasets", (a) => {
|
|
226
|
+
const { contributesTo: e } = this.props;
|
|
227
|
+
b(`${j.dataApi}dataset?q=${a}&limit=30${e ? "&contributesTo=" + e : ""}`).then((n) => {
|
|
228
228
|
this.setState({ datasets: n.data.result });
|
|
229
229
|
}).catch((n) => {
|
|
230
230
|
this.setState({ datasets: [], err: n });
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
|
-
c(this, "onSelectDataset", (
|
|
234
|
-
this.setState({ value:
|
|
233
|
+
c(this, "onSelectDataset", (a, e) => {
|
|
234
|
+
this.setState({ value: a }), this.props.onSelectDataset({ key: e.key, title: a });
|
|
235
235
|
});
|
|
236
236
|
c(this, "onReset", () => {
|
|
237
237
|
this.setState({ value: "", names: [] }, this.props.onResetSearch);
|
|
238
238
|
});
|
|
239
239
|
c(this, "render", () => {
|
|
240
|
-
const { value:
|
|
240
|
+
const { value: a, randomID: e } = this.state, { style: n } = this.props, o = this.state.datasets ? this.state.datasets.map((l) => {
|
|
241
241
|
const h = `${l.alias || l.title} [${l.key}]`;
|
|
242
242
|
return {
|
|
243
243
|
key: l.key,
|
|
244
244
|
value: h,
|
|
245
245
|
label: /* @__PURE__ */ s.jsx(
|
|
246
|
-
|
|
246
|
+
Nt,
|
|
247
247
|
{
|
|
248
248
|
highlightStyle: { fontWeight: "bold", padding: 0 },
|
|
249
|
-
searchWords:
|
|
249
|
+
searchWords: a.split(" "),
|
|
250
250
|
autoEscape: !0,
|
|
251
251
|
textToHighlight: h
|
|
252
252
|
}
|
|
@@ -254,7 +254,7 @@ class Kt extends f.Component {
|
|
|
254
254
|
data: l
|
|
255
255
|
};
|
|
256
256
|
}) : [];
|
|
257
|
-
return /* @__PURE__ */ s.jsx("div", { id: `dataset_autocomplete_${
|
|
257
|
+
return /* @__PURE__ */ s.jsx("div", { id: `dataset_autocomplete_${e}`, children: /* @__PURE__ */ s.jsx(
|
|
258
258
|
K,
|
|
259
259
|
{
|
|
260
260
|
onSelect: this.onSelectDataset,
|
|
@@ -263,8 +263,8 @@ class Kt extends f.Component {
|
|
|
263
263
|
placeholder: this.props.placeHolder || "Find dataset",
|
|
264
264
|
style: n || { width: "100%" },
|
|
265
265
|
onChange: (l) => this.setState({ value: l }),
|
|
266
|
-
value:
|
|
267
|
-
getPopupContainer: () => document.getElementById(`dataset_autocomplete_${
|
|
266
|
+
value: a,
|
|
267
|
+
getPopupContainer: () => document.getElementById(`dataset_autocomplete_${e}`),
|
|
268
268
|
children: /* @__PURE__ */ s.jsx(G.Search, { allowClear: !0 })
|
|
269
269
|
}
|
|
270
270
|
) });
|
|
@@ -279,7 +279,7 @@ class Kt extends f.Component {
|
|
|
279
279
|
this.getDatasets.cancel();
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
const V = "search-content-type", $ =
|
|
282
|
+
const V = "search-content-type", $ = R.Item, zt = yt.Group, q = [
|
|
283
283
|
"rank",
|
|
284
284
|
"issue",
|
|
285
285
|
"status",
|
|
@@ -291,7 +291,7 @@ const V = "search-content-type", $ = N.Item, zt = vt.Group, q = [
|
|
|
291
291
|
"environment",
|
|
292
292
|
"group",
|
|
293
293
|
"authorshipYear"
|
|
294
|
-
],
|
|
294
|
+
], y = 50, W = 50, E = {
|
|
295
295
|
limit: 50,
|
|
296
296
|
offset: 0,
|
|
297
297
|
facet: q,
|
|
@@ -299,23 +299,22 @@ const V = "search-content-type", $ = N.Item, zt = vt.Group, q = [
|
|
|
299
299
|
facetLimit: W,
|
|
300
300
|
sortBy: "relevance"
|
|
301
301
|
}, Pt = () => [
|
|
302
|
-
{
|
|
303
|
-
title: "",
|
|
304
|
-
dataIndex: ["usage", "merged"],
|
|
305
|
-
key: "merged",
|
|
306
|
-
width: 12,
|
|
307
|
-
render: (r, i) => {
|
|
308
|
-
var e, a, n;
|
|
309
|
-
return (e = i == null ? void 0 : i.usage) != null && e.merged ? /* @__PURE__ */ s.jsx(Nt, { datasetKey: (a = i == null ? void 0 : i.usage) == null ? void 0 : a.datasetKey, verbatimSourceKey: (n = i == null ? void 0 : i.usage) == null ? void 0 : n.verbatimSourceKey }) : "";
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
302
|
{
|
|
313
303
|
title: "Scientific Name",
|
|
314
304
|
dataIndex: ["usage", "labelHtml"],
|
|
315
305
|
key: "scientificName",
|
|
316
306
|
render: (r, i) => {
|
|
317
|
-
|
|
318
|
-
|
|
307
|
+
var e, n, o;
|
|
308
|
+
const a = u(i, "usage.accepted.id") || u(i, "usage.id");
|
|
309
|
+
return /* @__PURE__ */ s.jsx(
|
|
310
|
+
Rt,
|
|
311
|
+
{
|
|
312
|
+
merged: (e = i == null ? void 0 : i.usage) == null ? void 0 : e.merged,
|
|
313
|
+
datasetKey: (n = i == null ? void 0 : i.usage) == null ? void 0 : n.datasetKey,
|
|
314
|
+
verbatimSourceKey: (o = i == null ? void 0 : i.usage) == null ? void 0 : o.verbatimSourceKey,
|
|
315
|
+
children: /* @__PURE__ */ s.jsx(S, { to: "taxon", args: a, children: /* @__PURE__ */ s.jsx("span", { dangerouslySetInnerHTML: { __html: r } }) })
|
|
316
|
+
}
|
|
317
|
+
);
|
|
319
318
|
},
|
|
320
319
|
width: 200,
|
|
321
320
|
sorter: !0
|
|
@@ -363,47 +362,47 @@ const V = "search-content-type", $ = N.Item, zt = vt.Group, q = [
|
|
|
363
362
|
}
|
|
364
363
|
];
|
|
365
364
|
class Ut extends f.Component {
|
|
366
|
-
constructor(
|
|
367
|
-
super(
|
|
365
|
+
constructor(a) {
|
|
366
|
+
super(a);
|
|
368
367
|
c(this, "componentDidMount", async () => {
|
|
369
368
|
this.parseParamsAndGetData();
|
|
370
|
-
const { datasetKey:
|
|
369
|
+
const { datasetKey: a } = this.props;
|
|
371
370
|
try {
|
|
372
|
-
const { data:
|
|
371
|
+
const { data: e } = await ft(a);
|
|
373
372
|
this.setState({
|
|
374
|
-
dataset:
|
|
375
|
-
datasetOrigin: ((
|
|
373
|
+
dataset: e,
|
|
374
|
+
datasetOrigin: ((e == null ? void 0 : e.origin) || "").toLowerCase()
|
|
376
375
|
});
|
|
377
376
|
} catch {
|
|
378
377
|
}
|
|
379
378
|
try {
|
|
380
|
-
const
|
|
381
|
-
this.setState({ taxGroups:
|
|
379
|
+
const e = await xt();
|
|
380
|
+
this.setState({ taxGroups: e });
|
|
382
381
|
} catch {
|
|
383
382
|
}
|
|
384
383
|
});
|
|
385
|
-
c(this, "componentDidUpdate", (
|
|
386
|
-
Dt(
|
|
384
|
+
c(this, "componentDidUpdate", (a) => {
|
|
385
|
+
Dt(a.filters, this.props.filters) || this.parseParamsAndGetData();
|
|
387
386
|
});
|
|
388
387
|
c(this, "getRank", () => {
|
|
389
388
|
b(`${j.dataApi}vocab/rank`).then(
|
|
390
|
-
(
|
|
389
|
+
(a) => this.setState({ rank: a.data.map((e) => e.name) })
|
|
391
390
|
);
|
|
392
391
|
});
|
|
393
392
|
c(this, "parseParamsAndGetData", () => {
|
|
394
|
-
const { defaultTaxonKey:
|
|
395
|
-
let n = { ...
|
|
396
|
-
if (
|
|
393
|
+
const { defaultTaxonKey: a, filters: e } = this.props;
|
|
394
|
+
let n = { ...e || {} };
|
|
395
|
+
if (a && !n.TAXON_ID && (n.TAXON_ID = a), Tt(n)) {
|
|
397
396
|
n = { ...E };
|
|
398
397
|
const o = St(V, void 0);
|
|
399
398
|
o != null && (n.sectorMode = o), this.pushParams(n);
|
|
400
399
|
} else n.facet || (n.facet = q);
|
|
401
|
-
n.facetLimit || (n.facetLimit = W), delete n.fuzzy, n.type && String(n.type).toUpperCase() !== "FUZZY" && delete n.type, n.limit || (n.limit =
|
|
400
|
+
n.facetLimit || (n.facetLimit = W), delete n.fuzzy, n.type && String(n.type).toUpperCase() !== "FUZZY" && delete n.type, n.limit || (n.limit = y), n.offset || (n.offset = 0), this.setState(
|
|
402
401
|
{
|
|
403
402
|
params: n,
|
|
404
403
|
pagination: {
|
|
405
|
-
pageSize: n.limit ||
|
|
406
|
-
current: Number(n.offset || 0) / Number(n.limit ||
|
|
404
|
+
pageSize: n.limit || y,
|
|
405
|
+
current: Number(n.offset || 0) / Number(n.limit || y) + 1,
|
|
407
406
|
showQuickJumper: !0,
|
|
408
407
|
pageSizeOptions: [50, 100, 500, 1e3]
|
|
409
408
|
}
|
|
@@ -411,14 +410,14 @@ class Ut extends f.Component {
|
|
|
411
410
|
this.getData
|
|
412
411
|
);
|
|
413
412
|
});
|
|
414
|
-
c(this, "pushParams", (
|
|
415
|
-
const
|
|
416
|
-
|
|
413
|
+
c(this, "pushParams", (a) => {
|
|
414
|
+
const e = { ...a };
|
|
415
|
+
e.q || delete e.q, this.props.onFiltersChange && this.props.onFiltersChange(e);
|
|
417
416
|
});
|
|
418
417
|
c(this, "getData", () => {
|
|
419
|
-
const { params:
|
|
418
|
+
const { params: a } = this.state;
|
|
420
419
|
this.setState({ loading: !0 });
|
|
421
|
-
const { datasetKey:
|
|
420
|
+
const { datasetKey: e } = this.props, n = `${j.dataApi}dataset/${e}/nameusage/search`, o = u(a, "status") ? a : { ...a, status: "_NOT_NULL" };
|
|
422
421
|
b(`${n}?${Ct.stringify(o)}`).then((l) => {
|
|
423
422
|
const h = { ...this.state.pagination };
|
|
424
423
|
h.total = l.data.total, this.setState({
|
|
@@ -431,22 +430,22 @@ class Ut extends f.Component {
|
|
|
431
430
|
this.setState({ loading: !1, error: l, data: [] });
|
|
432
431
|
});
|
|
433
432
|
});
|
|
434
|
-
c(this, "handleTableChange", (
|
|
433
|
+
c(this, "handleTableChange", (a, e, n) => {
|
|
435
434
|
let o = $t(this.state.params, {
|
|
436
|
-
limit:
|
|
437
|
-
offset: (
|
|
438
|
-
...
|
|
435
|
+
limit: a.pageSize,
|
|
436
|
+
offset: (a.current - 1) * a.pageSize,
|
|
437
|
+
...e
|
|
439
438
|
});
|
|
440
439
|
n && n.field && (n.field[n.field.length - 1] === "labelHtml" ? o.sortBy = "name" : n.field[n.field.length - 1] === "rank" ? o.sortBy = "taxonomic" : o.sortBy = n.field[n.field.length - 1]), n && n.order === "descend" ? o.reverse = !0 : o.reverse = !1, this.setState({ params: o }, () => this.pushParams(o));
|
|
441
440
|
});
|
|
442
|
-
c(this, "updateSearch", (
|
|
443
|
-
"sectorMode" in
|
|
444
|
-
let
|
|
445
|
-
Et(
|
|
446
|
-
|
|
441
|
+
c(this, "updateSearch", (a) => {
|
|
442
|
+
"sectorMode" in a && vt(V, a.sectorMode);
|
|
443
|
+
let e = { ...this.state.params, offset: 0, limit: 50 };
|
|
444
|
+
Et(a, (o, l) => {
|
|
445
|
+
e[l] = o;
|
|
447
446
|
});
|
|
448
|
-
const n = Object.keys(
|
|
449
|
-
(o, l) => (
|
|
447
|
+
const n = Object.keys(e).reduce(
|
|
448
|
+
(o, l) => (e[l] !== null && (o[l] = e[l]), o),
|
|
450
449
|
{}
|
|
451
450
|
);
|
|
452
451
|
this.setState(
|
|
@@ -472,7 +471,7 @@ class Ut extends f.Component {
|
|
|
472
471
|
params: {},
|
|
473
472
|
taxGroups: [],
|
|
474
473
|
pagination: {
|
|
475
|
-
pageSize:
|
|
474
|
+
pageSize: y,
|
|
476
475
|
current: 1,
|
|
477
476
|
showQuickJumper: !0,
|
|
478
477
|
pageSizeOptions: [50, 100, 500, 1e3]
|
|
@@ -482,49 +481,49 @@ class Ut extends f.Component {
|
|
|
482
481
|
};
|
|
483
482
|
}
|
|
484
483
|
render() {
|
|
485
|
-
var
|
|
484
|
+
var B;
|
|
486
485
|
const {
|
|
487
|
-
data: { result:
|
|
486
|
+
data: { result: a, facets: e },
|
|
488
487
|
loading: n,
|
|
489
488
|
error: o,
|
|
490
489
|
params: l,
|
|
491
490
|
pagination: h,
|
|
492
491
|
advancedFilters: d,
|
|
493
|
-
dataset:
|
|
492
|
+
dataset: v,
|
|
494
493
|
taxGroups: Ht
|
|
495
|
-
} = this.state, { datasetKey: A, defaultTaxonKey:
|
|
494
|
+
} = this.state, { datasetKey: A, defaultTaxonKey: X, citation: _ } = this.props, D = String(l.type || "").toUpperCase() === "FUZZY", Z = u(e, "rank") ? e.rank.map((t) => ({
|
|
496
495
|
value: t.value,
|
|
497
496
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
498
497
|
})) : null;
|
|
499
|
-
u(
|
|
498
|
+
u(e, "issue") && e.issue.map((t) => ({
|
|
500
499
|
value: t.value,
|
|
501
500
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
502
501
|
}));
|
|
503
|
-
const J = u(
|
|
502
|
+
const J = u(e, "status") ? e.status.map((t) => ({
|
|
504
503
|
value: t.value,
|
|
505
504
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
506
|
-
})) : null, Q = u(
|
|
505
|
+
})) : null, Q = u(e, "nomStatus") ? e.nomStatus.map((t) => ({
|
|
507
506
|
value: t.value,
|
|
508
507
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
509
|
-
})) : null, tt = u(
|
|
508
|
+
})) : null, tt = u(e, "nameType") ? e.nameType.map((t) => ({
|
|
510
509
|
value: t.value,
|
|
511
510
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
512
|
-
})) : null, et = u(
|
|
511
|
+
})) : null, et = u(e, "field") ? e.field.map((t) => ({
|
|
513
512
|
value: t.value,
|
|
514
513
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
515
|
-
})) : null, at = u(
|
|
514
|
+
})) : null, at = u(e, "authorship") ? e.authorship.map((t) => ({
|
|
516
515
|
value: t.value,
|
|
517
516
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
518
|
-
})) : [], st = (t) => t === "1" || t === !0 || t === "true" ? "Extinct" : t === "0" || t === !1 || t === "false" ? "Extant" : "Unknown", nt = u(
|
|
517
|
+
})) : [], st = (t) => t === "1" || t === !0 || t === "true" ? "Extinct" : t === "0" || t === !1 || t === "false" ? "Extant" : "Unknown", nt = u(e, "extinct") ? e.extinct.map((t) => ({
|
|
519
518
|
value: t.value,
|
|
520
519
|
label: `${st(t == null ? void 0 : t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
521
|
-
})) : [], lt = u(
|
|
520
|
+
})) : [], lt = u(e, "environment") ? e.environment.map((t) => ({
|
|
522
521
|
value: t.value,
|
|
523
522
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
524
|
-
})) : [], it = u(
|
|
523
|
+
})) : [], it = u(e, "group") ? e.group.map((t) => ({
|
|
525
524
|
value: t.value,
|
|
526
525
|
label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
|
|
527
|
-
})) : [], ot = u(
|
|
526
|
+
})) : [], ot = u(e, "authorshipYear") ? e.authorshipYear.map((t) => ({
|
|
528
527
|
value: t.value,
|
|
529
528
|
label: `${t.value} (${t.count.toLocaleString("en-GB")})`
|
|
530
529
|
})) : [];
|
|
@@ -538,12 +537,12 @@ class Ut extends f.Component {
|
|
|
538
537
|
margin: "16px 0"
|
|
539
538
|
},
|
|
540
539
|
children: [
|
|
541
|
-
|
|
540
|
+
_ === "top" && v && /* @__PURE__ */ s.jsx(F, { dataset: v }),
|
|
542
541
|
/* @__PURE__ */ s.jsx(x, { children: o && /* @__PURE__ */ s.jsx(
|
|
543
542
|
jt,
|
|
544
543
|
{
|
|
545
544
|
style: { marginBottom: "10px" },
|
|
546
|
-
message: /* @__PURE__ */ s.jsx(
|
|
545
|
+
message: /* @__PURE__ */ s.jsx(Ot, { error: o }),
|
|
547
546
|
type: "error"
|
|
548
547
|
}
|
|
549
548
|
) }),
|
|
@@ -559,11 +558,11 @@ class Ut extends f.Component {
|
|
|
559
558
|
}
|
|
560
559
|
),
|
|
561
560
|
/* @__PURE__ */ s.jsx(
|
|
562
|
-
|
|
561
|
+
wt,
|
|
563
562
|
{
|
|
564
563
|
datasetKey: A,
|
|
565
564
|
minRank: "GENUS",
|
|
566
|
-
defaultTaxonKey: u(l, "TAXON_ID") ||
|
|
565
|
+
defaultTaxonKey: u(l, "TAXON_ID") || X || null,
|
|
567
566
|
onSelectName: (t) => {
|
|
568
567
|
this.updateSearch({ TAXON_ID: t.key });
|
|
569
568
|
},
|
|
@@ -590,7 +589,7 @@ class Ut extends f.Component {
|
|
|
590
589
|
autoFocus: !1
|
|
591
590
|
}
|
|
592
591
|
) }),
|
|
593
|
-
/* @__PURE__ */ s.jsx("div", { style: { marginTop: "10px" }, children: /* @__PURE__ */ s.jsxs(
|
|
592
|
+
/* @__PURE__ */ s.jsx("div", { style: { marginTop: "10px" }, children: /* @__PURE__ */ s.jsxs(R, { layout: "inline", children: [
|
|
594
593
|
(this.state.datasetOrigin === "xrelease" || this.state.datasetOrigin === "project") && /* @__PURE__ */ s.jsx($, { label: "Content", children: /* @__PURE__ */ s.jsx(
|
|
595
594
|
zt,
|
|
596
595
|
{
|
|
@@ -599,7 +598,7 @@ class Ut extends f.Component {
|
|
|
599
598
|
onChange: (t) => {
|
|
600
599
|
this.updateSearch({ sectorMode: t.target.value.split(",").filter((rt) => rt !== "") });
|
|
601
600
|
},
|
|
602
|
-
value:
|
|
601
|
+
value: O(l == null ? void 0 : l.sectorMode) ? (B = l == null ? void 0 : l.sectorMode) == null ? void 0 : B.join(",") : (l == null ? void 0 : l.sectorMode) || "",
|
|
603
602
|
optionType: "button",
|
|
604
603
|
options: [
|
|
605
604
|
{ value: "", label: "All" },
|
|
@@ -609,14 +608,14 @@ class Ut extends f.Component {
|
|
|
609
608
|
}
|
|
610
609
|
) }),
|
|
611
610
|
/* @__PURE__ */ s.jsx($, { children: /* @__PURE__ */ s.jsx(
|
|
612
|
-
|
|
611
|
+
k,
|
|
613
612
|
{
|
|
614
613
|
mode: "multiple",
|
|
615
614
|
allowClear: !0,
|
|
616
615
|
size: "small",
|
|
617
616
|
style: { minWidth: 200 },
|
|
618
617
|
placeholder: "Search fields",
|
|
619
|
-
value:
|
|
618
|
+
value: O(l == null ? void 0 : l.content) ? l.content : l != null && l.content ? [l.content] : [],
|
|
620
619
|
onChange: (t) => this.updateSearch({ content: t.length ? t : null }),
|
|
621
620
|
options: [
|
|
622
621
|
{ value: "SCIENTIFIC_NAME", label: "Scientific name" },
|
|
@@ -644,7 +643,7 @@ class Ut extends f.Component {
|
|
|
644
643
|
{
|
|
645
644
|
defaultValue: u(l, "rank"),
|
|
646
645
|
onChange: (t) => this.updateSearch({ rank: t }),
|
|
647
|
-
vocab:
|
|
646
|
+
vocab: Z || [],
|
|
648
647
|
label: "Ranks"
|
|
649
648
|
}
|
|
650
649
|
),
|
|
@@ -754,7 +753,7 @@ class Ut extends f.Component {
|
|
|
754
753
|
size: "small",
|
|
755
754
|
columns: this.state.columns,
|
|
756
755
|
scroll: { x: "max-content" },
|
|
757
|
-
dataSource:
|
|
756
|
+
dataSource: a,
|
|
758
757
|
loading: n,
|
|
759
758
|
pagination: this.state.pagination,
|
|
760
759
|
onChange: this.handleTableChange,
|
|
@@ -769,7 +768,7 @@ class Ut extends f.Component {
|
|
|
769
768
|
)
|
|
770
769
|
}
|
|
771
770
|
),
|
|
772
|
-
|
|
771
|
+
_ === "bottom" && v && /* @__PURE__ */ s.jsx(F, { dataset: v })
|
|
773
772
|
]
|
|
774
773
|
}
|
|
775
774
|
);
|
|
@@ -778,8 +777,8 @@ class Ut extends f.Component {
|
|
|
778
777
|
function Yt({
|
|
779
778
|
datasetKey: r,
|
|
780
779
|
filters: i,
|
|
781
|
-
onFiltersChange:
|
|
782
|
-
defaultTaxonKey:
|
|
780
|
+
onFiltersChange: a,
|
|
781
|
+
defaultTaxonKey: e,
|
|
783
782
|
citation: n,
|
|
784
783
|
auth: o,
|
|
785
784
|
...l
|
|
@@ -789,8 +788,8 @@ function Yt({
|
|
|
789
788
|
{
|
|
790
789
|
datasetKey: r,
|
|
791
790
|
filters: i,
|
|
792
|
-
onFiltersChange:
|
|
793
|
-
defaultTaxonKey:
|
|
791
|
+
onFiltersChange: a,
|
|
792
|
+
defaultTaxonKey: e,
|
|
794
793
|
citation: n
|
|
795
794
|
}
|
|
796
795
|
) });
|