@jbrowse/plugin-spreadsheet-view 3.1.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.
@@ -6,18 +6,18 @@ const mobx_react_1 = require("mobx-react");
6
6
  const SpreadsheetDataGrid = (0, mobx_react_1.observer)(function ({ model, }) {
7
7
  const { rows, dataGridColumns, visibleColumns } = model;
8
8
  const apiRef = (0, x_data_grid_1.useGridApiRef)();
9
- return rows && dataGridColumns ? ((0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { apiRef: apiRef, checkboxSelection: true, disableRowSelectionOnClick: true, columnHeaderHeight: 35, columnVisibilityModel: visibleColumns, onFilterModelChange: () => {
9
+ return rows && dataGridColumns ? ((0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { apiRef: apiRef, checkboxSelection: true, columnHeaderHeight: 35, columnVisibilityModel: visibleColumns, onFilterModelChange: () => {
10
10
  setTimeout(() => {
11
- model.setVisibleRows(apiRef.current.state.visibleRowsLookup);
11
+ if (apiRef.current) {
12
+ model.setVisibleRows(apiRef.current.state.visibleRowsLookup);
13
+ }
12
14
  });
13
15
  }, onColumnVisibilityModelChange: n => {
14
16
  model.setVisibleColumns(n);
15
- }, rowHeight: 25, hideFooter: rows.length < 100, slots: {
16
- toolbar: x_data_grid_1.GridToolbar,
17
- }, slotProps: {
17
+ }, rowHeight: 25, hideFooter: rows.length < 100, slotProps: {
18
18
  toolbar: {
19
19
  showQuickFilter: true,
20
20
  },
21
- }, rows: rows, columns: dataGridColumns })) : null;
21
+ }, showToolbar: true, rows: rows, columns: dataGridColumns })) : null;
22
22
  });
23
23
  exports.default = SpreadsheetDataGrid;
@@ -4,14 +4,14 @@ exports.parseBedBuffer = parseBedBuffer;
4
4
  const isNumber_1 = require("./isNumber");
5
5
  const util_1 = require("./util");
