linear-react-components-ui 1.1.20-beta.19 → 1.1.20-beta.20

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,4 +1,4 @@
1
- import { I as ITreeTableRow } from '../types.d-068c42bd.js';
1
+ import { I as ITreeTableRow } from '../types.d-b477e076.js';
2
2
  import 'react';
3
3
  import '../table/types.js';
4
4
 
@@ -38,14 +38,14 @@ const TreeRow = props => {
38
38
  rightToolbarElements,
39
39
  styleForRightToolbar,
40
40
  toolbarElementsValidations,
41
- startNodesOpened
41
+ openNodeId
42
42
  } = (0, _react.useContext)(_helpers.TreeTableContext);
43
43
  const {
44
44
  rowId,
45
45
  dataRow,
46
46
  rowLevel
47
47
  } = props;
48
- const [open, setOpen] = (0, _react.useState)(startNodesOpened);
48
+ const [open, setOpen] = (0, _react.useState)(false);
49
49
  const [childrens, setChildrens] = (0, _react.useState)();
50
50
  const [isLoadingChildrens, setIsLoadingChildrens] = (0, _react.useState)(false);
51
51
  const [showToolbarElements, setShowToolbarElements] = (0, _react.useState)(false);
@@ -128,6 +128,9 @@ const TreeRow = props => {
128
128
  (0, _react.useEffect)(() => {
129
129
  setIsLoadingChildrens(false);
130
130
  }, [childrens]);
131
+ (0, _react.useEffect)(() => {
132
+ if (Number(dataRow.id) === Number(openNodeId)) setOpen(true);
133
+ }, [dataRow]);
131
134
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_table.TRow, _extends({}, props, {
132
135
  dataId: rowId,
133
136
  customClass: "tree-row-element",
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { a as ITreeTableProps } from '../types.d-068c42bd.js';
2
+ import { a as ITreeTableProps } from '../types.d-b477e076.js';
3
3
  import '../table/types.js';
4
4
 
5
5
  declare const TreeTableContext: React.Context<ITreeTableProps>;
@@ -1,5 +1,5 @@
1
- import { a as ITreeTableProps } from '../types.d-068c42bd.js';
2
- export { b as IRowElementsValidations, R as RowItem } from '../types.d-068c42bd.js';
1
+ import { a as ITreeTableProps } from '../types.d-b477e076.js';
2
+ export { b as IRowElementsValidations, R as RowItem } from '../types.d-b477e076.js';
3
3
  import 'react';
4
4
  import '../table/types.js';
5
5
 
@@ -34,7 +34,7 @@ interface ITreeTableProps extends ITableProps {
34
34
  onClickFirstColumn?: (id?: string | number) => void;
35
35
  styleForRightToolbar?: CSSProperties;
36
36
  styleForLeftToolbar?: CSSProperties;
37
- startNodesOpened?: boolean;
37
+ openNodeId?: number;
38
38
  }
39
39
 
40
40
  interface ITreeTableRow extends ITableRowProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.20-beta.19",
3
+ "version": "1.1.20-beta.20",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",