File tree Expand file tree Collapse file tree 5 files changed +13
-3
lines changed
mgt-components/src/components/mgt-file-list
stories/components/fileList Expand file tree Collapse file tree 5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -403,6 +403,11 @@ export class MgtFileList extends MgtTemplatedComponent implements CardSection {
403403 void this . requestStateUpdate ( true ) ;
404404 }
405405
406+ @property ( {
407+ attribute : 'disable-open-on-click' ,
408+ type : Boolean
409+ } )
410+ public disableOpenOnClick = false ;
406411 /**
407412 * A boolean value indication if 'show-more' button should be disabled
408413 *
@@ -1007,7 +1012,7 @@ export class MgtFileList extends MgtTemplatedComponent implements CardSection {
10071012 }
10081013
10091014 private handleFileClick ( file : DriveItem ) {
1010- if ( file ?. webUrl ) {
1015+ if ( file ?. webUrl && ! this . disableOpenOnClick ) {
10111016 window . open ( file . webUrl , '_blank' , 'noreferrer' ) ;
10121017 }
10131018 }
Original file line number Diff line number Diff line change 88// THIS FILE IS AUTO GENERATED
99// ANY CHANGES WILL BE LOST DURING BUILD
1010
11- export const PACKAGE_VERSION = '3.0 .1' ;
11+ export const PACKAGE_VERSION = '3.1 .1' ;
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export type FileListProps = {
5858 itemView ?: ViewType ;
5959 fileExtensions ?: string [ ] ;
6060 pageSize ?: number ;
61+ disableOpenOnClick ?: boolean ;
6162 hideMoreFilesButton ?: boolean ;
6263 maxFileSize ?: number ;
6364 enableFileUpload ?: boolean ;
Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ export const getFileListByExtensions = () => html`
9494 < mgt-file-list file-extensions ="docx, xlsx "> </ mgt-file-list >
9595 ` ;
9696
97+ export const disableOpenOnClick = ( ) => html `
98+ < mgt-file-list disable-open-on-click > </ mgt-file-list >
99+ ` ;
100+
97101export const disableFileExpansion = ( ) => html `
98102 < mgt-file-list hide-more-files-button > </ mgt-file-list >
99103 ` ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export const localization = () => html`
5151export const events = ( ) => html `
5252 < p > Clicked File:</ p >
5353 < mgt-file > </ mgt-file >
54- < mgt-file-list > </ mgt-file-list >
54+ < mgt-file-list disable-open-on-click > </ mgt-file-list >
5555 < script >
5656 document . querySelector ( 'mgt-file-list' ) . addEventListener ( 'itemClick' , e => {
5757 const file = document . querySelector ( 'mgt-file' ) ;
You can’t perform that action at this time.
0 commit comments