@instructure/ui-table 8.8.1-snapshot.3 → 8.9.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.
- package/CHANGELOG.md +6 -0
- package/es/Table/Body/index.js +17 -29
- package/{src/Table/Cell/types.ts → es/Table/Body/props.js} +14 -8
- package/es/Table/Cell/index.js +17 -29
- package/{src/Table/types.ts → es/Table/Cell/props.js} +12 -11
- package/es/Table/ColHeader/index.js +22 -63
- package/es/Table/ColHeader/props.js +66 -0
- package/es/Table/Head/index.js +18 -29
- package/{src/Table/Body/types.ts → es/Table/Head/props.js} +13 -8
- package/es/Table/Row/index.js +17 -29
- package/{src/Table/ColHeader/types.ts → es/Table/Row/props.js} +16 -12
- package/es/Table/RowHeader/index.js +16 -27
- package/{src/Table/Head/types.ts → es/Table/RowHeader/props.js} +11 -6
- package/es/Table/index.js +23 -62
- package/es/Table/props.js +66 -0
- package/lib/Table/Body/index.js +17 -30
- package/lib/Table/Body/props.js +50 -0
- package/lib/Table/Cell/index.js +17 -29
- package/lib/Table/Cell/props.js +47 -0
- package/lib/Table/ColHeader/index.js +22 -63
- package/lib/Table/ColHeader/props.js +77 -0
- package/lib/Table/Head/index.js +18 -30
- package/lib/Table/Head/props.js +49 -0
- package/lib/Table/Row/index.js +17 -30
- package/lib/Table/Row/props.js +54 -0
- package/lib/Table/RowHeader/index.js +16 -27
- package/lib/Table/RowHeader/props.js +46 -0
- package/lib/Table/index.js +22 -62
- package/lib/Table/props.js +81 -0
- package/package.json +17 -18
- package/src/Table/Body/index.tsx +8 -26
- package/src/Table/{Row/types.ts → Body/props.ts} +39 -3
- package/src/Table/Cell/index.tsx +9 -25
- package/src/Table/Cell/props.ts +62 -0
- package/src/Table/Cell/styles.ts +1 -1
- package/src/Table/ColHeader/index.tsx +9 -51
- package/src/Table/ColHeader/props.ts +94 -0
- package/src/Table/ColHeader/styles.ts +1 -1
- package/src/Table/Head/index.tsx +8 -24
- package/src/Table/Head/props.ts +62 -0
- package/src/Table/Row/index.tsx +9 -28
- package/src/Table/Row/props.ts +70 -0
- package/src/Table/Row/styles.ts +1 -1
- package/src/Table/RowHeader/index.tsx +9 -24
- package/src/Table/RowHeader/{types.ts → props.ts} +28 -3
- package/src/Table/RowHeader/styles.ts +1 -1
- package/src/Table/index.tsx +12 -51
- package/src/Table/props.ts +93 -0
- package/src/Table/styles.ts +1 -1
- package/src/index.ts +7 -7
- package/types/Table/Body/index.d.ts +13 -16
- package/types/Table/Body/index.d.ts.map +1 -1
- package/types/Table/Body/props.d.ts +17 -0
- package/types/Table/Body/props.d.ts.map +1 -0
- package/types/Table/Cell/index.d.ts +14 -14
- package/types/Table/Cell/index.d.ts.map +1 -1
- package/types/Table/Cell/props.d.ts +17 -0
- package/types/Table/Cell/props.d.ts.map +1 -0
- package/types/Table/Cell/styles.d.ts +1 -1
- package/types/Table/ColHeader/index.d.ts +22 -40
- package/types/Table/ColHeader/index.d.ts.map +1 -1
- package/types/Table/ColHeader/props.d.ts +21 -0
- package/types/Table/ColHeader/props.d.ts.map +1 -0
- package/types/Table/ColHeader/styles.d.ts +1 -1
- package/types/Table/Head/index.d.ts +11 -15
- package/types/Table/Head/index.d.ts.map +1 -1
- package/types/Table/Head/props.d.ts +16 -0
- package/types/Table/Head/props.d.ts.map +1 -0
- package/types/Table/Row/index.d.ts +14 -17
- package/types/Table/Row/index.d.ts.map +1 -1
- package/types/Table/Row/props.d.ts +17 -0
- package/types/Table/Row/props.d.ts.map +1 -0
- package/types/Table/Row/styles.d.ts +1 -1
- package/types/Table/RowHeader/index.d.ts +12 -13
- package/types/Table/RowHeader/index.d.ts.map +1 -1
- package/types/Table/RowHeader/props.d.ts +16 -0
- package/types/Table/RowHeader/props.d.ts.map +1 -0
- package/types/Table/RowHeader/styles.d.ts +1 -1
- package/types/Table/index.d.ts +18 -41
- package/types/Table/index.d.ts.map +1 -1
- package/types/Table/props.d.ts +19 -0
- package/types/Table/props.d.ts.map +1 -0
- package/types/Table/styles.d.ts +1 -1
- package/types/index.d.ts +7 -7
- package/LICENSE.md +0 -27
- package/es/Table/Body/types.js +0 -1
- package/es/Table/Cell/types.js +0 -1
- package/es/Table/ColHeader/types.js +0 -1
- package/es/Table/Head/types.js +0 -1
- package/es/Table/Row/types.js +0 -1
- package/es/Table/RowHeader/types.js +0 -1
- package/es/Table/types.js +0 -1
- package/lib/Table/Body/types.js +0 -1
- package/lib/Table/Cell/types.js +0 -1
- package/lib/Table/ColHeader/types.js +0 -1
- package/lib/Table/Head/types.js +0 -1
- package/lib/Table/Row/types.js +0 -1
- package/lib/Table/RowHeader/types.js +0 -1
- package/lib/Table/types.js +0 -1
- package/types/Table/Body/types.d.ts +0 -9
- package/types/Table/Body/types.d.ts.map +0 -1
- package/types/Table/Cell/types.d.ts +0 -9
- package/types/Table/Cell/types.d.ts.map +0 -1
- package/types/Table/ColHeader/types.d.ts +0 -12
- package/types/Table/ColHeader/types.d.ts.map +0 -1
- package/types/Table/Head/types.d.ts +0 -8
- package/types/Table/Head/types.d.ts.map +0 -1
- package/types/Table/Row/types.d.ts +0 -9
- package/types/Table/Row/types.d.ts.map +0 -1
- package/types/Table/RowHeader/types.d.ts +0 -7
- package/types/Table/RowHeader/types.d.ts.map +0 -1
- package/types/Table/types.d.ts +0 -12
- package/types/Table/types.d.ts.map +0 -1
@@ -22,9 +22,34 @@
|
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
import React from 'react'
|
26
|
+
import PropTypes from 'prop-types'
|
27
|
+
|
28
|
+
import type { PropValidators } from '@instructure/shared-types'
|
29
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
30
|
+
|
31
|
+
type TableRowHeaderOwnProps = {
|
28
32
|
isStacked?: boolean
|
29
33
|
textAlign?: 'start' | 'center' | 'end'
|
34
|
+
children?: React.ReactNode | ((...args: any[]) => React.ReactNode)
|
30
35
|
}
|
36
|
+
|
37
|
+
type PropKeys = keyof TableRowHeaderOwnProps
|
38
|
+
|
39
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
40
|
+
|
41
|
+
type TableRowHeaderProps = TableRowHeaderOwnProps & WithStyleProps
|
42
|
+
|
43
|
+
const propTypes: PropValidators<PropKeys> = {
|
44
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
45
|
+
isStacked: PropTypes.bool,
|
46
|
+
/**
|
47
|
+
* Control the text alignment in row header
|
48
|
+
*/
|
49
|
+
textAlign: PropTypes.oneOf(['start', 'center', 'end'])
|
50
|
+
}
|
51
|
+
|
52
|
+
const allowedProps: AllowedPropKeys = ['children', 'isStacked', 'textAlign']
|
53
|
+
|
54
|
+
export type { TableRowHeaderProps }
|
55
|
+
export { propTypes, allowedProps }
|
package/src/Table/index.tsx
CHANGED
@@ -24,18 +24,16 @@
|
|
24
24
|
|
25
25
|
/** @jsx jsx */
|
26
26
|
import { Component, Children, ReactElement } from 'react'
|
27
|
-
import PropTypes from 'prop-types'
|
28
27
|
|
29
28
|
import {
|
30
29
|
matchComponentTypes,
|
31
30
|
safeCloneElement,
|
32
31
|
omitProps
|
33
32
|
} from '@instructure/ui-react-utils'
|
34
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
35
33
|
import { View } from '@instructure/ui-view'
|
36
34
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
37
35
|
|
38
|
-
import { withStyle, jsx
|
36
|
+
import { withStyle, jsx } from '@instructure/emotion'
|
39
37
|
|
40
38
|
import generateStyle from './styles'
|
41
39
|
import generateComponentTheme from './theme'
|
@@ -46,7 +44,8 @@ import { Row } from './Row'
|
|
46
44
|
import { ColHeader } from './ColHeader'
|
47
45
|
import { RowHeader } from './RowHeader'
|
48
46
|
import { Cell } from './Cell'
|
49
|
-
import { TableProps } from './
|
47
|
+
import type { TableProps } from './props'
|
48
|
+
import { allowedProps, propTypes } from './props'
|
50
49
|
|
51
50
|
/**
|
52
51
|
---
|
@@ -57,48 +56,13 @@ category: components
|
|
57
56
|
class Table extends Component<TableProps> {
|
58
57
|
static readonly componentId = 'Table'
|
59
58
|
|
60
|
-
static
|
61
|
-
|
62
|
-
makeStyles: PropTypes.func,
|
63
|
-
// eslint-disable-next-line react/require-default-props
|
64
|
-
styles: PropTypes.object,
|
65
|
-
/**
|
66
|
-
* Provide a screen reader friendly description. Anything passed to this
|
67
|
-
* prop will be wrapped by `<ScreenReaderContent>` when it is rendered.
|
68
|
-
*/
|
69
|
-
caption: PropTypes.node.isRequired,
|
70
|
-
/**
|
71
|
-
* Build table via `Table.Head` and `Table.Body`
|
72
|
-
*/
|
73
|
-
children: ChildrenPropTypes.oneOf([Head, Body]),
|
74
|
-
/**
|
75
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
76
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
77
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
78
|
-
*/
|
79
|
-
margin: ThemeablePropTypes.spacing,
|
80
|
-
/**
|
81
|
-
* Provide a reference to the underlying html element
|
82
|
-
*/
|
83
|
-
elementRef: PropTypes.func,
|
84
|
-
/**
|
85
|
-
* Highlight each row on hover
|
86
|
-
*/
|
87
|
-
hover: PropTypes.bool,
|
88
|
-
/**
|
89
|
-
* `auto` lets the browser determine table column widths based on cell content,
|
90
|
-
* while `fixed` forces columns of equal width. `stacked` renders table in one
|
91
|
-
* column to be more readable on narrow screens
|
92
|
-
*/
|
93
|
-
layout: PropTypes.oneOf(['auto', 'fixed', 'stacked'])
|
94
|
-
}
|
59
|
+
static allowedProps = allowedProps
|
60
|
+
static propTypes = propTypes
|
95
61
|
|
96
62
|
static defaultProps = {
|
97
63
|
children: null,
|
98
64
|
hover: false,
|
99
|
-
layout: 'auto'
|
100
|
-
margin: undefined,
|
101
|
-
elementRef: undefined
|
65
|
+
layout: 'auto'
|
102
66
|
}
|
103
67
|
|
104
68
|
static Head = Head
|
@@ -109,14 +73,11 @@ class Table extends Component<TableProps> {
|
|
109
73
|
static Cell = Cell
|
110
74
|
|
111
75
|
componentDidMount() {
|
112
|
-
|
113
|
-
this.props.makeStyles()
|
76
|
+
this.props.makeStyles?.()
|
114
77
|
}
|
115
78
|
|
116
|
-
|
117
|
-
|
118
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
119
|
-
this.props.makeStyles()
|
79
|
+
componentDidUpdate() {
|
80
|
+
this.props.makeStyles?.()
|
120
81
|
}
|
121
82
|
|
122
83
|
getHeaders() {
|
@@ -158,9 +119,9 @@ class Table extends Component<TableProps> {
|
|
158
119
|
as={isStacked ? 'div' : 'table'}
|
159
120
|
margin={margin}
|
160
121
|
elementRef={elementRef}
|
161
|
-
css={styles
|
162
|
-
role={isStacked ? 'table' :
|
163
|
-
aria-label={isStacked ? (caption as string) :
|
122
|
+
css={styles?.table}
|
123
|
+
role={isStacked ? 'table' : undefined}
|
124
|
+
aria-label={isStacked ? (caption as string) : undefined}
|
164
125
|
>
|
165
126
|
{!isStacked && (
|
166
127
|
<caption>
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/*
|
2
|
+
* The MIT License (MIT)
|
3
|
+
*
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
14
|
+
* copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
* SOFTWARE.
|
23
|
+
*/
|
24
|
+
import React from 'react'
|
25
|
+
import PropTypes from 'prop-types'
|
26
|
+
|
27
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
28
|
+
import { ThemeablePropTypes } from '@instructure/emotion'
|
29
|
+
|
30
|
+
import { Head } from './Head'
|
31
|
+
import { Body } from './Body'
|
32
|
+
|
33
|
+
import type { Spacing, WithStyleProps } from '@instructure/emotion'
|
34
|
+
import type { PropValidators } from '@instructure/shared-types'
|
35
|
+
|
36
|
+
type TableOwnProps = {
|
37
|
+
caption: React.ReactNode
|
38
|
+
margin?: Spacing
|
39
|
+
elementRef?: (...args: any[]) => any
|
40
|
+
hover?: boolean
|
41
|
+
layout?: 'auto' | 'fixed' | 'stacked'
|
42
|
+
children?: React.ReactNode
|
43
|
+
}
|
44
|
+
|
45
|
+
type PropKeys = keyof TableOwnProps
|
46
|
+
|
47
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
48
|
+
|
49
|
+
type TableProps = TableOwnProps & WithStyleProps
|
50
|
+
|
51
|
+
const propTypes: PropValidators<PropKeys> = {
|
52
|
+
/**
|
53
|
+
* Provide a screen reader friendly description. Anything passed to this
|
54
|
+
* prop will be wrapped by `<ScreenReaderContent>` when it is rendered.
|
55
|
+
*/
|
56
|
+
caption: PropTypes.node.isRequired,
|
57
|
+
/**
|
58
|
+
* Build table via `Table.Head` and `Table.Body`
|
59
|
+
*/
|
60
|
+
children: ChildrenPropTypes.oneOf([Head, Body]),
|
61
|
+
/**
|
62
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
63
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
64
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
65
|
+
*/
|
66
|
+
margin: ThemeablePropTypes.spacing,
|
67
|
+
/**
|
68
|
+
* Provide a reference to the underlying html element
|
69
|
+
*/
|
70
|
+
elementRef: PropTypes.func,
|
71
|
+
/**
|
72
|
+
* Highlight each row on hover
|
73
|
+
*/
|
74
|
+
hover: PropTypes.bool,
|
75
|
+
/**
|
76
|
+
* `auto` lets the browser determine table column widths based on cell content,
|
77
|
+
* while `fixed` forces columns of equal width. `stacked` renders table in one
|
78
|
+
* column to be more readable on narrow screens
|
79
|
+
*/
|
80
|
+
layout: PropTypes.oneOf(['auto', 'fixed', 'stacked'])
|
81
|
+
}
|
82
|
+
|
83
|
+
const allowedProps: AllowedPropKeys = [
|
84
|
+
'caption',
|
85
|
+
'children',
|
86
|
+
'margin',
|
87
|
+
'elementRef',
|
88
|
+
'hover',
|
89
|
+
'layout'
|
90
|
+
]
|
91
|
+
|
92
|
+
export type { TableProps }
|
93
|
+
export { propTypes, allowedProps }
|
package/src/Table/styles.ts
CHANGED
package/src/index.ts
CHANGED
@@ -23,10 +23,10 @@
|
|
23
23
|
*/
|
24
24
|
export { Table } from './Table'
|
25
25
|
|
26
|
-
export type { TableProps } from './Table/
|
27
|
-
export type { TableBodyProps } from './Table/Body/
|
28
|
-
export type { TableCellProps } from './Table/Cell/
|
29
|
-
export type { TableColHeaderProps } from './Table/ColHeader/
|
30
|
-
export type { TableHeadProps } from './Table/Head/
|
31
|
-
export type { TableRowProps } from './Table/Row/
|
32
|
-
export type { TableRowHeaderProps } from './Table/RowHeader/
|
26
|
+
export type { TableProps } from './Table/props'
|
27
|
+
export type { TableBodyProps } from './Table/Body/props'
|
28
|
+
export type { TableCellProps } from './Table/Cell/props'
|
29
|
+
export type { TableColHeaderProps } from './Table/ColHeader/props'
|
30
|
+
export type { TableHeadProps } from './Table/Head/props'
|
31
|
+
export type { TableRowProps } from './Table/Row/props'
|
32
|
+
export type { TableRowHeaderProps } from './Table/RowHeader/props'
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/** @jsx jsx */
|
2
2
|
import { Component } from 'react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
import { jsx } from '@instructure/emotion';
|
5
|
-
import { TableBodyProps } from './
|
4
|
+
import type { TableBodyProps } from './props';
|
6
5
|
/**
|
7
6
|
---
|
8
7
|
parent: Table
|
@@ -11,20 +10,18 @@ id: Table.Body
|
|
11
10
|
**/
|
12
11
|
declare class Body extends Component<TableBodyProps> {
|
13
12
|
static readonly componentId = "Table.Body";
|
14
|
-
static
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
headers: PropTypes.Requireable<(string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray | null | undefined)[]>;
|
27
|
-
};
|
13
|
+
static allowedProps: readonly (keyof {
|
14
|
+
hover?: boolean | undefined;
|
15
|
+
isStacked?: boolean | undefined;
|
16
|
+
headers?: (import("react").ReactNode | ((...args: any[]) => any))[] | undefined;
|
17
|
+
children?: import("react").ReactNode;
|
18
|
+
})[];
|
19
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
20
|
+
hover?: boolean | undefined;
|
21
|
+
isStacked?: boolean | undefined;
|
22
|
+
headers?: (import("react").ReactNode | ((...args: any[]) => any))[] | undefined;
|
23
|
+
children?: import("react").ReactNode;
|
24
|
+
}>;
|
28
25
|
static defaultProps: {
|
29
26
|
children: null;
|
30
27
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAQzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;MAElB;IAED,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAIjD,MAAM;CAwBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
4
|
+
declare type TableBodyOwnProps = {
|
5
|
+
hover?: boolean;
|
6
|
+
isStacked?: boolean;
|
7
|
+
headers?: (React.ReactNode | ((...args: any[]) => any))[];
|
8
|
+
children?: React.ReactNode;
|
9
|
+
};
|
10
|
+
declare type PropKeys = keyof TableBodyOwnProps;
|
11
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
12
|
+
declare type TableBodyProps = TableBodyOwnProps & WithStyleProps;
|
13
|
+
declare const propTypes: PropValidators<PropKeys>;
|
14
|
+
declare const allowedProps: AllowedPropKeys;
|
15
|
+
export type { TableBodyProps };
|
16
|
+
export { propTypes, allowedProps };
|
17
|
+
//# sourceMappingURL=props.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAA;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GAAG,cAAc,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAUvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAKnB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/** @jsx jsx */
|
2
2
|
import { Component } from 'react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
import { jsx } from '@instructure/emotion';
|
5
|
-
import { TableCellProps } from './
|
4
|
+
import type { TableCellProps } from './props';
|
6
5
|
/**
|
7
6
|
---
|
8
7
|
parent: Table
|
@@ -11,23 +10,24 @@ id: Table.Cell
|
|
11
10
|
**/
|
12
11
|
declare class Cell extends Component<TableCellProps> {
|
13
12
|
static readonly componentId = "Table.Cell";
|
14
|
-
static
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
textAlign
|
24
|
-
|
13
|
+
static allowedProps: readonly (keyof {
|
14
|
+
isStacked?: boolean | undefined;
|
15
|
+
header?: import("react").ReactNode | ((...args: any[]) => any);
|
16
|
+
textAlign?: "start" | "center" | "end" | undefined;
|
17
|
+
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
18
|
+
})[];
|
19
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
20
|
+
isStacked?: boolean | undefined;
|
21
|
+
header?: import("react").ReactNode | ((...args: any[]) => any);
|
22
|
+
textAlign?: "start" | "center" | "end" | undefined;
|
23
|
+
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
24
|
+
}>;
|
25
25
|
static defaultProps: {
|
26
26
|
textAlign: string;
|
27
27
|
children: null;
|
28
28
|
};
|
29
29
|
componentDidMount(): void;
|
30
|
-
componentDidUpdate(
|
30
|
+
componentDidUpdate(): void;
|
31
31
|
render(): jsx.JSX.Element;
|
32
32
|
}
|
33
33
|
export default Cell;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Cell/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Cell/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAgBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
3
|
+
import type { PropValidators } from '@instructure/shared-types';
|
4
|
+
declare type TableCellOwnProps = {
|
5
|
+
isStacked?: boolean;
|
6
|
+
header?: React.ReactNode | ((...args: any[]) => any);
|
7
|
+
textAlign?: 'start' | 'center' | 'end';
|
8
|
+
children?: React.ReactNode | ((...args: any[]) => React.ReactNode);
|
9
|
+
};
|
10
|
+
declare type PropKeys = keyof TableCellOwnProps;
|
11
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
12
|
+
declare type TableCellProps = TableCellOwnProps & WithStyleProps;
|
13
|
+
declare const propTypes: PropValidators<PropKeys>;
|
14
|
+
declare const allowedProps: AllowedPropKeys;
|
15
|
+
export type { TableCellProps };
|
16
|
+
export { propTypes, allowedProps };
|
17
|
+
//# sourceMappingURL=props.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Cell/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,iBAAiB,GAAG;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACpD,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;CACnE,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GAAG,cAAc,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAQvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAKnB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/** @jsx jsx */
|
2
2
|
import { Component } from 'react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
import { jsx } from '@instructure/emotion';
|
5
|
-
import { TableColHeaderProps } from './
|
4
|
+
import type { TableColHeaderProps } from './props';
|
6
5
|
/**
|
7
6
|
---
|
8
7
|
parent: Table
|
@@ -11,51 +10,34 @@ id: Table.ColHeader
|
|
11
10
|
**/
|
12
11
|
declare class ColHeader extends Component<TableColHeaderProps> {
|
13
12
|
static readonly componentId = "Table.ColHeader";
|
14
|
-
static
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
* Control the text alignment in column header
|
35
|
-
*/
|
36
|
-
textAlign: PropTypes.Requireable<string>;
|
37
|
-
/**
|
38
|
-
* The string of sorting direction
|
39
|
-
*/
|
40
|
-
sortDirection: PropTypes.Requireable<string>;
|
41
|
-
/**
|
42
|
-
* Callback fired when column header is clicked. Parameters: `(event, { id })`
|
43
|
-
*/
|
44
|
-
onRequestSort: PropTypes.Requireable<(...args: any[]) => any>;
|
45
|
-
/**
|
46
|
-
* The column header scope attribute. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
|
47
|
-
*/
|
48
|
-
scope: PropTypes.Requireable<string>;
|
49
|
-
};
|
13
|
+
static allowedProps: readonly (keyof {
|
14
|
+
id: string;
|
15
|
+
stackedSortByLabel?: string | undefined;
|
16
|
+
width?: string | number | undefined;
|
17
|
+
textAlign?: "start" | "center" | "end" | undefined;
|
18
|
+
sortDirection?: "none" | "ascending" | "descending" | undefined;
|
19
|
+
onRequestSort?: ((...args: any[]) => any) | undefined;
|
20
|
+
scope?: "row" | "col" | "rowgroup" | "colgroup" | "auto" | undefined;
|
21
|
+
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
22
|
+
})[];
|
23
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
24
|
+
id: string;
|
25
|
+
stackedSortByLabel?: string | undefined;
|
26
|
+
width?: string | number | undefined;
|
27
|
+
textAlign?: "start" | "center" | "end" | undefined;
|
28
|
+
sortDirection?: "none" | "ascending" | "descending" | undefined;
|
29
|
+
onRequestSort?: ((...args: any[]) => any) | undefined;
|
30
|
+
scope?: "row" | "col" | "rowgroup" | "colgroup" | "auto" | undefined;
|
31
|
+
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
32
|
+
}>;
|
50
33
|
static defaultProps: {
|
51
34
|
textAlign: string;
|
52
35
|
sortDirection: string;
|
53
|
-
stackedSortByLabel: undefined;
|
54
36
|
children: null;
|
55
37
|
scope: string;
|
56
38
|
};
|
57
39
|
componentDidMount(): void;
|
58
|
-
componentDidUpdate(
|
40
|
+
componentDidUpdate(): void;
|
59
41
|
handleClick: (event: any) => void;
|
60
42
|
renderSortArrow(): jsx.JSX.Element | null;
|
61
43
|
render(): jsx.JSX.Element;
|