col-browser 2.1.0 → 2.2.1

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/search.js CHANGED
@@ -1,62 +1,63 @@
1
- var ot = Object.defineProperty;
2
- var rt = (r, i, a) => i in r ? ot(r, i, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[i] = a;
3
- var c = (r, i, a) => rt(r, typeof i != "symbol" ? i + "" : i, a);
4
- import { a as ut } from "./chunks/withDatasetKey-BgMY05XE.js";
5
- import { c as j, w as ct } from "./chunks/config-BPRXv9x8.js";
1
+ var rt = Object.defineProperty;
2
+ var ut = (r, i, e) => i in r ? rt(r, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[i] = e;
3
+ var c = (r, i, e) => ut(r, typeof i != "symbol" ? i + "" : i, e);
4
+ import { a as ct } from "./chunks/withDatasetKey-BgMY05XE.js";
5
+ import { c as b, w as ht } from "./chunks/config-BPRXv9x8.js";
6
6
  import { j as s } from "./chunks/jsx-runtime-BzflLqGi.js";
7
- import * as A from "react";
7
+ import * as D from "react";
8
8
  import f from "react";
9
- import { L as S, c as C, s as ht, R as dt, b as pt } from "./chunks/router-CssZk5qZ.js";
10
- import { a as mt } from "./chunks/dataset-DvQG4NjA.js";
11
- import { a as gt } from "./chunks/enumeration-yDQXSZsf.js";
12
- import { Input as F, Form as D, Select as k, Row as x, Col as g, AutoComplete as V, Radio as ft, Alert as xt, Button as St, Table as vt } from "antd";
13
- import yt from "query-string";
14
- import { isArray as O, startCase as m, snakeCase as _, get as u, initial as G, debounce as bt, isEqual as jt, isEmpty as Ct, merge as Dt, forEach as At } from "lodash-es";
15
- import { E as Tt } from "./chunks/ErrorMsg-K8k5PPTp.js";
16
- import { C as N, N as $t } from "./chunks/DatasetCitation-bkPmDDYB.js";
17
- import Et from "react-highlight-words";
18
- import { M as Ot } from "./chunks/MergedDataBadge-DsTsn5Xu.js";
19
- import { I as K } from "./chunks/AntdIcon-B1nMlqyh.js";
20
- var Rt = { 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" };
21
- function R() {
22
- return R = Object.assign ? Object.assign.bind() : function(r) {
9
+ import { L as S, c as j, s as dt, R as pt, b as mt } from "./chunks/router-CssZk5qZ.js";
10
+ import { a as gt } from "./chunks/dataset-DvQG4NjA.js";
11
+ import { a as ft } from "./chunks/enumeration-yDQXSZsf.js";
12
+ import { r as xt, w as St } from "./chunks/storage-BgdCo9fV.js";
13
+ import { Input as V, Form as C, Select as _, Row as x, Col as g, AutoComplete as G, Radio as vt, Alert as yt, Button as bt, Table as jt } from "antd";
14
+ import Ct from "query-string";
15
+ import { isArray as O, startCase as m, snakeCase as B, get as u, initial as K, debounce as Dt, isEqual as At, isEmpty as Tt, merge as Et, forEach as $t } from "lodash-es";
16
+ import { E as Ot } from "./chunks/ErrorMsg-K8k5PPTp.js";
17
+ import { C as I, N as wt } from "./chunks/DatasetCitation-bkPmDDYB.js";
18
+ import Rt from "react-highlight-words";
19
+ import { M as _t } from "./chunks/MergedDataBadge-DsTsn5Xu.js";
20
+ import { I as P } from "./chunks/AntdIcon-B1nMlqyh.js";
21
+ var Nt = { 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) {
23
24
  for (var i = 1; i < arguments.length; i++) {
24
- var a = arguments[i];
25
- for (var e in a)
26
- Object.prototype.hasOwnProperty.call(a, e) && (r[e] = a[e]);
25
+ var e = arguments[i];
26
+ for (var a in e)
27
+ Object.prototype.hasOwnProperty.call(e, a) && (r[a] = e[a]);
27
28
  }
28
29
  return r;
29
- }, R.apply(this, arguments);
30
+ }, w.apply(this, arguments);
30
31
  }
31
- const wt = (r, i) => /* @__PURE__ */ A.createElement(K, R({}, r, {
32
+ const kt = (r, i) => /* @__PURE__ */ D.createElement(P, w({}, r, {
32
33
  ref: i,
33
- icon: Rt
34
- })), P = /* @__PURE__ */ A.forwardRef(wt);
35
- process.env.NODE_ENV !== "production" && (P.displayName = "DownOutlined");
36
- var kt = { 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" };
37
- function w() {
38
- return w = Object.assign ? Object.assign.bind() : function(r) {
34
+ icon: Nt
35
+ })), z = /* @__PURE__ */ D.forwardRef(kt);
36
+ process.env.NODE_ENV !== "production" && (z.displayName = "DownOutlined");
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 R() {
39
+ return R = Object.assign ? Object.assign.bind() : function(r) {
39
40
  for (var i = 1; i < arguments.length; i++) {
40
- var a = arguments[i];
41
- for (var e in a)
42
- Object.prototype.hasOwnProperty.call(a, e) && (r[e] = a[e]);
41
+ var e = arguments[i];
42
+ for (var a in e)
43
+ Object.prototype.hasOwnProperty.call(e, a) && (r[a] = e[a]);
43
44
  }
44
45
  return r;
45
- }, w.apply(this, arguments);
46
+ }, R.apply(this, arguments);
46
47
  }
47
- const Bt = (r, i) => /* @__PURE__ */ A.createElement(K, w({}, r, {
48
+ const It = (r, i) => /* @__PURE__ */ D.createElement(P, R({}, r, {
48
49
  ref: i,
49
- icon: kt
50
- })), z = /* @__PURE__ */ A.forwardRef(Bt);
51
- process.env.NODE_ENV !== "production" && (z.displayName = "UpOutlined");
52
- const $ = ["family", "superfamily", "order", "subclass", "class", "superclass", "subphylum", "phylum"], H = ({ classification: r, maxParents: i = r.length, truncate: a }) => {
53
- const e = r.slice(Math.max(r.length - i));
54
- if (a) {
50
+ icon: Bt
51
+ })), H = /* @__PURE__ */ D.forwardRef(It);
52
+ process.env.NODE_ENV !== "production" && (H.displayName = "UpOutlined");
53
+ const T = ["family", "superfamily", "order", "subclass", "class", "superclass", "subphylum", "phylum"], U = ({ classification: r, maxParents: i = r.length, truncate: e }) => {
54
+ const a = r.slice(Math.max(r.length - i));
55
+ if (e) {
55
56
  const l = r.reduce((h, d) => (h[d.rank] = d, h), {}), o = l.kingdom;
56
57
  let n;
57
- for (let h = 0; h < $.length; h++)
58
- if (l[$[h]]) {
59
- n = l[$[h]];
58
+ for (let h = 0; h < T.length; h++)
59
+ if (l[T[h]]) {
60
+ n = l[T[h]];
60
61
  break;
61
62
  }
62
63
  return o && n ? /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
@@ -65,19 +66,19 @@ const $ = ["family", "superfamily", "order", "subclass", "class", "superclass",
65
66
  /* @__PURE__ */ s.jsx(S, { to: "taxon", args: n.id, children: n.name })
66
67
  ] }) : o ? /* @__PURE__ */ s.jsx(S, { to: "taxon", args: o.id, children: o.name }) : null;
67
68
  } else
68
- return e.map((l, o) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
69
+ return a.map((l, o) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
69
70
  /* @__PURE__ */ s.jsx(S, { to: "taxon", args: l.id, children: l.name }),
70
- !Object.is(e.length - 1, o) && " > "
71
+ !Object.is(a.length - 1, o) && " > "
71
72
  ] }, o));
72
- }, It = F.Search;
73
- class _t extends f.Component {
74
- constructor(a) {
75
- super(a);
73
+ }, Mt = V.Search;
74
+ class Lt extends f.Component {
75
+ constructor(e) {
76
+ super(e);
76
77
  c(this, "componentDidMount", () => {
77
78
  this.props.defaultValue && this.setState({ search: this.props.defaultValue });
78
79
  });
79
- c(this, "componentDidUpdate", (a) => {
80
- a.defaultValue !== this.props.defaultValue && this.setState({ search: this.props.defaultValue });
80
+ c(this, "componentDidUpdate", (e) => {
81
+ e.defaultValue !== this.props.defaultValue && this.setState({ search: this.props.defaultValue });
81
82
  });
82
83
  c(this, "resetSearch", () => {
83
84
  this.setState({ search: "" }, () => {
@@ -85,13 +86,13 @@ class _t extends f.Component {
85
86
  });
86
87
  });
87
88
  c(this, "render", () => /* @__PURE__ */ s.jsx(
88
- It,
89
+ Mt,
89
90
  {
90
91
  style: this.props.style || null,
91
92
  placeholder: "Search query",
92
93
  value: this.state.search,
93
- onSearch: (a) => this.props.onSearch(this.state.search),
94
- onChange: (a) => this.setState({ search: a.target.value }),
94
+ onSearch: (e) => this.props.onSearch(this.state.search),
95
+ onChange: (e) => this.setState({ search: e.target.value }),
95
96
  addonAfter: this.props.addonAfter,
96
97
  allowClear: !0,
97
98
  autoFocus: !0
@@ -102,7 +103,7 @@ class _t extends f.Component {
102
103
  };
103
104
  }
104
105
  }
105
- const Nt = D.Item, L = k.Option, Lt = {
106
+ const Ft = C.Item, M = _.Option, Vt = {
106
107
  labelCol: {
107
108
  xs: { span: 24 },
108
109
  sm: { span: 24 },
@@ -115,32 +116,32 @@ const Nt = D.Item, L = k.Option, Lt = {
115
116
  }
116
117
  };
117
118
  class p extends f.Component {
118
- constructor(a) {
119
- super(a);
120
- c(this, "handleChange", (a) => {
121
- this.setState({ selected: a }, () => {
122
- this.props.onChange(a);
119
+ constructor(e) {
120
+ super(e);
121
+ c(this, "handleChange", (e) => {
122
+ this.setState({ selected: e }, () => {
123
+ this.props.onChange(e);
123
124
  });
124
125
  });
125
126
  c(this, "render", () => {
126
- const { defaultValue: a, label: e, vocab: l } = this.props, { randomID: o } = this.state, n = /* @__PURE__ */ new Set([...l.map((d) => d.value)]);
127
+ const { defaultValue: e, label: a, vocab: l } = this.props, { randomID: o } = this.state, n = /* @__PURE__ */ new Set([...l.map((d) => d.value)]);
127
128
  let h;
128
- return a && O(a) ? h = a.filter((d) => n.has(d)) : a && (h = [a].filter((d) => n.has(d))), /* @__PURE__ */ s.jsx(
129
- Nt,
129
+ return e && O(e) ? h = e.filter((d) => n.has(d)) : e && (h = [e].filter((d) => n.has(d))), /* @__PURE__ */ s.jsx(
130
+ Ft,
130
131
  {
131
- ...Lt,
132
- label: e,
132
+ ...Vt,
133
+ label: a,
133
134
  style: { marginBottom: "8px", width: "100%" },
134
- children: /* @__PURE__ */ s.jsx("div", { id: `${_(e)}_${o}`, children: /* @__PURE__ */ s.jsx(
135
- k,
135
+ children: /* @__PURE__ */ s.jsx("div", { id: `${B(a)}_${o}`, children: /* @__PURE__ */ s.jsx(
136
+ _,
136
137
  {
137
138
  showSearch: !0,
138
139
  mode: "multiple",
139
140
  placeholder: "Please select",
140
141
  value: h,
141
142
  onChange: this.handleChange,
142
- getPopupContainer: () => document.getElementById(`${_(e)}_${o}`),
143
- children: l.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))
143
+ getPopupContainer: () => document.getElementById(`${B(a)}_${o}`),
144
+ children: l.map((d) => typeof d == "string" ? /* @__PURE__ */ s.jsx(M, { value: d, children: m(d) }, d) : /* @__PURE__ */ s.jsx(M, { value: d.value, children: d.label }, d.value))
144
145
  }
145
146
  ) })
146
147
  }
@@ -152,7 +153,7 @@ class p extends f.Component {
152
153
  };
153
154
  }
154
155
  }
155
- const Mt = ({ issues: r, usage: i, classification: a, vernacularNames: e, issueMap: l }) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
156
+ const Gt = ({ issues: r, usage: i, classification: e, vernacularNames: a, issueMap: l }) => /* @__PURE__ */ s.jsxs(f.Fragment, { children: [
156
157
  u(i, "id") && /* @__PURE__ */ s.jsxs(x, { style: { marginBottom: "10px" }, children: [
157
158
  /* @__PURE__ */ s.jsx(
158
159
  g,
@@ -168,7 +169,7 @@ const Mt = ({ issues: r, usage: i, classification: a, vernacularNames: e, issueM
168
169
  ),
169
170
  /* @__PURE__ */ s.jsx(g, { span: 18, children: u(i, "id") })
170
171
  ] }),
171
- a && /* @__PURE__ */ s.jsxs(x, { style: { marginBottom: "10px" }, children: [
172
+ e && /* @__PURE__ */ s.jsxs(x, { style: { marginBottom: "10px" }, children: [
172
173
  /* @__PURE__ */ s.jsx(
173
174
  g,
174
175
  {
@@ -182,13 +183,13 @@ const Mt = ({ issues: r, usage: i, classification: a, vernacularNames: e, issueM
182
183
  }
183
184
  ),
184
185
  /* @__PURE__ */ s.jsx(g, { span: 18, children: /* @__PURE__ */ s.jsx(
185
- H,
186
+ U,
186
187
  {
187
- classification: G(a)
188
+ classification: K(e)
188
189
  }
189
190
  ) })
190
191
  ] }),
191
- e && /* @__PURE__ */ s.jsxs(x, { children: [
192
+ a && /* @__PURE__ */ s.jsxs(x, { children: [
192
193
  /* @__PURE__ */ s.jsx(
193
194
  g,
194
195
  {
@@ -201,51 +202,51 @@ const Mt = ({ issues: r, usage: i, classification: a, vernacularNames: e, issueM
201
202
  children: "Vernacular:"
202
203
  }
203
204
  ),
204
- /* @__PURE__ */ s.jsx(g, { span: 18, style: { paddingBottom: "12px" }, children: e.slice(0, 8).map((o) => o.name).join(", ") })
205
+ /* @__PURE__ */ s.jsx(g, { span: 18, style: { paddingBottom: "12px" }, children: a.slice(0, 8).map((o) => o.name).join(", ") })
205
206
  ] })
206
207
  ] });
207
- V.Option;
208
- class Ft extends f.Component {
209
- constructor(a) {
210
- super(a);
208
+ G.Option;
209
+ class Kt extends f.Component {
210
+ constructor(e) {
211
+ super(e);
211
212
  c(this, "componentDidMount", () => {
212
- const { defaultDatasetKey: a } = this.props;
213
- a && this.setDefaultValue(a);
214
- });
215
- c(this, "componentDidUpdate", (a) => {
216
213
  const { defaultDatasetKey: e } = this.props;
217
- e && e !== a.defaultDatasetKey ? this.setDefaultValue(e) : a.defaultDatasetKey && !e && this.setState({ value: "" });
214
+ e && this.setDefaultValue(e);
215
+ });
216
+ c(this, "componentDidUpdate", (e) => {
217
+ const { defaultDatasetKey: a } = this.props;
218
+ a && a !== e.defaultDatasetKey ? this.setDefaultValue(a) : e.defaultDatasetKey && !a && this.setState({ value: "" });
218
219
  });
219
- c(this, "setDefaultValue", (a) => {
220
- C(`${j.dataApi}dataset/${a}`).then((e) => {
221
- this.setState({ value: u(e, "data.title") || "" }), this.props.onSelectDataset(e.data);
220
+ c(this, "setDefaultValue", (e) => {
221
+ j(`${b.dataApi}dataset/${e}`).then((a) => {
222
+ this.setState({ value: u(a, "data.title") || "" }), this.props.onSelectDataset(a.data);
222
223
  });
223
224
  });
224
- c(this, "getDatasets", (a) => {
225
- const { contributesTo: e } = this.props;
226
- C(`${j.dataApi}dataset?q=${a}&limit=30${e ? "&contributesTo=" + e : ""}`).then((l) => {
225
+ c(this, "getDatasets", (e) => {
226
+ const { contributesTo: a } = this.props;
227
+ j(`${b.dataApi}dataset?q=${e}&limit=30${a ? "&contributesTo=" + a : ""}`).then((l) => {
227
228
  this.setState({ datasets: l.data.result });
228
229
  }).catch((l) => {
229
230
  this.setState({ datasets: [], err: l });
230
231
  });
231
232
  });
232
- c(this, "onSelectDataset", (a, e) => {
233
- this.setState({ value: a }), this.props.onSelectDataset({ key: e.key, title: a });
233
+ c(this, "onSelectDataset", (e, a) => {
234
+ this.setState({ value: e }), this.props.onSelectDataset({ key: a.key, title: e });
234
235
  });
235
236
  c(this, "onReset", () => {
236
237
  this.setState({ value: "", names: [] }, this.props.onResetSearch);
237
238
  });
238
239
  c(this, "render", () => {
239
- const { value: a, randomID: e } = this.state, { style: l } = this.props, o = this.state.datasets ? this.state.datasets.map((n) => {
240
+ const { value: e, randomID: a } = this.state, { style: l } = this.props, o = this.state.datasets ? this.state.datasets.map((n) => {
240
241
  const h = `${n.alias || n.title} [${n.key}]`;
241
242
  return {
242
243
  key: n.key,
243
244
  value: h,
244
245
  label: /* @__PURE__ */ s.jsx(
245
- Et,
246
+ Rt,
246
247
  {
247
248
  highlightStyle: { fontWeight: "bold", padding: 0 },
248
- searchWords: a.split(" "),
249
+ searchWords: e.split(" "),
249
250
  autoEscape: !0,
250
251
  textToHighlight: h
251
252
  }
@@ -253,8 +254,8 @@ class Ft extends f.Component {
253
254
  data: n
254
255
  };
255
256
  }) : [];
256
- return /* @__PURE__ */ s.jsx("div", { id: `dataset_autocomplete_${e}`, children: /* @__PURE__ */ s.jsx(
257
- V,
257
+ return /* @__PURE__ */ s.jsx("div", { id: `dataset_autocomplete_${a}`, children: /* @__PURE__ */ s.jsx(
258
+ G,
258
259
  {
259
260
  onSelect: this.onSelectDataset,
260
261
  onSearch: (n) => n ? this.getDatasets(n) : this.onReset(),
@@ -262,13 +263,13 @@ class Ft extends f.Component {
262
263
  placeholder: this.props.placeHolder || "Find dataset",
263
264
  style: l || { width: "100%" },
264
265
  onChange: (n) => this.setState({ value: n }),
265
- value: a,
266
- getPopupContainer: () => document.getElementById(`dataset_autocomplete_${e}`),
267
- children: /* @__PURE__ */ s.jsx(F.Search, { allowClear: !0 })
266
+ value: e,
267
+ getPopupContainer: () => document.getElementById(`dataset_autocomplete_${a}`),
268
+ children: /* @__PURE__ */ s.jsx(V.Search, { allowClear: !0 })
268
269
  }
269
270
  ) });
270
271
  });
271
- this.getDatasets = bt(this.getDatasets, 500), this.state = {
272
+ this.getDatasets = Dt(this.getDatasets, 500), this.state = {
272
273
  datasets: [],
273
274
  value: "",
274
275
  randomID: (Math.floor(Math.random() * 100) + 1) * (Math.floor(Math.random() * 100) + 1) * (Math.floor(Math.random() * 100) + 1)
@@ -278,7 +279,7 @@ class Ft extends f.Component {
278
279
  this.getDatasets.cancel();
279
280
  }
280
281
  }
281
- const E = D.Item, M = ft.Group, U = [
282
+ const L = "search-content-type", E = C.Item, F = vt.Group, W = [
282
283
  "rank",
283
284
  "issue",
284
285
  "status",
@@ -290,22 +291,22 @@ const E = D.Item, M = ft.Group, U = [
290
291
  "environment",
291
292
  "group",
292
293
  "authorshipYear"
293
- ], y = 50, W = 50, b = {
294
+ ], y = 50, Y = 50, $ = {
294
295
  limit: 50,
295
296
  offset: 0,
296
- facet: U,
297
+ facet: W,
297
298
  //["rank", "issue", "status", "nomStatus", "nameType", "field"],
298
- facetLimit: W,
299
+ facetLimit: Y,
299
300
  sortBy: "relevance"
300
- }, Vt = () => [
301
+ }, Pt = () => [
301
302
  {
302
303
  title: "",
303
304
  dataIndex: ["usage", "merged"],
304
305
  key: "merged",
305
306
  width: 12,
306
307
  render: (r, i) => {
307
- var a, e, l;
308
- return (a = i == null ? void 0 : i.usage) != null && a.merged ? /* @__PURE__ */ s.jsx(Ot, { datasetKey: (e = i == null ? void 0 : i.usage) == null ? void 0 : e.datasetKey, verbatimSourceKey: (l = i == null ? void 0 : i.usage) == null ? void 0 : l.verbatimSourceKey }) : "";
308
+ var e, a, l;
309
+ return (e = i == null ? void 0 : i.usage) != null && e.merged ? /* @__PURE__ */ s.jsx(_t, { datasetKey: (a = i == null ? void 0 : i.usage) == null ? void 0 : a.datasetKey, verbatimSourceKey: (l = i == null ? void 0 : i.usage) == null ? void 0 : l.verbatimSourceKey }) : "";
309
310
  }
310
311
  },
311
312
  {
@@ -313,8 +314,8 @@ const E = D.Item, M = ft.Group, U = [
313
314
  dataIndex: ["usage", "labelHtml"],
314
315
  key: "scientificName",
315
316
  render: (r, i) => {
316
- const a = u(i, "usage.accepted.id") || u(i, "usage.id");
317
- return /* @__PURE__ */ s.jsx(S, { to: "taxon", args: a, children: /* @__PURE__ */ s.jsx("span", { dangerouslySetInnerHTML: { __html: r } }) });
317
+ const e = u(i, "usage.accepted.id") || u(i, "usage.id");
318
+ return /* @__PURE__ */ s.jsx(S, { to: "taxon", args: e, children: /* @__PURE__ */ s.jsx("span", { dangerouslySetInnerHTML: { __html: r } }) });
318
319
  },
319
320
  width: 200,
320
321
  sorter: !0
@@ -351,9 +352,9 @@ const E = D.Item, M = ft.Group, U = [
351
352
  key: "parents",
352
353
  width: 180,
353
354
  render: (r, i) => u(i, "classification") ? /* @__PURE__ */ s.jsx(
354
- H,
355
+ U,
355
356
  {
356
- classification: G(i.classification),
357
+ classification: K(i.classification),
357
358
  truncate: !0,
358
359
  datasetKey: u(i, "usage.name.datasetKey")
359
360
  },
@@ -361,38 +362,43 @@ const E = D.Item, M = ft.Group, U = [
361
362
  ) : ""
362
363
  }
363
364
  ];
364
- class Gt extends f.Component {
365
- constructor(a) {
366
- super(a);
365
+ class zt extends f.Component {
366
+ constructor(e) {
367
+ super(e);
367
368
  c(this, "componentDidMount", async () => {
368
369
  this.parseParamsAndGetData();
369
- const { datasetKey: a } = this.props;
370
+ const { datasetKey: e } = this.props;
370
371
  try {
371
- const { data: e } = await mt(a);
372
+ const { data: a } = await gt(e);
372
373
  this.setState({
373
- dataset: e,
374
- datasetOrigin: ((e == null ? void 0 : e.origin) || "").toLowerCase()
374
+ dataset: a,
375
+ datasetOrigin: ((a == null ? void 0 : a.origin) || "").toLowerCase()
375
376
  });
376
377
  } catch {
377
378
  }
378
379
  try {
379
- const e = await gt();
380
- this.setState({ taxGroups: e });
380
+ const a = await ft();
381
+ this.setState({ taxGroups: a });
381
382
  } catch {
382
383
  }
383
384
  });
384
- c(this, "componentDidUpdate", (a) => {
385
- jt(a.filters, this.props.filters) || this.parseParamsAndGetData();
385
+ c(this, "componentDidUpdate", (e) => {
386
+ At(e.filters, this.props.filters) || this.parseParamsAndGetData();
386
387
  });
387
388
  c(this, "getRank", () => {
388
- C(`${j.dataApi}vocab/rank`).then(
389
- (a) => this.setState({ rank: a.data.map((e) => e.name) })
389
+ j(`${b.dataApi}vocab/rank`).then(
390
+ (e) => this.setState({ rank: e.data.map((a) => a.name) })
390
391
  );
391
392
  });
392
393
  c(this, "parseParamsAndGetData", () => {
393
- const { defaultTaxonKey: a, filters: e } = this.props;
394
- let l = { ...e || {} };
395
- a && !l.TAXON_ID && (l.TAXON_ID = a), Ct(l) ? (l = b, this.pushParams(b)) : l.facet || (l.facet = U), l.facetLimit || (l.facetLimit = W), delete l.fuzzy, l.limit || (l.limit = y), l.offset || (l.offset = 0), this.setState(
394
+ const { defaultTaxonKey: e, filters: a } = this.props;
395
+ let l = { ...a || {} };
396
+ if (e && !l.TAXON_ID && (l.TAXON_ID = e), Tt(l)) {
397
+ l = { ...$ };
398
+ const o = xt(L, void 0);
399
+ o != null && (l.sectorMode = o), this.pushParams(l);
400
+ } else l.facet || (l.facet = W);
401
+ l.facetLimit || (l.facetLimit = Y), delete l.fuzzy, l.limit || (l.limit = y), l.offset || (l.offset = 0), this.setState(
396
402
  {
397
403
  params: l,
398
404
  pagination: {
@@ -405,15 +411,15 @@ class Gt extends f.Component {
405
411
  this.getData
406
412
  );
407
413
  });
408
- c(this, "pushParams", (a) => {
409
- const e = { ...a };
410
- e.q || delete e.q, this.props.onFiltersChange && this.props.onFiltersChange(e);
414
+ c(this, "pushParams", (e) => {
415
+ const a = { ...e };
416
+ a.q || delete a.q, this.props.onFiltersChange && this.props.onFiltersChange(a);
411
417
  });
412
418
  c(this, "getData", () => {
413
- const { params: a } = this.state;
419
+ const { params: e } = this.state;
414
420
  this.setState({ loading: !0 });
415
- const { datasetKey: e } = this.props, l = `${j.dataApi}dataset/${e}/nameusage/search`, o = u(a, "status") ? a : { ...a, status: "_NOT_NULL" };
416
- C(`${l}?${yt.stringify(o)}`).then((n) => {
421
+ const { datasetKey: a } = this.props, l = `${b.dataApi}dataset/${a}/nameusage/search`, o = u(e, "status") ? e : { ...e, status: "_NOT_NULL" };
422
+ j(`${l}?${Ct.stringify(o)}`).then((n) => {
417
423
  const h = { ...this.state.pagination };
418
424
  h.total = n.data.total, this.setState({
419
425
  loading: !1,
@@ -425,21 +431,22 @@ class Gt extends f.Component {
425
431
  this.setState({ loading: !1, error: n, data: [] });
426
432
  });
427
433
  });
428
- c(this, "handleTableChange", (a, e, l) => {
429
- let o = Dt(this.state.params, {
430
- limit: a.pageSize,
431
- offset: (a.current - 1) * a.pageSize,
432
- ...e
434
+ c(this, "handleTableChange", (e, a, l) => {
435
+ let o = Et(this.state.params, {
436
+ limit: e.pageSize,
437
+ offset: (e.current - 1) * e.pageSize,
438
+ ...a
433
439
  });
434
440
  l && l.field && (l.field[l.field.length - 1] === "labelHtml" ? o.sortBy = "name" : l.field[l.field.length - 1] === "rank" ? o.sortBy = "taxonomic" : o.sortBy = l.field[l.field.length - 1]), l && l.order === "descend" ? o.reverse = !0 : o.reverse = !1, this.setState({ params: o }, () => this.pushParams(o));
435
441
  });
436
- c(this, "updateSearch", (a) => {
437
- let e = { ...this.state.params, offset: 0, limit: 50 };
438
- At(a, (o, n) => {
439
- e[n] = o;
442
+ c(this, "updateSearch", (e) => {
443
+ "sectorMode" in e && St(L, e.sectorMode);
444
+ let a = { ...this.state.params, offset: 0, limit: 50 };
445
+ $t(e, (o, n) => {
446
+ a[n] = o;
440
447
  });
441
- const l = Object.keys(e).reduce(
442
- (o, n) => (e[n] !== null && (o[n] = e[n]), o),
448
+ const l = Object.keys(a).reduce(
449
+ (o, n) => (a[n] !== null && (o[n] = a[n]), o),
443
450
  {}
444
451
  );
445
452
  this.setState(
@@ -450,9 +457,9 @@ class Gt extends f.Component {
450
457
  c(this, "resetSearch", () => {
451
458
  this.setState(
452
459
  {
453
- params: b
460
+ params: $
454
461
  },
455
- () => this.pushParams(b)
462
+ () => this.pushParams($)
456
463
  );
457
464
  });
458
465
  c(this, "toggleAdvancedFilters", () => {
@@ -461,7 +468,7 @@ class Gt extends f.Component {
461
468
  this.state = {
462
469
  data: [],
463
470
  advancedFilters: !1,
464
- columns: Vt(),
471
+ columns: Pt(),
465
472
  params: {},
466
473
  taxGroups: [],
467
474
  pagination: {
@@ -475,49 +482,49 @@ class Gt extends f.Component {
475
482
  };
476
483
  }
477
484
  render() {
478
- var I;
485
+ var k;
479
486
  const {
480
- data: { result: a, facets: e },
487
+ data: { result: e, facets: a },
481
488
  loading: l,
482
489
  error: o,
483
490
  params: n,
484
491
  pagination: h,
485
492
  advancedFilters: d,
486
493
  dataset: v,
487
- taxGroups: Pt
488
- } = this.state, { datasetKey: T, defaultTaxonKey: Y, citation: B } = this.props, q = u(e, "rank") ? e.rank.map((t) => ({
494
+ taxGroups: Ut
495
+ } = this.state, { datasetKey: A, defaultTaxonKey: q, citation: N } = this.props, X = u(a, "rank") ? a.rank.map((t) => ({
489
496
  value: t.value,
490
497
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
491
498
  })) : null;
492
- u(e, "issue") && e.issue.map((t) => ({
499
+ u(a, "issue") && a.issue.map((t) => ({
493
500
  value: t.value,
494
501
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
495
502
  }));
496
- const X = u(e, "status") ? e.status.map((t) => ({
503
+ const Z = u(a, "status") ? a.status.map((t) => ({
497
504
  value: t.value,
498
505
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
499
- })) : null, Z = u(e, "nomStatus") ? e.nomStatus.map((t) => ({
506
+ })) : null, J = u(a, "nomStatus") ? a.nomStatus.map((t) => ({
500
507
  value: t.value,
501
508
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
502
- })) : null, J = u(e, "nameType") ? e.nameType.map((t) => ({
509
+ })) : null, Q = u(a, "nameType") ? a.nameType.map((t) => ({
503
510
  value: t.value,
504
511
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
505
- })) : null, Q = u(e, "field") ? e.field.map((t) => ({
512
+ })) : null, tt = u(a, "field") ? a.field.map((t) => ({
506
513
  value: t.value,
507
514
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
508
- })) : null, tt = u(e, "authorship") ? e.authorship.map((t) => ({
515
+ })) : null, et = u(a, "authorship") ? a.authorship.map((t) => ({
509
516
  value: t.value,
510
517
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
511
- })) : [], et = (t) => t === "1" || t === !0 || t === "true" ? "Extinct" : t === "0" || t === !1 || t === "false" ? "Extant" : "Unknown", at = u(e, "extinct") ? e.extinct.map((t) => ({
518
+ })) : [], at = (t) => t === "1" || t === !0 || t === "true" ? "Extinct" : t === "0" || t === !1 || t === "false" ? "Extant" : "Unknown", st = u(a, "extinct") ? a.extinct.map((t) => ({
512
519
  value: t.value,
513
- label: `${et(t == null ? void 0 : t.value)} (${t.count.toLocaleString("en-GB")})`
514
- })) : [], st = u(e, "environment") ? e.environment.map((t) => ({
520
+ label: `${at(t == null ? void 0 : t.value)} (${t.count.toLocaleString("en-GB")})`
521
+ })) : [], nt = u(a, "environment") ? a.environment.map((t) => ({
515
522
  value: t.value,
516
523
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
517
- })) : [], nt = u(e, "group") ? e.group.map((t) => ({
524
+ })) : [], lt = u(a, "group") ? a.group.map((t) => ({
518
525
  value: t.value,
519
526
  label: `${m(t.value)} (${t.count.toLocaleString("en-GB")})`
520
- })) : [], lt = u(e, "authorshipYear") ? e.authorshipYear.map((t) => ({
527
+ })) : [], it = u(a, "authorshipYear") ? a.authorshipYear.map((t) => ({
521
528
  value: t.value,
522
529
  label: `${t.value} (${t.count.toLocaleString("en-GB")})`
523
530
  })) : [];
@@ -531,19 +538,19 @@ class Gt extends f.Component {
531
538
  margin: "16px 0"
532
539
  },
533
540
  children: [
534
- B === "top" && v && /* @__PURE__ */ s.jsx(N, { dataset: v }),
541
+ N === "top" && v && /* @__PURE__ */ s.jsx(I, { dataset: v }),
535
542
  /* @__PURE__ */ s.jsx(x, { children: o && /* @__PURE__ */ s.jsx(
536
- xt,
543
+ yt,
537
544
  {
538
545
  style: { marginBottom: "10px" },
539
- message: /* @__PURE__ */ s.jsx(Tt, { error: o }),
546
+ message: /* @__PURE__ */ s.jsx(Ot, { error: o }),
540
547
  type: "error"
541
548
  }
542
549
  ) }),
543
550
  /* @__PURE__ */ s.jsxs(x, { children: [
544
551
  /* @__PURE__ */ s.jsxs(g, { xs: 24, sm: 24, md: 12, style: { marginBottom: "8px" }, children: [
545
552
  /* @__PURE__ */ s.jsx(
546
- _t,
553
+ Lt,
547
554
  {
548
555
  defaultValue: u(this.props.filters || {}, "q"),
549
556
  onSearch: (t) => this.updateSearch({ q: t }),
@@ -552,11 +559,11 @@ class Gt extends f.Component {
552
559
  }
553
560
  ),
554
561
  /* @__PURE__ */ s.jsx(
555
- $t,
562
+ wt,
556
563
  {
557
- datasetKey: T,
564
+ datasetKey: A,
558
565
  minRank: "GENUS",
559
- defaultTaxonKey: u(n, "TAXON_ID") || Y || null,
566
+ defaultTaxonKey: u(n, "TAXON_ID") || q || null,
560
567
  onSelectName: (t) => {
561
568
  this.updateSearch({ TAXON_ID: t.key });
562
569
  },
@@ -569,9 +576,9 @@ class Gt extends f.Component {
569
576
  }
570
577
  ),
571
578
  (this.state.datasetOrigin === "xrelease" || this.state.datasetOrigin === "release") && /* @__PURE__ */ s.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ s.jsx(
572
- Ft,
579
+ Kt,
573
580
  {
574
- contributesTo: Number(T),
581
+ contributesTo: Number(A),
575
582
  onSelectDataset: (t) => {
576
583
  this.updateSearch({ SECTOR_DATASET_KEY: t.key });
577
584
  },
@@ -584,8 +591,8 @@ class Gt extends f.Component {
584
591
  }
585
592
  ) }),
586
593
  /* @__PURE__ */ s.jsxs("div", { style: { marginTop: "10px" }, children: [
587
- /* @__PURE__ */ s.jsx(D, { layout: "inline", children: /* @__PURE__ */ s.jsx(E, { label: "Matching", children: /* @__PURE__ */ s.jsx(
588
- M,
594
+ /* @__PURE__ */ s.jsx(C, { layout: "inline", children: /* @__PURE__ */ s.jsx(E, { label: "Matching", children: /* @__PURE__ */ s.jsx(
595
+ F,
589
596
  {
590
597
  size: "small",
591
598
  onChange: (t) => {
@@ -601,16 +608,16 @@ class Gt extends f.Component {
601
608
  ]
602
609
  }
603
610
  ) }) }),
604
- /* @__PURE__ */ s.jsxs(D, { layout: "inline", children: [
611
+ /* @__PURE__ */ s.jsxs(C, { layout: "inline", children: [
605
612
  (this.state.datasetOrigin === "xrelease" || this.state.datasetOrigin === "project") && /* @__PURE__ */ s.jsx(E, { label: "Content", children: /* @__PURE__ */ s.jsx(
606
- M,
613
+ F,
607
614
  {
608
615
  style: { marginLeft: "8px" },
609
616
  size: "small",
610
617
  onChange: (t) => {
611
- this.updateSearch({ sectorMode: t.target.value.split(",").filter((it) => it !== "") });
618
+ this.updateSearch({ sectorMode: t.target.value.split(",").filter((ot) => ot !== "") });
612
619
  },
613
- value: O(n == null ? void 0 : n.sectorMode) ? (I = n == null ? void 0 : n.sectorMode) == null ? void 0 : I.join(",") : (n == null ? void 0 : n.sectorMode) || "",
620
+ value: O(n == null ? void 0 : n.sectorMode) ? (k = n == null ? void 0 : n.sectorMode) == null ? void 0 : k.join(",") : (n == null ? void 0 : n.sectorMode) || "",
614
621
  optionType: "button",
615
622
  options: [
616
623
  { value: "", label: "All" },
@@ -620,7 +627,7 @@ class Gt extends f.Component {
620
627
  }
621
628
  ) }),
622
629
  /* @__PURE__ */ s.jsx(E, { children: /* @__PURE__ */ s.jsx(
623
- k,
630
+ _,
624
631
  {
625
632
  mode: "multiple",
626
633
  allowClear: !0,
@@ -645,7 +652,7 @@ class Gt extends f.Component {
645
652
  {
646
653
  defaultValue: u(n, "rank"),
647
654
  onChange: (t) => this.updateSearch({ rank: t }),
648
- vocab: q || [],
655
+ vocab: X || [],
649
656
  label: "Ranks"
650
657
  }
651
658
  ),
@@ -654,7 +661,7 @@ class Gt extends f.Component {
654
661
  {
655
662
  defaultValue: u(n, "status"),
656
663
  onChange: (t) => this.updateSearch({ status: t }),
657
- vocab: X || [],
664
+ vocab: Z || [],
658
665
  label: "Status"
659
666
  }
660
667
  ),
@@ -663,7 +670,7 @@ class Gt extends f.Component {
663
670
  {
664
671
  defaultValue: u(n, "environment"),
665
672
  onChange: (t) => this.updateSearch({ environment: t }),
666
- vocab: st,
673
+ vocab: nt,
667
674
  label: "Environment"
668
675
  }
669
676
  ),
@@ -671,7 +678,7 @@ class Gt extends f.Component {
671
678
  p,
672
679
  {
673
680
  onChange: (t) => this.updateSearch({ extinct: t }),
674
- vocab: at,
681
+ vocab: st,
675
682
  label: "Extinct"
676
683
  }
677
684
  ),
@@ -681,7 +688,7 @@ class Gt extends f.Component {
681
688
  {
682
689
  defaultValue: u(n, "nomstatus"),
683
690
  onChange: (t) => this.updateSearch({ nomstatus: t }),
684
- vocab: Z || [],
691
+ vocab: J || [],
685
692
  label: "Nomenclatural status"
686
693
  }
687
694
  ),
@@ -690,7 +697,7 @@ class Gt extends f.Component {
690
697
  {
691
698
  defaultValue: u(n, "nameType"),
692
699
  onChange: (t) => this.updateSearch({ nameType: t }),
693
- vocab: J || [],
700
+ vocab: Q || [],
694
701
  label: "Name type"
695
702
  }
696
703
  ),
@@ -699,7 +706,7 @@ class Gt extends f.Component {
699
706
  {
700
707
  defaultValue: u(n, "field"),
701
708
  onChange: (t) => this.updateSearch({ field: t }),
702
- vocab: Q || [],
709
+ vocab: tt || [],
703
710
  label: "Name field"
704
711
  }
705
712
  ),
@@ -708,7 +715,7 @@ class Gt extends f.Component {
708
715
  {
709
716
  defaultValue: u(n, "authorship"),
710
717
  onChange: (t) => this.updateSearch({ authorship: t }),
711
- vocab: tt,
718
+ vocab: et,
712
719
  label: "Authorship"
713
720
  }
714
721
  ),
@@ -717,7 +724,7 @@ class Gt extends f.Component {
717
724
  {
718
725
  defaultValue: u(n, "group"),
719
726
  onChange: (t) => this.updateSearch({ group: t }),
720
- vocab: nt,
727
+ vocab: lt,
721
728
  label: "Taxonomic group"
722
729
  }
723
730
  ),
@@ -726,7 +733,7 @@ class Gt extends f.Component {
726
733
  {
727
734
  defaultValue: u(n, "authorshipYear"),
728
735
  onChange: (t) => this.updateSearch({ authorshipYear: t }),
729
- vocab: lt,
736
+ vocab: it,
730
737
  label: "Authorship year"
731
738
  }
732
739
  )
@@ -739,65 +746,65 @@ class Gt extends f.Component {
739
746
  children: [
740
747
  "Advanced",
741
748
  " ",
742
- this.state.advancedFilters ? /* @__PURE__ */ s.jsx(z, {}) : /* @__PURE__ */ s.jsx(P, {})
749
+ this.state.advancedFilters ? /* @__PURE__ */ s.jsx(H, {}) : /* @__PURE__ */ s.jsx(z, {})
743
750
  ]
744
751
  }
745
752
  ) })
746
753
  ] })
747
754
  ] }),
748
755
  /* @__PURE__ */ s.jsxs(x, { children: [
749
- /* @__PURE__ */ s.jsx(g, { span: 12, style: { textAlign: "left", marginBottom: "8px" }, children: /* @__PURE__ */ s.jsx(St, { type: "primary", danger: !0, onClick: this.resetSearch, children: "Reset all" }) }),
756
+ /* @__PURE__ */ s.jsx(g, { span: 12, style: { textAlign: "left", marginBottom: "8px" }, children: /* @__PURE__ */ s.jsx(bt, { type: "primary", danger: !0, onClick: this.resetSearch, children: "Reset all" }) }),
750
757
  /* @__PURE__ */ s.jsx(g, { span: 12, style: { textAlign: "right", marginBottom: "8px" }, children: h && !isNaN(h.total) && `results: ${h.total.toLocaleString("en-GB")}` })
751
758
  ] }),
752
759
  !o && /* @__PURE__ */ s.jsx(
753
- vt,
760
+ jt,
754
761
  {
755
762
  size: "small",
756
763
  columns: this.state.columns,
757
764
  scroll: { x: "max-content" },
758
- dataSource: a,
765
+ dataSource: e,
759
766
  loading: l,
760
767
  pagination: this.state.pagination,
761
768
  onChange: this.handleTableChange,
762
769
  rowKey: (t) => t.usage.id,
763
770
  showSorterTooltip: !1,
764
771
  expandedRowRender: (t) => /* @__PURE__ */ s.jsx(
765
- Mt,
772
+ Gt,
766
773
  {
767
774
  ...t,
768
- datasetKey: T
775
+ datasetKey: A
769
776
  }
770
777
  )
771
778
  }
772
779
  ),
773
- B === "bottom" && v && /* @__PURE__ */ s.jsx(N, { dataset: v })
780
+ N === "bottom" && v && /* @__PURE__ */ s.jsx(I, { dataset: v })
774
781
  ]
775
782
  }
776
783
  );
777
784
  }
778
785
  }
779
- function Kt({
786
+ function Ht({
780
787
  datasetKey: r,
781
788
  filters: i,
782
- onFiltersChange: a,
783
- defaultTaxonKey: e,
789
+ onFiltersChange: e,
790
+ defaultTaxonKey: a,
784
791
  citation: l,
785
792
  auth: o,
786
793
  ...n
787
794
  }) {
788
- return ht(o), /* @__PURE__ */ s.jsx(dt.Provider, { value: pt(n), children: /* @__PURE__ */ s.jsx(
789
- Gt,
795
+ return dt(o), /* @__PURE__ */ s.jsx(pt.Provider, { value: mt(n), children: /* @__PURE__ */ s.jsx(
796
+ zt,
790
797
  {
791
798
  datasetKey: r,
792
799
  filters: i,
793
- onFiltersChange: a,
794
- defaultTaxonKey: e,
800
+ onFiltersChange: e,
801
+ defaultTaxonKey: a,
795
802
  citation: l
796
803
  }
797
804
  ) });
798
805
  }
799
- const ie = ct(ut(Kt));
806
+ const ce = ht(ct(Ht));
800
807
  export {
801
- ie as Search
808
+ ce as Search
802
809
  };
803
810
  //# sourceMappingURL=search.js.map