@ohif/app 3.7.0-beta.79 → 3.7.0-beta.80
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/{128.bundle.d4536952e6eda267cb5a.js → 128.bundle.5198a2266456afecd420.js} +37 -55
- package/dist/{181.bundle.9a76ce585a7139d4862f.js → 181.bundle.fa57199595cf28f44c7b.js} +3 -3
- package/dist/{30.bundle.16bfc3a374fc4eda5ffc.js → 19.bundle.75ec1ec14786e136b7b3.js} +114 -260
- package/dist/19.css +1 -0
- package/dist/{202.bundle.6c3b5e9f37d88388e5c8.js → 202.bundle.96bbb4547a346fe3921f.js} +3 -3
- package/dist/221.bundle.8a81cea315fa7697c0e0.js +1722 -0
- package/dist/221.css +2 -0
- package/dist/{236.bundle.2386ed58739fdbdd53f8.js → 236.bundle.d2da6d1991e1229bf913.js} +11 -16
- package/dist/{250.bundle.77985c008fc579308ca9.js → 250.bundle.36909d7bc681d66087d1.js} +4 -4
- package/dist/{90.bundle.1d113c4a201e850c98c0.js → 342.bundle.70da5239bd664aa5d41a.js} +408 -152
- package/dist/{348.bundle.343c39a8c96a044b0fe2.js → 348.bundle.8c5b950d30e5aa992290.js} +45 -56
- package/dist/{359.bundle.2618db789083f7d3007d.js → 359.bundle.d2a3abe1a5cd3ca3cd8e.js} +36 -115
- package/dist/{410.bundle.5cc4909f3c608350a71e.js → 410.bundle.be538faa9c7fad92189b.js} +3 -4
- package/dist/{451.bundle.aaabf094eb8fa67da819.js → 451.bundle.dc0d14c3724464cca2bf.js} +27 -19
- package/dist/{471.bundle.953dacdccd46028efba7.js → 471.bundle.2206d4c0ac2ad0df2362.js} +26 -19
- package/dist/{506.bundle.c0258b1d7299fdb7628e.js → 506.bundle.97e53732423192fee818.js} +1 -75
- package/dist/{677.bundle.ec5f2b4707db33bd4d8e.js → 530.bundle.a03b6f942ace3e1baa1e.js} +5 -10
- package/dist/613.bundle.549d71231abfed24a2dc.js +532 -0
- package/dist/{754.bundle.6618bdd7f648b532c682.js → 754.bundle.e3ce6855d8d4d187f224.js} +36 -46
- package/dist/{777.bundle.82a7cc23a7b6a8bd12fa.js → 777.bundle.ae3fdb8a470caecc0c6a.js} +2 -2
- package/dist/{782.bundle.6fa60a24d3d4ad76c8db.js → 782.bundle.ee8dba2e8582b55cb38d.js} +7 -7
- package/dist/{822.bundle.4767349eb43b79145b3e.js → 822.bundle.5fca45a4f40f5259aec5.js} +2 -2
- package/dist/831.bundle.83658f62fcc769043605.js +16700 -0
- package/dist/{886.bundle.7ee671b1d5656455d067.js → 886.bundle.a9de117c3a42b7907cf6.js} +2 -2
- package/dist/{967.bundle.ab062b0b325bed3b9af9.js → 967.bundle.cce1d004b2ff178b1a8e.js} +242 -101
- package/dist/app-config.js +1 -5
- package/dist/{app.bundle.adf312c193d56262fa41.js → app.bundle.681f66ab37cef811e68b.js} +21839 -18707
- package/dist/app.bundle.css +8 -7
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +19 -19
- package/dist/150.bundle.1fff6b0c3496b6367f58.js +0 -742
- /package/dist/{12.bundle.653904a1682368c34d6b.js → 12.bundle.4a052141b46dec16862d.js} +0 -0
- /package/dist/{125.bundle.aeaad798561853bf6939.js → 125.bundle.253395f320b72180da63.js} +0 -0
- /package/dist/{281.bundle.fbb8c83b343a6903d529.js → 281.bundle.21a9e3178ddebe01b958.js} +0 -0
- /package/dist/{417.bundle.6cadc61b8a455776de31.js → 417.bundle.af0a207c29b109f84159.js} +0 -0
- /package/dist/{663.bundle.5175469e25c5196a739c.js → 663.bundle.b0f98b6e7221b1b9cf6a.js} +0 -0
- /package/dist/{686.bundle.b3dbf84eefbef768843f.js → 686.bundle.dccef1f36e4bc79bcc48.js} +0 -0
- /package/dist/{687.bundle.60d3856e6e77c027c174.js → 687.bundle.ab0ffdccae4610b00224.js} +0 -0
- /package/dist/{814.bundle.ba4f6267b43f8dbc803f.js → 814.bundle.eec4458e893e6055f0fc.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[
|
|
2
|
+
(self["webpackChunk"] = self["webpackChunk"] || []).push([[342],{
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 56342:
|
|
5
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
6
|
|
|
7
7
|
// ESM COMPAT FLAG
|
|
@@ -11,6 +11,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11
11
|
__webpack_require__.d(__webpack_exports__, {
|
|
12
12
|
ContextMenuController: () => (/* reexport */ ContextMenuController),
|
|
13
13
|
CustomizableContextMenuTypes: () => (/* reexport */ types_namespaceObject),
|
|
14
|
+
createReportAsync: () => (/* reexport */ Actions_createReportAsync),
|
|
15
|
+
createReportDialogPrompt: () => (/* reexport */ createReportDialogPrompt),
|
|
14
16
|
"default": () => (/* binding */ default_src),
|
|
15
17
|
dicomWebUtils: () => (/* reexport */ utils_namespaceObject),
|
|
16
18
|
getStudiesForPatientByMRN: () => (/* reexport */ Panels_getStudiesForPatientByMRN)
|
|
@@ -1167,7 +1169,7 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
|
|
|
1167
1169
|
await wadoDicomWebClient.storeInstances(options);
|
|
1168
1170
|
} else {
|
|
1169
1171
|
const meta = {
|
|
1170
|
-
FileMetaInformationVersion: dataset._meta
|
|
1172
|
+
FileMetaInformationVersion: dataset._meta?.FileMetaInformationVersion?.Value,
|
|
1171
1173
|
MediaStorageSOPClassUID: dataset.SOPClassUID,
|
|
1172
1174
|
MediaStorageSOPInstanceUID: dataset.SOPInstanceUID,
|
|
1173
1175
|
TransferSyntaxUID: EXPLICIT_VR_LITTLE_ENDIAN,
|
|
@@ -1217,6 +1219,8 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
|
|
|
1217
1219
|
instance
|
|
1218
1220
|
});
|
|
1219
1221
|
instance.imageId = imageId;
|
|
1222
|
+
instance.wadoRoot = dicomWebConfig.wadoRoot;
|
|
1223
|
+
instance.wadoUri = dicomWebConfig.wadoUri;
|
|
1220
1224
|
metadataProvider.addImageIdToUIDs(imageId, {
|
|
1221
1225
|
StudyInstanceUID,
|
|
1222
1226
|
SeriesInstanceUID: instance.SeriesInstanceUID,
|
|
@@ -1511,18 +1515,18 @@ function createDicomJSONApi(dicomJsonConfig) {
|
|
|
1511
1515
|
});
|
|
1512
1516
|
},
|
|
1513
1517
|
processResults: () => {
|
|
1514
|
-
console.
|
|
1518
|
+
console.warn(' DICOMJson QUERY processResults not implemented');
|
|
1515
1519
|
}
|
|
1516
1520
|
},
|
|
1517
1521
|
series: {
|
|
1518
1522
|
// mapParams: mapParams.bind(),
|
|
1519
1523
|
search: () => {
|
|
1520
|
-
console.
|
|
1524
|
+
console.warn(' DICOMJson QUERY SERIES SEARCH not implemented');
|
|
1521
1525
|
}
|
|
1522
1526
|
},
|
|
1523
1527
|
instances: {
|
|
1524
1528
|
search: () => {
|
|
1525
|
-
console.
|
|
1529
|
+
console.warn(' DICOMJson QUERY instances SEARCH not implemented');
|
|
1526
1530
|
}
|
|
1527
1531
|
}
|
|
1528
1532
|
},
|
|
@@ -1602,7 +1606,7 @@ function createDicomJSONApi(dicomJsonConfig) {
|
|
|
1602
1606
|
},
|
|
1603
1607
|
store: {
|
|
1604
1608
|
dicom: () => {
|
|
1605
|
-
console.
|
|
1609
|
+
console.warn(' DICOMJson store dicom not implemented');
|
|
1606
1610
|
}
|
|
1607
1611
|
},
|
|
1608
1612
|
getImageIdsForDisplaySet(displaySet) {
|
|
@@ -1744,7 +1748,7 @@ function createDicomLocalApi(dicomLocalConfig) {
|
|
|
1744
1748
|
});
|
|
1745
1749
|
},
|
|
1746
1750
|
processResults: () => {
|
|
1747
|
-
console.
|
|
1751
|
+
console.warn(' DICOMLocal QUERY processResults not implemented');
|
|
1748
1752
|
}
|
|
1749
1753
|
},
|
|
1750
1754
|
series: {
|
|
@@ -1766,7 +1770,7 @@ function createDicomLocalApi(dicomLocalConfig) {
|
|
|
1766
1770
|
},
|
|
1767
1771
|
instances: {
|
|
1768
1772
|
search: () => {
|
|
1769
|
-
console.
|
|
1773
|
+
console.warn(' DICOMLocal QUERY instances SEARCH not implemented');
|
|
1770
1774
|
}
|
|
1771
1775
|
}
|
|
1772
1776
|
},
|
|
@@ -2048,8 +2052,8 @@ var react = __webpack_require__(43001);
|
|
|
2048
2052
|
// EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
|
|
2049
2053
|
var prop_types = __webpack_require__(3827);
|
|
2050
2054
|
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
2051
|
-
// EXTERNAL MODULE: ../../ui/src/index.js +
|
|
2052
|
-
var ui_src = __webpack_require__(
|
|
2055
|
+
// EXTERNAL MODULE: ../../ui/src/index.js + 485 modules
|
|
2056
|
+
var ui_src = __webpack_require__(71783);
|
|
2053
2057
|
// EXTERNAL MODULE: ./state/index.js + 1 modules
|
|
2054
2058
|
var state = __webpack_require__(62657);
|
|
2055
2059
|
// EXTERNAL MODULE: ../node_modules/react-router-dom/dist/index.js
|
|
@@ -2058,8 +2062,8 @@ var dist = __webpack_require__(62474);
|
|
|
2058
2062
|
var es = __webpack_require__(69190);
|
|
2059
2063
|
// EXTERNAL MODULE: ../node_modules/react-router/dist/index.js
|
|
2060
2064
|
var react_router_dist = __webpack_require__(85066);
|
|
2061
|
-
// EXTERNAL MODULE: ../../i18n/src/index.js +
|
|
2062
|
-
var i18n_src = __webpack_require__(
|
|
2065
|
+
// EXTERNAL MODULE: ../../i18n/src/index.js + 99 modules
|
|
2066
|
+
var i18n_src = __webpack_require__(34708);
|
|
2063
2067
|
// EXTERNAL MODULE: ../../../node_modules/classnames/index.js
|
|
2064
2068
|
var classnames = __webpack_require__(44921);
|
|
2065
2069
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
@@ -2075,48 +2079,21 @@ function Toolbar(_ref) {
|
|
|
2075
2079
|
toolbarService
|
|
2076
2080
|
} = servicesManager.services;
|
|
2077
2081
|
const [toolbarButtons, setToolbarButtons] = (0,react.useState)([]);
|
|
2078
|
-
const [buttonState, setButtonState] = (0,react.useState)({
|
|
2079
|
-
primaryToolId: '',
|
|
2080
|
-
toggles: {},
|
|
2081
|
-
groups: {}
|
|
2082
|
-
});
|
|
2083
|
-
|
|
2084
|
-
// Could track buttons and state separately...?
|
|
2085
2082
|
(0,react.useEffect)(() => {
|
|
2086
2083
|
const {
|
|
2087
|
-
unsubscribe
|
|
2084
|
+
unsubscribe
|
|
2088
2085
|
} = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_MODIFIED, () => setToolbarButtons(toolbarService.getButtonSection('primary')));
|
|
2089
|
-
const {
|
|
2090
|
-
unsubscribe: unsub2
|
|
2091
|
-
} = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED, () => setButtonState({
|
|
2092
|
-
...toolbarService.state
|
|
2093
|
-
}));
|
|
2094
2086
|
return () => {
|
|
2095
|
-
|
|
2096
|
-
unsub2();
|
|
2087
|
+
unsubscribe();
|
|
2097
2088
|
};
|
|
2098
2089
|
}, [toolbarService]);
|
|
2090
|
+
const onInteraction = (0,react.useCallback)(args => toolbarService.recordInteraction(args), [toolbarService]);
|
|
2099
2091
|
return /*#__PURE__*/react.createElement(react.Fragment, null, toolbarButtons.map(toolDef => {
|
|
2100
2092
|
const {
|
|
2101
2093
|
id,
|
|
2102
2094
|
Component,
|
|
2103
2095
|
componentProps
|
|
2104
2096
|
} = toolDef;
|
|
2105
|
-
// TODO: ...
|
|
2106
|
-
|
|
2107
|
-
// isActive if:
|
|
2108
|
-
// - id is primary?
|
|
2109
|
-
// - id is in list of "toggled on"?
|
|
2110
|
-
let isActive;
|
|
2111
|
-
if (componentProps.type === 'toggle') {
|
|
2112
|
-
isActive = buttonState.toggles[id];
|
|
2113
|
-
}
|
|
2114
|
-
// Also need... to filter list for splitButton, and set primary based on most recently clicked
|
|
2115
|
-
// Also need to kill the radioGroup button's magic logic
|
|
2116
|
-
// Everything should be reactive off these props, so commands can inform ToolbarService
|
|
2117
|
-
|
|
2118
|
-
// These can... Trigger toolbar events based on updates?
|
|
2119
|
-
// Then sync using useEffect, or simply modify the state here?
|
|
2120
2097
|
return (
|
|
2121
2098
|
/*#__PURE__*/
|
|
2122
2099
|
// The margin for separating the tools on the toolbar should go here and NOT in each individual component (button) item.
|
|
@@ -2127,9 +2104,7 @@ function Toolbar(_ref) {
|
|
|
2127
2104
|
}, /*#__PURE__*/react.createElement(Component, _extends({
|
|
2128
2105
|
id: id
|
|
2129
2106
|
}, componentProps, {
|
|
2130
|
-
|
|
2131
|
-
isActive: isActive,
|
|
2132
|
-
onInteraction: args => toolbarService.recordInteraction(args),
|
|
2107
|
+
onInteraction: onInteraction,
|
|
2133
2108
|
servicesManager: servicesManager
|
|
2134
2109
|
})))
|
|
2135
2110
|
);
|
|
@@ -2191,8 +2166,8 @@ function ViewerHeader(_ref) {
|
|
|
2191
2166
|
hotkeyDefinitions,
|
|
2192
2167
|
hotkeyDefaults
|
|
2193
2168
|
} = hotkeysManager;
|
|
2194
|
-
const versionNumber = "3.7.0-beta.
|
|
2195
|
-
const commitHash = "
|
|
2169
|
+
const versionNumber = "3.7.0-beta.80";
|
|
2170
|
+
const commitHash = "04ca10d8779dd15454920002f3d48afa8830de8a";
|
|
2196
2171
|
const menuOptions = [{
|
|
2197
2172
|
title: t('Header:About'),
|
|
2198
2173
|
icon: 'info',
|
|
@@ -2260,6 +2235,49 @@ function ViewerHeader(_ref) {
|
|
|
2260
2235
|
}))));
|
|
2261
2236
|
}
|
|
2262
2237
|
/* harmony default export */ const ViewerLayout_ViewerHeader = (ViewerHeader);
|
|
2238
|
+
;// CONCATENATED MODULE: ../../../extensions/default/src/Components/SidePanelWithServices.tsx
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
const SidePanelWithServices = _ref => {
|
|
2242
|
+
let {
|
|
2243
|
+
servicesManager,
|
|
2244
|
+
side,
|
|
2245
|
+
className,
|
|
2246
|
+
activeTabIndex: activeTabIndexProp,
|
|
2247
|
+
tabs
|
|
2248
|
+
} = _ref;
|
|
2249
|
+
const panelService = servicesManager?.services?.panelService;
|
|
2250
|
+
|
|
2251
|
+
// Tracks whether this SidePanel has been opened at least once since this SidePanel was inserted into the DOM.
|
|
2252
|
+
// Thus going to the Study List page and back to the viewer resets this flag for a SidePanel.
|
|
2253
|
+
const [hasBeenOpened, setHasBeenOpened] = (0,react.useState)(false);
|
|
2254
|
+
const [activeTabIndex, setActiveTabIndex] = (0,react.useState)(activeTabIndexProp);
|
|
2255
|
+
(0,react.useEffect)(() => {
|
|
2256
|
+
if (panelService) {
|
|
2257
|
+
const activatePanelSubscription = panelService.subscribe(panelService.EVENTS.ACTIVATE_PANEL, activatePanelEvent => {
|
|
2258
|
+
if (!hasBeenOpened || activatePanelEvent.forceActive) {
|
|
2259
|
+
const tabIndex = tabs.findIndex(tab => tab.id === activatePanelEvent.panelId);
|
|
2260
|
+
if (tabIndex !== -1) {
|
|
2261
|
+
setActiveTabIndex(tabIndex);
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
});
|
|
2265
|
+
return () => {
|
|
2266
|
+
activatePanelSubscription.unsubscribe();
|
|
2267
|
+
};
|
|
2268
|
+
}
|
|
2269
|
+
}, [tabs, hasBeenOpened, panelService]);
|
|
2270
|
+
return /*#__PURE__*/react.createElement(ui_src/* SidePanel */.hs, {
|
|
2271
|
+
side: side,
|
|
2272
|
+
className: className,
|
|
2273
|
+
activeTabIndex: activeTabIndex,
|
|
2274
|
+
tabs: tabs,
|
|
2275
|
+
onOpen: () => {
|
|
2276
|
+
setHasBeenOpened(true);
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
};
|
|
2280
|
+
/* harmony default export */ const Components_SidePanelWithServices = (SidePanelWithServices);
|
|
2263
2281
|
;// CONCATENATED MODULE: ../../../extensions/default/src/ViewerLayout/index.tsx
|
|
2264
2282
|
|
|
2265
2283
|
|
|
@@ -2267,6 +2285,7 @@ function ViewerHeader(_ref) {
|
|
|
2267
2285
|
|
|
2268
2286
|
|
|
2269
2287
|
|
|
2288
|
+
|
|
2270
2289
|
function ViewerLayout(_ref) {
|
|
2271
2290
|
let {
|
|
2272
2291
|
// From Extension Module Params
|
|
@@ -2304,7 +2323,7 @@ function ViewerLayout(_ref) {
|
|
|
2304
2323
|
const getComponent = id => {
|
|
2305
2324
|
const entry = extensionManager.getModuleEntry(id);
|
|
2306
2325
|
if (!entry) {
|
|
2307
|
-
throw new Error(`${id} is not
|
|
2326
|
+
throw new Error(`${id} is not valid for an extension module. Please verify your configuration or ensure that the extension is properly registered. It's also possible that your mode is utilizing a module from an extension that hasn't been included in its dependencies (add the extension to the "extensionDependencies" array in your mode's index.js file)`);
|
|
2308
2327
|
}
|
|
2309
2328
|
let content;
|
|
2310
2329
|
if (entry && entry.component) {
|
|
@@ -2370,7 +2389,7 @@ function ViewerLayout(_ref) {
|
|
|
2370
2389
|
className: "h-full w-full bg-black"
|
|
2371
2390
|
}), leftPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
|
|
2372
2391
|
context: "Left Panel"
|
|
2373
|
-
}, /*#__PURE__*/react.createElement(
|
|
2392
|
+
}, /*#__PURE__*/react.createElement(Components_SidePanelWithServices, {
|
|
2374
2393
|
side: "left",
|
|
2375
2394
|
activeTabIndex: leftPanelDefaultClosed ? null : 0,
|
|
2376
2395
|
tabs: leftPanelComponents,
|
|
@@ -2387,7 +2406,7 @@ function ViewerLayout(_ref) {
|
|
|
2387
2406
|
commandsManager: commandsManager
|
|
2388
2407
|
})))), rightPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
|
|
2389
2408
|
context: "Right Panel"
|
|
2390
|
-
}, /*#__PURE__*/react.createElement(
|
|
2409
|
+
}, /*#__PURE__*/react.createElement(Components_SidePanelWithServices, {
|
|
2391
2410
|
side: "right",
|
|
2392
2411
|
activeTabIndex: rightPanelDefaultClosed ? null : 0,
|
|
2393
2412
|
tabs: rightPanelComponents,
|
|
@@ -2549,8 +2568,7 @@ function PanelStudyBrowser(_ref) {
|
|
|
2549
2568
|
});
|
|
2550
2569
|
}
|
|
2551
2570
|
StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));
|
|
2552
|
-
|
|
2553
|
-
}, [StudyInstanceUIDs, getStudiesForPatientByMRN]);
|
|
2571
|
+
}, [StudyInstanceUIDs, dataSource, getStudiesForPatientByMRN, navigate]);
|
|
2554
2572
|
|
|
2555
2573
|
// // ~~ Initial Thumbnails
|
|
2556
2574
|
(0,react.useEffect)(() => {
|
|
@@ -2562,24 +2580,25 @@ function PanelStudyBrowser(_ref) {
|
|
|
2562
2580
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
|
2563
2581
|
|
|
2564
2582
|
// TODO: Is it okay that imageIds are not returned here for SR displaySets?
|
|
2565
|
-
if (imageId
|
|
2566
|
-
|
|
2567
|
-
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);
|
|
2568
|
-
if (isMounted.current) {
|
|
2569
|
-
setThumbnailImageSrcMap(prevState => {
|
|
2570
|
-
return {
|
|
2571
|
-
...prevState,
|
|
2572
|
-
...newImageSrcEntry
|
|
2573
|
-
};
|
|
2574
|
-
});
|
|
2575
|
-
}
|
|
2583
|
+
if (!imageId || displaySet?.unsupported) {
|
|
2584
|
+
return;
|
|
2576
2585
|
}
|
|
2586
|
+
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
|
2587
|
+
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);
|
|
2588
|
+
if (!isMounted.current) {
|
|
2589
|
+
return;
|
|
2590
|
+
}
|
|
2591
|
+
setThumbnailImageSrcMap(prevState => {
|
|
2592
|
+
return {
|
|
2593
|
+
...prevState,
|
|
2594
|
+
...newImageSrcEntry
|
|
2595
|
+
};
|
|
2596
|
+
});
|
|
2577
2597
|
});
|
|
2578
2598
|
return () => {
|
|
2579
2599
|
isMounted.current = false;
|
|
2580
2600
|
};
|
|
2581
|
-
|
|
2582
|
-
}, []);
|
|
2601
|
+
}, [StudyInstanceUIDs, dataSource, displaySetService, getImageSrc]);
|
|
2583
2602
|
|
|
2584
2603
|
// ~~ displaySets
|
|
2585
2604
|
(0,react.useEffect)(() => {
|
|
@@ -2588,40 +2607,44 @@ function PanelStudyBrowser(_ref) {
|
|
|
2588
2607
|
const mappedDisplaySets = _mapDisplaySets(currentDisplaySets, thumbnailImageSrcMap);
|
|
2589
2608
|
sortStudyInstances(mappedDisplaySets);
|
|
2590
2609
|
setDisplaySets(mappedDisplaySets);
|
|
2591
|
-
|
|
2592
|
-
}, [thumbnailImageSrcMap]);
|
|
2610
|
+
}, [StudyInstanceUIDs, thumbnailImageSrcMap, displaySetService]);
|
|
2593
2611
|
|
|
2594
2612
|
// ~~ subscriptions --> displaySets
|
|
2595
2613
|
(0,react.useEffect)(() => {
|
|
2596
2614
|
// DISPLAY_SETS_ADDED returns an array of DisplaySets that were added
|
|
2597
2615
|
const SubscriptionDisplaySetsAdded = displaySetService.subscribe(displaySetService.EVENTS.DISPLAY_SETS_ADDED, data => {
|
|
2598
2616
|
const {
|
|
2599
|
-
displaySetsAdded
|
|
2617
|
+
displaySetsAdded,
|
|
2618
|
+
options
|
|
2600
2619
|
} = data;
|
|
2601
2620
|
displaySetsAdded.forEach(async dSet => {
|
|
2602
2621
|
const newImageSrcEntry = {};
|
|
2603
2622
|
const displaySet = displaySetService.getDisplaySetByUID(dSet.displaySetInstanceUID);
|
|
2604
|
-
if (
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
setThumbnailImageSrcMap(prevState => {
|
|
2614
|
-
return {
|
|
2615
|
-
...prevState,
|
|
2616
|
-
...newImageSrcEntry
|
|
2617
|
-
};
|
|
2618
|
-
});
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2623
|
+
if (displaySet?.unsupported) {
|
|
2624
|
+
return;
|
|
2625
|
+
}
|
|
2626
|
+
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
|
2627
|
+
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
|
2628
|
+
|
|
2629
|
+
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
|
2630
|
+
if (!imageId) {
|
|
2631
|
+
return;
|
|
2621
2632
|
}
|
|
2633
|
+
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
|
2634
|
+
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId, dSet.initialViewport);
|
|
2635
|
+
setThumbnailImageSrcMap(prevState => {
|
|
2636
|
+
return {
|
|
2637
|
+
...prevState,
|
|
2638
|
+
...newImageSrcEntry
|
|
2639
|
+
};
|
|
2640
|
+
});
|
|
2622
2641
|
});
|
|
2623
2642
|
});
|
|
2624
|
-
|
|
2643
|
+
return () => {
|
|
2644
|
+
SubscriptionDisplaySetsAdded.unsubscribe();
|
|
2645
|
+
};
|
|
2646
|
+
}, [getImageSrc, dataSource, displaySetService]);
|
|
2647
|
+
(0,react.useEffect)(() => {
|
|
2625
2648
|
// TODO: Will this always hold _all_ the displaySets we care about?
|
|
2626
2649
|
// DISPLAY_SETS_CHANGED returns `DisplaySerService.activeDisplaySets`
|
|
2627
2650
|
const SubscriptionDisplaySetsChanged = displaySetService.subscribe(displaySetService.EVENTS.DISPLAY_SETS_CHANGED, changedDisplaySets => {
|
|
@@ -2633,12 +2656,10 @@ function PanelStudyBrowser(_ref) {
|
|
|
2633
2656
|
setDisplaySets(mappedDisplaySets);
|
|
2634
2657
|
});
|
|
2635
2658
|
return () => {
|
|
2636
|
-
SubscriptionDisplaySetsAdded.unsubscribe();
|
|
2637
2659
|
SubscriptionDisplaySetsChanged.unsubscribe();
|
|
2638
2660
|
SubscriptionDisplaySetMetaDataInvalidated.unsubscribe();
|
|
2639
2661
|
};
|
|
2640
|
-
|
|
2641
|
-
}, []);
|
|
2662
|
+
}, [StudyInstanceUIDs, thumbnailImageSrcMap, displaySetService]);
|
|
2642
2663
|
const tabs = _createStudyBrowserTabs(StudyInstanceUIDs, studyDisplayList, displaySets);
|
|
2643
2664
|
|
|
2644
2665
|
// TODO: Should not fire this on "close"
|
|
@@ -2899,7 +2920,7 @@ function ActionButtons(_ref) {
|
|
|
2899
2920
|
const {
|
|
2900
2921
|
t
|
|
2901
2922
|
} = (0,es/* useTranslation */.$G)('MeasurementTable');
|
|
2902
|
-
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ui_src/*
|
|
2923
|
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ui_src/* LegacyButtonGroup */.HO, {
|
|
2903
2924
|
color: "black",
|
|
2904
2925
|
size: "inherit"
|
|
2905
2926
|
}, /*#__PURE__*/react.createElement(ui_src/* LegacyButton */.mN, {
|
|
@@ -3007,11 +3028,11 @@ function createReportDialogPrompt(uiDialogService, _ref) {
|
|
|
3007
3028
|
actions: [{
|
|
3008
3029
|
id: 'cancel',
|
|
3009
3030
|
text: 'Cancel',
|
|
3010
|
-
type: ui_src/* ButtonEnums.type */.LZ.
|
|
3031
|
+
type: ui_src/* ButtonEnums.type */.LZ.dt.secondary
|
|
3011
3032
|
}, {
|
|
3012
3033
|
id: 'save',
|
|
3013
3034
|
text: 'Save',
|
|
3014
|
-
type: ui_src/* ButtonEnums.type */.LZ.
|
|
3035
|
+
type: ui_src/* ButtonEnums.type */.LZ.dt.primary
|
|
3015
3036
|
}],
|
|
3016
3037
|
// TODO: Should be on button press...
|
|
3017
3038
|
onSubmit: _handleFormSubmit,
|
|
@@ -3074,12 +3095,13 @@ function createReportDialogPrompt(uiDialogService, _ref) {
|
|
|
3074
3095
|
/**
|
|
3075
3096
|
*
|
|
3076
3097
|
* @param {*} servicesManager
|
|
3077
|
-
* @param {*} dataSource
|
|
3078
|
-
* @param {*} measurements
|
|
3079
|
-
* @param {*} options
|
|
3080
|
-
* @returns {string[]} displaySetInstanceUIDs
|
|
3081
3098
|
*/
|
|
3082
|
-
async function createReportAsync(
|
|
3099
|
+
async function createReportAsync(_ref) {
|
|
3100
|
+
let {
|
|
3101
|
+
servicesManager,
|
|
3102
|
+
getReport,
|
|
3103
|
+
reportType = 'measurement'
|
|
3104
|
+
} = _ref;
|
|
3083
3105
|
const {
|
|
3084
3106
|
displaySetService,
|
|
3085
3107
|
uiNotificationService,
|
|
@@ -3089,32 +3111,27 @@ async function createReportAsync(servicesManager, commandsManager, dataSource, m
|
|
|
3089
3111
|
showOverlay: true,
|
|
3090
3112
|
isDraggable: false,
|
|
3091
3113
|
centralize: true,
|
|
3092
|
-
// TODO: Create a loading indicator component + zeplin design?
|
|
3093
3114
|
content: Loading
|
|
3094
3115
|
});
|
|
3095
3116
|
try {
|
|
3096
|
-
const naturalizedReport = await
|
|
3097
|
-
measurementData: measurements,
|
|
3098
|
-
dataSource,
|
|
3099
|
-
additionalFindingTypes: ['ArrowAnnotate'],
|
|
3100
|
-
options
|
|
3101
|
-
}, 'CORNERSTONE_STRUCTURED_REPORT');
|
|
3117
|
+
const naturalizedReport = await getReport();
|
|
3102
3118
|
|
|
3103
3119
|
// The "Mode" route listens for DicomMetadataStore changes
|
|
3104
3120
|
// When a new instance is added, it listens and
|
|
3105
3121
|
// automatically calls makeDisplaySets
|
|
3106
3122
|
src.DicomMetadataStore.addInstances([naturalizedReport], true);
|
|
3107
|
-
const
|
|
3123
|
+
const displaySet = displaySetService.getMostRecentDisplaySet();
|
|
3124
|
+
const displaySetInstanceUID = displaySet.displaySetInstanceUID;
|
|
3108
3125
|
uiNotificationService.show({
|
|
3109
3126
|
title: 'Create Report',
|
|
3110
|
-
message:
|
|
3127
|
+
message: `${reportType} saved successfully`,
|
|
3111
3128
|
type: 'success'
|
|
3112
3129
|
});
|
|
3113
3130
|
return [displaySetInstanceUID];
|
|
3114
3131
|
} catch (error) {
|
|
3115
3132
|
uiNotificationService.show({
|
|
3116
3133
|
title: 'Create Report',
|
|
3117
|
-
message: error.message ||
|
|
3134
|
+
message: error.message || `Failed to store ${reportType}`,
|
|
3118
3135
|
type: 'error'
|
|
3119
3136
|
});
|
|
3120
3137
|
} finally {
|
|
@@ -3276,7 +3293,18 @@ function PanelMeasurementTable(_ref) {
|
|
|
3276
3293
|
// Reuse an existing series having the same series description to avoid
|
|
3277
3294
|
// creating too many series instances.
|
|
3278
3295
|
const options = findSRWithSameSeriesDescription(SeriesDescription, displaySetService);
|
|
3279
|
-
|
|
3296
|
+
const getReport = async () => {
|
|
3297
|
+
return commandsManager.runCommand('storeMeasurements', {
|
|
3298
|
+
measurementData: trackedMeasurements,
|
|
3299
|
+
dataSource,
|
|
3300
|
+
additionalFindingTypes: ['ArrowAnnotate'],
|
|
3301
|
+
options
|
|
3302
|
+
}, 'CORNERSTONE_STRUCTURED_REPORT');
|
|
3303
|
+
};
|
|
3304
|
+
return Actions_createReportAsync({
|
|
3305
|
+
servicesManager,
|
|
3306
|
+
getReport
|
|
3307
|
+
});
|
|
3280
3308
|
}
|
|
3281
3309
|
}
|
|
3282
3310
|
const jumpToImage = _ref2 => {
|
|
@@ -3366,11 +3394,11 @@ function PanelMeasurementTable(_ref) {
|
|
|
3366
3394
|
actions: [{
|
|
3367
3395
|
id: 'cancel',
|
|
3368
3396
|
text: 'Cancel',
|
|
3369
|
-
type: ui_src/* ButtonEnums.type */.LZ.
|
|
3397
|
+
type: ui_src/* ButtonEnums.type */.LZ.dt.secondary
|
|
3370
3398
|
}, {
|
|
3371
3399
|
id: 'save',
|
|
3372
3400
|
text: 'Save',
|
|
3373
|
-
type: ui_src/* ButtonEnums.type */.LZ.
|
|
3401
|
+
type: ui_src/* ButtonEnums.type */.LZ.dt.primary
|
|
3374
3402
|
}],
|
|
3375
3403
|
onSubmit: onSubmitHandler
|
|
3376
3404
|
}
|
|
@@ -3463,6 +3491,7 @@ function _mapMeasurementToDisplay(measurement, index, types) {
|
|
|
3463
3491
|
|
|
3464
3492
|
|
|
3465
3493
|
|
|
3494
|
+
|
|
3466
3495
|
;// CONCATENATED MODULE: ../../../extensions/default/src/getPanelModule.tsx
|
|
3467
3496
|
|
|
3468
3497
|
|
|
@@ -3487,7 +3516,7 @@ function getPanelModule(_ref) {
|
|
|
3487
3516
|
};
|
|
3488
3517
|
return [{
|
|
3489
3518
|
name: 'seriesList',
|
|
3490
|
-
iconName: '
|
|
3519
|
+
iconName: 'tab-studies',
|
|
3491
3520
|
iconLabel: 'Studies',
|
|
3492
3521
|
label: 'Studies',
|
|
3493
3522
|
component: Panels_WrappedPanelStudyBrowser.bind(null, {
|
|
@@ -3987,40 +4016,49 @@ function ToolbarDivider() {
|
|
|
3987
4016
|
});
|
|
3988
4017
|
}
|
|
3989
4018
|
;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/ToolbarLayoutSelector.tsx
|
|
4019
|
+
function ToolbarLayoutSelector_extends() { ToolbarLayoutSelector_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ToolbarLayoutSelector_extends.apply(this, arguments); }
|
|
3990
4020
|
|
|
3991
4021
|
|
|
3992
4022
|
|
|
3993
4023
|
|
|
3994
|
-
function
|
|
4024
|
+
function ToolbarLayoutSelectorWithServices(_ref) {
|
|
3995
4025
|
let {
|
|
3996
|
-
rows,
|
|
3997
|
-
columns,
|
|
3998
|
-
className,
|
|
3999
4026
|
servicesManager,
|
|
4000
|
-
...
|
|
4027
|
+
...props
|
|
4001
4028
|
} = _ref;
|
|
4002
|
-
const [isOpen, setIsOpen] = (0,react.useState)(false);
|
|
4003
4029
|
const {
|
|
4004
|
-
hangingProtocolService,
|
|
4005
4030
|
toolbarService
|
|
4006
4031
|
} = servicesManager.services;
|
|
4032
|
+
const onSelection = (0,react.useCallback)(props => {
|
|
4033
|
+
toolbarService.recordInteraction({
|
|
4034
|
+
interactionType: 'action',
|
|
4035
|
+
commands: [{
|
|
4036
|
+
commandName: 'setViewportGridLayout',
|
|
4037
|
+
commandOptions: {
|
|
4038
|
+
...props
|
|
4039
|
+
},
|
|
4040
|
+
context: 'DEFAULT'
|
|
4041
|
+
}]
|
|
4042
|
+
});
|
|
4043
|
+
}, [toolbarService]);
|
|
4044
|
+
return /*#__PURE__*/react.createElement(LayoutSelector, ToolbarLayoutSelector_extends({}, props, {
|
|
4045
|
+
onSelection: onSelection
|
|
4046
|
+
}));
|
|
4047
|
+
}
|
|
4048
|
+
function LayoutSelector(_ref2) {
|
|
4049
|
+
let {
|
|
4050
|
+
rows,
|
|
4051
|
+
columns,
|
|
4052
|
+
className,
|
|
4053
|
+
onSelection,
|
|
4054
|
+
...rest
|
|
4055
|
+
} = _ref2;
|
|
4056
|
+
const [isOpen, setIsOpen] = (0,react.useState)(false);
|
|
4007
4057
|
const closeOnOutsideClick = () => {
|
|
4008
4058
|
if (isOpen) {
|
|
4009
4059
|
setIsOpen(false);
|
|
4010
4060
|
}
|
|
4011
4061
|
};
|
|
4012
|
-
(0,react.useEffect)(() => {
|
|
4013
|
-
const {
|
|
4014
|
-
unsubscribe
|
|
4015
|
-
} = hangingProtocolService.subscribe(hangingProtocolService.EVENTS.PROTOCOL_CHANGED, evt => {
|
|
4016
|
-
const {
|
|
4017
|
-
protocol
|
|
4018
|
-
} = evt;
|
|
4019
|
-
});
|
|
4020
|
-
return () => {
|
|
4021
|
-
unsubscribe();
|
|
4022
|
-
};
|
|
4023
|
-
}, [hangingProtocolService]);
|
|
4024
4062
|
(0,react.useEffect)(() => {
|
|
4025
4063
|
window.addEventListener('click', closeOnOutsideClick);
|
|
4026
4064
|
return () => {
|
|
@@ -4029,18 +4067,6 @@ function LayoutSelector(_ref) {
|
|
|
4029
4067
|
}, [isOpen]);
|
|
4030
4068
|
const onInteractionHandler = () => setIsOpen(!isOpen);
|
|
4031
4069
|
const DropdownContent = isOpen ? ui_src/* LayoutSelector */.OF : null;
|
|
4032
|
-
const onSelectionHandler = props => {
|
|
4033
|
-
toolbarService.recordInteraction({
|
|
4034
|
-
interactionType: 'action',
|
|
4035
|
-
commands: [{
|
|
4036
|
-
commandName: 'setViewportGridLayout',
|
|
4037
|
-
commandOptions: {
|
|
4038
|
-
...props
|
|
4039
|
-
},
|
|
4040
|
-
context: 'DEFAULT'
|
|
4041
|
-
}]
|
|
4042
|
-
});
|
|
4043
|
-
};
|
|
4044
4070
|
return /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.hA, {
|
|
4045
4071
|
id: "Layout",
|
|
4046
4072
|
label: "Grid Layout",
|
|
@@ -4051,7 +4077,7 @@ function LayoutSelector(_ref) {
|
|
|
4051
4077
|
dropdownContent: DropdownContent !== null && /*#__PURE__*/react.createElement(DropdownContent, {
|
|
4052
4078
|
rows: rows,
|
|
4053
4079
|
columns: columns,
|
|
4054
|
-
onSelection:
|
|
4080
|
+
onSelection: onSelection
|
|
4055
4081
|
}),
|
|
4056
4082
|
isActive: isOpen,
|
|
4057
4083
|
type: "toggle"
|
|
@@ -4068,10 +4094,238 @@ LayoutSelector.defaultProps = {
|
|
|
4068
4094
|
columns: 3,
|
|
4069
4095
|
onLayoutChange: () => {}
|
|
4070
4096
|
};
|
|
4071
|
-
/* harmony default export */ const ToolbarLayoutSelector = (
|
|
4072
|
-
;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/
|
|
4097
|
+
/* harmony default export */ const ToolbarLayoutSelector = (ToolbarLayoutSelectorWithServices);
|
|
4098
|
+
;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/ToolbarSplitButtonWithServices.tsx
|
|
4099
|
+
function ToolbarSplitButtonWithServices_extends() { ToolbarSplitButtonWithServices_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ToolbarSplitButtonWithServices_extends.apply(this, arguments); }
|
|
4100
|
+
|
|
4073
4101
|
|
|
4074
|
-
|
|
4102
|
+
|
|
4103
|
+
|
|
4104
|
+
function ToolbarSplitButtonWithServices(_ref) {
|
|
4105
|
+
let {
|
|
4106
|
+
isRadio,
|
|
4107
|
+
isAction,
|
|
4108
|
+
groupId,
|
|
4109
|
+
primary,
|
|
4110
|
+
secondary,
|
|
4111
|
+
items,
|
|
4112
|
+
renderer,
|
|
4113
|
+
onInteraction,
|
|
4114
|
+
servicesManager
|
|
4115
|
+
} = _ref;
|
|
4116
|
+
const {
|
|
4117
|
+
toolbarService
|
|
4118
|
+
} = servicesManager?.services;
|
|
4119
|
+
const handleItemClick = (item, index) => {
|
|
4120
|
+
const {
|
|
4121
|
+
id,
|
|
4122
|
+
type,
|
|
4123
|
+
commands
|
|
4124
|
+
} = item;
|
|
4125
|
+
onInteraction({
|
|
4126
|
+
groupId,
|
|
4127
|
+
itemId: id,
|
|
4128
|
+
interactionType: type,
|
|
4129
|
+
commands
|
|
4130
|
+
});
|
|
4131
|
+
setState(state => ({
|
|
4132
|
+
...state,
|
|
4133
|
+
primary: !isAction && isRadio ? {
|
|
4134
|
+
...item,
|
|
4135
|
+
index
|
|
4136
|
+
} : state.primary,
|
|
4137
|
+
isExpanded: false,
|
|
4138
|
+
items: getSplitButtonItems(items).filter(item => isRadio && !isAction ? item.index !== index : true)
|
|
4139
|
+
}));
|
|
4140
|
+
};
|
|
4141
|
+
|
|
4142
|
+
/* Bubbles up individual item clicks */
|
|
4143
|
+
const getSplitButtonItems = items => items.map((item, index) => ({
|
|
4144
|
+
...item,
|
|
4145
|
+
index,
|
|
4146
|
+
onClick: () => handleItemClick(item, index)
|
|
4147
|
+
}));
|
|
4148
|
+
const [buttonsState, setButtonState] = (0,react.useState)({
|
|
4149
|
+
primaryToolId: '',
|
|
4150
|
+
toggles: {},
|
|
4151
|
+
groups: {}
|
|
4152
|
+
});
|
|
4153
|
+
const [state, setState] = (0,react.useState)({
|
|
4154
|
+
primary,
|
|
4155
|
+
items: getSplitButtonItems(items).filter(item => isRadio && !isAction ? item.id !== primary.id : true)
|
|
4156
|
+
});
|
|
4157
|
+
const {
|
|
4158
|
+
primaryToolId,
|
|
4159
|
+
toggles
|
|
4160
|
+
} = buttonsState;
|
|
4161
|
+
const isPrimaryToggle = state.primary.type === 'toggle';
|
|
4162
|
+
const isPrimaryActive = state.primary.type === 'tool' && primaryToolId === state.primary.id || isPrimaryToggle && toggles[state.primary.id] === true;
|
|
4163
|
+
const PrimaryButtonComponent = toolbarService?.getButtonComponentForUIType(state.primary.uiType) ?? ui_src/* ToolbarButton */.hA;
|
|
4164
|
+
(0,react.useEffect)(() => {
|
|
4165
|
+
const {
|
|
4166
|
+
unsubscribe
|
|
4167
|
+
} = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED, state => {
|
|
4168
|
+
setButtonState({
|
|
4169
|
+
...state
|
|
4170
|
+
});
|
|
4171
|
+
});
|
|
4172
|
+
return () => {
|
|
4173
|
+
unsubscribe();
|
|
4174
|
+
};
|
|
4175
|
+
}, [toolbarService]);
|
|
4176
|
+
const updatedItems = state.items.map(item => {
|
|
4177
|
+
const isActive = item.type === 'tool' && primaryToolId === item.id;
|
|
4178
|
+
|
|
4179
|
+
// We could have added the
|
|
4180
|
+
// item.type === 'toggle' && toggles[item.id] === true
|
|
4181
|
+
// too but that makes the button active when the toggle is active under it
|
|
4182
|
+
// which feels weird
|
|
4183
|
+
return {
|
|
4184
|
+
...item,
|
|
4185
|
+
isActive
|
|
4186
|
+
};
|
|
4187
|
+
});
|
|
4188
|
+
const DefaultListItemRenderer = _ref2 => {
|
|
4189
|
+
let {
|
|
4190
|
+
type,
|
|
4191
|
+
icon,
|
|
4192
|
+
label,
|
|
4193
|
+
t,
|
|
4194
|
+
id
|
|
4195
|
+
} = _ref2;
|
|
4196
|
+
const isActive = type === 'toggle' && toggles[id] === true;
|
|
4197
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
4198
|
+
className: classnames_default()('hover:bg-primary-dark flex h-8 w-full flex-row items-center p-3', 'whitespace-pre text-base', isActive && 'bg-primary-dark', isActive ? 'text-[#348CFD]' : 'text-common-bright hover:bg-primary-dark hover:text-primary-light')
|
|
4199
|
+
}, icon && /*#__PURE__*/react.createElement("span", {
|
|
4200
|
+
className: "mr-4"
|
|
4201
|
+
}, /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
|
|
4202
|
+
name: icon,
|
|
4203
|
+
className: "h-5 w-5"
|
|
4204
|
+
})), /*#__PURE__*/react.createElement("span", {
|
|
4205
|
+
className: "mr-5"
|
|
4206
|
+
}, t(label)));
|
|
4207
|
+
};
|
|
4208
|
+
const listItemRenderer = renderer || DefaultListItemRenderer;
|
|
4209
|
+
return /*#__PURE__*/react.createElement(ui_src/* SplitButton */.aW, {
|
|
4210
|
+
isRadio: isRadio,
|
|
4211
|
+
isAction: isAction,
|
|
4212
|
+
primary: state.primary,
|
|
4213
|
+
secondary: secondary,
|
|
4214
|
+
items: updatedItems,
|
|
4215
|
+
groupId: groupId,
|
|
4216
|
+
renderer: listItemRenderer,
|
|
4217
|
+
isActive: isPrimaryActive || updatedItems.some(item => item.isActive),
|
|
4218
|
+
isToggle: isPrimaryToggle,
|
|
4219
|
+
onInteraction: onInteraction,
|
|
4220
|
+
Component: props => /*#__PURE__*/react.createElement(PrimaryButtonComponent, ToolbarSplitButtonWithServices_extends({}, props, {
|
|
4221
|
+
servicesManager: servicesManager
|
|
4222
|
+
}))
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4225
|
+
ToolbarSplitButtonWithServices.propTypes = {
|
|
4226
|
+
isRadio: (prop_types_default()).bool,
|
|
4227
|
+
isAction: (prop_types_default()).bool,
|
|
4228
|
+
groupId: (prop_types_default()).string,
|
|
4229
|
+
primary: prop_types_default().shape({
|
|
4230
|
+
id: (prop_types_default()).string.isRequired,
|
|
4231
|
+
type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
|
|
4232
|
+
uiType: (prop_types_default()).string
|
|
4233
|
+
}),
|
|
4234
|
+
secondary: prop_types_default().shape({
|
|
4235
|
+
id: (prop_types_default()).string,
|
|
4236
|
+
icon: (prop_types_default()).string.isRequired,
|
|
4237
|
+
label: (prop_types_default()).string,
|
|
4238
|
+
tooltip: (prop_types_default()).string.isRequired,
|
|
4239
|
+
isActive: (prop_types_default()).bool
|
|
4240
|
+
}),
|
|
4241
|
+
items: prop_types_default().arrayOf(prop_types_default().shape({
|
|
4242
|
+
id: (prop_types_default()).string.isRequired,
|
|
4243
|
+
type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
|
|
4244
|
+
icon: (prop_types_default()).string,
|
|
4245
|
+
label: (prop_types_default()).string,
|
|
4246
|
+
tooltip: (prop_types_default()).string
|
|
4247
|
+
})),
|
|
4248
|
+
renderer: (prop_types_default()).func,
|
|
4249
|
+
onInteraction: (prop_types_default()).func.isRequired,
|
|
4250
|
+
servicesManager: prop_types_default().shape({
|
|
4251
|
+
services: prop_types_default().shape({
|
|
4252
|
+
toolbarService: (prop_types_default()).object
|
|
4253
|
+
})
|
|
4254
|
+
})
|
|
4255
|
+
};
|
|
4256
|
+
ToolbarSplitButtonWithServices.defaultProps = {
|
|
4257
|
+
isRadio: false,
|
|
4258
|
+
isAction: false
|
|
4259
|
+
};
|
|
4260
|
+
/* harmony default export */ const Toolbar_ToolbarSplitButtonWithServices = (ToolbarSplitButtonWithServices);
|
|
4261
|
+
;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/ToolbarButtonWithServices.tsx
|
|
4262
|
+
function ToolbarButtonWithServices_extends() { ToolbarButtonWithServices_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ToolbarButtonWithServices_extends.apply(this, arguments); }
|
|
4263
|
+
|
|
4264
|
+
|
|
4265
|
+
|
|
4266
|
+
function ToolbarButtonWithServices(_ref) {
|
|
4267
|
+
let {
|
|
4268
|
+
id,
|
|
4269
|
+
type,
|
|
4270
|
+
commands,
|
|
4271
|
+
onInteraction,
|
|
4272
|
+
servicesManager,
|
|
4273
|
+
...props
|
|
4274
|
+
} = _ref;
|
|
4275
|
+
const {
|
|
4276
|
+
toolbarService
|
|
4277
|
+
} = servicesManager?.services || {};
|
|
4278
|
+
const [buttonsState, setButtonState] = (0,react.useState)({
|
|
4279
|
+
primaryToolId: '',
|
|
4280
|
+
toggles: {},
|
|
4281
|
+
groups: {}
|
|
4282
|
+
});
|
|
4283
|
+
const {
|
|
4284
|
+
primaryToolId
|
|
4285
|
+
} = buttonsState;
|
|
4286
|
+
const isActive = type === 'tool' && id === primaryToolId || type === 'toggle' && buttonsState.toggles[id] === true;
|
|
4287
|
+
(0,react.useEffect)(() => {
|
|
4288
|
+
const {
|
|
4289
|
+
unsubscribe
|
|
4290
|
+
} = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED, state => {
|
|
4291
|
+
setButtonState({
|
|
4292
|
+
...state
|
|
4293
|
+
});
|
|
4294
|
+
});
|
|
4295
|
+
return () => {
|
|
4296
|
+
unsubscribe();
|
|
4297
|
+
};
|
|
4298
|
+
}, [toolbarService]);
|
|
4299
|
+
return /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.hA, ToolbarButtonWithServices_extends({
|
|
4300
|
+
commands: commands,
|
|
4301
|
+
id: id,
|
|
4302
|
+
type: type,
|
|
4303
|
+
isActive: isActive,
|
|
4304
|
+
onInteraction: onInteraction
|
|
4305
|
+
}, props));
|
|
4306
|
+
}
|
|
4307
|
+
ToolbarButtonWithServices.propTypes = {
|
|
4308
|
+
id: (prop_types_default()).string.isRequired,
|
|
4309
|
+
type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
|
|
4310
|
+
commands: prop_types_default().arrayOf(prop_types_default().shape({
|
|
4311
|
+
commandName: (prop_types_default()).string.isRequired,
|
|
4312
|
+
context: (prop_types_default()).string
|
|
4313
|
+
})),
|
|
4314
|
+
onInteraction: (prop_types_default()).func.isRequired,
|
|
4315
|
+
servicesManager: prop_types_default().shape({
|
|
4316
|
+
services: prop_types_default().shape({
|
|
4317
|
+
toolbarService: prop_types_default().shape({
|
|
4318
|
+
subscribe: (prop_types_default()).func.isRequired,
|
|
4319
|
+
state: prop_types_default().shape({
|
|
4320
|
+
primaryToolId: (prop_types_default()).string,
|
|
4321
|
+
toggles: prop_types_default().objectOf((prop_types_default()).bool),
|
|
4322
|
+
groups: prop_types_default().objectOf((prop_types_default()).object)
|
|
4323
|
+
}).isRequired
|
|
4324
|
+
}).isRequired
|
|
4325
|
+
}).isRequired
|
|
4326
|
+
}).isRequired
|
|
4327
|
+
};
|
|
4328
|
+
/* harmony default export */ const Toolbar_ToolbarButtonWithServices = (ToolbarButtonWithServices);
|
|
4075
4329
|
;// CONCATENATED MODULE: ../../../extensions/default/src/getToolbarModule.tsx
|
|
4076
4330
|
|
|
4077
4331
|
|
|
@@ -4088,15 +4342,15 @@ function getToolbarModule(_ref) {
|
|
|
4088
4342
|
clickHandler: () => {}
|
|
4089
4343
|
}, {
|
|
4090
4344
|
name: 'ohif.action',
|
|
4091
|
-
defaultComponent:
|
|
4345
|
+
defaultComponent: Toolbar_ToolbarButtonWithServices,
|
|
4092
4346
|
clickHandler: () => {}
|
|
4093
4347
|
}, {
|
|
4094
4348
|
name: 'ohif.radioGroup',
|
|
4095
|
-
defaultComponent:
|
|
4349
|
+
defaultComponent: Toolbar_ToolbarButtonWithServices,
|
|
4096
4350
|
clickHandler: () => {}
|
|
4097
4351
|
}, {
|
|
4098
4352
|
name: 'ohif.splitButton',
|
|
4099
|
-
defaultComponent:
|
|
4353
|
+
defaultComponent: Toolbar_ToolbarSplitButtonWithServices,
|
|
4100
4354
|
clickHandler: () => {}
|
|
4101
4355
|
}, {
|
|
4102
4356
|
name: 'ohif.layoutSelector',
|
|
@@ -4104,7 +4358,7 @@ function getToolbarModule(_ref) {
|
|
|
4104
4358
|
clickHandler: (evt, clickedBtn, btnSectionName) => {}
|
|
4105
4359
|
}, {
|
|
4106
4360
|
name: 'ohif.toggle',
|
|
4107
|
-
defaultComponent:
|
|
4361
|
+
defaultComponent: Toolbar_ToolbarButtonWithServices,
|
|
4108
4362
|
clickHandler: () => {}
|
|
4109
4363
|
}];
|
|
4110
4364
|
}
|
|
@@ -6327,7 +6581,7 @@ function DataSourceSelector() {
|
|
|
6327
6581
|
}, /*#__PURE__*/react.createElement("h1", {
|
|
6328
6582
|
className: "text-white"
|
|
6329
6583
|
}, ds.configuration?.friendlyName || ds.friendlyName), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
|
|
6330
|
-
type: ui_src/* ButtonEnums.type */.LZ.
|
|
6584
|
+
type: ui_src/* ButtonEnums.type */.LZ.dt.primary,
|
|
6331
6585
|
className: classnames_default()('ml-2'),
|
|
6332
6586
|
onClick: () => {
|
|
6333
6587
|
navigate({
|
|
@@ -7101,6 +7355,8 @@ const handlePETImageMetadata = _ref2 => {
|
|
|
7101
7355
|
|
|
7102
7356
|
|
|
7103
7357
|
|
|
7358
|
+
|
|
7359
|
+
|
|
7104
7360
|
const defaultExtension = {
|
|
7105
7361
|
/**
|
|
7106
7362
|
* Only required property. Should be a unique value across all extensions.
|