carbon-components-angular
Version:
Next generation components
106 lines (101 loc) • 4.26 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, Input, HostBinding, NgModule } from '@angular/core';
import * as i1 from 'carbon-components-angular/i18n';
import { I18nModule } from 'carbon-components-angular/i18n';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
/**
* Get started with importing the module:
*
* ```typescript
* import { LoadingModule } from 'carbon-components-angular';
* ```
*
* [See demo](../../?path=/story/components-loading--basic)
*/
class Loading {
constructor(i18n) {
this.i18n = i18n;
/**
* Accessible title for the loading circle.
* Defaults to the `LOADING.TITLE` value from the i18n service.
*/
this.title = this.i18n.get().LOADING.TITLE;
/**
* set to `false` to stop the loading animation
*/
this.isActive = true;
/**
* Specify the size of the button
*/
this.size = "normal";
/**
* Set to `true` to make loader with an overlay.
*/
this.overlay = false;
}
}
Loading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Loading, deps: [{ token: i1.I18n }], target: i0.ɵɵFactoryTarget.Component });
Loading.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Loading, selector: "cds-loading, ibm-loading", inputs: { title: "title", isActive: "isActive", size: "size", overlay: "overlay" }, host: { properties: { "class.cds--loading-overlay": "this.overlay" } }, ngImport: i0, template: `
<div
[ngClass]="{
'cds--loading--small': size === 'sm',
'cds--loading--stop': !isActive && !overlay,
'cds--loading-overlay--stop': !isActive && overlay
}"
class="cds--loading">
<svg class="cds--loading__svg" viewBox="0 0 100 100">
<title>{{title}}</title>
<circle class="cds--loading__stroke" cx="50%" cy="50%" r="44" />
</svg>
</div>
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Loading, decorators: [{
type: Component,
args: [{
selector: "cds-loading, ibm-loading",
template: `
<div
[ngClass]="{
'cds--loading--small': size === 'sm',
'cds--loading--stop': !isActive && !overlay,
'cds--loading-overlay--stop': !isActive && overlay
}"
class="cds--loading">
<svg class="cds--loading__svg" viewBox="0 0 100 100">
<title>{{title}}</title>
<circle class="cds--loading__stroke" cx="50%" cy="50%" r="44" />
</svg>
</div>
`
}]
}], ctorParameters: function () { return [{ type: i1.I18n }]; }, propDecorators: { title: [{
type: Input
}], isActive: [{
type: Input
}], size: [{
type: Input
}], overlay: [{
type: Input
}, {
type: HostBinding,
args: ["class.cds--loading-overlay"]
}] } });
class LoadingModule {
}
LoadingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LoadingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: LoadingModule, declarations: [Loading], imports: [CommonModule, I18nModule], exports: [Loading] });
LoadingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingModule, imports: [CommonModule, I18nModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingModule, decorators: [{
type: NgModule,
args: [{
declarations: [Loading],
exports: [Loading],
imports: [CommonModule, I18nModule]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { Loading, LoadingModule };
//# sourceMappingURL=carbon-components-angular-loading.mjs.map