@wishbone-media/spark 0.13.0 → 0.13.1
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Dialog
|
|
4
4
|
:initialFocus="panelRef"
|
|
5
5
|
class="relative z-200"
|
|
6
|
-
@close="
|
|
6
|
+
@close="handleClose"
|
|
7
7
|
>
|
|
8
8
|
<TransitionChild
|
|
9
9
|
as="template"
|
|
@@ -57,7 +57,7 @@ import { Dialog, DialogPanel, TransitionChild, TransitionRoot } from '@headlessu
|
|
|
57
57
|
|
|
58
58
|
const panelRef = ref(null)
|
|
59
59
|
|
|
60
|
-
defineProps({
|
|
60
|
+
const props = defineProps({
|
|
61
61
|
position: {
|
|
62
62
|
type: String,
|
|
63
63
|
required: true,
|
|
@@ -69,4 +69,11 @@ defineProps({
|
|
|
69
69
|
required: true,
|
|
70
70
|
},
|
|
71
71
|
})
|
|
72
|
+
|
|
73
|
+
const emit = defineEmits(['close'])
|
|
74
|
+
|
|
75
|
+
const handleClose = () => {
|
|
76
|
+
props.overlayInstance.close()
|
|
77
|
+
emit('close')
|
|
78
|
+
}
|
|
72
79
|
</script>
|
|
@@ -7,11 +7,29 @@ class SparkOverlayService {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
showLeft = (component, props = {}, eventHandlers = {}) => {
|
|
10
|
-
|
|
10
|
+
const handlers = {
|
|
11
|
+
close: () => {
|
|
12
|
+
// Call user's close handler if provided
|
|
13
|
+
eventHandlers.close?.()
|
|
14
|
+
// Then close the overlay
|
|
15
|
+
this.closeLeft()
|
|
16
|
+
},
|
|
17
|
+
...eventHandlers,
|
|
18
|
+
}
|
|
19
|
+
this.left.show(component, props, handlers)
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
showRight = (component, props = {}, eventHandlers = {}) => {
|
|
14
|
-
|
|
23
|
+
const handlers = {
|
|
24
|
+
close: () => {
|
|
25
|
+
// Call user's close handler if provided
|
|
26
|
+
eventHandlers.close?.()
|
|
27
|
+
// Then close the overlay
|
|
28
|
+
this.closeRight()
|
|
29
|
+
},
|
|
30
|
+
...eventHandlers,
|
|
31
|
+
}
|
|
32
|
+
this.right.show(component, props, handlers)
|
|
15
33
|
}
|
|
16
34
|
|
|
17
35
|
closeLeft = () => {
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
<spark-overlay
|
|
155
155
|
position="left"
|
|
156
156
|
:overlay-instance="sparkOverlayService.left"
|
|
157
|
-
@close="
|
|
157
|
+
@close="emit('overlayClose', 'left')"
|
|
158
158
|
/>
|
|
159
159
|
<spark-overlay
|
|
160
160
|
position="right"
|
|
161
161
|
:overlay-instance="sparkOverlayService.right"
|
|
162
|
-
@close="
|
|
162
|
+
@close="emit('overlayClose', 'right')"
|
|
163
163
|
/>
|
|
164
164
|
|
|
165
165
|
<spark-modal-container />
|
|
@@ -193,6 +193,8 @@ const props = defineProps({
|
|
|
193
193
|
},
|
|
194
194
|
})
|
|
195
195
|
|
|
196
|
+
const emit = defineEmits(['overlayClose'])
|
|
197
|
+
|
|
196
198
|
const slots = useSlots()
|
|
197
199
|
|
|
198
200
|
const sparkBrandFilterStore = useSparkBrandFilterStore()
|
|
@@ -228,7 +230,6 @@ const toggleBrandSelector = () => {
|
|
|
228
230
|
{
|
|
229
231
|
select: (brand) => {
|
|
230
232
|
sparkBrandFilterStore.toggleBrand(brand)
|
|
231
|
-
sparkOverlayService.closeLeft()
|
|
232
233
|
},
|
|
233
234
|
},
|
|
234
235
|
)
|