File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
stories/components/searchResults Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * -------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4
+ * See License in the project root for license information.
5
+ * -------------------------------------------------------------------------------------------
6
+ */
7
+
8
+ import { html } from 'lit' ;
9
+ import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon' ;
10
+
11
+ export default {
12
+ title : 'Components / mgt-search-results / Templating' ,
13
+ component : 'search-results' ,
14
+ decorators : [ withCodeEditor ]
15
+ } ;
16
+
17
+ export const DefaultTemplates = ( ) => html `
18
+ < mgt-search-results query-string ="contoso " entity-types ="site ">
19
+ < template data-type ="default ">
20
+ < div data-for ="result in value[0].hitsContainers[0].hits ">
21
+ < div class ="displayName "> {{result.resource.displayName}}</ div >
22
+ </ div >
23
+ </ template >
24
+ < template data-type ="loading ">
25
+ Loading
26
+ </ template >
27
+ </ mgt-search-results >
28
+ ` ;
29
+
30
+ export const noDataTemplate = ( ) => html `
31
+ < div >
32
+ < div > No data template</ div >
33
+ < mgt-search-results query-string ="xyxy " entity-types ="driveItem ">
34
+ < template data-type ="no-data ">
35
+ < div > No results found</ div >
36
+ </ template >
37
+ </ mgt-search-results >
38
+ </ div >
39
+ ` ;
You can’t perform that action at this time.
0 commit comments