@bigbinary/neetoui 5.0.5 → 5.0.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.
package/index.cjs.js CHANGED
@@ -10802,7 +10802,7 @@ var UniqueArray = /*#__PURE__*/function () {
10802
10802
  var renderFocusOnFocusableElements = function renderFocusOnFocusableElements(ref) {
10803
10803
  var _ref$current, _ref$current2;
10804
10804
  var shouldFocusFirstFocusableElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
10805
- var focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
10805
+ var focusableElements = '[href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
10806
10806
  var firstFocusableElement = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelectorAll(focusableElements)[0];
10807
10807
  var focusableContent = ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.querySelectorAll(focusableElements);
10808
10808
  var lastFocusableElement = focusableContent[(focusableContent === null || focusableContent === void 0 ? void 0 : focusableContent.length) - 1];
@@ -17577,12 +17577,12 @@ var useOverlay = function useOverlay(_ref) {
17577
17577
  var focusRequiredElementInOverlay = function focusRequiredElementInOverlay() {
17578
17578
  if (hasTransitionCompleted) {
17579
17579
  var _initialFocusRef;
17580
- if (!((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current)) {
17581
- renderFocusOnFocusableElements(overlayWrapper);
17582
- } else {
17580
+ if ((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current) {
17583
17581
  var _initialFocusRef2, _initialFocusRef2$cur;
17584
17582
  (_initialFocusRef2 = initialFocusRef) === null || _initialFocusRef2 === void 0 ? void 0 : (_initialFocusRef2$cur = _initialFocusRef2.current) === null || _initialFocusRef2$cur === void 0 ? void 0 : _initialFocusRef2$cur.focus();
17585
17583
  renderFocusOnFocusableElements(overlayWrapper, false);
17584
+ } else {
17585
+ renderFocusOnFocusableElements(overlayWrapper);
17586
17586
  }
17587
17587
  }
17588
17588
  };
@@ -27751,13 +27751,13 @@ var Pane = function Pane(_ref) {
27751
27751
  handleOverlayClose = _useOverlay.handleOverlayClose,
27752
27752
  setFocusField = _useOverlay.setFocusField;
27753
27753
  React$5.useEffect(function () {
27754
- if (isOpen) {
27754
+ if (hasTransitionCompleted) {
27755
27755
  var headerHeight = getHeaderHeight(paneWrapper);
27756
27756
  if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {
27757
27757
  paneWrapper.current.style.setProperty("--neeto-ui-pane-header-height", "".concat(headerHeight, "px"));
27758
27758
  }
27759
27759
  }
27760
- }, [isOpen]);
27760
+ }, [hasTransitionCompleted]);
27761
27761
  return /*#__PURE__*/React__default["default"].createElement(Portal, {
27762
27762
  rootId: "neeto-ui-portal"
27763
27763
  }, /*#__PURE__*/React__default["default"].createElement(CSSTransition, {
@@ -27765,7 +27765,7 @@ var Pane = function Pane(_ref) {
27765
27765
  appear: isOpen,
27766
27766
  classNames: "neeto-ui-pane",
27767
27767
  "in": isOpen,
27768
- timeout: 300,
27768
+ timeout: 230,
27769
27769
  onEntered: function onEntered() {
27770
27770
  return setHasTransitionCompleted(true);
27771
27771
  },
@@ -27793,9 +27793,9 @@ var Pane = function Pane(_ref) {
27793
27793
  size: "small",
27794
27794
  style: "text",
27795
27795
  onClick: handleOverlayClose
27796
- }), typeof children === "function" ? children({
27796
+ }), hasTransitionCompleted && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, typeof children === "function" ? children({
27797
27797
  setFocusField: setFocusField
27798
- }) : children))));
27798
+ }) : children)))));
27799
27799
  };
27800
27800
  Pane.Header = Header;
27801
27801
  Pane.Body = Body;
@@ -32689,9 +32689,16 @@ var Table = function Table(_ref) {
32689
32689
  }
32690
32690
  }
32691
32691
  }, [resizeObserver.current, fixedHeight]);
32692
+ var handleHeaderClasses = function handleHeaderClasses() {
32693
+ var _headerRef$current;
32694
+ Object.values((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.children).forEach(function (child) {
32695
+ child.setAttribute("data-text-align", child.style["text-align"]);
32696
+ });
32697
+ };
32692
32698
  useTimeout(function () {
32693
32699
  var headerHeight = headerRef.current ? headerRef.current.offsetHeight : TABLE_DEFAULT_HEADER_HEIGHT;
32694
32700
  setHeaderHeight(headerHeight);
32701
+ handleHeaderClasses();
32695
32702
  }, 0);
32696
32703
  var _useReorderColumns = useReorderColumns({
32697
32704
  isEnabled: enableColumnReorder,
@@ -32808,6 +32815,7 @@ var Table = function Table(_ref) {
32808
32815
  x: "max-content",
32809
32816
  y: calculateTableContainerHeight()
32810
32817
  }, scroll),
32818
+ onChange: handleHeaderClasses,
32811
32819
  onHeaderRow: function onHeaderRow() {
32812
32820
  return {
32813
32821
  ref: headerRef,