File tree Expand file tree Collapse file tree 2 files changed +13
-19
lines changed
src/routes/components/facets/examples Expand file tree Collapse file tree 2 files changed +13
-19
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { writable } from ' svelte/store' ;
3+
24 import CodeContainer from ' $docs/components/CodeContainer.svelte' ;
35 import Facets from ' $lib/components/Facets/Facets.svelte' ;
46 import { facetsNoGroupSelectionData , facetsGroupSelectionSvelte } from ' ../data/codeBlocks' ;
57 import { groups } from ' ../data/data' ;
68
7- let selected = {
8- Mediums: [],
9- Genres: [],
10- Authors: []
11- };
12-
13- let selectedGroups = {
14- Mediums: true ,
15- Genres: false ,
16- Authors: false
17- };
9+ const groupsStore = writable (groups );
1810 </script >
1911
2012<div id =" facetsGroupSelection" >
2315 svelte ={facetsGroupSelectionSvelte }
2416 data ={facetsNoGroupSelectionData }
2517 >
26- <Facets { groups } bind:selected bind:selectedGroups groupSelection open />
18+ <Facets groups ={ groupsStore } groupSelection open on:change ={( e ) => console . log ( e )} />
2719 </CodeContainer >
2820</div >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { writable } from ' svelte/store' ;
3+
24 import CodeContainer from ' $docs/components/CodeContainer.svelte' ;
35 import Facets from ' $lib/components/Facets/Facets.svelte' ;
46 import { facetsNoGroupSelectionData , facetsNoGroupSelectionSvelte } from ' ../data/codeBlocks' ;
57 import { groups } from ' ../data/data' ;
68
7- let selected = {
8- Mediums: [],
9- Genres: [],
10- Authors: []
11- };
9+ const groupsStore = writable (groups );
1210 </script >
1311
1412<div id =" facetsNoGroupSelection" >
15- <CodeContainer title ="No group selection, closed by default and all options displayed in UI" svelte ={facetsNoGroupSelectionSvelte } data ={facetsNoGroupSelectionData }>
16- <Facets {groups } bind:selected showAll />
13+ <CodeContainer
14+ title =" No group selection, closed by default and all options displayed in UI"
15+ svelte ={facetsNoGroupSelectionSvelte }
16+ data ={facetsNoGroupSelectionData }
17+ >
18+ <Facets groups ={groupsStore } showAll on:change ={(e ) => console .log (e )} />
1719 </CodeContainer >
1820</div >
You can’t perform that action at this time.
0 commit comments