@instructure/ui-table 10.0.1-snapshot-13 → 10.1.1-snapshot-4973
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/CHANGELOG.md +9 -1
- package/es/Table/ColHeader/props.js +2 -1
- package/es/Table/Head/props.js +2 -1
- package/es/Table/__new-tests__/Table.test.js +6 -0
- package/lib/Table/ColHeader/props.js +2 -1
- package/lib/Table/Head/props.js +2 -1
- package/lib/Table/__new-tests__/Table.test.js +5 -0
- package/package.json +17 -17
- package/src/Table/ColHeader/props.ts +3 -0
- package/src/Table/Head/props.ts +3 -0
- package/src/Table/__new-tests__/Table.test.tsx +4 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Table/ColHeader/index.d.ts +2 -0
- package/types/Table/ColHeader/index.d.ts.map +1 -1
- package/types/Table/ColHeader/props.d.ts +1 -0
- package/types/Table/ColHeader/props.d.ts.map +1 -1
- package/types/Table/Head/index.d.ts +2 -0
- package/types/Table/Head/index.d.ts.map +1 -1
- package/types/Table/Head/props.d.ts +1 -0
- package/types/Table/Head/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,7 +3,15 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [10.
|
6
|
+
## [10.1.1-snapshot-4973](https://github.com/instructure/instructure-ui/compare/v10.0.0...v10.1.1-snapshot-4973) (2024-08-23)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @instructure/ui-table
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [10.1.0](https://github.com/instructure/instructure-ui/compare/v10.0.0...v10.1.0) (2024-08-23)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-table
|
9
17
|
|
@@ -24,6 +24,7 @@
|
|
24
24
|
|
25
25
|
import PropTypes from 'prop-types';
|
26
26
|
const propTypes = {
|
27
|
+
isStacked: PropTypes.bool,
|
27
28
|
id: PropTypes.string.isRequired,
|
28
29
|
stackedSortByLabel: PropTypes.string,
|
29
30
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
@@ -33,5 +34,5 @@ const propTypes = {
|
|
33
34
|
onRequestSort: PropTypes.func,
|
34
35
|
scope: PropTypes.oneOf(['row', 'col', 'rowgroup', 'colgroup', 'auto'])
|
35
36
|
};
|
36
|
-
const allowedProps = ['id', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
|
37
|
+
const allowedProps = ['id', 'isStacked', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
|
37
38
|
export { propTypes, allowedProps };
|
package/es/Table/Head/props.js
CHANGED
@@ -25,8 +25,9 @@
|
|
25
25
|
import PropTypes from 'prop-types';
|
26
26
|
const propTypes = {
|
27
27
|
children: PropTypes.node,
|
28
|
+
hover: PropTypes.bool,
|
28
29
|
isStacked: PropTypes.bool,
|
29
30
|
renderSortLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
30
31
|
};
|
31
|
-
const allowedProps = ['children', 'isStacked', 'renderSortLabel'];
|
32
|
+
const allowedProps = ['children', 'hover', 'isStacked', 'renderSortLabel'];
|
32
33
|
export { propTypes, allowedProps };
|
@@ -30,6 +30,9 @@ import { userEvent } from '@testing-library/user-event';
|
|
30
30
|
import '@testing-library/jest-dom';
|
31
31
|
import { Table } from '../index';
|
32
32
|
import { runAxeCheck } from '@instructure/ui-axe-check';
|
33
|
+
|
34
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
35
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
33
36
|
describe('<Table />', async () => {
|
34
37
|
let consoleErrorMock;
|
35
38
|
beforeEach(() => {
|
@@ -127,6 +130,9 @@ describe('<Table />', async () => {
|
|
127
130
|
expect(stackedTable).toBeInTheDocument();
|
128
131
|
expect(stackedTable).not.toHaveTextContent('Foo');
|
129
132
|
});
|
133
|
+
|
134
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
135
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
130
136
|
describe('when table is sortable', async () => {
|
131
137
|
const renderSortableTable = (props, handlers = {}, layout = 'auto') => render( /*#__PURE__*/React.createElement(Table, {
|
132
138
|
caption: "Sortable table",
|
@@ -31,6 +31,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
const propTypes = exports.propTypes = {
|
34
|
+
isStacked: _propTypes.default.bool,
|
34
35
|
id: _propTypes.default.string.isRequired,
|
35
36
|
stackedSortByLabel: _propTypes.default.string,
|
36
37
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
@@ -40,4 +41,4 @@ const propTypes = exports.propTypes = {
|
|
40
41
|
onRequestSort: _propTypes.default.func,
|
41
42
|
scope: _propTypes.default.oneOf(['row', 'col', 'rowgroup', 'colgroup', 'auto'])
|
42
43
|
};
|
43
|
-
const allowedProps = exports.allowedProps = ['id', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
|
44
|
+
const allowedProps = exports.allowedProps = ['id', 'isStacked', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
|
package/lib/Table/Head/props.js
CHANGED
@@ -32,7 +32,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
32
32
|
|
33
33
|
const propTypes = exports.propTypes = {
|
34
34
|
children: _propTypes.default.node,
|
35
|
+
hover: _propTypes.default.bool,
|
35
36
|
isStacked: _propTypes.default.bool,
|
36
37
|
renderSortLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
|
37
38
|
};
|
38
|
-
const allowedProps = exports.allowedProps = ['children', 'isStacked', 'renderSortLabel'];
|
39
|
+
const allowedProps = exports.allowedProps = ['children', 'hover', 'isStacked', 'renderSortLabel'];
|
@@ -32,6 +32,8 @@ var _Table$Head, _Table$Body, _Table, _Table2, _Table3, _Table$Body2;
|
|
32
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
33
33
|
* SOFTWARE.
|
34
34
|
*/
|
35
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
36
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
35
37
|
describe('<Table />', async () => {
|
36
38
|
let consoleErrorMock;
|
37
39
|
beforeEach(() => {
|
@@ -129,6 +131,9 @@ describe('<Table />', async () => {
|
|
129
131
|
expect(stackedTable).toBeInTheDocument();
|
130
132
|
expect(stackedTable).not.toHaveTextContent('Foo');
|
131
133
|
});
|
134
|
+
|
135
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
136
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
132
137
|
describe('when table is sortable', async () => {
|
133
138
|
const renderSortableTable = (props, handlers = {}, layout = 'auto') => (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.Table, {
|
134
139
|
caption: "Sortable table",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instructure/ui-table",
|
3
|
-
"version": "10.
|
3
|
+
"version": "10.1.1-snapshot-4973",
|
4
4
|
"description": "A styled HTML table component",
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
6
6
|
"module": "./es/index.js",
|
@@ -23,11 +23,11 @@
|
|
23
23
|
},
|
24
24
|
"license": "MIT",
|
25
25
|
"devDependencies": {
|
26
|
-
"@instructure/ui-axe-check": "10.
|
27
|
-
"@instructure/ui-babel-preset": "10.
|
28
|
-
"@instructure/ui-color-utils": "10.
|
29
|
-
"@instructure/ui-test-utils": "10.
|
30
|
-
"@instructure/ui-themes": "10.
|
26
|
+
"@instructure/ui-axe-check": "10.1.1-snapshot-4973",
|
27
|
+
"@instructure/ui-babel-preset": "10.1.1-snapshot-4973",
|
28
|
+
"@instructure/ui-color-utils": "10.1.1-snapshot-4973",
|
29
|
+
"@instructure/ui-test-utils": "10.1.1-snapshot-4973",
|
30
|
+
"@instructure/ui-themes": "10.1.1-snapshot-4973",
|
31
31
|
"@testing-library/jest-dom": "^6.4.6",
|
32
32
|
"@testing-library/react": "^15.0.7",
|
33
33
|
"@testing-library/user-event": "^14.5.2",
|
@@ -35,17 +35,17 @@
|
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
37
|
"@babel/runtime": "^7.24.5",
|
38
|
-
"@instructure/console": "10.
|
39
|
-
"@instructure/emotion": "10.
|
40
|
-
"@instructure/shared-types": "10.
|
41
|
-
"@instructure/ui-a11y-content": "10.
|
42
|
-
"@instructure/ui-icons": "10.
|
43
|
-
"@instructure/ui-prop-types": "10.
|
44
|
-
"@instructure/ui-react-utils": "10.
|
45
|
-
"@instructure/ui-simple-select": "10.
|
46
|
-
"@instructure/ui-testable": "10.
|
47
|
-
"@instructure/ui-utils": "10.
|
48
|
-
"@instructure/ui-view": "10.
|
38
|
+
"@instructure/console": "10.1.1-snapshot-4973",
|
39
|
+
"@instructure/emotion": "10.1.1-snapshot-4973",
|
40
|
+
"@instructure/shared-types": "10.1.1-snapshot-4973",
|
41
|
+
"@instructure/ui-a11y-content": "10.1.1-snapshot-4973",
|
42
|
+
"@instructure/ui-icons": "10.1.1-snapshot-4973",
|
43
|
+
"@instructure/ui-prop-types": "10.1.1-snapshot-4973",
|
44
|
+
"@instructure/ui-react-utils": "10.1.1-snapshot-4973",
|
45
|
+
"@instructure/ui-simple-select": "10.1.1-snapshot-4973",
|
46
|
+
"@instructure/ui-testable": "10.1.1-snapshot-4973",
|
47
|
+
"@instructure/ui-utils": "10.1.1-snapshot-4973",
|
48
|
+
"@instructure/ui-view": "10.1.1-snapshot-4973",
|
49
49
|
"prop-types": "^15.8.1"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
@@ -32,6 +32,7 @@ import type {
|
|
32
32
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
33
33
|
|
34
34
|
type TableColHeaderOwnProps = {
|
35
|
+
isStacked?: boolean // needed because it needs the same API as `Table.RowHeader`
|
35
36
|
/**
|
36
37
|
* A unique id for this column. The `id` is also used as option in combobox,
|
37
38
|
* when sortable table is in stacked layout,
|
@@ -85,6 +86,7 @@ type TableColHeaderStyle = ComponentStyle<
|
|
85
86
|
>
|
86
87
|
|
87
88
|
const propTypes: PropValidators<PropKeys> = {
|
89
|
+
isStacked: PropTypes.bool,
|
88
90
|
id: PropTypes.string.isRequired,
|
89
91
|
stackedSortByLabel: PropTypes.string,
|
90
92
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
@@ -97,6 +99,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
97
99
|
|
98
100
|
const allowedProps: AllowedPropKeys = [
|
99
101
|
'id',
|
102
|
+
'isStacked',
|
100
103
|
'stackedSortByLabel',
|
101
104
|
'children',
|
102
105
|
'width',
|
package/src/Table/Head/props.ts
CHANGED
@@ -34,6 +34,7 @@ import type {
|
|
34
34
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
35
35
|
|
36
36
|
type TableHeadOwnProps = {
|
37
|
+
hover?: boolean // needed because it needs the same API as `Table.Body`
|
37
38
|
isStacked?: boolean
|
38
39
|
renderSortLabel?: Renderable
|
39
40
|
/**
|
@@ -53,12 +54,14 @@ type TableHeadStyle = ComponentStyle<'head'>
|
|
53
54
|
|
54
55
|
const propTypes: PropValidators<PropKeys> = {
|
55
56
|
children: PropTypes.node,
|
57
|
+
hover: PropTypes.bool,
|
56
58
|
isStacked: PropTypes.bool,
|
57
59
|
renderSortLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
58
60
|
}
|
59
61
|
|
60
62
|
const allowedProps: AllowedPropKeys = [
|
61
63
|
'children',
|
64
|
+
'hover',
|
62
65
|
'isStacked',
|
63
66
|
'renderSortLabel'
|
64
67
|
]
|
@@ -33,6 +33,8 @@ import type { TableProps } from '../props'
|
|
33
33
|
import type { TableColHeaderProps } from '../ColHeader/props'
|
34
34
|
import { runAxeCheck } from '@instructure/ui-axe-check'
|
35
35
|
|
36
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
37
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
36
38
|
describe('<Table />', async () => {
|
37
39
|
let consoleErrorMock: any
|
38
40
|
|
@@ -167,6 +169,8 @@ describe('<Table />', async () => {
|
|
167
169
|
expect(stackedTable).not.toHaveTextContent('Foo')
|
168
170
|
})
|
169
171
|
|
172
|
+
// see https://github.com/vitest-dev/eslint-plugin-vitest/issues/511
|
173
|
+
// eslint-disable-next-line vitest/valid-describe-callback
|
170
174
|
describe('when table is sortable', async () => {
|
171
175
|
const renderSortableTable = (
|
172
176
|
props: TableColHeaderProps | null,
|