linear-react-components-ui 1.1.19-beta.4 → 1.1.19-beta.6

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.
@@ -66,9 +66,8 @@
66
66
  svg {
67
67
  margin: 0;
68
68
  }
69
- span.rowhover {
69
+ span {
70
70
  width: 100%;
71
- text-align: center;
72
71
  }
73
72
  }
74
73
 
@@ -1,10 +1,10 @@
1
+ import React__default from 'react';
1
2
  import { PopoverTextProps } from './types.js';
2
- import 'react';
3
3
  import '../@types/Position.js';
4
4
  import '../@types/SizePixels.js';
5
5
  import '../@types/Icon.js';
6
6
  import '../icons/helper.js';
7
7
 
8
- declare const PopoverText: ({ children }: PopoverTextProps) => JSX.Element;
8
+ declare const PopoverText: React__default.ForwardRefExoticComponent<PopoverTextProps & React__default.RefAttributes<HTMLParagraphElement>>;
9
9
 
10
10
  export { PopoverText as default };
@@ -4,14 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const PopoverText = _ref => {
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const PopoverText = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
10
11
  let {
11
12
  children
12
13
  } = _ref;
13
14
  return /*#__PURE__*/_react.default.createElement("p", {
14
- className: "text"
15
+ className: "text",
16
+ ref: ref
15
17
  }, children);
16
- };
18
+ });
19
+ PopoverText.displayName = 'PopoverText';
17
20
  var _default = exports.default = PopoverText;
@@ -39,7 +39,9 @@ const TreeNode = props => {
39
39
  children,
40
40
  nodeMenuButtonSize = 'small',
41
41
  selectedNodeId,
42
- alwaysShowArrow = false
42
+ alwaysShowArrow = false,
43
+ customClass = '',
44
+ customStyle
43
45
  } = props;
44
46
  const [node, setNode] = (0, _react.useState)(props.node);
45
47
  const [isVisible, setIsVisible] = (0, _react.useState)(startNodesOpened && nodeHasItens(node));
