@linagora/twake-mui 9.4.0 → 9.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/components/VirtualizedTable/Cell.js +4 -3
- package/dist/components/VirtualizedTable/HeadCell.js +10 -2
- package/dist/components/VirtualizedTable/index.js +7 -5
- package/dist/components/VirtualizedTable/locales/en.json +6 -0
- package/dist/components/VirtualizedTable/locales/fr.json +6 -0
- package/dist/components/VirtualizedTable/locales/ru.json +6 -0
- package/dist/components/VirtualizedTable/locales/vi.json +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/makeTheme.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## @linagora/twake-mui [9.5.1](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.5.0...@linagora/twake-mui@9.5.1) (2026-09-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **twake-mui:** Remove the dark mode elevation overlay on papers ([b940b8f](https://github.com/linagora/twake-ui/commit/b940b8feba4abbe7918870ea1253a21469d3e534))
|
|
7
|
+
|
|
8
|
+
# @linagora/twake-mui [9.5.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.4.0...@linagora/twake-mui@9.5.0) (2026-09-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **twake-mui:** Keep slow clicks on VirtualizedTable cells without a long press handler ([9e2d7a7](https://github.com/linagora/twake-ui/commit/9e2d7a786e911a509ba35b5ddedcacb43e9d2061))
|
|
14
|
+
* **twake-mui:** Show a pointer only on clickable VirtualizedTable cells ([eb98bc0](https://github.com/linagora/twake-ui/commit/eb98bc08892c5d6c162443cda249f81f57422512))
|
|
15
|
+
* **twake-mui:** Sort VirtualizedTable rows only when rows or order change ([1cb782a](https://github.com/linagora/twake-ui/commit/1cb782a1b7fa39c4bf12a814cb1aa5d6d1ae7cc0))
|
|
16
|
+
* **twake-mui:** Translate the VirtualizedTable sort direction announcement ([ffd5cc2](https://github.com/linagora/twake-ui/commit/ffd5cc2efaa437cc47d757b9d423e6648ddf6fe4))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **twake-mui:** Export VirtuosoMockContext to test VirtualizedTable ([ab456e5](https://github.com/linagora/twake-ui/commit/ab456e56fa0c121c67561e944d91d3c2641b98de))
|
|
22
|
+
|
|
1
23
|
# @linagora/twake-mui [9.4.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.3.0...@linagora/twake-mui@9.4.0) (2026-09-23)
|
|
2
24
|
|
|
3
25
|
|
|
@@ -11,10 +11,11 @@ export const Cell = ({ row, columns, column, onClick, onDoubleClick, onLongPress
|
|
|
11
11
|
const cellContent = getPath(row, column.id);
|
|
12
12
|
const cell = cellContent === undefined ? '—' : cellContent;
|
|
13
13
|
const longPressRef = useOnLongPress(() => {
|
|
14
|
-
|
|
14
|
+
// without a long press handler, a slow click must stay a click
|
|
15
|
+
if (column.disableClick || !onLongPress)
|
|
15
16
|
return;
|
|
16
17
|
isLongPress.current = true;
|
|
17
|
-
onLongPress
|
|
18
|
+
onLongPress(row, column);
|
|
18
19
|
}, { duration: LONG_PRESS_DURATION });
|
|
19
20
|
const handleClick = () => {
|
|
20
21
|
if (column.disableClick)
|
|
@@ -30,7 +31,7 @@ export const Cell = ({ row, columns, column, onClick, onDoubleClick, onLongPress
|
|
|
30
31
|
onClick?.(row, column);
|
|
31
32
|
};
|
|
32
33
|
return (React.createElement(TableCell, { ref: longPressRef, sx: {
|
|
33
|
-
cursor: onClick ? 'pointer' : undefined,
|
|
34
|
+
cursor: !!onClick && !column.disableClick ? 'pointer' : undefined,
|
|
34
35
|
width: column.width,
|
|
35
36
|
maxWidth: column.maxWidth
|
|
36
37
|
}, className: column.noWrap ? 'u-ellipsis' : undefined, align: column.textAlign ?? 'left', padding: column.disablePadding ? 'none' : 'normal', onClick: handleClick, onDoubleClick: () => column.disableClick ? undefined : onDoubleClick?.(row, column), onContextMenu: ev => isLongPress.current && ev.preventDefault() }, children
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { TableCell, TableSortLabel } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useExtendI18n, useI18n } from 'twake-i18n';
|
|
4
|
+
import en from './locales/en.json';
|
|
5
|
+
import fr from './locales/fr.json';
|
|
6
|
+
import ru from './locales/ru.json';
|
|
7
|
+
import vi from './locales/vi.json';
|
|
8
|
+
const locales = { en, fr, ru, vi };
|
|
3
9
|
export const HeadCell = ({ column, orderBy, orderDirection, onClick }) => {
|
|
10
|
+
useExtendI18n(locales);
|
|
11
|
+
const { t } = useI18n();
|
|
4
12
|
const isActive = orderBy === column.id;
|
|
5
13
|
return (React.createElement(TableCell, { sx: { width: column.width, maxWidth: column.maxWidth }, className: column.noWrap ? 'u-ellipsis' : undefined, align: column.textAlign ?? 'left', padding: column.disablePadding ? 'none' : 'normal', sortDirection: isActive ? orderDirection : false }, column.sortable !== false ? (React.createElement(TableSortLabel, { active: isActive, direction: isActive ? orderDirection : 'asc', onClick: onClick },
|
|
6
14
|
column.label,
|
|
7
15
|
isActive && (React.createElement("span", { className: "u-visuallyhidden" }, orderDirection === 'desc'
|
|
8
|
-
? '
|
|
9
|
-
: '
|
|
16
|
+
? t('VirtualizedTable.sortedDesc')
|
|
17
|
+
: t('VirtualizedTable.sortedAsc'))))) : (column.label)));
|
|
10
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableCell } from '@mui/material';
|
|
2
|
-
import React, { forwardRef, useState } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo, useState } from 'react';
|
|
3
3
|
import { GroupedTableVirtuoso, TableVirtuoso } from 'react-virtuoso';
|
|
4
4
|
import { FixedHeaderContent } from './FixedHeaderContent';
|
|
5
5
|
import { RowContent } from './RowContent';
|
|
@@ -8,10 +8,12 @@ import { virtuosoComponents } from './virtuosoComponents';
|
|
|
8
8
|
export const VirtualizedTable = forwardRef(({ rows, columns, groups, defaultOrder, secondarySort, selectedItems = [], isSelectedItem = () => false, isNewItem, context, componentsProps, components = virtuosoComponents, onSortChange, ...props }, ref) => {
|
|
9
9
|
const [orderDirection, setOrderDirection] = useState(defaultOrder?.direction ?? 'asc');
|
|
10
10
|
const [orderBy, setOrderBy] = useState(defaultOrder?.by);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const data = useMemo(() => {
|
|
12
|
+
const sortedRows = orderBy
|
|
13
|
+
? stableSort(rows, getComparator(orderDirection, orderBy))
|
|
14
|
+
: rows;
|
|
15
|
+
return secondarySort ? secondarySort(sortedRows) : sortedRows;
|
|
16
|
+
}, [rows, orderBy, orderDirection, secondarySort]);
|
|
15
17
|
const { groupLabels, groupCounts } = groups?.(data) ?? {};
|
|
16
18
|
const tableContext = {
|
|
17
19
|
...context,
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { NavDesktopDropdown } from './components/NavDesktopDropdown';
|
|
|
24
24
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
25
25
|
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
26
26
|
export { default as VirtualizedTable } from './components/VirtualizedTable';
|
|
27
|
+
export { VirtuosoMockContext } from 'react-virtuoso';
|
|
27
28
|
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
28
29
|
export type { TwakeTheme } from './lib/theme';
|
|
29
30
|
export type { PaletteJson } from './lib/types';
|
package/dist/index.js
CHANGED
|
@@ -27,4 +27,5 @@ export { NavDesktopDropdown } from './components/NavDesktopDropdown';
|
|
|
27
27
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
28
28
|
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
29
29
|
export { default as VirtualizedTable } from './components/VirtualizedTable';
|
|
30
|
+
export { VirtuosoMockContext } from 'react-virtuoso';
|
|
30
31
|
export { useBreakpoints } from './hooks/useBreakpoints';
|
package/dist/lib/makeTheme.js
CHANGED
|
@@ -34,7 +34,8 @@ export const makeTheme = (mode = 'light', paletteOverrides, themeOptions) => {
|
|
|
34
34
|
},
|
|
35
35
|
dark: {
|
|
36
36
|
palette: makePalette('dark', paletteOverrides),
|
|
37
|
-
shadows: makeShadows('dark')
|
|
37
|
+
shadows: makeShadows('dark'),
|
|
38
|
+
overlays: Array(25).fill('none')
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
typography: makeTypography(),
|