@vitessce/feature-list 3.5.12 → 3.6.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/dist/index.js +19021 -12727
- package/dist-tsc/FeatureList.js +3 -3
- package/dist-tsc/FeatureListOptions.js +6 -6
- package/dist-tsc/selectable-table/SelectableTable.d.ts.map +1 -1
- package/dist-tsc/selectable-table/SelectableTable.js +2 -6
- package/dist-tsc/selectable-table/SelectableTable.test.js +3 -7
- package/dist-tsc/selectable-table/styles.d.ts +9 -1
- package/dist-tsc/selectable-table/styles.d.ts.map +1 -1
- package/dist-tsc/selectable-table/styles.js +2 -2
- package/package.json +13 -12
- package/src/FeatureList.js +3 -3
- package/src/FeatureListOptions.js +4 -4
- package/src/selectable-table/SelectableTable.js +2 -6
- package/src/selectable-table/SelectableTable.test.jsx +3 -10
- package/src/selectable-table/styles.js +2 -2
package/dist-tsc/FeatureList.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
3
3
|
import { every } from 'lodash-es';
|
|
4
|
-
import { makeStyles } from '@
|
|
4
|
+
import { makeStyles } from '@vitessce/styles';
|
|
5
5
|
import { cleanFeatureId } from '@vitessce/utils';
|
|
6
6
|
import { SelectableTable } from './selectable-table/index.js';
|
|
7
7
|
import { ALT_COLNAME } from './constants.js';
|
|
8
|
-
const useStyles = makeStyles(() => ({
|
|
8
|
+
const useStyles = makeStyles()(() => ({
|
|
9
9
|
searchBar: {
|
|
10
10
|
marginBottom: '4px',
|
|
11
11
|
border: '0',
|
|
@@ -15,7 +15,7 @@ const useStyles = makeStyles(() => ({
|
|
|
15
15
|
}));
|
|
16
16
|
export default function FeatureList(props) {
|
|
17
17
|
const { hasColorEncoding, geneList = [], featureLabelsMap, geneSelection = [], geneFilter = null, setGeneSelection, enableMultiSelect, showFeatureTable, featureListSort, featureListSortKey, hasFeatureLabels, primaryColumnName, } = props;
|
|
18
|
-
const classes = useStyles();
|
|
18
|
+
const { classes } = useStyles();
|
|
19
19
|
const [searchTerm, setSearchTerm] = useState('');
|
|
20
20
|
const [searchResults, setSearchResults] = useState(geneList);
|
|
21
21
|
// In FeatureListSubscriber, we think in terms of 'featureIndex' and 'featureLabels'.
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useId } from 'react-aria';
|
|
4
4
|
import { OptionsContainer, OptionSelect, usePlotOptionsStyles } from '@vitessce/vit-s';
|
|
5
|
-
import { TableCell, TableRow, Checkbox } from '@
|
|
5
|
+
import { TableCell, TableRow, Checkbox } from '@vitessce/styles';
|
|
6
6
|
import { FEATURELIST_SORT_OPTIONS, ALT_COLNAME } from './constants.js';
|
|
7
7
|
export default function FeatureListOptions(props) {
|
|
8
8
|
const { children, featureListSort, setFeatureListSort, featureListSortKey, setFeatureListSortKey, showFeatureTable, setShowFeatureTable, hasFeatureLabels, primaryColumnName, } = props;
|
|
@@ -16,14 +16,14 @@ export default function FeatureListOptions(props) {
|
|
|
16
16
|
function handleShowTableChange(event) {
|
|
17
17
|
setShowFeatureTable(event.target.checked);
|
|
18
18
|
}
|
|
19
|
-
const classes = usePlotOptionsStyles();
|
|
19
|
+
const { classes } = usePlotOptionsStyles();
|
|
20
20
|
return (_jsxs(OptionsContainer, { children: [children, _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `feature-list-sort-option-${featureListId}`, children: "Sort Ordering" }) }), _jsx(TableCell, { variant: "body", children: _jsx(OptionSelect, { className: classes.select, value: featureListSort, onChange: handleFeatureListSortChange, inputProps: {
|
|
21
21
|
id: `feature-list-sort-option-${featureListId}`,
|
|
22
22
|
}, children: FEATURELIST_SORT_OPTIONS.map(option => (_jsx("option", { value: option, children: option }, option))) }) })] }), hasFeatureLabels ? (_jsxs(_Fragment, { children: [_jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `feature-list-sort-key-${featureListId}`, children: "Sort Key" }) }), _jsx(TableCell, { variant: "body", children: _jsx(OptionSelect, { className: classes.select, disabled: featureListSort === 'original', value: featureListSortKey, onChange: handleFeatureListSortKeyChange, inputProps: {
|
|
23
23
|
'aria-label': 'Select the feature list sort key',
|
|
24
24
|
id: `feature-list-sort-key-${featureListId}`,
|
|
25
|
-
}, children: hasFeatureLabels ? (_jsxs(_Fragment, { children: [_jsx("option", { value: "featureLabels", children: primaryColumnName }), _jsx("option", { value: "featureIndex", children: ALT_COLNAME })] })) : (_jsx("option", { value: "featureIndex", children: primaryColumnName })) }) })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `feature-list-show-alternative-ids-${featureListId}`, children: "Show Alternate IDs" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(Checkbox, { className: classes.tableCheckbox, checked: showFeatureTable, onChange: handleShowTableChange, name: "feature-list-show-table", color: "default",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
}, children: hasFeatureLabels ? (_jsxs(_Fragment, { children: [_jsx("option", { value: "featureLabels", children: primaryColumnName }), _jsx("option", { value: "featureIndex", children: ALT_COLNAME })] })) : (_jsx("option", { value: "featureIndex", children: primaryColumnName })) }) })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `feature-list-show-alternative-ids-${featureListId}`, children: "Show Alternate IDs" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(Checkbox, { className: classes.tableCheckbox, checked: showFeatureTable, onChange: handleShowTableChange, name: "feature-list-show-table", color: "default", slotProps: { input: {
|
|
26
|
+
'aria-label': 'Show or hide alternative feature ids',
|
|
27
|
+
id: `feature-list-show-alternative-ids-${featureListId}`,
|
|
28
|
+
} } }) })] })] })) : null] }));
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableTable.d.ts","sourceRoot":"","sources":["../../src/selectable-table/SelectableTable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectableTable.d.ts","sourceRoot":"","sources":["../../src/selectable-table/SelectableTable.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;GAkBG;AACH,iEAyLC"}
|
|
@@ -3,11 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
4
4
|
/* eslint-disable max-len */
|
|
5
5
|
import React, { useEffect, useCallback, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
// because the ESM version is broken.
|
|
8
|
-
// Reference: https://github.com/bvaughn/react-virtualized/issues/1632
|
|
9
|
-
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer/index.js';
|
|
10
|
-
import { Table } from 'react-virtualized/dist/commonjs/Table/index.js';
|
|
6
|
+
import { AutoSizer, Table } from 'react-virtualized';
|
|
11
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
12
8
|
import { union, difference, isEqual } from 'lodash-es';
|
|
13
9
|
import clsx from 'clsx';
|
|
@@ -124,7 +120,7 @@ export default function SelectableTable(props) {
|
|
|
124
120
|
onChange(null);
|
|
125
121
|
}
|
|
126
122
|
}, [selectedRows, allowMultiple]);
|
|
127
|
-
const classes = useStyles();
|
|
123
|
+
const { classes } = useStyles();
|
|
128
124
|
// Generate a unique ID to use in (for, id) label-input pairs.
|
|
129
125
|
const inputUuid = uuidv4();
|
|
130
126
|
const rowRenderer = ({ index, style }) => (
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import { cleanup, render, screen, } from '@testing-library/react';
|
|
5
|
-
import userEvent from '@testing-library/user-event';
|
|
6
2
|
import React from 'react';
|
|
3
|
+
import { describe, it, expect } from 'vitest';
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
7
6
|
import SelectableTable from './SelectableTable.js';
|
|
8
7
|
const user = userEvent.setup();
|
|
9
|
-
afterEach(() => {
|
|
10
|
-
cleanup();
|
|
11
|
-
});
|
|
12
8
|
const tableData = [
|
|
13
9
|
{
|
|
14
10
|
X: 'X1',
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export const useStyles: (
|
|
1
|
+
export const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
2
|
+
props: Record<string, unknown>;
|
|
3
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
4
|
+
} | undefined) => {
|
|
5
|
+
classes: Record<"selectableTable" | "tableRow" | "tableItem" | "tableCell" | "inputContainer" | "hiddenInputColumn" | "radioOrCheckbox" | "tableRadio" | "tableCheckbox", string>;
|
|
6
|
+
theme: import("@mui/material").Theme;
|
|
7
|
+
css: import("tss-react").Css;
|
|
8
|
+
cx: import("tss-react").Cx;
|
|
9
|
+
};
|
|
2
10
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/selectable-table/styles.js"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/selectable-table/styles.js"],"names":[],"mappings":"AAGA;;cAoB2D,CAAC;;;kBAEO,eAAsB;gBAGrF,WAEH;eACO,WAAU;EA2Cd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
|
-
import { makeStyles } from '@
|
|
3
|
-
export const useStyles = makeStyles(theme => ({
|
|
2
|
+
import { makeStyles } from '@vitessce/styles';
|
|
3
|
+
export const useStyles = makeStyles()(theme => ({
|
|
4
4
|
selectableTable: {
|
|
5
5
|
flex: '1 1 auto',
|
|
6
6
|
outline: 'none',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/feature-list",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,26 +16,27 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@material-ui/core": "~4.12.3",
|
|
20
19
|
"clsx": "^1.1.1",
|
|
21
20
|
"lodash-es": "^4.17.21",
|
|
22
|
-
"react-virtualized": "^9.22.
|
|
21
|
+
"react-virtualized": "^9.22.6",
|
|
23
22
|
"uuid": "^9.0.0",
|
|
24
23
|
"react-aria": "^3.28.0",
|
|
25
|
-
"@vitessce/
|
|
26
|
-
"@vitessce/
|
|
27
|
-
"@vitessce/
|
|
24
|
+
"@vitessce/styles": "3.6.1",
|
|
25
|
+
"@vitessce/constants-internal": "3.6.1",
|
|
26
|
+
"@vitessce/utils": "3.6.1",
|
|
27
|
+
"@vitessce/vit-s": "3.6.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@testing-library/jest-dom": "^
|
|
31
|
-
"@testing-library/react": "^
|
|
32
|
-
"@testing-library/user-event": "^14.
|
|
30
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
31
|
+
"@testing-library/react": "^16.3.0",
|
|
32
|
+
"@testing-library/user-event": "^14.6.1",
|
|
33
33
|
"react": "^18.0.0",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"react-dom": "^18.0.0",
|
|
35
|
+
"vite": "^6.3.5",
|
|
36
|
+
"vitest": "^3.1.4"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
39
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
package/src/FeatureList.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
2
2
|
import { every } from 'lodash-es';
|
|
3
|
-
import { makeStyles } from '@
|
|
3
|
+
import { makeStyles } from '@vitessce/styles';
|
|
4
4
|
import { cleanFeatureId } from '@vitessce/utils';
|
|
5
5
|
import { SelectableTable } from './selectable-table/index.js';
|
|
6
6
|
import { ALT_COLNAME } from './constants.js';
|
|
7
7
|
|
|
8
|
-
const useStyles = makeStyles(() => ({
|
|
8
|
+
const useStyles = makeStyles()(() => ({
|
|
9
9
|
searchBar: {
|
|
10
10
|
marginBottom: '4px',
|
|
11
11
|
border: '0',
|
|
@@ -30,7 +30,7 @@ export default function FeatureList(props) {
|
|
|
30
30
|
primaryColumnName,
|
|
31
31
|
} = props;
|
|
32
32
|
|
|
33
|
-
const classes = useStyles();
|
|
33
|
+
const { classes } = useStyles();
|
|
34
34
|
|
|
35
35
|
const [searchTerm, setSearchTerm] = useState('');
|
|
36
36
|
const [searchResults, setSearchResults] = useState(geneList);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useId } from 'react-aria';
|
|
3
3
|
import { OptionsContainer, OptionSelect, usePlotOptionsStyles } from '@vitessce/vit-s';
|
|
4
|
-
import { TableCell, TableRow, Checkbox } from '@
|
|
4
|
+
import { TableCell, TableRow, Checkbox } from '@vitessce/styles';
|
|
5
5
|
import { FEATURELIST_SORT_OPTIONS, ALT_COLNAME } from './constants.js';
|
|
6
6
|
|
|
7
7
|
|
|
@@ -32,7 +32,7 @@ export default function FeatureListOptions(props) {
|
|
|
32
32
|
setShowFeatureTable(event.target.checked);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const classes = usePlotOptionsStyles();
|
|
35
|
+
const { classes } = usePlotOptionsStyles();
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<OptionsContainer>
|
|
@@ -95,10 +95,10 @@ export default function FeatureListOptions(props) {
|
|
|
95
95
|
onChange={handleShowTableChange}
|
|
96
96
|
name="feature-list-show-table"
|
|
97
97
|
color="default"
|
|
98
|
-
|
|
98
|
+
slotProps={{ input: {
|
|
99
99
|
'aria-label': 'Show or hide alternative feature ids',
|
|
100
100
|
id: `feature-list-show-alternative-ids-${featureListId}`,
|
|
101
|
-
}}
|
|
101
|
+
} }}
|
|
102
102
|
/>
|
|
103
103
|
</TableCell>
|
|
104
104
|
</TableRow>
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
/* eslint-disable max-len */
|
|
4
4
|
import React, { useEffect, useCallback, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
// because the ESM version is broken.
|
|
7
|
-
// Reference: https://github.com/bvaughn/react-virtualized/issues/1632
|
|
8
|
-
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer/index.js';
|
|
9
|
-
import { Table } from 'react-virtualized/dist/commonjs/Table/index.js';
|
|
5
|
+
import { AutoSizer, Table } from 'react-virtualized';
|
|
10
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
7
|
import { union, difference, isEqual } from 'lodash-es';
|
|
12
8
|
import clsx from 'clsx';
|
|
@@ -151,7 +147,7 @@ export default function SelectableTable(props) {
|
|
|
151
147
|
}
|
|
152
148
|
}, [selectedRows, allowMultiple]);
|
|
153
149
|
|
|
154
|
-
const classes = useStyles();
|
|
150
|
+
const { classes } = useStyles();
|
|
155
151
|
|
|
156
152
|
// Generate a unique ID to use in (for, id) label-input pairs.
|
|
157
153
|
const inputUuid = uuidv4();
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import {
|
|
4
|
-
cleanup, render, screen,
|
|
5
|
-
} from '@testing-library/react';
|
|
6
|
-
import userEvent from '@testing-library/user-event';
|
|
7
1
|
import React from 'react';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
8
5
|
|
|
9
6
|
import SelectableTable from './SelectableTable.js';
|
|
10
7
|
|
|
11
8
|
const user = userEvent.setup();
|
|
12
9
|
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
cleanup();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
10
|
const tableData = [
|
|
18
11
|
{
|
|
19
12
|
X: 'X1',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
|
-
import { makeStyles } from '@
|
|
2
|
+
import { makeStyles } from '@vitessce/styles';
|
|
3
3
|
|
|
4
|
-
export const useStyles = makeStyles(theme => ({
|
|
4
|
+
export const useStyles = makeStyles()(theme => ({
|
|
5
5
|
selectableTable: {
|
|
6
6
|
flex: '1 1 auto',
|
|
7
7
|
outline: 'none',
|