@instructure/ui-table 8.8.1-snapshot.8 → 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.
Files changed (113) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/Table/Body/index.js +16 -28
  3. package/{src/Table/Cell/types.ts → es/Table/Body/props.js} +14 -8
  4. package/es/Table/Cell/index.js +16 -28
  5. package/{src/Table/types.ts → es/Table/Cell/props.js} +12 -11
  6. package/es/Table/ColHeader/index.js +22 -63
  7. package/es/Table/ColHeader/props.js +66 -0
  8. package/es/Table/Head/index.js +18 -29
  9. package/{src/Table/Body/types.ts → es/Table/Head/props.js} +13 -8
  10. package/es/Table/Row/index.js +16 -28
  11. package/{src/Table/ColHeader/types.ts → es/Table/Row/props.js} +16 -12
  12. package/es/Table/RowHeader/index.js +15 -26
  13. package/{src/Table/Head/types.ts → es/Table/RowHeader/props.js} +11 -6
  14. package/es/Table/index.js +21 -60
  15. package/es/Table/props.js +66 -0
  16. package/lib/Table/Body/index.js +16 -29
  17. package/lib/Table/Body/props.js +50 -0
  18. package/lib/Table/Cell/index.js +16 -28
  19. package/lib/Table/Cell/props.js +47 -0
  20. package/lib/Table/ColHeader/index.js +22 -63
  21. package/lib/Table/ColHeader/props.js +77 -0
  22. package/lib/Table/Head/index.js +18 -30
  23. package/lib/Table/Head/props.js +49 -0
  24. package/lib/Table/Row/index.js +16 -29
  25. package/lib/Table/Row/props.js +54 -0
  26. package/lib/Table/RowHeader/index.js +15 -26
  27. package/lib/Table/RowHeader/props.js +46 -0
  28. package/lib/Table/index.js +20 -60
  29. package/lib/Table/props.js +81 -0
  30. package/package.json +17 -18
  31. package/src/Table/Body/index.tsx +7 -25
  32. package/src/Table/{Row/types.ts → Body/props.ts} +39 -3
  33. package/src/Table/Cell/index.tsx +8 -24
  34. package/src/Table/Cell/props.ts +62 -0
  35. package/src/Table/Cell/styles.ts +1 -1
  36. package/src/Table/ColHeader/index.tsx +9 -51
  37. package/src/Table/ColHeader/props.ts +94 -0
  38. package/src/Table/ColHeader/styles.ts +1 -1
  39. package/src/Table/Head/index.tsx +8 -24
  40. package/src/Table/Head/props.ts +62 -0
  41. package/src/Table/Row/index.tsx +8 -27
  42. package/src/Table/Row/props.ts +70 -0
  43. package/src/Table/Row/styles.ts +1 -1
  44. package/src/Table/RowHeader/index.tsx +8 -23
  45. package/src/Table/RowHeader/{types.ts → props.ts} +28 -3
  46. package/src/Table/RowHeader/styles.ts +1 -1
  47. package/src/Table/index.tsx +10 -49
  48. package/src/Table/props.ts +93 -0
  49. package/src/Table/styles.ts +1 -1
  50. package/src/index.ts +7 -7
  51. package/types/Table/Body/index.d.ts +13 -16
  52. package/types/Table/Body/index.d.ts.map +1 -1
  53. package/types/Table/Body/props.d.ts +17 -0
  54. package/types/Table/Body/props.d.ts.map +1 -0
  55. package/types/Table/Cell/index.d.ts +14 -14
  56. package/types/Table/Cell/index.d.ts.map +1 -1
  57. package/types/Table/Cell/props.d.ts +17 -0
  58. package/types/Table/Cell/props.d.ts.map +1 -0
  59. package/types/Table/Cell/styles.d.ts +1 -1
  60. package/types/Table/ColHeader/index.d.ts +22 -40
  61. package/types/Table/ColHeader/index.d.ts.map +1 -1
  62. package/types/Table/ColHeader/props.d.ts +21 -0
  63. package/types/Table/ColHeader/props.d.ts.map +1 -0
  64. package/types/Table/ColHeader/styles.d.ts +1 -1
  65. package/types/Table/Head/index.d.ts +11 -15
  66. package/types/Table/Head/index.d.ts.map +1 -1
  67. package/types/Table/Head/props.d.ts +16 -0
  68. package/types/Table/Head/props.d.ts.map +1 -0
  69. package/types/Table/Row/index.d.ts +14 -17
  70. package/types/Table/Row/index.d.ts.map +1 -1
  71. package/types/Table/Row/props.d.ts +17 -0
  72. package/types/Table/Row/props.d.ts.map +1 -0
  73. package/types/Table/Row/styles.d.ts +1 -1
  74. package/types/Table/RowHeader/index.d.ts +12 -13
  75. package/types/Table/RowHeader/index.d.ts.map +1 -1
  76. package/types/Table/RowHeader/props.d.ts +16 -0
  77. package/types/Table/RowHeader/props.d.ts.map +1 -0
  78. package/types/Table/RowHeader/styles.d.ts +1 -1
  79. package/types/Table/index.d.ts +18 -41
  80. package/types/Table/index.d.ts.map +1 -1
  81. package/types/Table/props.d.ts +19 -0
  82. package/types/Table/props.d.ts.map +1 -0
  83. package/types/Table/styles.d.ts +1 -1
  84. package/types/index.d.ts +7 -7
  85. package/LICENSE.md +0 -27
  86. package/es/Table/Body/types.js +0 -1
  87. package/es/Table/Cell/types.js +0 -1
  88. package/es/Table/ColHeader/types.js +0 -1
  89. package/es/Table/Head/types.js +0 -1
  90. package/es/Table/Row/types.js +0 -1
  91. package/es/Table/RowHeader/types.js +0 -1
  92. package/es/Table/types.js +0 -1
  93. package/lib/Table/Body/types.js +0 -1
  94. package/lib/Table/Cell/types.js +0 -1
  95. package/lib/Table/ColHeader/types.js +0 -1
  96. package/lib/Table/Head/types.js +0 -1
  97. package/lib/Table/Row/types.js +0 -1
  98. package/lib/Table/RowHeader/types.js +0 -1
  99. package/lib/Table/types.js +0 -1
  100. package/types/Table/Body/types.d.ts +0 -9
  101. package/types/Table/Body/types.d.ts.map +0 -1
  102. package/types/Table/Cell/types.d.ts +0 -9
  103. package/types/Table/Cell/types.d.ts.map +0 -1
  104. package/types/Table/ColHeader/types.d.ts +0 -12
  105. package/types/Table/ColHeader/types.d.ts.map +0 -1
  106. package/types/Table/Head/types.d.ts +0 -8
  107. package/types/Table/Head/types.d.ts.map +0 -1
  108. package/types/Table/Row/types.d.ts +0 -9
  109. package/types/Table/Row/types.d.ts.map +0 -1
  110. package/types/Table/RowHeader/types.d.ts +0 -7
  111. package/types/Table/RowHeader/types.d.ts.map +0 -1
  112. package/types/Table/types.d.ts +0 -12
  113. package/types/Table/types.d.ts.map +0 -1
