@instructure/ui-table 9.7.2 → 9.8.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 +11 -0
- package/es/Table/Body/index.js +13 -5
- package/es/Table/Body/props.js +2 -5
- package/es/Table/Body/styles.js +0 -2
- package/es/Table/Cell/index.js +3 -2
- package/es/Table/Cell/props.js +1 -2
- package/es/Table/ColHeader/props.js +2 -1
- package/es/Table/Head/index.js +40 -30
- package/es/Table/Head/props.js +1 -2
- package/es/Table/Head/styles.js +0 -2
- package/es/Table/Row/index.js +21 -18
- package/es/Table/Row/props.js +2 -5
- package/es/Table/Row/styles.js +4 -6
- package/es/Table/RowHeader/index.js +3 -2
- package/es/Table/RowHeader/props.js +1 -2
- package/es/Table/TableContext.js +34 -0
- package/es/Table/__new-tests__/Table.test.js +66 -2
- package/es/Table/index.js +10 -6
- package/es/index.js +2 -1
- package/lib/Table/Body/index.js +13 -5
- package/lib/Table/Body/props.js +2 -5
- package/lib/Table/Body/styles.js +0 -2
- package/lib/Table/Cell/index.js +3 -2
- package/lib/Table/Cell/props.js +1 -2
- package/lib/Table/ColHeader/props.js +2 -1
- package/lib/Table/Head/index.js +39 -30
- package/lib/Table/Head/props.js +1 -2
- package/lib/Table/Head/styles.js +0 -2
- package/lib/Table/Row/index.js +18 -17
- package/lib/Table/Row/props.js +2 -5
- package/lib/Table/Row/styles.js +4 -6
- package/lib/Table/RowHeader/index.js +3 -2
- package/lib/Table/RowHeader/props.js +1 -2
- package/lib/Table/TableContext.js +39 -0
- package/lib/Table/__new-tests__/Table.test.js +66 -2
- package/lib/Table/index.js +10 -6
- package/lib/index.js +8 -1
- package/package.json +17 -17
- package/src/Table/Body/index.tsx +14 -7
- package/src/Table/Body/props.ts +6 -18
- package/src/Table/Body/styles.ts +0 -2
- package/src/Table/Cell/index.tsx +6 -3
- package/src/Table/Cell/props.ts +7 -9
- package/src/Table/ColHeader/props.ts +9 -3
- package/src/Table/Head/index.tsx +40 -40
- package/src/Table/Head/props.ts +20 -10
- package/src/Table/Head/styles.ts +0 -2
- package/src/Table/README.md +1788 -546
- package/src/Table/Row/index.tsx +21 -23
- package/src/Table/Row/props.ts +7 -19
- package/src/Table/Row/styles.ts +5 -6
- package/src/Table/RowHeader/index.tsx +6 -4
- package/src/Table/RowHeader/props.ts +1 -3
- package/src/Table/TableContext.ts +54 -0
- package/src/Table/__new-tests__/Table.test.tsx +95 -2
- package/src/Table/index.tsx +32 -28
- package/src/Table/props.ts +8 -28
- package/src/index.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Table/Body/index.d.ts +6 -13
- package/types/Table/Body/index.d.ts.map +1 -1
- package/types/Table/Body/props.d.ts +4 -5
- package/types/Table/Body/props.d.ts.map +1 -1
- package/types/Table/Body/styles.d.ts +0 -2
- package/types/Table/Body/styles.d.ts.map +1 -1
- package/types/Table/Cell/index.d.ts +4 -3
- package/types/Table/Cell/index.d.ts.map +1 -1
- package/types/Table/Cell/props.d.ts +6 -2
- package/types/Table/Cell/props.d.ts.map +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 +7 -3
- package/types/Table/ColHeader/props.d.ts.map +1 -1
- package/types/Table/Head/index.d.ts +15 -5
- package/types/Table/Head/index.d.ts.map +1 -1
- package/types/Table/Head/props.d.ts +19 -4
- package/types/Table/Head/props.d.ts.map +1 -1
- package/types/Table/Head/styles.d.ts +0 -2
- package/types/Table/Head/styles.d.ts.map +1 -1
- package/types/Table/Row/index.d.ts +6 -13
- package/types/Table/Row/index.d.ts.map +1 -1
- package/types/Table/Row/props.d.ts +5 -6
- package/types/Table/Row/props.d.ts.map +1 -1
- package/types/Table/Row/styles.d.ts +5 -2
- package/types/Table/Row/styles.d.ts.map +1 -1
- package/types/Table/RowHeader/index.d.ts +4 -3
- package/types/Table/RowHeader/index.d.ts.map +1 -1
- package/types/Table/RowHeader/props.d.ts +0 -1
- package/types/Table/RowHeader/props.d.ts.map +1 -1
- package/types/Table/TableContext.d.ts +24 -0
- package/types/Table/TableContext.d.ts.map +1 -0
- package/types/Table/index.d.ts.map +1 -1
- package/types/Table/props.d.ts +10 -22
- package/types/Table/props.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -1,7 +1,8 @@
|
|
1
1
|
/** @jsx jsx */
|
2
|
-
import { Component } from 'react';
|
2
|
+
import { Component, ContextType } from 'react';
|
3
3
|
import { jsx } from '@instructure/emotion';
|
4
4
|
import type { TableBodyProps } from './props';
|
5
|
+
import TableContext from '../TableContext';
|
5
6
|
/**
|
6
7
|
---
|
7
8
|
parent: Table
|
@@ -10,18 +11,10 @@ id: Table.Body
|
|
10
11
|
**/
|
11
12
|
declare class Body extends Component<TableBodyProps> {
|
12
13
|
static readonly componentId = "Table.Body";
|
13
|
-
static
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
children?: import("react").ReactNode;
|
18
|
-
})[];
|
19
|
-
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
20
|
-
hover?: boolean;
|
21
|
-
isStacked?: boolean;
|
22
|
-
headers?: import("../..").TableRowProps["headers"];
|
23
|
-
children?: import("react").ReactNode;
|
24
|
-
}>;
|
14
|
+
static contextType: import("react").Context<import("../TableContext").TableContextType>;
|
15
|
+
context: ContextType<typeof TableContext>;
|
16
|
+
static allowedProps: readonly "children"[];
|
17
|
+
static propTypes: import("@instructure/shared-types").PropValidators<"children">;
|
25
18
|
static defaultProps: {
|
26
19
|
children: null;
|
27
20
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAY,WAAW,EAAkB,MAAM,OAAO,CAAA;AAIxE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAC1C,MAAM,CAAC,WAAW,sEAAe;IACzB,OAAO,EAAE,WAAW,CAAC,OAAO,YAAY,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY,wBAAe;IAClC,MAAM,CAAC,SAAS,iEAAY;IAC5B,MAAM,CAAC,YAAY;;MAElB;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CA+BP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type { TableRowProps } from '../Row/props';
|
3
2
|
import type { OtherHTMLAttributes, PropValidators, TableBodyTheme } from '@instructure/shared-types';
|
4
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
5
4
|
type TableBodyOwnProps = {
|
6
|
-
hover?: boolean;
|
7
|
-
isStacked?: boolean;
|
8
|
-
headers?: TableRowProps['headers'];
|
9
5
|
/**
|
10
|
-
*
|
6
|
+
* Body's children should be a container component where each child represents
|
7
|
+
* a row.
|
8
|
+
*
|
9
|
+
* `Table.Row` by default
|
11
10
|
*/
|
12
11
|
children?: React.ReactNode;
|
13
12
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,iBAAiB,GAAG;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,GAC9C,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,KAAK,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAE5C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA8B,CAAA;AAElD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -6,8 +6,6 @@ import type { TableBodyStyle } from './props';
|
|
6
6
|
* ---
|
7
7
|
* Generates the style object from the theme and provided additional information
|
8
8
|
* @param {Object} componentTheme The theme variable object.
|
9
|
-
* @param {Object} props the props of the component, the style is applied to
|
10
|
-
* @param {Object} state the state of the component, the style is applied to
|
11
9
|
* @return {Object} The final style object, which will be used in the component
|
12
10
|
*/
|
13
11
|
declare const generateStyle: (componentTheme: TableBodyTheme) => TableBodyStyle;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Body/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,mBAAoB,cAAc,KAAG,cAWvD,CAAA;AAED,eAAe,aAAa,CAAA"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/** @jsx jsx */
|
2
|
-
import { Component } from 'react';
|
2
|
+
import { Component, ContextType } from 'react';
|
3
3
|
import { jsx } from '@instructure/emotion';
|
4
4
|
import type { TableCellProps } from './props';
|
5
|
+
import TableContext from '../TableContext';
|
5
6
|
/**
|
6
7
|
---
|
7
8
|
parent: Table
|
@@ -10,14 +11,14 @@ id: Table.Cell
|
|
10
11
|
**/
|
11
12
|
declare class Cell extends Component<TableCellProps> {
|
12
13
|
static readonly componentId = "Table.Cell";
|
14
|
+
static contextType: import("react").Context<import("../TableContext").TableContextType>;
|
15
|
+
context: ContextType<typeof TableContext>;
|
13
16
|
static allowedProps: readonly (keyof {
|
14
|
-
isStacked?: boolean;
|
15
17
|
header?: import("@instructure/shared-types").Renderable;
|
16
18
|
textAlign?: "start" | "center" | "end";
|
17
19
|
children?: import("@instructure/shared-types").Renderable;
|
18
20
|
})[];
|
19
21
|
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
20
|
-
isStacked?: boolean;
|
21
22
|
header?: import("@instructure/shared-types").Renderable;
|
22
23
|
textAlign?: "start" | "center" | "end";
|
23
24
|
children?: import("@instructure/shared-types").Renderable;
|
@@ -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,WAAW,EAAE,MAAM,OAAO,CAAA;AAK9C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAC1C,MAAM,CAAC,WAAW,sEAAe;IACzB,OAAO,EAAE,WAAW,CAAC,OAAO,YAAY,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAiBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -1,10 +1,14 @@
|
|
1
1
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
2
2
|
import type { OtherHTMLAttributes, PropValidators, Renderable, TableCellTheme } from '@instructure/shared-types';
|
3
3
|
type TableCellOwnProps = {
|
4
|
-
|
4
|
+
/**
|
5
|
+
* Contains the column header for this cell.
|
6
|
+
* This gets rendered in `stacked` layout to identify the column the data
|
7
|
+
* belongs to.
|
8
|
+
*/
|
5
9
|
header?: Renderable;
|
6
10
|
/**
|
7
|
-
*
|
11
|
+
* Controls the text alignment in cell.
|
8
12
|
*/
|
9
13
|
textAlign?: 'start' | 'center' | 'end';
|
10
14
|
children?: Renderable;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Cell/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAA;AAElC,KAAK,iBAAiB,GAAG;IACvB
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Cell/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAA;AAElC,KAAK,iBAAiB,GAAG;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,GAC9C,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,KAAK,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAE5C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAIvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAqD,CAAA;AAEzE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -11,6 +11,7 @@ id: Table.ColHeader
|
|
11
11
|
declare class ColHeader extends Component<TableColHeaderProps> {
|
12
12
|
static readonly componentId = "Table.ColHeader";
|
13
13
|
static allowedProps: readonly (keyof {
|
14
|
+
isStacked?: boolean;
|
14
15
|
id: string;
|
15
16
|
stackedSortByLabel?: string;
|
16
17
|
width?: string | number;
|
@@ -23,6 +24,7 @@ declare class ColHeader extends Component<TableColHeaderProps> {
|
|
23
24
|
children?: React.ReactNode;
|
24
25
|
})[];
|
25
26
|
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
27
|
+
isStacked?: boolean;
|
26
28
|
id: string;
|
27
29
|
stackedSortByLabel?: string;
|
28
30
|
width?: string | number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASxC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlD;;;;;GAKG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,YAAY
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASxC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlD;;;;;GAKG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,WAAW,UAAW,KAAK,CAAC,cAAc,UAIzC;IAED,eAAe;IAef,MAAM;CA2BP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
@@ -2,6 +2,10 @@ import React, { ThHTMLAttributes } from 'react';
|
|
2
2
|
import type { OtherHTMLAttributes, PropValidators, TableColHeaderTheme } from '@instructure/shared-types';
|
3
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
4
4
|
type TableColHeaderOwnProps = {
|
5
|
+
/**
|
6
|
+
* DEPRECATED. Use `TableContext` to read this value
|
7
|
+
*/
|
8
|
+
isStacked?: boolean;
|
5
9
|
/**
|
6
10
|
* A unique id for this column. The `id` is also used as option in combobox,
|
7
11
|
* when sortable table is in stacked layout,
|
@@ -22,17 +26,17 @@ type TableColHeaderOwnProps = {
|
|
22
26
|
*/
|
23
27
|
textAlign?: 'start' | 'center' | 'end';
|
24
28
|
/**
|
25
|
-
* The
|
29
|
+
* The sorting direction
|
26
30
|
*/
|
27
31
|
sortDirection?: 'none' | 'ascending' | 'descending';
|
28
32
|
/**
|
29
|
-
* Callback fired when column header is clicked.
|
33
|
+
* Callback fired when column header is clicked.
|
30
34
|
*/
|
31
35
|
onRequestSort?: (event: React.SyntheticEvent, param: {
|
32
36
|
id: TableColHeaderOwnProps['id'];
|
33
37
|
}) => void;
|
34
38
|
/**
|
35
|
-
* The column header scope attribute. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#
|
39
|
+
* The column header scope attribute. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#scope
|
36
40
|
*/
|
37
41
|
scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | 'auto';
|
38
42
|
children?: React.ReactNode;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAG/C,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,sBAAsB,GAAG;IAC5B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAA;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,KAAK,EAAE;QAAE,EAAE,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAA;KAAE,KACxC,IAAI,CAAA;IACT;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAA;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,mBAAmB,CACjB,sBAAsB,EACtB,gBAAgB,CAAC,sBAAsB,CAAC,CACzC,CAAA;AAEH,KAAK,mBAAmB,GAAG,cAAc,CACvC,WAAW,GAAG,QAAQ,GAAG,eAAe,CACzC,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAG/C,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,sBAAsB,GAAG;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAA;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,KAAK,EAAE;QAAE,EAAE,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAA;KAAE,KACxC,IAAI,CAAA;IACT;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAA;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,mBAAmB,CACjB,sBAAsB,EACtB,gBAAgB,CAAC,sBAAsB,CAAC,CACzC,CAAA;AAEH,KAAK,mBAAmB,GAAG,cAAc,CACvC,WAAW,GAAG,QAAQ,GAAG,eAAe,CACzC,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAUvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAUnB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
/** @jsx jsx */
|
2
|
-
import { Component } from 'react';
|
2
|
+
import { Component, ContextType } from 'react';
|
3
3
|
import { jsx } from '@instructure/emotion';
|
4
4
|
import type { TableHeadProps } from './props';
|
5
|
+
import type { RowChild } from '../props';
|
6
|
+
import TableContext from '../TableContext';
|
5
7
|
/**
|
6
8
|
---
|
7
9
|
parent: Table
|
@@ -10,22 +12,30 @@ id: Table.Head
|
|
10
12
|
**/
|
11
13
|
declare class Head extends Component<TableHeadProps> {
|
12
14
|
static readonly componentId = "Table.Head";
|
15
|
+
static contextType: import("react").Context<import("../TableContext").TableContextType>;
|
16
|
+
context: ContextType<typeof TableContext>;
|
13
17
|
static allowedProps: readonly (keyof {
|
14
|
-
isStacked?: boolean;
|
15
18
|
renderSortLabel?: import("@instructure/shared-types").Renderable;
|
16
|
-
children?:
|
19
|
+
children?: RowChild;
|
17
20
|
})[];
|
18
21
|
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
19
|
-
isStacked?: boolean;
|
20
22
|
renderSortLabel?: import("@instructure/shared-types").Renderable;
|
21
|
-
children?:
|
23
|
+
children?: RowChild;
|
22
24
|
}>;
|
23
25
|
static defaultProps: {
|
24
26
|
children: null;
|
25
27
|
};
|
28
|
+
/**
|
29
|
+
* Returns `true` if the first child's children have a `onRequestSort` prop
|
30
|
+
*/
|
26
31
|
get isSortable(): boolean;
|
27
32
|
componentDidMount(): void;
|
28
33
|
componentDidUpdate(): void;
|
34
|
+
/**
|
35
|
+
* This `Select` is used in `stacked` layout. It's populated by iterating
|
36
|
+
* through the first child's children (by default `ColHeader`) and reading
|
37
|
+
* there the `id`, `stackedSortByLabel`, `sortDirection`, `onRequestSort` props
|
38
|
+
*/
|
29
39
|
renderSelect(): jsx.JSX.Element | null;
|
30
40
|
render(): jsx.JSX.Element | null;
|
31
41
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AASxD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAC1C,MAAM,CAAC,WAAW,sEAAe;IACzB,OAAO,EAAE,WAAW,CAAC,OAAO,YAAY,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;MAElB;IAED;;OAEG;IACH,IAAI,UAAU,YAYb;IAED,iBAAiB;IAIjB,kBAAkB;IAUlB;;;;OAIG;IACH,YAAY;IA+EZ,MAAM;CAcP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -1,13 +1,28 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import type { OtherHTMLAttributes, PropValidators, Renderable, TableHeadTheme } from '@instructure/shared-types';
|
3
2
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
3
|
+
import { RowChild } from '../props';
|
4
4
|
type TableHeadOwnProps = {
|
5
|
-
|
5
|
+
/**
|
6
|
+
* The sort `Select`'s label when using `stacked` layout and the table is
|
7
|
+
* sortable.
|
8
|
+
* If you don't want to display anything you should use `ScreenReaderContent`
|
9
|
+
* so screen readers can read the `Select`'s purpose
|
10
|
+
*/
|
6
11
|
renderSortLabel?: Renderable;
|
7
12
|
/**
|
8
|
-
*
|
13
|
+
* The header row(s).
|
14
|
+
* Default type: `Table.Row`
|
15
|
+
*
|
16
|
+
* Its first child is treated specially if the table is sortable and has
|
17
|
+
* `stacked` layout:
|
18
|
+
*
|
19
|
+
* A `Select` is created which reads options from the first child's
|
20
|
+
* children, that tries to read the following props: `id`,
|
21
|
+
* `stackedSortByLabel`,`sortDirection`, `onRequestSort` (Available on
|
22
|
+
* `Table.ColHeader`).
|
23
|
+
* These are used to sort the table in this layout.
|
9
24
|
*/
|
10
|
-
children?:
|
25
|
+
children?: RowChild;
|
11
26
|
};
|
12
27
|
type PropKeys = keyof TableHeadOwnProps;
|
13
28
|
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/props.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,KAAK,iBAAiB,GAAG;IACvB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CAAA;AACD,KAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,GAC9C,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,KAAK,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAE5C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAiD,CAAA;AAErE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -6,8 +6,6 @@ import type { TableHeadStyle } from './props';
|
|
6
6
|
* ---
|
7
7
|
* Generates the style object from the theme and provided additional information
|
8
8
|
* @param {Object} componentTheme The theme variable object.
|
9
|
-
* @param {Object} props the props of the component, the style is applied to
|
10
|
-
* @param {Object} state the state of the component, the style is applied to
|
11
9
|
* @return {Object} The final style object, which will be used in the component
|
12
10
|
*/
|
13
11
|
declare const generateStyle: (componentTheme: TableHeadTheme) => TableHeadStyle;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Head/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,mBAAoB,cAAc,KAAG,cAWvD,CAAA;AAED,eAAe,aAAa,CAAA"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/** @jsx jsx */
|
2
|
-
import { Component } from 'react';
|
2
|
+
import { Component, ContextType } from 'react';
|
3
3
|
import { jsx } from '@instructure/emotion';
|
4
4
|
import type { TableRowProps } from './props';
|
5
|
+
import TableContext from '../TableContext';
|
5
6
|
/**
|
6
7
|
---
|
7
8
|
parent: Table
|
@@ -10,18 +11,10 @@ id: Table.Row
|
|
10
11
|
**/
|
11
12
|
declare class Row extends Component<TableRowProps> {
|
12
13
|
static readonly componentId = "Table.Row";
|
13
|
-
static
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
children?: import("react").ReactNode;
|
18
|
-
})[];
|
19
|
-
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
20
|
-
hover?: boolean;
|
21
|
-
isStacked?: boolean;
|
22
|
-
headers?: import("../..").TableCellProps["header"][];
|
23
|
-
children?: import("react").ReactNode;
|
24
|
-
}>;
|
14
|
+
static contextType: import("react").Context<import("../TableContext").TableContextType>;
|
15
|
+
context: ContextType<typeof TableContext>;
|
16
|
+
static allowedProps: readonly "children"[];
|
17
|
+
static propTypes: import("@instructure/shared-types").PropValidators<"children">;
|
25
18
|
static defaultProps: {
|
26
19
|
children: null;
|
27
20
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAY,WAAW,EAAkB,MAAM,OAAO,CAAA;AAKxE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,cACM,GAAI,SAAQ,SAAS,CAAC,aAAa,CAAC;IACxC,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IACzC,MAAM,CAAC,WAAW,sEAAe;IACzB,OAAO,EAAE,WAAW,CAAC,OAAO,YAAY,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY,wBAAe;IAClC,MAAM,CAAC,SAAS,iEAAY;IAE5B,MAAM,CAAC,YAAY;;MAElB;IAED,iBAAiB;IAOjB,kBAAkB;IAOlB,MAAM;CA8BP;AAED,eAAe,GAAG,CAAA;AAClB,OAAO,EAAE,GAAG,EAAE,CAAA"}
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type { TableCellProps } from '../Cell/props';
|
3
2
|
import type { OtherHTMLAttributes, PropValidators, TableRowTheme } from '@instructure/shared-types';
|
4
3
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
5
4
|
type TableRowOwnProps = {
|
6
|
-
hover?: boolean;
|
7
|
-
isStacked?: boolean;
|
8
|
-
headers?: TableCellProps['header'][];
|
9
5
|
/**
|
10
|
-
*
|
6
|
+
* A row's children should be table cells. Its children should have the
|
7
|
+
* `header` prop to render the column header in `stacked` layout
|
8
|
+
*
|
9
|
+
* By default `Table.ColHeader` or `Table.RowHeader` or `Table.Cell`
|
11
10
|
*/
|
12
|
-
children?: React.
|
11
|
+
children?: React.ReactElement | React.ReactElement[];
|
13
12
|
};
|
14
13
|
type PropKeys = keyof TableRowOwnProps;
|
15
14
|
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,gBAAgB,GAAG;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAA;CACrD,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,gBAAgB,CAAA;AAEtC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,aAAa,GAAG,gBAAgB,GACnC,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,GAC5C,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAEvC,KAAK,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAE1C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA8B,CAAA;AAElD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -7,9 +7,12 @@ import type { TableRowProps, TableRowStyle } from './props';
|
|
7
7
|
* Generates the style object from the theme and provided additional information
|
8
8
|
* @param {Object} componentTheme The theme variable object.
|
9
9
|
* @param {Object} props the props of the component, the style is applied to
|
10
|
-
* @param {Object}
|
10
|
+
* @param {Object} extraArgs the state of the component, the style is applied to
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
12
12
|
*/
|
13
|
-
declare const generateStyle: (componentTheme: TableRowTheme,
|
13
|
+
declare const generateStyle: (componentTheme: TableRowTheme, _props: TableRowProps, extraArgs: {
|
14
|
+
isStacked: boolean;
|
15
|
+
hover: boolean;
|
16
|
+
}) => TableRowStyle;
|
14
17
|
export default generateStyle;
|
15
18
|
//# sourceMappingURL=styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,aAAa,
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Table/Row/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,aAAa,UACrB,aAAa,aACV;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,KAChD,aA2BF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/** @jsx jsx */
|
2
|
-
import { Component } from 'react';
|
2
|
+
import { Component, ContextType } from 'react';
|
3
3
|
import { jsx } from '@instructure/emotion';
|
4
4
|
import type { TableRowHeaderProps } from './props';
|
5
|
+
import TableContext from '../TableContext';
|
5
6
|
/**
|
6
7
|
---
|
7
8
|
parent: Table
|
@@ -10,13 +11,13 @@ id: Table.RowHeader
|
|
10
11
|
**/
|
11
12
|
declare class RowHeader extends Component<TableRowHeaderProps> {
|
12
13
|
static readonly componentId = "Table.RowHeader";
|
14
|
+
static contextType: import("react").Context<import("../TableContext").TableContextType>;
|
15
|
+
context: ContextType<typeof TableContext>;
|
13
16
|
static allowedProps: readonly (keyof {
|
14
|
-
isStacked?: boolean;
|
15
17
|
textAlign?: "start" | "center" | "end";
|
16
18
|
children?: import("@instructure/shared-types").Renderable;
|
17
19
|
})[];
|
18
20
|
static propTypes: import("@instructure/shared-types").PropValidators<keyof {
|
19
|
-
isStacked?: boolean;
|
20
21
|
textAlign?: "start" | "center" | "end";
|
21
22
|
children?: import("@instructure/shared-types").Renderable;
|
22
23
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/RowHeader/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/RowHeader/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAK9C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAC/C,MAAM,CAAC,WAAW,sEAAe;IACzB,OAAO,EAAE,WAAW,CAAC,OAAO,YAAY,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAkBP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { OtherHTMLAttributes, PropValidators, Renderable, TableRowHeaderTheme } from '@instructure/shared-types';
|
2
2
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
3
3
|
type TableRowHeaderOwnProps = {
|
4
|
-
isStacked?: boolean;
|
5
4
|
/**
|
6
5
|
* Control the text alignment in row header
|
7
6
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/RowHeader/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,sBAAsB,GAAG;IAC5B
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/RowHeader/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,KAAK,sBAAsB,GAAG;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,mBAAmB,CAAC,sBAAsB,CAAC,CAAA;AAE7C,KAAK,mBAAmB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAEtD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA2C,CAAA;AAE/D,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Renderable } from '@instructure/shared-types';
|
2
|
+
type TableContextType = {
|
3
|
+
/**
|
4
|
+
* If `true` the table gets rendered in one column to be more readable on
|
5
|
+
* narrow screens.
|
6
|
+
*/
|
7
|
+
isStacked: boolean;
|
8
|
+
/**
|
9
|
+
* Highlight each row on hover.
|
10
|
+
*/
|
11
|
+
hover: boolean;
|
12
|
+
/**
|
13
|
+
* Contents of the first row of cells. Has value if `isStacked` is `true`.
|
14
|
+
*/
|
15
|
+
headers?: Renderable[];
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* React context created by the `Table` component to hold its data
|
19
|
+
*/
|
20
|
+
declare const TableContext: import("react").Context<TableContextType>;
|
21
|
+
export default TableContext;
|
22
|
+
export { TableContext };
|
23
|
+
export type { TableContextType };
|
24
|
+
//# sourceMappingURL=TableContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TableContext.d.ts","sourceRoot":"","sources":["../../src/Table/TableContext.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,KAAK,gBAAgB,GAAG;IACtB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,QAAA,MAAM,YAAY,2CAGhB,CAAA;AAEF,eAAe,YAAY,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Table/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAA;AAM3D,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Table/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAA;AAM3D,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKzC;;;;GAIG;AACH,cACM,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAU;IAErC,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;MAIlB;IAED,MAAM,CAAC,IAAI,cAAO;IAClB,MAAM,CAAC,IAAI,cAAO;IAClB,MAAM,CAAC,GAAG,aAAM;IAChB,MAAM,CAAC,SAAS,mBAAY;IAC5B,MAAM,CAAC,SAAS,mBAAY;IAC5B,MAAM,CAAC,IAAI,cAAO;IAElB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,UAAU;IAWV,MAAM;CAwCP;AAED,eAAe,KAAK,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/types/Table/props.d.ts
CHANGED
@@ -1,24 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
3
3
|
import type { OtherHTMLAttributes, PropValidators, TableTheme } from '@instructure/shared-types';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
import type { TableBodyProps } from './Body/props';
|
8
|
-
import { Row } from './Row';
|
9
|
-
import type { TableRowProps } from './Row/props';
|
10
|
-
import { ColHeader } from './ColHeader';
|
11
|
-
import type { TableColHeaderProps } from './ColHeader/props';
|
12
|
-
import { RowHeader } from './RowHeader';
|
13
|
-
import type { TableRowHeaderProps } from './RowHeader/props';
|
14
|
-
import { Cell } from './Cell';
|
15
|
-
import type { TableCellProps } from './Cell/props';
|
16
|
-
type HeadChild = React.ComponentElement<TableHeadProps, Head>;
|
17
|
-
type BodyChild = React.ComponentElement<TableBodyProps, Body>;
|
18
|
-
type RowChild = React.ComponentElement<TableRowProps, Row>;
|
19
|
-
type ColHeaderChild = React.ComponentElement<TableColHeaderProps, ColHeader>;
|
20
|
-
type RowHeaderChild = React.ComponentElement<TableRowHeaderProps, RowHeader>;
|
21
|
-
type CellChild = React.ComponentElement<TableCellProps, Cell>;
|
4
|
+
type RowChild = React.ReactElement<{
|
5
|
+
children: React.ReactElement;
|
6
|
+
}>;
|
22
7
|
type TableOwnProps = {
|
23
8
|
/**
|
24
9
|
* Provide a screen reader friendly description. Anything passed to this
|
@@ -41,12 +26,15 @@ type TableOwnProps = {
|
|
41
26
|
hover?: boolean;
|
42
27
|
/**
|
43
28
|
* `auto` lets the browser determine table column widths based on cell content,
|
44
|
-
* while `fixed` forces columns of equal width
|
45
|
-
*
|
29
|
+
* while `fixed` forces columns of equal width (sets the
|
30
|
+
* [tableLayout](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout)
|
31
|
+
* CSS prop to `fixed`).
|
32
|
+
*
|
33
|
+
* `stacked` renders table in one column to be more readable on narrow screens
|
46
34
|
*/
|
47
35
|
layout?: 'auto' | 'fixed' | 'stacked';
|
48
36
|
/**
|
49
|
-
*
|
37
|
+
* `Table.Head` or `Table.Body`
|
50
38
|
*/
|
51
39
|
children?: React.ReactNode;
|
52
40
|
};
|
@@ -56,6 +44,6 @@ type TableProps = TableOwnProps & WithStyleProps<TableTheme, TableStyle> & Other
|
|
56
44
|
type TableStyle = ComponentStyle<'table'>;
|
57
45
|
declare const propTypes: PropValidators<PropKeys>;
|
58
46
|
declare const allowedProps: AllowedPropKeys;
|
59
|
-
export type { TableProps, TableStyle,
|
47
|
+
export type { TableProps, TableStyle, RowChild };
|
60
48
|
export { propTypes, allowedProps };
|
61
49
|
//# sourceMappingURL=props.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Table/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACX,MAAM,2BAA2B,CAAA;AAElC,
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Table/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,UAAU,EACX,MAAM,2BAA2B,CAAA;AAElC,KAAK,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAAE,CAAC,CAAA;AAEpE,KAAK,aAAa,GAAG;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,aAAa,CAAA;AAEnC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,UAAU,GAAG,aAAa,GAC7B,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,GACtC,mBAAmB,CAAC,aAAa,CAAC,CAAA;AAEpC,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AAEzC,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAOvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAOnB,CAAA;AAED,YAAY,EACV,UAAU,EACV,UAAU,EAEV,QAAQ,EACT,CAAA;AACD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA"}
|