react-mutation-mapper 0.8.50 → 0.8.51

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/index.js CHANGED
@@ -843,6 +843,14 @@ var OncoKBSuggestAnnotationLinkout = /** @class */ (function (_super) {
843
843
  return OncoKBSuggestAnnotationLinkout;
844
844
  }(React__namespace.Component));
845
845
 
846
+ var levelTooltipContent = function (level) {
847
+ return (React__namespace.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
848
+ };
849
+ var LevelIcon = function (props) {
850
+ return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: levelTooltipContent(props.level), placement: "left", disabled: !props.showDescription, trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
851
+ React__namespace.createElement("i", { className: levelIconClassNames(props.level) })));
852
+ };
853
+
846
854
  var OncoKbHelper = /** @class */ (function () {
847
855
  function OncoKbHelper() {
848
856
  }
@@ -981,7 +989,6 @@ var OncoKbHelper = /** @class */ (function () {
981
989
  configurable: true,
982
990
  writable: true,
983
991
  value: function (columnKey) {
984
- var _this = this;
985
992
  switch (columnKey) {
986
993
  case 'level':
987
994
  return {
@@ -994,8 +1001,7 @@ var OncoKbHelper = /** @class */ (function () {
994
1001
  },
995
1002
  Cell: function (props) {
996
1003
  var normalizedLevel = normalizeLevel(props.value) || '';
997
- return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: _this.levelTooltipContent(normalizedLevel), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
998
- React__namespace.createElement("i", { className: levelIconClassNames(normalizedLevel), style: { margin: 'auto' } })));
1004
+ return (React__namespace.createElement(LevelIcon, { level: normalizedLevel, showDescription: true }));
999
1005
  },
1000
1006
  };
1001
1007
  case 'alterations':
@@ -1011,14 +1017,6 @@ var OncoKbHelper = /** @class */ (function () {
1011
1017
  }
1012
1018
  }
1013
1019
  });
1014
- Object.defineProperty(OncoKbHelper, "levelTooltipContent", {
1015
- enumerable: true,
1016
- configurable: true,
1017
- writable: true,
1018
- value: function (level) {
1019
- return (React__namespace.createElement("div", { style: { maxWidth: '200px' } }, OncoKbHelper.LEVEL_DESC[level]));
1020
- }
1021
- });
1022
1020
  Object.defineProperty(OncoKbHelper, "getAlterationsColumnCell", {
1023
1021
  enumerable: true,
1024
1022
  configurable: true,
@@ -1384,6 +1382,11 @@ var ImplicationContent = function (props) {
1384
1382
 
1385
1383
  var tabsStyles = {"tabs-wrapper":"tabs-module_tabs-wrapper__XKjzo","tabs":"tabs-module_tabs__2I3mz","tab":"tabs-module_tab__3MoDA","tab-pane":"tabs-module_tab-pane__sGd85","tab-title-a":"tabs-module_tab-title-a__2WTNA","tab-title":"tabs-module_tab-title__2z9-D","tab-subtitle":"tabs-module_tab-subtitle__1P8B_"};
1386
1384
 
1385
+ var OncogenicIcon = function (props) {
1386
+ return (React__namespace.createElement(cbioportalFrontendCommons.DefaultTooltip, { overlay: React__namespace.createElement("span", null, props.oncogenicity), placement: "left", trigger: ['hover', 'focus'], destroyTooltipOnHide: true },
1387
+ React__namespace.createElement("i", { className: oncogenicityIconClassNames(props.oncogenicity) })));
1388
+ };
1389
+
1387
1390
  var _a$3;
1388
1391
  var OncoKbMedicalDisclaimer = (React__default["default"].createElement("p", { className: mainStyles.disclaimer }, "The information above is intended for research purposes only and should not be used as a substitute for professional diagnosis and treatment."));
1389
1392
  var ONCOKB_DATA_ACCESS_PAGE_LINK = 'https://docs.cbioportal.org/2.4-integration-with-other-webservices/oncokb-data-access';
@@ -1405,8 +1408,9 @@ var TabContentWrapper = function (props) {
1405
1408
  return React__default["default"].createElement("div", { className: mainStyles['tab-content'] }, props.children);
1406
1409
  };
1407
1410
  var TabTitle = function (props) {
1411
+ var _a;
1408
1412
  var title = DATA_TYPE_TO_TITLE[props.type];
1409
- var icon = props.displayHighestLevelInTabTitle ? (React__default["default"].createElement("i", { className: annotationIconClassNames(props.type, calcHighestIndicatorLevel(props.type, props.indicator), props.indicator) })) : null;
1413
+ var icon = props.displayHighestLevelInTabTitle ? (props.type === cbioportalUtils.OncoKbCardDataType.BIOLOGICAL ? (React__default["default"].createElement(OncogenicIcon, { oncogenicity: ((_a = props.indicator) === null || _a === void 0 ? void 0 : _a.oncogenic) || '', showDescription: true })) : (React__default["default"].createElement(LevelIcon, { level: normalizeLevel(calcHighestIndicatorLevel(props.type, props.indicator)) || '', showDescription: true }))) : null;
1410
1414
  return icon ? (React__default["default"].createElement("span", { style: { display: 'flex' } },
1411
1415
  icon,
1412
1416
  " ",
@@ -2137,7 +2141,7 @@ function getDefaultEntrezGeneId(mutation) {
2137
2141
  return (mutation.gene && mutation.gene.entrezGeneId) || 0;
2138
2142
  }
2139
2143
  function getDefaultTumorType() {
2140
- return 'Unknown';
2144
+ return '';
2141
2145
  }
2142
2146
  var memoized = new Map();
2143
2147
  function getAnnotationData(mutation, oncoKbCancerGenes, hotspotData, myCancerGenomeData, oncoKbData, usingPublicOncoKbInstance, civicGenes, civicVariants, resolveTumorType, resolveEntrezGeneId) {
@@ -8213,9 +8217,7 @@ var OncoKbSummaryTable = /** @class */ (function (_super) {
8213
8217
  overflow: 'hidden',
8214
8218
  textOverflow: 'ellipsis',
8215
8219
  } },
8216
- React__namespace.createElement("i", { className: levelIconClassNames(level.level), style: {
8217
- verticalAlign: 'text-bottom',
8218
- } }),
8220
+ React__namespace.createElement(LevelIcon, { level: level.level, showDescription: true }),
8219
8221
  React__namespace.createElement("span", { style: {
8220
8222
  paddingRight: 3,
8221
8223
  } }, ":"),
@@ -8335,7 +8337,7 @@ function generateLevelData(indicatorData) {
8335
8337
  var parts = treatment.level.split('_');
8336
8338
  var level = parts.length === 2 ? parts[1] : treatment.level;
8337
8339
  levels[level] = levels[level] || [];
8338
- levels[level].push(indicator.query.tumorType);
8340
+ levels[level].push(getTumorTypeName(treatment.levelAssociatedCancerType));
8339
8341
  });
8340
8342
  });
8341
8343
  return ___default["default"].keys(levels)
@@ -10643,7 +10645,7 @@ var DefaultMutationMapperDataFetcher = /** @class */ (function () {
10643
10645
  writable: true,
10644
10646
  value: function (mutations, fields, isoformOverrideSource, client) {
10645
10647
  if (fields === void 0) { fields = ['annotation_summary']; }
10646
- if (isoformOverrideSource === void 0) { isoformOverrideSource = 'uniprot'; }
10648
+ if (isoformOverrideSource === void 0) { isoformOverrideSource = 'mskcc'; }
10647
10649
  if (client === void 0) { client = this.genomeNexusClient; }
10648
10650
  return tslib.__awaiter(this, void 0, void 0, function () {
10649
10651
  return tslib.__generator(this, function (_a) {
@@ -12069,7 +12071,7 @@ var DefaultMutationMapperStore = /** @class */ (function () {
12069
12071
  value: function (mutation) {
12070
12072
  return this.config.getTumorType
12071
12073
  ? this.config.getTumorType(mutation)
12072
- : 'Unknown';
12074
+ : '';
12073
12075
  }
12074
12076
  });
12075
12077
  Object.defineProperty(DefaultMutationMapperStore.prototype, "getDefaultEntrezGeneId", {