sit-onyx 1.4.0-dev-20251111093451 → 1.4.0-dev-20251111161847

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.
@@ -878,12 +878,42 @@ const useOutsideClick = ({
878
878
  };
879
879
  useGlobalEventListener({ type: "mousedown", listener: clickListener, disabled });
880
880
  if (checkOnTab) {
881
- const keydownListener = async (event) => {
881
+ const keydownListener = (event) => {
882
882
  if (event.key !== "Tab") return;
883
- await new Promise((resolve) => setTimeout(resolve));
884
883
  if (isOutsideClick(document.activeElement)) {
885
884
  onOutsideClick(event);
886
885
  }
886
+ const controller = new AbortController();
887
+ const { signal } = controller;
888
+ const onFocusIn = (event2) => {
889
+ const target = event2.target;
890
+ if (isOutsideClick(target)) {
891
+ onOutsideClick(event2);
892
+ }
893
+ controller.abort();
894
+ };
895
+ const onWindowBlur = (event2) => {
896
+ if (isOutsideClick(document.activeElement)) {
897
+ onOutsideClick(event2);
898
+ }
899
+ controller.abort();
900
+ };
901
+ const onKeyUp = (e) => {
902
+ if (e.key === "Tab") controller.abort();
903
+ };
904
+ document.addEventListener("focusin", onFocusIn, {
905
+ once: true,
906
+ capture: true,
907
+ // Capture phase to handle before component focus handlers
908
+ signal
909
+ });
910
+ window.addEventListener("blur", onWindowBlur, { once: true, signal });
911
+ document.addEventListener("keyup", onKeyUp, {
912
+ once: true,
913
+ capture: true,
914
+ // Capture phase to prevent conflicts with prevented keydown
915
+ signal
916
+ });
887
917
  };
888
918
  useGlobalEventListener({ type: "keydown", listener: keydownListener, disabled });
889
919
  }
@@ -7084,7 +7114,7 @@ function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
7084
7114
  return openBlock(), createElementBlock(
7085
7115
  "div",
7086
7116
  {
7087
- class: "onyx-table-wrapper onyx-component",
7117
+ class: normalizeClass(["onyx-component", "onyx-table-wrapper", $setup.densityClass]),
7088
7118
  style: normalizeStyle($setup.style)
7089
7119
  },
7090
7120
  [
@@ -7105,14 +7135,15 @@ function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
7105
7135
  }, $props.scrollContainerAttrs), [
7106
7136
  createElementVNode("table", {
7107
7137
  ref: "tableRef",
7108
- class: normalizeClass(["onyx-table onyx-text", [
7138
+ class: normalizeClass([
7139
+ "onyx-table",
7140
+ "onyx-text",
7141
+ `onyx-table--cell-truncation-${$setup.props.truncation}`,
7109
7142
  {
7110
7143
  "onyx-table--striped": $setup.props.striped,
7111
- "onyx-table--vertical-borders": $setup.props.withVerticalBorders,
7112
- [`onyx-table--cell-truncation-${$setup.props.truncation}`]: true
7113
- },
7114
- $setup.densityClass
7115
- ]]),
7144
+ "onyx-table--vertical-borders": $setup.props.withVerticalBorders
7145
+ }
7146
+ ]),
7116
7147
  "aria-labelledby": $setup.headlineId
7117
7148
  }, [
7118
7149
  (openBlock(true), createElementBlock(
@@ -7180,8 +7211,8 @@ function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
7180
7211
  ])
7181
7212
  ])) : createCommentVNode("v-if", true)
7182
7213
  ],
7183
- 4
7184
- /* STYLE */
7214
+ 6
7215
+ /* CLASS, STYLE */
7185
7216
  );
7186
7217
  }
7187
7218
  const OnyxTable = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$Y], ["__file", "/home/runner/work/onyx/onyx/packages/sit-onyx/src/components/OnyxTable/OnyxTable.vue"]]);