@economic/taco 2.65.0-alpha.0 → 2.65.0-alt-tab-popover-focus.0

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/taco.js CHANGED
@@ -9845,8 +9845,25 @@ function isElementTriggeredFromContainer(element, container) {
9845
9845
  }
9846
9846
  return false;
9847
9847
  }
9848
+ const isDialogOpenedFromContainer = (element, container) => {
9849
+ if (!container) {
9850
+ return false;
9851
+ }
9852
+ let currentDialog = element == null ? void 0 : element.closest('[role="dialog"]');
9853
+ while (currentDialog == null ? void 0 : currentDialog.id) {
9854
+ const opener = document.querySelector(`[aria-controls="${currentDialog.id}"]`);
9855
+ if (!opener) {
9856
+ return false;
9857
+ }
9858
+ if (container.contains(opener)) {
9859
+ return true;
9860
+ }
9861
+ currentDialog = opener.closest('[role="dialog"]');
9862
+ }
9863
+ return false;
9864
+ };
9848
9865
  function isElementInsideOrTriggeredFromContainer(element, container) {
9849
- return isElementTriggeredFromContainer(element, container) || !!(container == null ? void 0 : container.contains(element));
9866
+ return isElementTriggeredFromContainer(element, container) || !!(container == null ? void 0 : container.contains(element)) || isDialogOpenedFromContainer(element, container);
9850
9867
  }
9851
9868
  function isElementInsideOverlay(element) {
9852
9869
  return !!(element == null ? void 0 : element.closest("[role=dialog],[role=menu]"));
@@ -18467,7 +18484,7 @@ const useCombobox = (props, ref) => {
18467
18484
  React.useEffect(() => {
18468
18485
  const isCurrentValue = value !== void 0 && value !== null && inputValue === String(value);
18469
18486
  if (inputValue && data.length && !isCurrentValue) {
18470
- setCurrentIndex(0);
18487
+ setCurrentIndex(getIndexFromValue(data, inputValue) || 0);
18471
18488
  if (!open) {
18472
18489
  setOpen(true);
18473
18490
  }
@@ -25731,6 +25748,13 @@ const Dialog = React.forwardRef(function Dialog2(props, ref) {
25731
25748
  }),
25732
25749
  [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]
25733
25750
  );
25751
+ React.useEffect(() => {
25752
+ const onFocusOut = (event) => {
25753
+ event.stopImmediatePropagation();
25754
+ };
25755
+ document.addEventListener("focusout", onFocusOut);
25756
+ return () => document.removeEventListener("focusout", onFocusOut);
25757
+ }, []);
25734
25758
  return /* @__PURE__ */ React.createElement(DialogContext.Provider, { value: context }, /* @__PURE__ */ React.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { defaultOpen, open, onOpenChange: onChange }, trigger && /* @__PURE__ */ React.createElement(Trigger$4, null, trigger), children));
25735
25759
  });
25736
25760
  Dialog.Trigger = Trigger$4;
@@ -55434,7 +55458,9 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
55434
55458
  return completed;
55435
55459
  }
55436
55460
  async function discardChanges(rowId, table) {
55437
- table.resetRowPinning(true);
55461
+ if (rowId.startsWith(TEMPORARY_ROW_ID_PREFIX)) {
55462
+ table.resetRowPinning(true);
55463
+ }
55438
55464
  dispatch({
55439
55465
  type: "removeRow",
55440
55466
  rowId,