linear-react-components-ui 1.1.20-beta.14 → 1.1.20-beta.15

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.
@@ -89,8 +89,9 @@ const DefaultButton = _ref => {
89
89
  }
90
90
  if (dropdown && showIconDropdown) {
91
91
  const openDropDownRule = isDropdownOpened ? 'mini_up' : 'mini_down';
92
+ const dropdownIcon = iconName || openDropDownRule;
92
93
  return /*#__PURE__*/_react.default.createElement(_icons.default, {
93
- name: openDropDownRule,
94
+ name: dropdownIcon,
94
95
  size: 16,
95
96
  customClass: "dropdown-icon",
96
97
  pointerEvents: "none",
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/Icon.js';
5
5
  import '../icons/helper.js';
6
+ import '../@types/Position.js';
6
7
 
7
8
  declare const Header: ({ title, children, style, customClass }: IListHeaderProps) => JSX.Element;
8
9
 
@@ -3,7 +3,11 @@ import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/Icon.js';
5
5
  import '../icons/helper.js';
6
+ import '../@types/Position.js';
6
7
 
7
- declare const Item: (props: IListItemProps) => JSX.Element | null;
8
+ declare const _default: {
9
+ (props: IListItemProps): JSX.Element;
10
+ displayName: string;
11
+ };
8
12
 
9
- export { Item as default };
13
+ export { _default as default };
package/lib/list/Item.js CHANGED
@@ -11,6 +11,7 @@ var _checkbox = _interopRequireDefault(require("../checkbox"));
11
11
  var _helpers = require("./helpers");
12
12
  var _withDropdown = require("../dropdown/withDropdown");
13
13
  var constants = _interopRequireWildcard(require("../internals/constants"));
14
+ var _withTooltip = _interopRequireWildcard(require("../internals/withTooltip"));
14
15
  var _permissionValidations = require("../permissionValidations");
15
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
17
  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); }
@@ -38,7 +39,9 @@ const Item = props => {
38
39
  separator = true,
39
40
  visible = true,
40
41
  permissionAttr,
41
- skeletonize
42
+ skeletonize,
43
+ targetRef,
44
+ onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
42
45
  } = props;
43
46
  const {
44
47
  handleSelectItem,
@@ -48,6 +51,9 @@ const Item = props => {
48
51
  selectOnEnter
49
52
  } = (0, _react.useContext)(_helpers.ListContext);
50
53
  const dropdownContext = (0, _react.useContext)(_withDropdown.WithDropdownContext);
54
+ const {
55
+ handlerSetOnDeniedText
56
+ } = (0, _react.useContext)(_withTooltip.TooltipContext);
51
57
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
52
58
  const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
53
59
  const navigate = (0, _reactRouterDom.useNavigate)();
@@ -103,6 +109,9 @@ const Item = props => {
103
109
  document.removeEventListener('keydown', onKeyDown);
104
110
  };
105
111
  }, [url, selectedItemId, itemId]);
