@vitessce/feature-list 3.1.1 → 3.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureListOptions.d.ts","sourceRoot":"","sources":["../src/FeatureListOptions.js"],"names":[],"mappings":"AAMA,oEA8FC"}
1
+ {"version":3,"file":"FeatureListOptions.d.ts","sourceRoot":"","sources":["../src/FeatureListOptions.js"],"names":[],"mappings":"AAMA,oEAqGC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import React from 'react';
2
+ import React, { useId } from 'react';
3
3
  import { OptionsContainer, OptionSelect, usePlotOptionsStyles } from '@vitessce/vit-s';
4
4
  import { TableCell, TableRow, Checkbox } from '@material-ui/core';
5
5
  import { FEATURELIST_SORT_OPTIONS, ALT_COLNAME } from './constants.js';
6
6
  export default function FeatureListOptions(props) {
7
7
  const { children, featureListSort, setFeatureListSort, featureListSortKey, setFeatureListSortKey, showFeatureTable, setShowFeatureTable, hasFeatureLabels, primaryColumnName, } = props;
8
+ const featureListId = useId();
8
9
  function handleFeatureListSortChange(event) {
9
10
  setFeatureListSort(event.target.value);
10
11
  }
@@ -15,9 +16,13 @@ export default function FeatureListOptions(props) {
15
16
  setShowFeatureTable(event.target.checked);
16
17
  }
17
18
  const classes = usePlotOptionsStyles();
18
- return (_jsxs(OptionsContainer, { children: [children, _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, htmlFor: "feature-list-sort-option-select", children: "Sort Ordering" }), _jsx(TableCell, { children: _jsx(OptionSelect, { className: classes.select, value: featureListSort, onChange: handleFeatureListSortChange, inputProps: {
19
- id: 'feature-list-sort-option-select',
20
- }, 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, htmlFor: "feature-list-sort-key-select", children: "Sort Key" }), _jsx(TableCell, { children: _jsx(OptionSelect, { className: classes.select, disabled: featureListSort === 'original', value: featureListSortKey, onChange: handleFeatureListSortKeyChange, inputProps: {
21
- id: 'feature-list-sort-key-select',
22
- }, 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, children: "Show Alternate IDs" }), _jsx(TableCell, { className: classes.inputCell, children: _jsx(Checkbox, { className: classes.tableCheckbox, checked: showFeatureTable, onChange: handleShowTableChange, name: "feature-list-show-table", color: "default" }) })] })] })) : null] }));
19
+ 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: {
20
+ id: `feature-list-sort-option-${featureListId}`,
21
+ }, 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: {
22
+ 'aria-label': 'Select the feature list sort key',
23
+ id: `feature-list-sort-key-${featureListId}`,
24
+ }, 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", inputProps: {
25
+ 'aria-label': 'Show or hide alternative feature ids',
26
+ id: `feature-list-show-alternative-ids-${featureListId}`,
27
+ } }) })] })] })) : null] }));
23
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureListSubscriber.d.ts","sourceRoot":"","sources":["../src/FeatureListSubscriber.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAlByB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,sBAAsB,EAApC,MAAM;IAEQ,4BAA4B,EAA1C,MAAM;IAES,iBAAiB,EAAhC,OAAO;IAEQ,SAAS,EAAxB,OAAO;IAC0B,IAAI,EAArC,cAAc,GAAC,UAAU;IAGkB,OAAO,EAAlD,cAAc,GAAC,eAAe,GAAC,IAAI;gBAgH7C"}
1
+ {"version":3,"file":"FeatureListSubscriber.d.ts","sourceRoot":"","sources":["../src/FeatureListSubscriber.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAlByB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,sBAAsB,EAApC,MAAM;IAEQ,4BAA4B,EAA1C,MAAM;IAES,iBAAiB,EAAhC,OAAO;IAEQ,SAAS,EAAxB,OAAO;IAC0B,IAAI,EAArC,cAAc,GAAC,UAAU;IAGkB,OAAO,EAAlD,cAAc,GAAC,eAAe,GAAC,IAAI;gBAgH7C"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React, { useState } from 'react';
3
- import plur from 'plur';
4
- import { capitalize, commaNumber } from '@vitessce/utils';
3
+ import { pluralize as plur, capitalize, commaNumber } from '@vitessce/utils';
5
4
  import { TitleInfo, useReady, useUrls, useFeatureLabelsData, useObsFeatureMatrixIndices, useCoordination, useLoaders, } from '@vitessce/vit-s';
6
5
  import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
7
6
  import FeatureList from './FeatureList.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/feature-list",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,12 +19,11 @@
19
19
  "@material-ui/core": "~4.12.3",
20
20
  "clsx": "^1.1.1",
21
21
  "lodash-es": "^4.17.21",
22
- "plur": "^5.1.0",
23
22
  "react-virtualized": "^9.22.2",
24
23
  "uuid": "^9.0.0",
25
- "@vitessce/constants-internal": "3.1.1",
26
- "@vitessce/utils": "3.1.1",
27
- "@vitessce/vit-s": "3.1.1"
24
+ "@vitessce/constants-internal": "3.1.2",
25
+ "@vitessce/utils": "3.1.2",
26
+ "@vitessce/vit-s": "3.1.2"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@testing-library/jest-dom": "^5.16.4",
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useId } from 'react';
2
2
  import { OptionsContainer, OptionSelect, usePlotOptionsStyles } from '@vitessce/vit-s';
3
3
  import { TableCell, TableRow, Checkbox } from '@material-ui/core';
4
4
  import { FEATURELIST_SORT_OPTIONS, ALT_COLNAME } from './constants.js';
@@ -17,6 +17,8 @@ export default function FeatureListOptions(props) {
17
17
  primaryColumnName,
18
18
  } = props;
19
19
 
20
+ const featureListId = useId();
21
+
20
22
  function handleFeatureListSortChange(event) {
21
23
  setFeatureListSort(event.target.value);
22
24
  }
@@ -35,16 +37,16 @@ export default function FeatureListOptions(props) {
35
37
  <OptionsContainer>
36
38
  {children}
37
39
  <TableRow>
38
- <TableCell className={classes.labelCell} htmlFor="feature-list-sort-option-select">
39
- Sort Ordering
40
+ <TableCell className={classes.labelCell} variant="head" scope="row">
41
+ <label htmlFor={`feature-list-sort-option-${featureListId}`}>Sort Ordering</label>
40
42
  </TableCell>
41
- <TableCell>
43
+ <TableCell variant="body">
42
44
  <OptionSelect
43
45
  className={classes.select}
44
46
  value={featureListSort}
45
47
  onChange={handleFeatureListSortChange}
46
48
  inputProps={{
47
- id: 'feature-list-sort-option-select',
49
+ id: `feature-list-sort-option-${featureListId}`,
48
50
  }}
49
51
  >
50
52
  {FEATURELIST_SORT_OPTIONS.map(option => (
@@ -56,17 +58,18 @@ export default function FeatureListOptions(props) {
56
58
  {hasFeatureLabels ? (
57
59
  <>
58
60
  <TableRow>
59
- <TableCell className={classes.labelCell} htmlFor="feature-list-sort-key-select">
60
- Sort Key
61
+ <TableCell className={classes.labelCell} variant="head" scope="row">
62
+ <label htmlFor={`feature-list-sort-key-${featureListId}`}>Sort Key</label>
61
63
  </TableCell>
62
- <TableCell>
64
+ <TableCell variant="body">
63
65
  <OptionSelect
64
66
  className={classes.select}
65
67
  disabled={featureListSort === 'original'}
66
68
  value={featureListSortKey}
67
69
  onChange={handleFeatureListSortKeyChange}
68
70
  inputProps={{
69
- id: 'feature-list-sort-key-select',
71
+ 'aria-label': 'Select the feature list sort key',
72
+ id: `feature-list-sort-key-${featureListId}`,
70
73
  }}
71
74
  >
72
75
  {hasFeatureLabels ? (
@@ -81,16 +84,20 @@ export default function FeatureListOptions(props) {
81
84
  </TableCell>
82
85
  </TableRow>
83
86
  <TableRow>
84
- <TableCell className={classes.labelCell}>
85
- Show Alternate IDs
87
+ <TableCell className={classes.labelCell} variant="head" scope="row">
88
+ <label htmlFor={`feature-list-show-alternative-ids-${featureListId}`}>Show Alternate IDs</label>
86
89
  </TableCell>
87
- <TableCell className={classes.inputCell}>
90
+ <TableCell className={classes.inputCell} variant="body">
88
91
  <Checkbox
89
92
  className={classes.tableCheckbox}
90
93
  checked={showFeatureTable}
91
94
  onChange={handleShowTableChange}
92
95
  name="feature-list-show-table"
93
96
  color="default"
97
+ inputProps={{
98
+ 'aria-label': 'Show or hide alternative feature ids',
99
+ id: `feature-list-show-alternative-ids-${featureListId}`,
100
+ }}
94
101
  />
95
102
  </TableCell>
96
103
  </TableRow>
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import plur from 'plur';
3
- import { capitalize, commaNumber } from '@vitessce/utils';
2
+ import { pluralize as plur, capitalize, commaNumber } from '@vitessce/utils';
4
3
  import {
5
4
  TitleInfo,
6
5
  useReady, useUrls,