@iobroker/gui-components 10.3.16 → 10.4.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.
Files changed (59) hide show
  1. package/README.md +17 -1
  2. package/build/Components/AnimatedIcons/IconCopyToClipboard.d.ts +25 -0
  3. package/build/Components/AnimatedIcons/IconCopyToClipboard.js +84 -0
  4. package/build/Components/AnimatedIcons/IconCopyToClipboard.js.map +1 -0
  5. package/build/Components/AnimatedIcons/IconFilter.d.ts +23 -0
  6. package/build/Components/AnimatedIcons/IconFilter.js +26 -0
  7. package/build/Components/AnimatedIcons/IconFilter.js.map +1 -0
  8. package/build/Components/AnimatedIcons/IconFolder.d.ts +6 -0
  9. package/build/Components/AnimatedIcons/IconFolder.js +2 -1
  10. package/build/Components/AnimatedIcons/IconFolder.js.map +1 -1
  11. package/build/Components/AnimatedIcons/IconThemeMode.d.ts +22 -0
  12. package/build/Components/AnimatedIcons/IconThemeMode.js +32 -0
  13. package/build/Components/AnimatedIcons/IconThemeMode.js.map +1 -0
  14. package/build/Components/AnimatedIcons/IconUpload.d.ts +24 -0
  15. package/build/Components/AnimatedIcons/IconUpload.js +37 -0
  16. package/build/Components/AnimatedIcons/IconUpload.js.map +1 -0
  17. package/build/Components/AnimatedIcons/common.d.ts +2 -0
  18. package/build/Components/AnimatedIcons/common.js +64 -5
  19. package/build/Components/AnimatedIcons/common.js.map +1 -1
  20. package/build/Components/ColorPicker.js +4 -3
  21. package/build/Components/ColorPicker.js.map +1 -1
  22. package/build/Components/FileBrowser.d.ts +6 -0
  23. package/build/Components/FileBrowser.js +54 -12
  24. package/build/Components/FileBrowser.js.map +1 -1
  25. package/build/Components/FileViewer.js +3 -2
  26. package/build/Components/FileViewer.js.map +1 -1
  27. package/build/Components/ObjectBrowser/ObjectBrowserClass.d.ts +6 -0
  28. package/build/Components/ObjectBrowser/ObjectBrowserClass.js +66 -6
  29. package/build/Components/ObjectBrowser/ObjectBrowserClass.js.map +1 -1
  30. package/build/Components/ObjectBrowser/contextMenu.js +3 -2
  31. package/build/Components/ObjectBrowser/contextMenu.js.map +1 -1
  32. package/build/Components/ObjectBrowser/renderLeaf.js +55 -76
  33. package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -1
  34. package/build/Components/ObjectBrowser/rowAnimation.d.ts +25 -1
  35. package/build/Components/ObjectBrowser/rowAnimation.js +46 -19
  36. package/build/Components/ObjectBrowser/rowAnimation.js.map +1 -1
  37. package/build/Components/ObjectBrowser/skeleton.d.ts +15 -0
  38. package/build/Components/ObjectBrowser/skeleton.js +106 -0
  39. package/build/Components/ObjectBrowser/skeleton.js.map +1 -0
  40. package/build/Components/ObjectBrowser/styles.js +16 -11
  41. package/build/Components/ObjectBrowser/styles.js.map +1 -1
  42. package/build/Components/ObjectBrowser/toolbar.js +18 -14
  43. package/build/Components/ObjectBrowser/toolbar.js.map +1 -1
  44. package/build/Components/ObjectBrowser/utils.d.ts +2 -0
  45. package/build/Components/ObjectBrowser/utils.js +2 -0
  46. package/build/Components/ObjectBrowser/utils.js.map +1 -1
  47. package/build/Components/ToggleThemeMenu.js +11 -8
  48. package/build/Components/ToggleThemeMenu.js.map +1 -1
  49. package/build/Components/TreeTable.d.ts +16 -0
  50. package/build/Components/TreeTable.js +106 -18
  51. package/build/Components/TreeTable.js.map +1 -1
  52. package/build/Dialogs/ComplexCron.js +3 -2
  53. package/build/Dialogs/ComplexCron.js.map +1 -1
  54. package/build/Dialogs/Error.js +3 -2
  55. package/build/Dialogs/Error.js.map +1 -1
  56. package/build/index.d.ts +4 -0
  57. package/build/index.js +4 -0
  58. package/build/index.js.map +1 -1
  59. package/package.json +5 -5
