@wishbone-media/spark 0.12.1 → 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 = () => {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<div class="flex grow m-2.5 p-[10px] rounded-lg">
|
|
4
4
|
<nav class="flex flex-1 flex-col">
|
|
5
5
|
<ul class="flex flex-1 flex-col gap-y-7" role="list">
|
|
6
|
-
<li>
|
|
7
|
-
<ul role="list">
|
|
6
|
+
<li class="flex flex-1 flex-col">
|
|
7
|
+
<ul role="list" class="flex flex-1 flex-col">
|
|
8
8
|
<li class="flex items-center pb-8">
|
|
9
9
|
<a
|
|
10
10
|
class="grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<li
|
|
25
25
|
:class="{
|
|
26
26
|
'mt-[10px]': item.children,
|
|
27
|
+
'mt-auto': item.footerSection,
|
|
27
28
|
}"
|
|
28
29
|
>
|
|
29
30
|
<a
|
|
@@ -153,12 +154,12 @@
|
|
|
153
154
|
<spark-overlay
|
|
154
155
|
position="left"
|
|
155
156
|
:overlay-instance="sparkOverlayService.left"
|
|
156
|
-
@close="
|
|
157
|
+
@close="emit('overlayClose', 'left')"
|
|
157
158
|
/>
|
|
158
159
|
<spark-overlay
|
|
159
160
|
position="right"
|
|
160
161
|
:overlay-instance="sparkOverlayService.right"
|
|
161
|
-
@close="
|
|
162
|
+
@close="emit('overlayClose', 'right')"
|
|
162
163
|
/>
|
|
163
164
|
|
|
164
165
|
<spark-modal-container />
|
|
@@ -192,6 +193,8 @@ const props = defineProps({
|
|
|
192
193
|
},
|
|
193
194
|
})
|
|
194
195
|
|
|
196
|
+
const emit = defineEmits(['overlayClose'])
|
|
197
|
+
|
|
195
198
|
const slots = useSlots()
|
|
196
199
|
|
|
197
200
|
const sparkBrandFilterStore = useSparkBrandFilterStore()
|
|
@@ -227,7 +230,6 @@ const toggleBrandSelector = () => {
|
|
|
227
230
|
{
|
|
228
231
|
select: (brand) => {
|
|
229
232
|
sparkBrandFilterStore.toggleBrand(brand)
|
|
230
|
-
sparkOverlayService.closeLeft()
|
|
231
233
|
},
|
|
232
234
|
},
|
|
233
235
|
)
|