@activecollab/components 1.0.317 → 1.0.319

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/dist/index.js CHANGED
@@ -474,7 +474,7 @@
474
474
  return React.useContext(MenuContext);
475
475
  };
476
476
 
477
- var _excluded$1f = ["children", "anchorEl", "open", "style", "transition", "placement", "strategy"];
477
+ var _excluded$1f = ["children", "anchorEl", "open", "style", "transition", "placement", "strategy", "afterWrite"];
478
478
  var Popper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
479
479
  var children = _ref.children,
480
480
  anchorEl = _ref.anchorEl,
@@ -487,6 +487,7 @@
487
487
  initialPlacement = _ref$placement === void 0 ? "bottom" : _ref$placement,
488
488
  _ref$strategy = _ref.strategy,
489
489
  strategy = _ref$strategy === void 0 ? "absolute" : _ref$strategy,
490
+ afterWrite = _ref.afterWrite,
490
491
  rest = _objectWithoutProperties(_ref, _excluded$1f);
491
492
  var _useState = React.useState(true),
492
493
  _useState2 = _slicedToArray(_useState, 2),
@@ -509,12 +510,22 @@
509
510
  if (popperRef.current) {
510
511
  popperRef.current.destroy();
511
512
  }
513
+ var modifiers = [];
514
+ if (typeof afterWrite === "function") {
515
+ modifiers.push({
516
+ phase: "afterWrite",
517
+ enabled: true,
518
+ name: "popper-after-write",
519
+ fn: afterWrite
520
+ });
521
+ }
512
522
  popperRef.current = core.createPopper(anchorEl, ownRef.current, {
513
523
  placement: placement,
514
524
  onFirstUpdate: handlePopperUpdate,
515
- strategy: strategy
525
+ strategy: strategy,
526
+ modifiers: modifiers
516
527
  });
517
- }, [anchorEl, open, placement, strategy]);
528
+ }, [afterWrite, anchorEl, open, placement, strategy]);
518
529
  var handleClose = function handleClose() {
519
530
  if (!popperRef.current) {
520
531
  return;
@@ -779,7 +790,8 @@
779
790
  popperClassName = _ref.popperClassName,
780
791
  backgroundElementClass = _ref.backgroundElementClass,
781
792
  _ref$windowAbsolutely = _ref.windowAbsolutelyPositioned,
782
- windowAbsolutelyPositioned = _ref$windowAbsolutely === void 0 ? false : _ref$windowAbsolutely;
793
+ windowAbsolutelyPositioned = _ref$windowAbsolutely === void 0 ? false : _ref$windowAbsolutely,
794
+ onPopperOpen = _ref.onPopperOpen;
783
795
  var _useState = React.useState(defaultOpen),
784
796
  _useState2 = _slicedToArray(_useState, 2),
785
797
  open = _useState2[0],
@@ -844,7 +856,8 @@
844
856
  open: childNode ? open : false,
845
857
  placement: position,
846
858
  className: popperClassName,
847
- tabIndex: -1
859
+ tabIndex: -1,
860
+ afterWrite: onPopperOpen
848
861
  }, /*#__PURE__*/React__default["default"].createElement(StyledMenu$2, {
849
862
  className: classNames__default["default"]("c-simple-menu__paper", "c-simple-menu__".concat(mode), menuClassName, className),
850
863
  $mode: mode,
@@ -11220,7 +11233,11 @@
11220
11233
  target: target,
11221
11234
  mode: mode,
11222
11235
  open: open,
11223
- position: position
11236
+ position: position,
11237
+ onPopperOpen: function onPopperOpen() {
11238
+ var _elementRef$current;
11239
+ return elementRef === null || elementRef === void 0 ? void 0 : (_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.focus();
11240
+ }
11224
11241
  };
11225
11242
  }
11226
11243
  return {
@@ -11281,7 +11298,6 @@
11281
11298
  ref: formRef
11282
11299
  }, /*#__PURE__*/React__default["default"].createElement(StyledSelectInput, {
11283
11300
  ref: handleRef,
11284
- autoFocus: true,
11285
11301
  placeholder: placeholder
11286
11302
  }), actionIcon && actionLabel && /*#__PURE__*/React__default["default"].createElement(Tooltip, {
11287
11303
  popperTooltipStyle: {