@@ -1,16 +1,19 @@
1
1
  import React from 'react';
2
2
  import { IconButton, Tooltip } from '@mui/material';
3
- import { Brightness4 as Brightness4Icon, Brightness5 as Brightness5Icon, Brightness6 as Brightness6Icon, Brightness7 as Brightness7Icon, } from '@mui/icons-material';
3
+ import { IconThemeMode } from './AnimatedIcons/IconThemeMode';
4
+ function getMode(themeName) {
5
+ if (themeName === 'dark' || themeName === 'modernDark') {
6
+ return 'dark';
7
+ }
8
+ if (themeName === 'blue' || themeName === 'colored') {
9
+ return themeName;
10
+ }
11
+ return 'light';
12
+ }
4
13
  export function ToggleThemeMenu({ themeName, toggleTheme, t, className, style, size, }) {
5
14
  return (React.createElement("div", { className: className || undefined, style: style || undefined },
6
15
  React.createElement(Tooltip, { title: t('ra_Change color theme'), slotProps: { popper: { sx: { pointerEvents: 'none' } } } },
7
16
  React.createElement(IconButton, { onClick: () => toggleTheme(), size: size || 'medium' },
8
- (themeName === 'dark' || themeName === 'modernDark') && React.createElement(Brightness4Icon, { className: className }),
9
- themeName === 'blue' && React.createElement(Brightness5Icon, { className: className }),
10
- themeName === 'colored' && React.createElement(Brightness6Icon, { className: className }),
11
- themeName !== 'dark' &&
12
- themeName !== 'modernDark' &&
13
- themeName !== 'blue' &&
14
- themeName !== 'colored' && React.createElement(Brightness7Icon, { className: className })))));
17
+ React.createElement(IconThemeMode, { mode: getMode(themeName), className: className })))));
15
18
  }
