@instructure/ui-table 11.7.3 → 11.7.4-pr-snapshot-1781695314229

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 (128) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +1 -0
  3. package/{lib/Table/v1/Cell/props.js → babel.config.cjs} +12 -7
  4. package/es/Table/v1/Body/index.js +6 -5
  5. package/es/Table/v1/Cell/index.js +6 -5
  6. package/es/Table/v1/ColHeader/index.js +5 -4
  7. package/es/Table/v1/Head/index.js +6 -5
  8. package/es/Table/v1/Row/index.js +6 -5
  9. package/es/Table/v1/RowHeader/index.js +6 -5
  10. package/es/Table/v1/index.js +11 -11
  11. package/es/Table/v2/Body/index.js +5 -4
  12. package/es/Table/v2/Cell/index.js +5 -4
  13. package/es/Table/v2/ColHeader/index.js +3 -3
  14. package/es/Table/v2/Head/index.js +5 -4
  15. package/es/Table/v2/Row/index.js +5 -4
  16. package/es/Table/v2/RowHeader/index.js +5 -4
  17. package/es/Table/v2/index.js +10 -10
  18. package/es/exports/a.js +8 -8
  19. package/es/exports/b.js +8 -8
  20. package/package.json +16 -21
  21. package/src/Table/v1/Body/index.tsx +5 -4
  22. package/src/Table/v1/Cell/index.tsx +5 -4
  23. package/src/Table/v1/ColHeader/index.tsx +4 -3
  24. package/src/Table/v1/Head/index.tsx +5 -4
  25. package/src/Table/v1/Head/props.ts +1 -1
  26. package/src/Table/v1/Row/index.tsx +5 -4
  27. package/src/Table/v1/RowHeader/index.tsx +5 -4
  28. package/src/Table/v1/index.tsx +11 -10
  29. package/src/Table/v2/Body/index.tsx +4 -3
  30. package/src/Table/v2/Cell/index.tsx +4 -3
  31. package/src/Table/v2/ColHeader/index.tsx +3 -2
  32. package/src/Table/v2/Head/index.tsx +4 -3
  33. package/src/Table/v2/Head/props.ts +1 -1
  34. package/src/Table/v2/Row/index.tsx +4 -3
  35. package/src/Table/v2/RowHeader/index.tsx +4 -3
  36. package/src/Table/v2/index.tsx +10 -9
  37. package/src/exports/a.ts +8 -8
  38. package/src/exports/b.ts +8 -8
  39. package/tsconfig.build.tsbuildinfo +1 -1
  40. package/types/Table/v1/Body/index.d.ts +3 -2
  41. package/types/Table/v1/Body/index.d.ts.map +1 -1
  42. package/types/Table/v1/Cell/index.d.ts +3 -2
  43. package/types/Table/v1/Cell/index.d.ts.map +1 -1
  44. package/types/Table/v1/ColHeader/index.d.ts +1 -0
  45. package/types/Table/v1/ColHeader/index.d.ts.map +1 -1
  46. package/types/Table/v1/Head/index.d.ts +3 -2
  47. package/types/Table/v1/Head/index.d.ts.map +1 -1
  48. package/types/Table/v1/Head/props.d.ts +1 -1
  49. package/types/Table/v1/Head/props.d.ts.map +1 -1
  50. package/types/Table/v1/Row/index.d.ts +3 -2
  51. package/types/Table/v1/Row/index.d.ts.map +1 -1
  52. package/types/Table/v1/RowHeader/index.d.ts +3 -2
  53. package/types/Table/v1/RowHeader/index.d.ts.map +1 -1
  54. package/types/Table/v1/index.d.ts +7 -6
  55. package/types/Table/v1/index.d.ts.map +1 -1
  56. package/types/Table/v2/Body/index.d.ts +3 -2
  57. package/types/Table/v2/Body/index.d.ts.map +1 -1
  58. package/types/Table/v2/Cell/index.d.ts +3 -2
  59. package/types/Table/v2/Cell/index.d.ts.map +1 -1
  60. package/types/Table/v2/ColHeader/index.d.ts +1 -0
  61. package/types/Table/v2/ColHeader/index.d.ts.map +1 -1
  62. package/types/Table/v2/Head/index.d.ts +3 -2
  63. package/types/Table/v2/Head/index.d.ts.map +1 -1
  64. package/types/Table/v2/Head/props.d.ts +1 -1
  65. package/types/Table/v2/Head/props.d.ts.map +1 -1
  66. package/types/Table/v2/Row/index.d.ts +3 -2
  67. package/types/Table/v2/Row/index.d.ts.map +1 -1
  68. package/types/Table/v2/RowHeader/index.d.ts +3 -2
  69. package/types/Table/v2/RowHeader/index.d.ts.map +1 -1
  70. package/types/Table/v2/index.d.ts +7 -6
  71. package/types/Table/v2/index.d.ts.map +1 -1
  72. package/types/exports/a.d.ts +8 -8
  73. package/types/exports/a.d.ts.map +1 -1
  74. package/types/exports/b.d.ts +8 -8
  75. package/types/exports/b.d.ts.map +1 -1
  76. package/lib/Table/v1/Body/index.js +0 -86
  77. package/lib/Table/v1/Body/props.js +0 -31
  78. package/lib/Table/v1/Body/styles.js +0 -51
  79. package/lib/Table/v1/Body/theme.js +0 -52
  80. package/lib/Table/v1/Cell/index.js +0 -79
  81. package/lib/Table/v1/Cell/styles.js +0 -63
  82. package/lib/Table/v1/Cell/theme.js +0 -56
  83. package/lib/Table/v1/ColHeader/index.js +0 -125
  84. package/lib/Table/v1/ColHeader/props.js +0 -31
  85. package/lib/Table/v1/ColHeader/styles.js +0 -108
  86. package/lib/Table/v1/ColHeader/theme.js +0 -69
  87. package/lib/Table/v1/Head/index.js +0 -179
  88. package/lib/Table/v1/Head/props.js +0 -31
  89. package/lib/Table/v1/Head/styles.js +0 -51
  90. package/lib/Table/v1/Head/theme.js +0 -52
  91. package/lib/Table/v1/Row/index.js +0 -93
  92. package/lib/Table/v1/Row/props.js +0 -31
  93. package/lib/Table/v1/Row/styles.js +0 -74
  94. package/lib/Table/v1/Row/theme.js +0 -63
  95. package/lib/Table/v1/RowHeader/index.js +0 -79
  96. package/lib/Table/v1/RowHeader/props.js +0 -31
  97. package/lib/Table/v1/RowHeader/styles.js +0 -63
  98. package/lib/Table/v1/RowHeader/theme.js +0 -56
  99. package/lib/Table/v1/TableContext.js +0 -51
  100. package/lib/Table/v1/index.js +0 -196
  101. package/lib/Table/v1/props.js +0 -31
  102. package/lib/Table/v1/styles.js +0 -74
  103. package/lib/Table/v1/theme.js +0 -59
  104. package/lib/Table/v2/Body/index.js +0 -85
  105. package/lib/Table/v2/Body/props.js +0 -31
  106. package/lib/Table/v2/Body/styles.js +0 -51
  107. package/lib/Table/v2/Cell/index.js +0 -78
  108. package/lib/Table/v2/Cell/props.js +0 -31
  109. package/lib/Table/v2/Cell/styles.js +0 -62
  110. package/lib/Table/v2/ColHeader/index.js +0 -124
  111. package/lib/Table/v2/ColHeader/props.js +0 -31
  112. package/lib/Table/v2/ColHeader/styles.js +0 -101
  113. package/lib/Table/v2/Head/index.js +0 -179
  114. package/lib/Table/v2/Head/props.js +0 -31
  115. package/lib/Table/v2/Head/styles.js +0 -51
  116. package/lib/Table/v2/Row/index.js +0 -92
  117. package/lib/Table/v2/Row/props.js +0 -31
  118. package/lib/Table/v2/Row/styles.js +0 -75
  119. package/lib/Table/v2/RowHeader/index.js +0 -78
  120. package/lib/Table/v2/RowHeader/props.js +0 -31
  121. package/lib/Table/v2/RowHeader/styles.js +0 -62
  122. package/lib/Table/v2/TableContext.js +0 -51
  123. package/lib/Table/v2/index.js +0 -195
  124. package/lib/Table/v2/props.js +0 -31
  125. package/lib/Table/v2/styles.js +0 -74
  126. package/lib/exports/a.js +0 -61
  127. package/lib/exports/b.js +0 -61
  128. package/lib/package.json +0 -1
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @return {Object} The final style object, which will be used in the component
38
- */
39
- const generateStyle = componentTheme => {
40
- return {
41
- body: {
42
- label: 'body',
43
- fontSize: componentTheme.fontSize,
44
- fontFamily: componentTheme.fontFamily,
45
- fontWeight: componentTheme.fontWeight,
46
- color: componentTheme.color,
47
- background: componentTheme.background
48
- }
49
- };
50
- };
51
- var _default = exports.default = generateStyle;
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- const {
38
- colors,
39
- typography
40
- } = theme;
41
- const componentVariables = {
42
- fontSize: typography?.fontSizeMedium,
43
- fontFamily: typography?.fontFamily,
44
- fontWeight: typography?.fontWeightNormal,
45
- color: colors?.contrasts?.grey125125,
46
- background: colors?.contrasts?.white1010
47
- };
48
- return {
49
- ...componentVariables
50
- };
51
- };
52
- var _default = exports.default = generateComponentTheme;
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.Cell = void 0;
8
- var _react = require("react");
9
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
10
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
11
- var _v11_ = require("@instructure/ui-view/v11_6");
12
- var _emotion = require("@instructure/emotion");
13
- var _styles = _interopRequireDefault(require("./styles"));
14
- var _theme = _interopRequireDefault(require("./theme"));
15
- var _props = require("./props");
16
- var _TableContext = _interopRequireDefault(require("../TableContext"));
17
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
18
- var _dec, _class;
19
- /*
20
- * The MIT License (MIT)
21
- *
22
- * Copyright (c) 2015 - present Instructure, Inc.
23
- *
24
- * Permission is hereby granted, free of charge, to any person obtaining a copy
25
- * of this software and associated documentation files (the "Software"), to deal
26
- * in the Software without restriction, including without limitation the rights
27
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
- * copies of the Software, and to permit persons to whom the Software is
29
- * furnished to do so, subject to the following conditions:
30
- *
31
- * The above copyright notice and this permission notice shall be included in all
32
- * copies or substantial portions of the Software.
33
- *
34
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
- * SOFTWARE.
41
- */
42
- /**
43
- ---
44
- parent: Table
45
- id: Table.Cell
46
- ---
47
- **/
48
- let Cell = exports.Cell = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class Cell extends _react.Component {
49
- static displayName = "Cell";
50
- static componentId = 'Table.Cell';
51
- static contextType = _TableContext.default;
52
- static allowedProps = _props.allowedProps;
53
- static defaultProps = {
54
- textAlign: 'start',
55
- children: null
56
- };
57
- componentDidMount() {
58
- this.props.makeStyles?.();
59
- }
60
- componentDidUpdate() {
61
- this.props.makeStyles?.();
62
- }
63
- render() {
64
- const {
65
- children,
66
- styles,
67
- header
68
- } = this.props;
69
- const isStacked = this.context.isStacked;
70
- return (0, _jsxRuntime.jsxs)(_v11_.View, {
71
- ..._v11_.View.omitViewProps((0, _omitProps.omitProps)(this.props, Cell.allowedProps), Cell),
72
- as: isStacked ? 'div' : 'td',
73
- css: styles?.cell,
74
- role: isStacked ? 'cell' : undefined,
75
- children: [header && (0, _callRenderProp.callRenderProp)(header), header && ': ', (0, _callRenderProp.callRenderProp)(children)]
76
- });
77
- }
78
- }) || _class);
79
- var _default = exports.default = Cell;
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props) => {
42
- const {
43
- textAlign
44
- } = props;
45
- return {
46
- cell: {
47
- label: 'cell',
48
- fontSize: componentTheme.fontSize,
49
- fontFamily: componentTheme.fontFamily,
50
- fontWeight: componentTheme.fontWeight,
51
- color: componentTheme.color,
52
- background: componentTheme.background,
53
- boxSizing: 'border-box',
54
- verticalAlign: 'middle',
55
- lineHeight: componentTheme.lineHeight,
56
- padding: componentTheme.padding,
57
- ...(textAlign && {
58
- textAlign
59
- })
60
- }
61
- };
62
- };
63
- var _default = exports.default = generateStyle;
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- const {
38
- colors,
39
- typography,
40
- spacing
41
- } = theme;
42
- const componentVariables = {
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}`
51
- };
52
- return {
53
- ...componentVariables
54
- };
55
- };
56
- var _default = exports.default = generateComponentTheme;
@@ -1,125 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.ColHeader = void 0;
8
- var _react = require("react");
9
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
10
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
11
- var _IconMiniArrowUpLine = require("@instructure/ui-icons/lib/generated/IconMiniArrowUpLine.js");
12
- var _IconMiniArrowDownLine = require("@instructure/ui-icons/lib/generated/IconMiniArrowDownLine.js");
13
- var _IconMiniArrowDoubleLine = require("@instructure/ui-icons/lib/generated/IconMiniArrowDoubleLine.js");
14
- var _emotion = require("@instructure/emotion");
15
- var _styles = _interopRequireDefault(require("./styles"));
16
- var _theme = _interopRequireDefault(require("./theme"));
17
- var _props = require("./props");
18
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
19
- var _dec, _class;
20
- /*
21
- * The MIT License (MIT)
22
- *
23
- * Copyright (c) 2015 - present Instructure, Inc.
24
- *
25
- * Permission is hereby granted, free of charge, to any person obtaining a copy
26
- * of this software and associated documentation files (the "Software"), to deal
27
- * in the Software without restriction, including without limitation the rights
28
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
- * copies of the Software, and to permit persons to whom the Software is
30
- * furnished to do so, subject to the following conditions:
31
- *
32
- * The above copyright notice and this permission notice shall be included in all
33
- * copies or substantial portions of the Software.
34
- *
35
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
- * SOFTWARE.
42
- */
43
- /**
44
- ---
45
- parent: Table
46
- id: Table.ColHeader
47
- ---
48
- **/
49
- let ColHeader = exports.ColHeader = (_dec = (0, _emotion.withStyle)(_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
- };
59
- componentDidMount() {
60
- this.props.makeStyles?.();
61
- }
62
- componentDidUpdate() {
63
- this.props.makeStyles?.();
64
- }
65
- handleClick = event => {
66
- const {
67
- id,
68
- onRequestSort
69
- } = this.props;
70
- onRequestSort && onRequestSort(event, {
71
- id
72
- });
73
- };
74
- renderSortArrow() {
75
- const {
76
- sortDirection,
77
- onRequestSort,
78
- styles
79
- } = this.props;
80
- if (sortDirection === 'ascending') {
81
- return (0, _jsxRuntime.jsx)(_IconMiniArrowUpLine.IconMiniArrowUpLine, {
82
- css: styles?.sortedIconColor
83
- });
84
- }
85
- if (sortDirection === 'descending') {
86
- return (0, _jsxRuntime.jsx)(_IconMiniArrowDownLine.IconMiniArrowDownLine, {
87
- css: styles?.sortedIconColor
88
- });
89
- }
90
- if (onRequestSort) {
91
- return (0, _jsxRuntime.jsx)(_IconMiniArrowDoubleLine.IconMiniArrowDoubleLine, {
92
- css: styles?.unSortedIconColor
93
- });
94
- }
95
- return undefined;
96
- }
97
- render() {
98
- const {
99
- onRequestSort,
100
- width,
101
- children,
102
- sortDirection,
103
- scope,
104
- styles
105
- } = this.props;
106
- return (0, _jsxRuntime.jsxs)("th", {
107
- ...(0, _omitProps.omitProps)(this.props, ColHeader.allowedProps),
108
- css: styles?.colHeader,
109
- style: {
110
- width
111
- },
112
- scope: scope,
113
- "aria-sort": sortDirection,
114
- children: [onRequestSort && (0, _jsxRuntime.jsx)("button", {
115
- onClick: this.handleClick,
116
- css: styles?.button,
117
- children: (0, _jsxRuntime.jsxs)("div", {
118
- css: styles?.buttonContent,
119
- children: [(0, _callRenderProp.callRenderProp)(children), this.renderSortArrow()]
120
- })
121
- }), !onRequestSort && children, !onRequestSort && this.renderSortArrow()]
122
- });
123
- }
124
- }) || _class);
125
- var _default = exports.default = ColHeader;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- const allowedProps = exports.allowedProps = ['id', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
@@ -1,108 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @return {Object} The final style object, which will be used in the component
39
- */
40
- const generateStyle = (componentTheme, props) => {
41
- const {
42
- onRequestSort,
43
- textAlign
44
- } = props;
45
- const headerStyle = {
46
- color: componentTheme.color,
47
- fontSize: componentTheme.fontSize,
48
- fontFamily: componentTheme.fontFamily,
49
- fontWeight: 'bold',
50
- lineHeight: componentTheme.lineHeight,
51
- padding: componentTheme.padding
52
- };
53
- const buttonTextAlignVariants = {
54
- start: {
55
- flexDirection: 'row'
56
- },
57
- center: {
58
- justifyContent: 'center'
59
- },
60
- end: {
61
- flexDirection: 'row-reverse'
62
- }
63
- };
64
- return {
65
- colHeader: {
66
- label: 'colHeader',
67
- background: componentTheme.background,
68
- verticalAlign: 'middle',
69
- boxSizing: 'border-box',
70
- ...(!onRequestSort && headerStyle),
71
- textAlign
72
- },
73
- button: {
74
- label: 'colHeader__button',
75
- ...headerStyle,
76
- display: 'flex',
77
- alignItems: 'center',
78
- boxSizing: 'border-box',
79
- border: 'none',
80
- width: '100%',
81
- height: '100%',
82
- background: 'transparent',
83
- cursor: 'pointer',
84
- outline: 'none',
85
- '&::-moz-focus-inner': {
86
- border: 0
87
- },
88
- '&:focus': {
89
- outline: `${componentTheme.focusOutlineWidth} ${componentTheme.focusOutlineStyle} ${componentTheme.focusOutlineColor}`
90
- },
91
- ...buttonTextAlignVariants[textAlign]
92
- },
93
- buttonContent: {
94
- label: 'colHeader__buttonContent',
95
- display: 'flex',
96
- alignItems: 'center'
97
- },
98
- unSortedIconColor: {
99
- label: 'colHeader__unSortedIconColor',
100
- color: componentTheme.unSortedIconColor
101
- },
102
- sortedIconColor: {
103
- label: 'colHeader__sortedIconColor',
104
- color: componentTheme.sortedIconColor
105
- }
106
- };
107
- };
108
- var _default = exports.default = generateStyle;
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- const {
38
- typography,
39
- colors,
40
- borders,
41
- spacing,
42
- key: themeName
43
- } = theme;
44
- const themeSpecificStyle = {
45
- canvas: {
46
- focusOutlineColor: theme['ic-brand-primary'],
47
- sortedIconColor: theme['ic-brand-primary']
48
- }
49
- };
50
- const componentVariables = {
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
63
- };
64
- return {
65
- ...componentVariables,
66
- ...themeSpecificStyle[themeName]
67
- };
68
- };
69
- var _default = exports.default = generateComponentTheme;