linear-react-components-ui 1.1.20-rc.2 → 1.1.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.
Files changed (149) hide show
  1. package/lib/alerts/BaseAlert.js +1 -1
  2. package/lib/alerts/Message.js +1 -1
  3. package/lib/assets/styles/calendar.scss +64 -30
  4. package/lib/assets/styles/datepicker.scss +26 -6
  5. package/lib/assets/styles/periodpicker.scss +60 -20
  6. package/lib/assets/styles/sidenav.scss +1 -1
  7. package/lib/assets/styles/tabs.scss +32 -15
  8. package/lib/avatar/index.js +9 -8
  9. package/lib/badge/index.js +4 -4
  10. package/lib/buttons/DangerButton.js +1 -1
  11. package/lib/buttons/DefaultButton.js +12 -4
  12. package/lib/buttons/InfoButton.js +1 -1
  13. package/lib/buttons/PrimaryButton.js +1 -1
  14. package/lib/buttons/SuccessButton.js +1 -1
  15. package/lib/buttons/WarningButton.js +1 -1
  16. package/lib/buttons/button_container/index.js +1 -1
  17. package/lib/buttons/split_button/index.js +1 -1
  18. package/lib/calendar/DangerCalendar.d.ts +1 -0
  19. package/lib/calendar/InfoCalendar.d.ts +1 -0
  20. package/lib/calendar/PrimaryCalendar.d.ts +1 -0
  21. package/lib/calendar/SuccessCalendar.d.ts +1 -0
  22. package/lib/calendar/WarningCalendar.d.ts +1 -0
  23. package/lib/calendar/base/Day.d.ts +1 -0
  24. package/lib/calendar/base/Day.js +6 -2
  25. package/lib/calendar/base/Month.d.ts +2 -1
  26. package/lib/calendar/base/Month.js +3 -1
  27. package/lib/calendar/base/Week.d.ts +1 -0
  28. package/lib/calendar/base/helpers.js +2 -2
  29. package/lib/calendar/base/index.d.ts +1 -0
  30. package/lib/calendar/base/index.js +62 -14
  31. package/lib/calendar/index.d.ts +1 -0
  32. package/lib/calendar/types.d.ts +5 -0
  33. package/lib/checkbox/index.js +1 -1
  34. package/lib/dialog/Custom.js +1 -1
  35. package/lib/dialog/Question.js +2 -4
  36. package/lib/dialog/base/Content.js +6 -5
  37. package/lib/dialog/base/Header.js +2 -3
  38. package/lib/dialog/base/index.js +30 -8
  39. package/lib/dialog/form/index.js +1 -1
  40. package/lib/dialog/wizard/progressbar.js +1 -1
  41. package/lib/dialog/wizard/step.js +1 -1
  42. package/lib/drawer/Drawer.js +4 -4
  43. package/lib/drawer/Header.js +1 -1
  44. package/lib/dropdown/Popup.d.ts +2 -2
  45. package/lib/dropdown/Popup.js +7 -7
  46. package/lib/dropdown/helper.js +1 -1
  47. package/lib/dropdown/types.d.ts +4 -4
  48. package/lib/dropdown/withDropdown.js +2 -2
  49. package/lib/fieldset/index.js +7 -7
  50. package/lib/form/FieldArray.js +1 -1
  51. package/lib/form/FieldNumber.js +3 -3
  52. package/lib/form/FieldPeriod.js +2 -2
  53. package/lib/form/index.js +2 -2
  54. package/lib/gridlayout/GridCol.js +5 -5
  55. package/lib/gridlayout/GridRow.js +4 -1
  56. package/lib/hint/index.js +7 -1
  57. package/lib/icons/index.js +24 -27
  58. package/lib/inputs/base/InputTextBase.js +15 -10
  59. package/lib/inputs/base/Label.js +1 -1
  60. package/lib/inputs/base/helpers.js +7 -3
  61. package/lib/inputs/base/types.d.ts +2 -0
  62. package/lib/inputs/date/Dialog.js +5 -4
  63. package/lib/inputs/date/Dropdown.js +13 -7
  64. package/lib/inputs/date/helpers.d.ts +1 -11
  65. package/lib/inputs/date/helpers.js +1 -11
  66. package/lib/inputs/date/index.js +130 -104
  67. package/lib/inputs/date/types.d.ts +7 -6
  68. package/lib/inputs/errorMessage/index.js +1 -1
  69. package/lib/inputs/file/DefaultFile.js +5 -6
  70. package/lib/inputs/file/DragDropFile.js +15 -17
  71. package/lib/inputs/file/File.js +3 -4
  72. package/lib/inputs/mask/BaseMask.js +1 -2
  73. package/lib/inputs/multiSelect/Dropdown.js +9 -10
  74. package/lib/inputs/multiSelect/helper.js +1 -2
  75. package/lib/inputs/multiSelect/index.js +7 -9
  76. package/lib/inputs/number/BaseNumber.js +1 -1
  77. package/lib/inputs/number/index.js +1 -2
  78. package/lib/inputs/period/Dialog.d.ts +1 -1
  79. package/lib/inputs/period/Dialog.js +5 -3
  80. package/lib/inputs/period/Dropdown.js +16 -8
  81. package/lib/inputs/period/PeriodList.js +3 -12
  82. package/lib/inputs/period/helper.js +3 -1
  83. package/lib/inputs/period/index.js +217 -86
  84. package/lib/inputs/period/types.d.ts +10 -8
  85. package/lib/inputs/search/index.js +1 -1
  86. package/lib/inputs/select/ActionButtons.js +3 -2
  87. package/lib/inputs/select/Dropdown.js +5 -3
  88. package/lib/inputs/select/helper.js +10 -13
  89. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  90. package/lib/inputs/select/multiple/index.js +18 -17
  91. package/lib/inputs/select/simple/index.js +19 -20
  92. package/lib/inputs/select/types.d.ts +4 -0
  93. package/lib/inputs/textarea/index.js +1 -1
  94. package/lib/inputs/types.d.ts +1 -0
  95. package/lib/internals/withTooltip.js +9 -9
  96. package/lib/labelMessages/index.js +4 -3
  97. package/lib/labels/DefaultLabel.js +4 -1
  98. package/lib/labels/label_container/index.js +1 -1
  99. package/lib/list/Header.js +1 -1
  100. package/lib/list/Item.js +10 -9
  101. package/lib/list/index.js +2 -1
  102. package/lib/menus/float/MenuItem.js +2 -2
  103. package/lib/menus/float/SubMenuContainer.js +1 -1
  104. package/lib/menus/float/index.js +1 -1
  105. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  106. package/lib/menus/sidenav/NavMenuGroup.js +1 -1
  107. package/lib/menus/sidenav/NavMenuItem.js +7 -9
  108. package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
  109. package/lib/menus/sidenav/helpers.js +1 -1
  110. package/lib/menus/sidenav/index.js +5 -5
  111. package/lib/panel/Content.js +5 -7
  112. package/lib/panel/Default.js +2 -2
  113. package/lib/panel/Header.js +3 -3
  114. package/lib/permissionValidations.js +1 -1
  115. package/lib/popover/index.js +1 -1
  116. package/lib/progress/Bar.js +6 -6
  117. package/lib/radio/index.js +2 -2
  118. package/lib/shortcuts/index.js +1 -1
  119. package/lib/skeleton/SkeletonContainer.js +2 -1
  120. package/lib/skeleton/index.js +4 -1
  121. package/lib/spinner/index.js +2 -2
  122. package/lib/split/Split.js +1 -1
  123. package/lib/split/SplitSide.js +3 -3
  124. package/lib/table/Body.js +3 -3
  125. package/lib/table/Header.js +8 -11
  126. package/lib/table/HeaderColumn.js +1 -1
  127. package/lib/table/Row.js +3 -3
  128. package/lib/table/RowColumn.js +1 -1
  129. package/lib/table/index.js +6 -1
  130. package/lib/tabs/DropdownTabs.js +21 -7
  131. package/lib/tabs/Menu.js +1 -1
  132. package/lib/tabs/MenuTabs.js +2 -2
  133. package/lib/tabs/Panel.js +5 -7
  134. package/lib/tabs/context.d.ts +1 -1
  135. package/lib/tabs/context.js +6 -9
  136. package/lib/tabs/types.d.ts +2 -1
  137. package/lib/textContent/index.js +1 -1
  138. package/lib/toolbar/ButtonBar.js +1 -1
  139. package/lib/toolbar/index.js +1 -1
  140. package/lib/toolbar/types.d.ts +2 -1
  141. package/lib/tooltip/index.js +7 -7
  142. package/lib/treetable/Body.js +1 -1
  143. package/lib/treetable/Header.js +2 -2
  144. package/lib/treetable/Row.js +9 -9
  145. package/lib/treeview/Header.js +1 -1
  146. package/lib/treeview/Node.js +5 -5
  147. package/lib/treeview/index.js +4 -4
  148. package/lib/uitour/index.js +6 -8
  149. package/package.json +1 -1
