File tree 2 files changed +34
-7
lines changed
2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 59
59
<div class =" row" >
60
60
<aside >
61
61
<div class =" menu-box" >
62
- <h4 >Navigation</h4 >
62
+ <h4 >Navigation</h4 >
63
63
<nav class =" side-nav" >
64
64
<ul >
65
65
<li ><a href =" /" >Home</a ></li >
66
66
<li ><a href =" /date-picker" >Date Picker</a ></li >
67
67
<li ><a href =" /range-picker" >Range Picker</a ></li >
68
- </ul >
68
+ </ul >
69
69
</nav >
70
70
</div >
71
71
</aside >
273
273
range ={true }
274
274
time ={true }
275
275
on:range-selected ={e => {
276
+ console .log (e )
276
277
firedEvents = [
277
278
... firedEvents ,
278
279
` Picked range ${e .detail .from } to ${e .detail .to } `
314
315
<div class =" container" >
315
316
<div class =" row" >
316
317
<div class =" col-lg-12 center" >
317
-
318
+
318
319
</div >
319
320
</div >
320
321
</div >
446
447
background-position : 100% ;
447
448
}
448
449
}
449
- </style >
450
+ </style >
Original file line number Diff line number Diff line change 1
1
<script >
2
- import { onMount } from ' svelte'
2
+ import { createEventDispatcher , onMount } from ' svelte'
3
3
import DatePickerInner from ' ./DatePickerInner.svelte'
4
4
import { setLoadingCursor } from ' ./lib/context'
5
5
9
9
await setLoadingCursor ()
10
10
ready = true
11
11
})
12
+
13
+ /**
14
+ * ! WARNING
15
+ *
16
+ * The only events forwarded here are the ones we are currently using in
17
+ * Real Rev...
18
+ *
19
+ * Forwarding both Date and Date Range events bricked our build.
20
+ */
21
+ const dispatch = createEventDispatcher ()
22
+ function forwardEvent (event ) {
23
+ console .log (' Forwarding event:' , event .type )
24
+ dispatch (event .type , event .detail )
25
+ }
12
26
</script >
13
27
14
28
{#if ready }
15
29
{#if $$slots .default }
16
- <DatePickerInner {...$$props } on: *>
30
+ <DatePickerInner {...$$restProps }
31
+ on:range-selected ={forwardEvent }
32
+ on:open ={forwardEvent }
33
+ on:close ={forwardEvent }
34
+ on:updateStart ={forwardEvent }
35
+ on:updateEnd ={forwardEvent }
36
+ >
17
37
<slot />
18
38
</DatePickerInner >
19
39
{:else }
20
- <DatePickerInner {...$$props } on: * />
40
+ <DatePickerInner {...$$restProps }
41
+ on:range-selected ={forwardEvent }
42
+ on:open ={forwardEvent }
43
+ on:close ={forwardEvent }
44
+ on:updateStart ={forwardEvent }
45
+ on:updateEnd ={forwardEvent }
46
+ />
21
47
{/if }
22
48
{/if }
You can’t perform that action at this time.
0 commit comments