blob: d7ba1effecb51ccea5a5d653b6c65c3cc03d1fb4 [file] [log] [blame]
{"version":3,"file":"covalent-core-loading.js.map","sources":["ng://@covalent/core/loading/loading.component.ts","ng://@covalent/core/loading/services/loading.factory.ts","ng://@covalent/core/loading/services/loading.service.ts","ng://@covalent/core/loading/directives/loading.directive.ts","ng://@covalent/core/loading/loading.module.ts"],"sourcesContent":["import { Component, ViewChild, TemplateRef, ChangeDetectorRef, ChangeDetectionStrategy, ElementRef, DoCheck } from '@angular/core';\nimport { AnimationEvent } from '@angular/animations';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { Observable, Subject } from 'rxjs';\n\nexport enum LoadingType {\n Circular = 'circular',\n Linear = 'linear',\n}\n\nexport enum LoadingMode {\n Determinate = 'determinate',\n Indeterminate = 'indeterminate',\n}\n\nexport enum LoadingStrategy {\n Overlay = 'overlay',\n Replace = 'replace',\n}\n\nexport enum LoadingStyle {\n FullScreen = 'fullscreen',\n Overlay = 'overlay',\n None = 'none',\n}\n\nimport { tdFadeInOutAnimation } from '@covalent/core/common';\n\nexport const TD_CIRCLE_DIAMETER: number = 100;\n\n@Component({\n selector: 'td-loading',\n styleUrls: ['./loading.component.scss' ],\n templateUrl: './loading.component.html',\n animations: [\n tdFadeInOutAnimation,\n ],\n})\nexport class TdLoadingComponent implements DoCheck {\n\n private _animationIn: Subject<any> = new Subject<any>();\n private _animationOut: Subject<any> = new Subject<any>();\n private _mode: LoadingMode = LoadingMode.Indeterminate;\n private _defaultMode: LoadingMode = LoadingMode.Indeterminate;\n private _value: number = 0;\n private _circleDiameter: number = TD_CIRCLE_DIAMETER;\n\n /**\n * Flag for animation\n */\n animation: boolean = false;\n\n /**\n * Content injected into loading component.\n */\n content: TemplatePortal<any>;\n\n /**\n * Sets mode of [TdLoadingComponent] to LoadingMode.Determinate or LoadingMode.Indeterminate\n */\n set mode(mode: LoadingMode) {\n this._defaultMode = mode;\n }\n get mode(): LoadingMode {\n return this._mode;\n }\n\n /**\n * Sets value of [TdLoadingComponent] if mode is 'LoadingMode.Determinate'\n */\n set value(value: number) {\n this._value = value;\n // Check for changes for `OnPush` change detection\n this._changeDetectorRef.markForCheck();\n }\n get value(): number {\n return this._value;\n }\n\n style: LoadingStyle = LoadingStyle.None;\n\n /**\n * height: number\n * Sets height of [TdLoadingComponent].\n */\n height: number;\n\n /**\n * type: LoadingType\n * Sets type of [TdLoadingComponent] rendered.\n */\n type: LoadingType = LoadingType.Circular;\n\n /**\n * color: primary' | 'accent' | 'warn'\n * Sets theme color of [TdLoadingComponent] rendered.\n */\n color: 'primary' | 'accent' | 'warn' = 'primary';\n\n constructor(private _elementRef: ElementRef,\n private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngDoCheck(): void {\n // When overlay is used and the host width has a value greater than 1px\n // set the circle diameter when possible incase the loading component was rendered in a hidden state\n if (this.isOverlay() && this._hostHeight() > 1) {\n if (this.animation) {\n this._setCircleDiameter();\n this._changeDetectorRef.markForCheck();\n }\n }\n }\n\n getHeight(): string {\n // Ignore height if style is `overlay` or `fullscreen`.\n // Add height if child elements have a height and style is `none`, else return default height.\n if (this.isOverlay() || this.isFullScreen()) {\n return undefined;\n } else {\n return this.height ? `${this.height}px` : '150px';\n }\n }\n\n getCircleDiameter(): number {\n return this._circleDiameter;\n }\n\n getCircleStrokeWidth(): number {\n // we calculate the stroke width by setting it as 10% of its diameter\n let strokeWidth: number = this.getCircleDiameter() / 10;\n return Math.abs(strokeWidth);\n }\n\n isCircular(): boolean {\n return this.type === LoadingType.Circular;\n }\n\n isLinear(): boolean {\n return this.type === LoadingType.Linear;\n }\n\n isFullScreen(): boolean {\n return this.style === LoadingStyle.FullScreen;\n }\n\n isOverlay(): boolean {\n return this.style === LoadingStyle.Overlay;\n }\n\n animationComplete(event: AnimationEvent): void {\n // Check to see if its \"in\" or \"out\" animation to execute the proper callback\n if (!event.fromState) {\n this.inAnimationCompleted();\n } else {\n this.outAnimationCompleted();\n }\n }\n\n inAnimationCompleted(): void {\n this._animationIn.next(undefined);\n }\n\n outAnimationCompleted(): void {\n /* little hack to reset the loader value and animation before removing it from DOM\n * else, the loader will appear with prev value when its registered again\n * and will do an animation going prev value to 0.\n */\n this.value = 0;\n // Check for changes for `OnPush` change detection\n this._changeDetectorRef.markForCheck();\n this._animationOut.next(undefined);\n }\n\n /**\n * Starts in animation and returns an observable for completition event.\n */\n startInAnimation(): Observable<any> {\n /* need to switch back to the selected mode, so we have saved it in another variable\n * and then recover it. (issue with protractor)\n */\n this._mode = this._defaultMode;\n // Set values before the animations starts\n this._setCircleDiameter();\n // Check for changes for `OnPush` change detection\n this.animation = true;\n this._changeDetectorRef.markForCheck();\n return this._animationIn.asObservable();\n }\n\n /**\n * Starts out animation and returns an observable for completition event.\n */\n startOutAnimation(): Observable<any> {\n this.animation = false;\n /* need to switch back and forth from determinate/indeterminate so the setInterval()\n * inside mat-progress-spinner stops and protractor doesnt timeout waiting to sync.\n */\n this._mode = LoadingMode.Determinate;\n // Check for changes for `OnPush` change detection\n this._changeDetectorRef.markForCheck();\n return this._animationOut.asObservable();\n }\n\n /**\n * Calculate the proper diameter for the circle and set it\n */\n private _setCircleDiameter(): void {\n // we set a default diameter of 100 since this is the default in material\n let diameter: number = TD_CIRCLE_DIAMETER;\n // if height is provided, then we take that as diameter\n if (this.height) {\n diameter = this.height;\n // else if its not provided, then we take the host height\n } else if (this.height === undefined) {\n diameter = this._hostHeight();\n }\n // if the diameter is over TD_CIRCLE_DIAMETER, we set TD_CIRCLE_DIAMETER\n if (!!diameter && diameter <= TD_CIRCLE_DIAMETER) {\n this._circleDiameter = Math.floor(diameter);\n } else {\n this._circleDiameter = TD_CIRCLE_DIAMETER;\n }\n }\n\n /**\n * Returns the host height of the loading component\n */\n private _hostHeight(): number {\n if (<HTMLElement>this._elementRef.nativeElement) {\n return (<HTMLElement>this._elementRef.nativeElement).getBoundingClientRect().height;\n }\n return 0;\n }\n}\n","import { Injectable, ComponentFactoryResolver, ChangeDetectorRef, Provider, SkipSelf, Optional, EmbeddedViewRef } from '@angular/core';\nimport { Injector, ComponentRef, ViewContainerRef, TemplateRef } from '@angular/core';\nimport { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';\nimport { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\n\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\n\nimport { TdLoadingContext } from '../directives/loading.directive';\nimport { TdLoadingComponent, LoadingStyle } from '../loading.component';\nimport { ITdLoadingConfig } from './loading.service';\n\nexport interface IInternalLoadingOptions extends ITdLoadingConfig {\n height?: number;\n style?: LoadingStyle;\n}\n\nexport interface ILoadingRef {\n observable: Observable<any>;\n componentRef: ComponentRef<any>;\n subject?: Subject<any>;\n times?: number;\n}\n\n/**\n * NOTE: @internal usage only.\n */\n@Injectable()\nexport class TdLoadingFactory {\n\n constructor(private _componentFactoryResolver: ComponentFactoryResolver,\n private _overlay: Overlay,\n private _injector: Injector) {\n }\n\n /**\n * Uses material `Overlay` services to create a DOM element and attach the loading component\n * into it. Leveraging the state and configuration from it.\n *\n * Saves a reference in context to be called when registering/resolving the loading element.\n */\n public createFullScreenComponent(options: ITdLoadingConfig): ILoadingRef {\n (<IInternalLoadingOptions>options).height = undefined;\n (<IInternalLoadingOptions>options).style = LoadingStyle.FullScreen;\n let loadingRef: ILoadingRef = this._initializeContext();\n let loading: boolean = false;\n let overlayRef: OverlayRef;\n loadingRef.observable.pipe(\n distinctUntilChanged(),\n ).subscribe((registered: number) => {\n if (registered > 0 && !loading) {\n loading = true;\n overlayRef = this._createOverlay();\n loadingRef.componentRef = overlayRef.attach(new ComponentPortal(TdLoadingComponent));\n this._mapOptions(options, loadingRef.componentRef.instance);\n loadingRef.componentRef.instance.startInAnimation();\n loadingRef.componentRef.changeDetectorRef.detectChanges();\n } else if (registered <= 0 && loading) {\n loading = false;\n let subs: Subscription = loadingRef.componentRef.instance.startOutAnimation().subscribe(() => {\n subs.unsubscribe();\n loadingRef.componentRef.destroy();\n overlayRef.detach();\n overlayRef.dispose();\n });\n }\n });\n return loadingRef;\n }\n\n /**\n * Creates a loading component dynamically and attaches it into the given viewContainerRef.\n * Leverages TemplatePortals from material to inject the template inside of it so it fits\n * perfectly when overlaying it.\n *\n * Saves a reference in context to be called when registering/resolving the loading element.\n */\n public createOverlayComponent(options: ITdLoadingConfig, viewContainerRef: ViewContainerRef,\n templateRef: TemplateRef<Object>): ILoadingRef {\n (<IInternalLoadingOptions>options).height = undefined;\n (<IInternalLoadingOptions>options).style = LoadingStyle.Overlay;\n let loadingRef: ILoadingRef = this._createComponent(options);\n let loading: boolean = false;\n loadingRef.componentRef.instance.content = new TemplatePortal(templateRef, viewContainerRef);\n viewContainerRef.clear();\n viewContainerRef.insert(loadingRef.componentRef.hostView, 0);\n loadingRef.observable.pipe(\n distinctUntilChanged(),\n ).subscribe((registered: number) => {\n if (registered > 0 && !loading) {\n loading = true;\n loadingRef.componentRef.instance.startInAnimation();\n } else if (registered <= 0 && loading) {\n loading = false;\n loadingRef.componentRef.instance.startOutAnimation();\n }\n });\n return loadingRef;\n }\n\n /**\n * Creates a loading component dynamically and attaches it into the given viewContainerRef.\n * Replaces the template with the loading component depending if it was registered or resolved.\n *\n * Saves a reference in context to be called when registering/resolving the loading element.\n */\n public createReplaceComponent(options: ITdLoadingConfig, viewContainerRef: ViewContainerRef,\n templateRef: TemplateRef<Object>, context: TdLoadingContext): ILoadingRef {\n let nativeElement: HTMLElement = <HTMLElement>templateRef.elementRef.nativeElement;\n (<IInternalLoadingOptions>options).height = nativeElement.nextElementSibling ?\n nativeElement.nextElementSibling.scrollHeight : undefined;\n (<IInternalLoadingOptions>options).style = LoadingStyle.None;\n let loadingRef: ILoadingRef = this._createComponent(options);\n let loading: boolean = false;\n // passing context so when the template is attached, we can keep the reference of the variables\n let contentRef: EmbeddedViewRef<Object> = viewContainerRef.createEmbeddedView(templateRef, context);\n loadingRef.observable.pipe(\n distinctUntilChanged(),\n ).subscribe((registered: number) => {\n if (registered > 0 && !loading) {\n loading = true;\n // detach the content and attach the loader if loader is there\n let index: number = viewContainerRef.indexOf(loadingRef.componentRef.hostView);\n if (index < 0) {\n viewContainerRef.detach(viewContainerRef.indexOf(contentRef));\n viewContainerRef.insert(loadingRef.componentRef.hostView, 0);\n }\n loadingRef.componentRef.instance.startInAnimation();\n } else if (registered <= 0 && loading) {\n loading = false;\n let subs: Subscription = loadingRef.componentRef.instance.startOutAnimation().subscribe(() => {\n subs.unsubscribe();\n // detach loader and attach the content if content is there\n let index: number = viewContainerRef.indexOf(contentRef);\n if (index < 0) {\n viewContainerRef.detach(viewContainerRef.indexOf(loadingRef.componentRef.hostView));\n viewContainerRef.insert(contentRef, 0);\n }\n /**\n * Need to call \"markForCheck\" and \"detectChanges\" on attached template, so its detected by parent component when attached\n * with \"OnPush\" change detection\n */\n contentRef.detectChanges();\n contentRef.markForCheck();\n });\n }\n });\n return loadingRef;\n }\n\n /**\n * Creates a fullscreen overlay for the loading usage.\n */\n private _createOverlay(): OverlayRef {\n let state: OverlayConfig = new OverlayConfig();\n state.hasBackdrop = false;\n state.positionStrategy = this._overlay.position().global().centerHorizontally().centerVertically();\n return this._overlay.create(state);\n }\n\n /**\n * Creates a generic component dynamically waiting to be attached to a viewContainerRef.\n */\n private _createComponent(options: IInternalLoadingOptions): ILoadingRef {\n let compRef: ILoadingRef = this._initializeContext();\n compRef.componentRef = this._componentFactoryResolver\n .resolveComponentFactory(TdLoadingComponent).create(this._injector);\n this._mapOptions(options, compRef.componentRef.instance);\n return compRef;\n }\n\n /**\n * Initialize context for loading component.\n */\n private _initializeContext(): ILoadingRef {\n let subject: Subject<any> = new Subject<any>();\n return {\n observable: subject.asObservable(),\n subject: subject,\n componentRef: undefined,\n times: 0,\n };\n }\n\n /**\n * Maps configuration to the loading component instance.\n */\n private _mapOptions(options: IInternalLoadingOptions, instance: TdLoadingComponent): void {\n instance.style = options.style;\n if (options.type !== undefined) {\n instance.type = options.type;\n }\n if (options.height !== undefined) {\n instance.height = options.height;\n }\n if (options.mode !== undefined) {\n instance.mode = options.mode;\n }\n if (options.color !== undefined) {\n instance.color = options.color;\n }\n }\n}\n\nexport function LOADING_FACTORY_PROVIDER_FACTORY(\n parent: TdLoadingFactory, componentFactoryResolver: ComponentFactoryResolver, overlay: Overlay, injector: Injector): TdLoadingFactory {\n return parent || new TdLoadingFactory(componentFactoryResolver, overlay, injector);\n}\n\nexport const LOADING_FACTORY_PROVIDER: Provider = {\n // If there is already a service available, use that. Otherwise, provide a new one.\n provide: TdLoadingFactory,\n deps: [[new Optional(), new SkipSelf(), TdLoadingFactory], ComponentFactoryResolver, Overlay, Injector],\n useFactory: LOADING_FACTORY_PROVIDER_FACTORY,\n};\n","import { Injectable, Provider, SkipSelf, Optional } from '@angular/core';\nimport { ViewContainerRef, TemplateRef } from '@angular/core';\nimport { Observable, Subject, Subscription } from 'rxjs';\n\nimport { TdLoadingContext } from '../directives/loading.directive';\nimport { TdLoadingComponent, LoadingMode, LoadingStrategy, LoadingType } from '../loading.component';\nimport { TdLoadingFactory, ILoadingRef } from './loading.factory';\n\nexport interface ITdLoadingConfig {\n name: string;\n type?: LoadingType;\n mode?: LoadingMode;\n color?: 'primary' | 'accent' | 'warn';\n}\n\nexport class TdLoadingConfig implements ITdLoadingConfig {\n name: string;\n type?: LoadingType;\n mode?: LoadingMode;\n color?: 'primary' | 'accent' | 'warn';\n\n constructor(config: ITdLoadingConfig) {\n this.name = config.name;\n if (!this.name) {\n throw Error('Name is required for [TdLoading] configuration.');\n }\n this.mode = config.mode ? config.mode : LoadingMode.Indeterminate;\n this.type = config.type ? config.type : LoadingType.Circular;\n this.color = config.color ? config.color : 'primary';\n }\n}\n\nexport interface ITdLoadingDirectiveConfig extends ITdLoadingConfig {\n strategy?: LoadingStrategy;\n}\n\nexport class TdLoadingDirectiveConfig extends TdLoadingConfig implements ITdLoadingDirectiveConfig {\n name: string;\n type: LoadingType;\n mode: LoadingMode;\n strategy: LoadingStrategy;\n\n constructor(config: ITdLoadingDirectiveConfig) {\n super(config);\n this.strategy = config.strategy ? config.strategy : LoadingStrategy.Replace;\n }\n}\n\n@Injectable()\nexport class TdLoadingService {\n\n private _context: {[key: string]: ILoadingRef} = {};\n private _timeouts: {[key: string]: any} = {};\n\n constructor(private _loadingFactory: TdLoadingFactory) {\n this.create({\n name: 'td-loading-main',\n });\n }\n\n /**\n * params:\n * - config: ILoadingDirectiveConfig\n * - viewContainerRef: ViewContainerRef\n * - templateRef: TemplateRef<Object>\n *\n * Creates an replace loading mask and attaches it to the viewContainerRef.\n * Replaces the templateRef with the mask when a request is registered on it.\n *\n * NOTE: @internal usage only.\n */\n createComponent(config: ITdLoadingDirectiveConfig, viewContainerRef: ViewContainerRef,\n templateRef: TemplateRef<Object>, context: TdLoadingContext): ILoadingRef {\n let directiveConfig: TdLoadingDirectiveConfig = new TdLoadingDirectiveConfig(config);\n if (this._context[directiveConfig.name]) {\n throw Error(`Name duplication: [TdLoading] directive has a name conflict with ${directiveConfig.name}.`);\n }\n if (directiveConfig.strategy === LoadingStrategy.Overlay) {\n this._context[directiveConfig.name] = this._loadingFactory.createOverlayComponent(directiveConfig, viewContainerRef, templateRef);\n } else {\n this._context[directiveConfig.name] = this._loadingFactory.createReplaceComponent(directiveConfig, viewContainerRef, templateRef, context);\n }\n return this._context[directiveConfig.name];\n }\n\n /**\n * params:\n * - config: ITdLoadingConfig\n *\n * Creates a fullscreen loading mask and attaches it to the DOM with the given configuration.\n * Only displayed when the mask has a request registered on it.\n */\n public create(config: ITdLoadingConfig): void {\n let fullscreenConfig: TdLoadingConfig = new TdLoadingConfig(config);\n this.removeComponent(fullscreenConfig.name);\n this._context[fullscreenConfig.name] = this._loadingFactory.createFullScreenComponent(fullscreenConfig);\n }\n\n /**\n * params:\n * - name: string\n *\n * Removes `loading` component from service context.\n */\n public removeComponent(name: string): void {\n if (this._context[name]) {\n this._context[name].subject.unsubscribe();\n if (this._context[name].componentRef) {\n this._context[name].componentRef.destroy();\n }\n this._context[name] = undefined;\n delete this._context[name];\n }\n }\n\n /**\n * params:\n * - name: string\n * - registers?: number\n * returns: true if successful\n *\n * Resolves a request for the loading mask referenced by the name parameter.\n * Can optionally pass registers argument to set a number of register calls.\n *\n * If no paramemeters are used, then default main mask will be used.\n *\n * e.g. loadingService.register()\n */\n public register(name: string = 'td-loading-main', registers: number = 1): boolean {\n // try registering into the service if the loading component has been instanciated or if it exists.\n if (this._context[name]) {\n registers = registers < 1 ? 1 : registers;\n this._context[name].times += registers;\n this._context[name].subject.next(this._context[name].times);\n return true;\n } else {\n // if it doesnt exist, set a timeout so its registered after change detection happens\n // this in case \"register\" occured on the `ngOnInit` lifehook cycle.\n if (!this._timeouts[name]) {\n this._timeouts[name] = setTimeout(() => {\n this.register(name, registers);\n });\n } else {\n // if it timeout occured and still doesnt exist, it means the tiemout wasnt needed so we clear it.\n this._clearTimeout(name);\n }\n }\n return false;\n }\n\n /**\n * params:\n * - name: string\n * - resolves?: number\n * returns: true if successful\n *\n * Resolves a request for the loading mask referenced by the name parameter.\n * Can optionally pass resolves argument to set a number of resolve calls.\n *\n * If no paramemeters are used, then default main mask will be used.\n *\n * e.g. loadingService.resolve()\n */\n public resolve(name: string = 'td-loading-main', resolves: number = 1): boolean {\n // clear timeout if the loading component is \"resolved\" before its \"registered\"\n this._clearTimeout(name);\n if (this._context[name]) {\n resolves = resolves < 1 ? 1 : resolves;\n if (this._context[name].times > 0) {\n let times: number = this._context[name].times;\n times -= resolves;\n this._context[name].times = times < 0 ? 0 : times;\n }\n this._context[name].subject.next(this._context[name].times);\n return true;\n }\n return false;\n }\n\n /**\n * params:\n * - name: string\n * returns: true if successful\n *\n * Resolves all request for the loading mask referenced by the name parameter.\n *\n * If no paramemeters are used, then default main mask will be used.\n *\n * e.g. loadingService.resolveAll()\n */\n public resolveAll(name: string = 'td-loading-main'): boolean {\n // clear timeout if the loading component is \"resolved\" before its \"registered\"\n this._clearTimeout(name);\n if (this._context[name]) {\n this._context[name].times = 0;\n this._context[name].subject.next(this._context[name].times);\n return true;\n }\n return false;\n }\n\n /**\n * params:\n * - name: string\n * - value: number\n * returns: true if successful\n *\n * Set value on a loading mask referenced by the name parameter.\n * Usage only available if its mode is 'determinate' and if loading is showing.\n */\n public setValue(name: string, value: number): boolean {\n if (this._context[name]) {\n let instance: TdLoadingComponent = this._context[name].componentRef.instance;\n if (instance.mode === LoadingMode.Determinate && instance.animation) {\n instance.value = value;\n return true;\n }\n }\n return false;\n }\n\n /**\n * Clears timeout linked to the name.\n * @param name Name of the loading component to be cleared\n */\n private _clearTimeout(name: string): void {\n clearTimeout(this._timeouts[name]);\n delete this._timeouts[name];\n }\n}\n\nexport function LOADING_PROVIDER_FACTORY(\n parent: TdLoadingService, loadingFactory: TdLoadingFactory): TdLoadingService {\n return parent || new TdLoadingService(loadingFactory);\n}\n\nexport const LOADING_PROVIDER: Provider = {\n // If there is already a service available, use that. Otherwise, provide a new one.\n provide: TdLoadingService,\n deps: [[new Optional(), new SkipSelf(), TdLoadingService], TdLoadingFactory],\n useFactory: LOADING_PROVIDER_FACTORY,\n};\n","import { Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { ViewContainerRef, TemplateRef } from '@angular/core';\n\nimport { LoadingType, LoadingMode, LoadingStrategy, TdLoadingComponent } from '../loading.component';\nimport { TdLoadingService } from '../services/loading.service';\nimport { ILoadingRef } from '../services/loading.factory';\n\n/**\n * Context class for variable reference\n */\nexport class TdLoadingContext {\n public $implicit: any = undefined;\n public tdLoading: any = undefined;\n}\n\n// Constant for generation of the id for the next component\nlet TD_LOADING_NEXT_ID: number = 0;\n\n@Directive({\n selector: '[tdLoading]',\n})\nexport class TdLoadingDirective implements OnInit, OnDestroy {\n\n private _context: TdLoadingContext = new TdLoadingContext();\n private _type: LoadingType;\n private _mode: LoadingMode;\n private _strategy: LoadingStrategy;\n private _name: string;\n private _loadingRef: ILoadingRef;\n\n /**\n * tdLoading: string\n * Name reference of the loading mask, used to register/resolve requests to the mask.\n */\n @Input('tdLoading')\n set name(name: string) {\n if (!this._name) {\n if (name) {\n this._name = name;\n }\n }\n }\n\n /**\n * tdLoadingUntil?: any\n * If its null, undefined or false it will be used to register requests to the mask.\n * Else if its any value that can be resolved as true, it will resolve the mask.\n * [name] is optional when using [until], but can still be used to register/resolve it manually.\n */\n @Input('tdLoadingUntil')\n set until(until: any) {\n if (!this._name) {\n this._name = 'td-loading-until-' + TD_LOADING_NEXT_ID++;\n }\n this._context.$implicit = this._context.tdLoading = until;\n if (!until) {\n this._loadingService.register(this._name);\n } else {\n this._loadingService.resolveAll(this._name);\n }\n }\n\n /**\n * tdLoadingType?: LoadingType or ['linear' | 'circular']\n * Sets the type of loading mask depending on value.\n * Defaults to [LoadingType.Circular | 'circular'].\n */\n @Input('tdLoadingType')\n set type(type: LoadingType) {\n switch (type) {\n case LoadingType.Linear:\n this._type = LoadingType.Linear;\n break;\n default:\n this._type = LoadingType.Circular;\n break;\n }\n }\n\n /**\n * tdLoadingMode?: LoadingMode or ['determinate' | 'indeterminate']\n * Sets the mode of loading mask depending on value.\n * Defaults to [LoadingMode.Indeterminate | 'indeterminate'].\n */\n @Input('tdLoadingMode')\n set mode(mode: LoadingMode) {\n switch (mode) {\n case LoadingMode.Determinate:\n this._mode = LoadingMode.Determinate;\n break;\n default:\n this._mode = LoadingMode.Indeterminate;\n break;\n }\n }\n\n /**\n * tdLoadingStrategy?: LoadingStrategy or ['replace' | 'overlay']\n * Sets the strategy of loading mask depending on value.\n * Defaults to [LoadingMode.Replace | 'replace'].\n */\n @Input('tdLoadingStrategy')\n set strategy(stategy: LoadingStrategy) {\n switch (stategy) {\n case LoadingStrategy.Overlay:\n this._strategy = LoadingStrategy.Overlay;\n break;\n default:\n this._strategy = LoadingStrategy.Replace;\n break;\n }\n }\n\n /**\n * tdLoadingColor?: \"primary\" | \"accent\" | \"warn\"\n * Sets the theme color of the loading component. Defaults to \"primary\"\n */\n @Input('tdLoadingColor') color: 'primary' | 'accent' | 'warn' = 'primary';\n\n constructor(private _viewContainerRef: ViewContainerRef,\n private _templateRef: TemplateRef<TdLoadingContext>,\n private _loadingService: TdLoadingService) {}\n\n /**\n * Registers component in the DOM, so it will be available when calling resolve/register.\n */\n ngOnInit(): void {\n this._registerComponent();\n }\n\n /**\n * Remove component when directive is destroyed.\n */\n ngOnDestroy(): void {\n this._loadingService.removeComponent(this._name);\n this._loadingRef = undefined;\n }\n\n /**\n * Creates [TdLoadingComponent] and attaches it to this directive's [ViewContainerRef].\n * Passes this directive's [TemplateRef] to modify DOM depending on loading `strategy`.\n */\n private _registerComponent(): void {\n if (!this._name) {\n throw new Error('Name is needed to register loading directive');\n }\n // Check if `TdLoadingComponent` has been created before trying to add one again.\n // There is a weird edge case when using `[routerLinkActive]` that calls the `ngOnInit` twice in a row\n if (!this._loadingRef) {\n this._loadingRef = this._loadingService.createComponent({\n name: this._name,\n type: this._type,\n mode: this._mode,\n color: this.color,\n strategy: this._strategy,\n }, this._viewContainerRef, this._templateRef, this._context);\n }\n }\n}\n","import { Type } from '@angular/core';\nimport { NgModule, ModuleWithProviders } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { TdLoadingService, LOADING_PROVIDER } from './services/loading.service';\nimport { TdLoadingFactory, LOADING_FACTORY_PROVIDER } from './services/loading.factory';\nimport { TdLoadingDirective } from './directives/loading.directive';\nimport { TdLoadingComponent } from './loading.component';\n\nconst TD_LOADING: Type<any>[] = [\n TdLoadingComponent,\n TdLoadingDirective,\n];\n\nconst TD_LOADING_ENTRY_COMPONENTS: Type<any>[] = [\n TdLoadingComponent,\n];\n\n@NgModule({\n imports: [\n CommonModule,\n MatProgressBarModule,\n MatProgressSpinnerModule,\n OverlayModule,\n PortalModule,\n ],\n declarations: [\n TD_LOADING,\n ],\n exports: [\n TD_LOADING,\n ],\n providers: [\n LOADING_FACTORY_PROVIDER,\n LOADING_PROVIDER,\n ],\n entryComponents: [\n TD_LOADING_ENTRY_COMPONENTS,\n ],\n})\nexport class CovalentLoadingModule {\n\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;AAAA;;IAME,UAAW,UAAU;IACrB,QAAS,QAAQ;;;;IAIjB,aAAc,aAAa;IAC3B,eAAgB,eAAe;;;;IAI/B,SAAU,SAAS;IACnB,SAAU,SAAS;;;;IAInB,YAAa,YAAY;IACzB,SAAU,SAAS;IACnB,MAAO,MAAM;;;AAKf,IAAa,kBAAkB,GAAW,GAAG;AAE7C;IAqEE,4BAAoB,WAAuB,EACvB,kBAAqC;QADrC,gBAAW,GAAX,WAAW,CAAY;QACvB,uBAAkB,GAAlB,kBAAkB,CAAmB;QA5DjD,iBAAY,GAAiB,IAAI,OAAO,EAAO,CAAC;QAChD,kBAAa,GAAiB,IAAI,OAAO,EAAO,CAAC;QACjD,UAAK,GAAgB,WAAW,CAAC,aAAa,CAAC;QAC/C,iBAAY,GAAgB,WAAW,CAAC,aAAa,CAAC;QACtD,WAAM,GAAW,CAAC,CAAC;QACnB,oBAAe,GAAW,kBAAkB,CAAC;;;;QAKrD,cAAS,GAAY,KAAK,CAAC;QA6B3B,UAAK,GAAiB,YAAY,CAAC,IAAI,CAAC;;;;;QAYxC,SAAI,GAAgB,WAAW,CAAC,QAAQ,CAAC;;;;;QAMzC,UAAK,GAAkC,SAAS,CAAC;KAGY;IAxC7D,sBAAI,oCAAI;;;;QAGR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;SACnB;;;;;;;;;QALD,UAAS,IAAiB;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;SAC1B;;;OAAA;IAQD,sBAAI,qCAAK;;;;QAKT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;SACpB;;;;;;;;;QAPD,UAAU,KAAa;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;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