@jbrowse/plugin-config 2.18.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +4 -9
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +16 -49
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +10 -36
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +10 -21
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +2 -5
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.js +2 -5
- package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +11 -37
- package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js +3 -25
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +19 -52
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +10 -36
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +26 -61
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +27 -60
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +2 -7
- package/dist/ConfigurationEditorWidget/index.js +17 -7
- package/dist/FromConfigAdapter/index.js +17 -7
- package/dist/FromConfigRegionsAdapter/index.js +17 -7
- package/dist/FromConfigSequenceAdapter/index.js +17 -7
- package/dist/NcbiSequenceReportAliasAdapter/index.js +17 -7
- package/dist/RefNameAliasAdapter/index.js +17 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -7
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +4 -6
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +16 -26
- package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +10 -13
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +10 -21
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +2 -2
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +2 -2
- package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +11 -14
- package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js +3 -2
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +19 -29
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +10 -13
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +26 -38
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +27 -37
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -4
- package/esm/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -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 ui_1 = require("@jbrowse/core/ui");
|
|
31
9
|
const util_1 = require("@jbrowse/core/util");
|
|
32
10
|
const mst_reflection_1 = require("@jbrowse/core/util/mst-reflection");
|
|
@@ -45,17 +23,16 @@ const StringArrayEditor_1 = __importDefault(require("./StringArrayEditor"));
|
|
|
45
23
|
const StringArrayMapEditor_1 = __importDefault(require("./StringArrayMapEditor"));
|
|
46
24
|
const useSlotEditorStyles_1 = require("./useSlotEditorStyles");
|
|
47
25
|
const StringEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
48
|
-
return (
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(ConfigurationTextField_1.default, { label: slot.name, helperText: slot.description, value: slot.value, onChange: evt => {
|
|
49
27
|
slot.set(evt.target.value);
|
|
50
28
|
} }));
|
|
51
29
|
});
|
|
52
30
|
const TextEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
53
|
-
return (
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { label: slot.name, helperText: slot.description, multiline: true, value: slot.value, onChange: evt => {
|
|
54
32
|
slot.set(evt.target.value);
|
|
55
33
|
} }));
|
|
56
34
|
});
|
|
57
|
-
const SvgCheckbox = () => (
|
|
58
|
-
react_1.default.createElement("path", { d: "M20.41,3C21.8,5.71 22.35,8.84 22,12C21.8,15.16 20.7,18.29 18.83,21L17.3,20C18.91,17.57 19.85,14.8 20,12C20.34,9.2 19.89,6.43 18.7,4L20.41,3M5.17,3L6.7,4C5.09,6.43 4.15,9.2 4,12C3.66,14.8 4.12,17.57 5.3,20L3.61,21C2.21,18.29 1.65,15.17 2,12C2.2,8.84 3.3,5.71 5.17,3M12.08,10.68L14.4,7.45H16.93L13.15,12.45L15.35,17.37H13.09L11.71,14L9.28,17.33H6.76L10.66,12.21L8.53,7.45H10.8L12.08,10.68Z" })));
|
|
35
|
+
const SvgCheckbox = () => ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, { children: (0, jsx_runtime_1.jsx)("path", { d: "M20.41,3C21.8,5.71 22.35,8.84 22,12C21.8,15.16 20.7,18.29 18.83,21L17.3,20C18.91,17.57 19.85,14.8 20,12C20.34,9.2 19.89,6.43 18.7,4L20.41,3M5.17,3L6.7,4C5.09,6.43 4.15,9.2 4,12C3.66,14.8 4.12,17.57 5.3,20L3.61,21C2.21,18.29 1.65,15.17 2,12C2.2,8.84 3.3,5.71 5.17,3M12.08,10.68L14.4,7.45H16.93L13.15,12.45L15.35,17.37H13.09L11.71,14L9.28,17.33H6.76L10.66,12.21L8.53,7.45H10.8L12.08,10.68Z" }) }));
|
|
59
36
|
const IntegerEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
60
37
|
const [val, setVal] = (0, react_1.useState)(slot.value);
|
|
61
38
|
(0, react_1.useEffect)(() => {
|
|
@@ -64,20 +41,20 @@ const IntegerEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
|
64
41
|
slot.set(num);
|
|
65
42
|
}
|
|
66
43
|
}, [slot, val]);
|
|
67
|
-
return (
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(ConfigurationTextField_1.default, { label: slot.name, helperText: slot.description, value: val, type: "number", onChange: evt => {
|
|
68
45
|
setVal(evt.target.value);
|
|
69
46
|
} }));
|
|
70
47
|
});
|
|
71
48
|
const StringEnumEditor = (0, mobx_react_1.observer)(function ({ slot, slotSchema, }) {
|
|
72
49
|
const p = (0, mobx_state_tree_1.getPropertyMembers)((0, mst_reflection_1.getSubType)(slotSchema));
|
|
73
50
|
const choices = (0, mst_reflection_1.getUnionSubTypes)((0, mst_reflection_1.getUnionSubTypes)((0, mst_reflection_1.getSubType)(p.properties.value))[1]).map(t => t.value);
|
|
74
|
-
return (
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(ConfigurationTextField_1.default, { value: slot.value, label: slot.name, select: true, helperText: slot.description, onChange: evt => {
|
|
75
52
|
slot.set(evt.target.value);
|
|
76
|
-
}
|
|
53
|
+
}, children: choices.map(str => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: str, children: str }, str))) }));
|
|
77
54
|
});
|
|
78
55
|
const FileSelectorWrapper = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
79
56
|
var _a;
|
|
80
|
-
return (
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.FileSelector, { location: slot.value, setLocation: location => {
|
|
81
58
|
slot.set(location);
|
|
82
59
|
}, name: slot.name, description: slot.description, rootModel: (_a = (0, util_1.getEnv)(slot).pluginManager) === null || _a === void 0 ? void 0 : _a.rootModel }));
|
|
83
60
|
});
|
|
@@ -110,9 +87,6 @@ const SlotEditor = (0, mobx_react_1.observer)(function ({ slot, slotSchema, }) {
|
|
|
110
87
|
if (!(type in valueComponents)) {
|
|
111
88
|
console.warn(`SlotEditor needs to implement ${type}`);
|
|
112
89
|
}
|
|
113
|
-
return (
|
|
114
|
-
react_1.default.createElement("div", { className: classes.paperContent },
|
|
115
|
-
react_1.default.createElement(ValueComponent, { slot: slot, slotSchema: slotSchema })),
|
|
116
|
-
react_1.default.createElement("div", { className: classes.slotModeSwitch }, slot.contextVariable.length ? (react_1.default.createElement(material_1.IconButton, { onClick: () => slot.isCallback ? slot.convertToValue() : slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}` }, slot.isCallback ? react_1.default.createElement(SvgCheckbox, null) : react_1.default.createElement(RadioButtonUnchecked_1.default, null))) : null)));
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { className: classes.paper, children: [(0, jsx_runtime_1.jsx)("div", { className: classes.paperContent, children: (0, jsx_runtime_1.jsx)(ValueComponent, { slot: slot, slotSchema: slotSchema }) }), (0, jsx_runtime_1.jsx)("div", { className: classes.slotModeSwitch, children: slot.contextVariable.length ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => slot.isCallback ? slot.convertToValue() : slot.convertToCallback(), title: `convert to ${slot.isCallback ? 'regular value' : 'callback'}`, children: slot.isCallback ? (0, jsx_runtime_1.jsx)(SvgCheckbox, {}) : (0, jsx_runtime_1.jsx)(RadioButtonUnchecked_1.default, {}) })) : null })] }));
|
|
117
91
|
});
|
|
118
92
|
exports.default = SlotEditor;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const StringArrayEditor: ({ slot, }: {
|
|
3
2
|
slot: {
|
|
4
3
|
name: string;
|
|
@@ -8,5 +7,5 @@ declare const StringArrayEditor: ({ slot, }: {
|
|
|
8
7
|
add: (arg: string) => void;
|
|
9
8
|
description: string;
|
|
10
9
|
};
|
|
11
|
-
}) =>
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export default StringArrayEditor;
|
|
@@ -1,74 +1,39 @@
|
|
|
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 Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
31
9
|
const material_1 = require("@mui/material");
|
|
32
10
|
const mobx_react_1 = require("mobx-react");
|
|
33
11
|
const StringArrayEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
34
12
|
const [value, setValue] = (0, react_1.useState)('');
|
|
35
13
|
const [addNew, setAddNew] = (0, react_1.useState)(false);
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
slot.add(value);
|
|
61
|
-
setValue('');
|
|
62
|
-
} }, "OK"),
|
|
63
|
-
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", style: { margin: 2 }, onClick: () => {
|
|
64
|
-
setAddNew(false);
|
|
65
|
-
setValue('');
|
|
66
|
-
} }, "Cancel")))),
|
|
67
|
-
},
|
|
68
|
-
} }))) : null,
|
|
69
|
-
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", style: { margin: 4 }, disabled: addNew, onClick: () => {
|
|
70
|
-
setAddNew(true);
|
|
71
|
-
} }, "Add item")),
|
|
72
|
-
react_1.default.createElement(material_1.FormHelperText, null, slot.description)));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [slot.name ? (0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: slot.name }) : null, (0, jsx_runtime_1.jsxs)(material_1.List, { disablePadding: true, children: [slot.value.map((val, idx) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { value: val, onChange: evt => {
|
|
15
|
+
slot.setAtIndex(idx, evt.target.value);
|
|
16
|
+
}, slotProps: {
|
|
17
|
+
input: {
|
|
18
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
19
|
+
slot.removeAtIndex(idx);
|
|
20
|
+
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }) })),
|
|
21
|
+
},
|
|
22
|
+
} }) }, `${JSON.stringify(val)}-${idx}`))), addNew ? ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { value: value, placeholder: "add new", onChange: event => {
|
|
23
|
+
setValue(event.target.value);
|
|
24
|
+
}, slotProps: {
|
|
25
|
+
input: {
|
|
26
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", style: { margin: 2 }, "data-testid": `stringArrayAdd-${slot.name}`, onClick: () => {
|
|
27
|
+
setAddNew(false);
|
|
28
|
+
slot.add(value);
|
|
29
|
+
setValue('');
|
|
30
|
+
}, children: "OK" }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", style: { margin: 2 }, onClick: () => {
|
|
31
|
+
setAddNew(false);
|
|
32
|
+
setValue('');
|
|
33
|
+
}, children: "Cancel" })] }) })),
|
|
34
|
+
},
|
|
35
|
+
} }) })) : null, (0, jsx_runtime_1.jsx)(material_1.Button, { color: "primary", variant: "contained", style: { margin: 4 }, disabled: addNew, onClick: () => {
|
|
36
|
+
setAddNew(true);
|
|
37
|
+
}, children: "Add item" })] }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: slot.description })] }));
|
|
73
38
|
});
|
|
74
39
|
exports.default = StringArrayEditor;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const StringArrayMapEditor: ({ slot, }: {
|
|
3
2
|
slot: {
|
|
4
3
|
name: string;
|
|
@@ -10,5 +9,5 @@ declare const StringArrayMapEditor: ({ slot, }: {
|
|
|
10
9
|
removeAtKeyIndex: (key: string, idx: number) => void;
|
|
11
10
|
addToKey: (key: string, val: string) => void;
|
|
12
11
|
};
|
|
13
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default StringArrayMapEditor;
|
|
@@ -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 Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
31
9
|
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
32
10
|
const material_1 = require("@mui/material");
|
|
@@ -41,41 +19,30 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
41
19
|
const StringArrayMapEditor = (0, mobx_react_1.observer)(function ({ slot, }) {
|
|
42
20
|
const { classes } = useStyles();
|
|
43
21
|
const [value, setValue] = (0, react_1.useState)('');
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, slotProps: {
|
|
70
|
-
input: {
|
|
71
|
-
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: "end" },
|
|
72
|
-
react_1.default.createElement(material_1.IconButton, { disabled: value === '', onClick: () => {
|
|
73
|
-
slot.add(value, []);
|
|
74
|
-
setValue('');
|
|
75
|
-
} },
|
|
76
|
-
react_1.default.createElement(Add_1.default, null)))),
|
|
77
|
-
},
|
|
78
|
-
} }) })),
|
|
79
|
-
react_1.default.createElement(material_1.FormHelperText, null, slot.description)));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: slot.name }), [...slot.value].map(([key, val]) => ((0, jsx_runtime_1.jsxs)(material_1.Card, { raised: true, className: classes.card, children: [(0, jsx_runtime_1.jsx)(material_1.CardHeader, { title: key, action: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
23
|
+
slot.remove(key);
|
|
24
|
+
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.CardContent, { children: (0, jsx_runtime_1.jsx)(StringArrayEditor_1.default, { slot: {
|
|
25
|
+
name: slot.name,
|
|
26
|
+
value: val,
|
|
27
|
+
description: `Values associated with entry ${key}`,
|
|
28
|
+
setAtIndex: (idx, val) => {
|
|
29
|
+
slot.setAtKeyIndex(key, idx, val);
|
|
30
|
+
},
|
|
31
|
+
removeAtIndex: (idx) => {
|
|
32
|
+
slot.removeAtKeyIndex(key, idx);
|
|
33
|
+
},
|
|
34
|
+
add: (val) => {
|
|
35
|
+
slot.addToKey(key, val);
|
|
36
|
+
},
|
|
37
|
+
} }) })] }, key))), (0, jsx_runtime_1.jsx)(material_1.Card, { raised: true, className: classes.card, children: (0, jsx_runtime_1.jsx)(material_1.CardHeader, { disableTypography: true, title: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
|
|
38
|
+
setValue(event.target.value);
|
|
39
|
+
}, slotProps: {
|
|
40
|
+
input: {
|
|
41
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { disabled: value === '', onClick: () => {
|
|
42
|
+
slot.add(value, []);
|
|
43
|
+
setValue('');
|
|
44
|
+
}, children: (0, jsx_runtime_1.jsx)(Add_1.default, {}) }) })),
|
|
45
|
+
},
|
|
46
|
+
} }) }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: slot.description })] }));
|
|
80
47
|
});
|
|
81
48
|
exports.default = StringArrayMapEditor;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
2
|
declare const TypeSelector: ({ typeNameChoices, slot, slotName, onChange, }: {
|
|
4
3
|
typeNameChoices: string[];
|
|
5
4
|
slot: AnyConfigurationModel;
|
|
6
5
|
slotName: string;
|
|
7
6
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default TypeSelector;
|
|
@@ -1,16 +1,11 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
8
5
|
const mobx_react_1 = require("mobx-react");
|
|
9
6
|
const useSlotEditorStyles_1 = require("./useSlotEditorStyles");
|
|
10
7
|
const TypeSelector = (0, mobx_react_1.observer)(function ({ typeNameChoices, slot, slotName, onChange, }) {
|
|
11
8
|
const { classes } = (0, useSlotEditorStyles_1.useSlotEditorStyles)();
|
|
12
|
-
return (
|
|
13
|
-
react_1.default.createElement("div", { className: classes.paperContent },
|
|
14
|
-
react_1.default.createElement(material_1.TextField, { value: slot.type, label: "Type", select: true, helperText: `Type of ${slotName} to use`, fullWidth: true, onChange: onChange }, typeNameChoices.map(str => (react_1.default.createElement(material_1.MenuItem, { key: str, value: str }, str)))))));
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Paper, { className: classes.paper, children: (0, jsx_runtime_1.jsx)("div", { className: classes.paperContent, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { value: slot.type, label: "Type", select: true, helperText: `Type of ${slotName} to use`, fullWidth: true, onChange: onChange, children: typeNameChoices.map(str => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: str, children: str }, str))) }) }) }));
|
|
15
10
|
});
|
|
16
11
|
exports.default = TypeSelector;
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const LazyConfigurationEditorComponent: import("react").LazyExoticCompon
|
|
|
5
5
|
target: import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
6
6
|
};
|
|
7
7
|
session?: import("@jbrowse/core/util").AbstractSessionModel;
|
|
8
|
-
}) => import("react").JSX.Element>;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
export default class ConfigurationPlugin extends Plugin {
|
|
10
10
|
name: string;
|
|
11
11
|
install(pluginManager: PluginManager): void;
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const BooleanEditor: ({ slot, }: {
|
|
3
2
|
slot: {
|
|
4
3
|
name: string;
|
|
@@ -6,5 +5,5 @@ declare const BooleanEditor: ({ slot, }: {
|
|
|
6
5
|
set: (arg: boolean) => void;
|
|
7
6
|
description: string;
|
|
8
7
|
};
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default BooleanEditor;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox, FormControl, FormControlLabel, FormHelperText, } from '@mui/material';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
const BooleanEditor = observer(function ({ slot, }) {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
slot.
|
|
8
|
-
} }) }),
|
|
9
|
-
React.createElement(FormHelperText, null, slot.description)));
|
|
5
|
+
return (_jsxs(FormControl, { children: [_jsx(FormControlLabel, { label: slot.name, control: _jsx(Checkbox, { checked: slot.value, onChange: evt => {
|
|
6
|
+
slot.set(evt.target.checked);
|
|
7
|
+
} }) }), _jsx(FormHelperText, { children: slot.description })] }));
|
|
10
8
|
});
|
|
11
9
|
export default BooleanEditor;
|