@instructure/ui-table 8.18.0 → 8.18.1-snapshot.12
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/LICENSE.md +27 -0
- package/es/Table/Body/index.js +13 -9
- package/es/Table/Body/theme.js +5 -5
- package/es/Table/Cell/index.js +12 -8
- package/es/Table/Cell/theme.js +8 -8
- package/es/Table/ColHeader/index.js +18 -14
- package/es/Table/ColHeader/theme.js +10 -10
- package/es/Table/Head/index.js +14 -10
- package/es/Table/Head/theme.js +5 -5
- package/es/Table/Row/index.js +12 -8
- package/es/Table/Row/theme.js +8 -8
- package/es/Table/RowHeader/index.js +11 -7
- package/es/Table/RowHeader/theme.js +8 -8
- package/es/Table/index.js +14 -10
- package/es/Table/theme.js +5 -5
- package/lib/Table/Body/index.js +13 -9
- package/lib/Table/Body/theme.js +5 -5
- package/lib/Table/Cell/index.js +12 -8
- package/lib/Table/Cell/theme.js +8 -8
- package/lib/Table/ColHeader/index.js +18 -14
- package/lib/Table/ColHeader/theme.js +10 -10
- package/lib/Table/Head/index.js +14 -10
- package/lib/Table/Head/theme.js +5 -5
- package/lib/Table/Row/index.js +12 -8
- package/lib/Table/Row/theme.js +8 -8
- package/lib/Table/RowHeader/index.js +11 -7
- package/lib/Table/RowHeader/theme.js +8 -8
- package/lib/Table/index.js +14 -10
- package/lib/Table/theme.js +5 -5
- package/package.json +18 -17
- package/tsconfig.build.tsbuildinfo +1 -1
package/LICENSE.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
title: The MIT License (MIT)
|
3
|
+
category: Getting Started
|
4
|
+
order: 9
|
5
|
+
---
|
6
|
+
|
7
|
+
# The MIT License (MIT)
|
8
|
+
|
9
|
+
Copyright (c) 2015 Instructure, Inc.
|
10
|
+
|
11
|
+
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
13
|
+
in the Software without restriction, including without limitation the rights
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
16
|
+
furnished to do so, subject to the following conditions.**
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
package/es/Table/Body/index.js
CHANGED
@@ -43,23 +43,27 @@ id: Table.Body
|
|
43
43
|
|
44
44
|
let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Body extends Component {
|
45
45
|
componentDidMount() {
|
46
|
-
|
46
|
+
var _this$props$makeStyle, _this$props;
|
47
|
+
|
48
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
47
49
|
}
|
48
50
|
|
49
51
|
componentDidUpdate() {
|
50
|
-
|
52
|
+
var _this$props$makeStyle2, _this$props2;
|
53
|
+
|
54
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
51
55
|
}
|
52
56
|
|
53
57
|
render() {
|
54
|
-
const _this$
|
55
|
-
children = _this$
|
56
|
-
hover = _this$
|
57
|
-
isStacked = _this$
|
58
|
-
headers = _this$
|
59
|
-
styles = _this$
|
58
|
+
const _this$props3 = this.props,
|
59
|
+
children = _this$props3.children,
|
60
|
+
hover = _this$props3.hover,
|
61
|
+
isStacked = _this$props3.isStacked,
|
62
|
+
headers = _this$props3.headers,
|
63
|
+
styles = _this$props3.styles;
|
60
64
|
return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, Body.allowedProps), Body), {
|
61
65
|
as: isStacked ? 'div' : 'tbody',
|
62
|
-
css: styles
|
66
|
+
css: styles === null || styles === void 0 ? void 0 : styles.body,
|
63
67
|
role: isStacked ? 'rowgroup' : void 0
|
64
68
|
}), Children.map(children, child => matchComponentTypes(child, [Row]) ? safeCloneElement(child, {
|
65
69
|
key: child.props.name,
|
package/es/Table/Body/theme.js
CHANGED
@@ -31,11 +31,11 @@ const generateComponentTheme = theme => {
|
|
31
31
|
const colors = theme.colors,
|
32
32
|
typography = theme.typography;
|
33
33
|
const componentVariables = {
|
34
|
-
fontSize: typography
|
35
|
-
fontFamily: typography
|
36
|
-
fontWeight: typography
|
37
|
-
color: colors
|
38
|
-
background: colors
|
34
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
35
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
36
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
37
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
38
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
|
39
39
|
};
|
40
40
|
return { ...componentVariables
|
41
41
|
};
|
package/es/Table/Cell/index.js
CHANGED
@@ -42,22 +42,26 @@ id: Table.Cell
|
|
42
42
|
|
43
43
|
let Cell = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Cell extends Component {
|
44
44
|
componentDidMount() {
|
45
|
-
|
45
|
+
var _this$props$makeStyle, _this$props;
|
46
|
+
|
47
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
46
48
|
}
|
47
49
|
|
48
50
|
componentDidUpdate() {
|
49
|
-
|
51
|
+
var _this$props$makeStyle2, _this$props2;
|
52
|
+
|
53
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
50
54
|
}
|
51
55
|
|
52
56
|
render() {
|
53
|
-
const _this$
|
54
|
-
children = _this$
|
55
|
-
styles = _this$
|
56
|
-
isStacked = _this$
|
57
|
-
header = _this$
|
57
|
+
const _this$props3 = this.props,
|
58
|
+
children = _this$props3.children,
|
59
|
+
styles = _this$props3.styles,
|
60
|
+
isStacked = _this$props3.isStacked,
|
61
|
+
header = _this$props3.header;
|
58
62
|
return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, Cell.allowedProps), Cell), {
|
59
63
|
as: isStacked ? 'div' : 'td',
|
60
|
-
css: styles
|
64
|
+
css: styles === null || styles === void 0 ? void 0 : styles.cell,
|
61
65
|
role: isStacked ? 'cell' : void 0
|
62
66
|
}), header && callRenderProp(header), header && ': ', callRenderProp(children));
|
63
67
|
}
|
package/es/Table/Cell/theme.js
CHANGED
@@ -32,14 +32,14 @@ const generateComponentTheme = theme => {
|
|
32
32
|
typography = theme.typography,
|
33
33
|
spacing = theme.spacing;
|
34
34
|
const componentVariables = {
|
35
|
-
fontSize: typography
|
36
|
-
fontFamily: typography
|
37
|
-
fontWeight: typography
|
38
|
-
color: colors
|
39
|
-
background: colors
|
40
|
-
borderColor: colors
|
41
|
-
lineHeight: typography
|
42
|
-
padding: `${spacing
|
35
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
36
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
37
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
38
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
39
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
40
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
|
41
|
+
lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
42
|
+
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
|
43
43
|
};
|
44
44
|
return { ...componentVariables
|
45
45
|
};
|
@@ -55,17 +55,21 @@ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
|
|
55
55
|
}
|
56
56
|
|
57
57
|
componentDidMount() {
|
58
|
-
|
58
|
+
var _this$props$makeStyle, _this$props2;
|
59
|
+
|
60
|
+
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
59
61
|
}
|
60
62
|
|
61
63
|
componentDidUpdate() {
|
62
|
-
|
64
|
+
var _this$props$makeStyle2, _this$props3;
|
65
|
+
|
66
|
+
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
63
67
|
}
|
64
68
|
|
65
69
|
renderSortArrow() {
|
66
|
-
const _this$
|
67
|
-
sortDirection = _this$
|
68
|
-
onRequestSort = _this$
|
70
|
+
const _this$props4 = this.props,
|
71
|
+
sortDirection = _this$props4.sortDirection,
|
72
|
+
onRequestSort = _this$props4.onRequestSort;
|
69
73
|
|
70
74
|
if (sortDirection === 'ascending') {
|
71
75
|
return _IconMiniArrowUpLine || (_IconMiniArrowUpLine = jsx(IconMiniArrowUpLine, null));
|
@@ -88,15 +92,15 @@ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
|
|
88
92
|
}
|
89
93
|
|
90
94
|
render() {
|
91
|
-
const _this$
|
92
|
-
onRequestSort = _this$
|
93
|
-
width = _this$
|
94
|
-
children = _this$
|
95
|
-
sortDirection = _this$
|
96
|
-
scope = _this$
|
97
|
-
styles = _this$
|
95
|
+
const _this$props5 = this.props,
|
96
|
+
onRequestSort = _this$props5.onRequestSort,
|
97
|
+
width = _this$props5.width,
|
98
|
+
children = _this$props5.children,
|
99
|
+
sortDirection = _this$props5.sortDirection,
|
100
|
+
scope = _this$props5.scope,
|
101
|
+
styles = _this$props5.styles;
|
98
102
|
return jsx("th", Object.assign({}, omitProps(this.props, ColHeader.allowedProps), {
|
99
|
-
css: styles
|
103
|
+
css: styles === null || styles === void 0 ? void 0 : styles.colHeader,
|
100
104
|
style: {
|
101
105
|
width
|
102
106
|
},
|
@@ -104,7 +108,7 @@ let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
|
|
104
108
|
"aria-sort": sortDirection
|
105
109
|
}), onRequestSort && jsx("button", {
|
106
110
|
onClick: this.handleClick,
|
107
|
-
css: styles
|
111
|
+
css: styles === null || styles === void 0 ? void 0 : styles.button
|
108
112
|
}, jsx("div", null, callRenderProp(children), this.renderSortArrow())), !onRequestSort && children, !onRequestSort && this.renderSortArrow());
|
109
113
|
}
|
110
114
|
|
@@ -33,16 +33,16 @@ const generateComponentTheme = theme => {
|
|
33
33
|
borders = theme.borders,
|
34
34
|
spacing = theme.spacing;
|
35
35
|
const componentVariables = {
|
36
|
-
fontSize: typography
|
37
|
-
fontFamily: typography
|
38
|
-
color: colors
|
39
|
-
background: colors
|
40
|
-
borderColor: colors
|
41
|
-
lineHeight: typography
|
42
|
-
padding: `${spacing
|
43
|
-
focusOutlineColor: colors
|
44
|
-
focusOutlineWidth: borders
|
45
|
-
focusOutlineStyle: borders
|
36
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
37
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
38
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
39
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
40
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
|
41
|
+
lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
42
|
+
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
|
43
|
+
focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
44
|
+
focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
45
|
+
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
|
46
46
|
};
|
47
47
|
return { ...componentVariables
|
48
48
|
};
|
package/es/Table/Head/index.js
CHANGED
@@ -67,21 +67,25 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
67
67
|
}
|
68
68
|
|
69
69
|
componentDidMount() {
|
70
|
-
|
70
|
+
var _this$props$makeStyle, _this$props;
|
71
|
+
|
72
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
71
73
|
}
|
72
74
|
|
73
75
|
componentDidUpdate() {
|
76
|
+
var _this$props$makeStyle2, _this$props2;
|
77
|
+
|
74
78
|
if (this.isSortable && typeof this.props.renderSortLabel === 'undefined') {
|
75
79
|
warn(false, '[Table.Head] The `renderSortLabel` prop should be provided when Table is sortable.');
|
76
80
|
}
|
77
81
|
|
78
|
-
this.props.makeStyles
|
82
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
79
83
|
}
|
80
84
|
|
81
85
|
renderSelect() {
|
82
|
-
const _this$
|
83
|
-
children = _this$
|
84
|
-
renderSortLabel = _this$
|
86
|
+
const _this$props3 = this.props,
|
87
|
+
children = _this$props3.children,
|
88
|
+
renderSortLabel = _this$props3.renderSortLabel;
|
85
89
|
|
86
90
|
const _ref3 = Children.toArray(children),
|
87
91
|
_ref4 = _slicedToArray(_ref3, 1),
|
@@ -163,12 +167,12 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
163
167
|
}
|
164
168
|
|
165
169
|
render() {
|
166
|
-
const _this$
|
167
|
-
children = _this$
|
168
|
-
isStacked = _this$
|
169
|
-
styles = _this$
|
170
|
+
const _this$props4 = this.props,
|
171
|
+
children = _this$props4.children,
|
172
|
+
isStacked = _this$props4.isStacked,
|
173
|
+
styles = _this$props4.styles;
|
170
174
|
return isStacked ? this.renderSelect() : jsx("thead", Object.assign({}, omitProps(this.props, Head.allowedProps), {
|
171
|
-
css: styles
|
175
|
+
css: styles === null || styles === void 0 ? void 0 : styles.head
|
172
176
|
}), Children.map(children, child => matchComponentTypes(child, [Row]) ? child : null));
|
173
177
|
}
|
174
178
|
|
package/es/Table/Head/theme.js
CHANGED
@@ -31,11 +31,11 @@ const generateComponentTheme = theme => {
|
|
31
31
|
const colors = theme.colors,
|
32
32
|
typography = theme.typography;
|
33
33
|
const componentVariables = {
|
34
|
-
fontSize: typography
|
35
|
-
fontFamily: typography
|
36
|
-
fontWeight: typography
|
37
|
-
color: colors
|
38
|
-
background: colors
|
34
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
35
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
36
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
37
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
38
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
|
39
39
|
};
|
40
40
|
return { ...componentVariables
|
41
41
|
};
|
package/es/Table/Row/index.js
CHANGED
@@ -45,22 +45,26 @@ id: Table.Row
|
|
45
45
|
|
46
46
|
let Row = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Row extends Component {
|
47
47
|
componentDidMount() {
|
48
|
-
|
48
|
+
var _this$props$makeStyle, _this$props;
|
49
|
+
|
50
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
49
51
|
}
|
50
52
|
|
51
53
|
componentDidUpdate() {
|
52
|
-
|
54
|
+
var _this$props$makeStyle2, _this$props2;
|
55
|
+
|
56
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
53
57
|
}
|
54
58
|
|
55
59
|
render() {
|
56
|
-
const _this$
|
57
|
-
children = _this$
|
58
|
-
styles = _this$
|
59
|
-
isStacked = _this$
|
60
|
-
headers = _this$
|
60
|
+
const _this$props3 = this.props,
|
61
|
+
children = _this$props3.children,
|
62
|
+
styles = _this$props3.styles,
|
63
|
+
isStacked = _this$props3.isStacked,
|
64
|
+
headers = _this$props3.headers;
|
61
65
|
return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, Row.allowedProps), Row), {
|
62
66
|
as: isStacked ? 'div' : 'tr',
|
63
|
-
css: styles
|
67
|
+
css: styles === null || styles === void 0 ? void 0 : styles.row,
|
64
68
|
role: isStacked ? 'row' : void 0
|
65
69
|
}), Children.toArray(children).filter(Boolean).map((child, index) => {
|
66
70
|
if (matchComponentTypes(child, [ColHeader])) {
|
package/es/Table/Row/theme.js
CHANGED
@@ -38,14 +38,14 @@ const generateComponentTheme = theme => {
|
|
38
38
|
}
|
39
39
|
};
|
40
40
|
const componentVariables = {
|
41
|
-
fontSize: typography
|
42
|
-
fontFamily: typography
|
43
|
-
fontWeight: typography
|
44
|
-
color: colors
|
45
|
-
background: colors
|
46
|
-
borderColor: colors
|
47
|
-
hoverBorderColor: colors
|
48
|
-
padding: `${spacing
|
41
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
42
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
43
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
44
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
45
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
46
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
|
47
|
+
hoverBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
48
|
+
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} 0`
|
49
49
|
};
|
50
50
|
return { ...componentVariables,
|
51
51
|
...themeSpecificStyle[themeName]
|
@@ -42,21 +42,25 @@ id: Table.RowHeader
|
|
42
42
|
|
43
43
|
let RowHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class RowHeader extends Component {
|
44
44
|
componentDidMount() {
|
45
|
-
|
45
|
+
var _this$props$makeStyle, _this$props;
|
46
|
+
|
47
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
46
48
|
}
|
47
49
|
|
48
50
|
componentDidUpdate() {
|
49
|
-
|
51
|
+
var _this$props$makeStyle2, _this$props2;
|
52
|
+
|
53
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
50
54
|
}
|
51
55
|
|
52
56
|
render() {
|
53
|
-
const _this$
|
54
|
-
children = _this$
|
55
|
-
isStacked = _this$
|
56
|
-
styles = _this$
|
57
|
+
const _this$props3 = this.props,
|
58
|
+
children = _this$props3.children,
|
59
|
+
isStacked = _this$props3.isStacked,
|
60
|
+
styles = _this$props3.styles;
|
57
61
|
return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, RowHeader.allowedProps), RowHeader), {
|
58
62
|
as: isStacked ? 'div' : 'th',
|
59
|
-
css: styles
|
63
|
+
css: styles === null || styles === void 0 ? void 0 : styles.rowHeader,
|
60
64
|
scope: "row",
|
61
65
|
role: isStacked ? 'rowheader' : void 0
|
62
66
|
}), callRenderProp(children));
|
@@ -32,14 +32,14 @@ const generateComponentTheme = theme => {
|
|
32
32
|
typography = theme.typography,
|
33
33
|
spacing = theme.spacing;
|
34
34
|
const componentVariables = {
|
35
|
-
fontSize: typography
|
36
|
-
fontFamily: typography
|
37
|
-
fontWeight: typography
|
38
|
-
color: colors
|
39
|
-
background: colors
|
40
|
-
borderColor: colors
|
41
|
-
lineHeight: typography
|
42
|
-
padding: `${spacing
|
35
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
36
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
37
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
38
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
39
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
40
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
|
41
|
+
lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
42
|
+
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
|
43
43
|
};
|
44
44
|
return { ...componentVariables
|
45
45
|
};
|
package/es/Table/index.js
CHANGED
@@ -64,11 +64,15 @@ let Table = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
64
64
|
}
|
65
65
|
|
66
66
|
componentDidMount() {
|
67
|
-
|
67
|
+
var _this$props$makeStyle, _this$props;
|
68
|
+
|
69
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
68
70
|
}
|
69
71
|
|
70
72
|
componentDidUpdate() {
|
71
|
-
|
73
|
+
var _this$props$makeStyle2, _this$props2;
|
74
|
+
|
75
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
72
76
|
}
|
73
77
|
|
74
78
|
getHeaders() {
|
@@ -94,20 +98,20 @@ let Table = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
94
98
|
}
|
95
99
|
|
96
100
|
render() {
|
97
|
-
const _this$
|
98
|
-
margin = _this$
|
99
|
-
layout = _this$
|
100
|
-
caption = _this$
|
101
|
-
children = _this$
|
102
|
-
hover = _this$
|
103
|
-
styles = _this$
|
101
|
+
const _this$props3 = this.props,
|
102
|
+
margin = _this$props3.margin,
|
103
|
+
layout = _this$props3.layout,
|
104
|
+
caption = _this$props3.caption,
|
105
|
+
children = _this$props3.children,
|
106
|
+
hover = _this$props3.hover,
|
107
|
+
styles = _this$props3.styles;
|
104
108
|
const isStacked = layout === 'stacked';
|
105
109
|
const headers = isStacked ? this.getHeaders() : void 0;
|
106
110
|
return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, Table.allowedProps), Table), {
|
107
111
|
as: isStacked ? 'div' : 'table',
|
108
112
|
margin: margin,
|
109
113
|
elementRef: this.handleRef,
|
110
|
-
css: styles
|
114
|
+
css: styles === null || styles === void 0 ? void 0 : styles.table,
|
111
115
|
role: isStacked ? 'table' : void 0,
|
112
116
|
"aria-label": isStacked ? caption : void 0
|
113
117
|
}), !isStacked && jsx("caption", null, jsx(ScreenReaderContent, null, caption)), Children.map(children, child => {
|
package/es/Table/theme.js
CHANGED
@@ -37,11 +37,11 @@ const generateComponentTheme = theme => {
|
|
37
37
|
}
|
38
38
|
};
|
39
39
|
const componentVariables = {
|
40
|
-
fontSize: typography
|
41
|
-
fontFamily: typography
|
42
|
-
fontWeight: typography
|
43
|
-
color: colors
|
44
|
-
background: colors
|
40
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
41
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
42
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
43
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
44
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
|
45
45
|
};
|
46
46
|
return { ...componentVariables,
|
47
47
|
...themeSpecificStyle[themeName]
|
package/lib/Table/Body/index.js
CHANGED
@@ -38,23 +38,27 @@ id: Table.Body
|
|
38
38
|
**/
|
39
39
|
let Body = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Body extends _react.Component {
|
40
40
|
componentDidMount() {
|
41
|
-
|
41
|
+
var _this$props$makeStyle, _this$props;
|
42
|
+
|
43
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
42
44
|
}
|
43
45
|
|
44
46
|
componentDidUpdate() {
|
45
|
-
|
47
|
+
var _this$props$makeStyle2, _this$props2;
|
48
|
+
|
49
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
46
50
|
}
|
47
51
|
|
48
52
|
render() {
|
49
|
-
const _this$
|
50
|
-
children = _this$
|
51
|
-
hover = _this$
|
52
|
-
isStacked = _this$
|
53
|
-
headers = _this$
|
54
|
-
styles = _this$
|
53
|
+
const _this$props3 = this.props,
|
54
|
+
children = _this$props3.children,
|
55
|
+
hover = _this$props3.hover,
|
56
|
+
isStacked = _this$props3.isStacked,
|
57
|
+
headers = _this$props3.headers,
|
58
|
+
styles = _this$props3.styles;
|
55
59
|
return (0, _emotion.jsx)(_View.View, Object.assign({}, _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, Body.allowedProps), Body), {
|
56
60
|
as: isStacked ? 'div' : 'tbody',
|
57
|
-
css: styles
|
61
|
+
css: styles === null || styles === void 0 ? void 0 : styles.body,
|
58
62
|
role: isStacked ? 'rowgroup' : void 0
|
59
63
|
}), _react.Children.map(children, child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Row.Row]) ? (0, _safeCloneElement.safeCloneElement)(child, {
|
60
64
|
key: child.props.name,
|
package/lib/Table/Body/theme.js
CHANGED
@@ -38,11 +38,11 @@ const generateComponentTheme = theme => {
|
|
38
38
|
const colors = theme.colors,
|
39
39
|
typography = theme.typography;
|
40
40
|
const componentVariables = {
|
41
|
-
fontSize: typography
|
42
|
-
fontFamily: typography
|
43
|
-
fontWeight: typography
|
44
|
-
color: colors
|
45
|
-
background: colors
|
41
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
42
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
43
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
44
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
45
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest
|
46
46
|
};
|
47
47
|
return { ...componentVariables
|
48
48
|
};
|
package/lib/Table/Cell/index.js
CHANGED
@@ -34,22 +34,26 @@ id: Table.Cell
|
|
34
34
|
**/
|
35
35
|
let Cell = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Cell extends _react.Component {
|
36
36
|
componentDidMount() {
|
37
|
-
|
37
|
+
var _this$props$makeStyle, _this$props;
|
38
|
+
|
39
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
38
40
|
}
|
39
41
|
|
40
42
|
componentDidUpdate() {
|
41
|
-
|
43
|
+
var _this$props$makeStyle2, _this$props2;
|
44
|
+
|
45
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
42
46
|
}
|
43
47
|
|
44
48
|
render() {
|
45
|
-
const _this$
|
46
|
-
children = _this$
|
47
|
-
styles = _this$
|
48
|
-
isStacked = _this$
|
49
|
-
header = _this$
|
49
|
+
const _this$props3 = this.props,
|
50
|
+
children = _this$props3.children,
|
51
|
+
styles = _this$props3.styles,
|
52
|
+
isStacked = _this$props3.isStacked,
|
53
|
+
header = _this$props3.header;
|
50
54
|
return (0, _emotion.jsx)(_View.View, Object.assign({}, _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, Cell.allowedProps), Cell), {
|
51
55
|
as: isStacked ? 'div' : 'td',
|
52
|
-
css: styles
|
56
|
+
css: styles === null || styles === void 0 ? void 0 : styles.cell,
|
53
57
|
role: isStacked ? 'cell' : void 0
|
54
58
|
}), header && (0, _callRenderProp.callRenderProp)(header), header && ': ', (0, _callRenderProp.callRenderProp)(children));
|
55
59
|
}
|
package/lib/Table/Cell/theme.js
CHANGED
@@ -39,14 +39,14 @@ const generateComponentTheme = theme => {
|
|
39
39
|
typography = theme.typography,
|
40
40
|
spacing = theme.spacing;
|
41
41
|
const componentVariables = {
|
42
|
-
fontSize: typography
|
43
|
-
fontFamily: typography
|
44
|
-
fontWeight: typography
|
45
|
-
color: colors
|
46
|
-
background: colors
|
47
|
-
borderColor: colors
|
48
|
-
lineHeight: typography
|
49
|
-
padding: `${spacing
|
42
|
+
fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
43
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
44
|
+
fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
45
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
46
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
47
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
|
48
|
+
lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
49
|
+
padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
|
50
50
|
};
|
51
51
|
return { ...componentVariables
|
52
52
|
};
|