@terraware/web-components 3.0.8 → 3.0.9-rc.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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableHeaderItem.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"TableHeaderItem.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA2FjE"}
|
@@ -10,17 +10,7 @@ var _sortable = require("@dnd-kit/sortable");
|
|
10
10
|
var _utilities = require("@dnd-kit/utilities");
|
11
11
|
var _iconsMaterial = require("@mui/icons-material");
|
12
12
|
var _material = require("@mui/material");
|
13
|
-
var _styles = require("@mui/styles");
|
14
13
|
var _IconTooltip = _interopRequireDefault(require("../IconTooltip"));
|
15
|
-
const useStyles = (0, _styles.makeStyles)(theme => ({
|
16
|
-
dragIcon: {
|
17
|
-
marginLeft: props => props.rightAligned ? '0px' : '-20px',
|
18
|
-
color: theme.palette.common.white,
|
19
|
-
'&:hover': {
|
20
|
-
color: theme.palette.neutral[600]
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}));
|
24
14
|
function TableHeaderItem(props) {
|
25
15
|
const {
|
26
16
|
headCell,
|
@@ -29,9 +19,6 @@ function TableHeaderItem(props) {
|
|
29
19
|
onRequestSort,
|
30
20
|
i
|
31
21
|
} = props;
|
32
|
-
const classes = useStyles({
|
33
|
-
rightAligned: headCell.alignment === 'right'
|
34
|
-
});
|
35
22
|
const {
|
36
23
|
attributes,
|
37
24
|
listeners,
|
@@ -50,6 +37,7 @@ function TableHeaderItem(props) {
|
|
50
37
|
const createSortHandler = property => event => {
|
51
38
|
onRequestSort(event, property);
|
52
39
|
};
|
40
|
+
const theme = (0, _material.useTheme)();
|
53
41
|
return headCell.alignment === 'right' ? /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
54
42
|
ref: setNodeRef,
|
55
43
|
id: "table-header-".concat(headCell.id),
|
@@ -73,12 +61,15 @@ function TableHeaderItem(props) {
|
|
73
61
|
}, headCell.tooltipTitle && /*#__PURE__*/_react.default.createElement(_IconTooltip.default, {
|
74
62
|
title: headCell.tooltipTitle,
|
75
63
|
disableRightMargin: true
|
76
|
-
}), headCell.label), i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({
|
77
|
-
className: classes.dragIcon
|
78
|
-
}, attributes, listeners, {
|
64
|
+
}), headCell.label), i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({}, attributes, listeners, {
|
79
65
|
sx: {
|
80
66
|
verticalAlign: 'middle',
|
81
|
-
display: 'inline-flex'
|
67
|
+
display: 'inline-flex',
|
68
|
+
marginLeft: headCell.alignment === 'right' ? '0px' : '-20px',
|
69
|
+
color: theme.palette.common.white,
|
70
|
+
'&:hover': {
|
71
|
+
color: theme.palette.neutral[600]
|
72
|
+
}
|
82
73
|
}
|
83
74
|
})))) : /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
84
75
|
ref: setNodeRef,
|
@@ -93,9 +84,15 @@ function TableHeaderItem(props) {
|
|
93
84
|
active: orderBy === headCell.id,
|
94
85
|
direction: orderBy === headCell.id ? order : 'asc',
|
95
86
|
onClick: createSortHandler(headCell.id)
|
96
|
-
}, i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({
|
97
|
-
|
98
|
-
|
87
|
+
}, i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({}, attributes, listeners, {
|
88
|
+
sx: {
|
89
|
+
marginLeft: '-20px',
|
90
|
+
color: theme.palette.common.white,
|
91
|
+
'&:hover': {
|
92
|
+
color: theme.palette.neutral[600]
|
93
|
+
}
|
94
|
+
}
|
95
|
+
})), headCell.label, headCell.tooltipTitle && /*#__PURE__*/_react.default.createElement(_IconTooltip.default, {
|
99
96
|
title: headCell.tooltipTitle
|
100
97
|
})));
|
101
98
|
}
|