@jbrowse/plugin-menus 3.2.0 → 3.3.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.
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const DataGridFlexContainer_1 = __importDefault(require("@jbrowse/core/ui/DataGridFlexContainer"));
|
|
7
8
|
const util_1 = require("@jbrowse/core/util");
|
|
8
9
|
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
9
10
|
const Star_1 = __importDefault(require("@mui/icons-material/Star"));
|
|
@@ -43,7 +44,7 @@ const SessionManager = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
session.notify(`${i} sessions deleted`, 'info');
|
|
46
|
-
}, children: "Delete non-fav sessions older than 7 days?" })] }), rows ? ((0, jsx_runtime_1.jsx)(
|
|
47
|
+
}, children: "Delete non-fav sessions older than 7 days?" })] }), rows ? ((0, jsx_runtime_1.jsx)(DataGridFlexContainer_1.default, { children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { columnHeaderHeight: 35, rowHeight: 25, hideFooter: rows.length < 100, slotProps: {
|
|
47
48
|
toolbar: {
|
|
48
49
|
showQuickFilter: true,
|
|
49
50
|
},
|
|
@@ -52,51 +53,43 @@ const SessionManager = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
|
52
53
|
field: 'fav',
|
|
53
54
|
headerName: 'Fav',
|
|
54
55
|
width: 20,
|
|
55
|
-
renderCell: ({ row }) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, children: row.fav ? (0, jsx_runtime_1.jsx)(Star_1.default, {}) : (0, jsx_runtime_1.jsx)(StarBorder_1.default, {}) }));
|
|
64
|
-
},
|
|
56
|
+
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
57
|
+
if (row.fav) {
|
|
58
|
+
session.unfavoriteSavedSession(row.id);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
session.favoriteSavedSession(row.id);
|
|
62
|
+
}
|
|
63
|
+
}, children: row.fav ? (0, jsx_runtime_1.jsx)(Star_1.default, {}) : (0, jsx_runtime_1.jsx)(StarBorder_1.default, {}) })),
|
|
65
64
|
},
|
|
66
65
|
{
|
|
67
66
|
field: 'name',
|
|
68
67
|
headerName: 'Name',
|
|
69
68
|
editable: true,
|
|
70
69
|
width: (0, util_1.measureGridWidth)(rows.map(r => r.name)),
|
|
71
|
-
renderCell: ({ row }) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, children: row.name }), session.id === row.id ? ' (current)' : ''] }));
|
|
76
|
-
},
|
|
70
|
+
renderCell: ({ row }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, { href: "#", onClick: event => {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
session.activateSession(row.id);
|
|
73
|
+
}, children: row.name }), session.id === row.id ? ' (current)' : ''] })),
|
|
77
74
|
},
|
|
78
75
|
{
|
|
79
76
|
headerName: 'Created at',
|
|
80
77
|
field: 'createdAt',
|
|
81
|
-
renderCell: ({ row }) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}) }) }));
|
|
89
|
-
},
|
|
78
|
+
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { disableInteractive: true, slotProps: {
|
|
79
|
+
transition: {
|
|
80
|
+
timeout: 0,
|
|
81
|
+
},
|
|
82
|
+
}, title: row.createdAt.toLocaleString(), children: (0, jsx_runtime_1.jsx)("div", { children: (0, date_fns_1.formatDistanceToNow)(row.createdAt, {
|
|
83
|
+
addSuffix: true,
|
|
84
|
+
}) }) })),
|
|
90
85
|
},
|
|
91
86
|
{
|
|
92
87
|
field: 'delete',
|
|
93
88
|
width: 10,
|
|
94
89
|
headerName: 'Delete',
|
|
95
|
-
renderCell: ({ row }) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }));
|
|
99
|
-
},
|
|
90
|
+
renderCell: ({ row }) => ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
91
|
+
session.deleteSavedSession(row.id);
|
|
92
|
+
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) })),
|
|
100
93
|
},
|
|
101
94
|
] }) })) : ((0, jsx_runtime_1.jsx)("div", { children: "No sessions loaded" }))] }));
|
|
102
95
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
|
|
2
3
|
import { measureGridWidth, useLocalStorage } from '@jbrowse/core/util';
|
|
3
4
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
4
5
|
import StarIcon from '@mui/icons-material/Star';
|
|
@@ -38,7 +39,7 @@ const SessionManager = observer(function ({ session, }) {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
session.notify(`${i} sessions deleted`, 'info');
|
|
41
|
-
}, children: "Delete non-fav sessions older than 7 days?" })] }), rows ? (_jsx(
|
|
42
|
+
}, children: "Delete non-fav sessions older than 7 days?" })] }), rows ? (_jsx(DataGridFlexContainer, { children: _jsx(DataGrid, { columnHeaderHeight: 35, rowHeight: 25, hideFooter: rows.length < 100, slotProps: {
|
|
42
43
|
toolbar: {
|
|
43
44
|
showQuickFilter: true,
|
|
44
45
|
},
|
|
@@ -47,51 +48,43 @@ const SessionManager = observer(function ({ session, }) {
|
|
|
47
48
|
field: 'fav',
|
|
48
49
|
headerName: 'Fav',
|
|
49
50
|
width: 20,
|
|
50
|
-
renderCell: ({ row }) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, children: row.fav ? _jsx(StarIcon, {}) : _jsx(StarBorderIcon, {}) }));
|
|
59
|
-
},
|
|
51
|
+
renderCell: ({ row }) => (_jsx(IconButton, { onClick: () => {
|
|
52
|
+
if (row.fav) {
|
|
53
|
+
session.unfavoriteSavedSession(row.id);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
session.favoriteSavedSession(row.id);
|
|
57
|
+
}
|
|
58
|
+
}, children: row.fav ? _jsx(StarIcon, {}) : _jsx(StarBorderIcon, {}) })),
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
61
|
field: 'name',
|
|
63
62
|
headerName: 'Name',
|
|
64
63
|
editable: true,
|
|
65
64
|
width: measureGridWidth(rows.map(r => r.name)),
|
|
66
|
-
renderCell: ({ row }) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}, children: row.name }), session.id === row.id ? ' (current)' : ''] }));
|
|
71
|
-
},
|
|
65
|
+
renderCell: ({ row }) => (_jsxs(_Fragment, { children: [_jsx(Link, { href: "#", onClick: event => {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
session.activateSession(row.id);
|
|
68
|
+
}, children: row.name }), session.id === row.id ? ' (current)' : ''] })),
|
|
72
69
|
},
|
|
73
70
|
{
|
|
74
71
|
headerName: 'Created at',
|
|
75
72
|
field: 'createdAt',
|
|
76
|
-
renderCell: ({ row }) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}) }) }));
|
|
84
|
-
},
|
|
73
|
+
renderCell: ({ row }) => (_jsx(Tooltip, { disableInteractive: true, slotProps: {
|
|
74
|
+
transition: {
|
|
75
|
+
timeout: 0,
|
|
76
|
+
},
|
|
77
|
+
}, title: row.createdAt.toLocaleString(), children: _jsx("div", { children: formatDistanceToNow(row.createdAt, {
|
|
78
|
+
addSuffix: true,
|
|
79
|
+
}) }) })),
|
|
85
80
|
},
|
|
86
81
|
{
|
|
87
82
|
field: 'delete',
|
|
88
83
|
width: 10,
|
|
89
84
|
headerName: 'Delete',
|
|
90
|
-
renderCell: ({ row }) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}, children: _jsx(DeleteIcon, {}) }));
|
|
94
|
-
},
|
|
85
|
+
renderCell: ({ row }) => (_jsx(IconButton, { onClick: () => {
|
|
86
|
+
session.deleteSavedSession(row.id);
|
|
87
|
+
}, children: _jsx(DeleteIcon, {}) })),
|
|
95
88
|
},
|
|
96
89
|
] }) })) : (_jsx("div", { children: "No sessions loaded" }))] }));
|
|
97
90
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-menus",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "JBrowse 2 basic menus",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jbrowse/core": "^3.
|
|
40
|
-
"@mui/icons-material": "^
|
|
41
|
-
"@mui/material": "^
|
|
39
|
+
"@jbrowse/core": "^3.3.0",
|
|
40
|
+
"@mui/icons-material": "^7.0.0",
|
|
41
|
+
"@mui/material": "^7.0.0",
|
|
42
42
|
"date-fns": "^4.1.0",
|
|
43
43
|
"mobx": "^6.0.0",
|
|
44
44
|
"mobx-react": "^9.0.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
|
|
61
61
|
}
|