16
19
  //# sourceMappingURL=ToggleThemeMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleThemeMenu.js","sourceRoot":"./src/","sources":["Components/ToggleThemeMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EACH,WAAW,IAAI,eAAe,EAC9B,WAAW,IAAI,eAAe,EAC9B,WAAW,IAAI,eAAe,EAC9B,WAAW,IAAI,eAAe,GACjC,MAAM,qBAAqB,CAAC;AAY7B,MAAM,UAAU,eAAe,CAAC,EAC5B,SAAS,EACT,WAAW,EACX,CAAC,EACD,SAAS,EACT,KAAK,EACL,IAAI,GACe;IACnB,OAAO,CACH,6BACI,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,KAAK,EAAE,KAAK,IAAI,SAAS;QAEzB,oBAAC,OAAO,IACJ,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACjC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE;YAExD,oBAAC,UAAU,IACP,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAC5B,IAAI,EAAE,IAAI,IAAI,QAAQ;gBAErB,CAAC,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,YAAY,CAAC,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;gBACjG,SAAS,KAAK,MAAM,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;gBACjE,SAAS,KAAK,SAAS,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;gBACpE,SAAS,KAAK,MAAM;oBACjB,SAAS,KAAK,YAAY;oBAC1B,SAAS,KAAK,MAAM;oBACpB,SAAS,KAAK,SAAS,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI,CAC/D,CACP,CACR,CACT,CAAC;AACN,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { IconButton, Tooltip } from '@mui/material';\n\nimport {\n Brightness4 as Brightness4Icon,\n Brightness5 as Brightness5Icon,\n Brightness6 as Brightness6Icon,\n Brightness7 as Brightness7Icon,\n} from '@mui/icons-material';\nimport type { ThemeName } from '../types';\n\ninterface ToggleThemeMenuProps {\n themeName: ThemeName;\n toggleTheme: () => void;\n t: (key: string) => string;\n className?: string;\n style?: React.CSSProperties;\n size?: 'small' | 'medium' | 'large';\n}\n\nexport function ToggleThemeMenu({\n themeName,\n toggleTheme,\n t,\n className,\n style,\n size,\n}: ToggleThemeMenuProps): JSX.Element {\n return (\n <div\n className={className || undefined}\n style={style || undefined}\n >\n <Tooltip\n title={t('ra_Change color theme')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <IconButton\n onClick={() => toggleTheme()}\n size={size || 'medium'}\n >\n {(themeName === 'dark' || themeName === 'modernDark') && <Brightness4Icon className={className} />}\n {themeName === 'blue' && <Brightness5Icon className={className} />}\n {themeName === 'colored' && <Brightness6Icon className={className} />}\n {themeName !== 'dark' &&\n themeName !== 'modernDark' &&\n themeName !== 'blue' &&\n themeName !== 'colored' && <Brightness7Icon className={className} />}\n </IconButton>\n </Tooltip>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ToggleThemeMenu.js","sourceRoot":"./src/","sources":["Components/ToggleThemeMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,aAAa,EAA2B,MAAM,+BAA+B,CAAC;AAGvF,SAAS,OAAO,CAAC,SAAoB;IACjC,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QACrD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAWD,MAAM,UAAU,eAAe,CAAC,EAC5B,SAAS,EACT,WAAW,EACX,CAAC,EACD,SAAS,EACT,KAAK,EACL,IAAI,GACe;IACnB,OAAO,CACH,6BACI,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,KAAK,EAAE,KAAK,IAAI,SAAS;QAEzB,oBAAC,OAAO,IACJ,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACjC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE;YAExD,oBAAC,UAAU,IACP,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAC5B,IAAI,EAAE,IAAI,IAAI,QAAQ;gBAGtB,oBAAC,aAAa,IACV,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,EACxB,SAAS,EAAE,SAAS,GACtB,CACO,CACP,CACR,CACT,CAAC;AACN,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { IconButton, Tooltip } from '@mui/material';\n\nimport { IconThemeMode, type IconThemeModeProps } from './AnimatedIcons/IconThemeMode';\nimport type { ThemeName } from '../types';\n\nfunction getMode(themeName: ThemeName): IconThemeModeProps['mode'] {\n if (themeName === 'dark' || themeName === 'modernDark') {\n return 'dark';\n }\n if (themeName === 'blue' || themeName === 'colored') {\n return themeName;\n }\n return 'light';\n}\n\ninterface ToggleThemeMenuProps {\n themeName: ThemeName;\n toggleTheme: () => void;\n t: (key: string) => string;\n className?: string;\n style?: React.CSSProperties;\n size?: 'small' | 'medium' | 'large';\n}\n\nexport function ToggleThemeMenu({\n themeName,\n toggleTheme,\n t,\n className,\n style,\n size,\n}: ToggleThemeMenuProps): JSX.Element {\n return (\n <div\n className={className || undefined}\n style={style || undefined}\n >\n <Tooltip\n title={t('ra_Change color theme')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <IconButton\n onClick={() => toggleTheme()}\n size={size || 'medium'}\n >\n {/* one icon for all themes, so that the change is animated */}\n <IconThemeMode\n mode={getMode(themeName)}\n className={className}\n />\n </IconButton>\n </Tooltip>\n </div>\n );\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import React, { Component, type JSX } from 'react';
2
2
  import type { Connection } from '../Connection';
3
+ import { type RowParts } from './ObjectBrowser/rowAnimation';
3
4
  import type { IobTheme, ThemeType } from '../types';