6
6
  function parseBedBuffer(buffer) {
7
- var _a, _b;
7
+ var _a;
8
8
  const lines = (0, util_1.bufferToLines)(buffer);
9
9
  const rest = lines.filter(line => !(line.startsWith('#') ||
10
10
  line.startsWith('browser') ||
11
11
  line.startsWith('track')));
12
12
  const lastHeaderLine = lines.findLast(line => line.startsWith('#'));
13
13
  const coreColumns = ['refName', 'start', 'end'];
14
- const numExtraColumns = Math.max(0, (((_b = (_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t')) === null || _b === void 0 ? void 0 : _b.length) || 0) - coreColumns.length);
14
+ const numExtraColumns = Math.max(0, (((_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t').length) || 0) - coreColumns.length);
15
15
  const extraNames = (lastHeaderLine === null || lastHeaderLine === void 0 ? void 0 : lastHeaderLine.includes('\t'))
16
16
  ? lastHeaderLine
17
17
  .slice(1)
@@ -4,7 +4,7 @@ exports.parseBedPEBuffer = parseBedPEBuffer;
4
4
  const internals_1 = require("@mui/x-data-grid/internals");
5
5
  const util_1 = require("./util");
6
6
  function parseBedPEBuffer(buffer) {
7
- var _a, _b;
7
+ var _a;
8
8
  const lines = (0, util_1.bufferToLines)(buffer);
9
9
  const rest = lines.filter(line => !(line.startsWith('#') ||
10
10
  line.startsWith('browser') ||
@@ -22,7 +22,7 @@ function parseBedPEBuffer(buffer) {
22
22
  'strand',
23
23
  'mateStrand',
24
24
  ];
25
- const numExtraColumns = Math.max(0, (((_b = (_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t')) === null || _b === void 0 ? void 0 : _b.length) || 0) - coreColumns.length);
25
+ const numExtraColumns = Math.max(0, (((_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t').length) || 0) - coreColumns.length);
26
26
  const extraNames = (lastHeaderLine === null || lastHeaderLine === void 0 ? void 0 : lastHeaderLine.includes('\t'))
27
27
  ? lastHeaderLine
28
28
  .slice(1)
@@ -1,21 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { DataGrid, GridToolbar, useGridApiRef } from '@mui/x-data-grid';
2
+ import { DataGrid, useGridApiRef } from '@mui/x-data-grid';
3
3
  import { observer } from 'mobx-react';
4
4
  const SpreadsheetDataGrid = observer(function ({ model, }) {
5
5
  const { rows, dataGridColumns, visibleColumns } = model;
6
6
  const apiRef = useGridApiRef();
7
- return rows && dataGridColumns ? (_jsx(DataGrid, { apiRef: apiRef, checkboxSelection: true, disableRowSelectionOnClick: true, columnHeaderHeight: 35, columnVisibilityModel: visibleColumns, onFilterModelChange: () => {
7
+ return rows && dataGridColumns ? (_jsx(DataGrid, { apiRef: apiRef, checkboxSelection: true, columnHeaderHeight: 35, columnVisibilityModel: visibleColumns, onFilterModelChange: () => {
8
8
  setTimeout(() => {
9
- model.setVisibleRows(apiRef.current.state.visibleRowsLookup);
9
+ if (apiRef.current) {
10
+ model.setVisibleRows(apiRef.current.state.visibleRowsLookup);
11
+ }
10
12
  });
11
13
  }, onColumnVisibilityModelChange: n => {
12
14
  model.setVisibleColumns(n);
13
- }, rowHeight: 25, hideFooter: rows.length < 100, slots: {
14
- toolbar: GridToolbar,
15
- }, slotProps: {
15
+ }, rowHeight: 25, hideFooter: rows.length < 100, slotProps: {
16
16
  toolbar: {
17
17
  showQuickFilter: true,
18
18
  },
19
- }, rows: rows, columns: dataGridColumns })) : null;
19
+ }, showToolbar: true, rows: rows, columns: dataGridColumns })) : null;
20
20
  });
21
21
  export default SpreadsheetDataGrid;
@@ -1,14 +1,14 @@
1
1
  import { isNumber } from './isNumber';
2
2
  import { bufferToLines, parseStrand } from './util';
3
3
  export function parseBedBuffer(buffer) {
4
- var _a, _b;
4
+ var _a;
5
5
  const lines = bufferToLines(buffer);
6
6
  const rest = lines.filter(line => !(line.startsWith('#') ||
7
7
  line.startsWith('browser') ||
8
8
  line.startsWith('track')));
9
9
  const lastHeaderLine = lines.findLast(line => line.startsWith('#'));
10
10
  const coreColumns = ['refName', 'start', 'end'];
11
- const numExtraColumns = Math.max(0, (((_b = (_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t')) === null || _b === void 0 ? void 0 : _b.length) || 0) - coreColumns.length);
11
+ const numExtraColumns = Math.max(0, (((_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t').length) || 0) - coreColumns.length);
12
12
  const extraNames = (lastHeaderLine === null || lastHeaderLine === void 0 ? void 0 : lastHeaderLine.includes('\t'))
13
13
  ? lastHeaderLine
14
14
  .slice(1)
@@ -1,7 +1,7 @@
1
1
  import { isNumber } from '@mui/x-data-grid/internals';
2
2
  import { bufferToLines, parseStrand } from './util';
3
3
  export function parseBedPEBuffer(buffer) {
4
- var _a, _b;
4
+ var _a;
5
5
  const lines = bufferToLines(buffer);
6
6
  const rest = lines.filter(line => !(line.startsWith('#') ||
7
7
  line.startsWith('browser') ||
@@ -19,7 +19,7 @@ export function parseBedPEBuffer(buffer) {
19
19
  'strand',
20
20
  'mateStrand',
21
21
  ];
22
- const numExtraColumns = Math.max(0, (((_b = (_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t')) === null || _b === void 0 ? void 0 : _b.length) || 0) - coreColumns.length);
22
+ const numExtraColumns = Math.max(0, (((_a = rest[0]) === null || _a === void 0 ? void 0 : _a.split('\t').length) || 0) - coreColumns.length);
23
23
  const extraNames = (lastHeaderLine === null || lastHeaderLine === void 0 ? void 0 : lastHeaderLine.includes('\t'))
24
24
  ? lastHeaderLine
25
25
  .slice(1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-spreadsheet-view",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "JBrowse 2 spreadsheet view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -38,12 +38,12 @@
38
38
  "dependencies": {
39
39
  "@gmod/bgzf-filehandle": "^2.0.1",
40
40
  "@gmod/vcf": "^6.0.8",
41
- "@jbrowse/core": "^3.1.0",
42
- "@jbrowse/plugin-linear-genome-view": "^3.1.0",
43
- "@jbrowse/plugin-variants": "^3.1.0",
44
- "@mui/icons-material": "^6.0.0",
45
- "@mui/material": "^6.0.0",
46
- "@mui/x-data-grid": "^7.0.0",
41
+ "@jbrowse/core": "^3.3.0",
42
+ "@jbrowse/plugin-linear-genome-view": "^3.3.0",
43
+ "@jbrowse/plugin-variants": "^3.3.0",
44
+ "@mui/icons-material": "^7.0.0",
45
+ "@mui/material": "^7.0.0",
46
+ "@mui/x-data-grid": "^8.0.0",
47
47
  "mobx": "^6.0.0",
48
48
  "mobx-react": "^9.0.0",
49
49
  "mobx-state-tree": "^5.0.0",
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "91492049ddea0aed90eb24d3c066c2d9f5a6b189"
63
+ "gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
64
64
  }