@@ -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 }
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { TableTheme } from '@instructure/shared-types'
26
- import { TableProps } from './types'
26
+ import { TableProps } from './props'
27
27
 
28
28
  /**
29
29
  * ---
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/types'
27
- export type { TableBodyProps } from './Table/Body/types'
28
- export type { TableCellProps } from './Table/Cell/types'
29
- export type { TableColHeaderProps } from './Table/ColHeader/types'
30
- export type { TableHeadProps } from './Table/Head/types'
31
- export type { TableRowProps } from './Table/Row/types'
32
- export type { TableRowHeaderProps } from './Table/RowHeader/types'
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 './types';
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 propTypes: {
15
- /**
16
- * `Table.Row`
17
- */
18
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
19
- styles: PropTypes.Requireable<object>;
20
- children: {
21
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
22
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
23
- };
24
- hover: PropTypes.Requireable<boolean>;
25
- isStacked: PropTypes.Requireable<boolean>;
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;AACzD,OAAO,SAAS,MAAM,YAAY,CAAA;AASlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAG1C,MAAM,CAAC,SAAS;QACd;;WAEG;;;;;;;;;;MAWJ;IAGD,MAAM,CAAC,YAAY;;MAElB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAwBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,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 './types';
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 propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
18
- isStacked: PropTypes.Requireable<boolean>;
19
- header: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
20
- /**
21
- * Control the text alignment in cell
22
- */
23
- textAlign: PropTypes.Requireable<string>;
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(prevProps: any, prevState: any, snapshot: any): void;
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;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAG1C,MAAM,CAAC,SAAS;;;;;;QAQd;;WAEG;;MAEJ;IAGD,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAgBP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,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,5 +1,5 @@
1
1
  import { TableCellTheme } from '@instructure/shared-types';
