@hitachivantara/uikit-react-lab 3.45.10 → 3.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProgressBar/ProgressBar.d.ts +2 -8
- package/dist/ProgressBar/ProgressBar.js +3 -15
- package/dist/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/ProgressBar/ProgressBarSimulator.js +0 -2
- package/dist/ProgressBar/ProgressBarSimulator.js.map +1 -1
- package/dist/ProgressBar/styles.js +0 -5
- package/dist/ProgressBar/styles.js.map +1 -1
- package/dist/Table/Table.d.ts +5 -1
- package/dist/Table/Table.js +20 -5
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody/TableBody.js +33 -5
- package/dist/Table/TableBody/TableBody.js.map +1 -1
- package/dist/Table/TableBody/styles.js.map +1 -1
- package/dist/Table/TableCell/TableCell.d.ts +3 -1
- package/dist/Table/TableCell/TableCell.js +22 -2
- package/dist/Table/TableCell/TableCell.js.map +1 -1
- package/dist/Table/TableCell/styles.js +28 -0
- package/dist/Table/TableCell/styles.js.map +1 -1
- package/dist/Table/TableHeader/TableHeader.d.ts +1 -0
- package/dist/Table/TableHeader/TableHeader.js +6 -1
- package/dist/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/Table/TableHeader/styles.js +9 -0
- package/dist/Table/TableHeader/styles.js.map +1 -1
- package/dist/Table/TableRow/TableRow.d.ts +3 -1
- package/dist/Table/TableRow/TableRow.js +16 -2
- package/dist/Table/TableRow/TableRow.js.map +1 -1
- package/dist/Table/TableRow/styles.js +28 -3
- package/dist/Table/TableRow/styles.js.map +1 -1
- package/dist/Table/styles.js +5 -0
- package/dist/Table/styles.js.map +1 -1
- package/dist/legacy/ProgressBar/ProgressBar.d.ts +2 -8
- package/dist/legacy/ProgressBar/ProgressBar.js +3 -15
- package/dist/legacy/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/legacy/ProgressBar/ProgressBarSimulator.js +0 -2
- package/dist/legacy/ProgressBar/ProgressBarSimulator.js.map +1 -1
- package/dist/legacy/ProgressBar/styles.js +0 -5
- package/dist/legacy/ProgressBar/styles.js.map +1 -1
- package/dist/legacy/Table/Table.d.ts +5 -1
- package/dist/legacy/Table/Table.js +21 -6
- package/dist/legacy/Table/Table.js.map +1 -1
- package/dist/legacy/Table/TableBody/TableBody.js +31 -6
- package/dist/legacy/Table/TableBody/TableBody.js.map +1 -1
- package/dist/legacy/Table/TableBody/styles.js.map +1 -1
- package/dist/legacy/Table/TableCell/TableCell.d.ts +3 -1
- package/dist/legacy/Table/TableCell/TableCell.js +22 -2
- package/dist/legacy/Table/TableCell/TableCell.js.map +1 -1
- package/dist/legacy/Table/TableCell/styles.js +28 -0
- package/dist/legacy/Table/TableCell/styles.js.map +1 -1
- package/dist/legacy/Table/TableHeader/TableHeader.d.ts +1 -0
- package/dist/legacy/Table/TableHeader/TableHeader.js +6 -1
- package/dist/legacy/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/legacy/Table/TableHeader/styles.js +9 -0
- package/dist/legacy/Table/TableHeader/styles.js.map +1 -1
- package/dist/legacy/Table/TableRow/TableRow.d.ts +3 -1
- package/dist/legacy/Table/TableRow/TableRow.js +16 -2
- package/dist/legacy/Table/TableRow/TableRow.js.map +1 -1
- package/dist/legacy/Table/TableRow/styles.js +27 -3
- package/dist/legacy/Table/TableRow/styles.js.map +1 -1
- package/dist/legacy/Table/styles.js +5 -0
- package/dist/legacy/Table/styles.js.map +1 -1
- package/dist/modern/ProgressBar/ProgressBar.d.ts +2 -8
- package/dist/modern/ProgressBar/ProgressBar.js +3 -14
- package/dist/modern/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/modern/ProgressBar/ProgressBarSimulator.js +0 -2
- package/dist/modern/ProgressBar/ProgressBarSimulator.js.map +1 -1
- package/dist/modern/ProgressBar/styles.js +0 -5
- package/dist/modern/ProgressBar/styles.js.map +1 -1
- package/dist/modern/Table/Table.d.ts +5 -1
- package/dist/modern/Table/Table.js +21 -7
- package/dist/modern/Table/Table.js.map +1 -1
- package/dist/modern/Table/TableBody/TableBody.js +30 -7
- package/dist/modern/Table/TableBody/TableBody.js.map +1 -1
- package/dist/modern/Table/TableBody/styles.js.map +1 -1
- package/dist/modern/Table/TableCell/TableCell.d.ts +3 -1
- package/dist/modern/Table/TableCell/TableCell.js +22 -2
- package/dist/modern/Table/TableCell/TableCell.js.map +1 -1
- package/dist/modern/Table/TableCell/styles.js +28 -0
- package/dist/modern/Table/TableCell/styles.js.map +1 -1
- package/dist/modern/Table/TableHeader/TableHeader.d.ts +1 -0
- package/dist/modern/Table/TableHeader/TableHeader.js +6 -1
- package/dist/modern/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/modern/Table/TableHeader/styles.js +9 -0
- package/dist/modern/Table/TableHeader/styles.js.map +1 -1
- package/dist/modern/Table/TableRow/TableRow.d.ts +3 -1
- package/dist/modern/Table/TableRow/TableRow.js +16 -2
- package/dist/modern/Table/TableRow/TableRow.js.map +1 -1
- package/dist/modern/Table/TableRow/styles.js +26 -3
- package/dist/modern/Table/TableRow/styles.js.map +1 -1
- package/dist/modern/Table/styles.js +5 -0
- package/dist/modern/Table/styles.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["classes", "className", "component"];
|
|
4
|
-
import React, { forwardRef, useContext } from "react";
|
|
3
|
+
const _excluded = ["classes", "className", "component", "children", "withNavigation"];
|
|
4
|
+
import React, { forwardRef, useContext, useRef } from "react";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { withStyles } from "@material-ui/core";
|
|
8
|
+
import { useForkRef } from "@hitachivantara/uikit-react-core";
|
|
9
|
+
import Focus from "@hitachivantara/uikit-react-core/dist/Focus";
|
|
8
10
|
import TableContext from "../TableContext";
|
|
9
11
|
import TableSectionContext from "../TableSectionContext";
|
|
10
12
|
import styles from "./styles";
|
|
11
13
|
const tableSectionContext = {
|
|
12
|
-
type: "body"
|
|
14
|
+
type: "body",
|
|
15
|
+
filterClassName: "grid"
|
|
13
16
|
};
|
|
14
17
|
const defaultComponent = "tbody";
|
|
15
18
|
/**
|
|
@@ -17,25 +20,40 @@ const defaultComponent = "tbody";
|
|
|
17
20
|
* `HvTableCell` and `HvTableRow` elements in it inherit body-specific styles
|
|
18
21
|
*/
|
|
19
22
|
|
|
20
|
-
const HvTableBody = /*#__PURE__*/forwardRef(function HvTableBody(props,
|
|
23
|
+
const HvTableBody = /*#__PURE__*/forwardRef(function HvTableBody(props, externalRef) {
|
|
21
24
|
var _tableContext$compone;
|
|
22
25
|
|
|
23
26
|
const {
|
|
24
27
|
classes,
|
|
25
28
|
className,
|
|
26
|
-
component
|
|
29
|
+
component,
|
|
30
|
+
children,
|
|
31
|
+
withNavigation = false
|
|
27
32
|
} = props,
|
|
28
33
|
others = _objectWithoutProperties(props, _excluded);
|
|
29
34
|
|
|
30
35
|
const tableContext = useContext(TableContext);
|
|
36
|
+
const bodyRef = useRef(null);
|
|
37
|
+
const handleRef = useForkRef(externalRef, bodyRef);
|
|
31
38
|
const Component = component || (tableContext === null || tableContext === void 0 ? void 0 : (_tableContext$compone = tableContext.components) === null || _tableContext$compone === void 0 ? void 0 : _tableContext$compone.TBody) || defaultComponent;
|
|
32
39
|
return /*#__PURE__*/React.createElement(TableSectionContext.Provider, {
|
|
33
40
|
value: tableSectionContext
|
|
34
41
|
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
35
42
|
className: clsx(classes.root, className),
|
|
36
|
-
ref:
|
|
43
|
+
ref: handleRef,
|
|
37
44
|
role: Component === defaultComponent ? null : "rowgroup"
|
|
38
|
-
}, others)
|
|
45
|
+
}, others), withNavigation ? children.map(element => {
|
|
46
|
+
return /*#__PURE__*/React.createElement(Focus, {
|
|
47
|
+
rootRef: bodyRef,
|
|
48
|
+
key: `row-${element.key}`,
|
|
49
|
+
strategy: "grid",
|
|
50
|
+
useArrows: "true",
|
|
51
|
+
filterClass: tableSectionContext.filterClassName,
|
|
52
|
+
navigationJump: 1,
|
|
53
|
+
focusDisabled: false,
|
|
54
|
+
selected: element.props.selected
|
|
55
|
+
}, element);
|
|
56
|
+
}) : children));
|
|
39
57
|
});
|
|
40
58
|
process.env.NODE_ENV !== "production" ? HvTableBody.propTypes = {
|
|
41
59
|
/**
|
|
@@ -54,6 +72,11 @@ process.env.NODE_ENV !== "production" ? HvTableBody.propTypes = {
|
|
|
54
72
|
*/
|
|
55
73
|
component: PropTypes.elementType,
|
|
56
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Sets whether or not there should be arrow navigation between the table rows
|
|
77
|
+
*/
|
|
78
|
+
withNavigation: PropTypes.bool,
|
|
79
|
+
|
|
57
80
|
/**
|
|
58
81
|
* A Jss Object used to override or extend the styles applied.
|
|
59
82
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","names":["React","forwardRef","useContext","PropTypes","clsx","withStyles","TableContext","TableSectionContext","styles","tableSectionContext","type","defaultComponent","HvTableBody","props","
|
|
1
|
+
{"version":3,"file":"TableBody.js","names":["React","forwardRef","useContext","useRef","PropTypes","clsx","withStyles","useForkRef","Focus","TableContext","TableSectionContext","styles","tableSectionContext","type","filterClassName","defaultComponent","HvTableBody","props","externalRef","classes","className","component","children","withNavigation","others","tableContext","bodyRef","handleRef","Component","components","TBody","root","map","element","key","selected","propTypes","string","node","elementType","bool","shape","isRequired","name"],"sources":["../../../../src/Table/TableBody/TableBody.js"],"sourcesContent":["import React, { forwardRef, useContext, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport { useForkRef } from \"@hitachivantara/uikit-react-core\";\n\nimport Focus from \"@hitachivantara/uikit-react-core/dist/Focus\";\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\nimport styles from \"./styles\";\n\nconst tableSectionContext = {\n type: \"body\",\n filterClassName: \"grid\",\n};\n\nconst defaultComponent = \"tbody\";\n\n/**\n * HvTableBody acts as a `tbody` element.\n * `HvTableCell` and `HvTableRow` elements in it inherit body-specific styles\n */\nconst HvTableBody = forwardRef(function HvTableBody(props, externalRef) {\n const { classes, className, component, children, withNavigation = false, ...others } = props;\n\n const tableContext = useContext(TableContext);\n\n const bodyRef = useRef(null);\n\n const handleRef = useForkRef(externalRef, bodyRef);\n\n const Component = component || tableContext?.components?.TBody || defaultComponent;\n\n return (\n <TableSectionContext.Provider value={tableSectionContext}>\n <Component\n className={clsx(classes.root, className)}\n ref={handleRef}\n role={Component === defaultComponent ? null : \"rowgroup\"}\n {...others}\n >\n {withNavigation\n ? children.map((element) => {\n return (\n <Focus\n rootRef={bodyRef}\n key={`row-${element.key}`}\n strategy=\"grid\"\n useArrows=\"true\"\n filterClass={tableSectionContext.filterClassName}\n navigationJump={1}\n focusDisabled={false}\n selected={element.props.selected}\n >\n {element}\n </Focus>\n );\n })\n : children}\n </Component>\n </TableSectionContext.Provider>\n );\n});\n\nHvTableBody.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Content to be rendered\n */\n children: PropTypes.node,\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to tbody.\n */\n component: PropTypes.elementType,\n /**\n * Sets whether or not there should be arrow navigation between the table rows\n */\n withNavigation: PropTypes.bool,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n }).isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvTableBody\" })(HvTableBody);\n"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,UAA5B,EAAwCC,MAAxC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MA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AQ,CAACU,GAAT,CAAcC,OAAD,IAAa;IACxB,oBACE,oBAAC,KAAD;MACE,OAAO,EAAEP,OADX;MAEE,GAAG,EAAG,OAAMO,OAAO,CAACC,GAAI,EAF1B;MAGE,QAAQ,EAAC,MAHX;MAIE,SAAS,EAAC,MAJZ;MAKE,WAAW,EAAEtB,mBAAmB,CAACE,eALnC;MAME,cAAc,EAAE,CANlB;MAOE,aAAa,EAAE,KAPjB;MAQE,QAAQ,EAAEmB,OAAO,CAAChB,KAAR,CAAckB;IAR1B,GAUGF,OAVH,CADF;EAcD,CAfD,CADW,GAiBXX,QAvBN,CADF,CADF;AA6BD,CAxC6B,CAA9B;AA0CA,wCAAAN,WAAW,CAACoB,SAAZ,GAAwB;EACtB;AACF;AACA;EACEhB,SAAS,EAAEhB,SAAS,CAACiC,MAJC;;EAKtB;AACF;AACA;EACEf,QAAQ,EAAElB,SAAS,CAACkC,IARE;;EAStB;AACF;AACA;AACA;EACEjB,SAAS,EAAEjB,SAAS,CAACmC,WAbC;;EActB;AACF;AACA;EACEhB,cAAc,EAAEnB,SAAS,CAACoC,IAjBJ;;EAkBtB;AACF;AACA;EACErB,OAAO,EAAEf,SAAS,CAACqC,KAAV,CAAgB;IACvB;AACJ;AACA;IACIV,IAAI,EAAE3B,SAAS,CAACiC;EAJO,CAAhB,EAKNK;AA1BmB,CAAxB;AA6BA,eAAepC,UAAU,CAACK,MAAD,EAAS;EAAEgC,IAAI,EAAE;AAAR,CAAT,CAAV,CAA4C3B,WAA5C,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","root","backgroundColor","position","zIndex"],"sources":["../../../../src/Table/TableBody/styles.js"],"sourcesContent":["const styles = () => ({\n root: {\n backgroundColor: \"inherit\",\n
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","root","backgroundColor","position","zIndex"],"sources":["../../../../src/Table/TableBody/styles.js"],"sourcesContent":["const styles = () => ({\n root: {\n backgroundColor: \"inherit\",\n position: \"relative\",\n zIndex: 0,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAG,OAAO;EACpBC,IAAI,EAAE;IACJC,eAAe,EAAE,SADb;IAEJC,QAAQ,EAAE,UAFN;IAGJC,MAAM,EAAE;EAHJ;AADc,CAAP,CAAf;;AAQA,eAAeJ,MAAf"}
|
|
@@ -15,6 +15,8 @@ export type HvTableCellClassKey =
|
|
|
15
15
|
| "variantCheckbox"
|
|
16
16
|
| "variantExpand"
|
|
17
17
|
| "variantActions"
|
|
18
|
+
| "variantListactions"
|
|
19
|
+
| "variantListcheckbox"
|
|
18
20
|
| "variantNone"
|
|
19
21
|
| "resizable"
|
|
20
22
|
| "resizing";
|
|
@@ -38,7 +40,7 @@ export interface HvTableCellProps
|
|
|
38
40
|
/**
|
|
39
41
|
* Sets the cell's variant.
|
|
40
42
|
*/
|
|
41
|
-
variant?: "checkbox" | "expand" | "actions" | "default" | "none";
|
|
43
|
+
variant?: "checkbox" | "expand" | "actions" | "default" | "listcheckbox" | "listactions" | "none";
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* Specify the cell type.
|
|
@@ -45,7 +45,7 @@ const HvTableCell = /*#__PURE__*/forwardRef(function HvTableCell(props, ref) {
|
|
|
45
45
|
ref: ref,
|
|
46
46
|
role: Component === defaultComponent ? null : "cell",
|
|
47
47
|
style: style,
|
|
48
|
-
className: clsx(classes.root, classes[type], className, align !== "inherit" && classes[`align${capitalize(align)}`], variant !== "default" && classes[`variant${capitalize(variant)}`], sorted && classes.sorted, stickyColumn && classes.stickyColumn, stickyColumnMostLeft && classes.stickyColumnMostLeft, stickyColumnLeastRight && classes.stickyColumnLeastRight, groupColumnMostLeft && classes.groupColumnMostLeft, groupColumnMostRight && classes.groupColumnMostRight, resizable && classes.resizable, resizing && classes.resizing)
|
|
48
|
+
className: clsx(classes.root, classes[type], className, align !== "inherit" && classes[`align${capitalize(align)}`], variant !== "default" && classes[`variant${capitalize(variant)}`], sorted && classes.sorted, stickyColumn && classes.stickyColumn, stickyColumnMostLeft && classes.stickyColumnMostLeft, stickyColumnLeastRight && classes.stickyColumnLeastRight, groupColumnMostLeft && classes.groupColumnMostLeft, groupColumnMostRight && classes.groupColumnMostRight, resizable && classes.resizable, resizing && classes.resizing, tableContext.variant === "listrow" && [classes.variantList, type !== "body" && classes.variantListHead])
|
|
49
49
|
}, others), children);
|
|
50
50
|
});
|
|
51
51
|
process.env.NODE_ENV !== "production" ? HvTableCell.propTypes = {
|
|
@@ -78,7 +78,7 @@ process.env.NODE_ENV !== "production" ? HvTableCell.propTypes = {
|
|
|
78
78
|
/**
|
|
79
79
|
* Sets the cell's variant.
|
|
80
80
|
*/
|
|
81
|
-
variant: PropTypes.oneOf(["checkbox", "expand", "actions", "default", "none"]),
|
|
81
|
+
variant: PropTypes.oneOf(["checkbox", "expand", "actions", "default", "listcheckbox", "listactions", "none"]),
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Specify the cell's type.
|
|
@@ -221,6 +221,26 @@ process.env.NODE_ENV !== "production" ? HvTableCell.propTypes = {
|
|
|
221
221
|
*/
|
|
222
222
|
variantNone: PropTypes.string,
|
|
223
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Styles applied to the component root when its variant is list
|
|
226
|
+
*/
|
|
227
|
+
variantList: PropTypes.string,
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Styles applied to the cell when its variant is list and actions.
|
|
231
|
+
*/
|
|
232
|
+
variantListactions: PropTypes.string,
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Styles applied to the cell when its variant is list and checkbox.
|
|
236
|
+
*/
|
|
237
|
+
variantListcheckbox: PropTypes.string,
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Styles applied to the cell when its variant is list and the type is head .
|
|
241
|
+
*/
|
|
242
|
+
variantListHead: PropTypes.string,
|
|
243
|
+
|
|
224
244
|
/**
|
|
225
245
|
* Styles applied to the cell when it's part of a resizable column.
|
|
226
246
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","names":["React","forwardRef","useContext","PropTypes","clsx","capitalize","withStyles","styles","TableContext","TableSectionContext","defaultComponent","HvTableCell","props","ref","children","component","className","style","classes","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sorted","resizable","resizing","others","tableContext","tableSectionContext","Component","components","Td","root","propTypes","elementType","node","string","instanceOf","Object","oneOf","bool","shape","head","body","footer","sortIcon","alignLeft","alignRight","alignCenter","alignJustify","variantCheckbox","variantExpand","variantActions","variantNone","isRequired","name"],"sources":["../../../../src/Table/TableCell/TableCell.js"],"sourcesContent":["import React, { forwardRef, useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport capitalize from \"lodash/capitalize\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\n\nconst defaultComponent = \"td\";\n\n/**\n * `HvTableCell` acts as a `td` element and inherits styles from its context\n */\nconst HvTableCell = forwardRef(function HvTableCell(props, ref) {\n const {\n children,\n\n component,\n\n className,\n style,\n classes,\n\n align = \"inherit\",\n variant = \"default\",\n\n type: typeProp,\n\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n\n sorted = false,\n\n resizable = false,\n resizing = false,\n\n ...others\n } = props;\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component = component || tableContext?.components?.Td || defaultComponent;\n\n return (\n <Component\n ref={ref}\n role={Component === defaultComponent ? null : \"cell\"}\n style={style}\n className={clsx(\n classes.root,\n classes[type],\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n\n [classes.sorted]: sorted,\n\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className\n )}\n {...others}\n >\n {children}\n </Component>\n );\n});\n\nHvTableCell.propTypes = {\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to td.\n */\n component: PropTypes.elementType,\n\n /**\n * Content to be rendered\n */\n children: PropTypes.node,\n\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n\n /**\n * Set the text-align on the table cell content.\n */\n align: PropTypes.oneOf([\"center\", \"inherit\", \"justify\", \"left\", \"right\"]),\n /**\n * Sets the cell's variant.\n */\n variant: PropTypes.oneOf([\"checkbox\", \"expand\", \"actions\", \"default\", \"none\"]),\n\n /**\n * Specify the cell's type.\n * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.\n */\n type: PropTypes.oneOf([\"body\", \"footer\", \"head\"]),\n\n /**\n * Whether or not the cell is part of a sorted column.\n */\n sorted: PropTypes.bool,\n\n /**\n * The cell is part of a sticky column.\n */\n stickyColumn: PropTypes.bool,\n /**\n * The cell is part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the first sticky to the right column.\n */\n stickyColumnLeastRight: PropTypes.bool,\n\n /**\n * The cell is part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.bool,\n\n /**\n * Whether or not the cell is resizable\n */\n resizable: PropTypes.bool,\n /**\n * Whether or not the cell is being resized\n */\n resizing: PropTypes.bool,\n\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's in the table head.\n */\n head: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table body.\n */\n body: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table footer.\n */\n footer: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of a sticky column.\n */\n stickyColumn: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the first right sticky column.\n */\n stickyColumnLeastRight: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of a sorted column.\n */\n sorted: PropTypes.string,\n\n sortIcon: PropTypes.string,\n\n /**\n * Styles applied to the component root when it is left aligned\n */\n alignLeft: PropTypes.string,\n /**\n * Styles applied to the component root when it is right aligned\n */\n alignRight: PropTypes.string,\n /**\n * Styles applied to the component root when it is center aligned\n */\n alignCenter: PropTypes.string,\n /**\n * Styles applied to the component root when it is justified\n */\n alignJustify: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is checkbox\n */\n variantCheckbox: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is expand\n */\n variantExpand: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is actions\n */\n variantActions: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is none\n */\n variantNone: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of a resizable column.\n */\n resizable: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizing column.\n */\n resizing: PropTypes.string,\n }).isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvTableCell\" })(HvTableCell);\n"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB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MA1BT;;IA2BvB;AACJ;AACA;IACIhB,sBAAsB,EAAEtB,SAAS,CAACsC,MA9BX;;IAgCvB;AACJ;AACA;IACIf,mBAAmB,EAAEvB,SAAS,CAACsC,MAnCR;;IAoCvB;AACJ;AACA;IACId,oBAAoB,EAAExB,SAAS,CAACsC,MAvCT;;IAyCvB;AACJ;AACA;IACIb,MAAM,EAAEzB,SAAS,CAACsC,MA5CK;IA8CvBS,QAAQ,EAAE/C,SAAS,CAACsC,MA9CG;;IAgDvB;AACJ;AACA;IACIU,SAAS,EAAEhD,SAAS,CAACsC,MAnDE;;IAoDvB;AACJ;AACA;IACIW,UAAU,EAAEjD,SAAS,CAACsC,MAvDC;;IAwDvB;AACJ;AACA;IACIY,WAAW,EAAElD,SAAS,CAACsC,MA3DA;;IA4DvB;AACJ;AACA;IACIa,YAAY,EAAEnD,SAAS,CAACsC,MA/DD;;IAgEvB;AACJ;AACA;IACIc,eAAe,EAAEpD,SAAS,CAACsC,MAnEJ;;IAoEvB;AACJ;AACA;IACIe,aAAa,EAAErD,SAAS,CAACsC,MAvEF;;IAwEvB;AACJ;AACA;IACIgB,cAAc,EAAEtD,SAAS,CAACsC,MA3EH;;IA4EvB;AACJ;AACA;IACIiB,WAAW,EAAEvD,SAAS,CAACsC,MA/EA;;IAiFvB;AACJ;AACA;IACIZ,SAAS,EAAE1B,SAAS,CAACsC,MApFE;;IAqFvB;AACJ;AACA;IACIX,QAAQ,EAAE3B,SAAS,CAACsC;EAxFG,CAAhB,EAyFNkB;AApKmB,CAAxB;AAuKA,eAAerD,UAAU,CAACC,MAAD,EAAS;EAAEqD,IAAI,EAAE;AAAR,CAAT,CAAV,CAA4CjD,WAA5C,CAAf"}
|
|
1
|
+
{"version":3,"file":"TableCell.js","names":["React","forwardRef","useContext","PropTypes","clsx","capitalize","withStyles","styles","TableContext","TableSectionContext","defaultComponent","HvTableCell","props","ref","children","component","className","style","classes","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sorted","resizable","resizing","others","tableContext","tableSectionContext","Component","components","Td","root","variantList","variantListHead","propTypes","elementType","node","string","instanceOf","Object","oneOf","bool","shape","head","body","footer","sortIcon","alignLeft","alignRight","alignCenter","alignJustify","variantCheckbox","variantExpand","variantActions","variantNone","variantListactions","variantListcheckbox","isRequired","name"],"sources":["../../../../src/Table/TableCell/TableCell.js"],"sourcesContent":["import React, { forwardRef, useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport capitalize from \"lodash/capitalize\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport styles from \"./styles\";\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\n\nconst defaultComponent = \"td\";\n\n/**\n * `HvTableCell` acts as a `td` element and inherits styles from its context\n */\nconst HvTableCell = forwardRef(function HvTableCell(props, ref) {\n const {\n children,\n\n component,\n\n className,\n style,\n classes,\n\n align = \"inherit\",\n variant = \"default\",\n\n type: typeProp,\n\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n\n sorted = false,\n\n resizable = false,\n resizing = false,\n\n ...others\n } = props;\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n\n const Component = component || tableContext?.components?.Td || defaultComponent;\n\n return (\n <Component\n ref={ref}\n role={Component === defaultComponent ? null : \"cell\"}\n style={style}\n className={clsx(\n classes.root,\n classes[type],\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.variantListHead]: tableContext.variant === \"listrow\" && type !== \"body\",\n [classes.sorted]: sorted,\n\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className\n )}\n {...others}\n >\n {children}\n </Component>\n );\n});\n\nHvTableCell.propTypes = {\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to td.\n */\n component: PropTypes.elementType,\n /**\n * Content to be rendered\n */\n children: PropTypes.node,\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n /**\n * Set the text-align on the table cell content.\n */\n align: PropTypes.oneOf([\"center\", \"inherit\", \"justify\", \"left\", \"right\"]),\n /**\n * Sets the cell's variant.\n */\n variant: PropTypes.oneOf([\n \"checkbox\",\n \"expand\",\n \"actions\",\n \"default\",\n \"listcheckbox\",\n \"listactions\",\n \"none\",\n ]),\n /**\n * Specify the cell's type.\n * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.\n */\n type: PropTypes.oneOf([\"body\", \"footer\", \"head\"]),\n /**\n * Whether or not the cell is part of a sorted column.\n */\n sorted: PropTypes.bool,\n /**\n * The cell is part of a sticky column.\n */\n stickyColumn: PropTypes.bool,\n /**\n * The cell is part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the first sticky to the right column.\n */\n stickyColumnLeastRight: PropTypes.bool,\n /**\n * The cell is part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.bool,\n /**\n * Whether or not the cell is resizable\n */\n resizable: PropTypes.bool,\n /**\n * Whether or not the cell is being resized\n */\n resizing: PropTypes.bool,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table head.\n */\n head: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table body.\n */\n body: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table footer.\n */\n footer: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a sticky column.\n */\n stickyColumn: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the first right sticky column.\n */\n stickyColumnLeastRight: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a sorted column.\n */\n sorted: PropTypes.string,\n\n sortIcon: PropTypes.string,\n /**\n * Styles applied to the component root when it is left aligned\n */\n alignLeft: PropTypes.string,\n /**\n * Styles applied to the component root when it is right aligned\n */\n alignRight: PropTypes.string,\n /**\n * Styles applied to the component root when it is center aligned\n */\n alignCenter: PropTypes.string,\n /**\n * Styles applied to the component root when it is justified\n */\n alignJustify: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is checkbox\n */\n variantCheckbox: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is expand\n */\n variantExpand: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is actions\n */\n variantActions: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is none\n */\n variantNone: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is list\n */\n variantList: PropTypes.string,\n /**\n * Styles applied to the cell when its variant is list and actions.\n */\n variantListactions: PropTypes.string,\n /**\n * Styles applied to the cell when its variant is list and checkbox.\n */\n variantListcheckbox: PropTypes.string,\n /**\n * Styles applied to the cell when its variant is list and the type is head .\n */\n variantListHead: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizable column.\n */\n resizable: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizing column.\n */\n resizing: PropTypes.string,\n }).isRequ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;;IAuFvB;AACJ;AACA;IACIJ,eAAe,EAAEpC,SAAS,CAACwC,MA1FJ;;IA2FvB;AACJ;AACA;IACId,SAAS,EAAE1B,SAAS,CAACwC,MA9FE;;IA+FvB;AACJ;AACA;IACIb,QAAQ,EAAE3B,SAAS,CAACwC;EAlGG,CAAhB,EAmGNoB;AA7KmB,CAAxB;AAgLA,eAAezD,UAAU,CAACC,MAAD,EAAS;EAAEyD,IAAI,EAAE;AAAR,CAAT,CAAV,CAA4CrD,WAA5C,CAAf"}
|
|
@@ -69,6 +69,34 @@ const styles = theme => {
|
|
|
69
69
|
paddingTop: 0,
|
|
70
70
|
paddingBottom: 0
|
|
71
71
|
},
|
|
72
|
+
variantList: {
|
|
73
|
+
minHeight: 52,
|
|
74
|
+
"td&": {
|
|
75
|
+
height: 52
|
|
76
|
+
},
|
|
77
|
+
padding: "0, 0, 0, 32px",
|
|
78
|
+
border: 0
|
|
79
|
+
},
|
|
80
|
+
variantListHead: {
|
|
81
|
+
backgroundColor: "inherit",
|
|
82
|
+
"td&": {
|
|
83
|
+
height: 16
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
variantListactions: {
|
|
87
|
+
borderLeft: `solid 2px ${theme.hv.palette.atmosphere.atmo2}`,
|
|
88
|
+
paddingLeft: "0",
|
|
89
|
+
textAlign: "center",
|
|
90
|
+
width: 130,
|
|
91
|
+
maxWidth: 130
|
|
92
|
+
},
|
|
93
|
+
variantListcheckbox: {
|
|
94
|
+
borderRight: `solid 2px ${theme.hv.palette.atmosphere.atmo2}`,
|
|
95
|
+
padding: 0,
|
|
96
|
+
textAlign: "center",
|
|
97
|
+
width: 34,
|
|
98
|
+
maxWidth: 34
|
|
99
|
+
},
|
|
72
100
|
stickyColumn: {
|
|
73
101
|
position: "sticky",
|
|
74
102
|
zIndex: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["hexToRgbA","styles","theme","semiTransparentAtmo1","hv","palette","atmosphere","atmo1","root","verticalAlign","textAlign","padding","hvSpacing","borderBottom","atmo4","head","height","backgroundColor","borderTop","typography","highlightText","body","minHeight","normalText","footer","sorted","alignLeft","alignCenter","alignRight","flexDirection","alignJustify","variantNone","variantCheckbox","width","maxWidth","overflow","borderRight","variantActions","borderLeft","variantExpand","paddingLeft","paddingTop","paddingBottom","stickyColumn","position","zIndex","background","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["hexToRgbA","styles","theme","semiTransparentAtmo1","hv","palette","atmosphere","atmo1","root","verticalAlign","textAlign","padding","hvSpacing","borderBottom","atmo4","head","height","backgroundColor","borderTop","typography","highlightText","body","minHeight","normalText","footer","sorted","alignLeft","alignCenter","alignRight","flexDirection","alignJustify","variantNone","variantCheckbox","width","maxWidth","overflow","borderRight","variantActions","borderLeft","variantExpand","paddingLeft","paddingTop","paddingBottom","variantList","border","variantListHead","variantListactions","atmo2","variantListcheckbox","stickyColumn","position","zIndex","background","backgroundImage","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","resizable","resizing","accent","acce1"],"sources":["../../../../src/Table/TableCell/styles.js"],"sourcesContent":["import { hexToRgbA } from \"@hitachivantara/uikit-react-core\";\n\nconst styles = (theme) => {\n const semiTransparentAtmo1 = hexToRgbA(theme.hv.palette.atmosphere.atmo1, 0.4);\n\n return {\n root: {\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.hvSpacing(\"8px\", \"xs\", \"8px\", \"32px\"),\n\n borderBottom: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n head: {\n height: 52,\n verticalAlign: \"top\",\n\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n borderTop: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n borderBottom: `1px solid ${theme.hv.palette.atmosphere.atmo4}`,\n ...theme.hv.typography.highlightText,\n },\n body: {\n minHeight: 32,\n \"td&\": {\n height: 32,\n },\n backgroundColor: \"inherit\",\n ...theme.hv.typography.normalText,\n\n \"&$sorted\": {\n backgroundColor: semiTransparentAtmo1,\n },\n },\n footer: {},\n\n sorted: {},\n\n alignLeft: {\n textAlign: \"left\",\n },\n alignCenter: {\n textAlign: \"center\",\n },\n alignRight: {\n textAlign: \"right\",\n flexDirection: \"row-reverse\",\n },\n alignJustify: {\n textAlign: \"justify\",\n },\n\n variantNone: {\n padding: 0,\n },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n overflow: \"hidden\",\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n variantExpand: {\n paddingLeft: 0,\n paddingTop: 0,\n paddingBottom: 0,\n },\n variantList: {\n minHeight: 52,\n \"td&\": {\n height: 52,\n },\n padding: \"0, 0, 0, 32px\",\n border: 0,\n },\n variantListHead: {\n backgroundColor: \"inherit\",\n \"td&\": {\n height: 16,\n },\n },\n variantListactions: {\n borderLeft: `solid 2px ${theme.hv.palette.atmosphere.atmo2}`,\n paddingLeft: \"0\",\n textAlign: \"center\",\n width: 130,\n maxWidth: 130,\n },\n variantListcheckbox: {\n borderRight: `solid 2px ${theme.hv.palette.atmosphere.atmo2}`,\n padding: 0,\n textAlign: \"center\",\n width: 34,\n maxWidth: 34,\n },\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n background: theme.hv.palette.atmosphere.atmo2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n\n \"&$sorted\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo2,\n backgroundImage: `linear-gradient(to right, ${semiTransparentAtmo1}, ${semiTransparentAtmo1})`,\n },\n },\n stickyColumnMostLeft: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n stickyColumnLeastRight: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n groupColumnMostLeft: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n \"&:first-child\": {\n borderLeft: 0,\n },\n },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n\n resizable: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n resizing: {\n borderRight: `solid 2px ${theme.hv.palette.accent.acce1}`,\n },\n };\n};\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,SAASA,SAAT,QAA0B,kCAA1B;;AAEA,MAAMC,MAAM,GAAIC,KAAD,IAAW;EACxB,MAAMC,oBAAoB,GAAGH,SAAS,CAACE,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAA7B,EAAoC,GAApC,CAAtC;EAEA,OAAO;IACLC,IAAI,EAAE;MACJC,aAAa,EAAE,SADX;MAEJC,SAAS,EAAE,MAFP;MAGJC,OAAO,EAAET,KAAK,CAACU,SAAN,CAAgB,KAAhB,EAAuB,IAAvB,EAA6B,KAA7B,EAAoC,MAApC,CAHL;MAKJC,YAAY,EAAG,aAAYX,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM;IALzD,CADD;IASLC,IAAI;MACFC,MAAM,EAAE,EADN;MAEFP,aAAa,EAAE,KAFb;MAIFQ,eAAe,EAAEf,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAJ3C;MAKFW,SAAS,EAAG,aAAYhB,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM,EALxD;MAMFD,YAAY,EAAG,aAA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C,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM;IADrC,CAlHnB;IAsHL0C,mBAAmB,EAAE;MACnBlB,UAAU,EAAG,aAAYpC,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM,EADxC;MAGnB,iBAAiB;QACfwB,UAAU,EAAE;MADG;IAHE,CAtHhB;IA6HLmB,oBAAoB,EAAE;MACpBrB,WAAW,EAAG,aAAYlC,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM,EADxC;MAGpB;MACA;MACA;MACA;MACA,gBAAgB;QACdsB,WAAW,EAAE;MADC,CAPI;MAWpB,yBAAyB;QACvBE,UAAU,EAAE;MADW;IAXL,CA7HjB;IA6ILoB,SAAS,EAAE;MACTtB,WAAW,EAAG,aAAYlC,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BQ,KAAM;IADnD,CA7IN;IAiJL6C,QAAQ,EAAE;MACRvB,WAAW,EAAG,aAAYlC,KAAK,CAACE,EAAN,CAASC,OAAT,CAAiBuD,MAAjB,CAAwBC,KAAM;IADhD;EAjJL,CAAP;AAqJD,CAxJD;;AA0JA,eAAe5D,MAAf"}
|
|
@@ -59,7 +59,7 @@ const HvTableHeader = /*#__PURE__*/forwardRef(function HvTableHeader(props, ref)
|
|
|
59
59
|
role: role,
|
|
60
60
|
scope: scope,
|
|
61
61
|
style: style,
|
|
62
|
-
className: clsx(classes.root, classes[type], className, align !== "inherit" && classes[`align${capitalize(align)}`], variant !== "default" && classes[`variant${capitalize(variant)}`], stickyColumn && classes.stickyColumn, stickyColumnMostLeft && classes.stickyColumnMostLeft, stickyColumnLeastRight && classes.stickyColumnLeastRight, groupColumnMostLeft && classes.groupColumnMostLeft, groupColumnMostRight && classes.groupColumnMostRight, sortable && classes.sortable, sorted && classes.sorted, resizable && classes.resizable, resizing && classes.resizing),
|
|
62
|
+
className: clsx(classes.root, classes[type], className, align !== "inherit" && classes[`align${capitalize(align)}`], variant !== "default" && classes[`variant${capitalize(variant)}`], stickyColumn && classes.stickyColumn, stickyColumnMostLeft && classes.stickyColumnMostLeft, stickyColumnLeastRight && classes.stickyColumnLeastRight, groupColumnMostLeft && classes.groupColumnMostLeft, groupColumnMostRight && classes.groupColumnMostRight, sortable && classes.sortable, sorted && classes.sorted, resizable && classes.resizable, resizing && classes.resizing, tableContext.variant === "listrow" && classes.variantList),
|
|
63
63
|
"aria-sort": sortable ? sortDirection : undefined
|
|
64
64
|
}, others), /*#__PURE__*/React.createElement("div", {
|
|
65
65
|
className: clsx(classes.headerContent, align !== "inherit" && classes[`alignFlex${capitalize(align)}`])
|
|
@@ -329,6 +329,11 @@ process.env.NODE_ENV !== "production" ? HvTableHeader.propTypes = {
|
|
|
329
329
|
*/
|
|
330
330
|
variantNone: PropTypes.string,
|
|
331
331
|
|
|
332
|
+
/**
|
|
333
|
+
* Styles applied to the component root when its variant is list row
|
|
334
|
+
*/
|
|
335
|
+
variantList: PropTypes.string,
|
|
336
|
+
|
|
332
337
|
/**
|
|
333
338
|
* Styles applied to the cell when it's part of a resizable column.
|
|
334
339
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.js","names":["React","forwardRef","useContext","useMemo","PropTypes","object","clsx","capitalize","withStyles","HvButton","HvTypography","getSortIcon","isParagraph","styles","TableContext","TableSectionContext","defaultComponent","HvTableHeader","props","ref","children","component","className","style","classes","scope","scopeProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortDirection","sorted","sortable","headerTextProps","resizerProps","resizable","resizing","others","tableContext","tableSectionContext","isHeadCell","Sort","Component","components","Th","role","paragraph","root","undefined","headerContent","sortButton","sortIcon","headerParagraph","headerText","sortableHeaderText","resizer","propTypes","elementType","node","string","instanceOf","Object","oneOf","bool","shape","head","body","footer","alignLeft","alignRight","alignCenter","alignJustify","alignFlexLeft","alignFlexRight","alignFlexCenter","alignFlexJustify","variantCheckbox","variantExpand","variantActions","variantNone","isRequired","name"],"sources":["../../../../src/Table/TableHeader/TableHeader.js"],"sourcesContent":["import React, { forwardRef, useContext, useMemo } from \"react\";\nimport PropTypes, { object } from \"prop-types\";\nimport clsx from \"clsx\";\nimport capitalize from \"lodash/capitalize\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport { HvButton, HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport { getSortIcon, isParagraph } from \"./utils\";\nimport styles from \"./styles\";\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\n\nconst defaultComponent = \"th\";\n\n/**\n * `HvTableHeader` acts as a `th` element and inherits styles from its context\n */\nconst HvTableHeader = forwardRef(function HvTableHeader(props, ref) {\n const {\n children,\n\n component,\n\n className,\n style,\n classes,\n\n scope: scopeProp,\n\n align = \"inherit\",\n variant = \"default\",\n\n type: typeProp,\n\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n\n sortDirection = \"none\",\n sorted,\n sortable,\n headerTextProps,\n\n resizerProps = {},\n resizable = false,\n resizing = false,\n\n ...others\n } = props;\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n const isHeadCell = type === \"head\";\n\n const scope = scopeProp ?? isHeadCell ? \"col\" : \"row\";\n\n const Sort = useMemo(() => getSortIcon(sorted && sortDirection), [sorted, sortDirection]);\n\n const Component = component || tableContext?.components?.Th || defaultComponent;\n\n // eslint-disable-next-line no-nested-ternary\n const role = Component === defaultComponent ? null : isHeadCell ? \"columnheader\" : \"rowheader\";\n const paragraph = isParagraph(children);\n return (\n <Component\n ref={ref}\n role={role}\n scope={scope}\n style={style}\n className={clsx(\n classes.root,\n classes[type],\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n\n [classes.sortable]: sortable,\n [classes.sorted]: sorted,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={clsx(classes.headerContent, {\n [classes[`alignFlex${capitalize(align)}`]]: align !== \"inherit\",\n })}\n >\n {isHeadCell && sortable && (\n <HvButton className={classes.sortButton} icon overrideIconColors={false}>\n <Sort className={classes.sortIcon} />\n </HvButton>\n )}\n <HvTypography\n component=\"div\"\n className={clsx({\n [classes.headerText]: !paragraph,\n [classes.headerParagraph]: paragraph,\n [classes.sortableHeaderText]: sortable,\n })}\n variant=\"highlightText\"\n {...headerTextProps}\n >\n {children}\n </HvTypography>\n {resizable && <div {...resizerProps} className={classes.resizer} />}\n </div>\n </Component>\n );\n});\n\nHvTableHeader.propTypes = {\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to th.\n */\n component: PropTypes.elementType,\n\n /**\n * Content to be rendered\n */\n children: PropTypes.node,\n\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n\n /**\n * The scope of cells that the header element relates to.\n */\n scope: PropTypes.oneOf([\"col\", \"row\", \"colgroup\", \"rowgroup\"]),\n\n /**\n * Set the text-align on the table cell content.\n */\n align: PropTypes.oneOf([\"center\", \"inherit\", \"justify\", \"left\", \"right\"]),\n /**\n * Sets the cell's variant.\n */\n variant: PropTypes.oneOf([\"checkbox\", \"expand\", \"actions\", \"default\", \"none\"]),\n\n /**\n * Specify the cell type.\n * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.\n */\n type: PropTypes.oneOf([\"body\", \"footer\", \"head\"]),\n\n /**\n * The cell is part of a sticky column.\n */\n stickyColumn: PropTypes.bool,\n /**\n * The cell is part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the first sticky to the right column.\n */\n stickyColumnLeastRight: PropTypes.bool,\n\n /**\n * The cell is part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.bool,\n\n /**\n * Whether or not the cell is sorted\n */\n sorted: PropTypes.bool,\n /**\n * Whether or not the cell is sortable\n */\n sortable: PropTypes.bool,\n /**\n * Set sort direction icon and aria-sort.\n */\n sortDirection: PropTypes.oneOf([\"ascending\", \"descending\", false]),\n /**\n * Extra props to be passed onto the text in the header.\n */\n headerTextProps: PropTypes.instanceOf(object),\n\n /**\n * Whether or not the cell is resizable\n */\n resizable: PropTypes.bool,\n /**\n * Whether or not the cell is being resized\n */\n resizing: PropTypes.bool,\n\n /**\n * The resize props injected in the resize handler\n */\n resizerProps: PropTypes.instanceOf(object),\n\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's in the table head.\n */\n head: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table body.\n */\n body: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table footer.\n */\n footer: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of a sticky column.\n */\n stickyColumn: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the first right sticky column.\n */\n stickyColumnLeastRight: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.string,\n\n /**\n * Styles applied to the container of the header cell content.\n */\n headerContent: PropTypes.string,\n /**\n * Styles applied to the text of the header cell.\n */\n headerText: PropTypes.string,\n /**\n * Styles applied to the text of the header cell when it is a paragraph.\n */\n headerParagraph: PropTypes.string,\n /**\n * Styles applied to the text of the header cell when it is sorted.\n */\n sortableHeaderText: PropTypes.string,\n\n /**\n * Styles applied to the component root when it is sorted.\n */\n sorted: PropTypes.string,\n /**\n * Styles applied to the component root when it is sortable.\n */\n sortable: PropTypes.string,\n /**\n * Styles applied to the sort button component.\n */\n sortButton: PropTypes.string,\n /**\n * Styles applied to the sort icon component.\n */\n sortIcon: PropTypes.string,\n\n /**\n * Styles applied to the component root when it is left aligned\n */\n alignLeft: PropTypes.string,\n /**\n * Styles applied to the component root when it is right aligned\n */\n alignRight: PropTypes.string,\n /**\n * Styles applied to the component root when it is center aligned\n */\n alignCenter: PropTypes.string,\n /**\n * Styles applied to the component root when it is justified\n */\n alignJustify: PropTypes.string,\n /**\n * Styles applied to the header content when it is left aligned\n */\n alignFlexLeft: PropTypes.string,\n /**\n * Styles applied to the header content when it is right aligned\n */\n alignFlexRight: PropTypes.string,\n /**\n * Styles applied to the header content when it is center aligned\n */\n alignFlexCenter: PropTypes.string,\n /**\n * Styles applied to the header content when it is justified\n */\n alignFlexJustify: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is checkbox\n */\n variantCheckbox: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is expand\n */\n variantExpand: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is actions\n */\n variantActions: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is none\n */\n variantNone: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizable column.\n */\n resizable: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizing column.\n */\n resizing: PropTypes.string,\n /**\n * Styles applied to the resizer object when column is resizable.\n */\n resizer: PropTypes.string,\n }).isRequired,\n};\n\nexport default withStyles(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AS,CAAC6D;EAtII,CAAhB,EAuINqB;AAxOqB,CAA1B;AA2OA,eAAe9E,UAAU,CAACK,MAAD,EAAS;EAAE0E,IAAI,EAAE;AAAR,CAAT,CAAV,CAA8CtE,aAA9C,CAAf"}
|
|
1
|
+
{"version":3,"file":"TableHeader.js","names":["React","forwardRef","useContext","useMemo","PropTypes","object","clsx","capitalize","withStyles","HvButton","HvTypography","getSortIcon","isParagraph","styles","TableContext","TableSectionContext","defaultComponent","HvTableHeader","props","ref","children","component","className","style","classes","scope","scopeProp","align","variant","type","typeProp","stickyColumn","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortDirection","sorted","sortable","headerTextProps","resizerProps","resizable","resizing","others","tableContext","tableSectionContext","isHeadCell","Sort","Component","components","Th","role","paragraph","root","variantList","undefined","headerContent","sortButton","sortIcon","headerParagraph","headerText","sortableHeaderText","resizer","propTypes","elementType","node","string","instanceOf","Object","oneOf","bool","shape","head","body","footer","alignLeft","alignRight","alignCenter","alignJustify","alignFlexLeft","alignFlexRight","alignFlexCenter","alignFlexJustify","variantCheckbox","variantExpand","variantActions","variantNone","isRequired","name"],"sources":["../../../../src/Table/TableHeader/TableHeader.js"],"sourcesContent":["import React, { forwardRef, useContext, useMemo } from \"react\";\nimport PropTypes, { object } from \"prop-types\";\nimport clsx from \"clsx\";\nimport capitalize from \"lodash/capitalize\";\n\nimport { withStyles } from \"@material-ui/core\";\nimport { HvButton, HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport { getSortIcon, isParagraph } from \"./utils\";\nimport styles from \"./styles\";\nimport TableContext from \"../TableContext\";\nimport TableSectionContext from \"../TableSectionContext\";\n\nconst defaultComponent = \"th\";\n\n/**\n * `HvTableHeader` acts as a `th` element and inherits styles from its context\n */\nconst HvTableHeader = forwardRef(function HvTableHeader(props, ref) {\n const {\n children,\n\n component,\n\n className,\n style,\n classes,\n\n scope: scopeProp,\n\n align = \"inherit\",\n variant = \"default\",\n\n type: typeProp,\n\n stickyColumn = false,\n stickyColumnMostLeft = false,\n stickyColumnLeastRight = false,\n\n groupColumnMostLeft = false,\n groupColumnMostRight = false,\n\n sortDirection = \"none\",\n sorted,\n sortable,\n headerTextProps,\n\n resizerProps = {},\n resizable = false,\n resizing = false,\n\n ...others\n } = props;\n\n const tableContext = useContext(TableContext);\n const tableSectionContext = useContext(TableSectionContext);\n\n const type = typeProp || tableSectionContext?.type || \"body\";\n const isHeadCell = type === \"head\";\n\n const scope = scopeProp ?? isHeadCell ? \"col\" : \"row\";\n\n const Sort = useMemo(() => getSortIcon(sorted && sortDirection), [sorted, sortDirection]);\n\n const Component = component || tableContext?.components?.Th || defaultComponent;\n\n // eslint-disable-next-line no-nested-ternary\n const role = Component === defaultComponent ? null : isHeadCell ? \"columnheader\" : \"rowheader\";\n const paragraph = isParagraph(children);\n return (\n <Component\n ref={ref}\n role={role}\n scope={scope}\n style={style}\n className={clsx(\n classes.root,\n classes[type],\n {\n [classes[`align${capitalize(align)}`]]: align !== \"inherit\",\n [classes[`variant${capitalize(variant)}`]]: variant !== \"default\",\n [classes.variantList]: tableContext.variant === \"listrow\",\n [classes.stickyColumn]: stickyColumn,\n [classes.stickyColumnMostLeft]: stickyColumnMostLeft,\n [classes.stickyColumnLeastRight]: stickyColumnLeastRight,\n\n [classes.groupColumnMostLeft]: groupColumnMostLeft,\n [classes.groupColumnMostRight]: groupColumnMostRight,\n\n [classes.sortable]: sortable,\n [classes.sorted]: sorted,\n [classes.resizable]: resizable,\n [classes.resizing]: resizing,\n },\n className\n )}\n aria-sort={sortable ? sortDirection : undefined}\n {...others}\n >\n <div\n className={clsx(classes.headerContent, {\n [classes[`alignFlex${capitalize(align)}`]]: align !== \"inherit\",\n })}\n >\n {isHeadCell && sortable && (\n <HvButton className={classes.sortButton} icon overrideIconColors={false}>\n <Sort className={classes.sortIcon} />\n </HvButton>\n )}\n <HvTypography\n component=\"div\"\n className={clsx({\n [classes.headerText]: !paragraph,\n [classes.headerParagraph]: paragraph,\n [classes.sortableHeaderText]: sortable,\n })}\n variant=\"highlightText\"\n {...headerTextProps}\n >\n {children}\n </HvTypography>\n {resizable && <div {...resizerProps} className={classes.resizer} />}\n </div>\n </Component>\n );\n});\n\nHvTableHeader.propTypes = {\n /**\n * The component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to th.\n */\n component: PropTypes.elementType,\n\n /**\n * Content to be rendered\n */\n children: PropTypes.node,\n\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n\n /**\n * The scope of cells that the header element relates to.\n */\n scope: PropTypes.oneOf([\"col\", \"row\", \"colgroup\", \"rowgroup\"]),\n\n /**\n * Set the text-align on the table cell content.\n */\n align: PropTypes.oneOf([\"center\", \"inherit\", \"justify\", \"left\", \"right\"]),\n /**\n * Sets the cell's variant.\n */\n variant: PropTypes.oneOf([\"checkbox\", \"expand\", \"actions\", \"default\", \"none\"]),\n\n /**\n * Specify the cell type.\n * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.\n */\n type: PropTypes.oneOf([\"body\", \"footer\", \"head\"]),\n\n /**\n * The cell is part of a sticky column.\n */\n stickyColumn: PropTypes.bool,\n /**\n * The cell is part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the first sticky to the right column.\n */\n stickyColumnLeastRight: PropTypes.bool,\n\n /**\n * The cell is part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.bool,\n /**\n * The cell is part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.bool,\n\n /**\n * Whether or not the cell is sorted\n */\n sorted: PropTypes.bool,\n /**\n * Whether or not the cell is sortable\n */\n sortable: PropTypes.bool,\n /**\n * Set sort direction icon and aria-sort.\n */\n sortDirection: PropTypes.oneOf([\"ascending\", \"descending\", false]),\n /**\n * Extra props to be passed onto the text in the header.\n */\n headerTextProps: PropTypes.instanceOf(object),\n\n /**\n * Whether or not the cell is resizable\n */\n resizable: PropTypes.bool,\n /**\n * Whether or not the cell is being resized\n */\n resizing: PropTypes.bool,\n\n /**\n * The resize props injected in the resize handler\n */\n resizerProps: PropTypes.instanceOf(object),\n\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's in the table head.\n */\n head: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table body.\n */\n body: PropTypes.string,\n /**\n * Styles applied to the cell when it's in the table footer.\n */\n footer: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of a sticky column.\n */\n stickyColumn: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last sticky to the left column.\n */\n stickyColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the first right sticky column.\n */\n stickyColumnLeastRight: PropTypes.string,\n\n /**\n * Styles applied to the cell when it's part of the first column in the group.\n */\n groupColumnMostLeft: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of the last column in the group.\n */\n groupColumnMostRight: PropTypes.string,\n\n /**\n * Styles applied to the container of the header cell content.\n */\n headerContent: PropTypes.string,\n /**\n * Styles applied to the text of the header cell.\n */\n headerText: PropTypes.string,\n /**\n * Styles applied to the text of the header cell when it is a paragraph.\n */\n headerParagraph: PropTypes.string,\n /**\n * Styles applied to the text of the header cell when it is sorted.\n */\n sortableHeaderText: PropTypes.string,\n\n /**\n * Styles applied to the component root when it is sorted.\n */\n sorted: PropTypes.string,\n /**\n * Styles applied to the component root when it is sortable.\n */\n sortable: PropTypes.string,\n /**\n * Styles applied to the sort button component.\n */\n sortButton: PropTypes.string,\n /**\n * Styles applied to the sort icon component.\n */\n sortIcon: PropTypes.string,\n\n /**\n * Styles applied to the component root when it is left aligned\n */\n alignLeft: PropTypes.string,\n /**\n * Styles applied to the component root when it is right aligned\n */\n alignRight: PropTypes.string,\n /**\n * Styles applied to the component root when it is center aligned\n */\n alignCenter: PropTypes.string,\n /**\n * Styles applied to the component root when it is justified\n */\n alignJustify: PropTypes.string,\n /**\n * Styles applied to the header content when it is left aligned\n */\n alignFlexLeft: PropTypes.string,\n /**\n * Styles applied to the header content when it is right aligned\n */\n alignFlexRight: PropTypes.string,\n /**\n * Styles applied to the header content when it is center aligned\n */\n alignFlexCenter: PropTypes.string,\n /**\n * Styles applied to the header content when it is justified\n */\n alignFlexJustify: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is checkbox\n */\n variantCheckbox: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is expand\n */\n variantExpand: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is actions\n */\n variantActions: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is none\n */\n variantNone: PropTypes.string,\n /**\n * Styles applied to the component root when its variant is list row\n */\n variantList: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizable column.\n */\n resizable: PropTypes.string,\n /**\n * Styles applied to the cell when it's part of a resizing column.\n */\n resizing: PropTypes.string,\n /**\n * Styles applied to the resizer object when column is resizable.\n */\n resizer: PropTypes.string,\n }).isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvTableHeader\" })(HvTableHeader);\n"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,UAA5B,EAAwCC,OAAxC,QAAuD,OAAvD;AACA,OAAOC,SAAP,IAAoBC,MAApB,QAAkC,YAAlC;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AAEA,SAASC,UAAT,QAA2B,mBAA3B;AACA,SAASC,QAAT,EAAmBC,YAAnB,QAAuC,kCAAvC;AACA,SAASC,WAAT,EAAsBC,WAAtB,QAAyC,SAAzC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,mBAAP,MAAgC,wBAAhC;AAEA,MAAMC,gBAAgB,GAAG,IAAzB;AAEA;AACA;AACA;;AAC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EAAEzE,SAAS,CAAC8D,MAtFA;;IAuFvB;AACJ;AACA;IACIY,YAAY,EAAE1E,SAAS,CAAC8D,MA1FD;;IA2FvB;AACJ;AACA;IACIa,aAAa,EAAE3E,SAAS,CAAC8D,MA9FF;;IA+FvB;AACJ;AACA;IACIc,cAAc,EAAE5E,SAAS,CAAC8D,MAlGH;;IAmGvB;AACJ;AACA;IACIe,eAAe,EAAE7E,SAAS,CAAC8D,MAtGJ;;IAuGvB;AACJ;AACA;IACIgB,gBAAgB,EAAE9E,SAAS,CAAC8D,MA1GL;;IA2GvB;AACJ;AACA;IACIiB,eAAe,EAAE/E,SAAS,CAAC8D,MA9GJ;;IA+GvB;AACJ;AACA;IACIkB,aAAa,EAAEhF,SAAS,CAAC8D,MAlHF;;IAmHvB;AACJ;AACA;IACImB,cAAc,EAAEjF,SAAS,CAAC8D,MAtHH;;IAuHvB;AACJ;AACA;IACIoB,WAAW,EAAElF,SAAS,CAAC8D,MA1HA;;IA2HvB;AACJ;AACA;IACIZ,WAAW,EAAElD,SAAS,CAAC8D,MA9HA;;IA+HvB;AACJ;AACA;IACIzB,SAAS,EAAErC,SAAS,CAAC8D,MAlIE;;IAmIvB;AACJ;AACA;IACIxB,QAAQ,EAAEtC,SAAS,CAAC8D,MAtIG;;IAuIvB;AACJ;AACA;IACIJ,OAAO,EAAE1D,SAAS,CAAC8D;EA1II,CAAhB,EA2INqB;AA5OqB,CAA1B;AA+OA,eAAe/E,UAAU,CAACK,MAAD,EAAS;EAAE2E,IAAI,EAAE;AAAR,CAAT,CAAV,CAA8CvE,aAA9C,CAAf"}
|
|
@@ -124,6 +124,15 @@ const styles = theme => ({
|
|
|
124
124
|
maxWidth: 32,
|
|
125
125
|
borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`
|
|
126
126
|
},
|
|
127
|
+
variantList: {
|
|
128
|
+
backgroundColor: "inherit",
|
|
129
|
+
borderBottom: 0,
|
|
130
|
+
height: 16,
|
|
131
|
+
":first-child > &": {
|
|
132
|
+
borderTop: 0,
|
|
133
|
+
height: 16
|
|
134
|
+
}
|
|
135
|
+
},
|
|
127
136
|
stickyColumn: {
|
|
128
137
|
position: "sticky",
|
|
129
138
|
zIndex: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["hexToRgbA","styles","theme","root","height","verticalAlign","textAlign","padding","hvSpacing","borderBottom","palette","atmo4","head","borderTop","paddingTop","backgroundColor","atmo1","hv","typography","highlightText","transition","transitions","create","duration","shorter","paddingLeft","cursor","atmo3","visibility","body","normalText","footer","alignLeft","alignCenter","alignRight","flexDirection","alignJustify","headerContent","display","alignItems","headerText","overflow","textOverflow","headerParagraph","sortableHeaderText","alignFlexLeft","justifyContent","alignFlexCenter","alignFlexRight","alignFlexJustify","variantNone","variantCheckbox","width","maxWidth","borderRight","atmosphere","variantExpand","variantActions","borderLeft","stickyColumn","position","zIndex","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortable","sorted","sortButton","boxShadow","sortIcon","resizable","resizing","accent","acce1","resizer","right","top","transform","touchAction"],"sources":["../../../../src/Table/TableHeader/styles.js"],"sourcesContent":["import { hexToRgbA } from \"@hitachivantara/uikit-react-core\";\n\nconst styles = (theme) => ({\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.hvSpacing(0, \"xs\", 0, \"32px\"),\n\n borderBottom: `1px solid ${theme.palette.atmo4}`,\n },\n\n head: {\n \":first-child > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: `1px solid ${theme.palette.atmo4}`,\n },\n\n paddingTop: 8,\n verticalAlign: \"top\",\n\n backgroundColor: theme.palette.atmo1,\n borderBottom: `1px solid ${theme.palette.atmo4}`,\n ...theme.hv.typography.highlightText,\n\n transition: theme.transitions.create(\"background-color\", {\n duration: theme.transitions.duration.shorter,\n }),\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.hv.typography.normalText,\n\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n \"&$sorted\": {\n backgroundColor: hexToRgbA(theme.palette.atmo1, 0.4),\n },\n },\n footer: {},\n\n alignLeft: {\n textAlign: \"left\",\n },\n alignCenter: {\n textAlign: \"center\",\n },\n alignRight: {\n textAlign: \"right\",\n flexDirection: \"row-reverse\",\n },\n alignJustify: {\n textAlign: \"justify\",\n },\n\n headerContent: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n headerText: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n headerParagraph: {\n overflow: \"hidden\",\n display: \"-webkit-box\",\n \"-webkit-line-clamp\": 2,\n \"-webkit-box-orient\": \"vertical\",\n },\n sortableHeaderText: {\n paddingTop: \"8px\",\n },\n alignFlexLeft: {\n justifyContent: \"flex-start\",\n },\n alignFlexCenter: {\n justifyContent: \"center\",\n },\n alignFlexRight: {\n justifyContent: \"flex-end\",\n },\n alignFlexJustify: {\n textAlign: \"justify\",\n },\n\n variantNone: {\n padding: 0,\n },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n stickyColumnLeastRight: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n groupColumnMostLeft: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n \"&:first-child\": {\n borderLeft: 0,\n },\n },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n\n sortable: {},\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n },\n },\n sortIcon: {\n display: \"inline-flex\",\n visibility: \"hidden\",\n },\n\n resizable: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n resizing: {\n borderRight: `solid 2px ${theme.hv.palette.accent.acce1}`,\n },\n\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \"absolute\",\n right: 0,\n top: 0,\n transform: \"translateX(50%)\",\n zIndex: 1,\n touchAction: \"none\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,SAASA,SAAT,QAA0B,kCAA1B;;AAEA,MAAMC,MAAM,GAAIC,KAAD,KAAY;EACzBC,IAAI,EAAE;IACJ,2BAA2B,MADvB;IAEJ,iBAAiB,MAFb;IAIJC,MAAM,EAAE,oBAJJ;IAKJC,aAAa,EAAE,SALX;IAMJ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AE,MADO;MAElBtD,eAAe,EAAE;IAFC;EADV,CAlLa;EAwLzBuD,QAAQ,EAAE;IACRhC,OAAO,EAAE,aADD;IAERV,UAAU,EAAE;EAFJ,CAxLe;EA6LzB2C,SAAS,EAAE;IACTjB,WAAW,EAAG,aAAYpD,KAAK,CAACe,EAAN,CAASP,OAAT,CAAiB6C,UAAjB,CAA4B5C,KAAM;EADnD,CA7Lc;EAiMzB6D,QAAQ,EAAE;IACRlB,WAAW,EAAG,aAAYpD,KAAK,CAACe,EAAN,CAASP,OAAT,CAAiB+D,MAAjB,CAAwBC,KAAM;EADhD,CAjMe;EAqMzBC,OAAO,EAAE;IACPrC,OAAO,EAAE,cADF;IAEPc,KAAK,EAAE,EAFA;IAGPhD,MAAM,EAAE,MAHD;IAIPwD,QAAQ,EAAE,UAJH;IAKPgB,KAAK,EAAE,CALA;IAMPC,GAAG,EAAE,CANE;IAOPC,SAAS,EAAE,iBAPJ;IAQPjB,MAAM,EAAE,CARD;IASPkB,WAAW,EAAE;EATN;AArMgB,CAAZ,CAAf;;AAkNA,eAAe9E,MAAf"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["hexToRgbA","styles","theme","root","height","verticalAlign","textAlign","padding","hvSpacing","borderBottom","palette","atmo4","head","borderTop","paddingTop","backgroundColor","atmo1","hv","typography","highlightText","transition","transitions","create","duration","shorter","paddingLeft","cursor","atmo3","visibility","body","normalText","footer","alignLeft","alignCenter","alignRight","flexDirection","alignJustify","headerContent","display","alignItems","headerText","overflow","textOverflow","headerParagraph","sortableHeaderText","alignFlexLeft","justifyContent","alignFlexCenter","alignFlexRight","alignFlexJustify","variantNone","variantCheckbox","width","maxWidth","borderRight","atmosphere","variantExpand","variantActions","borderLeft","variantList","stickyColumn","position","zIndex","stickyColumnMostLeft","stickyColumnLeastRight","groupColumnMostLeft","groupColumnMostRight","sortable","sorted","sortButton","boxShadow","sortIcon","resizable","resizing","accent","acce1","resizer","right","top","transform","touchAction"],"sources":["../../../../src/Table/TableHeader/styles.js"],"sourcesContent":["import { hexToRgbA } from \"@hitachivantara/uikit-react-core\";\n\nconst styles = (theme) => ({\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.hvSpacing(0, \"xs\", 0, \"32px\"),\n\n borderBottom: `1px solid ${theme.palette.atmo4}`,\n },\n\n head: {\n \":first-child > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: `1px solid ${theme.palette.atmo4}`,\n },\n\n paddingTop: 8,\n verticalAlign: \"top\",\n\n backgroundColor: theme.palette.atmo1,\n borderBottom: `1px solid ${theme.palette.atmo4}`,\n ...theme.hv.typography.highlightText,\n\n transition: theme.transitions.create(\"background-color\", {\n duration: theme.transitions.duration.shorter,\n }),\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n // IE fallback code (using focus-within-polyfill)\n \"&.focus-within\": {\n backgroundColor: theme.palette.atmo3,\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.hv.typography.normalText,\n\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n \"&$sorted\": {\n backgroundColor: hexToRgbA(theme.palette.atmo1, 0.4),\n },\n },\n footer: {},\n\n alignLeft: {\n textAlign: \"left\",\n },\n alignCenter: {\n textAlign: \"center\",\n },\n alignRight: {\n textAlign: \"right\",\n flexDirection: \"row-reverse\",\n },\n alignJustify: {\n textAlign: \"justify\",\n },\n\n headerContent: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n headerText: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n headerParagraph: {\n overflow: \"hidden\",\n display: \"-webkit-box\",\n \"-webkit-line-clamp\": 2,\n \"-webkit-box-orient\": \"vertical\",\n },\n sortableHeaderText: {\n paddingTop: \"8px\",\n },\n alignFlexLeft: {\n justifyContent: \"flex-start\",\n },\n alignFlexCenter: {\n justifyContent: \"center\",\n },\n alignFlexRight: {\n justifyContent: \"flex-end\",\n },\n alignFlexJustify: {\n textAlign: \"justify\",\n },\n\n variantNone: {\n padding: 0,\n },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n variantList: {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n height: 16,\n \":first-child > &\": {\n borderTop: 0,\n height: 16,\n },\n },\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n stickyColumnLeastRight: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n groupColumnMostLeft: {\n borderLeft: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n \"&:first-child\": {\n borderLeft: 0,\n },\n },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n\n sortable: {},\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n },\n },\n sortIcon: {\n display: \"inline-flex\",\n visibility: \"hidden\",\n },\n\n resizable: {\n borderRight: `solid 1px ${theme.hv.palette.atmosphere.atmo4}`,\n },\n\n resizing: {\n borderRight: `solid 2px ${theme.hv.palette.accent.acce1}`,\n },\n\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \"absolute\",\n right: 0,\n top: 0,\n transform: \"translateX(50%)\",\n zIndex: 1,\n touchAction: \"none\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,SAASA,SAAT,QAA0B,kCAA1B;;AAEA,MAAMC,MAAM,GAAIC,KAAD,KAAY;EACzBC,IAAI,EAAE;IACJ,2BAA2B,MADvB;IAEJ,iBAAiB,MAFb;IAIJC,MAAM,EAAE,oBAJJ;IAKJC,aAAa,EAAE,SALX;IAMJC,SAAS,EAAE,MANP;IAOJC,OAAO,EAAEL,KAAK,CAACM,SAAN,CAAgB,CAAhB,EAAmB,IAAnB,EAAyB,CAAzB,EAA4B,MAA5B,CAPL;IASJC,YAAY,EAAG,aAAYP,KAAK,CAACQ,OAAN,CAAcC,KAAM;EAT3C,CADmB;EAazBC,IAAI;IACF,oBAAoB;MAClBR,MAAM,EAAE,8BADU;MAElBS,SAAS,EAAG,aAAYX,KAAK,CAACQ,OAAN,CAAcC,KAAM;IAF1B,CADlB;IAMFG,UAAU,EAAE,CANV;IAOFT,aAAa,EAAE,KAPb;IASFU,eAAe,EAAEb,KAAK,CAACQ,OAAN,CAAcM,KAT7B;IAUFP,YAAY,EAAG,aAAYP,KAAK,CAACQ,OAAN,CAAcC,KAAM;EAV7C,GAWCT,KAAK,CAACe,EAAN,CAASC,UAAT,CAAoBC,aAXrB;IAaFC,UAAU,EAAElB,KAAK,CAACmB,WAAN,CAAkBC,MAAlB,CAAyB,kBAAzB,EAA6C;MACvD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AGPhD,MAAM,EAAE,MAHD;IAIPyD,QAAQ,EAAE,UAJH;IAKPgB,KAAK,EAAE,CALA;IAMPC,GAAG,EAAE,CANE;IAOPC,SAAS,EAAE,iBAPJ;IAQPjB,MAAM,EAAE,CARD;IASPkB,WAAW,EAAE;EATN;AA7MgB,CAAZ,CAAf;;AA0NA,eAAe/E,MAAf"}
|
|
@@ -8,7 +8,9 @@ export type HvTableRowClassKey =
|
|
|
8
8
|
| "hover"
|
|
9
9
|
| "selected"
|
|
10
10
|
| "expanded"
|
|
11
|
-
| "striped"
|
|
11
|
+
| "striped"
|
|
12
|
+
| "variantList"
|
|
13
|
+
| "variantListHead";
|
|
12
14
|
|
|
13
15
|
export interface HvTableRowProps
|
|
14
16
|
extends StandardProps<React.HTMLAttributes<HTMLTableRowElement>, HvTableRowClassKey> {
|
|
@@ -30,10 +30,14 @@ const HvTableRow = /*#__PURE__*/forwardRef(function HvTableRow(props, ref) {
|
|
|
30
30
|
const tableContext = useContext(TableContext);
|
|
31
31
|
const tableSectionContext = useContext(TableSectionContext);
|
|
32
32
|
const type = (tableSectionContext === null || tableSectionContext === void 0 ? void 0 : tableSectionContext.type) || "body";
|
|
33
|
+
const isList = tableContext.variant === "listrow";
|
|
33
34
|
const Component = component || (tableContext === null || tableContext === void 0 ? void 0 : (_tableContext$compone = tableContext.components) === null || _tableContext$compone === void 0 ? void 0 : _tableContext$compone.Tr) || defaultComponent;
|
|
34
35
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
35
36
|
ref: ref,
|
|
36
|
-
className: clsx(classes.root, classes[type],
|
|
37
|
+
className: clsx(classes.root, classes[type], tableSectionContext.filterClassName, className, isList && {
|
|
38
|
+
"body": classes.variantList,
|
|
39
|
+
"head": classes.variantListHead
|
|
40
|
+
}[type], hover && classes.hover, selected && classes.selected, expanded && classes.expanded, striped && classes.striped),
|
|
37
41
|
role: Component === defaultComponent ? null : "row"
|
|
38
42
|
}, others));
|
|
39
43
|
});
|
|
@@ -116,7 +120,17 @@ process.env.NODE_ENV !== "production" ? HvTableRow.propTypes = {
|
|
|
116
120
|
/**
|
|
117
121
|
* Styles applied to the component root when inside a `HvTableFooter`.
|
|
118
122
|
*/
|
|
119
|
-
footer: PropTypes.string
|
|
123
|
+
footer: PropTypes.string,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Styles applied to the component root when its table variant is list.
|
|
127
|
+
*/
|
|
128
|
+
variantList: PropTypes.string,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Styles applied to the component root when its table variant is list.
|
|
132
|
+
*/
|
|
133
|
+
variantListHead: PropTypes.string
|
|
120
134
|
}).isRequired
|
|
121
135
|
} : void 0;
|
|
122
136
|
export default withStyles(styles, {
|