mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
Move properties container and loading spinner to common components (#10058)
* Move properties container and loading spinner to common components * Fix compile error * Fix tests
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/loadingComponent';
|
||||
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import * as nls from 'vs/nls';
|
||||
import { status } from 'vs/base/browser/ui/aria/aria';
|
||||
|
||||
const DefaultLoadingMessage = nls.localize('loadingMessage', "Loading");
|
||||
const DefaultLoadingCompletedMessage = nls.localize('loadingCompletedMessage', "Loading completed");
|
||||
|
||||
@Component({
|
||||
selector: 'loading-spinner',
|
||||
template: `
|
||||
<div class="modelview-loadingComponent-container" *ngIf="loading">
|
||||
<div class="modelview-loadingComponent-spinner" *ngIf="loading" [title]="_loadingMessage" #spinnerElement></div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export default class LoadingSpinner implements OnChanges {
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes.loading !== undefined) {
|
||||
const message = this.loading ? this._loadingMessage : this._loadingCompletedMessage;
|
||||
status(message);
|
||||
}
|
||||
}
|
||||
|
||||
get _loadingMessage(): string {
|
||||
return this.loadingMessage ? this.loadingMessage : DefaultLoadingMessage;
|
||||
}
|
||||
|
||||
get _loadingCompletedMessage(): string {
|
||||
return this.loadingCompletedMessage ? this.loadingCompletedMessage : DefaultLoadingCompletedMessage;
|
||||
}
|
||||
|
||||
@Input()
|
||||
loading: boolean;
|
||||
|
||||
@Input()
|
||||
loadingMessage: string;
|
||||
|
||||
@Input()
|
||||
loadingCompletedMessage: string;
|
||||
}
|
||||
Reference in New Issue
Block a user