@jbrowse/core 2.18.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +6 -11
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +16 -17
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +2 -5
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +4 -6
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +5 -7
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +19 -46
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +11 -27
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +2 -4
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +2 -4
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +5 -7
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -34
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +29 -22
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +10 -75
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +5 -23
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +8 -42
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +98 -90
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +18 -53
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +3 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
- package/CorePlugin.js +17 -7
- package/PluginManager.d.ts +2 -1
- package/PluginManager.js +4 -2
- package/ReExports/list.js +3 -0
- package/ReExports/modules.d.ts +4 -2
- package/ReExports/modules.js +29 -19
- package/TextSearch/BaseResults.d.ts +1 -1
- package/assemblyManager/assembly.js +4 -4
- package/configuration/configurationSlot.d.ts +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -4
- package/data_adapters/CytobandAdapter/index.js +20 -7
- package/data_adapters/dataAdapterCache.d.ts +0 -1
- package/data_adapters/dataAdapterCache.js +2 -9
- package/data_adapters/util.d.ts +1 -0
- package/data_adapters/util.js +10 -0
- package/package.json +14 -16
- package/pluggableElementTypes/models/BaseTrackModel.js +9 -5
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +1 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +2 -2
- package/pluggableElementTypes/renderers/RendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/RendererType.js +2 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +1 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +9 -65
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +9 -65
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +3 -3
- package/stories/examples/WithSequencePanel.d.ts +5 -6
- package/stories/examples/WithSequencePanel.js +6 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +1 -2
- package/ui/AppLogo.js +2 -5
- package/ui/AssemblySelector.d.ts +3 -3
- package/ui/AssemblySelector.js +11 -33
- package/ui/BaseTooltip.d.ts +1 -2
- package/ui/BaseTooltip.js +9 -12
- package/ui/CascadingMenu.d.ts +1 -2
- package/ui/CascadingMenu.js +15 -53
- package/ui/CascadingMenuButton.d.ts +1 -2
- package/ui/CascadingMenuButton.js +17 -41
- package/ui/ColorPicker.d.ts +3 -4
- package/ui/ColorPicker.js +33 -31
- package/ui/Dialog.d.ts +1 -2
- package/ui/Dialog.js +13 -21
- package/ui/DraggableDialog.d.ts +5 -0
- package/ui/DraggableDialog.js +32 -0
- package/ui/DropDownMenu.d.ts +1 -2
- package/ui/DropDownMenu.js +8 -34
- package/ui/EditableTypography.d.ts +1 -2
- package/ui/EditableTypography.js +29 -54
- package/ui/ErrorBoundary.d.ts +2 -2
- package/ui/ErrorBoundary.js +3 -25
- package/ui/ErrorMessage.d.ts +1 -2
- package/ui/ErrorMessage.js +25 -25
- package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
- package/ui/ErrorMessageStackTraceDialog.js +11 -44
- package/ui/FactoryResetDialog.d.ts +1 -2
- package/ui/FactoryResetDialog.js +7 -12
- package/ui/FatalErrorDialog.d.ts +1 -2
- package/ui/FatalErrorDialog.js +10 -41
- package/ui/FileSelector/FileSelector.d.ts +1 -2
- package/ui/FileSelector/FileSelector.js +37 -76
- package/ui/FileSelector/LocalFileChooser.d.ts +1 -2
- package/ui/FileSelector/LocalFileChooser.js +17 -28
- package/ui/FileSelector/UrlChooser.d.ts +1 -2
- package/ui/FileSelector/UrlChooser.js +2 -5
- package/ui/Icons.d.ts +9 -10
- package/ui/Icons.js +10 -19
- package/ui/LoadingEllipses.d.ts +1 -2
- package/ui/LoadingEllipses.js +2 -5
- package/ui/Logo.d.ts +2 -3
- package/ui/Logo.js +5 -23
- package/ui/Menu.d.ts +2 -3
- package/ui/Menu.js +83 -113
- package/ui/MenuButton.d.ts +1 -2
- package/ui/MenuButton.js +11 -35
- package/ui/PrerenderedCanvas.d.ts +1 -2
- package/ui/PrerenderedCanvas.js +3 -25
- package/ui/RedErrorMessageBox.d.ts +1 -2
- package/ui/RedErrorMessageBox.js +2 -5
- package/ui/ResizeHandle.d.ts +1 -2
- package/ui/ResizeHandle.js +3 -25
- package/ui/ReturnToImportFormDialog.d.ts +1 -2
- package/ui/ReturnToImportFormDialog.js +7 -12
- package/ui/SanitizedHTML.d.ts +2 -3
- package/ui/SanitizedHTML.js +3 -3
- package/ui/Snackbar.d.ts +1 -2
- package/ui/Snackbar.js +41 -20
- package/ui/SnackbarContents.d.ts +5 -0
- package/ui/SnackbarContents.js +16 -0
- package/ui/SnackbarModel.js +20 -9
- package/ui/colors.js +1 -1
- package/ui/index.d.ts +0 -2
- package/ui/index.js +1 -5
- package/ui/react-colorful.js +17 -7
- package/ui/theme.js +7 -0
- package/util/index.d.ts +13 -11
- package/util/index.js +31 -11
- package/util/io/RemoteFileWithRangeCache.d.ts +3 -5
- package/util/io/RemoteFileWithRangeCache.js +8 -6
- package/util/io/index.d.ts +1 -1
- package/util/io/index.js +3 -3
- package/util/nanoid.d.ts +1 -1
- package/util/offscreenCanvasUtils.d.ts +2 -3
- package/util/offscreenCanvasUtils.js +21 -13
- package/util/tracks.d.ts +1 -1
- package/util/tracks.js +8 -3
- package/util/useMeasure.d.ts +1 -1
package/ui/AppLogo.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AnyConfigurationModel } from '../configuration';
|
|
3
2
|
declare const Logo: ({ session, }: {
|
|
4
3
|
session: {
|
|
5
4
|
configuration: AnyConfigurationModel;
|
|
6
5
|
};
|
|
7
|
-
}) =>
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default Logo;
|
package/ui/AppLogo.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
4
|
const mobx_react_1 = require("mobx-react");
|
|
8
5
|
const configuration_1 = require("../configuration");
|
|
9
6
|
const Logo_1 = require("./Logo");
|
|
10
7
|
const Logo = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
11
8
|
const { configuration } = session;
|
|
12
9
|
const logoPath = (0, configuration_1.readConfObject)(configuration, 'logoPath');
|
|
13
|
-
return (logoPath === null || logoPath === void 0 ? void 0 : logoPath.uri) ? (
|
|
10
|
+
return (logoPath === null || logoPath === void 0 ? void 0 : logoPath.uri) ? ((0, jsx_runtime_1.jsx)("img", { src: logoPath.uri, alt: "Custom logo" })) : ((0, jsx_runtime_1.jsx)(Logo_1.LogoFull, { variant: "white" }));
|
|
14
11
|
});
|
|
15
12
|
exports.default = Logo;
|
package/ui/AssemblySelector.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AbstractSessionModel } from '../util';
|
|
3
2
|
import type { InputProps as IIP, TextFieldProps as TFP } from '@mui/material';
|
|
4
|
-
declare const AssemblySelector: ({ session, onChange, selected, InputProps, TextFieldProps, localStorageKey, helperText, }: {
|
|
3
|
+
declare const AssemblySelector: ({ session, onChange, label, selected, InputProps, TextFieldProps, localStorageKey, helperText, }: {
|
|
5
4
|
session: AbstractSessionModel;
|
|
5
|
+
label?: string;
|
|
6
6
|
helperText?: string;
|
|
7
7
|
onChange: (arg: string) => void;
|
|
8
8
|
selected?: string;
|
|
9
9
|
localStorageKey?: string;
|
|
10
10
|
InputProps?: IIP;
|
|
11
11
|
TextFieldProps?: TFP;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default AssemblySelector;
|
package/ui/AssemblySelector.js
CHANGED
|
@@ -1,40 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
27
5
|
const material_1 = require("@mui/material");
|
|
28
6
|
const mobx_react_1 = require("mobx-react");
|
|
29
7
|
const mui_1 = require("tss-react/mui");
|
|
30
|
-
const configuration_1 = require("../configuration");
|
|
31
8
|
const util_1 = require("../util");
|
|
32
9
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
33
10
|
importFormEntry: {
|
|
34
11
|
minWidth: 180,
|
|
35
12
|
},
|
|
36
13
|
});
|
|
37
|
-
const AssemblySelector = (0, mobx_react_1.observer)(function ({ session, onChange, selected, InputProps, TextFieldProps, localStorageKey, helperText = 'Select assembly to view', }) {
|
|
14
|
+
const AssemblySelector = (0, mobx_react_1.observer)(function ({ session, onChange, label = 'Assembly', selected, InputProps, TextFieldProps, localStorageKey, helperText = 'Select assembly to view', }) {
|
|
38
15
|
const { classes } = useStyles();
|
|
39
16
|
const { assemblyNames, assemblyManager } = session;
|
|
40
17
|
const config = new URLSearchParams(window.location.search).get('config');
|
|
@@ -54,15 +31,16 @@ const AssemblySelector = (0, mobx_react_1.observer)(function ({ session, onChang
|
|
|
54
31
|
}
|
|
55
32
|
}, [selection, onChange, selected]);
|
|
56
33
|
const error = assemblyNames.length ? '' : 'No configured assemblies';
|
|
57
|
-
return (
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, "data-testid": "assembly-selector-textfield", label: label, variant: "outlined", helperText: error || helperText, value: selection || '', onChange: event => {
|
|
58
35
|
setLastSelected(event.target.value);
|
|
59
36
|
}, error: !!error, disabled: !!error, className: classes.importFormEntry, ...TextFieldProps, slotProps: {
|
|
60
37
|
input: InputProps,
|
|
61
|
-
htmlInput: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
38
|
+
htmlInput: {
|
|
39
|
+
'data-testid': 'assembly-selector',
|
|
40
|
+
},
|
|
41
|
+
}, children: assemblyNames.map(name => {
|
|
42
|
+
var _a;
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: name, children: ((_a = assemblyManager.get(name)) === null || _a === void 0 ? void 0 : _a.displayName) || name }, name));
|
|
44
|
+
}) }));
|
|
67
45
|
});
|
|
68
46
|
exports.default = AssemblySelector;
|
package/ui/BaseTooltip.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export default function BaseTooltip({ clientPoint: clientPointCoords, children, placement, }: {
|
|
3
2
|
placement?: 'left' | 'right';
|
|
4
3
|
clientPoint?: {
|
|
@@ -6,4 +5,4 @@ export default function BaseTooltip({ clientPoint: clientPointCoords, children,
|
|
|
6
5
|
y: number;
|
|
7
6
|
};
|
|
8
7
|
children: React.ReactNode;
|
|
9
|
-
}):
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/ui/BaseTooltip.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.default = BaseTooltip;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@floating-ui/react");
|
|
9
6
|
const material_1 = require("@mui/material");
|
|
10
7
|
const mui_1 = require("tss-react/mui");
|
|
11
8
|
function round(value) {
|
|
@@ -20,7 +17,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
20
17
|
color: theme.palette.common.white,
|
|
21
18
|
fontFamily: theme.typography.fontFamily,
|
|
22
19
|
padding: '4px 8px',
|
|
23
|
-
fontSize: theme.typography.
|
|
20
|
+
fontSize: theme.typography.fontSize,
|
|
24
21
|
lineHeight: `${round(14 / 10)}em`,
|
|
25
22
|
maxWidth: 300,
|
|
26
23
|
wordWrap: 'break-word',
|
|
@@ -31,19 +28,19 @@ function BaseTooltip({ clientPoint: clientPointCoords, children, placement = 'ri
|
|
|
31
28
|
const theme = (0, material_1.useTheme)();
|
|
32
29
|
const popperTheme = (_a = theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
33
30
|
const { classes } = useStyles();
|
|
34
|
-
const { refs, floatingStyles, context } = (0,
|
|
31
|
+
const { refs, floatingStyles, context } = (0, react_1.useFloating)({
|
|
35
32
|
placement,
|
|
36
33
|
strategy: 'fixed',
|
|
34
|
+
middleware: [(0, react_1.offset)(5)],
|
|
37
35
|
});
|
|
38
|
-
const clientPoint = (0,
|
|
39
|
-
const { getFloatingProps } = (0,
|
|
40
|
-
return (
|
|
41
|
-
react_1.default.createElement("div", { className: classes.tooltip, ref: refs.setFloating, style: {
|
|
36
|
+
const clientPoint = (0, react_1.useClientPoint)(context, clientPointCoords);
|
|
37
|
+
const { getFloatingProps } = (0, react_1.useInteractions)([clientPoint]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container, children: (0, jsx_runtime_1.jsx)("div", { className: classes.tooltip, ref: refs.setFloating, style: {
|
|
42
39
|
...floatingStyles,
|
|
43
40
|
zIndex: 100000,
|
|
44
41
|
visibility: floatingStyles.transform === 'translate(0px, 0px)'
|
|
45
42
|
? 'hidden'
|
|
46
43
|
: undefined,
|
|
47
44
|
pointerEvents: 'none',
|
|
48
|
-
}, ...getFloatingProps()
|
|
45
|
+
}, ...getFloatingProps(), children: children }) }));
|
|
49
46
|
}
|
package/ui/CascadingMenu.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { MenuItem as JBMenuItem } from './Menu';
|
|
3
2
|
import type { PopupState } from 'material-ui-popup-state/hooks';
|
|
4
3
|
declare function CascadingMenuChildren(props: {
|
|
@@ -6,5 +5,5 @@ declare function CascadingMenuChildren(props: {
|
|
|
6
5
|
closeAfterItemClick?: boolean;
|
|
7
6
|
menuItems: JBMenuItem[];
|
|
8
7
|
popupState: PopupState;
|
|
9
|
-
}):
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default CascadingMenuChildren;
|
package/ui/CascadingMenu.js
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
30
8
|
const ChevronRight_1 = __importDefault(require("@mui/icons-material/ChevronRight"));
|
|
31
9
|
const material_1 = require("@mui/material");
|
|
32
10
|
const HoverMenu_1 = __importDefault(require("material-ui-popup-state/HoverMenu"));
|
|
33
11
|
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
34
12
|
const Menu_1 = require("./Menu");
|
|
35
|
-
const CascadingContext = react_1.
|
|
13
|
+
const CascadingContext = (0, react_1.createContext)({
|
|
36
14
|
parentPopupState: null,
|
|
37
15
|
rootPopupState: null,
|
|
38
16
|
});
|
|
@@ -41,7 +19,7 @@ function CascadingMenuItem({ onClick, closeAfterItemClick, ...props }) {
|
|
|
41
19
|
if (!rootPopupState) {
|
|
42
20
|
throw new Error('must be used inside a CascadingMenu');
|
|
43
21
|
}
|
|
44
|
-
return (
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { ...props, onClick: event => {
|
|
45
23
|
if (closeAfterItemClick) {
|
|
46
24
|
rootPopupState.close();
|
|
47
25
|
}
|
|
@@ -55,13 +33,7 @@ function CascadingSubmenu({ title, Icon, inset, popupId, ...props }) {
|
|
|
55
33
|
variant: 'popover',
|
|
56
34
|
parentPopupState,
|
|
57
35
|
});
|
|
58
|
-
return (
|
|
59
|
-
react_1.default.createElement(material_1.MenuItem, { ...(0, hooks_1.bindHover)(popupState), ...(0, hooks_1.bindFocus)(popupState) },
|
|
60
|
-
Icon ? (react_1.default.createElement(material_1.ListItemIcon, null,
|
|
61
|
-
react_1.default.createElement(Icon, null))) : null,
|
|
62
|
-
react_1.default.createElement(material_1.ListItemText, { primary: title, inset: inset }),
|
|
63
|
-
react_1.default.createElement(ChevronRight_1.default, null)),
|
|
64
|
-
react_1.default.createElement(CascadingSubmenuHover, { ...props, anchorOrigin: { vertical: 'top', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'left' }, popupState: popupState })));
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { ...(0, hooks_1.bindHover)(popupState), ...(0, hooks_1.bindFocus)(popupState), children: [Icon ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon, {}) })) : null, (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: title, inset: inset }), (0, jsx_runtime_1.jsx)(ChevronRight_1.default, {})] }), (0, jsx_runtime_1.jsx)(CascadingSubmenuHover, { ...props, anchorOrigin: { vertical: 'top', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'left' }, popupState: popupState })] }));
|
|
65
37
|
}
|
|
66
38
|
function CascadingSubmenuHover({ popupState, onMenuItemClick, menuItems, classes, ...props }) {
|
|
67
39
|
const { rootPopupState } = (0, react_1.useContext)(CascadingContext);
|
|
@@ -69,8 +41,7 @@ function CascadingSubmenuHover({ popupState, onMenuItemClick, menuItems, classes
|
|
|
69
41
|
rootPopupState: rootPopupState || popupState,
|
|
70
42
|
parentPopupState: popupState,
|
|
71
43
|
}), [rootPopupState, popupState]);
|
|
72
|
-
return (
|
|
73
|
-
react_1.default.createElement(HoverMenu_1.default, { ...props, ...(0, hooks_1.bindMenu)(popupState) })));
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(CascadingContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(HoverMenu_1.default, { ...props, ...(0, hooks_1.bindMenu)(popupState) }) }));
|
|
74
45
|
}
|
|
75
46
|
function CascadingMenu({ popupState, onMenuItemClick, menuItems, ...props }) {
|
|
76
47
|
const { rootPopupState } = (0, react_1.useContext)(CascadingContext);
|
|
@@ -78,15 +49,14 @@ function CascadingMenu({ popupState, onMenuItemClick, menuItems, ...props }) {
|
|
|
78
49
|
rootPopupState: rootPopupState || popupState,
|
|
79
50
|
parentPopupState: popupState,
|
|
80
51
|
}), [rootPopupState, popupState]);
|
|
81
|
-
return (
|
|
82
|
-
react_1.default.createElement(material_1.Menu, { ...props, ...(0, hooks_1.bindMenu)(popupState) })));
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(CascadingContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(material_1.Menu, { ...props, ...(0, hooks_1.bindMenu)(popupState) }) }));
|
|
83
53
|
}
|
|
84
54
|
function EndDecoration({ item }) {
|
|
85
55
|
if ('subMenu' in item) {
|
|
86
|
-
return
|
|
56
|
+
return (0, jsx_runtime_1.jsx)(Menu_1.MenuItemEndDecoration, { type: "subMenu" });
|
|
87
57
|
}
|
|
88
58
|
else if (item.type === 'checkbox' || item.type === 'radio') {
|
|
89
|
-
return (
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(Menu_1.MenuItemEndDecoration, { type: item.type, checked: item.checked, disabled: item.disabled }));
|
|
90
60
|
}
|
|
91
61
|
return null;
|
|
92
62
|
}
|
|
@@ -97,22 +67,14 @@ function CascadingMenuList({ onMenuItemClick, closeAfterItemClick, menuItems, ..
|
|
|
97
67
|
};
|
|
98
68
|
}
|
|
99
69
|
const hasIcon = menuItems.some(m => 'icon' in m && m.icon);
|
|
100
|
-
return (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
item.icon ? (react_1.default.createElement(material_1.ListItemIcon, null,
|
|
106
|
-
react_1.default.createElement(item.icon, null))) : null,
|
|
107
|
-
' ',
|
|
108
|
-
react_1.default.createElement(material_1.ListItemText, { primary: item.label, secondary: item.subLabel, inset: hasIcon && !item.icon }),
|
|
109
|
-
react_1.default.createElement("div", { style: { flexGrow: 1, minWidth: 10 } }),
|
|
110
|
-
react_1.default.createElement(EndDecoration, { item: item })));
|
|
111
|
-
})));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: menuItems
|
|
71
|
+
.sort((a, b) => (b.priority || 0) - (a.priority || 0))
|
|
72
|
+
.map((item, idx) => {
|
|
73
|
+
return 'subMenu' in item ? ((0, jsx_runtime_1.jsx)(CascadingSubmenu, { popupId: `subMenu-${item.label}`, title: item.label, Icon: item.icon, inset: hasIcon && !item.icon, onMenuItemClick: onMenuItemClick, menuItems: item.subMenu, children: (0, jsx_runtime_1.jsx)(CascadingMenuList, { ...props, closeAfterItemClick: closeAfterItemClick, onMenuItemClick: onMenuItemClick, menuItems: item.subMenu }) }, `subMenu-${item.label}-${idx}`)) : item.type === 'divider' ? ((0, jsx_runtime_1.jsx)(material_1.Divider, { component: "li" }, `divider-${JSON.stringify(item)}-${idx}`)) : item.type === 'subHeader' ? ((0, jsx_runtime_1.jsx)(material_1.ListSubheader, { children: item.label }, `subHeader-${item.label}-${idx}`)) : ((0, jsx_runtime_1.jsxs)(CascadingMenuItem, { closeAfterItemClick: closeAfterItemClick, onClick: 'onClick' in item ? handleClick(item.onClick) : undefined, disabled: Boolean(item.disabled), children: [item.icon ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(item.icon, {}) })) : null, ' ', (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: item.label, secondary: item.subLabel, inset: hasIcon && !item.icon }), (0, jsx_runtime_1.jsx)("div", { style: { flexGrow: 1, minWidth: 10 } }), (0, jsx_runtime_1.jsx)(EndDecoration, { item: item })] }, `${item.label}-${idx}`));
|
|
74
|
+
}) }));
|
|
112
75
|
}
|
|
113
76
|
function CascadingMenuChildren(props) {
|
|
114
77
|
const { closeAfterItemClick = true, ...rest } = props;
|
|
115
|
-
return (
|
|
116
|
-
react_1.default.createElement(CascadingMenuList, { ...rest, closeAfterItemClick: closeAfterItemClick })));
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(CascadingMenu, { ...rest, children: (0, jsx_runtime_1.jsx)(CascadingMenuList, { ...rest, closeAfterItemClick: closeAfterItemClick }) }));
|
|
117
79
|
}
|
|
118
80
|
exports.default = CascadingMenuChildren;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { MenuItem } from '@jbrowse/core/ui';
|
|
3
2
|
declare const CascadingMenuButton: ({ children, menuItems, closeAfterItemClick, stopPropagation, setOpen, onClick: onClickExtra, ...rest }: {
|
|
4
3
|
children?: React.ReactElement;
|
|
@@ -8,5 +7,5 @@ declare const CascadingMenuButton: ({ children, menuItems, closeAfterItemClick,
|
|
|
8
7
|
onClick?: () => void;
|
|
9
8
|
setOpen?: (arg: boolean) => void;
|
|
10
9
|
[key: string]: unknown;
|
|
11
|
-
}) =>
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export default CascadingMenuButton;
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
30
8
|
const CascadingMenu_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenu"));
|
|
31
9
|
const material_1 = require("@mui/material");
|
|
32
10
|
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
@@ -41,22 +19,20 @@ const CascadingMenuButton = (0, mobx_react_1.observer)(function CascadingMenuBut
|
|
|
41
19
|
(0, react_1.useEffect)(() => {
|
|
42
20
|
setOpen === null || setOpen === void 0 ? void 0 : setOpen(isOpen);
|
|
43
21
|
}, [isOpen, setOpen]);
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
callback();
|
|
60
|
-
}, menuItems: menuItems, closeAfterItemClick: closeAfterItemClick, popupState: popupState })));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: event => {
|
|
23
|
+
if (stopPropagation) {
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
}
|
|
26
|
+
onClick(event);
|
|
27
|
+
onClickExtra === null || onClickExtra === void 0 ? void 0 : onClickExtra();
|
|
28
|
+
}, onTouchStart: event => {
|
|
29
|
+
if (stopPropagation) {
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
}
|
|
32
|
+
onTouchStart(event);
|
|
33
|
+
onClickExtra === null || onClickExtra === void 0 ? void 0 : onClickExtra();
|
|
34
|
+
}, ...rest2, ...rest, disabled: menuItems.length === 0, children: children }), (0, jsx_runtime_1.jsx)(CascadingMenu_1.default, { ...(0, hooks_1.bindPopover)(popupState), onMenuItemClick: (_, callback) => {
|
|
35
|
+
callback();
|
|
36
|
+
}, menuItems: menuItems, closeAfterItemClick: closeAfterItemClick, popupState: popupState })] }));
|
|
61
37
|
});
|
|
62
38
|
exports.default = CascadingMenuButton;
|
package/ui/ColorPicker.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare const PopoverPicker: ({ color, onChange, }: {
|
|
3
2
|
color: string;
|
|
4
3
|
onChange: (color: string) => void;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export declare function ColorPopover({ anchorEl, onChange, onClose, color, }: {
|
|
7
6
|
color: string;
|
|
8
7
|
anchorEl: HTMLElement | null;
|
|
9
8
|
onChange: (val: string) => void;
|
|
10
9
|
onClose: () => void;
|
|
11
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export declare function ColorPicker({ onChange, color, }: {
|
|
13
12
|
color: string;
|
|
14
13
|
onChange: (val: string) => void;
|
|
15
|
-
}):
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export default PopoverPicker;
|
package/ui/ColorPicker.js
CHANGED
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.PopoverPicker = void 0;
|
|
27
37
|
exports.ColorPopover = ColorPopover;
|
|
28
38
|
exports.ColorPicker = ColorPicker;
|
|
29
|
-
const
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
30
41
|
const colord_1 = require("@jbrowse/core/util/colord");
|
|
31
42
|
const material_1 = require("@mui/material");
|
|
32
43
|
const mui_1 = require("tss-react/mui");
|
|
@@ -53,18 +64,15 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
53
64
|
const PopoverPicker = ({ color, onChange, }) => {
|
|
54
65
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
55
66
|
const { classes } = useStyles();
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
setAnchorEl(null);
|
|
62
|
-
}, color: color, onChange: onChange })));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.picker, children: [(0, jsx_runtime_1.jsx)("div", { className: classes.swatch, style: { backgroundColor: color }, onClick: event => {
|
|
68
|
+
setAnchorEl(event.currentTarget);
|
|
69
|
+
} }), (0, jsx_runtime_1.jsx)(ColorPopover, { anchorEl: anchorEl, onClose: () => {
|
|
70
|
+
setAnchorEl(null);
|
|
71
|
+
}, color: color, onChange: onChange })] }));
|
|
63
72
|
};
|
|
64
73
|
exports.PopoverPicker = PopoverPicker;
|
|
65
74
|
function ColorPopover({ anchorEl, onChange, onClose, color, }) {
|
|
66
|
-
return (
|
|
67
|
-
react_1.default.createElement(ColorPicker, { color: color, onChange: onChange })));
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Popover, { open: !!anchorEl, anchorEl: anchorEl, onClose: onClose, children: (0, jsx_runtime_1.jsx)(ColorPicker, { color: color, onChange: onChange }) }));
|
|
68
76
|
}
|
|
69
77
|
function ColorPicker({ onChange, color, }) {
|
|
70
78
|
const { classes } = useStyles();
|
|
@@ -81,19 +89,13 @@ function ColorPicker({ onChange, color, }) {
|
|
|
81
89
|
}
|
|
82
90
|
catch (e) { }
|
|
83
91
|
};
|
|
84
|
-
return (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
react_1.default.createElement("div", { className: classes.swatches }, presetColors.map((presetColor, idx) => (react_1.default.createElement("button", { type: "button", key: `${presetColor}-${idx}`, className: classes.swatch, style: { background: presetColor }, onClick: () => {
|
|
93
|
-
handleChange(presetColor);
|
|
94
|
-
} })))),
|
|
95
|
-
react_1.default.createElement(material_1.TextField, { helperText: 'Manually set color (hex, rgb, or css color name)', value: text, onChange: event => {
|
|
96
|
-
handleChange(event.target.value);
|
|
97
|
-
} }))));
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: 10 }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: 200, margin: 5 }, children: (0, jsx_runtime_1.jsx)(react_colorful_1.RgbaStringColorPicker, { color: rgbDebounced, onChange: handleChange }) }), (0, jsx_runtime_1.jsxs)("div", { style: { width: 200, margin: 5 }, children: [(0, jsx_runtime_1.jsx)(material_1.Select, { value: val, onChange: event => {
|
|
93
|
+
const pal = event.target.value;
|
|
94
|
+
setVal(pal);
|
|
95
|
+
}, children: palettes.map(p => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: p, children: p }, p))) }), (0, jsx_runtime_1.jsx)("div", { className: classes.swatches, children: presetColors.map((presetColor, idx) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: classes.swatch, style: { background: presetColor }, onClick: () => {
|
|
96
|
+
handleChange(presetColor);
|
|
97
|
+
} }, `${presetColor}-${idx}`))) }), (0, jsx_runtime_1.jsx)(material_1.TextField, { helperText: 'Manually set color (hex, rgb, or css color name)', value: text, onChange: event => {
|
|
98
|
+
handleChange(event.target.value);
|
|
99
|
+
} })] })] }));
|
|
98
100
|
}
|
|
99
101
|
exports.default = exports.PopoverPicker;
|
package/ui/Dialog.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DialogProps } from '@mui/material';
|
|
3
2
|
interface Props extends DialogProps {
|
|
4
3
|
header?: React.ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare const Dialog: (props: Props) =>
|
|
5
|
+
declare const Dialog: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default Dialog;
|
package/ui/Dialog.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
7
8
|
const ErrorBoundary_1 = require("@jbrowse/core/ui/ErrorBoundary");
|
|
8
9
|
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
9
10
|
const material_1 = require("@mui/material");
|
|
@@ -20,33 +21,24 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
20
21
|
},
|
|
21
22
|
}));
|
|
22
23
|
function DialogError({ error }) {
|
|
23
|
-
return (
|
|
24
|
-
react_1.default.createElement(ErrorMessage_1.default, { error: error })));
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { width: 800, margin: 40 }, children: (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { error: error }) }));
|
|
25
25
|
}
|
|
26
26
|
const Dialog = (0, mobx_react_1.observer)(function (props) {
|
|
27
27
|
const { classes } = useStyles();
|
|
28
28
|
const { title, header, children, onClose } = props;
|
|
29
29
|
const theme = (0, material_1.useTheme)();
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
react_1.default.createElement(ErrorBoundary_1.ErrorBoundary, { FallbackComponent: DialogError },
|
|
40
|
-
react_1.default.createElement(material_1.ThemeProvider, { theme: (0, material_1.createTheme)(theme, {
|
|
41
|
-
components: {
|
|
42
|
-
MuiInputBase: {
|
|
43
|
-
styleOverrides: {
|
|
44
|
-
input: {
|
|
45
|
-
boxSizing: 'content-box!important',
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Dialog, { ...props, children: (0, jsx_runtime_1.jsxs)(material_1.ScopedCssBaseline, { children: [(0, react_1.isValidElement)(header) ? (header) : ((0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { children: [(0, jsx_runtime_1.jsx)(SanitizedHTML_1.default, { html: title || '' }), onClose ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { className: classes.closeButton, onClick: () => {
|
|
31
|
+
onClose();
|
|
32
|
+
}, children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) })) : null] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { FallbackComponent: DialogError, children: (0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: (0, material_1.createTheme)(theme, {
|
|
33
|
+
components: {
|
|
34
|
+
MuiInputBase: {
|
|
35
|
+
styleOverrides: {
|
|
36
|
+
input: {
|
|
37
|
+
boxSizing: 'content-box!important',
|
|
38
|
+
},
|
|
46
39
|
},
|
|
47
40
|
},
|
|
48
41
|
},
|
|
49
|
-
},
|
|
50
|
-
}) }, children)))));
|
|
42
|
+
}), children: children }) })] }) }));
|
|
51
43
|
});
|
|
52
44
|
exports.default = Dialog;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
11
|
+
const react_draggable_1 = __importDefault(require("react-draggable"));
|
|
12
|
+
const mui_1 = require("tss-react/mui");
|
|
13
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
14
|
+
closeButton: {
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
right: theme.spacing(1),
|
|
17
|
+
top: theme.spacing(1),
|
|
18
|
+
color: theme.palette.grey[500],
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
function PaperComponent(props) {
|
|
22
|
+
const ref = (0, react_1.useRef)(null);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(react_draggable_1.default, { nodeRef: ref, cancel: '[class*="MuiDialogContent-root"]', onStart: arg => { var _a; return `${(_a = arg.target) === null || _a === void 0 ? void 0 : _a.className}`.includes('MuiDialogTitle'); }, children: (0, jsx_runtime_1.jsx)(material_1.Paper, { ref: ref, ...props }) }));
|
|
24
|
+
}
|
|
25
|
+
const DraggableDialog = (0, mobx_react_1.observer)(function DraggableDialog(props) {
|
|
26
|
+
const { classes } = useStyles();
|
|
27
|
+
const { title, children, onClose } = props;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Dialog, { ...props, PaperComponent: PaperComponent, children: (0, jsx_runtime_1.jsxs)(material_1.ScopedCssBaseline, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { style: { cursor: 'move' }, children: [title, onClose ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { className: classes.closeButton, onClick: () => {
|
|
29
|
+
onClose();
|
|
30
|
+
}, children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), children] }) }));
|
|
31
|
+
});
|
|
32
|
+
exports.default = DraggableDialog;
|