@auronui/vue 1.0.16 → 1.0.17

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.
@@ -15474,6 +15474,19 @@ var SelectTrigger_default = /* @__PURE__ */ (0, vue.defineComponent)({
15474
15474
  return v !== "";
15475
15475
  });
15476
15476
  const showInsideLabel = (0, vue.computed)(() => ctx.hasLabel.value && ctx.labelPlacement.value === "inside");
15477
+ const skipNextFocus = (0, vue.ref)(false);
15478
+ (0, vue.watch)(() => rootContext.open.value, (open, wasOpen) => {
15479
+ if (!open && wasOpen) {
15480
+ skipNextFocus.value = true;
15481
+ setTimeout(() => {
15482
+ skipNextFocus.value = false;
15483
+ }, 0);
15484
+ }
15485
+ }, { flush: "sync" });
15486
+ function handleFocus() {
15487
+ if (ctx.isDisabled.value || ctx.isReadonly.value || skipNextFocus.value || rootContext.open.value) return;
15488
+ rootContext.onOpenChange(true);
15489
+ }
15477
15490
  return (_ctx, _cache) => {
15478
15491
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(reka_ui.SelectTrigger), {
15479
15492
  id: (0, vue.unref)(ctx).triggerId.value,
@@ -15483,7 +15496,8 @@ var SelectTrigger_default = /* @__PURE__ */ (0, vue.defineComponent)({
15483
15496
  "data-readonly": (0, vue.unref)(ctx).isReadonly.value || void 0,
15484
15497
  "aria-invalid": (0, vue.unref)(ctx).isInvalid.value || void 0,
15485
15498
  "aria-describedby": (0, vue.unref)(ctx).ariaDescribedBy.value,
15486
- "data-slot": "trigger"
15499
+ "data-slot": "trigger",
15500
+ onFocus: handleFocus
15487
15501
  }, {
15488
15502
  default: (0, vue.withCtx)(() => [
15489
15503
  showInsideLabel.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", {
@@ -15659,6 +15673,9 @@ var SelectContent_default = /* @__PURE__ */ (0, vue.defineComponent)({
15659
15673
  }, 100);
15660
15674
  }
15661
15675
  });
15676
+ function handleKeydown(e) {
15677
+ if (e.key === "Tab") rootContext.onOpenChange(false);
15678
+ }
15662
15679
  return (_ctx, _cache) => {
15663
15680
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(reka_ui.SelectPortal), null, {
15664
15681
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(AnimatePresence_default), null, {
@@ -15676,7 +15693,8 @@ var SelectContent_default = /* @__PURE__ */ (0, vue.defineComponent)({
15676
15693
  opacity: 0,
15677
15694
  scale: .95
15678
15695
  },
15679
- transition: { duration: .15 }
15696
+ transition: { duration: .15 },
15697
+ onKeydown: handleKeydown
15680
15698
  }, {
15681
15699
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(reka_ui.SelectViewport), { "data-slot": "list-box" }, {
15682
15700
  default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),