@instructure/ui-table 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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 +5 -2
- package/es/Table/v1/Body/index.js +21 -15
- package/es/Table/v1/Body/theme.js +9 -8
- package/es/Table/v1/Cell/index.js +20 -16
- package/es/Table/v1/Cell/styles.js +3 -1
- package/es/Table/v1/Cell/theme.js +13 -12
- package/es/Table/v1/ColHeader/index.js +43 -41
- package/es/Table/v1/ColHeader/styles.js +4 -2
- package/es/Table/v1/ColHeader/theme.js +19 -18
- package/es/Table/v1/Head/index.js +34 -34
- package/es/Table/v1/Head/theme.js +9 -8
- package/es/Table/v1/Row/index.js +18 -14
- package/es/Table/v1/Row/styles.js +4 -2
- package/es/Table/v1/Row/theme.js +14 -13
- package/es/Table/v1/RowHeader/index.js +19 -15
- package/es/Table/v1/RowHeader/styles.js +3 -1
- package/es/Table/v1/RowHeader/theme.js +13 -12
- package/es/Table/v1/index.js +50 -55
- package/es/Table/v1/styles.js +3 -1
- package/es/Table/v1/theme.js +10 -9
- package/es/Table/v2/Body/index.js +21 -15
- package/es/Table/v2/Cell/index.js +20 -16
- package/es/Table/v2/Cell/styles.js +3 -1
- package/es/Table/v2/ColHeader/index.js +45 -43
- package/es/Table/v2/ColHeader/styles.js +4 -2
- package/es/Table/v2/Head/index.js +37 -37
- package/es/Table/v2/Row/index.js +18 -14
- package/es/Table/v2/Row/styles.js +4 -2
- package/es/Table/v2/RowHeader/index.js +19 -15
- package/es/Table/v2/RowHeader/styles.js +3 -1
- package/es/Table/v2/index.js +50 -55
- package/es/Table/v2/styles.js +3 -1
- package/lib/Table/v1/Body/index.js +21 -15
- package/lib/Table/v1/Body/theme.js +9 -8
- package/lib/Table/v1/Cell/index.js +20 -16
- package/lib/Table/v1/Cell/styles.js +3 -1
- package/lib/Table/v1/Cell/theme.js +13 -12
- package/lib/Table/v1/ColHeader/index.js +43 -41
- package/lib/Table/v1/ColHeader/styles.js +4 -2
- package/lib/Table/v1/ColHeader/theme.js +19 -18
- package/lib/Table/v1/Head/index.js +35 -35
- package/lib/Table/v1/Head/theme.js +9 -8
- package/lib/Table/v1/Row/index.js +18 -14
- package/lib/Table/v1/Row/styles.js +4 -2
- package/lib/Table/v1/Row/theme.js +14 -13
- package/lib/Table/v1/RowHeader/index.js +19 -15
- package/lib/Table/v1/RowHeader/styles.js +3 -1
- package/lib/Table/v1/RowHeader/theme.js +13 -12
- package/lib/Table/v1/index.js +50 -55
- package/lib/Table/v1/styles.js +3 -1
- package/lib/Table/v1/theme.js +10 -9
- package/lib/Table/v2/Body/index.js +21 -15
- package/lib/Table/v2/Cell/index.js +20 -16
- package/lib/Table/v2/Cell/styles.js +3 -1
- package/lib/Table/v2/ColHeader/index.js +45 -43
- package/lib/Table/v2/ColHeader/styles.js +4 -2
- package/lib/Table/v2/Head/index.js +38 -38
- package/lib/Table/v2/Row/index.js +18 -14
- package/lib/Table/v2/Row/styles.js +4 -2
- package/lib/Table/v2/RowHeader/index.js +19 -15
- package/lib/Table/v2/RowHeader/styles.js +3 -1
- package/lib/Table/v2/index.js +50 -55
- package/lib/Table/v2/styles.js +3 -1
- package/package.json +15 -15
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -34,19 +34,20 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
typography
|
|
40
|
-
spacing
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
typography,
|
|
40
|
+
spacing
|
|
41
|
+
} = theme;
|
|
41
42
|
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
|
|
43
|
+
fontSize: typography?.fontSizeMedium,
|
|
44
|
+
fontFamily: typography?.fontFamily,
|
|
45
|
+
fontWeight: typography?.fontWeightNormal,
|
|
46
|
+
color: colors?.contrasts?.grey125125,
|
|
47
|
+
background: colors?.contrasts?.white1010,
|
|
48
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
49
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
50
|
+
padding: `${spacing?.xSmall} ${spacing?.small}`
|
|
50
51
|
};
|
|
51
52
|
return {
|
|
52
53
|
...componentVariables
|
|
@@ -16,7 +16,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
16
16
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
17
17
|
var _props = require("./props");
|
|
18
18
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var _dec, _class
|
|
19
|
+
var _dec, _class;
|
|
20
20
|
/*
|
|
21
21
|
* The MIT License (MIT)
|
|
22
22
|
*
|
|
@@ -46,59 +46,66 @@ parent: Table
|
|
|
46
46
|
id: Table.ColHeader
|
|
47
47
|
---
|
|
48
48
|
**/
|
|
49
|
-
let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
}
|
|
49
|
+
let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class ColHeader extends _react.Component {
|
|
50
|
+
static displayName = "ColHeader";
|
|
51
|
+
static componentId = 'Table.ColHeader';
|
|
52
|
+
static allowedProps = _props.allowedProps;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
textAlign: 'start',
|
|
55
|
+
sortDirection: 'none',
|
|
56
|
+
children: null,
|
|
57
|
+
scope: 'col'
|
|
58
|
+
};
|
|
61
59
|
componentDidMount() {
|
|
62
|
-
|
|
63
|
-
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
60
|
+
this.props.makeStyles?.();
|
|
64
61
|
}
|
|
65
62
|
componentDidUpdate() {
|
|
66
|
-
|
|
67
|
-
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
63
|
+
this.props.makeStyles?.();
|
|
68
64
|
}
|
|
65
|
+
handleClick = event => {
|
|
66
|
+
const {
|
|
67
|
+
id,
|
|
68
|
+
onRequestSort
|
|
69
|
+
} = this.props;
|
|
70
|
+
onRequestSort && onRequestSort(event, {
|
|
71
|
+
id
|
|
72
|
+
});
|
|
73
|
+
};
|
|
69
74
|
renderSortArrow() {
|
|
70
|
-
const
|
|
71
|
-
sortDirection
|
|
72
|
-
onRequestSort
|
|
73
|
-
styles
|
|
75
|
+
const {
|
|
76
|
+
sortDirection,
|
|
77
|
+
onRequestSort,
|
|
78
|
+
styles
|
|
79
|
+
} = this.props;
|
|
74
80
|
if (sortDirection === 'ascending') {
|
|
75
81
|
return (0, _jsxRuntime.jsx)(_IconMiniArrowUpLine.IconMiniArrowUpLine, {
|
|
76
|
-
css: styles
|
|
82
|
+
css: styles?.sortedIconColor
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
if (sortDirection === 'descending') {
|
|
80
86
|
return (0, _jsxRuntime.jsx)(_IconMiniArrowDownLine.IconMiniArrowDownLine, {
|
|
81
|
-
css: styles
|
|
87
|
+
css: styles?.sortedIconColor
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
90
|
if (onRequestSort) {
|
|
85
91
|
return (0, _jsxRuntime.jsx)(_IconMiniArrowDoubleLine.IconMiniArrowDoubleLine, {
|
|
86
|
-
css: styles
|
|
92
|
+
css: styles?.unSortedIconColor
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
|
-
return
|
|
95
|
+
return undefined;
|
|
90
96
|
}
|
|
91
97
|
render() {
|
|
92
|
-
const
|
|
93
|
-
onRequestSort
|
|
94
|
-
width
|
|
95
|
-
children
|
|
96
|
-
sortDirection
|
|
97
|
-
scope
|
|
98
|
-
styles
|
|
98
|
+
const {
|
|
99
|
+
onRequestSort,
|
|
100
|
+
width,
|
|
101
|
+
children,
|
|
102
|
+
sortDirection,
|
|
103
|
+
scope,
|
|
104
|
+
styles
|
|
105
|
+
} = this.props;
|
|
99
106
|
return (0, _jsxRuntime.jsxs)("th", {
|
|
100
107
|
...(0, _omitProps.omitProps)(this.props, ColHeader.allowedProps),
|
|
101
|
-
css: styles
|
|
108
|
+
css: styles?.colHeader,
|
|
102
109
|
style: {
|
|
103
110
|
width
|
|
104
111
|
},
|
|
@@ -106,18 +113,13 @@ let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyleLegacy)(_style
|
|
|
106
113
|
"aria-sort": sortDirection,
|
|
107
114
|
children: [onRequestSort && (0, _jsxRuntime.jsx)("button", {
|
|
108
115
|
onClick: this.handleClick,
|
|
109
|
-
css: styles
|
|
116
|
+
css: styles?.button,
|
|
110
117
|
children: (0, _jsxRuntime.jsxs)("div", {
|
|
111
|
-
css: styles
|
|
118
|
+
css: styles?.buttonContent,
|
|
112
119
|
children: [(0, _callRenderProp.callRenderProp)(children), this.renderSortArrow()]
|
|
113
120
|
})
|
|
114
121
|
}), !onRequestSort && children, !onRequestSort && this.renderSortArrow()]
|
|
115
122
|
});
|
|
116
123
|
}
|
|
117
|
-
}
|
|
118
|
-
textAlign: 'start',
|
|
119
|
-
sortDirection: 'none',
|
|
120
|
-
children: null,
|
|
121
|
-
scope: 'col'
|
|
122
|
-
}, _ColHeader)) || _class);
|
|
124
|
+
}) || _class);
|
|
123
125
|
var _default = exports.default = ColHeader;
|
|
@@ -38,8 +38,10 @@ exports.default = void 0;
|
|
|
38
38
|
* @return {Object} The final style object, which will be used in the component
|
|
39
39
|
*/
|
|
40
40
|
const generateStyle = (componentTheme, props) => {
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const {
|
|
42
|
+
onRequestSort,
|
|
43
|
+
textAlign
|
|
44
|
+
} = props;
|
|
43
45
|
const headerStyle = {
|
|
44
46
|
color: componentTheme.color,
|
|
45
47
|
fontSize: componentTheme.fontSize,
|
|
@@ -34,12 +34,13 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
colors
|
|
40
|
-
borders
|
|
41
|
-
spacing
|
|
42
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
typography,
|
|
39
|
+
colors,
|
|
40
|
+
borders,
|
|
41
|
+
spacing,
|
|
42
|
+
key: themeName
|
|
43
|
+
} = theme;
|
|
43
44
|
const themeSpecificStyle = {
|
|
44
45
|
canvas: {
|
|
45
46
|
focusOutlineColor: theme['ic-brand-primary'],
|
|
@@ -47,18 +48,18 @@ const generateComponentTheme = theme => {
|
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
const componentVariables = {
|
|
50
|
-
fontSize: typography
|
|
51
|
-
fontFamily: typography
|
|
52
|
-
color: colors
|
|
53
|
-
background: colors
|
|
54
|
-
borderColor: colors
|
|
55
|
-
lineHeight: typography
|
|
56
|
-
padding: `${spacing
|
|
57
|
-
focusOutlineColor: colors
|
|
58
|
-
focusOutlineWidth: borders
|
|
59
|
-
focusOutlineStyle: borders
|
|
60
|
-
unSortedIconColor: colors
|
|
61
|
-
sortedIconColor: colors
|
|
51
|
+
fontSize: typography?.fontSizeMedium,
|
|
52
|
+
fontFamily: typography?.fontFamily,
|
|
53
|
+
color: colors?.contrasts?.grey125125,
|
|
54
|
+
background: colors?.contrasts?.white1010,
|
|
55
|
+
borderColor: colors?.contrasts?.grey1214,
|
|
56
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
57
|
+
padding: `${spacing?.xSmall} ${spacing?.small}`,
|
|
58
|
+
focusOutlineColor: colors?.contrasts?.blue4570,
|
|
59
|
+
focusOutlineWidth: borders?.widthMedium,
|
|
60
|
+
focusOutlineStyle: borders?.style,
|
|
61
|
+
unSortedIconColor: colors?.contrasts?.grey3045,
|
|
62
|
+
sortedIconColor: colors?.contrasts?.blue4570
|
|
62
63
|
};
|
|
63
64
|
return {
|
|
64
65
|
...componentVariables,
|
|
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Head = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
11
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
12
11
|
var _v11_ = require("@instructure/ui-simple-select/v11_6");
|
|
13
|
-
var
|
|
12
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
14
13
|
var _IconCheckLine = require("@instructure/ui-icons/lib/generated/IconCheckLine.js");
|
|
15
14
|
var _console = require("@instructure/console");
|
|
16
15
|
var _emotion = require("@instructure/emotion");
|
|
@@ -19,7 +18,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
19
18
|
var _props = require("./props");
|
|
20
19
|
var _TableContext = _interopRequireDefault(require("../TableContext"));
|
|
21
20
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
22
|
-
var _dec, _class
|
|
21
|
+
var _dec, _class;
|
|
23
22
|
/*
|
|
24
23
|
* The MIT License (MIT)
|
|
25
24
|
*
|
|
@@ -49,19 +48,24 @@ parent: Table
|
|
|
49
48
|
id: Table.Head
|
|
50
49
|
---
|
|
51
50
|
**/
|
|
52
|
-
let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
51
|
+
let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Head extends _react.Component {
|
|
52
|
+
static displayName = "Head";
|
|
53
|
+
static componentId = 'Table.Head';
|
|
54
|
+
static contextType = _TableContext.default;
|
|
55
|
+
static allowedProps = _props.allowedProps;
|
|
56
|
+
static defaultProps = {
|
|
57
|
+
children: null
|
|
58
|
+
};
|
|
59
|
+
|
|
53
60
|
/**
|
|
54
61
|
* Returns `true` if the first child's children have a `onRequestSort` prop
|
|
55
62
|
*/
|
|
56
63
|
get isSortable() {
|
|
57
|
-
const
|
|
58
|
-
_ref2 = (0, _slicedToArray2.default)(_ref, 1),
|
|
59
|
-
firstRow = _ref2[0];
|
|
64
|
+
const [firstRow] = _react.Children.toArray(this.props.children);
|
|
60
65
|
let sortable = false;
|
|
61
66
|
if (firstRow && firstRow.props && firstRow.props.children) {
|
|
62
67
|
_react.Children.forEach(firstRow.props.children, grandchild => {
|
|
63
|
-
|
|
64
|
-
if (grandchild !== null && grandchild !== void 0 && (_grandchild$props = grandchild.props) !== null && _grandchild$props !== void 0 && _grandchild$props.onRequestSort) {
|
|
68
|
+
if (grandchild?.props?.onRequestSort) {
|
|
65
69
|
sortable = true;
|
|
66
70
|
return;
|
|
67
71
|
}
|
|
@@ -70,15 +74,13 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
70
74
|
return sortable;
|
|
71
75
|
}
|
|
72
76
|
componentDidMount() {
|
|
73
|
-
|
|
74
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
77
|
+
this.props.makeStyles?.();
|
|
75
78
|
}
|
|
76
79
|
componentDidUpdate() {
|
|
77
|
-
var _this$props$makeStyle2, _this$props2;
|
|
78
80
|
if (this.isSortable && typeof this.props.renderSortLabel === 'undefined') {
|
|
79
81
|
(0, _console.warn)(false, '[Table.Head] The `renderSortLabel` prop should be provided when Table is sortable.');
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
this.props.makeStyles?.();
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
/**
|
|
@@ -87,14 +89,12 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
87
89
|
* there the `id`, `stackedSortByLabel`, `sortDirection`, `onRequestSort` props
|
|
88
90
|
*/
|
|
89
91
|
renderSelect() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
firstRow = _ref4[0];
|
|
97
|
-
if (!(firstRow !== null && firstRow !== void 0 && (_firstRow$props = firstRow.props) !== null && _firstRow$props !== void 0 && _firstRow$props.children)) {
|
|
92
|
+
const {
|
|
93
|
+
children,
|
|
94
|
+
renderSortLabel
|
|
95
|
+
} = this.props;
|
|
96
|
+
const [firstRow] = _react.Children.toArray(children);
|
|
97
|
+
if (!firstRow?.props?.children) {
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
const options = [];
|
|
@@ -103,12 +103,13 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
103
103
|
let count = 0;
|
|
104
104
|
_react.Children.forEach(firstRow.props.children, grandchild => {
|
|
105
105
|
count += 1;
|
|
106
|
-
if (!
|
|
107
|
-
const
|
|
108
|
-
id
|
|
109
|
-
stackedSortByLabel
|
|
110
|
-
sortDirection
|
|
111
|
-
onRequestSort
|
|
106
|
+
if (!grandchild?.props) return; // grandchild can be false
|
|
107
|
+
const {
|
|
108
|
+
id,
|
|
109
|
+
stackedSortByLabel,
|
|
110
|
+
sortDirection,
|
|
111
|
+
onRequestSort
|
|
112
|
+
} = grandchild.props;
|
|
112
113
|
if (id && onRequestSort) {
|
|
113
114
|
const label = stackedSortByLabel || id;
|
|
114
115
|
options.push({
|
|
@@ -141,7 +142,7 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
141
142
|
role: "cell",
|
|
142
143
|
"aria-colspan": count,
|
|
143
144
|
children: (0, _jsxRuntime.jsx)(_v11_.SimpleSelect, {
|
|
144
|
-
renderLabel: renderSortLabel ? (0, _callRenderProp.callRenderProp)(renderSortLabel) :
|
|
145
|
+
renderLabel: renderSortLabel ? (0, _callRenderProp.callRenderProp)(renderSortLabel) : (0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {}),
|
|
145
146
|
renderBeforeInput: selectedOption && _IconCheckLine.IconCheckLine,
|
|
146
147
|
value: selectedOption,
|
|
147
148
|
onChange: handleSelect,
|
|
@@ -164,16 +165,15 @@ let Head = exports.Head = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
167
|
render() {
|
|
167
|
-
const
|
|
168
|
-
children
|
|
169
|
-
styles
|
|
168
|
+
const {
|
|
169
|
+
children,
|
|
170
|
+
styles
|
|
171
|
+
} = this.props;
|
|
170
172
|
return this.context.isStacked ? this.renderSelect() : (0, _jsxRuntime.jsx)("thead", {
|
|
171
173
|
...(0, _omitProps.omitProps)(this.props, Head.allowedProps),
|
|
172
|
-
css: styles
|
|
174
|
+
css: styles?.head,
|
|
173
175
|
children: children
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
|
-
}
|
|
177
|
-
children: null
|
|
178
|
-
}, _Head)) || _class);
|
|
178
|
+
}) || _class);
|
|
179
179
|
var _default = exports.default = Head;
|
|
@@ -34,15 +34,16 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
typography
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
typography
|
|
40
|
+
} = theme;
|
|
40
41
|
const componentVariables = {
|
|
41
|
-
fontSize: typography
|
|
42
|
-
fontFamily: typography
|
|
43
|
-
fontWeight: typography
|
|
44
|
-
color: colors
|
|
45
|
-
background: colors
|
|
42
|
+
fontSize: typography?.fontSizeMedium,
|
|
43
|
+
fontFamily: typography?.fontFamily,
|
|
44
|
+
fontWeight: typography?.fontWeightNormal,
|
|
45
|
+
color: colors?.contrasts?.grey125125,
|
|
46
|
+
background: colors?.contrasts?.white1010
|
|
46
47
|
};
|
|
47
48
|
return {
|
|
48
49
|
...componentVariables
|
|
@@ -15,7 +15,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
15
15
|
var _props = require("./props");
|
|
16
16
|
var _TableContext = _interopRequireDefault(require("../TableContext"));
|
|
17
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
var _dec, _class
|
|
18
|
+
var _dec, _class;
|
|
19
19
|
/*
|
|
20
20
|
* The MIT License (MIT)
|
|
21
21
|
*
|
|
@@ -45,32 +45,38 @@ parent: Table
|
|
|
45
45
|
id: Table.Row
|
|
46
46
|
---
|
|
47
47
|
**/
|
|
48
|
-
let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
48
|
+
let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Row extends _react.Component {
|
|
49
|
+
static displayName = "Row";
|
|
50
|
+
static componentId = 'Table.Row';
|
|
51
|
+
static contextType = _TableContext.default;
|
|
52
|
+
static allowedProps = _props.allowedProps;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
children: null
|
|
55
|
+
};
|
|
49
56
|
componentDidMount() {
|
|
50
|
-
|
|
51
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
|
|
57
|
+
this.props.makeStyles?.({
|
|
52
58
|
isStacked: this.context.isStacked,
|
|
53
59
|
hover: this.context.hover
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
componentDidUpdate() {
|
|
57
|
-
|
|
58
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
|
|
63
|
+
this.props.makeStyles?.({
|
|
59
64
|
isStacked: this.context.isStacked,
|
|
60
65
|
hover: this.context.hover
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
render() {
|
|
64
|
-
const
|
|
65
|
-
children
|
|
66
|
-
styles
|
|
69
|
+
const {
|
|
70
|
+
children,
|
|
71
|
+
styles
|
|
72
|
+
} = this.props;
|
|
67
73
|
const isStacked = this.context.isStacked;
|
|
68
74
|
const headers = this.context.headers;
|
|
69
75
|
return (0, _jsxRuntime.jsx)(_v11_.View, {
|
|
70
76
|
..._v11_.View.omitViewProps((0, _omitProps.omitProps)(this.props, Row.allowedProps), Row),
|
|
71
77
|
as: isStacked ? 'div' : 'tr',
|
|
72
|
-
css: styles
|
|
73
|
-
role: isStacked ? 'row' :
|
|
78
|
+
css: styles?.row,
|
|
79
|
+
role: isStacked ? 'row' : undefined,
|
|
74
80
|
children: _react.Children.toArray(children).filter(Boolean).map((child, index) => {
|
|
75
81
|
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
76
82
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
@@ -83,7 +89,5 @@ let Row = exports.Row = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _
|
|
|
83
89
|
})
|
|
84
90
|
});
|
|
85
91
|
}
|
|
86
|
-
}
|
|
87
|
-
children: null
|
|
88
|
-
}, _Row)) || _class);
|
|
92
|
+
}) || _class);
|
|
89
93
|
var _default = exports.default = Row;
|
|
@@ -39,7 +39,9 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props, extraArgs) => {
|
|
42
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
setHoverStateTo
|
|
44
|
+
} = props;
|
|
43
45
|
const hoverStyles = {
|
|
44
46
|
borderLeftColor: componentTheme.hoverBorderColor,
|
|
45
47
|
borderRightColor: componentTheme.hoverBorderColor
|
|
@@ -56,7 +58,7 @@ const generateStyle = (componentTheme, props, extraArgs) => {
|
|
|
56
58
|
borderBottomStyle: 'solid',
|
|
57
59
|
borderBottomWidth: '0.0625rem',
|
|
58
60
|
borderBottomColor: componentTheme.borderColor,
|
|
59
|
-
...((setHoverStateTo
|
|
61
|
+
...((setHoverStateTo ?? extraArgs.hover) && {
|
|
60
62
|
borderLeft: '0.1875rem solid transparent',
|
|
61
63
|
borderRight: '0.1875rem solid transparent',
|
|
62
64
|
...(setHoverStateTo === true ? hoverStyles : {
|
|
@@ -34,25 +34,26 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
typography
|
|
40
|
-
spacing
|
|
41
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
typography,
|
|
40
|
+
spacing,
|
|
41
|
+
key: themeName
|
|
42
|
+
} = theme;
|
|
42
43
|
const themeSpecificStyle = {
|
|
43
44
|
canvas: {
|
|
44
45
|
hoverBorderColor: theme['ic-brand-primary']
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
const componentVariables = {
|
|
48
|
-
fontSize: typography
|
|
49
|
-
fontFamily: typography
|
|
50
|
-
fontWeight: typography
|
|
51
|
-
color: colors
|
|
52
|
-
background: colors
|
|
53
|
-
borderColor: colors
|
|
54
|
-
hoverBorderColor: colors
|
|
55
|
-
padding: `${spacing
|
|
49
|
+
fontSize: typography?.fontSizeMedium,
|
|
50
|
+
fontFamily: typography?.fontFamily,
|
|
51
|
+
fontWeight: typography?.fontWeightNormal,
|
|
52
|
+
color: colors?.contrasts?.grey125125,
|
|
53
|
+
background: colors?.contrasts?.white1010,
|
|
54
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
55
|
+
hoverBorderColor: colors?.contrasts?.blue4570,
|
|
56
|
+
padding: `${spacing?.xSmall} 0`
|
|
56
57
|
};
|
|
57
58
|
return {
|
|
58
59
|
...componentVariables,
|
|
@@ -15,7 +15,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
15
15
|
var _props = require("./props");
|
|
16
16
|
var _TableContext = _interopRequireDefault(require("../TableContext"));
|
|
17
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
var _dec, _class
|
|
18
|
+
var _dec, _class;
|
|
19
19
|
/*
|
|
20
20
|
* The MIT License (MIT)
|
|
21
21
|
*
|
|
@@ -45,31 +45,35 @@ parent: Table
|
|
|
45
45
|
id: Table.RowHeader
|
|
46
46
|
---
|
|
47
47
|
**/
|
|
48
|
-
let RowHeader = exports.RowHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
48
|
+
let RowHeader = exports.RowHeader = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class RowHeader extends _react.Component {
|
|
49
|
+
static displayName = "RowHeader";
|
|
50
|
+
static componentId = 'Table.RowHeader';
|
|
51
|
+
static contextType = _TableContext.default;
|
|
52
|
+
static allowedProps = _props.allowedProps;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
textAlign: 'start',
|
|
55
|
+
children: null
|
|
56
|
+
};
|
|
49
57
|
componentDidMount() {
|
|
50
|
-
|
|
51
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
58
|
+
this.props.makeStyles?.();
|
|
52
59
|
}
|
|
53
60
|
componentDidUpdate() {
|
|
54
|
-
|
|
55
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
61
|
+
this.props.makeStyles?.();
|
|
56
62
|
}
|
|
57
63
|
render() {
|
|
58
|
-
const
|
|
59
|
-
children
|
|
60
|
-
styles
|
|
64
|
+
const {
|
|
65
|
+
children,
|
|
66
|
+
styles
|
|
67
|
+
} = this.props;
|
|
61
68
|
const isStacked = this.context.isStacked;
|
|
62
69
|
return (0, _jsxRuntime.jsx)(_v11_.View, {
|
|
63
70
|
..._v11_.View.omitViewProps((0, _omitProps.omitProps)(this.props, RowHeader.allowedProps), RowHeader),
|
|
64
71
|
as: isStacked ? 'div' : 'th',
|
|
65
|
-
css: styles
|
|
72
|
+
css: styles?.rowHeader,
|
|
66
73
|
scope: "row",
|
|
67
|
-
role: isStacked ? 'rowheader' :
|
|
74
|
+
role: isStacked ? 'rowheader' : undefined,
|
|
68
75
|
children: (0, _callRenderProp.callRenderProp)(children)
|
|
69
76
|
});
|
|
70
77
|
}
|
|
71
|
-
}
|
|
72
|
-
textAlign: 'start',
|
|
73
|
-
children: null
|
|
74
|
-
}, _RowHeader)) || _class);
|
|
78
|
+
}) || _class);
|
|
75
79
|
var _default = exports.default = RowHeader;
|
|
@@ -39,7 +39,9 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
textAlign
|
|
44
|
+
} = props;
|
|
43
45
|
return {
|
|
44
46
|
rowHeader: {
|
|
45
47
|
label: 'rowHeader',
|
|
@@ -34,19 +34,20 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
typography
|
|
40
|
-
spacing
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
typography,
|
|
40
|
+
spacing
|
|
41
|
+
} = theme;
|
|
41
42
|
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
|
|
43
|
+
fontSize: typography?.fontSizeMedium,
|
|
44
|
+
fontFamily: typography?.fontFamily,
|
|
45
|
+
fontWeight: typography?.fontWeightBold,
|
|
46
|
+
color: colors?.contrasts?.grey125125,
|
|
47
|
+
background: colors?.contrasts?.white1010,
|
|
48
|
+
borderColor: colors?.contrasts?.grey4570,
|
|
49
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
50
|
+
padding: `${spacing?.xSmall} ${spacing?.small}`
|
|
50
51
|
};
|
|
51
52
|
return {
|
|
52
53
|
...componentVariables
|