feat(ui): Added loader inside ui-lib. (TV-859)
Squashed commit of the following: commit 21101f1de202e87c27ae7832669e484d163e66b4 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Oct 28 11:01:09 2021 +0200 Updated imports commit 0d8bee6ac8967f5ddb480eff429e91db812b0f16 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Oct 28 10:42:35 2021 +0200 Now using loader from inside libs
This commit is contained in:
@@ -31,5 +31,5 @@
|
||||
Vald handledare har uppdaterats
|
||||
</digi-form-validation-message>
|
||||
</div>
|
||||
<msfa-loader *ngIf="submitHandledareLoading$ | async" size="s" type="absolute"></msfa-loader>
|
||||
<ui-loader *ngIf="submitHandledareLoading$ | async" uiSize="s" uiType="absolute"></ui-loader>
|
||||
</form>
|
||||
|
||||
@@ -2,13 +2,13 @@ import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { LoaderModule } from '../loader/loader.module';
|
||||
import { UiLoaderModule } from '@ui/loader/loader.module';
|
||||
import { HandledarePickerFormComponent } from './handledare-picker-form.component';
|
||||
|
||||
@NgModule({
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [HandledarePickerFormComponent],
|
||||
imports: [CommonModule, ReactiveFormsModule, LoaderModule, DigiNgFormSelectModule],
|
||||
imports: [CommonModule, ReactiveFormsModule, UiLoaderModule, DigiNgFormSelectModule],
|
||||
exports: [HandledarePickerFormComponent],
|
||||
})
|
||||
export class HandledarePickerFormModule {}
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
<msfa-footer class="msfa__footer"></msfa-footer>
|
||||
</div>
|
||||
|
||||
<msfa-loader *ngIf="(userLoading$ | async) || (rolesLoading$ | async)" type="full-screen"></msfa-loader>
|
||||
<ui-loader *ngIf="(userLoading$ | async) || (rolesLoading$ | async)" uiType="full-screen"></ui-loader>
|
||||
|
||||
@@ -3,8 +3,8 @@ import { CommonModule } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { UiLoaderModule } from '@ui/loader/loader.module';
|
||||
import { MarkdownModule } from 'ngx-markdown';
|
||||
import { LoaderModule } from '../loader/loader.module';
|
||||
import { FooterModule } from './components/footer/footer.module';
|
||||
import { NavigationModule } from './components/navigation/navigation.module';
|
||||
import { SidebarModule } from './components/sidebar/sidebar.module';
|
||||
@@ -23,7 +23,7 @@ import { LayoutComponent } from './layout.component';
|
||||
FooterModule,
|
||||
MarkdownModule.forRoot({ loader: HttpClient }),
|
||||
DigiNgNavigationBreadcrumbsModule,
|
||||
LoaderModule,
|
||||
UiLoaderModule,
|
||||
],
|
||||
exports: [LayoutComponent],
|
||||
})
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<div [ngClass]="loaderClass">
|
||||
<digi-icon-spinner [ngClass]="spinnerClass"></digi-icon-spinner>
|
||||
</div>
|
||||
@@ -1,40 +0,0 @@
|
||||
@import 'mixins/backdrop';
|
||||
@import 'variables/gutters';
|
||||
@import 'variables/z-index';
|
||||
|
||||
@keyframes spinning {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&--padded {
|
||||
padding: $digi--layout--gutter--l;
|
||||
}
|
||||
|
||||
&--absolute {
|
||||
@include msfa__backdrop($msfa__z-index-backdrop, false);
|
||||
}
|
||||
|
||||
&--full-screen {
|
||||
@include msfa__backdrop($msfa__z-index-backdrop);
|
||||
}
|
||||
|
||||
&--full-blank-screen {
|
||||
@include msfa__backdrop($msfa__z-index-backdrop, true, true);
|
||||
}
|
||||
|
||||
&__spinner {
|
||||
display: inline-flex;
|
||||
animation: spinning 1s linear infinite;
|
||||
|
||||
&--s {
|
||||
width: 2.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/* tslint:disable:no-unused-variable */
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { LoaderComponent } from './loader.component';
|
||||
|
||||
describe('LoaderComponent', () => {
|
||||
let component: LoaderComponent;
|
||||
let fixture: ComponentFixture<LoaderComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [LoaderComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LoaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,25 +0,0 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { LoaderType } from '@msfa-enums/loader-type.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'msfa-loader',
|
||||
templateUrl: './loader.component.html',
|
||||
styleUrls: ['./loader.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class LoaderComponent {
|
||||
private readonly _defaultClass = 'loader';
|
||||
@Input() type: LoaderType;
|
||||
@Input() size: 's' | 'm' = 'm';
|
||||
|
||||
get loaderClass(): string {
|
||||
if (this.type) {
|
||||
return `${this._defaultClass} ${this._defaultClass}--${this.type as string}`;
|
||||
}
|
||||
return this._defaultClass;
|
||||
}
|
||||
|
||||
get spinnerClass(): string {
|
||||
return `${this._defaultClass}__spinner ${this._defaultClass}__spinner--${this.size}`;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { LoaderComponent } from './loader.component';
|
||||
|
||||
@NgModule({
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [LoaderComponent],
|
||||
imports: [CommonModule],
|
||||
exports: [LoaderComponent],
|
||||
})
|
||||
export class LoaderModule {}
|
||||
@@ -1,6 +0,0 @@
|
||||
export enum LoaderType {
|
||||
FULL_SCREEN = 'fullscreen',
|
||||
FULL_BLANK_SCREEN = 'full-blank-screen',
|
||||
ABSOLUTE = 'absolute',
|
||||
PADDED = 'padded',
|
||||
}
|
||||
Reference in New Issue
Block a user