2
- import { TableCellProps } from './types';
2
+ import { TableCellProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -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 './types';
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 propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- /**
18
- * A unique id for this column. The `id` is also used as option in combobox,
19
- * when sortable table is in stacked layout,
20
- * and no `stackedSortByLabel` is provided.
21
- */
22
- id: PropTypes.Validator<string>;
23
- /**
24
- * A custom string to display as option text in the combobox (instead of
25
- * using the `id` prop), when sortable table is in stacked layout.
26
- */
27
- stackedSortByLabel: PropTypes.Requireable<string>;
28
- children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
29
- /**
30
- * Control the width of column.
31
- */
32
- width: PropTypes.Requireable<string | number>;
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(prevProps: any, prevState: any, snapshot: any): void;
40
+ componentDidUpdate(): void;
59
41
  handleClick: (event: any) => void;
60
42
  renderSortArrow(): jsx.JSX.Element | null;
61
43
  render(): jsx.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAQlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAG/C,MAAM,CAAC,SAAS;;;QAKd;;;;WAIG;;QAEH;;;WAGG;;;QAGH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;MAEJ;IAGD,MAAM,CAAC,YAAY;;;;;;MAMlB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAMjD,WAAW,uBAOV;IAED,eAAe;IAgBf,MAAM;CAiCP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,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;IAKlB,WAAW,uBAOV;IAED,eAAe;IAgBf,MAAM;CAiCP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type TableColHeaderOwnProps = {
5
+ id: string;
6
+ stackedSortByLabel?: string;
7
+ width?: string | number;
8
+ textAlign?: 'start' | 'center' | 'end';
9
+ sortDirection?: 'none' | 'ascending' | 'descending';
10
+ onRequestSort?: (...args: any[]) => any;
11
+ scope?: 'row' | 'col' | 'rowgroup' | 'colgroup' | 'auto';
12
+ children?: React.ReactNode | ((...args: any[]) => React.ReactNode);
13
+ };
14
+ declare type PropKeys = keyof TableColHeaderOwnProps;
15
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
16
+ declare type TableColHeaderProps = TableColHeaderOwnProps & WithStyleProps;
17
+ declare const propTypes: PropValidators<PropKeys>;
18
+ declare const allowedProps: AllowedPropKeys;
19
+ export type { TableColHeaderProps };
20
+ export { propTypes, allowedProps };
21
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Table/ColHeader/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,sBAAsB,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAA;IACnD,aAAa,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACvC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAA;IACxD,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,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,GAAG,cAAc,CAAA;AAElE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAiCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { TableColHeaderTheme } from '@instructure/shared-types';
2
- import { TableColHeaderProps } from './types';
2
+ import { TableColHeaderProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -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 { TableHeadProps } from './types';
4
+ import type { TableHeadProps } from './props';
6
5
  /**
7
6
  ---
8
7
  parent: Table
@@ -11,19 +10,16 @@ id: Table.Head
11
10
  **/
12
11
  declare class Head extends Component<TableHeadProps> {
13
12
  static readonly componentId = "Table.Head";
14
- static propTypes: {
15
- /**
16
- * `Table.Row`
17
- */
18
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
19
- styles: PropTypes.Requireable<object>;
20
- children: {
21
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
22
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
23
- };
24
- isStacked: PropTypes.Requireable<boolean>;
25
- renderSortLabel: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
26
- };
13
+ static allowedProps: readonly (keyof {
14
+ isStacked?: boolean | undefined;
15
+ renderSortLabel?: import("react").ReactNode | ((...args: any[]) => any);
16
+ children?: import("react").ReactNode;
17
+ })[];
18
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
19
+ isStacked?: boolean | undefined;
20
+ renderSortLabel?: import("react").ReactNode | ((...args: any[]) => any);
21
+ children?: import("react").ReactNode;
22
+ }>;
27
23
  static defaultProps: {
28
24
  children: null;
29
25
  };
@@ -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;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAA;AAalC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAOrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAG1C,MAAM,CAAC,SAAS;QACd;;WAEG;;;;;;;;;MAQJ;IAGD,MAAM,CAAC,YAAY;;MAElB;IAED,IAAI,UAAU,YAcb;IAED,iBAAiB;IAKjB,kBAAkB;IAWlB,YAAY;IAqFZ,MAAM;CAaP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
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;AAY3C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAOrD,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,IAAI,UAAU,YAcb;IAED,iBAAiB;IAIjB,kBAAkB;IAUlB,YAAY;IAoFZ,MAAM;CAaP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type TableHeadOwnProps = {
5
+ isStacked?: boolean;
6
+ renderSortLabel?: React.ReactNode | ((...args: any[]) => any);
7
+ children?: React.ReactNode;
8
+ };
9
+ declare type PropKeys = keyof TableHeadOwnProps;
10
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
11
+ declare type TableHeadProps = TableHeadOwnProps & WithStyleProps;
12
+ declare const propTypes: PropValidators<PropKeys>;
13
+ declare const allowedProps: AllowedPropKeys;
14
+ export type { TableHeadProps };
15
+ export { propTypes, allowedProps };
16
+ //# sourceMappingURL=props.d.ts.map