fds-vue-core 2.0.44 → 2.0.45
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FdsModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/FdsModal/FdsModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FdsModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/FdsModal/FdsModal.vue"],"names":[],"mappings":"AA+PA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AA8V5C,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA+BvD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;4EAInB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAY1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -3461,6 +3461,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3461
3461
|
const emit = __emit;
|
|
3462
3462
|
const isOpen = vue.ref(props.open);
|
|
3463
3463
|
let cleanupFocusTrap = null;
|
|
3464
|
+
const previouslyFocusedElement = vue.ref(null);
|
|
3464
3465
|
const hasFooterSlot = useHasSlot("modal-footer");
|
|
3465
3466
|
const modalOuterClasses = vue.computed(() => ["fixed top-0 left-0 w-full h-full overflow-auto z-100"]);
|
|
3466
3467
|
const modalInnerClasses = vue.computed(() => [
|
|
@@ -3510,6 +3511,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3510
3511
|
}
|
|
3511
3512
|
isOpen.value = false;
|
|
3512
3513
|
document.getElementsByTagName("html")[0].style.overflow = "auto";
|
|
3514
|
+
vue.nextTick(() => {
|
|
3515
|
+
if (previouslyFocusedElement.value) {
|
|
3516
|
+
previouslyFocusedElement.value.focus();
|
|
3517
|
+
previouslyFocusedElement.value = null;
|
|
3518
|
+
}
|
|
3519
|
+
});
|
|
3513
3520
|
emit("close");
|
|
3514
3521
|
emit("update:open", false);
|
|
3515
3522
|
};
|
|
@@ -3556,6 +3563,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3556
3563
|
(newValue) => {
|
|
3557
3564
|
isOpen.value = newValue;
|
|
3558
3565
|
if (newValue) {
|
|
3566
|
+
previouslyFocusedElement.value = document.activeElement;
|
|
3559
3567
|
if (props.lockScroll) {
|
|
3560
3568
|
document.getElementsByTagName("html")[0].style.overflow = "hidden";
|
|
3561
3569
|
}
|
|
@@ -3566,12 +3574,19 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3566
3574
|
cleanupFocusTrap();
|
|
3567
3575
|
cleanupFocusTrap = null;
|
|
3568
3576
|
}
|
|
3577
|
+
vue.nextTick(() => {
|
|
3578
|
+
if (previouslyFocusedElement.value) {
|
|
3579
|
+
previouslyFocusedElement.value.focus();
|
|
3580
|
+
previouslyFocusedElement.value = null;
|
|
3581
|
+
}
|
|
3582
|
+
});
|
|
3569
3583
|
}
|
|
3570
3584
|
}
|
|
3571
3585
|
);
|
|
3572
3586
|
vue.onMounted(() => {
|
|
3573
3587
|
document.addEventListener("keydown", handleKeyDown, true);
|
|
3574
3588
|
if (props.open) {
|
|
3589
|
+
previouslyFocusedElement.value = document.activeElement;
|
|
3575
3590
|
if (props.lockScroll) {
|
|
3576
3591
|
document.getElementsByTagName("html")[0].style.overflow = "hidden";
|
|
3577
3592
|
}
|