|
| 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-element'; |
| 9 | +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; |
| 10 | + |
| 11 | +export default { |
| 12 | + title: 'Components / mgt-file / Properties', |
| 13 | + component: 'mgt-file', |
| 14 | + decorators: [withCodeEditor] |
| 15 | +}; |
| 16 | + |
| 17 | +export const fileQuery = () => html` |
| 18 | + <mgt-file file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2"></mgt-file> |
| 19 | + `; |
| 20 | + |
| 21 | +export const fileViews = () => html` |
| 22 | + <mgt-file file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2" view="oneline"></mgt-file> |
| 23 | + <mgt-file file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2" view="twolines"></mgt-file> |
| 24 | + <mgt-file file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2" view="threelines"></mgt-file> |
| 25 | + `; |
| 26 | + |
| 27 | +export const setIcon = () => html` |
| 28 | + <mgt-file |
| 29 | + file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2" |
| 30 | + file-icon="https://github.com//microsoftgraph/microsoft-graph-toolkit/blob/main/assets/favicon.png?raw=true" |
| 31 | + ></mgt-file> |
| 32 | + `; |
| 33 | + |
| 34 | +export const getFileByDriveId = () => html` |
| 35 | + <mgt-file |
| 36 | + drive-id="b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd" |
| 37 | + item-id="01BYE5RZ5MYLM2SMX75ZBIPQZIHT6OAYPB" |
| 38 | + ></mgt-file> |
| 39 | + <mgt-file |
| 40 | + drive-id="b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd" |
| 41 | + item-path="Attachments" |
| 42 | + ></mgt-file> |
| 43 | + `; |
| 44 | + |
| 45 | +export const getFileByGroupId = () => html` |
| 46 | + <mgt-file group-id="02bd9fd6-8f93-4758-87c3-1fb73740a315" item-id="01XKNBVLNL4EWP43GPU5EY67UHT3DGKCWQ"></mgt-file> |
| 47 | + <mgt-file group-id="02bd9fd6-8f93-4758-87c3-1fb73740a315" item-path="Onboarding/Employee Handbook.docx"></mgt-file> |
| 48 | + `; |
| 49 | + |
| 50 | +export const getFileByListId = () => html` |
| 51 | + <mgt-file |
| 52 | + list-id="23f045a1-e6df-457c-8d95-a6ebd5feda5d" |
| 53 | + site-id="d82312f9-b23b-4cbc-95d5-3e0d94e68c1e" |
| 54 | + item-id="49"> |
| 55 | + </mgt-file> |
| 56 | + `; |
| 57 | + |
| 58 | +export const getSignedinUserFiles = () => html` |
| 59 | + <mgt-file item-id="01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K"></mgt-file> |
| 60 | + <mgt-file item-path="Class Documents/01. Organic Chemistry Header Image.jpg"></mgt-file> |
| 61 | + `; |
| 62 | + |
| 63 | +export const getFileBySiteId = () => html` |
| 64 | + <mgt-file |
| 65 | + site-id="m365x214355.sharepoint.com,5a58bb09-1fba-41c1-8125-69da264370a0,9f2ec1da-0be4-4a74-9254-973f0add78fd" |
| 66 | + item-id="01OXYKUGW6HG5WM2OBTVDZ72ABJAY5P4BY" |
| 67 | + ></mgt-file> |
| 68 | + <mgt-file |
| 69 | + site-id="m365x214355.sharepoint.com,5a58bb09-1fba-41c1-8125-69da264370a0,9f2ec1da-0be4-4a74-9254-973f0add78fd" |
| 70 | + item-Path="/DemoDocs/AdminDemo" |
| 71 | + ></mgt-file> |
| 72 | + `; |
| 73 | + |
| 74 | +export const getFileByUserId = () => html` |
| 75 | + <mgt-person user-id="e3d0513b-449e-4198-ba6f-bd97ae7cae85" view="twolines"></mgt-person> |
| 76 | + <mgt-file user-id="e3d0513b-449e-4198-ba6f-bd97ae7cae85" item-id="01HT2SVWU2EX3RVDWYAFAZDLCGYFZTCUHC"></mgt-file> |
| 77 | + <mgt-file user-id="e3d0513b-449e-4198-ba6f-bd97ae7cae85" item-path="Fashion Products v2.pdf"></mgt-file> |
| 78 | + `; |
| 79 | + |
| 80 | +export const getFileByInsights = () => html` |
| 81 | + <mgt-file |
| 82 | + insight-type="shared" |
| 83 | + insight-id="AW1GxMvkOztMkJX-SCppUSRPF5EvyPDHRZVAqtQZXI4JoUXwI9_mfEWNlabr1f7aXRBWDMt2C2FDop4fP1vsUw9tRsTL5Ds7TJCV_kgqaVEkBA" |
| 84 | + ></mgt-file> |
| 85 | + `; |
| 86 | + |
| 87 | +export const changeLineProperties = () => html` |
| 88 | + <mgt-file |
| 89 | + file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2" |
| 90 | + line1-property="lastModifiedDateTime" |
| 91 | + line2-property="size" |
| 92 | + line3-property="name" |
| 93 | + ></mgt-file> |
| 94 | + `; |
| 95 | + |
| 96 | +export const supplyDriveItem = () => html` |
| 97 | + <mgt-file |
| 98 | + class="my-file" |
| 99 | + line1-property="lastModifiedDateTime" |
| 100 | + line2-property="name" |
| 101 | + > |
| 102 | + </mgt-file> |
| 103 | + <script> |
| 104 | + const file = document.querySelector('.my-file'); |
| 105 | +
|
| 106 | + file.fileDetails = { |
| 107 | + size: 298990, |
| 108 | + name: "Sample Drive Item File", |
| 109 | + } |
| 110 | + </script> |
| 111 | + `; |
| 112 | + |
| 113 | +// export const mediaQuery = () => html` |
| 114 | +// <mgt-file file-query="/me/drive/items/01BYE5RZZFWGWWVNHHKVHYXE3OUJHGWCT2"></mgt-file> |
| 115 | +// <p id="file-media-query">Getting media query</p> |
| 116 | +// <script> |
| 117 | +// const mediaQuery = document.querySelector('mgt-file').ComponentMediaQuery; |
| 118 | +// console.log(mediaQuery) |
| 119 | +// const display = document.getElementById("file-media-query"); |
| 120 | +// display.innerHTML = mediaQuery; |
| 121 | + |
| 122 | +// </script> |
| 123 | +// `; |
0 commit comments