@moderneinc/design-system-components 7.5.0-next.6d29ed → 7.5.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/DataGrid/DataGrid.styles.d.ts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.esm.js +12 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1547,7 +1547,13 @@ ModCodeSnippet.displayName = 'ModCodeSnippet';
|
|
|
1547
1547
|
const panelSurfaceStyles = {
|
|
1548
1548
|
backgroundColor: designSystemTokens.semanticColors.color.surface.raised,
|
|
1549
1549
|
};
|
|
1550
|
-
|
|
1550
|
+
/**
|
|
1551
|
+
* `resizable` picks header-title overflow. User-draggable widths truncate,
|
|
1552
|
+
* since wrapped labels grow the header row mid-drag; the ellipsis also
|
|
1553
|
+
* restores MUI's full-label tooltip, which needs `overflow: hidden`. Fixed
|
|
1554
|
+
* widths wrap. Grid-level only: MUI has no per-column resizability class.
|
|
1555
|
+
*/
|
|
1556
|
+
const getDataGridHeaderStyles = ({ resizable = false, } = {}) => {
|
|
1551
1557
|
return {
|
|
1552
1558
|
// Header cell container styles: bg, border, padding
|
|
1553
1559
|
[`& .${xDataGrid.gridClasses.columnHeader}`]: {
|
|
@@ -1573,8 +1579,9 @@ const getDataGridHeaderStyles = () => {
|
|
|
1573
1579
|
...designSystemTokens.semanticTypography.table.header,
|
|
1574
1580
|
color: designSystemTokens.semanticColors.color.text.tertiary,
|
|
1575
1581
|
transition: 'color 0.2s',
|
|
1576
|
-
|
|
1577
|
-
|
|
1582
|
+
...(resizable
|
|
1583
|
+
? { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }
|
|
1584
|
+
: { textOverflow: 'clip', whiteSpace: 'break-spaces' }),
|
|
1578
1585
|
},
|
|
1579
1586
|
// Change text color on hover
|
|
1580
1587
|
[`& .${xDataGrid.gridClasses.columnHeader}:hover .${xDataGrid.gridClasses.columnHeaderTitle}`]: {
|
|
@@ -1595,6 +1602,7 @@ const getDataGridHeaderStyles = () => {
|
|
|
1595
1602
|
},
|
|
1596
1603
|
// MUI clips this container when padding leaves < 16px of content area, which
|
|
1597
1604
|
// crops the sort icon. Guards callers that shrink height.table.header.
|
|
1605
|
+
// NOTE: MUI's own minWidth: 0 here keeps title truncation working despite `visible`.
|
|
1598
1606
|
[`& .${xDataGrid.gridClasses.columnHeaderTitleContainer}`]: {
|
|
1599
1607
|
overflow: 'visible',
|
|
1600
1608
|
lineHeight: 1,
|
|
@@ -2360,7 +2368,7 @@ function ModDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
|
|
|
2360
2368
|
[`&& .${xDataGrid.gridClasses.filler}, && .${xDataGrid.gridClasses.scrollbarFiller}`]: {
|
|
2361
2369
|
backgroundColor: designSystemTokens.semanticColors.color.surface.dataGrid.default,
|
|
2362
2370
|
},
|
|
2363
|
-
...getDataGridHeaderStyles(),
|
|
2371
|
+
...getDataGridHeaderStyles({ resizable: !props.disableColumnResize }),
|
|
2364
2372
|
...getDataGridRowStyles(),
|
|
2365
2373
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
2366
2374
|
// Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons
|