@@ -56,9 +56,8 @@ const PanelContent = _ref => {
56
56
  scrollHeight
57
57
  } = rootElementRef.current;
58
58
  if (scrollHeight !== lastScrollHeight.current) {
59
- var _observer;
60
59
  enableOnEndReached.current = true;
61
- (_observer = observer) === null || _observer === void 0 ? void 0 : _observer.disconnect();
60
+ observer?.disconnect();
62
61
  }
63
62
  });
64
63
  observer.observe(rootElementRef.current);
@@ -66,16 +65,15 @@ const PanelContent = _ref => {
66
65
  rootElementRef.current.addEventListener('resize', onScrollEndReached);
67
66
  }
68
67
  return () => {
69
- var _rootElementRef$curre, _rootElementRef$curre2, _observer2;
70
- (_rootElementRef$curre = rootElementRef.current) === null || _rootElementRef$curre === void 0 ? void 0 : _rootElementRef$curre.removeEventListener('scroll', onScrollEndReached);
71
- (_rootElementRef$curre2 = rootElementRef.current) === null || _rootElementRef$curre2 === void 0 ? void 0 : _rootElementRef$curre2.removeEventListener('resize', onScrollEndReached);
72
- (_observer2 = observer) === null || _observer2 === void 0 ? void 0 : _observer2.disconnect();
68
+ rootElementRef.current?.removeEventListener('scroll', onScrollEndReached);
69
+ rootElementRef.current?.removeEventListener('resize', onScrollEndReached);
70
+ observer?.disconnect();
73
71
  };
74
72
  }, [onScrollEndReached]);
75
73
  if (!opened) return null;
