@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.js CHANGED
@@ -10773,7 +10773,7 @@ var UniqueArray = /*#__PURE__*/function () {
10773
10773
  var renderFocusOnFocusableElements = function renderFocusOnFocusableElements(ref) {
10774
10774
  var _ref$current, _ref$current2;
10775
10775
  var shouldFocusFirstFocusableElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
10776
- var focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
10776
+ var focusableElements = '[href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
10777
10777
  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];
10778
10778
  var focusableContent = ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.querySelectorAll(focusableElements);
10779
10779
  var lastFocusableElement = focusableContent[(focusableContent === null || focusableContent === void 0 ? void 0 : focusableContent.length) - 1];
@@ -17548,12 +17548,12 @@ var useOverlay = function useOverlay(_ref) {
17548
17548
  var focusRequiredElementInOverlay = function focusRequiredElementInOverlay() {
17549
17549
  if (hasTransitionCompleted) {
17550
17550
  var _initialFocusRef;
17551
- if (!((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current)) {
17552
- renderFocusOnFocusableElements(overlayWrapper);
17553
- } else {
17551
+ if ((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current) {
17554
17552
  var _initialFocusRef2, _initialFocusRef2$cur;
17555
17553
  (_initialFocusRef2 = initialFocusRef) === null || _initialFocusRef2 === void 0 ? void 0 : (_initialFocusRef2$cur = _initialFocusRef2.current) === null || _initialFocusRef2$cur === void 0 ? void 0 : _initialFocusRef2$cur.focus();
17556
17554
  renderFocusOnFocusableElements(overlayWrapper, false);
17555
+ } else {
17556
+ renderFocusOnFocusableElements(overlayWrapper);
17557
17557
  }
17558
17558
  }
17559
17559
  };
@@ -27722,13 +27722,13 @@ var Pane = function Pane(_ref) {
27722
27722
  handleOverlayClose = _useOverlay.handleOverlayClose,
27723
27723
  setFocusField = _useOverlay.setFocusField;
27724
27724
  useEffect(function () {
27725
- if (isOpen) {
27725
+ if (hasTransitionCompleted) {
27726
27726
  var headerHeight = getHeaderHeight(paneWrapper);
27727
27727
  if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {
27728
27728
  paneWrapper.current.style.setProperty("--neeto-ui-pane-header-height", "".concat(headerHeight, "px"));
27729
27729
  }
27730
27730
  }
27731
- }, [isOpen]);
27731
+ }, [hasTransitionCompleted]);
27732
27732
  return /*#__PURE__*/React__default.createElement(Portal, {
27733
27733
  rootId: "neeto-ui-portal"
27734
27734
  }, /*#__PURE__*/React__default.createElement(CSSTransition, {
@@ -27736,7 +27736,7 @@ var Pane = function Pane(_ref) {
27736
27736
  appear: isOpen,
27737
27737
  classNames: "neeto-ui-pane",
27738
27738
  "in": isOpen,
27739
- timeout: 300,
27739
+ timeout: 230,
27740
27740
  onEntered: function onEntered() {
27741
27741
  return setHasTransitionCompleted(true);
27742
27742
  },
@@ -27764,9 +27764,9 @@ var Pane = function Pane(_ref) {
27764
27764
  size: "small",
27765
27765
  style: "text",
27766
27766
  onClick: handleOverlayClose
27767
- }), typeof children === "function" ? children({
27767
+ }), hasTransitionCompleted && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, typeof children === "function" ? children({
27768
27768
  setFocusField: setFocusField
27769
- }) : children))));
27769
+ }) : children)))));
27770
27770
  };
27771
27771
  Pane.Header = Header;
27772
27772
  Pane.Body = Body;
@@ -32660,9 +32660,16 @@ var Table = function Table(_ref) {
32660
32660
  }
32661
32661
  }
32662
32662
  }, [resizeObserver.current, fixedHeight]);
32663
+ var handleHeaderClasses = function handleHeaderClasses() {
32664
+ var _headerRef$current;
32665
+ Object.values((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.children).forEach(function (child) {
32666
+ child.setAttribute("data-text-align", child.style["text-align"]);
32667
+ });
32668
+ };
32663
32669
  useTimeout(function () {
32664
32670
  var headerHeight = headerRef.current ? headerRef.current.offsetHeight : TABLE_DEFAULT_HEADER_HEIGHT;
32665
32671
  setHeaderHeight(headerHeight);
32672
+ handleHeaderClasses();
32666
32673
  }, 0);
32667
32674
  var _useReorderColumns = useReorderColumns({
32668
32675
  isEnabled: enableColumnReorder,
@@ -32779,6 +32786,7 @@ var Table = function Table(_ref) {
32779
32786
  x: "max-content",
32780
32787
  y: calculateTableContainerHeight()
32781
32788
  }, scroll),
32789
+ onChange: handleHeaderClasses,
32782
32790
  onHeaderRow: function onHeaderRow() {
32783
32791
  return {
32784
32792
  ref: headerRef,