col-browser 2.3.10 → 2.5.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/README.md +54 -2
- package/es/bibtex.js +2 -2
- package/es/chunks/{BibTex-CPaVr-5w.js → BibTex-CyUpSmpY.js} +2 -2
- package/es/chunks/{BibTex-CPaVr-5w.js.map → BibTex-CyUpSmpY.js.map} +1 -1
- package/es/chunks/{DatasetCitation-JpNSTWz-.js → DatasetCitation-BnOkKDTv.js} +2 -2
- package/es/chunks/{DatasetCitation-JpNSTWz-.js.map → DatasetCitation-BnOkKDTv.js.map} +1 -1
- package/es/chunks/{DatasetlogoWithFallback-BhWvpgDn.js → DatasetlogoWithFallback-DJEkjMJ1.js} +2 -2
- package/es/chunks/{DatasetlogoWithFallback-BhWvpgDn.js.map → DatasetlogoWithFallback-DJEkjMJ1.js.map} +1 -1
- package/es/chunks/Distributions-Dwjo7KhA.js +1173 -0
- package/es/chunks/Distributions-Dwjo7KhA.js.map +1 -0
- package/es/chunks/{MergedDataBadge-DK4XUXsL.js → MergedDataBadge-FvHUdT7B.js} +2 -2
- package/es/chunks/{MergedDataBadge-DK4XUXsL.js.map → MergedDataBadge-FvHUdT7B.js.map} +1 -1
- package/es/chunks/{TaxonBreakdown-BYRnP8bH.js → TaxonBreakdown-D9g3tYXL.js} +2 -2
- package/es/chunks/{TaxonBreakdown-BYRnP8bH.js.map → TaxonBreakdown-D9g3tYXL.js.map} +1 -1
- package/es/chunks/{XrGutter-CORP2r5Y.js → XrGutter-D3PMq-Dn.js} +2 -2
- package/es/chunks/{XrGutter-CORP2r5Y.js.map → XrGutter-D3PMq-Dn.js.map} +1 -1
- package/es/chunks/config-D4b3a4Yi.js +27 -0
- package/es/chunks/config-D4b3a4Yi.js.map +1 -0
- package/es/chunks/{dataset-BuF063rn.js → dataset-D_gmg2Zv.js} +2 -2
- package/es/chunks/{dataset-BuF063rn.js.map → dataset-D_gmg2Zv.js.map} +1 -1
- package/es/chunks/{enumeration-CC8SblcI.js → enumeration-B-nIqCor.js} +2 -2
- package/es/chunks/{enumeration-CC8SblcI.js.map → enumeration-B-nIqCor.js.map} +1 -1
- package/es/chunks/{sector-Behb-WCC.js → sector-CE-w32Gs.js} +2 -2
- package/es/chunks/{sector-Behb-WCC.js.map → sector-CE-w32Gs.js.map} +1 -1
- package/es/chunks/withTheme-Dh6PRuII.js +17 -0
- package/es/chunks/withTheme-Dh6PRuII.js.map +1 -0
- package/es/config.js +5 -0
- package/es/config.js.map +1 -0
- package/es/index.js +4 -2
- package/es/index.js.map +1 -1
- package/es/search.js +14 -13
- package/es/search.js.map +1 -1
- package/es/sourceDataset.js +7 -6
- package/es/sourceDataset.js.map +1 -1
- package/es/sourceDatasetList.js +16 -15
- package/es/sourceDatasetList.js.map +1 -1
- package/es/taxon.js +746 -741
- package/es/taxon.js.map +1 -1
- package/es/taxonBreakdown.js +23 -22
- package/es/taxonBreakdown.js.map +1 -1
- package/es/taxonDistribution.js +32 -29
- package/es/taxonDistribution.js.map +1 -1
- package/es/tree.js +8 -7
- package/es/tree.js.map +1 -1
- package/package.json +5 -1
- package/types/config.d.ts +1 -0
- package/types/index.d.ts +39 -0
- package/umd/col-browser.js +57 -30
- 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/Distributions-CKn1-Qze.js +0 -1169
- package/es/chunks/Distributions-CKn1-Qze.js.map +0 -1
- package/es/chunks/config-B2Z9BaEd.js +0 -30
- package/es/chunks/config-B2Z9BaEd.js.map +0 -1
package/README.md
CHANGED
|
@@ -181,6 +181,55 @@ The COL portal uses `mode: 'path'`. The GitHub Pages demo uses `mode: 'hash'` ag
|
|
|
181
181
|
|
|
182
182
|
For SPA frameworks where the adapter doesn't fit (a custom router, Redux state, no URL at all), every component also works as a plain controlled component — see [Bypassing the adapter](#bypassing-the-adapter-custom-router-redux-no-url-at-all).
|
|
183
183
|
|
|
184
|
+
### API endpoint (optional)
|
|
185
|
+
|
|
186
|
+
By default every component reads from the production ChecklistBank API (`https://api.checklistbank.org/`). To point them at the dev API — or a local backend — call `configure()` once before mounting:
|
|
187
|
+
|
|
188
|
+
```jsx
|
|
189
|
+
// ES module — from the barrel …
|
|
190
|
+
import { configure } from 'col-browser';
|
|
191
|
+
// … or from its own subpath, if you only import single components:
|
|
192
|
+
import { configure } from 'col-browser/config';
|
|
193
|
+
|
|
194
|
+
configure({ dataApi: 'https://api.dev.checklistbank.org/' });
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<!-- UMD -->
|
|
199
|
+
<script>
|
|
200
|
+
ColBrowser.configure({ dataApi: 'https://api.dev.checklistbank.org/' });
|
|
201
|
+
</script>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
| Key | Default | Used for |
|
|
205
|
+
|---|---|---|
|
|
206
|
+
| `dataApi` | `https://api.checklistbank.org/` | every ChecklistBank API request |
|
|
207
|
+
| `clbPortal` | `https://www.checklistbank.org` | outbound links to dataset / publisher pages |
|
|
208
|
+
| `gbifApi` | `https://api.gbif.org` | occurrence counts and distribution-map tiles |
|
|
209
|
+
| `gbifPortal` | `https://www.gbif.org` | the GBIF occurrence-search attribution link |
|
|
210
|
+
| `basemapStyle` | `https://basemaps.cartocdn.com/gl/positron-gl-style/style.json` | the MapLibre basemap under the distribution map |
|
|
211
|
+
|
|
212
|
+
`configure()` merges into the shared config, so keys you leave out keep their current value, and trailing slashes are normalised — pass the URL in either form. Components read the base URL as they render and as they fire each request, so call `configure()` before mounting; to switch endpoints at runtime, remount afterwards (the demo app does this with a React `key`).
|
|
213
|
+
|
|
214
|
+
#### Basemap
|
|
215
|
+
|
|
216
|
+
`basemapStyle` is the one key that is not a base URL, so it is stored verbatim — path, query string and API key survive untouched. It takes anything MapLibre accepts as `style`: a style URL with your provider's key baked in, or an inline style object.
|
|
217
|
+
|
|
218
|
+
```js
|
|
219
|
+
// your own CARTO account
|
|
220
|
+
configure({ basemapStyle: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json?api_key=YOUR_KEY' });
|
|
221
|
+
|
|
222
|
+
// or another provider entirely
|
|
223
|
+
configure({ basemapStyle: 'https://api.maptiler.com/maps/basic-v2/style.json?key=YOUR_KEY' });
|
|
224
|
+
|
|
225
|
+
// or a style you host yourself
|
|
226
|
+
configure({ basemapStyle: { version: 8, sources: { … }, layers: [ … ] } });
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
The default is CARTO's public Positron CDN, which needs no key — check CARTO's terms before relying on it for production traffic. Map attribution comes from the style document, so switching providers updates the credit in the map's attribution control automatically.
|
|
230
|
+
|
|
231
|
+
`Taxon` and `TaxonDistribution` also take a `basemapStyle` **prop**, which overrides this default for a single map. Unlike the config keys, the prop is live: changing it rebuilds the map on the new style in place, no remount needed. If you pass an inline style *object* as the prop, hold it in a stable reference (a module constant or `useMemo`) rather than an object literal.
|
|
232
|
+
|
|
184
233
|
### Theming (optional)
|
|
185
234
|
|
|
186
235
|
Every top-level component accepts two optional theming props. When neither is set, the library's defaults are used and no Ant Design `ConfigProvider` is mounted.
|
|
@@ -320,13 +369,15 @@ ColBrowser.ReactDOM.createRoot(document.querySelector('#search')).render(
|
|
|
320
369
|
2. `taxonKey` - (controlled) the taxon to render. Read by the host from its URL and passed in.
|
|
321
370
|
3. `pageTitleTemplate` - (Optional) a template for formatting the page title. A string containing the variable `__taxon__` that will be replaced with the taxon name.
|
|
322
371
|
4. `identifierLabel` - (Optional) label for the identifier listed on top of the taxon view. Defaults to `"Identifier"`.
|
|
323
|
-
5. `showDistributionMap` - (Optional) When `true`, render an interactive MapLibre GL map
|
|
372
|
+
5. `showDistributionMap` - (Optional) When `true`, render an interactive MapLibre GL map for distributions whose areas have a known geometry, with a toggle to switch to the plain text list view. The basemap defaults to the keyless CARTO Positron vector style; override it with the `basemapStyle` prop below or globally via [`configure()`](#api-endpoint-optional). **Requires the consumer to load MapLibre GL JS 4+ or 5+ and its CSS** (peer dependency).
|
|
324
373
|
6. `gbifChecklistKey` - (Optional) When set, the distribution map adds a GBIF occurrence overlay (iNaturalist.poly hex bins) for the focal taxon, using the GBIF v2 multitaxonomy tile endpoint. The value is passed as the `checklistKey` query parameter; the focal taxon's id is passed as `taxonKey`. **The consumer is responsible for only setting this when the configured `datasetKey` actually uses identifiers that GBIF recognises under the given checklist.** For datasets keyed by COL identifiers, use the Catalogue of Life backbone UUID:
|
|
325
374
|
|
|
326
375
|
```
|
|
327
376
|
gbifChecklistKey="7ddf754f-d193-4cc9-b351-99906754a03b"
|
|
328
377
|
```
|
|
329
378
|
|
|
379
|
+
7. `basemapStyle` - (Optional) MapLibre style for the basemap under the distribution polygons — a style URL with your provider's API key baked in, or an inline style object. Overrides the global [`configure({ basemapStyle })`](#basemap) default for this map only, and can be changed at runtime: the map rebuilds on the new style in place. Pass an inline style object from a stable reference, not an object literal.
|
|
380
|
+
|
|
330
381
|
To use the map, include MapLibre GL JS alongside React in your page:
|
|
331
382
|
|
|
332
383
|
```html
|
|
@@ -435,7 +486,8 @@ The Taxon page's distribution block — a MapLibre GL vector map of the taxon's
|
|
|
435
486
|
1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
|
|
436
487
|
2. `taxonId` - (controlled) the taxon to render. The component loads the taxon, its distributions, and the rank vocabulary itself.
|
|
437
488
|
3. `gbifChecklistKey` - (Optional) when set, adds the GBIF occurrence overlay (iNaturalist.poly hex bins) for the focal taxon. See the same prop on `ColBrowser.Taxon` for the caveat about checklist-key alignment.
|
|
438
|
-
4. `style` - (Optional) inline style passed through to the outer wrapper.
|
|
489
|
+
4. `style` - (Optional) inline style passed through to the outer wrapper. Note this is the wrapper's CSS, not the map style — see `basemapStyle` below.
|
|
490
|
+
5. `basemapStyle` - (Optional) MapLibre style for the basemap under the distribution polygons — a style URL with your provider's API key baked in, or an inline style object. Overrides the global [`configure({ basemapStyle })`](#basemap) default for this map only, and can be changed at runtime: the map rebuilds on the new style in place. Pass an inline style object from a stable reference, not an object literal.
|
|
439
491
|
|
|
440
492
|
**Requires the consumer to load MapLibre GL JS 4+ or 5+ and its CSS** (peer dependency), same as `ColBrowser.Taxon` with `showDistributionMap`:
|
|
441
493
|
|
package/es/bibtex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w as i } from "./chunks/withDatasetKey-BgMY05XE.js";
|
|
2
|
-
import { w as m } from "./chunks/
|
|
3
|
-
import { B as o } from "./chunks/BibTex-
|
|
2
|
+
import { w as m } from "./chunks/withTheme-Dh6PRuII.js";
|
|
3
|
+
import { B as o } from "./chunks/BibTex-CyUpSmpY.js";
|
|
4
4
|
const a = m(i(o));
|
|
5
5
|
export {
|
|
6
6
|
a as BibTex
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { c as o } from "./config-
|
|
3
|
+
import { c as o } from "./config-D4b3a4Yi.js";
|
|
4
4
|
const b = ({ datasetKey: t, sourceDatasetKey: i, style: r = {} }) => {
|
|
5
5
|
const a = {
|
|
6
6
|
height: "40px"
|
|
@@ -10,4 +10,4 @@ const b = ({ datasetKey: t, sourceDatasetKey: i, style: r = {} }) => {
|
|
|
10
10
|
export {
|
|
11
11
|
b as B
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=BibTex-
|
|
13
|
+
//# sourceMappingURL=BibTex-CyUpSmpY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BibTex-
|
|
1
|
+
{"version":3,"file":"BibTex-CyUpSmpY.js","sources":["../../src/components/BibTex.js"],"sourcesContent":["import React from \"react\";\nimport config from \"../config\";\n\nconst BibTex = ({ datasetKey, sourceDatasetKey, style = {} }) => {\nconst defaultStyle = {\n height: \"40px\"\n}\nconst url = sourceDatasetKey ? `${config.dataApi}dataset/${datasetKey}/source/${sourceDatasetKey}.bib` : `${config.dataApi}dataset/${datasetKey}.bib`\n\n return (\n <a href={url} >\n <img src=\"https://www.checklistbank.org/images/bibtex_logo.png\" style={{...defaultStyle, ...style}} />\n </a>\n );\n};\n\nexport default BibTex;\n"],"names":["BibTex","datasetKey","sourceDatasetKey","style","defaultStyle","url","config","jsx"],"mappings":";;;AAGA,MAAMA,IAAS,CAAC,EAAE,YAAAC,GAAY,kBAAAC,GAAkB,OAAAC,IAAQ,CAAA,QAAS;AACjE,QAAMC,IAAe;AAAA,IACjB,QAAQ;AAAA,EAAA,GAENC,IAAMH,IAAmB,GAAGI,EAAO,OAAO,WAAWL,CAAU,WAAWC,CAAgB,SAAS,GAAGI,EAAO,OAAO,WAAWL,CAAU;AAE7I,SACEM,gBAAAA,EAAAA,IAAC,KAAA,EAAE,MAAMF,GACP,gCAAC,OAAA,EAAI,KAAI,wDAAuD,OAAO,EAAC,GAAGD,GAAc,GAAGD,EAAA,GAAQ,GACtG;AAEJ;"}
|
|
@@ -4,7 +4,7 @@ var o = (s, n, t) => g(s, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { j as l } from "./jsx-runtime-BzflLqGi.js";
|
|
5
5
|
import f from "react";
|
|
6
6
|
import { c as u } from "./router-CssZk5qZ.js";
|
|
7
|
-
import { c as p } from "./config-
|
|
7
|
+
import { c as p } from "./config-D4b3a4Yi.js";
|
|
8
8
|
import { Select as x } from "antd";
|
|
9
9
|
import { debounce as S, get as i } from "lodash-es";
|
|
10
10
|
import $ from "react-highlight-words";
|
|
@@ -116,4 +116,4 @@ export {
|
|
|
116
116
|
R as C,
|
|
117
117
|
M as N
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=DatasetCitation-
|
|
119
|
+
//# sourceMappingURL=DatasetCitation-BnOkKDTv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetCitation-
|
|
1
|
+
{"version":3,"file":"DatasetCitation-BnOkKDTv.js","sources":["../../src/ColTree/NameAutocomplete.js","../../src/components/DatasetCitation.js"],"sourcesContent":["import React from \"react\";\nimport client from \"../api/client\";\nimport config from \"../config\";\nimport { AutoComplete, Input , Select} from \"antd\";\nimport { debounce, get } from \"lodash-es\";\nimport Highlighter from \"react-highlight-words\";\n\n\nclass NameSearchAutocomplete extends React.Component {\n constructor(props) {\n super(props);\n\n this.getNames = debounce(this.getNames, 500);\n this.state = {\n options: [],\n value: \"\",\n randomID: (Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)\n };\n }\n\n componentDidMount = () => {\n const { defaultTaxonKey } = this.props;\n if (defaultTaxonKey) {\n this.setDefaultValue(defaultTaxonKey);\n }\n };\n\n componentDidUpdate = (prevProps) => {\n const { defaultTaxonKey } = this.props;\n if (defaultTaxonKey !== prevProps.defaultTaxonKey) {\n if (defaultTaxonKey) {\n this.setDefaultValue(defaultTaxonKey);\n } else {\n this.setState({ value: \"\", options: [] });\n }\n }\n };\n\n componentWillUnmount() {\n this.getNames.cancel();\n }\n\n setDefaultValue = (usageId) => {\n const { datasetKey } = this.props;\n client(\n `${config.dataApi}dataset/${datasetKey}/nameusage/search?USAGE_ID=${usageId}`\n ).then((res) => {\n this.setState({ value: get(res, \"data.result[0].usage.label\") || \"\" });\n });\n };\n getNames = (q) => {\n const { datasetKey, minRank, extinct /* hideExtinct */ } = this.props;\n const {value} = this.state;\n const url = datasetKey\n ? `${config.dataApi}dataset/${datasetKey}/nameusage/suggest`\n : `${config.dataApi}name/search`;\n\n client(\n `${url}?limit=25&q=${q}${\n minRank ? `&minRank=${minRank}` : \"\"\n }${extinct ? `&extinct=${extinct}`:''}`\n )\n .then((res) => {\n this.setState({\n // names: res.data || [],\n options: this.getOptions(res.data || [], value)\n });\n })\n .catch((err) => {\n this.setState({ options: [], err });\n });\n };\n onSelectName = (val, obj) => {\n const selectedTaxon = get(obj, \"data.acceptedUsageId\")\n ? {\n key: get(obj, \"data.acceptedUsageId\"),\n rank: get(obj, \"data.rank\"),\n title: get(obj, \"data.parentOrAcceptedName\"),\n }\n : { key: get(obj, \"data.usageId\"), rank: get(obj, \"data.rank\"), title: get(obj, \"data.name\") };\n this.setState({ value: val });\n this.props.onSelectName(selectedTaxon);\n };\n onReset = () => {\n this.setState({ value: \"\", options: [] }, this.props.onResetSearch);\n };\n\n getOptions = (names, searchTerm) => {\n return names.map((o) => {\n return {\n key: o.usageId,\n value: o.usageId, //o.suggestion,\n label: (\n <Highlighter\n highlightStyle={{ fontWeight: \"bold\", padding: 0 }}\n searchWords={searchTerm ? searchTerm.split(\" \") : []}\n autoEscape\n textToHighlight={o.suggestion}\n />\n ),\n data: o,\n };\n });\n }\n render = () => {\n const { placeHolder, autoFocus, disabled } = this.props;\n const { value , options, randomID} = this.state;\n //const randomID = (Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1);\n\n // const options = this.getOptions(this.state.names, value)\n\n return (\n <div id={`taxon_autocomplete_${randomID}`} className=\"taxon-autocomplete\">\n <Select\n value={value || undefined}\n defaultActiveFirstOption={false}\n suffixIcon={null}\n showSearch\n allowClear\n notFoundContent={null}\n\n style={this.props.style ? this.props.style : { width: \"100%\" }}\n options={options}\n filterOption={false}\n onSelect={this.onSelectName}\n onClear={this.onReset}\n onSearch={(q) => (!!q ? this.getNames(q) : this.onReset())}\n placeholder={placeHolder || \"Find taxon\"}\n autoFocus={autoFocus === false ? false : true}\n disabled={disabled}\n getPopupContainer={() => {\n console.log(`Test ${randomID}`)\n return document.getElementById(`taxon_autocomplete_${randomID}`)\n }\n \n }\n \n >\n \n </Select>\n {/* <AutoComplete\n style={this.props.style ? this.props.style : { width: \"100%\" }}\n options={options}\n onSelect={this.onSelectName}\n onSearch={(q) => (!!q ? this.getNames(q) : this.onReset())}\n placeholder={placeHolder || \"Find taxon\"}\n onChange={(value) => {\n if(value){\n this.setState({ value })\n } else {\n setTimeout(this.onReset, 50); \n }\n }}\n value={value}\n autoFocus={autoFocus === false ? false : true}\n disabled={disabled}\n getPopupContainer={() => {\n console.log(`Test ${randomID}`)\n return document.getElementById(`taxon_autocomplete_${randomID}`)\n }\n \n }\n \n >\n <Input.Search allowClear />\n </AutoComplete> */}\n \n </div> \n );\n };\n}\n\nexport default NameSearchAutocomplete;\n","import React from 'react';\n\n\nconst Citation = ({ dataset }) => {\n\n return (\n <div className=\"col-dataset-citation\">\n <div className=\"col-dataset-citation-title\">{dataset.citation ? <span dangerouslySetInnerHTML={{__html: dataset.citation}}></span> : dataset.title}</div>\n <div className=\"col-dataset-citation-source\"> - accessed through <a href={`https://www.checklistbank.org/dataset/${dataset.key}`}>ChecklistBank</a></div>\n </div>\n );\n};\n\n\nexport default Citation;"],"names":["NameSearchAutocomplete","React","props","__publicField","defaultTaxonKey","prevProps","usageId","datasetKey","client","config","res","get","q","minRank","extinct","value","url","err","val","obj","selectedTaxon","names","searchTerm","o","jsx","Highlighter","placeHolder","autoFocus","disabled","options","randomID","Select","debounce","Citation","dataset","jsxs"],"mappings":";;;;;;;;;;AAQA,MAAMA,UAA+BC,EAAM,UAAU;AAAA,EACnD,YAAYC,GAAO;AACjB,UAAMA,CAAK;AAUb,IAAAC,EAAA,2BAAoB,MAAM;AACxB,YAAM,EAAE,iBAAAC,MAAoB,KAAK;AACjC,MAAIA,KACF,KAAK,gBAAgBA,CAAe;AAAA,IAExC;AAEA,IAAAD,EAAA,4BAAqB,CAACE,MAAc;AAClC,YAAM,EAAE,iBAAAD,MAAoB,KAAK;AACjC,MAAIA,MAAoBC,EAAU,oBAC5BD,IACF,KAAK,gBAAgBA,CAAe,IAEpC,KAAK,SAAS,EAAE,OAAO,IAAI,SAAS,CAAA,GAAI;AAAA,IAG9C;AAMA,IAAAD,EAAA,yBAAkB,CAACG,MAAY;AAC7B,YAAM,EAAE,YAAAC,MAAe,KAAK;AAC5B,MAAAC;AAAA,QACE,GAAGC,EAAO,OAAO,WAAWF,CAAU,8BAA8BD,CAAO;AAAA,MAAA,EAC3E,KAAK,CAACI,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AS,eAAe,sBAAsBA,CAAQ,EAAE;AAAA,QACjE;AAAA,MAAA,GAkCF;AAAA,IAEJ;AA7JE,SAAK,WAAWE,EAAS,KAAK,UAAU,GAAG,GAC3C,KAAK,QAAQ;AAAA,MACX,SAAS,CAAA;AAAA,MACT,OAAO;AAAA,MACP,WAAW,KAAK,MAAM,KAAK,WAAW,GAAG,IAAG,MAAI,KAAK,MAAM,KAAK,OAAA,IAAW,GAAG,IAAG,MAAI,KAAK,MAAM,KAAK,OAAA,IAAW,GAAG,IAAG;AAAA,IAAA;AAAA,EAE1H;AAAA,EAoBA,uBAAuB;AACrB,SAAK,SAAS,OAAA;AAAA,EAChB;AAkIF;ACvKA,MAAMC,IAAW,CAAC,EAAE,SAAAC,QAGhBC,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,wBACb,UAAA;AAAA,EAAAX,gBAAAA,MAAC,OAAA,EAAI,WAAU,8BAA8B,UAAAU,EAAQ,WAAWV,gBAAAA,MAAC,QAAA,EAAK,yBAAyB,EAAC,QAAQU,EAAQ,SAAA,EAAQ,CAAG,IAAUA,EAAQ,OAAM;AAAA,EACnJC,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,+BAA8B,UAAA;AAAA,IAAA;AAAA,0BAAqB,KAAA,EAAE,MAAM,yCAAyCD,EAAQ,GAAG,IAAI,UAAA,gBAAA,CAAa;AAAA,EAAA,EAAA,CAAI;AAAA,GACrJ;"}
|
package/es/chunks/{DatasetlogoWithFallback-BhWvpgDn.js → DatasetlogoWithFallback-DJEkjMJ1.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import n from "react";
|
|
3
|
-
import { c } from "./config-
|
|
3
|
+
import { c } from "./config-D4b3a4Yi.js";
|
|
4
4
|
class m extends n.Component {
|
|
5
5
|
constructor(t) {
|
|
6
6
|
super(t), this.state = { error: !0, loading: !0 };
|
|
@@ -21,4 +21,4 @@ class m extends n.Component {
|
|
|
21
21
|
export {
|
|
22
22
|
m as D
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=DatasetlogoWithFallback-
|
|
24
|
+
//# sourceMappingURL=DatasetlogoWithFallback-DJEkjMJ1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetlogoWithFallback-
|
|
1
|
+
{"version":3,"file":"DatasetlogoWithFallback-DJEkjMJ1.js","sources":["../../src/components/DatasetlogoWithFallback.js"],"sourcesContent":["import React from \"react\";\nimport config from \"../config\";\n\nclass DatasetlogoWithFallback extends React.Component {\n constructor(props) {\n super(props);\n this.state = { error: true, loading: true };\n }\n render() {\n\n const {fallBack = null, datasetKey, sourceDatasetKey, style, size = 'MEDIUM'} = this.props;\n const {error, loading} = this.state;\n return (loading || !error) ?\n <img\n style={style}\n src={`${config.dataApi}dataset/${datasetKey}/logo/source/${sourceDatasetKey}?size=${size}`}\n onLoad={() => this.setState({error: false, loading: false})}\n onError={() => this.setState({error: true, loading: false})}\n /> : fallBack;\n \n ;\n }\n}\nexport default DatasetlogoWithFallback;"],"names":["DatasetlogoWithFallback","React","props","fallBack","datasetKey","sourceDatasetKey","style","size","error","loading","jsx","config"],"mappings":";;;AAGA,MAAMA,UAAgCC,EAAM,UAAU;AAAA,EACpD,YAAYC,GAAO;AACjB,UAAMA,CAAK,GACX,KAAK,QAAQ,EAAE,OAAO,IAAM,SAAS,GAAA;AAAA,EACvC;AAAA,EACA,SAAS;AAEL,UAAM,EAAC,UAAAC,IAAW,MAAM,YAAAC,GAAY,kBAAAC,GAAkB,OAAAC,GAAO,MAAAC,IAAO,aAAY,KAAK,OAC/E,EAAC,OAAAC,GAAO,SAAAC,EAAA,IAAW,KAAK;AAChC,WAAQA,KAAW,CAACD,IAChBE,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAAJ;AAAA,QACA,KAAK,GAAGK,EAAO,OAAO,WAAWP,CAAU,gBAAgBC,CAAgB,SAASE,CAAI;AAAA,QACxF,QAAQ,MAAM,KAAK,SAAS,EAAC,OAAO,IAAO,SAAS,IAAM;AAAA,QAC1D,SAAS,MAAM,KAAK,SAAS,EAAC,OAAO,IAAM,SAAS,GAAA,CAAM;AAAA,MAAA;AAAA,IAAA,IACvDJ;AAAA,EAGX;AACF;"}
|