112
+ (0, _react.useEffect)(() => {
113
+ if (disabledByPermission) handlerSetOnDeniedText(onDeniedText);
114
+ }, [disabledByPermission]);
106
115
  const renderCheckBox = (0, _react.useMemo)(() => {
107
116
  if (!disabledByPermission && displayCheckbox) {
108
117
  return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
@@ -117,7 +126,10 @@ const Item = props => {
117
126
  }, [disabledByPermission && displayCheckbox]);
118
127
  if (!visible || onDenied.unvisible) return null;
119
128
  return /*#__PURE__*/_react.default.createElement("li", _extends({
120
- ref: itemId && selectedItemId === itemId ? selectedItemRef : null,
129
+ ref: ref => {
130
+ if (targetRef) targetRef(ref);
131
+ return itemId && selectedItemId === itemId ? selectedItemRef : null;
132
+ },
121
133
  style: style,
122
134
  className: "item-container ".concat(hovered && 'hovered', "\n ").concat(itemId && selectedItemId === itemId ? '-activedlist' : '')
123
135
  }, getProps(), {
@@ -137,4 +149,4 @@ const Item = props => {
137
149
  className: "".concat(getClass(), " -icon-right")
138
150
  }, getIcon(rightIconName, rightIcon), rightElement));
139
151
  };
140
- var _default = exports.default = Item;
152
+ var _default = exports.default = (0, _withTooltip.default)(Item);
@@ -3,6 +3,7 @@ import { IListContext } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/Icon.js';
5
5
  import '../icons/helper.js';
6
+ import '../@types/Position.js';
6
7
 
7
8
  declare const ListContext: React__default.Context<IListContext>;
8
9
  declare const LIST_ITEMS_TYPES: {
@@ -6,6 +6,7 @@ import 'react';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../@types/Icon.js';
8
8
  import '../icons/helper.js';
9
+ import '../@types/Position.js';
9
10
 
10
11
  declare const List: (props: IListProps) => JSX.Element;
11
12
 
@@ -1,6 +1,7 @@
1
1
  import { ReactNode, ReactElement, CSSProperties, Ref } from 'react';
2
2
  import { PermissionAttr } from '../@types/PermissionAttr.js';
3
3
  import { IconNames } from '../@types/Icon.js';
4
+ import { Position } from '../@types/Position.js';
4
5
  import '../icons/helper.js';
5
6
 
6
7
  type ItemId = string;
@@ -52,6 +53,11 @@ interface IListItemProps {
52
53
  permissionAttr?: PermissionAttr | PermissionAttr[];
53
54
  selectOnEnter?: boolean;
54
55
  skeletonize?: boolean;
56
+ targetRef?: (ref: HTMLLIElement) => void;
57
+ tooltipPosition?: Exclude<Position, 'center'>;
58
+ tooltipWidth?: string | number;
59
+ tooltip?: string;
60
+ onDeniedText?: string;
55
61
  }
56
62
  interface IListContext {
57
63
  selectable: boolean;
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _icons = _interopRequireDefault(require("../icons"));
9
9
  var _skeleton = _interopRequireDefault(require("../skeleton"));
10
10
  var _helpers = _interopRequireDefault(require("./helpers"));
11
+ var _lodash = _interopRequireDefault(require("lodash"));
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  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); }
13
14
  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; }
@@ -20,8 +21,6 @@ const HeaderColumn = props => {
20
21
  textAlign,
21
22
  visible = true,
22
23
  id,
23
- rowSpan,
24
- colSpan,
25
24
  isMenuColumn = false
26
25
  } = props;
27
26
  const {
@@ -38,13 +37,14 @@ const HeaderColumn = props => {
38
37
  size: 22
39
38
  });
40
39
  };
40
+ const getProps = () => {
41
+ return _lodash.default.omit(props, ['isMenuColumn', 'customClass', 'children', 'textAlign', 'visible']);
42
+ };
41
43
  if (!visible) return null;
42
- return /*#__PURE__*/_react.default.createElement("th", _extends({}, props, {
44
+ return /*#__PURE__*/_react.default.createElement("th", _extends({}, getProps(), {
43
45
  id: id,
44
- rowSpan: rowSpan,
45
- colSpan: colSpan,
46
- className: "headercolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(isMenuColumn && 'menu-column'),
47
- style: style
46
+ style: style,
47
+ className: "headercolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(isMenuColumn && 'menu-column')
48
48
  }), skeletonize && (skeletonInHeader || !skeletonInRows) && !vertical ? /*#__PURE__*/_react.default.createElement(_skeleton.default, {
49
49
  height: style && style.height ? undefined : 16,
50
50
  style: {
@@ -25,8 +25,6 @@ interface ITableHeaderProps extends ComponentProps<'th'> {
25
25
  textAlign?: string;
26
26
  visible?: boolean;
27
27
  id?: string;
28
- rowSpan?: number;
29
- colSpan?: number;
30
28
  isMenuColumn?: boolean;
31
29
  }
32
30
  interface ITableBodyProps extends TableHTMLAttributes<HTMLTableElement> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.20-beta.14",
3
+ "version": "1.1.20-beta.15",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",