76
74
  return hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : /*#__PURE__*/_react.default.createElement("div", _extends({
77
75
  ref: rootElementRef,
78
- className: "panel-content ".concat(customClass !== null && customClass !== void 0 ? customClass : '')
76
+ className: `panel-content ${customClass ?? ''}`
79
77
  }, rest), opened && children);
80
78
  };
81
79
  var _default = exports.default = PanelContent;
@@ -37,8 +37,8 @@ const DefaultPanel = _ref => {
37
37
  } = _permissionValidations.OPTIONS_ON_DENIED;
38
38
  const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)([hideContent, unvisible], permissionAttr));
39
39
  const getCssClass = () => {
40
- let cssClass = "panel-component ".concat(customClass);
41
- cssClass += colorStyle !== '' ? " -".concat(colorStyle) : '';
40
+ let cssClass = `panel-component ${customClass}`;
41
+ cssClass += colorStyle !== '' ? ` -${colorStyle}` : '';
42
42
  return cssClass;
43
43
  };
44
44
  const renderContent = () => /*#__PURE__*/_react.default.createElement("div", _extends({
@@ -32,7 +32,7 @@ const getClassName = _ref => {
32
32
  customClass,
33
33
  headerColored = true
34
34
  } = _ref;
35
- let className = "panel-header ".concat(customClass !== null && customClass !== void 0 ? customClass : '');
35
+ let className = `panel-header ${customClass ?? ''}`;
36
36
  if (!headerColored) className += ' -uncolored';
37
37
  return className;
38
38
  };
@@ -56,9 +56,9 @@ const PanelHeader = props => {
56
56
  return /*#__PURE__*/_react.default.createElement("div", _extends({
57
57
  className: getClassName(props)
58
58
  }, rest), (icon || titleIcon) && /*#__PURE__*/_react.default.createElement("div", {
59
- className: "".concat(icon !== null || titleIcon !== null ? 'icon-left-panel' : '')
59
+ className: `${icon !== null || titleIcon !== null ? 'icon-left-panel' : ''}`
60
60
  }, getIcon(titleIcon, icon)), title && /*#__PURE__*/_react.default.createElement("h1", {
61
- className: "title ".concat(customClassForTitle !== null && customClassForTitle !== void 0 ? customClassForTitle : ''),
61
+ className: `title ${customClassForTitle ?? ''}`,
62
62
  style: styleForTitle
63
63
  }, title), toggleable && /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
64
64
  position: "right"
@@ -45,7 +45,7 @@ const actionsOnPermissionDenied = (options, permissionAttr) => {
45
45
  }
46
46
  const result = {};
47
47
  options.forEach(option => {
48
- result[option] = hasPermission ? false : option === (permissionsAttr === null || permissionsAttr === void 0 ? void 0 : permissionsAttr[0].onDenied);
48
+ result[option] = hasPermission ? false : option === permissionsAttr?.[0].onDenied;
49
49
  });
50
50
  return result;
51
51
  };
@@ -61,7 +61,7 @@ const Popover = _ref => {
61
61
  e.preventDefault();
62
62
  }
63
63
  }, rest), /*#__PURE__*/_react.default.createElement("div", {
64
- className: "popovercontainer -".concat(theme, " ").concat(customClass),
64
+ className: `popovercontainer -${theme} ${customClass}`,
65
65
  "data-testid": "popover-container",
66
66
  style: customStyle
67
67
  }, children));
@@ -18,8 +18,8 @@ const getPercentage = _ref => {
18
18
  };
