@@ -13,7 +13,7 @@ import {
1313 ProviderState
1414} from '@microsoft/mgt-element' ;
1515import { DriveItem } from '@microsoft/microsoft-graph-types' ;
16- import { customElement , html , property , TemplateResult } from 'lit-element' ;
16+ import { customElement , html , internalProperty , property , TemplateResult } from 'lit-element' ;
1717import { repeat } from 'lit-html/directives/repeat' ;
1818import {
1919 clearFilesCache ,
@@ -40,6 +40,8 @@ import { styles } from './mgt-file-list-css';
4040import { strings } from './strings' ;
4141import { MgtFile } from '../mgt-file/mgt-file' ;
4242
43+ export { FluentDesignSystemProvider , FluentProgressRing } from '@fluentui/web-components' ;
44+
4345/**
4446 * The File List component displays a list of multiple folders and files by
4547 * using the file/folder name, an icon, and other properties specicified by the developer.
@@ -69,6 +71,7 @@ import { MgtFile } from '../mgt-file/mgt-file';
6971 * @cssprop --show-more-button-padding - {String} Show more button padding
7072 * @cssprop --show-more-button-border-bottom-right-radius - {String} Show more button bottom right radius
7173 * @cssprop --show-more-button-border-bottom-left-radius - {String} Show more button bottom left radius
74+ * @cssprop --progress-ring-size -{String} Progress ring height and width
7275 */
7376
7477@customElement ( 'mgt-file-list' )
@@ -400,6 +403,8 @@ export class MgtFileList extends MgtTemplatedComponent {
400403 // tracking user arrow key input of selection for accessibility purpose
401404 private _focusedItemIndex : number = - 1 ;
402405
406+ @internalProperty ( ) private _isLoadingMore : boolean ;
407+
403408 constructor ( ) {
404409 super ( ) ;
405410
@@ -525,9 +530,11 @@ export class MgtFileList extends MgtTemplatedComponent {
525530 * @memberof MgtFileList
526531 */
527532 protected renderMoreFileButton ( ) : TemplateResult {
528- if ( this . isLoadingState ) {
533+ if ( this . _isLoadingMore ) {
529534 return html `
530- < mgt-spinner > </ mgt-spinner >
535+ < fluent-design-system-provider use-defaults >
536+ < fluent-progress-ring role ="progressbar " viewBox ="0 0 8 8 " class ="progress-ring "> </ fluent-progress-ring >
537+ </ fluent-design-system-provider >
531538 ` ;
532539 } else {
533540 return html `< a id ="show-more " class ="show-more " @click =${ ( ) => this . renderNextPage ( ) } tabindex ="0" @keydown=${
@@ -768,28 +775,6 @@ export class MgtFileList extends MgtTemplatedComponent {
768775 * @memberof MgtFileList
769776 */
770777 protected async renderNextPage ( ) {
771- const root = this . renderRoot . querySelector ( 'file-list-wrapper' ) ;
772- if ( root && root . animate ) {
773- // play back
774- root . animate (
775- [
776- {
777- height : 'auto' ,
778- transformOrigin : 'top left'
779- } ,
780- {
781- height : 'auto' ,
782- transformOrigin : 'top left'
783- }
784- ] ,
785- {
786- duration : 1000 ,
787- easing : 'ease-in-out' ,
788- fill : 'both'
789- }
790- ) ;
791- }
792-
793778 // render next page from cache if exists, or else use iterator
794779 if ( this . _preloadedFiles . length > 0 ) {
795780 this . files = [
@@ -798,7 +783,30 @@ export class MgtFileList extends MgtTemplatedComponent {
798783 ] ;
799784 } else {
800785 if ( this . pageIterator . hasNext ) {
786+ this . _isLoadingMore = true ;
787+ const root = this . renderRoot . querySelector ( 'file-list-wrapper' ) ;
788+ if ( root && root . animate ) {
789+ // play back
790+ root . animate (
791+ [
792+ {
793+ height : 'auto' ,
794+ transformOrigin : 'top left'
795+ } ,
796+ {
797+ height : 'auto' ,
798+ transformOrigin : 'top left'
799+ }
800+ ] ,
801+ {
802+ duration : 1000 ,
803+ easing : 'ease-in-out' ,
804+ fill : 'both'
805+ }
806+ ) ;
807+ }
801808 await fetchNextAndCacheForFilesPageIterator ( this . pageIterator ) ;
809+ this . _isLoadingMore = false ;
802810 this . files = this . pageIterator . value ;
803811 }
804812 }
0 commit comments