@@ -65,8 +67,6 @@ const TreeNode = props => {
65
67
  const checked = selectedIds && selectedIds.includes(node[valuePropName]) || required;
66
68
  if (node !== props.node) {
67
69
  setNode(props.node);
68
- setIsVisible(startNodesOpened && nodeHasItens(node));
69
- setWasOpened(startNodesOpened && nodeHasItens(node));
70
70
  }
71
71
  const openCloseTree = currentNode => {
72
72
  if (!wasOpened && handlerOnNodeOpen) {
@@ -80,7 +80,6 @@ const TreeNode = props => {
80
80
  let span = /*#__PURE__*/_react.default.createElement("noscript", null);
81
81
  if (node.itens && node.itens.length > 0 || alwaysShowArrow) {
82
82
  span = /*#__PURE__*/_react.default.createElement("span", {
83
- onKeyPress: () => {},
84
83
  tabIndex: 0,
85
84
  role: "button",
86
85
  className: isLoading ? 'loading' : 'opencloseicon',
@@ -88,7 +87,7 @@ const TreeNode = props => {
88
87
  }, isLoading ? /*#__PURE__*/_react.default.createElement(_SpinnerLoading.default, {
89
88
  size: "35px"
90
89
  }) : /*#__PURE__*/_react.default.createElement(_icons.default, {
91
- name: isVisible ? 'up' : 'down',
90
+ name: isVisible ? 'down' : 'arrow_right',
92
91
  size: 10
93
92
  }));
94
93
  }
@@ -119,8 +118,8 @@ const TreeNode = props => {
119
118
  validator,
120
119
  applyBehavior
121
120
  } = validation;
122
- if (_lodash.default.isEmpty(elementBehavior) && validator && validator(node) && applyBehavior) {
123
- elementBehavior = options[applyBehavior] || options.unvisible;
121
+ if (_lodash.default.isEmpty(elementBehavior) && validator && validator(node)) {
122
+ elementBehavior = options[applyBehavior !== null && applyBehavior !== void 0 ? applyBehavior : 'unvisible'];
124
123
  }
125
124
  });
126
125
  }
@@ -180,8 +179,13 @@ const TreeNode = props => {
180
179
  customClass: "node-toolbarelements"
181
180
  }, /*#__PURE__*/_react.default.createElement(_toolbar.ToolBarGroup, null, updatedNodeRightElements)) : null;
182
181
  };
182
+ (0, _react.useEffect)(() => {
183
+ setIsVisible(startNodesOpened && nodeHasItens(node));
184
+ setWasOpened(startNodesOpened && nodeHasItens(node));
185
+ }, [node]);
183
186
  return /*#__PURE__*/_react.default.createElement("li", {
184
- className: "treeviewitem"
187
+ style: customStyle,
188
+ className: "treeviewitem ".concat(customClass)
185
189
  }, getSpan(), /*#__PURE__*/_react.default.createElement("div", {
186
190
  className: "label",
187
191
  style: {
@@ -47,11 +47,13 @@ const TreeView = props => {
47
47
  nodeToolbarElements,
48
48
  onNodeClick,
49
49
  selectedNodeId,
50
- customClass,
50
+ customClass = '',
51
51
  children,
52
52
  styleForContainer,
53
53
  bordered,
54
- requiredIds: propsRequiredIds = []
54
+ requiredIds: propsRequiredIds = [],
55
+ customClassForNodes = '',
56
+ customStyleForNodes
55
57
  } = props;
56
58
  const [data, setData] = (0, _react.useState)(props.data);
57
59
  const [currentSelectedIds, setCurrentSelectedIds] = (0, _react.useState)(selectedIds);
@@ -251,7 +253,9 @@ const TreeView = props => {
251
253
  nodeMenuButtonSize: nodeMenuButtonSize,
252
254
  onNodeClick: onNodeClick,
253
255
  selectedNodeId: selectedNodeId,
254
- handlerOnNodeOpen: handleOnNodeOpen
256
+ handlerOnNodeOpen: handleOnNodeOpen,
257
+ customClass: customClassForNodes,
258
+ customStyle: customStyleForNodes
255
259
  }, childrenIds.length > 0 && node.itens && node.itens.map(nodeitem => buildTree(nodeitem, node.id, idsWithChildren)));
256
260
  };
257
261
  const handleNewSelectedIds = selectedNodeIds => {
@@ -47,6 +47,8 @@ interface ITreeviewProps {
47
47
  enableDynamicData?: boolean;
48
48
  idsInLoading?: number[];
49
49
  selectedNodeId?: number;
50
+ customClassForNodes?: string;
51
+ customStyleForNodes?: CSSProperties;
50
52
  }
51
53
  interface ITreeNodeProps {
52
54
  node: any;
@@ -65,6 +67,8 @@ interface ITreeNodeProps {
65
67
  nodeElementsValidations?: INodeElementsValidations;
66
68
  idsInLoading?: number[];
67
69
  selectedNodeId?: number;
70
+ customClass?: string;
71
+ customStyle?: CSSProperties;
68
72
  }
69
73
  interface ITreeHeaderProps {
70
74
  title?: string;
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.19-beta.4",
3
+ "version": "1.1.19-beta.6",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",
7
+ "files": [
8
+ "lib"
9
+ ],
7
10
  "scripts": {
8
11
  "lib": "babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" --ignore **/*.spec.tsx && babel src/lib/assets -d lib/assets --copy-files && npm run lib:types",
9
12
  "lib:types": "tsup --dts-only --dts --external react",
@@ -26,7 +29,7 @@
26
29
  "homepage": "",
27
30
  "repository": {
28
31
  "type": "git",
29
- "url": "git@gitlab.com:linear-front/linear-react-components-ui.git"
32
+ "url": "git@git.erplinear.com.br:linear-front/linear-react-components-ui.git"
30
33
  },
31
34
  "browserslist": {
32
35
  "production": [
package/.editorconfig DELETED
@@ -1,19 +0,0 @@
1
- # EditorConfig is awesome: http://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- [*.md]
7
- trim_trailing_whitespace = false
8
-
9
- [*.js]
10
- trim_trailing_whitespace = true
11
-
12
- # Unix-style newlines with a newline ending every file
13
- [*]
14
- indent_style = space
15
- indent_size = 2
16
- end_of_line = lf
17
- charset = utf-8
18
- insert_final_newline = true
19
- max_line_length = 100