19
19
  const getClass = props => {
20
20
  let style = 'bar';
21
- if (props.customClass) style += "".concat(props.customClass);
22
- if (props.type) style += " -".concat(props.type);
21
+ if (props.customClass) style += `${props.customClass}`;
22
+ if (props.type) style += ` -${props.type}`;
23
23
  if (props.effect) style += ' -effect';
24
24
  if (props.animated) style += ' -animated';
25
25
  if (props.indeterminate) style += ' -indeterminate';
@@ -28,7 +28,7 @@ const getClass = props => {
28
28
  const getLabel = progress => {
29
29
  let value = progress.label;
30
30
  if (!progress.label) {
31
- value = "".concat(getPercentage(progress), "%");
31
+ value = `${getPercentage(progress)}%`;
32
32
  }
33
33
  return /*#__PURE__*/_react.default.createElement("span", {
34
34
  className: "progressbar-label "
@@ -46,12 +46,12 @@ const getStyle = props => {
46
46
  return {
47
47
  width: progressWidth,
48
48
  height,
49
- animationDuration: "".concat(indeterminateDuration, "s"),
50
- animationDelay: "".concat(indeterminateDelay, "s")
49
+ animationDuration: `${indeterminateDuration}s`,
50
+ animationDelay: `${indeterminateDelay}s`
51
51
  };
52
52
  }
53
53
  return {
54
- width: "".concat(getPercentage(props), "%"),
54
+ width: `${getPercentage(props)}%`,
55
55
  height
56
56
  };
57
57
  };
@@ -79,7 +79,7 @@ const Radio = _ref => {
79
79
  alignItems: 'center'
80
80
  }
81
81
  }, /*#__PURE__*/_react.default.createElement("div", {
82
- className: "radio-button ".concat(disabled ? 'disabled' : '', " ").concat(skeletonize ? '-skeletonized' : '')
82
+ className: `radio-button ${disabled ? 'disabled' : ''} ${skeletonize ? '-skeletonized' : ''}`
83
83
  }, /*#__PURE__*/_react.default.createElement("input", _extends({}, getCustomProps(), {
84
84
  ref: inputRef,
85
85
  className: "radio-component",
@@ -90,7 +90,7 @@ const Radio = _ref => {
90
90
  required: required,
91
91
  disabled: shouldDisable()
92
92
  })), /*#__PURE__*/_react.default.createElement("label", {
93
- className: "description ".concat(size && "-".concat(size)),
93
+ className: `description ${size && `-${size}`}`,
94
94
  htmlFor: id
95
95
  }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_textContent.default, {
96
96
  required: required,
@@ -21,7 +21,7 @@ const Shortcuts = _ref => {
21
21
  style: style
22
22
  }, /*#__PURE__*/_react.default.createElement("kbd", {
23
23
  "data-testid": "shortcut",
24
- className: "shortcut-component ".concat(type && "-".concat(type)),
24
+ className: `shortcut-component ${type && `-${type}`}`,
25
25
  style: styleShortcut
26
26
  }, shortcut), ":\xA0", description);
27
27
  };
@@ -13,7 +13,8 @@ const SkeletonContainer = _ref => {
13
13
  customClass,
14
14
  style
15
15
  } = _ref;
16
- const getClass = () => "skeletoncontainer-component ".concat(customClass, "\n ").concat(row && '-row');
16
+ const getClass = () => `skeletoncontainer-component ${customClass}
17
+ ${row && '-row'}`;
17
18
  return /*#__PURE__*/_react.default.createElement("div", {
18
19
  className: getClass(),
19
20
  style: style
@@ -35,7 +35,10 @@ const Skeleton = props => {
35
35
  width,
36
36
  height
37
37
  };
38
- const getClass = () => "skeleton-component ".concat(customClass, "\n ").concat(color && "-".concat(color), "\n ").concat(round && '-round', "\n ").concat(round && size && "-".concat(size));
38
+ const getClass = () => `skeleton-component ${customClass}
39
+ ${color && `-${color}`}
40
+ ${round && '-round'}
41
+ ${round && size && `-${size}`}`;
39
42
  const renderContent = () => /*#__PURE__*/_react.default.createElement("div", {
40
43
  className: getClass(),
41
44
  style: _objectSpread(_objectSpread({}, customStyles), style)
@@ -37,8 +37,8 @@ const Spinner = props => {
37
37
  };
38
38
  }, []);
39
39
  const getCssClass = () => {
40
- let css = "spinner-component -".concat(align, " ").concat(customClass, " ");
41
- if (heightAuto) css = "".concat(css, " -heightauto");
40
+ let css = `spinner-component -${align} ${customClass} `;
41
+ if (heightAuto) css = `${css} -heightauto`;
42
42
  return css;
43
43
  };
44
44
  if (delay) return null;
@@ -246,7 +246,7 @@ const Split = _ref => {
246
246
  } = state;
247
247
  let containerClasses = 'split-component';
248
248
  if (customClass) {
249
- containerClasses += " ".concat(customClass);
249
+ containerClasses += ` ${customClass}`;
250
250
  }
251
251
  if (vertical) {
252
252
  containerClasses += ' splitter-layout-vertical';
@@ -27,15 +27,15 @@ const SplitSide = _ref => {
27
27
  const splitSideStyle = {};
28
28
  if (!primary) {
29
29
  if (vertical) {
30
- splitSideStyle.height = "".concat(sizeSplitSide).concat(unit);
30
+ splitSideStyle.height = `${sizeSplitSide}${unit}`;
31
31
  } else {
32
- splitSideStyle.width = "".concat(sizeSplitSide).concat(unit);
32
+ splitSideStyle.width = `${sizeSplitSide}${unit}`;
33
33
  }
34
34
  } else {
35
35
  classes += ' layout-pane-primary';
36
36
  }
37
37
  return /*#__PURE__*/_react.default.createElement("div", {
38
- className: "".concat(classes, " ").concat(customClass),
38
+ className: `${classes} ${customClass}`,
39
39
  style: Object.assign({}, splitSideStyle, style)
40
40
  }, children);
41
41
  };
package/lib/table/Body.js CHANGED
@@ -28,7 +28,7 @@ const renderChildren = (children, _ref) => {
28
28
  key: index
29
29
  }, columns.map(id => /*#__PURE__*/_react.default.createElement(_index.Td, {
30
30
  style: {
31
- width: columnsWidth === null || columnsWidth === void 0 ? void 0 : columnsWidth[id - 1]
31
+ width: columnsWidth?.[id - 1]
32
32
  },
33
33
  key: id
34
34
  }, /*#__PURE__*/_react.default.createElement(_skeleton.default, {
@@ -63,9 +63,9 @@ const TableBody = _ref2 => {
63
63
  contain: strict ? 'strict' : 'size layout style'
64
64
  }
65
65
  }, /*#__PURE__*/_react.default.createElement("tbody", {
66
- className: "tbody ".concat(isSkeletonized ? 'skeleton-transparency' : '', " ").concat(customClass)
66
+ className: `tbody ${isSkeletonized ? 'skeleton-transparency' : ''} ${customClass}`
67
67
  }, renderChildren(children, context)))) : /*#__PURE__*/_react.default.createElement("tbody", {
68
- className: "tbody ".concat(isSkeletonized ? 'skeleton-transparency' : '', " ").concat(customClass)
68
+ className: `tbody ${isSkeletonized ? 'skeleton-transparency' : ''} ${customClass}`
69
69
  }, renderChildren(children, context));
70
70
  };
71
71
  var _default = exports.default = TableBody;
@@ -12,7 +12,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
12
12
  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; }
13
13
  const getColumnsWidth = children => {
14
14
  const columnsWidth = [];
15
- if ( /*#__PURE__*/(0, _react.isValidElement)(children) && children.props) {
15
+ if (/*#__PURE__*/(0, _react.isValidElement)(children) && children.props) {
16
16
  let columns = children.props.children;
17
17
  if (!_lodash.default.isArray(columns)) columns = [columns];
18
18
  columns.forEach(element => {
@@ -20,14 +20,12 @@ const getColumnsWidth = children => {
20
20
  if (_lodash.default.isArray(element)) {
21
21
  element.forEach(elementArray => {
22
22
  if (elementArray && elementArray.props) {
23
- var _elementArray$props, _elementArray$props$s;
24
- colWidth = (_elementArray$props = elementArray.props) === null || _elementArray$props === void 0 ? void 0 : (_elementArray$props$s = _elementArray$props.style) === null || _elementArray$props$s === void 0 ? void 0 : _elementArray$props$s.width;
23
+ colWidth = elementArray.props?.style?.width;
25
24
  }
26
25
  columnsWidth.push(colWidth);
27
26
  });
28
27
  } else if (element && element.props) {
29
- var _element$props, _element$props$style;
30
- colWidth = (_element$props = element.props) === null || _element$props === void 0 ? void 0 : (_element$props$style = _element$props.style) === null || _element$props$style === void 0 ? void 0 : _element$props$style.width;
28
+ colWidth = element.props?.style?.width;
31
29
  columnsWidth.push(colWidth);
32
30
  }
33
31
  });
@@ -36,9 +34,8 @@ const getColumnsWidth = children => {
36
34
  };
37
35
  const countColumnsFromChildren = (element, columnsCount) => {
38
36
  const count = columnsCount;
39
- if ( /*#__PURE__*/(0, _react.isValidElement)(element)) {
40
- var _element$props2;
41
- if (_lodash.default.isArray(element === null || element === void 0 ? void 0 : (_element$props2 = element.props) === null || _element$props2 === void 0 ? void 0 : _element$props2.children)) {
37
+ if (/*#__PURE__*/(0, _react.isValidElement)(element)) {
38
+ if (_lodash.default.isArray(element?.props?.children)) {
42
39
  const currentElement = element.props;
43
40
  currentElement.children.forEach(child => countColumnsFromChildren(child, count));
44
41
  } else if (element) {
@@ -51,7 +48,7 @@ const countColumnsFromChildren = (element, columnsCount) => {
51
48
  const getColumnsCount = (children, columnsCount) => {
52
49
  if (_lodash.default.isArray(children) && children.length > 0 && children[0].props) {
53
50
  countColumnsFromChildren(children[0].props.children, columnsCount);
54
- } else if ( /*#__PURE__*/(0, _react.isValidElement)(children) && children.props && children.props.children) {
51
+ } else if (/*#__PURE__*/(0, _react.isValidElement)(children) && children.props && children.props.children) {
55
52
  countColumnsFromChildren(children.props.children, columnsCount);
56
53
  }
57
54
  return columnsCount.current;
@@ -85,9 +82,9 @@ const Header = _ref => {
85
82
  tableLayout: 'fixed'
86
83
  }
87
84
  }, /*#__PURE__*/_react.default.createElement("thead", {
88
- className: "theader ".concat(customClass)
85
+ className: `theader ${customClass}`
89
86
  }, children))) : /*#__PURE__*/_react.default.createElement("thead", {
90
- className: "theader ".concat(customClass)
87
+ className: `theader ${customClass}`
91
88
  }, children);
92
89
  };
93
90
  var _default = exports.default = Header;
@@ -44,7 +44,7 @@ const HeaderColumn = props => {
44
44
  return /*#__PURE__*/_react.default.createElement("th", _extends({}, getProps(), {
45
45
  id: id,
46
46
  style: style,
47
- className: "headercolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(isMenuColumn && 'menu-column')
47
+ className: `headercolumn ${customClass} text-align-${textAlign} ${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: {
package/lib/table/Row.js CHANGED
@@ -53,7 +53,7 @@ const Row = props => {
53
53
  }, !divider ? /*#__PURE__*/_react.default.createElement("tr", {
54
54
  onMouseEnter: onMouseEnter,
55
55
  onMouseLeave: onMouseLeave,
56
- className: "trow ".concat(customClass, " ").concat(rowId && selectedRowId === rowId ? '-selected' : ''),
56
+ className: `trow ${customClass} ${rowId && selectedRowId === rowId ? '-selected' : ''}`,
57
57
  onClick: e => {
58
58
  if (handleSelectRow && (rowId !== undefined || rowId !== null)) handleSelectRow(rowId);
59
59
  if (handleTableRowClick) handleTableRowClick(e, dataId);
@@ -67,11 +67,11 @@ const Row = props => {
67
67
  className: "trow trow-divider"
68
68
  }, vertical ? /*#__PURE__*/_react.default.createElement("th", {
69
69
  colSpan: dividerColSpan,
70
- className: "-divider -".concat(dividerColor),
70
+ className: `-divider -${dividerColor}`,
71
71
  style: dividerStyle
72
72
  }, dividerTitle || '') : /*#__PURE__*/_react.default.createElement("td", {
73
73
  colSpan: dividerColSpan,
74
- className: "-divider -".concat(dividerColor),
74
+ className: `-divider -${dividerColor}`,
75
75
  style: dividerStyle
76
76
  }, dividerTitle || '')));
77
77
  };
@@ -71,7 +71,7 @@ const RowColumn = props => {
71
71
  return /*#__PURE__*/_react.default.createElement("td", {
72
72
  rowSpan: rowSpan,
73
73
  colSpan: colSpan,
74
- className: "rowcolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(!context.rowBorder && ' -noborder', " ").concat(!rowSpan ? ' -norowspan' : '', " ").concat(isMenuColumn && 'menu-column'),
74
+ className: `rowcolumn ${customClass} text-align-${textAlign} ${!context.rowBorder && ' -noborder'} ${!rowSpan ? ' -norowspan' : ''} ${isMenuColumn && 'menu-column'}`,
75
75
  style: style,
76
76
  onClick: e => getColClickEvent(e, _objectSpread(_objectSpread({}, context), props)),
77
77
  role: "presentation",
@@ -65,7 +65,12 @@ const getClass = _ref => {
65
65
  bodyScrollable,
66
66
  skeletonInRows = 10
67
67
  } = _ref;
68
- return "table-component ".concat(customClass, " ").concat(striped && '-striped', " \n ").concat(bordered && '-bordered', " ").concat(hovered && '-hovered', " ").concat(headerColored && '-headercolor', "\n ").concat(condensed && '-condensed', "\n ").concat(vertical && '-vertical', "\n ").concat(skeletonize && !skeletonInRows ? '-skeletonized' : '', "\n ").concat(bodyScrollable ? '-scrollable' : '');
68
+ return `table-component ${customClass} ${striped && '-striped'}
69
+ ${bordered && '-bordered'} ${hovered && '-hovered'} ${headerColored && '-headercolor'}
70
+ ${condensed && '-condensed'}
71
+ ${vertical && '-vertical'}
72
+ ${skeletonize && !skeletonInRows ? '-skeletonized' : ''}
73
+ ${bodyScrollable ? '-scrollable' : ''}`;
69
74
  };
70
75
  const Table = _ref2 => {
71
76
  let {
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _lodash = _interopRequireDefault(require("lodash"));
7
8
  var _react = _interopRequireDefault(require("react"));
8
9
  var _buttons = _interopRequireDefault(require("../buttons"));
9
10
  var _list = _interopRequireWildcard(require("../list"));
10
11
  var _useTabs = require("./useTabs");
11
- var _lodash = _interopRequireDefault(require("lodash"));
12
+ var _2 = require("..");
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; }
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -26,16 +27,25 @@ const DropdownTab = _ref => {
26
27
  } = _ref;
27
28
  const {
28
29
  selectTab,
29
- removeTab
30
+ removeTab,
31
+ selectedTabId
30
32
  } = (0, _useTabs.useTabs)();
31
33
  return /*#__PURE__*/_react.default.createElement(_list.ListItem, {
32
- key: id
34
+ key: id,
35
+ onClick: () => selectTab(id)
33
36
  }, /*#__PURE__*/_react.default.createElement("div", {
34
37
  className: "menuitem"
35
- }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
38
+ }, selectedTabId === id ? /*#__PURE__*/_react.default.createElement(_2.Icon, {
39
+ name: "checkmark",
40
+ color: "#A10D0D"
41
+ }) : /*#__PURE__*/_react.default.createElement("div", {
42
+ style: {
43
+ width: 16,
44
+ height: 16
45
+ }
46
+ }), /*#__PURE__*/_react.default.createElement(_buttons.default, {
36
47
  className: "btn menubutton",
37
48
  boxShadow: false,
38
- onClick: () => selectTab(id),
39
49
  iconAlign: iconAlign,
40
50
  iconName: iconName,
41
51
  icon: icon,
@@ -53,16 +63,20 @@ const DropdownTabs = _ref2 => {
53
63
  tabs = [],
54
64
  tabMenuSize = 'medium'
55
65
  } = _ref2;
66
+ const {
67
+ selectedTabId
68
+ } = (0, _useTabs.useTabs)();
69
+ const hasSelectedTab = tabs.some(tab => tab.id === selectedTabId);
56
70
  const hasTabs = tabs.length > 0;
57
71
  const uniqueTabs = _lodash.default.uniqBy(tabs, 'id');
58
- if (tabs.length === 0) return null;
72
+ if (!hasTabs) return null;
59
73
  return /*#__PURE__*/_react.default.createElement(_buttons.default, {
60
74
  dropdown: true,
61
75
  dropdownAlign: "right",
62
76
  transparent: true,
63
77
  boxShadow: false,
64
78
  size: "large",
65
- customClass: "dropdownbutton ".concat(hasTabs ? 'show' : '')
79
+ customClass: `dropdownbutton ${hasTabs ? 'show' : ''} ${hasSelectedTab ? 'has-selected' : ''}`
66
80
  }, /*#__PURE__*/_react.default.createElement(_list.default, {
67
81
  customClass: "dropdown-hide-tabs"
68
82
  }, uniqueTabs.map(tab => /*#__PURE__*/_react.default.createElement(DropdownTab, _extends({
package/lib/tabs/Menu.js CHANGED
@@ -40,7 +40,7 @@ const Menu = _ref => {
40
40
  tabMenuAlign: props.tabMenuAlign,
41
41
  firstTabIdent: props.firstTabIdent
42
42
  }), toolbar && /*#__PURE__*/_react.default.cloneElement(toolbar, {
43
- customClass: "menubar ".concat(customClassForToolBar)
43
+ customClass: `menubar ${customClassForToolBar}`
44
44
  }));
45
45
  };
46
46
  var _default = exports.default = Menu;
@@ -42,7 +42,7 @@ const MenuTab = _ref => {
42
42
  style: {
43
43
  width: tabWidth
44
44
  },
45
- className: "menuitem ".concat(selectedTabId === id && 'selected')
45
+ className: `menuitem ${selectedTabId === id && 'selected'}`
46
46
  }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
47
47
  className: "btn menubutton",
48
48
  boxShadow: false,
@@ -71,7 +71,7 @@ const MenuTabs = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
71
71
  } = _ref2;
72
72
  const uniqueTabs = _lodash.default.uniqBy(tabs, 'id');
73
73
  return /*#__PURE__*/_react.default.createElement("ul", {
74
- className: "menu ".concat(firstTabIdent && '-firsttabident'),
74
+ className: `menu ${firstTabIdent && '-firsttabident'}`,
75
75
  style: helpers.menuStyles(tabMenuAlign),
76
76
  ref: ref
77
77
  }, uniqueTabs.map(tab => /*#__PURE__*/_react.default.createElement(MenuTab, _extends({
package/lib/tabs/Panel.js CHANGED
@@ -60,9 +60,8 @@ const Panel = props => {
60
60
  scrollHeight
61
61
  } = rootElementRef.current;
62
62
  if (scrollHeight !== lastScrollHeight.current) {
63
- var _observer;
64
63
  enableOnEndReached.current = true;
65
- (_observer = observer) === null || _observer === void 0 ? void 0 : _observer.disconnect();
64
+ observer?.disconnect();
66
65
  }
67
66
  });
68
67
  observer.observe(rootElementRef.current);
@@ -70,16 +69,15 @@ const Panel = props => {
70
69
  rootElementRef.current.addEventListener('resize', onScrollEndReached);
71
70
  }
72
71
  return () => {
73
- var _rootElementRef$curre, _rootElementRef$curre2, _observer2;
74
- (_rootElementRef$curre = rootElementRef.current) === null || _rootElementRef$curre === void 0 ? void 0 : _rootElementRef$curre.removeEventListener('scroll', onScrollEndReached);
75
- (_rootElementRef$curre2 = rootElementRef.current) === null || _rootElementRef$curre2 === void 0 ? void 0 : _rootElementRef$curre2.removeEventListener('resize', onScrollEndReached);
76
- (_observer2 = observer) === null || _observer2 === void 0 ? void 0 : _observer2.disconnect();
72
+ rootElementRef.current?.removeEventListener('scroll', onScrollEndReached);
73
+ rootElementRef.current?.removeEventListener('resize', onScrollEndReached);
74
+ observer?.disconnect();
77
75
  };
78
76
  }, [onScrollEndReached]);
79
77
  return /*#__PURE__*/_react.default.createElement("div", {
80
78
  ref: rootElementRef,
81
79
  id: id,
82
- className: "".concat(customClass, " panel ").concat(hidePanel),
80
+ className: `${customClass} panel ${hidePanel}`,
83
81
  style: style
84
82
  }, hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : children);
85
83
  };
@@ -7,6 +7,6 @@ import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
8
 
9
9
  declare const TabsContext: React__default.Context<TabsContextType>;
10
- declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, }: TabsProviderProps): JSX.Element;
10
+ declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, keepTabOriginalPosition, }: TabsProviderProps): JSX.Element;
11
11
 
12
12
  export { TabsContext, TabsProvider };
@@ -13,7 +13,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
13
13
  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; }
14
14
  const TabsContext = exports.TabsContext = /*#__PURE__*/(0, _react.createContext)({});
15
15
  function TabsProvider(_ref) {
16
- var _menuRef$current$clie, _menuRef$current;
17
16
  let {
18
17
  children,
19
18
  tabs: tabsProp,
@@ -22,16 +21,16 @@ function TabsProvider(_ref) {
22
21
  onTabChange,
23
22
  onTabClose,
24
23
  tabsWidth: tabsWidthProp,
25
- firstTabIdent = false
24
+ firstTabIdent = false,
25
+ keepTabOriginalPosition = true
26
26
  } = _ref;
27
27
  const [selectedTabId, setSelectedTabId] = _react.default.useState(selectedTab);
28
28
  const [containerWidth, setContainerWidth] = (0, _react.useState)(() => {
29
- var _container$current$cl, _container$current;
30
- return (_container$current$cl = (_container$current = container.current) === null || _container$current === void 0 ? void 0 : _container$current.clientWidth) !== null && _container$current$cl !== void 0 ? _container$current$cl : 0;
29
+ return container.current?.clientWidth ?? 0;
31
30
  });
32
31
  const [tabs, setTabs] = (0, _react.useState)((0, _tabHelpers.getTabs)(tabsProp));
33
32
  const menuRef = (0, _react.useRef)(null);
34
- const menuSize = ((_menuRef$current$clie = (_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : _menuRef$current.clientWidth) !== null && _menuRef$current$clie !== void 0 ? _menuRef$current$clie : 0) - 38 - (firstTabIdent ? 15 : 0);
33
+ const menuSize = (menuRef.current?.clientWidth ?? 0) - 38 - (firstTabIdent ? 15 : 0);
35
34
  const tabsWidth = (0, _react.useMemo)(() => {
36
35
  if (typeof tabsWidthProp === 'string') return tabsWidthProp === 'auto' ? 100 : parseInt(tabsWidthProp) || 100;
37
36
  return tabsWidthProp;
@@ -41,8 +40,7 @@ function TabsProvider(_ref) {
41
40
  setSelectedTabId(selectedTab);
42
41
  }
43
42
  if (tabs.length > 0 && selectedTabId === null) {
44
- var _tabs$;
45
- setSelectedTabId((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.id);
43
+ setSelectedTabId(tabs[0]?.id);
46
44
  }
47
45
  const dropdownTabs = (0, _react.useMemo)(() => {
48
46
  if (menuSize === 0) return [];
@@ -64,7 +62,7 @@ function TabsProvider(_ref) {
64
62
  }
65
63
  }, [setTabs, menuTabs, tabs, dropdownTabs]);
66
64
  const selectTab = (0, _react.useCallback)(tabId => {
67
- updateTabs(tabId);
65
+ if (!keepTabOriginalPosition) updateTabs(tabId);
68
66
  setSelectedTabId(tabId);
69
67
  if (onTabChange) {
70
68
  onTabChange(tabId);
@@ -120,7 +118,6 @@ function TabsProvider(_ref) {
120
118
  dropdownTabs,
121
119
  containerWidth,
122
120
  tabsCount,
123
- updateTabs,
124
121
  selectTab,
125
122
  selectedTabId,
126
123
  removeTab,
@@ -11,7 +11,6 @@ type TabsContextType = {
11
11
  dropdownTabs: TabProps[];
12
12
  selectedTabId: string | number | null;
13
13
  selectTab: (tabId: string | number) => void;
14
- updateTabs: (tabId: string | number) => void;
15
14
  removeTab: (tabId: string | number) => void;
16
15
  containerWidth: number;
17
16
  tabsCount: number;
@@ -26,6 +25,7 @@ interface TabsProviderProps {
26
25
  onTabChange?: (tabId: string | number) => void;
27
26
  onTabClose?: (tabId: string) => void;
28
27
  firstTabIdent?: boolean;
28
+ keepTabOriginalPosition?: boolean;
29
29
  }
30
30
  interface ITabsPros {
31
31
  style?: CSSProperties;
@@ -41,6 +41,7 @@ interface ITabsPros {
41
41
  handlerCloseTab?: (id?: string, idx?: string) => void;
42
42
  customClassForToolBar?: string;
43
43
  tabsWidth?: string | number;
44
+ keepTabOriginalPosition?: boolean;
44
45
  }
45
46
  interface TabProps {
46
47
  id: string | number;
@@ -33,7 +33,7 @@ const TextContent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
33
33
  return /*#__PURE__*/_react.default.createElement(Comp, _extends({
34
34
  ref: typedRef,
35
35
  style: styleForLabel,
36
- className: "text-content-component ".concat(className),
36
+ className: `text-content-component ${className}`,
37
37
  "data-textcontent": Comp,
38
38
  onMouseEnter: onHoverLabel
39
39
  }, restProps), children);
@@ -44,7 +44,7 @@ const ButtonBar = _ref => {
44
44
  transparent,
45
45
  skeletonize,
46
46
  boxShadow: false,
47
- customClass: "buttonbar ".concat(customClass)
47
+ customClass: `buttonbar ${customClass}`
48
48
  });
49
49
  return {
50
50
  default: /*#__PURE__*/_react.default.createElement(_buttons.default, getProps()),
@@ -58,7 +58,7 @@ const ToolBar = _ref => {
58
58
  value: contextValues
59
59
  }, /*#__PURE__*/_react.default.createElement("div", {
60
60
  ref: innerRef,
61
- className: "toolbar-component ".concat(size ? "".concat(size, "-bar") : '', " ").concat(customClass),
61
+ className: `toolbar-component ${size ? `${size}-bar` : ''} ${customClass}`,
62
62
  style: style
63
63
  }, children));
64
64
  };
@@ -1,4 +1,4 @@
1
- import { ReactNode, CSSProperties, ReactElement } from 'react';
1
+ import { ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
2
2
  import { ButtonTypes } from '../@types/ButtonTypes.js';
3
3
  import { Position } from '../@types/Position.js';
4
4
  import { Size } from '../@types/Size.js';
@@ -28,6 +28,7 @@ interface IButtonBarProps {
28
28
  boxShadow?: boolean;
29
29
  id?: string;
30
30
  onNodeElementClick?: (node: NodeItem) => void;
31
+ buttonRef?: MutableRefObject<HTMLButtonElement | null> | ((ref: HTMLButtonElement | null) => void);
31
32
  }
32
33
  interface ILabelBarProps {
33
34
  iconName?: IconNames;