@instructure/ui-table 11.6.0 → 11.6.1-snapshot-129
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 +43 -308
- package/es/Table/{Body → v1/Body}/index.js +2 -2
- package/es/Table/{Cell → v1/Cell}/index.js +2 -2
- package/es/Table/{ColHeader → v1/ColHeader}/index.js +1 -1
- package/es/Table/{Head → v1/Head}/index.js +2 -2
- package/es/Table/{Row → v1/Row}/index.js +2 -2
- package/es/Table/{RowHeader → v1/RowHeader}/index.js +2 -2
- package/es/Table/{index.js → v1/index.js} +2 -2
- package/es/Table/v2/Body/index.js +73 -0
- package/es/Table/v2/Body/props.js +26 -0
- package/es/Table/v2/Body/styles.js +45 -0
- package/es/Table/v2/Cell/index.js +68 -0
- package/es/Table/v2/Cell/props.js +26 -0
- package/es/Table/v2/Cell/styles.js +54 -0
- package/es/Table/v2/ColHeader/index.js +117 -0
- package/es/Table/v2/ColHeader/props.js +26 -0
- package/es/Table/v2/ColHeader/styles.js +93 -0
- package/es/Table/v2/Head/index.js +173 -0
- package/es/Table/v2/Head/props.js +26 -0
- package/es/Table/v2/Head/styles.js +45 -0
- package/es/Table/v2/Row/index.js +82 -0
- package/es/Table/v2/Row/props.js +26 -0
- package/es/Table/v2/Row/styles.js +67 -0
- package/es/Table/v2/RowHeader/index.js +68 -0
- package/es/Table/v2/RowHeader/props.js +26 -0
- package/es/Table/v2/RowHeader/styles.js +54 -0
- package/es/Table/v2/TableContext.js +46 -0
- package/es/Table/v2/index.js +135 -0
- package/es/Table/v2/props.js +26 -0
- package/es/Table/v2/styles.js +58 -0
- package/es/exports/a.js +31 -0
- package/es/exports/b.js +31 -0
- package/lib/Table/{Body → v1/Body}/index.js +4 -4
- package/lib/Table/{Cell → v1/Cell}/index.js +4 -4
- package/lib/Table/{ColHeader → v1/ColHeader}/index.js +4 -4
- package/lib/Table/{Head → v1/Head}/index.js +5 -5
- package/lib/Table/{Row → v1/Row}/index.js +4 -4
- package/lib/Table/{RowHeader → v1/RowHeader}/index.js +4 -4
- package/lib/Table/{index.js → v1/index.js} +4 -4
- package/lib/Table/v2/Body/index.js +79 -0
- package/lib/Table/v2/Body/props.js +31 -0
- package/lib/Table/v2/Body/styles.js +51 -0
- package/lib/Table/v2/Cell/index.js +74 -0
- package/lib/Table/v2/Cell/props.js +31 -0
- package/lib/Table/v2/Cell/styles.js +60 -0
- package/lib/Table/v2/ColHeader/index.js +122 -0
- package/lib/Table/v2/ColHeader/props.js +31 -0
- package/lib/Table/v2/ColHeader/styles.js +99 -0
- package/lib/Table/v2/Head/index.js +179 -0
- package/lib/Table/v2/Head/props.js +31 -0
- package/lib/Table/v2/Head/styles.js +51 -0
- package/lib/Table/v2/Row/index.js +88 -0
- package/lib/Table/v2/Row/props.js +31 -0
- package/lib/Table/v2/Row/styles.js +73 -0
- package/lib/Table/v2/RowHeader/index.js +74 -0
- package/lib/Table/v2/RowHeader/props.js +31 -0
- package/lib/Table/v2/RowHeader/styles.js +60 -0
- package/lib/Table/v2/TableContext.js +51 -0
- package/lib/Table/v2/index.js +140 -0
- package/lib/Table/v2/props.js +31 -0
- package/lib/Table/v2/styles.js +64 -0
- package/lib/{index.js → exports/a.js} +9 -9
- package/lib/exports/b.js +61 -0
- package/package.json +43 -21
- package/src/Table/{Body → v1/Body}/index.tsx +2 -2
- package/src/Table/{Cell → v1/Cell}/index.tsx +2 -2
- package/src/Table/{ColHeader → v1/ColHeader}/index.tsx +1 -1
- package/src/Table/{Head → v1/Head}/index.tsx +3 -3
- package/src/Table/{README.md → v1/README.md} +1 -1
- package/src/Table/{Row → v1/Row}/index.tsx +2 -2
- package/src/Table/{RowHeader → v1/RowHeader}/index.tsx +2 -2
- package/src/Table/{index.tsx → v1/index.tsx} +2 -2
- package/src/Table/v2/Body/index.tsx +91 -0
- package/src/Table/v2/Body/props.ts +50 -0
- package/src/Table/v2/Body/styles.ts +51 -0
- package/src/Table/v2/Cell/index.tsx +83 -0
- package/src/Table/v2/Cell/props.ts +54 -0
- package/src/Table/v2/Cell/styles.ts +60 -0
- package/src/Table/v2/ColHeader/index.tsx +118 -0
- package/src/Table/v2/ColHeader/props.ts +93 -0
- package/src/Table/v2/ColHeader/styles.ts +95 -0
- package/src/Table/v2/Head/index.tsx +200 -0
- package/src/Table/v2/Head/props.ts +64 -0
- package/src/Table/v2/Head/styles.ts +51 -0
- package/src/Table/v2/README.md +1155 -0
- package/src/Table/v2/Row/index.tsx +105 -0
- package/src/Table/v2/Row/props.ts +67 -0
- package/src/Table/v2/Row/styles.ts +78 -0
- package/src/Table/v2/RowHeader/index.tsx +84 -0
- package/src/Table/v2/RowHeader/props.ts +48 -0
- package/src/Table/v2/RowHeader/styles.ts +60 -0
- package/src/Table/v2/TableContext.ts +66 -0
- package/src/Table/v2/index.tsx +160 -0
- package/src/Table/v2/props.ts +98 -0
- package/src/Table/v2/styles.ts +63 -0
- package/src/exports/a.ts +39 -0
- package/src/exports/b.ts +39 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Table/v1/Body/index.d.ts.map +1 -0
- package/types/Table/v1/Body/props.d.ts.map +1 -0
- package/types/Table/v1/Body/styles.d.ts.map +1 -0
- package/types/Table/v1/Body/theme.d.ts.map +1 -0
- package/types/Table/v1/Cell/index.d.ts.map +1 -0
- package/types/Table/v1/Cell/props.d.ts.map +1 -0
- package/types/Table/v1/Cell/styles.d.ts.map +1 -0
- package/types/Table/v1/Cell/theme.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/index.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/props.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/styles.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/theme.d.ts.map +1 -0
- package/types/Table/v1/Head/index.d.ts.map +1 -0
- package/types/Table/v1/Head/props.d.ts.map +1 -0
- package/types/Table/v1/Head/styles.d.ts.map +1 -0
- package/types/Table/v1/Head/theme.d.ts.map +1 -0
- package/types/Table/v1/Row/index.d.ts.map +1 -0
- package/types/Table/v1/Row/props.d.ts.map +1 -0
- package/types/Table/v1/Row/styles.d.ts.map +1 -0
- package/types/Table/v1/Row/theme.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/index.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/props.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/styles.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/theme.d.ts.map +1 -0
- package/types/Table/v1/TableContext.d.ts.map +1 -0
- package/types/Table/v1/index.d.ts.map +1 -0
- package/types/Table/v1/props.d.ts.map +1 -0
- package/types/Table/v1/styles.d.ts.map +1 -0
- package/types/Table/v1/theme.d.ts.map +1 -0
- package/types/Table/v2/Body/index.d.ts +24 -0
- package/types/Table/v2/Body/index.d.ts.map +1 -0
- package/types/Table/v2/Body/props.d.ts +20 -0
- package/types/Table/v2/Body/props.d.ts.map +1 -0
- package/types/Table/v2/Body/styles.d.ts +13 -0
- package/types/Table/v2/Body/styles.d.ts.map +1 -0
- package/types/Table/v2/Cell/index.d.ts +29 -0
- package/types/Table/v2/Cell/index.d.ts.map +1 -0
- package/types/Table/v2/Cell/props.d.ts +23 -0
- package/types/Table/v2/Cell/props.d.ts.map +1 -0
- package/types/Table/v2/Cell/styles.d.ts +14 -0
- package/types/Table/v2/Cell/styles.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/index.d.ts +37 -0
- package/types/Table/v2/ColHeader/index.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/props.d.ts +47 -0
- package/types/Table/v2/ColHeader/props.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/styles.d.ts +15 -0
- package/types/Table/v2/ColHeader/styles.d.ts.map +1 -0
- package/types/Table/v2/Head/index.d.ts +38 -0
- package/types/Table/v2/Head/index.d.ts.map +1 -0
- package/types/Table/v2/Head/props.d.ts +34 -0
- package/types/Table/v2/Head/props.d.ts.map +1 -0
- package/types/Table/v2/Head/styles.d.ts +13 -0
- package/types/Table/v2/Head/styles.d.ts.map +1 -0
- package/types/Table/v2/Row/index.d.ts +27 -0
- package/types/Table/v2/Row/index.d.ts.map +1 -0
- package/types/Table/v2/Row/props.d.ts +29 -0
- package/types/Table/v2/Row/props.d.ts.map +1 -0
- package/types/Table/v2/Row/styles.d.ts +19 -0
- package/types/Table/v2/Row/styles.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/index.d.ts +28 -0
- package/types/Table/v2/RowHeader/index.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/props.d.ts +17 -0
- package/types/Table/v2/RowHeader/props.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/styles.d.ts +14 -0
- package/types/Table/v2/RowHeader/styles.d.ts.map +1 -0
- package/types/Table/v2/TableContext.d.ts +36 -0
- package/types/Table/v2/TableContext.d.ts.map +1 -0
- package/types/Table/v2/index.d.ts +45 -0
- package/types/Table/v2/index.d.ts.map +1 -0
- package/types/Table/v2/props.d.ts +53 -0
- package/types/Table/v2/props.d.ts.map +1 -0
- package/types/Table/v2/styles.d.ts +15 -0
- package/types/Table/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +16 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +16 -0
- package/types/exports/b.d.ts.map +1 -0
- package/es/index.js +0 -31
- package/src/index.ts +0 -39
- package/types/Table/Body/index.d.ts.map +0 -1
- package/types/Table/Body/props.d.ts.map +0 -1
- package/types/Table/Body/styles.d.ts.map +0 -1
- package/types/Table/Body/theme.d.ts.map +0 -1
- package/types/Table/Cell/index.d.ts.map +0 -1
- package/types/Table/Cell/props.d.ts.map +0 -1
- package/types/Table/Cell/styles.d.ts.map +0 -1
- package/types/Table/Cell/theme.d.ts.map +0 -1
- package/types/Table/ColHeader/index.d.ts.map +0 -1
- package/types/Table/ColHeader/props.d.ts.map +0 -1
- package/types/Table/ColHeader/styles.d.ts.map +0 -1
- package/types/Table/ColHeader/theme.d.ts.map +0 -1
- package/types/Table/Head/index.d.ts.map +0 -1
- package/types/Table/Head/props.d.ts.map +0 -1
- package/types/Table/Head/styles.d.ts.map +0 -1
- package/types/Table/Head/theme.d.ts.map +0 -1
- package/types/Table/Row/index.d.ts.map +0 -1
- package/types/Table/Row/props.d.ts.map +0 -1
- package/types/Table/Row/styles.d.ts.map +0 -1
- package/types/Table/Row/theme.d.ts.map +0 -1
- package/types/Table/RowHeader/index.d.ts.map +0 -1
- package/types/Table/RowHeader/props.d.ts.map +0 -1
- package/types/Table/RowHeader/styles.d.ts.map +0 -1
- package/types/Table/RowHeader/theme.d.ts.map +0 -1
- package/types/Table/TableContext.d.ts.map +0 -1
- package/types/Table/index.d.ts.map +0 -1
- package/types/Table/props.d.ts.map +0 -1
- package/types/Table/styles.d.ts.map +0 -1
- package/types/Table/theme.d.ts.map +0 -1
- package/types/index.d.ts +0 -16
- package/types/index.d.ts.map +0 -1
- /package/es/Table/{Body → v1/Body}/props.js +0 -0
- /package/es/Table/{Body → v1/Body}/styles.js +0 -0
- /package/es/Table/{Body → v1/Body}/theme.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/props.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/styles.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/theme.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/props.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/styles.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/theme.js +0 -0
- /package/es/Table/{Head → v1/Head}/props.js +0 -0
- /package/es/Table/{Head → v1/Head}/styles.js +0 -0
- /package/es/Table/{Head → v1/Head}/theme.js +0 -0
- /package/es/Table/{Row → v1/Row}/props.js +0 -0
- /package/es/Table/{Row → v1/Row}/styles.js +0 -0
- /package/es/Table/{Row → v1/Row}/theme.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/props.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/styles.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/theme.js +0 -0
- /package/es/Table/{TableContext.js → v1/TableContext.js} +0 -0
- /package/es/Table/{props.js → v1/props.js} +0 -0
- /package/es/Table/{styles.js → v1/styles.js} +0 -0
- /package/es/Table/{theme.js → v1/theme.js} +0 -0
- /package/lib/Table/{Body → v1/Body}/props.js +0 -0
- /package/lib/Table/{Body → v1/Body}/styles.js +0 -0
- /package/lib/Table/{Body → v1/Body}/theme.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/props.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/styles.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/theme.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/props.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/styles.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/theme.js +0 -0
- /package/lib/Table/{Head → v1/Head}/props.js +0 -0
- /package/lib/Table/{Head → v1/Head}/styles.js +0 -0
- /package/lib/Table/{Head → v1/Head}/theme.js +0 -0
- /package/lib/Table/{Row → v1/Row}/props.js +0 -0
- /package/lib/Table/{Row → v1/Row}/styles.js +0 -0
- /package/lib/Table/{Row → v1/Row}/theme.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/props.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/styles.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/theme.js +0 -0
- /package/lib/Table/{TableContext.js → v1/TableContext.js} +0 -0
- /package/lib/Table/{props.js → v1/props.js} +0 -0
- /package/lib/Table/{styles.js → v1/styles.js} +0 -0
- /package/lib/Table/{theme.js → v1/theme.js} +0 -0
- /package/src/Table/{Body → v1/Body}/props.ts +0 -0
- /package/src/Table/{Body → v1/Body}/styles.ts +0 -0
- /package/src/Table/{Body → v1/Body}/theme.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/props.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/styles.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/theme.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/props.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/styles.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/theme.ts +0 -0
- /package/src/Table/{Head → v1/Head}/props.ts +0 -0
- /package/src/Table/{Head → v1/Head}/styles.ts +0 -0
- /package/src/Table/{Head → v1/Head}/theme.ts +0 -0
- /package/src/Table/{Row → v1/Row}/props.ts +0 -0
- /package/src/Table/{Row → v1/Row}/styles.ts +0 -0
- /package/src/Table/{Row → v1/Row}/theme.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/props.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/styles.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/theme.ts +0 -0
- /package/src/Table/{TableContext.ts → v1/TableContext.ts} +0 -0
- /package/src/Table/{props.ts → v1/props.ts} +0 -0
- /package/src/Table/{styles.ts → v1/styles.ts} +0 -0
- /package/src/Table/{theme.ts → v1/theme.ts} +0 -0
- /package/types/Table/{Body → v1/Body}/index.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/props.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/styles.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/theme.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/index.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/props.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/styles.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/theme.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/index.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/props.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/styles.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/theme.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/index.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/props.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/styles.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/theme.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/index.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/props.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/styles.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/theme.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/index.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/props.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/styles.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/theme.d.ts +0 -0
- /package/types/Table/{TableContext.d.ts → v1/TableContext.d.ts} +0 -0
- /package/types/Table/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/Table/{props.d.ts → v1/props.d.ts} +0 -0
- /package/types/Table/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/Table/{theme.d.ts → v1/theme.d.ts} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
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 type {
|
|
26
|
+
Spacing,
|
|
27
|
+
ComponentStyle,
|
|
28
|
+
WithStyleProps
|
|
29
|
+
} from '@instructure/emotion'
|
|
30
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
31
|
+
|
|
32
|
+
type RowChild = React.ReactElement<{ children: React.ReactElement }>
|
|
33
|
+
|
|
34
|
+
type TableOwnProps = {
|
|
35
|
+
/**
|
|
36
|
+
* Provide a screen reader friendly description. Anything passed to this
|
|
37
|
+
* prop will be wrapped by `<ScreenReaderContent>` when it is rendered.
|
|
38
|
+
*/
|
|
39
|
+
caption: React.ReactNode
|
|
40
|
+
/**
|
|
41
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
42
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
43
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
44
|
+
*/
|
|
45
|
+
margin?: Spacing
|
|
46
|
+
/**
|
|
47
|
+
* Provide a reference to the underlying html element
|
|
48
|
+
*/
|
|
49
|
+
elementRef?: (element: Element | null) => void
|
|
50
|
+
/**
|
|
51
|
+
* Highlight each row on hover
|
|
52
|
+
*/
|
|
53
|
+
hover?: boolean
|
|
54
|
+
/**
|
|
55
|
+
* `auto` lets the browser determine table column widths based on cell content,
|
|
56
|
+
* while `fixed` forces columns of equal width (sets the
|
|
57
|
+
* [tableLayout](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout)
|
|
58
|
+
* CSS prop to `fixed`).
|
|
59
|
+
*
|
|
60
|
+
* `stacked` renders table in one column to be more readable on narrow screens
|
|
61
|
+
*/
|
|
62
|
+
layout?: 'auto' | 'fixed' | 'stacked'
|
|
63
|
+
/**
|
|
64
|
+
* Sets the CSS prop `min-width` on the table.
|
|
65
|
+
* Same as {@link React.CSSProperties.minWidth}
|
|
66
|
+
*/
|
|
67
|
+
minWidth?: React.CSSProperties['minWidth']
|
|
68
|
+
/**
|
|
69
|
+
* `Table.Head` or `Table.Body`
|
|
70
|
+
*/
|
|
71
|
+
children?: React.ReactNode
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
type PropKeys = keyof TableOwnProps
|
|
75
|
+
|
|
76
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
77
|
+
|
|
78
|
+
type TableProps = TableOwnProps &
|
|
79
|
+
WithStyleProps<null, TableStyle> &
|
|
80
|
+
OtherHTMLAttributes<TableOwnProps>
|
|
81
|
+
|
|
82
|
+
type TableStyle = ComponentStyle<'table'>
|
|
83
|
+
const allowedProps: AllowedPropKeys = [
|
|
84
|
+
'caption',
|
|
85
|
+
'children',
|
|
86
|
+
'margin',
|
|
87
|
+
'elementRef',
|
|
88
|
+
'hover',
|
|
89
|
+
'layout'
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
export type {
|
|
93
|
+
TableProps,
|
|
94
|
+
TableStyle,
|
|
95
|
+
// children
|
|
96
|
+
RowChild
|
|
97
|
+
}
|
|
98
|
+
export { allowedProps }
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
|
|
25
|
+
import type { TableProps, TableStyle } from './props'
|
|
26
|
+
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* ---
|
|
30
|
+
* private: true
|
|
31
|
+
* ---
|
|
32
|
+
* Generates the style object from the theme and provided additional information
|
|
33
|
+
* @param {Object} componentTheme The theme variable object.
|
|
34
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
35
|
+
* @param {Object} sharedTokens Shared token object
|
|
36
|
+
* @return {Object} The final style object, which will be used in the component
|
|
37
|
+
*/
|
|
38
|
+
const generateStyle = (
|
|
39
|
+
componentTheme: NewComponentTypes['Table'],
|
|
40
|
+
props: TableProps,
|
|
41
|
+
_sharedTokens: SharedTokens
|
|
42
|
+
): TableStyle => {
|
|
43
|
+
const { layout } = props
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
table: {
|
|
47
|
+
label: 'table',
|
|
48
|
+
fontSize: componentTheme.fontSize,
|
|
49
|
+
fontFamily: componentTheme.fontFamily,
|
|
50
|
+
fontWeight: componentTheme.fontWeight,
|
|
51
|
+
color: componentTheme.color,
|
|
52
|
+
background: componentTheme.background,
|
|
53
|
+
display: 'table',
|
|
54
|
+
width: '100%',
|
|
55
|
+
borderCollapse: 'collapse',
|
|
56
|
+
borderSpacing: 0,
|
|
57
|
+
...(layout === 'fixed' && { tableLayout: 'fixed' }),
|
|
58
|
+
caption: { textAlign: 'start' }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default generateStyle
|
package/src/exports/a.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export { Table } from '../Table/v1'
|
|
25
|
+
export { TableContext } from '../Table/v1/TableContext'
|
|
26
|
+
export { Body as TableBody } from '../Table/v1/Body'
|
|
27
|
+
export { Cell as TableCell } from '../Table/v1/Cell'
|
|
28
|
+
export { ColHeader as TableColHeader } from '../Table/v1/ColHeader'
|
|
29
|
+
export { Head as TableHead } from '../Table/v1/Head'
|
|
30
|
+
export { Row as TableRow } from '../Table/v1/Row'
|
|
31
|
+
export { RowHeader as TableRowHeader } from '../Table/v1/RowHeader'
|
|
32
|
+
|
|
33
|
+
export type { TableProps } from '../Table/v1/props'
|
|
34
|
+
export type { TableBodyProps } from '../Table/v1/Body/props'
|
|
35
|
+
export type { TableCellProps } from '../Table/v1/Cell/props'
|
|
36
|
+
export type { TableColHeaderProps } from '../Table/v1/ColHeader/props'
|
|
37
|
+
export type { TableHeadProps } from '../Table/v1/Head/props'
|
|
38
|
+
export type { TableRowProps } from '../Table/v1/Row/props'
|
|
39
|
+
export type { TableRowHeaderProps } from '../Table/v1/RowHeader/props'
|
package/src/exports/b.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export { Table } from '../Table/v2'
|
|
25
|
+
export { TableContext } from '../Table/v2/TableContext'
|
|
26
|
+
export { Body as TableBody } from '../Table/v2/Body'
|
|
27
|
+
export { Cell as TableCell } from '../Table/v2/Cell'
|
|
28
|
+
export { ColHeader as TableColHeader } from '../Table/v2/ColHeader'
|
|
29
|
+
export { Head as TableHead } from '../Table/v2/Head'
|
|
30
|
+
export { Row as TableRow } from '../Table/v2/Row'
|
|
31
|
+
export { RowHeader as TableRowHeader } from '../Table/v2/RowHeader'
|
|
32
|
+
|
|
33
|
+
export type { TableProps } from '../Table/v2/props'
|
|
34
|
+
export type { TableBodyProps } from '../Table/v2/Body/props'
|
|
35
|
+
export type { TableCellProps } from '../Table/v2/Cell/props'
|
|
36
|
+
export type { TableColHeaderProps } from '../Table/v2/ColHeader/props'
|
|
37
|
+
export type { TableHeadProps } from '../Table/v2/Head/props'
|
|
38
|
+
export type { TableRowProps } from '../Table/v2/Row/props'
|
|
39
|
+
export type { TableRowHeaderProps } from '../Table/v2/RowHeader/props'
|