@fy-/fws-vue 0.0.920 → 0.0.922

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.
@@ -12,7 +12,7 @@ import {
12
12
  } from "@heroicons/vue/24/solid";
13
13
  import DefaultPaging from "./DefaultPaging.vue";
14
14
  import type { Component } from "vue";
15
- const isOpen = ref<boolean>(false);
15
+ const isGalleryOpen = ref<boolean>(false);
16
16
  const eventBus = useEventBus();
17
17
  const sidePanel = ref<boolean>(true);
18
18
  const props = withDefaults(
@@ -62,7 +62,7 @@ const setModal = (value: boolean) => {
62
62
  } else {
63
63
  if (props.onClose) props.onClose();
64
64
  }
65
- isOpen.value = value;
65
+ isGalleryOpen.value = value;
66
66
  };
67
67
  const openGalleryImage = (index: number | undefined) => {
68
68
  if (index === undefined) modelValue.value = 0;
@@ -140,9 +140,13 @@ const handleKeyboardRelease = (event: KeyboardEvent) => {
140
140
  isKeyPressed.value = false;
141
141
  }
142
142
  };
143
+ const closeGallery = () => {
144
+ setModal(false);
145
+ };
143
146
  onMounted(() => {
144
147
  eventBus.on(`${props.id}GalleryImage`, openGalleryImage);
145
148
  eventBus.on(`${props.id}Gallery`, openGalleryImage);
149
+ eventBus.on(`${props.id}GalleryClose`, closeGallery);
146
150
  if (window !== undefined && !import.meta.env.SSR) {
147
151
  window.addEventListener("keydown", handleKeyboardInput);
148
152
  window.addEventListener("keyup", handleKeyboardRelease);
@@ -151,6 +155,7 @@ onMounted(() => {
151
155
  onUnmounted(() => {
152
156
  eventBus.off(`${props.id}Gallery`, openGalleryImage);
153
157
  eventBus.off(`${props.id}GalleryImage`, openGalleryImage);
158
+ eventBus.off(`${props.id}GalleryClose`, closeGallery);
154
159
  if (window !== undefined && !import.meta.env.SSR) {
155
160
  window.removeEventListener("keydown", handleKeyboardInput);
156
161
  window.removeEventListener("keyup", handleKeyboardRelease);
@@ -160,7 +165,7 @@ onUnmounted(() => {
160
165
  <template>
161
166
  <div>
162
167
  <TransitionRoot
163
- :show="isOpen"
168
+ :show="isGalleryOpen"
164
169
  as="template"
165
170
  enter="duration-300 ease-out"
166
171
  enter-from="opacity-0"
@@ -170,7 +175,7 @@ onUnmounted(() => {
170
175
  leave-to="opacity-0"
171
176
  >
172
177
  <Dialog
173
- :open="isOpen"
178
+ :open="isGalleryOpen"
174
179
  @close="setModal"
175
180
  class="fixed bg-fv-neutral-900 text-white inset-0 max-w-[100vw] overflow-y-auto overflow-x-hidden"
176
181
  style="z-index: 37"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.0.920",
3
+ "version": "0.0.922",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {