synapse-react-client 4.0.22 → 4.0.24
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/dist/SWC.index.js +1 -1
- package/dist/assets/icons/GeneticsIcon.d.ts +3 -0
- package/dist/assets/icons/GeneticsIcon.d.ts.map +1 -0
- package/dist/assets/icons/GeneticsIcon.js +14 -0
- package/dist/assets/icons/GeneticsIcon.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +49 -32
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts +18 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +112 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts +31 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js +198 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -0
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +4 -8
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +6 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +168 -153
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +19 -18
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/Plot/SynapsePlot.d.ts +4 -0
- package/dist/components/Plot/SynapsePlot.d.ts.map +1 -1
- package/dist/components/Plot/SynapsePlot.js +57 -44
- package/dist/components/Plot/SynapsePlot.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts +21 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts +10 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +65 -59
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +2 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +77 -34
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +33 -6
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +93 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts +3 -0
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +39 -37
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts +3 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +5 -0
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +7 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +87 -51
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +0 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +1 -0
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +31 -22
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js +34 -20
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js.map +1 -1
- package/dist/components/favorites/FavoriteButton.d.ts +1 -0
- package/dist/components/favorites/FavoriteButton.d.ts.map +1 -1
- package/dist/components/favorites/FavoriteButton.js +8 -8
- package/dist/components/favorites/FavoriteButton.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts +8 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +50 -20
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts +1 -0
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +24 -24
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +59 -49
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts +25 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts.map +1 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js +40 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js.map +1 -0
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.js +8 -2
- package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts +10 -5
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js +10 -17
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +11 -10
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +70 -54
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +17 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +2 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +7 -7
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.js +99 -45
- package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +174 -149
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.d.ts +6 -0
- package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.js +19 -2
- package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
- package/dist/style/components/_total-query-results.scss +10 -34
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +11 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/SWC.index.js
CHANGED
|
@@ -113,7 +113,7 @@ var x = { BackendDestinationEnum: r }, S = {
|
|
|
113
113
|
sendSearchResultsReturnedEvent: y,
|
|
114
114
|
sendSearchResultReturnedEvent: v,
|
|
115
115
|
sendSearchResultClickedEvent: _
|
|
116
|
-
}, T = "4.0.
|
|
116
|
+
}, T = "4.0.24";
|
|
117
117
|
//#endregion
|
|
118
118
|
export { w as Analytics, a as HttpClient, d as Palettes, o as SynapseClient, C as SynapseComponents, n as SynapseConstants, S as SynapseContext, x as SynapseEnums, m as SynapseQueries, T as SynapseReactClientVersion, p as SynapseSessionManager, i as xssOptions };
|
|
119
119
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneticsIcon.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/GeneticsIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAM1D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,YAAY,2CAMvD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvgIcon as e } from "@mui/material";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/assets/icons/GeneticsIcon.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
...n,
|
|
8
|
+
children: /* @__PURE__ */ t("path", { d: "M5 23v-1q0-3.475 1.45-5.637t4-4.363q-2.55-2.2-4-4.362T5 2V1h2v1q0 .275.013.513T7.05 3h9.9q.025-.25.038-.488T17 2V1h2v1q0 3.475-1.45 5.638t-4 4.362q2.55 2.2 4 4.363T19 22v1h-2v-1q0-.275-.012-.513T16.95 21h-9.9q-.025.25-.037.488T7 22v1zM8.45 7h7.1q.325-.475.563-.95T16.55 5h-9.1q.2.55.437 1.038T8.45 7M12 10.7q.5-.425.975-.85t.9-.85h-3.75q.425.425.9.85t.975.85M10.125 15h3.75q-.425-.425-.9-.85T12 13.3q-.5.425-.975.85t-.9.85M7.45 19h9.1q-.2-.55-.437-1.037T15.55 17h-7.1q-.325.475-.562.95T7.45 19" })
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=GeneticsIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneticsIcon.js","names":[],"sources":["../../../src/assets/icons/GeneticsIcon.tsx"],"sourcesContent":["import { SvgIcon, type SvgIconProps } from '@mui/material'\n\n// `@mui/icons-material` (the classic Material Icons set) has no DNA/helix glyph,\n// so the DUO genetic-studies term uses Google's Material Symbols \"genetics\" icon,\n// inlined as an MUI SvgIcon so it inherits sizing and color like the rest.\n// (Material Symbols, Apache-2.0.)\nexport default function GeneticsIcon(props: SvgIconProps) {\n return (\n <SvgIcon viewBox=\"0 0 24 24\" {...props}>\n <path d=\"M5 23v-1q0-3.475 1.45-5.637t4-4.363q-2.55-2.2-4-4.362T5 2V1h2v1q0 .275.013.513T7.05 3h9.9q.025-.25.038-.488T17 2V1h2v1q0 3.475-1.45 5.638t-4 4.362q2.55 2.2 4 4.363T19 22v1h-2v-1q0-.275-.012-.513T16.95 21h-9.9q-.025.25-.037.488T7 22v1zM8.45 7h7.1q.325-.475.563-.95T16.55 5h-9.1q.2.55.437 1.038T8.45 7M12 10.7q.5-.425.975-.85t.9-.85h-3.75q.425.425.9.85t.975.85M10.125 15h3.75q-.425-.425-.9-.85T12 13.3q-.5.425-.975.85t-.9.85M7.45 19h9.1q-.2-.55-.437-1.037T15.55 17h-7.1q-.325.475-.562.95T7.45 19\" />\n </SvgIcon>\n )\n}\n"],"mappings":";;;AAMA,SAAwB,EAAa,GAAqB;CACxD,OACE,kBAAC,GAAD;EAAS,SAAQ;EAAY,GAAI;YAC/B,kBAAC,QAAD,EAAM,GAAE,gfAAif,CAAA;CAClf,CAAA;AAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCitation.d.ts","sourceRoot":"","sources":["../../../src/components/EntityCitation/EntityCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"EntityCitation.d.ts","sourceRoot":"","sources":["../../../src/components/EntityCitation/EntityCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,QAAA,MAAM,cAAc,GAAI,yCAIrB,mBAAmB,KAAG,KAAK,CAAC,SA2J9B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -10,65 +10,82 @@ import { Button as c, Skeleton as l } from "@mui/material";
|
|
|
10
10
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
11
|
import { DoiObjectType as p } from "@sage-bionetworks/synapse-client";
|
|
12
12
|
//#region src/components/EntityCitation/EntityCitation.tsx
|
|
13
|
-
var m = ({ projectId:
|
|
14
|
-
let { data:
|
|
15
|
-
id:
|
|
13
|
+
var m = "10px 12px", h = ({ projectId: h, entityId: g, versionNumber: _ }) => {
|
|
14
|
+
let { data: v, isLoading: y } = e(g, _), [b, x] = s(null), [S, C] = s(void 0), [w, T] = s(null), [E, D] = s(void 0), O = o(null), k = b ? "cite-as-popover" : void 0, A = a(g, _, h, v), { data: j, isLoading: M } = t({
|
|
15
|
+
id: h,
|
|
16
16
|
version: void 0,
|
|
17
17
|
type: p.ENTITY
|
|
18
|
-
}, { enabled: !!
|
|
19
|
-
function
|
|
20
|
-
return
|
|
18
|
+
}, { enabled: !!h }), N = j && A;
|
|
19
|
+
function P() {
|
|
20
|
+
return N ? "Cite as..." : A && !j ? "Cite page" : !A && j ? "Cite project" : "";
|
|
21
21
|
}
|
|
22
|
-
let
|
|
23
|
-
return !
|
|
22
|
+
let F = P();
|
|
23
|
+
return !j && !A ? null : y || M ? /* @__PURE__ */ d(l, { sx: {
|
|
24
24
|
width: {
|
|
25
25
|
xs: "100%",
|
|
26
26
|
sm: "140px"
|
|
27
27
|
},
|
|
28
28
|
height: "45px"
|
|
29
|
-
} }) : /* @__PURE__ */ f(u, { children: [
|
|
30
|
-
disabled:
|
|
29
|
+
} }) : /* @__PURE__ */ f(u, { children: [N ? /* @__PURE__ */ d(i, {
|
|
30
|
+
disabled: y && M,
|
|
31
31
|
options: ["Cite this Project", "Cite only this page"],
|
|
32
|
-
anchorRef:
|
|
33
|
-
sx: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
anchorRef: O,
|
|
33
|
+
sx: {
|
|
34
|
+
width: {
|
|
35
|
+
xs: "100%",
|
|
36
|
+
sm: "initial"
|
|
37
|
+
},
|
|
38
|
+
"& .MuiButtonGroup-firstButton": {
|
|
39
|
+
borderTopLeftRadius: "6px",
|
|
40
|
+
borderBottomLeftRadius: "6px",
|
|
41
|
+
padding: m
|
|
42
|
+
},
|
|
43
|
+
"& .MuiButtonGroup-lastButton": {
|
|
44
|
+
borderTopRightRadius: "6px",
|
|
45
|
+
borderBottomRightRadius: "6px"
|
|
46
|
+
},
|
|
47
|
+
"& .MuiButton-root": { fontWeight: 540 }
|
|
48
|
+
},
|
|
37
49
|
buttonText: "Cite as...",
|
|
38
50
|
variant: "outlined",
|
|
39
51
|
buttonGroupAriaLabel: "Citation options",
|
|
40
|
-
selectedIndex:
|
|
52
|
+
selectedIndex: E,
|
|
41
53
|
setSelectedIndex: (e) => {
|
|
42
|
-
|
|
43
|
-
let t = e === 0 ?
|
|
44
|
-
t && (
|
|
54
|
+
D(e);
|
|
55
|
+
let t = e === 0 ? j?.doiUri : A?.doiUri;
|
|
56
|
+
t && (C(t), T(O.current));
|
|
45
57
|
}
|
|
46
58
|
}) : /* @__PURE__ */ d(c, {
|
|
47
59
|
onClick: (e) => {
|
|
48
|
-
|
|
60
|
+
A && !j ? (C(A.doiUri), T(e.currentTarget)) : !A && j ? (C(j.doiUri), T(e.currentTarget)) : x(e.currentTarget);
|
|
61
|
+
},
|
|
62
|
+
disabled: y && M,
|
|
63
|
+
sx: {
|
|
64
|
+
width: {
|
|
65
|
+
xs: "100%",
|
|
66
|
+
sm: "initial"
|
|
67
|
+
},
|
|
68
|
+
borderRadius: "6px",
|
|
69
|
+
fontWeight: 540,
|
|
70
|
+
padding: m
|
|
49
71
|
},
|
|
50
|
-
disabled: v && j,
|
|
51
|
-
sx: { width: {
|
|
52
|
-
xs: "100%",
|
|
53
|
-
sm: "initial"
|
|
54
|
-
} },
|
|
55
72
|
variant: "outlined",
|
|
56
73
|
startIcon: /* @__PURE__ */ d(n, {
|
|
57
74
|
width: 18,
|
|
58
75
|
height: 18
|
|
59
76
|
}),
|
|
60
|
-
children:
|
|
77
|
+
children: F
|
|
61
78
|
}), /* @__PURE__ */ d(r, {
|
|
62
|
-
doi:
|
|
63
|
-
anchorEl:
|
|
64
|
-
open: !!
|
|
65
|
-
id:
|
|
79
|
+
doi: S,
|
|
80
|
+
anchorEl: w,
|
|
81
|
+
open: !!w && !!S,
|
|
82
|
+
id: k,
|
|
66
83
|
onClose: () => {
|
|
67
|
-
|
|
84
|
+
T(null), C(void 0);
|
|
68
85
|
}
|
|
69
86
|
})] });
|
|
70
87
|
};
|
|
71
88
|
//#endregion
|
|
72
|
-
export {
|
|
89
|
+
export { h as default };
|
|
73
90
|
|
|
74
91
|
//# sourceMappingURL=EntityCitation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCitation.js","names":[],"sources":["../../../src/components/EntityCitation/EntityCitation.tsx"],"sourcesContent":["import React from 'react'\nimport { ReactComponent as DoubleQuotes } from '@/assets/icons/DoubleQuotes.svg'\nimport { Button, Skeleton } from '@mui/material'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { useGetEntityBundle } from '@/synapse-queries/entity'\nimport { DoiObjectType } from '@sage-bionetworks/synapse-client'\nimport CitationPopoverContent from '../CitationPopover/CitationPopoverContent'\nimport { useRef, useState } from 'react'\nimport { useGetEntityDoiAssociation } from './EntityCitationUtils'\nimport DropdownSelect from '../DropdownSelect'\n\nexport type EntityCitationProps = {\n projectId: string\n entityId: string\n versionNumber?: number\n}\n\nconst EntityCitation = ({\n projectId,\n entityId,\n versionNumber,\n}: EntityCitationProps): React.ReactNode => {\n const { data: bundle, isLoading: isEntityLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)\n const [selectedDoi, setSelectedDoi] = useState<string | undefined>(undefined)\n const [citationAnchorEl, setCitationAnchorEl] = useState<HTMLElement | null>(\n null,\n )\n const [selectedIndex, setSelectedIndex] = useState<number | undefined>(\n undefined,\n )\n const citationButtonRef = useRef<HTMLDivElement>(null)\n\n const open = Boolean(anchorEl)\n const id = open ? 'cite-as-popover' : undefined\n\n const entityDoiAssociation = useGetEntityDoiAssociation(\n entityId,\n versionNumber,\n projectId,\n bundle,\n )\n\n // Get DOI association for the project\n // Projects are not versioned\n const { data: projectDoiAssociation, isLoading: isProjectLoading } =\n useGetDOIAssociation(\n {\n id: projectId,\n version: undefined,\n type: DoiObjectType.ENTITY,\n },\n {\n enabled: !!projectId,\n },\n )\n\n // If both project and entity have DOIs, we show the dropdown variant\n const isProjectAndEntityDoi = projectDoiAssociation && entityDoiAssociation\n\n function getButtonText() {\n if (isProjectAndEntityDoi) {\n return 'Cite as...'\n } else if (entityDoiAssociation && !projectDoiAssociation) {\n return 'Cite page'\n } else if (!entityDoiAssociation && projectDoiAssociation) {\n return 'Cite project'\n }\n return ''\n }\n\n const buttonText = getButtonText()\n\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (entityDoiAssociation && !projectDoiAssociation) {\n setSelectedDoi(entityDoiAssociation.doiUri)\n setCitationAnchorEl(event.currentTarget)\n } else if (!entityDoiAssociation && projectDoiAssociation) {\n setSelectedDoi(projectDoiAssociation.doiUri)\n setCitationAnchorEl(event.currentTarget)\n } else {\n // If both project and entity doi exist, show dropdown\n setAnchorEl(event.currentTarget)\n }\n }\n\n const popover = (\n <CitationPopoverContent\n doi={selectedDoi}\n anchorEl={citationAnchorEl}\n open={!!citationAnchorEl && !!selectedDoi}\n id={id}\n onClose={() => {\n setCitationAnchorEl(null)\n setSelectedDoi(undefined)\n }}\n />\n )\n\n const options: string[] = ['Cite this Project', 'Cite only this page']\n\n if (!projectDoiAssociation && !entityDoiAssociation) {\n return null\n }\n\n if (isEntityLoading || isProjectLoading) {\n return (\n <Skeleton\n sx={{\n width: { xs: '100%', sm: '140px' },\n height: '45px',\n }}\n />\n )\n }\n\n return (\n <>\n {isProjectAndEntityDoi ? (\n <DropdownSelect\n disabled={isEntityLoading && isProjectLoading}\n options={options}\n anchorRef={citationButtonRef}\n sx={{\n width: { xs: '100%', sm: 'initial' },\n }}\n buttonText=\"Cite as...\"\n variant=\"outlined\"\n buttonGroupAriaLabel=\"Citation options\"\n selectedIndex={selectedIndex}\n setSelectedIndex={(index: number) => {\n setSelectedIndex(index)\n const selected =\n index === 0\n ? projectDoiAssociation?.doiUri\n : entityDoiAssociation?.doiUri\n if (selected) {\n setSelectedDoi(selected)\n setCitationAnchorEl(citationButtonRef.current)\n }\n }}\n />\n ) : (\n <Button\n onClick={handleButtonClick}\n disabled={isEntityLoading && isProjectLoading}\n sx={{\n width: { xs: '100%', sm: 'initial' },\n }}\n variant=\"outlined\"\n startIcon={<DoubleQuotes width={18} height={18} />}\n >\n {buttonText}\n </Button>\n )}\n {popover}\n </>\n )\n}\n\nexport default EntityCitation\n"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityCitation.js","names":[],"sources":["../../../src/components/EntityCitation/EntityCitation.tsx"],"sourcesContent":["import React from 'react'\nimport { ReactComponent as DoubleQuotes } from '@/assets/icons/DoubleQuotes.svg'\nimport { Button, Skeleton } from '@mui/material'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { useGetEntityBundle } from '@/synapse-queries/entity'\nimport { DoiObjectType } from '@sage-bionetworks/synapse-client'\nimport CitationPopoverContent from '../CitationPopover/CitationPopoverContent'\nimport { useRef, useState } from 'react'\nimport { useGetEntityDoiAssociation } from './EntityCitationUtils'\nimport DropdownSelect from '../DropdownSelect'\n\nconst CITATION_BUTTON_PADDING = '10px 12px'\n\nexport type EntityCitationProps = {\n projectId: string\n entityId: string\n versionNumber?: number\n}\n\nconst EntityCitation = ({\n projectId,\n entityId,\n versionNumber,\n}: EntityCitationProps): React.ReactNode => {\n const { data: bundle, isLoading: isEntityLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)\n const [selectedDoi, setSelectedDoi] = useState<string | undefined>(undefined)\n const [citationAnchorEl, setCitationAnchorEl] = useState<HTMLElement | null>(\n null,\n )\n const [selectedIndex, setSelectedIndex] = useState<number | undefined>(\n undefined,\n )\n const citationButtonRef = useRef<HTMLDivElement>(null)\n\n const open = Boolean(anchorEl)\n const id = open ? 'cite-as-popover' : undefined\n\n const entityDoiAssociation = useGetEntityDoiAssociation(\n entityId,\n versionNumber,\n projectId,\n bundle,\n )\n\n // Get DOI association for the project\n // Projects are not versioned\n const { data: projectDoiAssociation, isLoading: isProjectLoading } =\n useGetDOIAssociation(\n {\n id: projectId,\n version: undefined,\n type: DoiObjectType.ENTITY,\n },\n {\n enabled: !!projectId,\n },\n )\n\n // If both project and entity have DOIs, we show the dropdown variant\n const isProjectAndEntityDoi = projectDoiAssociation && entityDoiAssociation\n\n function getButtonText() {\n if (isProjectAndEntityDoi) {\n return 'Cite as...'\n } else if (entityDoiAssociation && !projectDoiAssociation) {\n return 'Cite page'\n } else if (!entityDoiAssociation && projectDoiAssociation) {\n return 'Cite project'\n }\n return ''\n }\n\n const buttonText = getButtonText()\n\n const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (entityDoiAssociation && !projectDoiAssociation) {\n setSelectedDoi(entityDoiAssociation.doiUri)\n setCitationAnchorEl(event.currentTarget)\n } else if (!entityDoiAssociation && projectDoiAssociation) {\n setSelectedDoi(projectDoiAssociation.doiUri)\n setCitationAnchorEl(event.currentTarget)\n } else {\n // If both project and entity doi exist, show dropdown\n setAnchorEl(event.currentTarget)\n }\n }\n\n const popover = (\n <CitationPopoverContent\n doi={selectedDoi}\n anchorEl={citationAnchorEl}\n open={!!citationAnchorEl && !!selectedDoi}\n id={id}\n onClose={() => {\n setCitationAnchorEl(null)\n setSelectedDoi(undefined)\n }}\n />\n )\n\n const options: string[] = ['Cite this Project', 'Cite only this page']\n\n if (!projectDoiAssociation && !entityDoiAssociation) {\n return null\n }\n\n if (isEntityLoading || isProjectLoading) {\n return (\n <Skeleton\n sx={{\n width: { xs: '100%', sm: '140px' },\n height: '45px',\n }}\n />\n )\n }\n\n return (\n <>\n {isProjectAndEntityDoi ? (\n <DropdownSelect\n disabled={isEntityLoading && isProjectLoading}\n options={options}\n anchorRef={citationButtonRef}\n sx={{\n width: { xs: '100%', sm: 'initial' },\n '& .MuiButtonGroup-firstButton': {\n borderTopLeftRadius: '6px',\n borderBottomLeftRadius: '6px',\n padding: CITATION_BUTTON_PADDING,\n },\n '& .MuiButtonGroup-lastButton': {\n borderTopRightRadius: '6px',\n borderBottomRightRadius: '6px',\n },\n '& .MuiButton-root': {\n fontWeight: 540,\n },\n }}\n buttonText=\"Cite as...\"\n variant=\"outlined\"\n buttonGroupAriaLabel=\"Citation options\"\n selectedIndex={selectedIndex}\n setSelectedIndex={(index: number) => {\n setSelectedIndex(index)\n const selected =\n index === 0\n ? projectDoiAssociation?.doiUri\n : entityDoiAssociation?.doiUri\n if (selected) {\n setSelectedDoi(selected)\n setCitationAnchorEl(citationButtonRef.current)\n }\n }}\n />\n ) : (\n <Button\n onClick={handleButtonClick}\n disabled={isEntityLoading && isProjectLoading}\n sx={{\n width: { xs: '100%', sm: 'initial' },\n borderRadius: '6px',\n fontWeight: 540,\n padding: CITATION_BUTTON_PADDING,\n }}\n variant=\"outlined\"\n startIcon={<DoubleQuotes width={18} height={18} />}\n >\n {buttonText}\n </Button>\n )}\n {popover}\n </>\n )\n}\n\nexport default EntityCitation\n"],"mappings":";;;;;;;;;;;;AAWA,IAAM,IAA0B,aAQ1B,KAAkB,EACtB,cACA,aACA,uBAC0C;CAC1C,IAAM,EAAE,MAAM,GAAQ,WAAW,MAAoB,EACnD,GACA,CACF,GACM,CAAC,GAAU,KAAe,EAAmC,IAAI,GACjE,CAAC,GAAa,KAAkB,EAA6B,KAAA,CAAS,GACtE,CAAC,GAAkB,KAAuB,EAC9C,IACF,GACM,CAAC,GAAe,KAAoB,EACxC,KAAA,CACF,GACM,IAAoB,EAAuB,IAAI,GAG/C,IADe,IACH,oBAAoB,KAAA,GAEhC,IAAuB,EAC3B,GACA,GACA,GACA,CACF,GAIM,EAAE,MAAM,GAAuB,WAAW,MAC9C,EACE;EACE,IAAI;EACJ,SAAS,KAAA;EACT,MAAM,EAAc;CACtB,GACA,EACE,SAAS,CAAC,CAAC,EACb,CACF,GAGI,IAAwB,KAAyB;CAEvD,SAAS,IAAgB;EAQvB,OAPI,IACK,eACE,KAAwB,CAAC,IAC3B,cACE,CAAC,KAAwB,IAC3B,iBAEF;CACT;CAEA,IAAM,IAAa,EAAc;CA6CjC,OAfI,CAAC,KAAyB,CAAC,IACtB,OAGL,KAAmB,IAEnB,kBAAC,GAAD,EACE,IAAI;EACF,OAAO;GAAE,IAAI;GAAQ,IAAI;EAAQ;EACjC,QAAQ;CACV,EACD,CAAA,IAKH,kBAAA,GAAA,EAAA,UAAA,CACG,IACC,kBAAC,GAAD;EACE,UAAU,KAAmB;EACpB,UAtBU,qBAAqB,qBAsB/B;EACT,WAAW;EACX,IAAI;GACF,OAAO;IAAE,IAAI;IAAQ,IAAI;GAAU;GACnC,iCAAiC;IAC/B,qBAAqB;IACrB,wBAAwB;IACxB,SAAS;GACX;GACA,gCAAgC;IAC9B,sBAAsB;IACtB,yBAAyB;GAC3B;GACA,qBAAqB,EACnB,YAAY,IACd;EACF;EACA,YAAW;EACX,SAAQ;EACR,sBAAqB;EACN;EACf,mBAAmB,MAAkB;GACnC,EAAiB,CAAK;GACtB,IAAM,IACJ,MAAU,IACN,GAAuB,SACvB,GAAsB;GAC5B,AAAI,MACF,EAAe,CAAQ,GACvB,EAAoB,EAAkB,OAAO;EAEjD;CACD,CAAA,IAED,kBAAC,GAAD;EACE,UAnFmB,MAA+C;GACxE,AAAI,KAAwB,CAAC,KAC3B,EAAe,EAAqB,MAAM,GAC1C,EAAoB,EAAM,aAAa,KAC9B,CAAC,KAAwB,KAClC,EAAe,EAAsB,MAAM,GAC3C,EAAoB,EAAM,aAAa,KAGvC,EAAY,EAAM,aAAa;EAEnC;EAyEQ,UAAU,KAAmB;EAC7B,IAAI;GACF,OAAO;IAAE,IAAI;IAAQ,IAAI;GAAU;GACnC,cAAc;GACd,YAAY;GACZ,SAAS;EACX;EACA,SAAQ;EACR,WAAW,kBAAC,GAAD;GAAc,OAAO;GAAI,QAAQ;EAAK,CAAA;YAEhD;CACK,CAAA,GAET,gBAnFH,EAAC,GAAD;EACE,KAAK;EACL,UAAU;EACV,MAAM,CAAC,CAAC,KAAoB,CAAC,CAAC;EAC1B;EACJ,eAAe;GAEb,AADA,EAAoB,IAAI,GACxB,EAAe,KAAA,CAAS;EAC1B;CACD,CA0EE,CACD,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RenderedFacetValueChip } from '@/components/QueryVisualizationWrapper/QueryVisualizationContext';
|
|
2
|
+
export type DuoTermTagsProps = {
|
|
3
|
+
/** Raw `dataUseModifiers` values (ontology codes or term names). */
|
|
4
|
+
terms: string[];
|
|
5
|
+
};
|
|
6
|
+
/** Renders a dataset's DUO data-use modifiers as a row of chips (used on cards). */
|
|
7
|
+
export default function DuoTermTags(props: DuoTermTagsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Builds a `renderFacetValue` function (for `QueryVisualizationWrapper`) that
|
|
10
|
+
* returns the chip content for the given DUO column's enumeration facet values
|
|
11
|
+
* — used by both the facet sidebar and the active-filter pills, which render it
|
|
12
|
+
* through the shared `FacetValueChip`. Other columns fall through to text.
|
|
13
|
+
*
|
|
14
|
+
* Portals only need to declare the DUO column (via the card schema's
|
|
15
|
+
* `dataUseModifiersColumnName`) rather than each defining their own handler.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createDuoFacetValueRenderer(duoColumnName: string): (columnName: string, value: string) => RenderedFacetValueChip | undefined;
|
|
18
|
+
//# sourceMappingURL=DuoTermTags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuoTermTags.d.ts","sourceRoot":"","sources":["../../../../src/components/GenericCard/DuoTermTags/DuoTermTags.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAA;AAE9G,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oEAAoE;IACpE,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AA4ED,oFAAoF;AACpF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,kDA6B1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,IAE7D,YAAY,MAAM,EAClB,OAAO,MAAM,KACZ,sBAAsB,GAAG,SAAS,CAWtC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import e from "../../../assets/icons/GeneticsIcon.js";
|
|
2
|
+
import { duoRegistryUrl as t, resolveDuoTerm as n } from "./duoTerms.js";
|
|
3
|
+
import r from "../../widgets/facet-nav/FacetValueChip.js";
|
|
4
|
+
import { Box as i, Link as a } from "@mui/material";
|
|
5
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import l from "@mui/icons-material/ScienceOutlined";
|
|
7
|
+
import u from "@mui/icons-material/MedicalServicesOutlined";
|
|
8
|
+
import d from "@mui/icons-material/CoronavirusOutlined";
|
|
9
|
+
import f from "@mui/icons-material/GroupsOutlined";
|
|
10
|
+
import p from "@mui/icons-material/HealingOutlined";
|
|
11
|
+
import m from "@mui/icons-material/LockOpenOutlined";
|
|
12
|
+
import h from "@mui/icons-material/MoneyOffOutlined";
|
|
13
|
+
import g from "@mui/icons-material/ArticleOutlined";
|
|
14
|
+
import _ from "@mui/icons-material/HandshakeOutlined";
|
|
15
|
+
import v from "@mui/icons-material/GavelOutlined";
|
|
16
|
+
import y from "@mui/icons-material/ReplayOutlined";
|
|
17
|
+
import b from "@mui/icons-material/FormatQuoteOutlined";
|
|
18
|
+
import x from "@mui/icons-material/PersonOutlined";
|
|
19
|
+
import S from "@mui/icons-material/AssignmentOutlined";
|
|
20
|
+
import C from "@mui/icons-material/ApartmentOutlined";
|
|
21
|
+
import w from "@mui/icons-material/PublicOutlined";
|
|
22
|
+
import T from "@mui/icons-material/ScheduleOutlined";
|
|
23
|
+
import E from "@mui/icons-material/HourglassEmptyOutlined";
|
|
24
|
+
import D from "@mui/icons-material/BlockOutlined";
|
|
25
|
+
import O from "@mui/icons-material/RuleOutlined";
|
|
26
|
+
import k from "@mui/icons-material/HelpOutline";
|
|
27
|
+
//#region src/components/GenericCard/DuoTermTags/DuoTermTags.tsx
|
|
28
|
+
var A = {
|
|
29
|
+
"DUO:0000042": l,
|
|
30
|
+
"DUO:0000006": u,
|
|
31
|
+
"DUO:0000007": d,
|
|
32
|
+
"DUO:0000011": f,
|
|
33
|
+
"DUO:0000043": p,
|
|
34
|
+
"DUO:0000004": m,
|
|
35
|
+
"DUO:0000046": h,
|
|
36
|
+
"DUO:0000018": h,
|
|
37
|
+
"DUO:0000045": h,
|
|
38
|
+
"DUO:0000019": g,
|
|
39
|
+
"DUO:0000020": _,
|
|
40
|
+
"DUO:0000021": v,
|
|
41
|
+
"DUO:0000029": y,
|
|
42
|
+
DUOplus7: b,
|
|
43
|
+
"DUO:0000026": x,
|
|
44
|
+
"DUO:0000027": S,
|
|
45
|
+
"DUO:0000028": C,
|
|
46
|
+
"DUO:0000022": w,
|
|
47
|
+
"DUO:0000025": T,
|
|
48
|
+
"DUO:0000024": E,
|
|
49
|
+
"DUO:0000016": e,
|
|
50
|
+
"DUO:0000015": D,
|
|
51
|
+
"DUO:0000044": D,
|
|
52
|
+
"DUO:0000012": O
|
|
53
|
+
}, j = (e) => {
|
|
54
|
+
let { term: t } = e;
|
|
55
|
+
return /* @__PURE__ */ s(A[t.code] ?? k, {});
|
|
56
|
+
}, M = {
|
|
57
|
+
permission: 0,
|
|
58
|
+
commercial: 1,
|
|
59
|
+
obligation: 2,
|
|
60
|
+
limit: 3
|
|
61
|
+
};
|
|
62
|
+
function N(e) {
|
|
63
|
+
let n = t(e), r = !!(e.abbr || e.code);
|
|
64
|
+
return /* @__PURE__ */ c(o, { children: [
|
|
65
|
+
/* @__PURE__ */ s("strong", { children: e.name }),
|
|
66
|
+
r && /* @__PURE__ */ c(o, { children: [
|
|
67
|
+
/* @__PURE__ */ s("br", {}),
|
|
68
|
+
e.abbr,
|
|
69
|
+
e.abbr && e.code ? " · " : "",
|
|
70
|
+
n ? /* @__PURE__ */ s(a, {
|
|
71
|
+
href: n,
|
|
72
|
+
target: "_blank",
|
|
73
|
+
rel: "noopener",
|
|
74
|
+
color: "inherit",
|
|
75
|
+
children: e.code
|
|
76
|
+
}) : e.code
|
|
77
|
+
] }),
|
|
78
|
+
e.definition && e.definition !== e.name && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("br", {}), e.definition] })
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
function P(e) {
|
|
82
|
+
let { terms: t } = e;
|
|
83
|
+
return !t || t.length === 0 ? null : /* @__PURE__ */ s(i, {
|
|
84
|
+
sx: {
|
|
85
|
+
display: "flex",
|
|
86
|
+
flexWrap: "wrap",
|
|
87
|
+
gap: .75,
|
|
88
|
+
minWidth: 0,
|
|
89
|
+
maxWidth: "100%"
|
|
90
|
+
},
|
|
91
|
+
children: t.map(n).sort((e, t) => M[e.category] - M[t.category]).map((e, t) => /* @__PURE__ */ s(r, {
|
|
92
|
+
label: e.name,
|
|
93
|
+
icon: /* @__PURE__ */ s(j, { term: e }),
|
|
94
|
+
tooltipTitle: N(e)
|
|
95
|
+
}, t))
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function F(e) {
|
|
99
|
+
return (t, r) => {
|
|
100
|
+
if (t !== e) return;
|
|
101
|
+
let i = n(r);
|
|
102
|
+
return {
|
|
103
|
+
label: i.name,
|
|
104
|
+
icon: /* @__PURE__ */ s(j, { term: i }),
|
|
105
|
+
tooltipTitle: N(i)
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { F as createDuoFacetValueRenderer, P as default };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=DuoTermTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuoTermTags.js","names":[],"sources":["../../../../src/components/GenericCard/DuoTermTags/DuoTermTags.tsx"],"sourcesContent":["import { Box, Link } from '@mui/material'\nimport type { ComponentType, ReactNode } from 'react'\nimport GeneticsIcon from '@/assets/icons/GeneticsIcon'\nimport ScienceOutlined from '@mui/icons-material/ScienceOutlined'\nimport MedicalServicesOutlined from '@mui/icons-material/MedicalServicesOutlined'\nimport CoronavirusOutlined from '@mui/icons-material/CoronavirusOutlined'\nimport GroupsOutlined from '@mui/icons-material/GroupsOutlined'\nimport HealingOutlined from '@mui/icons-material/HealingOutlined'\nimport LockOpenOutlined from '@mui/icons-material/LockOpenOutlined'\nimport MoneyOffOutlined from '@mui/icons-material/MoneyOffOutlined'\nimport ArticleOutlined from '@mui/icons-material/ArticleOutlined'\nimport HandshakeOutlined from '@mui/icons-material/HandshakeOutlined'\nimport GavelOutlined from '@mui/icons-material/GavelOutlined'\nimport ReplayOutlined from '@mui/icons-material/ReplayOutlined'\nimport FormatQuoteOutlined from '@mui/icons-material/FormatQuoteOutlined'\nimport PersonOutlined from '@mui/icons-material/PersonOutlined'\nimport AssignmentOutlined from '@mui/icons-material/AssignmentOutlined'\nimport ApartmentOutlined from '@mui/icons-material/ApartmentOutlined'\nimport PublicOutlined from '@mui/icons-material/PublicOutlined'\nimport ScheduleOutlined from '@mui/icons-material/ScheduleOutlined'\nimport HourglassEmptyOutlined from '@mui/icons-material/HourglassEmptyOutlined'\nimport BlockOutlined from '@mui/icons-material/BlockOutlined'\nimport RuleOutlined from '@mui/icons-material/RuleOutlined'\nimport HelpOutline from '@mui/icons-material/HelpOutline'\nimport {\n DuoCategory,\n DuoTerm,\n duoRegistryUrl,\n resolveDuoTerm,\n} from './duoTerms'\nimport FacetValueChip from '@/components/widgets/facet-nav/FacetValueChip'\nimport type { RenderedFacetValueChip } from '@/components/QueryVisualizationWrapper/QueryVisualizationContext'\n\nexport type DuoTermTagsProps = {\n /** Raw `dataUseModifiers` values (ontology codes or term names). */\n terms: string[]\n}\n\n// An icon per code so the meaning reads at a glance.\nconst DUO_ICONS: Record<string, ComponentType> = {\n 'DUO:0000042': ScienceOutlined, // General Research Use\n 'DUO:0000006': MedicalServicesOutlined, // Health/Medical/Biomedical\n 'DUO:0000007': CoronavirusOutlined, // Disease Specific\n 'DUO:0000011': GroupsOutlined, // Population Origins/Ancestry\n 'DUO:0000043': HealingOutlined, // Clinical Care Use\n 'DUO:0000004': LockOpenOutlined, // No Restriction\n 'DUO:0000046': MoneyOffOutlined, // Non-Commercial Use Only\n 'DUO:0000018': MoneyOffOutlined, // Not-for-Profit, Non-Commercial\n 'DUO:0000045': MoneyOffOutlined, // Not-for-Profit Organisation\n 'DUO:0000019': ArticleOutlined, // Publication Required\n 'DUO:0000020': HandshakeOutlined, // Collaboration Required\n 'DUO:0000021': GavelOutlined, // Ethics Approval Required\n 'DUO:0000029': ReplayOutlined, // Return to Database/Resource\n DUOplus7: FormatQuoteOutlined, // Attribution Required\n 'DUO:0000026': PersonOutlined, // User Specific\n 'DUO:0000027': AssignmentOutlined, // Project Specific\n 'DUO:0000028': ApartmentOutlined, // Institution Specific\n 'DUO:0000022': PublicOutlined, // Geographical Restriction\n 'DUO:0000025': ScheduleOutlined, // Time Limit\n 'DUO:0000024': HourglassEmptyOutlined, // Publication Moratorium\n 'DUO:0000016': GeneticsIcon, // Genetic Studies Only (Material Symbols)\n 'DUO:0000015': BlockOutlined, // No General Methods Research\n 'DUO:0000044': BlockOutlined, // Population/Ancestry Prohibited\n 'DUO:0000012': RuleOutlined, // Research Specific Restrictions\n}\n\nconst TermIcon = (props: { term: DuoTerm }): ReactNode => {\n const { term } = props\n const Icon = DUO_ICONS[term.code] ?? HelpOutline\n return <Icon />\n}\n\n// Primary use first (the dataset's purpose), then the conditions that limit it.\nconst ORDER: Record<DuoCategory, number> = {\n permission: 0,\n commercial: 1,\n obligation: 2,\n limit: 3,\n}\n\n// The rich tooltip for a DUO term: full name, abbreviation, ontology code\n// (linked to the registry when available), and definition.\nfunction duoTooltipTitle(t: DuoTerm): ReactNode {\n const url = duoRegistryUrl(t)\n const hasMeta = Boolean(t.abbr || t.code)\n return (\n <>\n <strong>{t.name}</strong>\n {hasMeta && (\n <>\n <br />\n {t.abbr}\n {t.abbr && t.code ? ' · ' : ''}\n {url ? (\n <Link href={url} target=\"_blank\" rel=\"noopener\" color=\"inherit\">\n {t.code}\n </Link>\n ) : (\n t.code\n )}\n </>\n )}\n {t.definition && t.definition !== t.name && (\n <>\n <br />\n {t.definition}\n </>\n )}\n </>\n )\n}\n\n/** Renders a dataset's DUO data-use modifiers as a row of chips (used on cards). */\nexport default function DuoTermTags(props: DuoTermTagsProps) {\n const { terms } = props\n if (!terms || terms.length === 0) {\n return null\n }\n const sorted = terms\n .map(resolveDuoTerm)\n .sort((a, b) => ORDER[a.category] - ORDER[b.category])\n\n return (\n <Box\n sx={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 0.75,\n minWidth: 0,\n maxWidth: '100%',\n }}\n >\n {sorted.map((t, i) => (\n <FacetValueChip\n key={i}\n label={t.name}\n icon={<TermIcon term={t} />}\n tooltipTitle={duoTooltipTitle(t)}\n />\n ))}\n </Box>\n )\n}\n\n/**\n * Builds a `renderFacetValue` function (for `QueryVisualizationWrapper`) that\n * returns the chip content for the given DUO column's enumeration facet values\n * — used by both the facet sidebar and the active-filter pills, which render it\n * through the shared `FacetValueChip`. Other columns fall through to text.\n *\n * Portals only need to declare the DUO column (via the card schema's\n * `dataUseModifiersColumnName`) rather than each defining their own handler.\n */\nexport function createDuoFacetValueRenderer(duoColumnName: string) {\n return (\n columnName: string,\n value: string,\n ): RenderedFacetValueChip | undefined => {\n if (columnName !== duoColumnName) {\n return undefined\n }\n const t = resolveDuoTerm(value)\n return {\n label: t.name,\n icon: <TermIcon term={t} />,\n tooltipTitle: duoTooltipTitle(t),\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAA2C;CAC/C,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,UAAU;CACV,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;AACjB,GAEM,KAAY,MAAwC;CACxD,IAAM,EAAE,YAAS;CAEjB,OAAO,kBADM,EAAU,EAAK,SAAS,GAC9B,CAAO,CAAA;AAChB,GAGM,IAAqC;CACzC,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,OAAO;AACT;AAIA,SAAS,EAAgB,GAAuB;CAC9C,IAAM,IAAM,EAAe,CAAC,GACtB,IAAU,GAAQ,EAAE,QAAQ,EAAE;CACpC,OACE,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,UAAD,EAAA,UAAS,EAAE,KAAa,CAAA;EACvB,KACC,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,MAAD,CAAK,CAAA;GACJ,EAAE;GACF,EAAE,QAAQ,EAAE,OAAO,QAAQ;GAC3B,IACC,kBAAC,GAAD;IAAM,MAAM;IAAK,QAAO;IAAS,KAAI;IAAW,OAAM;cACnD,EAAE;GACC,CAAA,IAEN,EAAE;EAEJ,EAAA,CAAA;EAEH,EAAE,cAAc,EAAE,eAAe,EAAE,QAClC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,MAAD,CAAK,CAAA,GACJ,EAAE,UACH,EAAA,CAAA;CAEJ,EAAA,CAAA;AAEN;AAGA,SAAwB,EAAY,GAAyB;CAC3D,IAAM,EAAE,aAAU;CAQlB,OAPI,CAAC,KAAS,EAAM,WAAW,IACtB,OAOP,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,UAAU;GACV,KAAK;GACL,UAAU;GACV,UAAU;EACZ;YAZW,EACZ,IAAI,CAAc,EAClB,MAAM,GAAG,MAAM,EAAM,EAAE,YAAY,EAAM,EAAE,SAYzC,EAAO,KAAK,GAAG,MACd,kBAAC,GAAD;GAEE,OAAO,EAAE;GACT,MAAM,kBAAC,GAAD,EAAU,MAAM,EAAI,CAAA;GAC1B,cAAc,EAAgB,CAAC;EAChC,GAJM,CAIN,CACF;CACE,CAAA;AAET;AAWA,SAAgB,EAA4B,GAAuB;CACjE,QACE,GACA,MACuC;EACvC,IAAI,MAAe,GACjB;EAEF,IAAM,IAAI,EAAe,CAAK;EAC9B,OAAO;GACL,OAAO,EAAE;GACT,MAAM,kBAAC,GAAD,EAAU,MAAM,EAAI,CAAA;GAC1B,cAAc,EAAgB,CAAC;EACjC;CACF;AACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type DuoCategory = 'permission' | 'commercial' | 'obligation' | 'limit';
|
|
2
|
+
export type DuoTerm = {
|
|
3
|
+
/** Ontology code, e.g. "DUO:0000042". DUO-Plus terms use a "DUOplus#" code. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** Short abbreviation (shown in tooltips). */
|
|
6
|
+
abbr: string;
|
|
7
|
+
/** Full human-readable name (the visible tag label). */
|
|
8
|
+
name: string;
|
|
9
|
+
category: DuoCategory;
|
|
10
|
+
definition: string;
|
|
11
|
+
};
|
|
12
|
+
/** All known terms, in canonical (category) order — for demos/legends. */
|
|
13
|
+
export declare const ALL_DUO_TERMS: readonly DuoTerm[];
|
|
14
|
+
/**
|
|
15
|
+
* Link to the term's definition in Bioregistry (GA4GH DUO terms only;
|
|
16
|
+
* DUO-Plus extensions have no registry entry).
|
|
17
|
+
*/
|
|
18
|
+
export declare function duoRegistryUrl(term: DuoTerm): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Parse a `dataUseModifiers` cell into a list of values. The column is a
|
|
21
|
+
* STRING_LIST, returned as a JSON-array string (e.g. `["General Research Use"]`
|
|
22
|
+
* or, once migrated, `["DUO:0000042"]`).
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseDuoModifiers(raw: string | null | undefined): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Resolve a raw `dataUseModifiers` value (an ontology code like DUO:0000042, a
|
|
27
|
+
* DUOplus# code, or a term name) to a known DuoTerm. Unknown values fall back
|
|
28
|
+
* to a neutral "limit" tag built from the raw text so nothing is dropped.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveDuoTerm(raw: string): DuoTerm;
|
|
31
|
+
//# sourceMappingURL=duoTerms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duoTerms.d.ts","sourceRoot":"","sources":["../../../../src/components/GenericCard/DuoTermTags/duoTerms.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,OAAO,CAAA;AAE9E,MAAM,MAAM,OAAO,GAAG;IACpB,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,WAAW,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAiMD,0EAA0E;AAC1E,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAU,CAAA;AAEtD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIhE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAU1E;AAWD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAoBnD"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//#region src/components/GenericCard/DuoTermTags/duoTerms.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
code: "DUO:0000042",
|
|
5
|
+
abbr: "GRU",
|
|
6
|
+
name: "General Research Use",
|
|
7
|
+
category: "permission",
|
|
8
|
+
definition: "Use is allowed for any research purpose, including methods development and population/ancestry research."
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
code: "DUO:0000006",
|
|
12
|
+
abbr: "HMB",
|
|
13
|
+
name: "Health or Medical or Biomedical Research",
|
|
14
|
+
category: "permission",
|
|
15
|
+
definition: "Use is allowed for health, medical, or biomedical research purposes."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
code: "DUO:0000007",
|
|
19
|
+
abbr: "DS",
|
|
20
|
+
name: "Disease Specific Research",
|
|
21
|
+
category: "permission",
|
|
22
|
+
definition: "Use is allowed for research into the specified disease or condition."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
code: "DUO:0000011",
|
|
26
|
+
abbr: "POA",
|
|
27
|
+
name: "Population Origins or Ancestry Research Only",
|
|
28
|
+
category: "permission",
|
|
29
|
+
definition: "Use is limited to population origins or ancestry research only."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
code: "DUO:0000043",
|
|
33
|
+
abbr: "CC",
|
|
34
|
+
name: "Clinical Care Use",
|
|
35
|
+
category: "permission",
|
|
36
|
+
definition: "Use is allowed for clinical care purposes."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: "DUO:0000004",
|
|
40
|
+
abbr: "NRES",
|
|
41
|
+
name: "No Restriction",
|
|
42
|
+
category: "permission",
|
|
43
|
+
definition: "No restrictions on use; data is available under open access."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
code: "DUO:0000046",
|
|
47
|
+
abbr: "NCU",
|
|
48
|
+
name: "Non-Commercial Use Only",
|
|
49
|
+
category: "commercial",
|
|
50
|
+
definition: "Use is limited to non-commercial purposes."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
code: "DUO:0000018",
|
|
54
|
+
abbr: "NPUNCU",
|
|
55
|
+
name: "Not-for-Profit, Non-Commercial Use Only",
|
|
56
|
+
category: "commercial",
|
|
57
|
+
definition: "Use is limited to not-for-profit organizations for non-commercial purposes."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
code: "DUO:0000045",
|
|
61
|
+
abbr: "NPU",
|
|
62
|
+
name: "Not-for-Profit Organisation Use Only",
|
|
63
|
+
category: "commercial",
|
|
64
|
+
definition: "Use is limited to not-for-profit organizations."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
code: "DUO:0000019",
|
|
68
|
+
abbr: "PUB",
|
|
69
|
+
name: "Publication Required",
|
|
70
|
+
category: "obligation",
|
|
71
|
+
definition: "Requestor agrees to make results of studies using the data available to the larger scientific community."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
code: "DUO:0000020",
|
|
75
|
+
abbr: "COL",
|
|
76
|
+
name: "Collaboration Required",
|
|
77
|
+
category: "obligation",
|
|
78
|
+
definition: "Requestor agrees to collaborate with the primary study investigator(s)."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
code: "DUO:0000021",
|
|
82
|
+
abbr: "IRB",
|
|
83
|
+
name: "Ethics Approval Required",
|
|
84
|
+
category: "obligation",
|
|
85
|
+
definition: "Requestor must provide documentation of local IRB/ethics approval."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
code: "DUO:0000029",
|
|
89
|
+
abbr: "RTN",
|
|
90
|
+
name: "Return to Database or Resource",
|
|
91
|
+
category: "obligation",
|
|
92
|
+
definition: "Requestor must return derived/enriched data to the database or resource."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
code: "DUOplus7",
|
|
96
|
+
abbr: "ATTR",
|
|
97
|
+
name: "Attribution Required",
|
|
98
|
+
category: "obligation",
|
|
99
|
+
definition: "Requestor must provide the specified attribution/acknowledgement statement when using the data. (Sage DUO-Plus extension.)"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
code: "DUO:0000026",
|
|
103
|
+
abbr: "US",
|
|
104
|
+
name: "User Specific Restriction",
|
|
105
|
+
category: "limit",
|
|
106
|
+
definition: "Use is limited to specified, approved users."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
code: "DUO:0000027",
|
|
110
|
+
abbr: "PS",
|
|
111
|
+
name: "Project Specific Restriction",
|
|
112
|
+
category: "limit",
|
|
113
|
+
definition: "Use is limited to a specified, approved project."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
code: "DUO:0000028",
|
|
117
|
+
abbr: "IS",
|
|
118
|
+
name: "Institution Specific Restriction",
|
|
119
|
+
category: "limit",
|
|
120
|
+
definition: "Use is limited to specified, approved institutions."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
code: "DUO:0000022",
|
|
124
|
+
abbr: "GS",
|
|
125
|
+
name: "Geographical Restriction",
|
|
126
|
+
category: "limit",
|
|
127
|
+
definition: "Use is limited to within a specified geographic region."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
code: "DUO:0000025",
|
|
131
|
+
abbr: "TS",
|
|
132
|
+
name: "Time Limit on Use",
|
|
133
|
+
category: "limit",
|
|
134
|
+
definition: "Use is approved for a specified period of time."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
code: "DUO:0000024",
|
|
138
|
+
abbr: "MOR",
|
|
139
|
+
name: "Publication Moratorium",
|
|
140
|
+
category: "limit",
|
|
141
|
+
definition: "Requestor must not publish results until a specified date."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
code: "DUO:0000016",
|
|
145
|
+
abbr: "GSO",
|
|
146
|
+
name: "Genetic Studies Only",
|
|
147
|
+
category: "limit",
|
|
148
|
+
definition: "Use is limited to genetic studies only."
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
code: "DUO:0000015",
|
|
152
|
+
abbr: "NMDS",
|
|
153
|
+
name: "No General Methods Research",
|
|
154
|
+
category: "limit",
|
|
155
|
+
definition: "Use for general methods development research is prohibited."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
code: "DUO:0000044",
|
|
159
|
+
abbr: "NPOA",
|
|
160
|
+
name: "Population Origins or Ancestry Research Prohibited",
|
|
161
|
+
category: "limit",
|
|
162
|
+
definition: "Use for population origins or ancestry research is prohibited."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
code: "DUO:0000012",
|
|
166
|
+
abbr: "RS",
|
|
167
|
+
name: "Research Specific Restrictions",
|
|
168
|
+
category: "limit",
|
|
169
|
+
definition: "Use is limited to the specific research type(s) described by the data provider."
|
|
170
|
+
}
|
|
171
|
+
], t = e;
|
|
172
|
+
function n(e) {
|
|
173
|
+
return e.code.startsWith("DUO:") ? `https://bioregistry.io/${e.code.toLowerCase()}` : void 0;
|
|
174
|
+
}
|
|
175
|
+
function r(e) {
|
|
176
|
+
if (!e) return [];
|
|
177
|
+
try {
|
|
178
|
+
let t = JSON.parse(e);
|
|
179
|
+
return Array.isArray(t) ? t.map(String) : [String(e)];
|
|
180
|
+
} catch {
|
|
181
|
+
return [e];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
var i = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim(), a = new Map(e.map((e) => [i(e.name), e])), o = new Map(e.map((e) => [e.code.toUpperCase(), e]));
|
|
185
|
+
function s(e) {
|
|
186
|
+
let t = e.trim();
|
|
187
|
+
return o.get(t.toUpperCase()) || a.get(i(t)) || {
|
|
188
|
+
code: "",
|
|
189
|
+
abbr: "",
|
|
190
|
+
name: t,
|
|
191
|
+
category: "limit",
|
|
192
|
+
definition: t
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { t as ALL_DUO_TERMS, n as duoRegistryUrl, r as parseDuoModifiers, s as resolveDuoTerm };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=duoTerms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duoTerms.js","names":[],"sources":["../../../../src/components/GenericCard/DuoTermTags/duoTerms.ts"],"sourcesContent":["// Data Use Ontology (DUO) vocabulary, plus Sage's DUO-Plus extensions.\n//\n// Source of truth for codes/labels: Sage-Bionetworks/governanceDUO\n// (`metadata structure.md`), which mirrors the GA4GH DUO term set and adds\n// Sage's \"DUOplus\" modifiers. Datasets are annotated with the ontology code\n// (e.g. DUO:0000042); the displayed tag is derived from that code here, so the\n// annotation and the display can evolve independently.\n\nexport type DuoCategory = 'permission' | 'commercial' | 'obligation' | 'limit'\n\nexport type DuoTerm = {\n /** Ontology code, e.g. \"DUO:0000042\". DUO-Plus terms use a \"DUOplus#\" code. */\n code: string\n /** Short abbreviation (shown in tooltips). */\n abbr: string\n /** Full human-readable name (the visible tag label). */\n name: string\n category: DuoCategory\n definition: string\n}\n\nconst TERMS: DuoTerm[] = [\n // --- Permitted use (what research the data may be used for) ---\n {\n code: 'DUO:0000042',\n abbr: 'GRU',\n name: 'General Research Use',\n category: 'permission',\n definition:\n 'Use is allowed for any research purpose, including methods development and population/ancestry research.',\n },\n {\n code: 'DUO:0000006',\n abbr: 'HMB',\n name: 'Health or Medical or Biomedical Research',\n category: 'permission',\n definition:\n 'Use is allowed for health, medical, or biomedical research purposes.',\n },\n {\n code: 'DUO:0000007',\n abbr: 'DS',\n name: 'Disease Specific Research',\n category: 'permission',\n definition:\n 'Use is allowed for research into the specified disease or condition.',\n },\n {\n code: 'DUO:0000011',\n abbr: 'POA',\n name: 'Population Origins or Ancestry Research Only',\n category: 'permission',\n definition:\n 'Use is limited to population origins or ancestry research only.',\n },\n {\n code: 'DUO:0000043',\n abbr: 'CC',\n name: 'Clinical Care Use',\n category: 'permission',\n definition: 'Use is allowed for clinical care purposes.',\n },\n {\n code: 'DUO:0000004',\n abbr: 'NRES',\n name: 'No Restriction',\n category: 'permission',\n definition: 'No restrictions on use; data is available under open access.',\n },\n\n // --- Commercial-use restriction ---\n {\n code: 'DUO:0000046',\n abbr: 'NCU',\n name: 'Non-Commercial Use Only',\n category: 'commercial',\n definition: 'Use is limited to non-commercial purposes.',\n },\n {\n code: 'DUO:0000018',\n abbr: 'NPUNCU',\n name: 'Not-for-Profit, Non-Commercial Use Only',\n category: 'commercial',\n definition:\n 'Use is limited to not-for-profit organizations for non-commercial purposes.',\n },\n {\n code: 'DUO:0000045',\n abbr: 'NPU',\n name: 'Not-for-Profit Organisation Use Only',\n category: 'commercial',\n definition: 'Use is limited to not-for-profit organizations.',\n },\n\n // --- Obligations (things the requester must do) ---\n {\n code: 'DUO:0000019',\n abbr: 'PUB',\n name: 'Publication Required',\n category: 'obligation',\n definition:\n 'Requestor agrees to make results of studies using the data available to the larger scientific community.',\n },\n {\n code: 'DUO:0000020',\n abbr: 'COL',\n name: 'Collaboration Required',\n category: 'obligation',\n definition:\n 'Requestor agrees to collaborate with the primary study investigator(s).',\n },\n {\n code: 'DUO:0000021',\n abbr: 'IRB',\n name: 'Ethics Approval Required',\n category: 'obligation',\n definition:\n 'Requestor must provide documentation of local IRB/ethics approval.',\n },\n {\n code: 'DUO:0000029',\n abbr: 'RTN',\n name: 'Return to Database or Resource',\n category: 'obligation',\n definition:\n 'Requestor must return derived/enriched data to the database or resource.',\n },\n {\n // Sage DUO-Plus extension (no GA4GH ontology id).\n code: 'DUOplus7',\n abbr: 'ATTR',\n name: 'Attribution Required',\n category: 'obligation',\n definition:\n 'Requestor must provide the specified attribution/acknowledgement statement when using the data. (Sage DUO-Plus extension.)',\n },\n\n // --- Use limits (narrow who / where / when / what kind of research) ---\n {\n code: 'DUO:0000026',\n abbr: 'US',\n name: 'User Specific Restriction',\n category: 'limit',\n definition: 'Use is limited to specified, approved users.',\n },\n {\n code: 'DUO:0000027',\n abbr: 'PS',\n name: 'Project Specific Restriction',\n category: 'limit',\n definition: 'Use is limited to a specified, approved project.',\n },\n {\n code: 'DUO:0000028',\n abbr: 'IS',\n name: 'Institution Specific Restriction',\n category: 'limit',\n definition: 'Use is limited to specified, approved institutions.',\n },\n {\n code: 'DUO:0000022',\n abbr: 'GS',\n name: 'Geographical Restriction',\n category: 'limit',\n definition: 'Use is limited to within a specified geographic region.',\n },\n {\n code: 'DUO:0000025',\n abbr: 'TS',\n name: 'Time Limit on Use',\n category: 'limit',\n definition: 'Use is approved for a specified period of time.',\n },\n {\n code: 'DUO:0000024',\n abbr: 'MOR',\n name: 'Publication Moratorium',\n category: 'limit',\n definition: 'Requestor must not publish results until a specified date.',\n },\n {\n code: 'DUO:0000016',\n abbr: 'GSO',\n name: 'Genetic Studies Only',\n category: 'limit',\n definition: 'Use is limited to genetic studies only.',\n },\n {\n code: 'DUO:0000015',\n abbr: 'NMDS',\n name: 'No General Methods Research',\n category: 'limit',\n definition: 'Use for general methods development research is prohibited.',\n },\n {\n code: 'DUO:0000044',\n abbr: 'NPOA',\n name: 'Population Origins or Ancestry Research Prohibited',\n category: 'limit',\n definition:\n 'Use for population origins or ancestry research is prohibited.',\n },\n {\n code: 'DUO:0000012',\n abbr: 'RS',\n name: 'Research Specific Restrictions',\n category: 'limit',\n definition:\n 'Use is limited to the specific research type(s) described by the data provider.',\n },\n]\n\n/** All known terms, in canonical (category) order — for demos/legends. */\nexport const ALL_DUO_TERMS: readonly DuoTerm[] = TERMS\n\n/**\n * Link to the term's definition in Bioregistry (GA4GH DUO terms only;\n * DUO-Plus extensions have no registry entry).\n */\nexport function duoRegistryUrl(term: DuoTerm): string | undefined {\n return term.code.startsWith('DUO:')\n ? `https://bioregistry.io/${term.code.toLowerCase()}`\n : undefined\n}\n\n/**\n * Parse a `dataUseModifiers` cell into a list of values. The column is a\n * STRING_LIST, returned as a JSON-array string (e.g. `[\"General Research Use\"]`\n * or, once migrated, `[\"DUO:0000042\"]`).\n */\nexport function parseDuoModifiers(raw: string | null | undefined): string[] {\n if (!raw) {\n return []\n }\n try {\n const parsed: unknown = JSON.parse(raw)\n return Array.isArray(parsed) ? parsed.map(String) : [String(raw)]\n } catch {\n return [raw]\n }\n}\n\nconst normalize = (s: string) =>\n s\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, ' ')\n .trim()\n\nconst BY_NAME = new Map(TERMS.map(t => [normalize(t.name), t]))\nconst BY_CODE = new Map(TERMS.map(t => [t.code.toUpperCase(), t]))\n\n/**\n * Resolve a raw `dataUseModifiers` value (an ontology code like DUO:0000042, a\n * DUOplus# code, or a term name) to a known DuoTerm. Unknown values fall back\n * to a neutral \"limit\" tag built from the raw text so nothing is dropped.\n */\nexport function resolveDuoTerm(raw: string): DuoTerm {\n const value = raw.trim()\n const byCode = BY_CODE.get(value.toUpperCase())\n if (byCode) {\n return byCode\n }\n const match = BY_NAME.get(normalize(value))\n if (match) {\n return match\n }\n // Unknown value: present the raw text as-is. Don't fabricate an abbreviation —\n // known terms carry a hard-coded abbr in TERMS; a guessed initialism would be\n // arbitrary and potentially wrong.\n return {\n code: '',\n abbr: '',\n name: value,\n category: 'limit',\n definition: value,\n }\n}\n"],"mappings":";AAqBA,IAAM,IAAmB;CAEvB;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CAGA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CAGA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EAEE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CAGA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;CACA;EACE,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YACE;CACJ;AACF,GAGa,IAAoC;AAMjD,SAAgB,EAAe,GAAmC;CAChE,OAAO,EAAK,KAAK,WAAW,MAAM,IAC9B,0BAA0B,EAAK,KAAK,YAAY,MAChD,KAAA;AACN;AAOA,SAAgB,EAAkB,GAA0C;CAC1E,IAAI,CAAC,GACH,OAAO,CAAC;CAEV,IAAI;EACF,IAAM,IAAkB,KAAK,MAAM,CAAG;EACtC,OAAO,MAAM,QAAQ,CAAM,IAAI,EAAO,IAAI,MAAM,IAAI,CAAC,OAAO,CAAG,CAAC;CAClE,QAAQ;EACN,OAAO,CAAC,CAAG;CACb;AACF;AAEA,IAAM,KAAa,MACjB,EACG,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,KAAK,GAEJ,IAAU,IAAI,IAAI,EAAM,KAAI,MAAK,CAAC,EAAU,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,GACxD,IAAU,IAAI,IAAI,EAAM,KAAI,MAAK,CAAC,EAAE,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC;AAOjE,SAAgB,EAAe,GAAsB;CACnD,IAAM,IAAQ,EAAI,KAAK;CAYvB,OAXe,EAAQ,IAAI,EAAM,YAAY,CACzC,KAGU,EAAQ,IAAI,EAAU,CAAK,CACrC,KAMG;EACL,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,YAAY;CACd;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapseCardLabel.d.ts","sourceRoot":"","sources":["../../../src/components/GenericCard/SynapseCardLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAM9D,OAAO,EACL,WAAW,EAEX,GAAG,EACH,YAAY,EACb,MAAM,iCAAiC,CAAA;AAIxC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,WAAW,EACX,8BAA8B,EAC/B,MAAM,0CAA0C,CAAA;AASjD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EACL,QAAQ,GACR,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,8BAA8B,GAC9B,SAAS,CAAA;IACb,aAAa,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;IACzC,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;IACvC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAA;AACD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SynapseCardLabel.d.ts","sourceRoot":"","sources":["../../../src/components/GenericCard/SynapseCardLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAM9D,OAAO,EACL,WAAW,EAEX,GAAG,EACH,YAAY,EACb,MAAM,iCAAiC,CAAA;AAIxC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,WAAW,EACX,8BAA8B,EAC/B,MAAM,0CAA0C,CAAA;AASjD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EACL,QAAQ,GACR,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,8BAA8B,GAC9B,SAAS,CAAA;IACb,aAAa,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;IACzC,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;IACvC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAA;AACD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CA8Q5D"}
|
|
@@ -60,14 +60,10 @@ function y(y) {
|
|
|
60
60
|
className: I
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
|
-
if ("resolveEntityName" in S && S.resolveEntityName && j) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
link: `/${e}?${t}=${j}`,
|
|
68
|
-
showIcon: !1
|
|
69
|
-
});
|
|
70
|
-
}
|
|
63
|
+
if ("resolveEntityName" in S && S.resolveEntityName && j) return /* @__PURE__ */ h(o, {
|
|
64
|
+
entity: j,
|
|
65
|
+
showIcon: !1
|
|
66
|
+
});
|
|
71
67
|
let R;
|
|
72
68
|
if ("isMapValueToReactNodeConfig" in S && S.isMapValueToReactNodeConfig) {
|
|
73
69
|
let { Component: e } = S;
|