4
5
  interface Column {
5
6
  cellStyle?: Record<string, any>;
@@ -54,8 +55,23 @@ interface TreeTableState {
54
55
  export declare class TreeTable extends Component<TreeTableProps, TreeTableState> {
55
56
  private selectCallback;
56
57
  private updateTimeout;
58
+ private readonly containerRef;
59
+ private readonly bodyRef;
60
+ /** The running animations of an opened or closing item (see `ObjectBrowser/rowAnimation.ts`) */
61
+ private rowAnimations;
62
+ /** The item whose children slide under its row at the moment; they are removed when that ends */
63
+ private foldingId;
64
+ private foldTimer;
57
65
  constructor(props: TreeTableProps);
58
66
  componentWillUnmount(): void;
67
+ /** The rendered rows of an item, of its children and the rows below them */
68
+ getRowParts(id: string): RowParts | null;
69
+ /** Opens or closes an item: its children slide out from under its row, or back under it */
70
+ toggleOpened(id: string): void;
71
+ /** The fold animation ended (or is cut short): remove the children of the item now */
72
+ applyFold(): void;
73
+ /** Ends a running fold or unfold animation at once */
74
+ finishRowAnimations(): void;
59
75
  static getDerivedStateFromProps(props: TreeTableProps, state: TreeTableState): Partial<TreeTableState>;
60
76
  renderCellEdit(item: Record<string, any>, col: Column): JSX.Element | null;
61
77
  onChange(col: Column, oldValue: string | number | boolean, newValue: string | number | boolean): void;
@@ -1,10 +1,12 @@
1
1
  import React, { Component } from 'react';
2
2
  import { Box, Fab, Table, TableBody, TableCell, TableHead, TableRow, TableSortLabel, IconButton, Select, MenuItem, TextField, Checkbox, Tooltip, } from '@mui/material';
3
- import { Edit as IconEdit, Delete as IconDelete, NavigateNext as IconExpand, Check as IconCheck, Close as IconClose, Add as IconAdd, ViewHeadline as IconList, } from '@mui/icons-material';
3
+ import { Edit as IconEdit, NavigateNext as IconExpand, Check as IconCheck, Close as IconClose, Add as IconAdd, ViewHeadline as IconList, } from '@mui/icons-material';
4
4
  import { DialogSelectID } from '../Dialogs/SelectID';
5
5
  import { ColorPicker, parseColor } from './ColorPicker';
6
6
  import { I18n } from '../i18n';
7
7
  import { Utils } from './Utils';
8
+ import { IconTrash } from './AnimatedIcons/IconTrash';
9
+ import { foldRows, measureRows, unfoldRows } from './ObjectBrowser/rowAnimation';
8
10
  function getAttr(obj, attr, lookup) {
9
11
  if (typeof attr === 'string') {
10
12
  attr = attr.split('.');
@@ -240,6 +242,13 @@ function stableSort(array, comparator) {
240
242
  export class TreeTable extends Component {
241
243
  selectCallback = null;
242
244
  updateTimeout = null;
245
+ containerRef = React.createRef();
246
+ bodyRef = React.createRef();
247
+ /** The running animations of an opened or closing item (see `ObjectBrowser/rowAnimation.ts`) */
248
+ rowAnimations = [];
249
+ /** The item whose children slide under its row at the moment; they are removed when that ends */
250
+ foldingId = null;
251
+ foldTimer = null;
243
252
  constructor(props) {
244
253
  super(props);
245
254
  let opened = (window._localStorage || window.localStorage).getItem(this.props.name || 'iob-table') || '[]';
@@ -267,6 +276,97 @@ export class TreeTable extends Component {
267
276
  clearTimeout(this.updateTimeout);
268
277
  this.updateTimeout = null;
269
278
  }
279
+ // a fold animation must not update the state after the component was destroyed
280
+ this.foldingId = null;
281
+ if (this.foldTimer) {
282
+ clearTimeout(this.foldTimer);
283
+ this.foldTimer = null;
284
+ }
285
+ this.rowAnimations.forEach(animation => animation.cancel());
286
+ this.rowAnimations = [];
287
+ }
288
+ /** The rendered rows of an item, of its children and the rows below them */
289
+ getRowParts(id) {
290
+ const body = this.bodyRef.current;
291
+ if (!body) {
292
+ return null;
293
+ }
294
+ let nodeRow = null;
295
+ const block = [];
296
+ const below = [];
297
+ for (const row of Array.from(body.children)) {
298
+ if (!nodeRow) {
299
+ if (row.dataset.treeId === String(id)) {
300
+ nodeRow = row;
301
+ }
302
+ }
303
+ else if (!below.length && row.dataset.treeLevel !== '0') {
304
+ block.push(row);
305
+ }
306
+ else {
307
+ below.push(row);
308
+ }
309
+ }
310
+ return measureRows(this.containerRef.current, nodeRow, block, below);
311
+ }
312
+ /** Opens or closes an item: its children slide out from under its row, or back under it */
313
+ toggleOpened(id) {
314
+ // an item that is still closing is closed now, this toggle builds on it
315
+ const folding = this.foldingId;
316
+ this.finishRowAnimations();
317
+ const opened = this.state.opened.filter(item => item !== folding);
318
+ const pos = opened.indexOf(id);
319
+ if (pos === -1) {
320
+ opened.push(id);
321
+ opened.sort();
322
+ }
323
+ else {
324
+ opened.splice(pos, 1);
325
+ }
326
+ (window._localStorage || window.localStorage).setItem(this.props.name || 'iob-table', JSON.stringify(opened));
327
+ if (pos === -1) {
328
+ this.setState({ opened }, () => {
329
+ this.rowAnimations = unfoldRows(this.getRowParts(id));
330
+ });
331
+ return;
332
+ }
333
+ const animations = foldRows(this.getRowParts(id), () => this.applyFold());
334
+ if (animations) {
335
+ // the children slide under the row first and are removed when the animation ends
336
+ this.rowAnimations = animations;
337
+ this.foldingId = id;
338
+ // a hidden tab does not run animations: close anyway
339
+ this.foldTimer = setTimeout(() => this.applyFold(), 600);
340
+ }
341
+ else {
342
+ this.setState({ opened });
343
+ }
344
+ }
345
+ /** The fold animation ended (or is cut short): remove the children of the item now */
346
+ applyFold() {
347
+ const id = this.foldingId;
348
+ if (id === null) {
349
+ return;
350
+ }
351
+ this.foldingId = null;
352
+ if (this.foldTimer) {
353
+ clearTimeout(this.foldTimer);
354
+ this.foldTimer = null;
355
+ }
356
+ const animations = this.rowAnimations;
357
+ this.rowAnimations = [];
358
+ // the animations hold the rows in their end position until the children are really gone
359
+ this.setState(state => ({ opened: state.opened.filter(item => item !== id) }), () => animations.forEach(animation => animation.cancel()));
360
+ }
361
+ /** Ends a running fold or unfold animation at once */
362
+ finishRowAnimations() {
363
+ if (this.foldingId !== null) {
364
+ this.applyFold();
365
+ }
366
+ else {
367
+ this.rowAnimations.forEach(animation => animation.cancel());
368
+ this.rowAnimations = [];
369
+ }
270
370
  }
271
371
  static getDerivedStateFromProps(props, state) {
272
372
  if (props.glowOnChange) {
@@ -443,25 +543,13 @@ export class TreeTable extends Component {
443
543
  const isEditingThis = this.state.editMode === i || this.state.deleteMode === i;
444
544
  const isBlurred = (this.state.editMode !== false && this.state.editMode !== i) ||
445
545
  (this.state.deleteMode !== false && this.state.deleteMode !== i);
446
- const row = (React.createElement(TableRow, { key: item.id, className: `table-row-${(item.id || '').toString().replace(/[.$]/g, '_')}`, sx: Utils.getStyle(this.props.theme, styles.row, level ? styles.rowSecondary : undefined, !level && children.length ? styles.rowMainWithChildren : undefined, !level && !children.length ? styles.rowMainWithoutChildren : undefined, isEditingThis ? styles.rowEditing : undefined, isBlurred ? styles.rowNoEdit : undefined), style: this.state.update && this.state.update.includes(item.id)
546
+ const row = (React.createElement(TableRow, { key: item.id, "data-tree-id": String(item.id), "data-tree-level": level, className: `table-row-${(item.id || '').toString().replace(/[.$]/g, '_')}`, sx: Utils.getStyle(this.props.theme, styles.row, level ? styles.rowSecondary : undefined, !level && children.length ? styles.rowMainWithChildren : undefined, !level && !children.length ? styles.rowMainWithoutChildren : undefined, isEditingThis ? styles.rowEditing : undefined, isBlurred ? styles.rowNoEdit : undefined), style: this.state.update && this.state.update.includes(item.id)
447
547
  ? { ...styles.glow }
448
548
  : undefined },
449
549
  React.createElement(TableCell, { sx: Utils.getStyle(this.props.theme, styles.cell, styles.cellExpand, level ? styles.cellSecondary : undefined) }, children.length ? (React.createElement(IconButton, { sx: {
450
550
  ...styles.expandButton,
451
551
  ...(opened ? styles.expandButtonOpened : undefined),
452
- }, title: I18n.t(opened ? 'ra_Collapse' : 'ra_Expand'), onClick: () => {
453
- const _opened = [...this.state.opened];
454
- const pos = _opened.indexOf(item.id);
455
- if (pos === -1) {
456
- _opened.push(item.id);
457
- _opened.sort();
458
- }
459
- else {
460
- _opened.splice(pos, 1);
461
- }
462
- (window._localStorage || window.localStorage).setItem(this.props.name || 'iob-table', JSON.stringify(_opened));
463
- this.setState({ opened: _opened });
464
- }, size: "small" },
552
+ }, title: I18n.t(opened ? 'ra_Collapse' : 'ra_Expand'), onClick: () => this.toggleOpened(item.id), size: "small" },
465
553
  React.createElement(IconExpand, { fontSize: "small" }))) : null),
466
554
  React.createElement(TableCell, { scope: "row", sx: Utils.getStyle(this.props.theme, styles.cell, level ? styles.cellSecondary : undefined), style: { ...this.props.columns[0].cellStyle, paddingLeft: levelShift * level } },
467
555
  React.createElement(Box, { component: "div", sx: { display: 'flex', alignItems: 'center' } },
@@ -498,7 +586,7 @@ export class TreeTable extends Component {
498
586
  React.createElement(IconClose, { fontSize: "small" })))) : this.props.onDelete ? (React.createElement(Tooltip, { title: I18n.t('ra_Delete') },
499
587
  React.createElement("span", null,
500
588
  React.createElement(IconButton, { disabled: this.state.deleteMode !== false, onClick: () => this.setState({ deleteMode: i }), size: "small" },
501
- React.createElement(IconDelete, { fontSize: "small" }))))) : null)) : null));
589
+ React.createElement(IconTrash, { fontSize: "small", open: this.state.deleteMode === i }))))) : null)) : null));
502
590
  if (!level && opened) {
503
591
  const items = children.map(it => this.renderLine(it, level + 1));
504
592
  items.unshift(row);
@@ -543,10 +631,10 @@ export class TreeTable extends Component {
543
631
  this.setState({ update: null });
544
632
  }, 500);
545
633
  }
546
- return (React.createElement("div", { style: styles.tableContainer, className: this.props.className },
634
+ return (React.createElement("div", { ref: this.containerRef, style: styles.tableContainer, className: this.props.className },
547
635
  React.createElement(Table, { style: styles.table, "aria-label": "simple table", size: "small", stickyHeader: true },
548
636
  this.renderHead(),
549
- React.createElement(TableBody, null, table.map(it => this.renderLine(it)))),
637
+ React.createElement(TableBody, { ref: this.bodyRef }, table.map(it => this.renderLine(it)))),
550
638
  this.renderSelectIdDialog()));
551
639
  }
552
640
  return null;