ngx-skeleton-loader 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -4
- package/{esm2020 → esm2022}/lib/ngx-skeleton-loader-config.types.mjs +1 -1
- package/esm2022/lib/ngx-skeleton-loader.component.mjs +92 -0
- package/esm2022/lib/ngx-skeleton-loader.module.mjs +26 -0
- package/{fesm2020 → fesm2022}/ngx-skeleton-loader.mjs +8 -18
- package/fesm2022/ngx-skeleton-loader.mjs.map +1 -0
- package/lib/ngx-skeleton-loader-config.types.d.ts +1 -1
- package/lib/ngx-skeleton-loader.component.d.ts +3 -5
- package/package.json +7 -14
- package/esm2020/lib/ngx-skeleton-loader.component.mjs +0 -100
- package/esm2020/lib/ngx-skeleton-loader.module.mjs +0 -25
- package/fesm2015/ngx-skeleton-loader.mjs +0 -137
- package/fesm2015/ngx-skeleton-loader.mjs.map +0 -1
- package/fesm2020/ngx-skeleton-loader.mjs.map +0 -1
- /package/{esm2020 → esm2022}/ngx-skeleton-loader.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased][]
|
|
9
9
|
|
|
10
|
+
## [8.0.0][] - 2023-06-20
|
|
11
|
+
|
|
12
|
+
### Updated
|
|
13
|
+
|
|
14
|
+
- Updating project to support Angular v16;
|
|
15
|
+
- Updating NodeJS version to v18;
|
|
16
|
+
- Updating peerDependencies to point to latest `@angular/*` packages;
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- Removing `perf-marks` dependency library;
|
|
21
|
+
|
|
10
22
|
## [7.0.0][] - 2023-02-04
|
|
11
23
|
|
|
12
24
|
### Added
|
|
@@ -556,7 +568,6 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
|
|
|
556
568
|
[5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
|
|
557
569
|
[unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
|
|
558
570
|
[6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
[
|
|
562
|
-
[7.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v7.0.0
|
|
571
|
+
[Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v8.0.0...HEAD
|
|
572
|
+
[8.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v7.0.0...v8.0.0
|
|
573
|
+
[7.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v7.0.0
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
export const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQW1CL0MsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsSUFBSSxjQUFjLENBQTBCLDRCQUE0QixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2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ional, Inject, } from '@angular/core';
|
|
2
|
+
import { NGX_SKELETON_LOADER_CONFIG, } from './ngx-skeleton-loader-config.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
class NgxSkeletonLoaderComponent {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
|
|
9
|
+
this.appearance = appearance;
|
|
10
|
+
this.animation = animation;
|
|
11
|
+
this.theme = theme;
|
|
12
|
+
this.loadingText = loadingText;
|
|
13
|
+
this.count = count;
|
|
14
|
+
this.items = [];
|
|
15
|
+
this.ariaLabel = ariaLabel;
|
|
16
|
+
}
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
this.validateInputValues();
|
|
19
|
+
}
|
|
20
|
+
validateInputValues() {
|
|
21
|
+
// Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
|
|
22
|
+
if (!/^\d+$/.test(`${this.count}`)) {
|
|
23
|
+
// Shows error message only in Development
|
|
24
|
+
if (isDevMode()) {
|
|
25
|
+
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
|
|
26
|
+
}
|
|
27
|
+
this.count = 1;
|
|
28
|
+
}
|
|
29
|
+
//Force count to 1 when custom-content is used
|
|
30
|
+
if (this.appearance === 'custom-content') {
|
|
31
|
+
// Shows error message only in Development
|
|
32
|
+
if (isDevMode() && this.count !== 1) {
|
|
33
|
+
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
34
|
+
this.count = 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
this.items.length = this.count;
|
|
38
|
+
const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
39
|
+
if (allowedAnimations.indexOf(String(this.animation)) === -1) {
|
|
40
|
+
// Shows error message only in Development
|
|
41
|
+
if (isDevMode()) {
|
|
42
|
+
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
|
|
43
|
+
}
|
|
44
|
+
this.animation = 'progress';
|
|
45
|
+
}
|
|
46
|
+
if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {
|
|
47
|
+
// Shows error message only in Development
|
|
48
|
+
if (isDevMode()) {
|
|
49
|
+
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to "''".`);
|
|
50
|
+
}
|
|
51
|
+
this.appearance = '';
|
|
52
|
+
}
|
|
53
|
+
if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {
|
|
54
|
+
// Shows error message only in Development
|
|
55
|
+
this.theme = { ...this.config.theme, ...this.theme };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
ngOnChanges(changes) {
|
|
59
|
+
// Avoiding multiple calls for the same input in case there's no changes in the fields
|
|
60
|
+
// Checking if the fields that require validation are available and if they were changed
|
|
61
|
+
// In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
|
|
62
|
+
if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.validateInputValues();
|
|
66
|
+
}
|
|
67
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
68
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
69
|
+
}
|
|
70
|
+
export { NgxSkeletonLoaderComponent };
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
|
|
74
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
75
|
+
type: Inject,
|
|
76
|
+
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
77
|
+
}, {
|
|
78
|
+
type: Optional
|
|
79
|
+
}] }]; }, propDecorators: { count: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], loadingText: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], appearance: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], animation: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], ariaLabel: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], theme: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}] } });
|
|
92
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBRVQsS0FBSyxFQUNMLFNBQVMsRUFDVCx1QkFBdUIsRUFHdkIsUUFBUSxFQUNSLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBR0wsMEJBQTBCLEdBQzNCLE1BQU0sb0NBQW9DLENBQUM7OztBQUU1QyxNQU1hLDBCQUEwQjtJQXdCckMsWUFBb0UsTUFBZ0M7UUFBaEMsV0FBTSxHQUFOLE1BQU0sQ0FBMEI7UUFDbEcsTUFBTSxFQUNKLFVBQVUsR0FBRyxNQUFNLEVBQ25CLFNBQVMsR0FBRyxVQUFVLEVBQ3RCLEtBQUssR0FBRyxJQUFJLEVBQ1osV0FBVyxHQUFHLFlBQVksRUFDMUIsS0FBSyxHQUFHLENBQUMsRUFDVCxTQUFTLEdBQUcsU0FBUyxHQUN0QixHQUFHLE1BQU0sSUFBSSxFQUFFLENBQUM7UUFFakIsSUFBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUM7UUFDN0IsSUFBSSxDQUFD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VmFsdWUpLFxuICAgICAgKVxuICAgICkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIHRoaXMudmFsaWRhdGVJbnB1dFZhbHVlcygpO1xuICB9XG59XG4iLCI8ZGl2XG4gICpuZ0Zvcj1cImxldCBpdGVtIG9mIGl0ZW1zXCJcbiAgY2xhc3M9XCJza2VsZXRvbi1sb2FkZXJcIlxuICBbYXR0ci5hcmlhLWxhYmVsXT1cImFyaWFMYWJlbFwiXG4gIGFyaWEtYnVzeT1cInRydWVcIlxuICBhcmlhLXZhbHVlbWluPVwiMFwiXG4gIGFyaWEtdmFsdWVtYXg9XCIxMDBcIlxuICBbYXR0ci5hcmlhLXZhbHVldGV4dF09XCJsb2FkaW5nVGV4dFwiXG4gIHJvbGU9XCJwcm9ncmVzc2JhclwiXG4gIHRhYmluZGV4PVwiLTFcIlxuICBbbmdDbGFzc109XCJ7XG4gICAgJ2N1c3RvbS1jb250ZW50JzogYXBwZWFyYW5jZSA9PT0gJ2N1c3RvbS1jb250ZW50JyxcbiAgICBjaXJjbGU6IGFwcGVhcmFuY2UgPT09ICdjaXJjbGUnLFxuICAgIHByb2dyZXNzOiBhbmltYXRpb24gPT09ICdwcm9ncmVzcycsXG4gICAgJ3Byb2dyZXNzLWRhcmsnOiBhbmltYXRpb24gPT09ICdwcm9ncmVzcy1kYXJrJyxcbiAgICBwdWxzZTogYW5pbWF0aW9uID09PSAncHVsc2UnXG4gIH1cIlxuICBbbmdTdHlsZV09XCJ0aGVtZVwiXG4+XG4gIDxuZy1jb250ZW50ICpuZ0lmPVwiYXBwZWFyYW5jZSAgPT09ICdjdXN0b20tY29udGVudCdcIj48L25nLWNvbnRlbnQ+XG48L2Rpdj5cbiJdfQ==
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';
|
|
4
|
+
import { NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
class NgxSkeletonLoaderModule {
|
|
7
|
+
static forRoot(config) {
|
|
8
|
+
return {
|
|
9
|
+
ngModule: NgxSkeletonLoaderModule,
|
|
10
|
+
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
14
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] }); }
|
|
15
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
|
|
16
|
+
}
|
|
17
|
+
export { NgxSkeletonLoaderModule };
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
19
|
+
type: NgModule,
|
|
20
|
+
args: [{
|
|
21
|
+
declarations: [NgxSkeletonLoaderComponent],
|
|
22
|
+
imports: [CommonModule],
|
|
23
|
+
exports: [NgxSkeletonLoaderComponent],
|
|
24
|
+
}]
|
|
25
|
+
}] });
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wc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uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuaW1wb3J0IHsgTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnQgfSBmcm9tICcuL25neC1za2VsZXRvbi1sb2FkZXIuY29tcG9uZW50JztcbmltcG9ydCB7IE5neFNrZWxldG9uTG9hZGVyQ29uZmlnLCBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRyB9IGZyb20gJy4vbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtOZ3hTa2VsZXRvbkxvYWRlckNvbXBvbmVudF0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdLFxuICBleHBvcnRzOiBbTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnRdLFxufSlcbmV4cG9ydCBjbGFzcyBOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZSB7XG4gIHN0YXRpYyBmb3JSb290KGNvbmZpZz86IFBhcnRpYWw8Tmd4U2tlbGV0b25Mb2FkZXJDb25maWc+KTogTW9kdWxlV2l0aFByb3ZpZGVyczxOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZT4ge1xuICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogTmd4U2tlbGV0b25Mb2FkZXJNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFt7IHByb3ZpZGU6IE5HWF9TS0VMRVRPTl9MT0FERVJfQ09ORklHLCB1c2VWYWx1ZTogY29uZmlnIH1dLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, isDevMode, Component, ChangeDetectionStrategy, Inject, Optional, Input, NgModule } from '@angular/core';
|
|
3
|
-
import { start, end } from 'perf-marks/marks';
|
|
4
3
|
import * as i1 from '@angular/common';
|
|
5
4
|
import { CommonModule } from '@angular/common';
|
|
6
5
|
|
|
@@ -19,8 +18,6 @@ class NgxSkeletonLoaderComponent {
|
|
|
19
18
|
this.ariaLabel = ariaLabel;
|
|
20
19
|
}
|
|
21
20
|
ngOnInit() {
|
|
22
|
-
start('NgxSkeletonLoader:Rendered');
|
|
23
|
-
start('NgxSkeletonLoader:Loaded');
|
|
24
21
|
this.validateInputValues();
|
|
25
22
|
}
|
|
26
23
|
validateInputValues() {
|
|
@@ -70,18 +67,12 @@ class NgxSkeletonLoaderComponent {
|
|
|
70
67
|
}
|
|
71
68
|
this.validateInputValues();
|
|
72
69
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
ngOnDestroy() {
|
|
77
|
-
end('NgxSkeletonLoader:Loaded');
|
|
78
|
-
}
|
|
70
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
79
72
|
}
|
|
80
|
-
|
|
81
|
-
/** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
83
74
|
type: Component,
|
|
84
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"
|
|
75
|
+
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
|
|
85
76
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
86
77
|
type: Inject,
|
|
87
78
|
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
@@ -108,11 +99,11 @@ class NgxSkeletonLoaderModule {
|
|
|
108
99
|
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
109
100
|
};
|
|
110
101
|
}
|
|
102
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
103
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] }); }
|
|
104
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
|
|
111
105
|
}
|
|
112
|
-
|
|
113
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
|
|
114
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] });
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
116
107
|
type: NgModule,
|
|
117
108
|
args: [{
|
|
118
109
|
declarations: [NgxSkeletonLoaderComponent],
|
|
@@ -131,4 +122,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
131
122
|
|
|
132
123
|
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
|
|
133
124
|
//# sourceMappingURL=ngx-skeleton-loader.mjs.map
|
|
134
|
-
//# sourceMappingURL=ngx-skeleton-loader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-skeleton-loader.mjs","sources":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n // It enforces a combination of `fromRoot` styles with component `styles` attribute\n extendsFromRoot?: boolean;\n // This is required since ngStyle is using `any` as well\n // More details in https://angular.io/api/common/NgStyle\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n OnInit,\n Input,\n isDevMode,\n ChangeDetectionStrategy,\n OnChanges,\n SimpleChanges,\n Optional,\n Inject,\n} from '@angular/core';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n@Component({\n selector: 'ngx-skeleton-loader',\n templateUrl: './ngx-skeleton-loader.html',\n styleUrls: ['./ngx-skeleton-loader.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxSkeletonLoaderComponent implements OnInit, OnChanges {\n static ngAcceptInputType_count: number | string;\n static ngAcceptInputType_animation: boolean | string;\n\n @Input()\n count: NgxSkeletonLoaderConfig['count'];\n\n @Input()\n loadingText: NgxSkeletonLoaderConfig['loadingText'];\n\n @Input()\n appearance: NgxSkeletonLoaderConfig['appearance'];\n\n @Input()\n animation: NgxSkeletonLoaderConfig['animation'];\n\n @Input()\n ariaLabel: NgxSkeletonLoaderConfig['ariaLabel'];\n\n @Input()\n theme: NgxSkeletonLoaderConfigTheme;\n\n items: Array<any>;\n\n constructor(@Inject(NGX_SKELETON_LOADER_CONFIG) @Optional() private config?: NgxSkeletonLoaderConfig) {\n const {\n appearance = 'line',\n animation = 'progress',\n theme = null,\n loadingText = 'Loading...',\n count = 1,\n ariaLabel = 'loading',\n } = config || {};\n\n this.appearance = appearance;\n this.animation = animation;\n this.theme = theme;\n this.loadingText = loadingText;\n this.count = count;\n this.items = [];\n this.ariaLabel = ariaLabel;\n }\n\n ngOnInit() {\n this.validateInputValues();\n }\n\n private validateInputValues() {\n // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)\n if (!/^\\d+$/.test(`${this.count}`)) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'count' a numeric value. Forcing default to \"1\".`,\n );\n }\n this.count = 1;\n }\n\n //Force count to 1 when custom-content is used\n if (this.appearance === 'custom-content') {\n // Shows error message only in Development\n if (isDevMode() && this.count !== 1) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n this.count = 1;\n }\n }\n this.items.length = this.count;\n\n const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];\n if (allowedAnimations.indexOf(String(this.animation)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'animation' as: ${allowedAnimations.join(\n ', ',\n )}. Forcing default to \"progress\".`,\n );\n }\n this.animation = 'progress';\n }\n\n if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\n }\n\n if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {\n // Shows error message only in Development\n this.theme = { ...this.config!.theme, ...this.theme };\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // Avoiding multiple calls for the same input in case there's no changes in the fields\n // Checking if the fields that require validation are available and if they were changed\n // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.\n if (\n ['count', 'animation', 'appearance'].find(\n key =>\n changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue),\n )\n ) {\n return;\n }\n\n this.validateInputValues();\n }\n}\n","<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n declarations: [NgxSkeletonLoaderComponent],\n imports: [CommonModule],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule> {\n return {\n ngModule: NgxSkeletonLoaderModule,\n providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],\n };\n }\n}\n","/*\n * Public API Surface of ngx-skeleton-loader\n */\n\nexport * from './lib/ngx-skeleton-loader.component';\nexport * from './lib/ngx-skeleton-loader.module';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAmBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;ACFlH,MAMa,0BAA0B,CAAA;AAwBrC,IAAA,WAAA,CAAoE,MAAgC,EAAA;QAAhC,IAAM,CAAA,MAAA,GAAN,MAAM,CAA0B;AAClG,QAAA,MAAM,EACJ,UAAU,GAAG,MAAM,EACnB,SAAS,GAAG,UAAU,EACtB,KAAK,GAAG,IAAI,EACZ,WAAW,GAAG,YAAY,EAC1B,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,SAAS,GACtB,GAAG,MAAM,IAA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AAA,CAAA;kBALnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,0BAA0B,CAAC;oBAC1C,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,0BAA0B,CAAC;AACtC,iBAAA,CAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OnInit,
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme } from './ngx-skeleton-loader-config.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class NgxSkeletonLoaderComponent implements OnInit,
|
|
4
|
+
export declare class NgxSkeletonLoaderComponent implements OnInit, OnChanges {
|
|
5
5
|
private config?;
|
|
6
6
|
static ngAcceptInputType_count: number | string;
|
|
7
7
|
static ngAcceptInputType_animation: boolean | string;
|
|
@@ -16,8 +16,6 @@ export declare class NgxSkeletonLoaderComponent implements OnInit, AfterViewInit
|
|
|
16
16
|
ngOnInit(): void;
|
|
17
17
|
private validateInputValues;
|
|
18
18
|
ngOnChanges(changes: SimpleChanges): void;
|
|
19
|
-
ngAfterViewInit(): void;
|
|
20
|
-
ngOnDestroy(): void;
|
|
21
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, [{ optional: true; }]>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": "count"; "loadingText": "loadingText"; "appearance": "appearance"; "animation": "animation"; "ariaLabel": "ariaLabel"; "theme": "theme"; }, {}, never, ["*"], false, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": { "alias": "count"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
23
21
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-skeleton-loader",
|
|
3
3
|
"description": "Make beautiful, animated loading skeletons that automatically adapt to your Angular apps",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.0.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": ">=
|
|
7
|
-
"@angular/core": ">=
|
|
6
|
+
"@angular/common": ">=16.0.0",
|
|
7
|
+
"@angular/core": ">=16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"keywords": [
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"animation"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"perf-marks": "^1.13.4",
|
|
25
24
|
"tslib": "^2.0.0"
|
|
26
25
|
},
|
|
27
26
|
"repository": {
|
|
@@ -32,11 +31,7 @@
|
|
|
32
31
|
"url": "https://github.com/willmendesneto/ngx-skeleton-loader/issues"
|
|
33
32
|
},
|
|
34
33
|
"homepage": "https://github.com/willmendesneto/ngx-skeleton-loader#readme",
|
|
35
|
-
"module": "
|
|
36
|
-
"es2020": "fesm2020/ngx-skeleton-loader.mjs",
|
|
37
|
-
"esm2020": "esm2020/ngx-skeleton-loader.mjs",
|
|
38
|
-
"fesm2020": "fesm2020/ngx-skeleton-loader.mjs",
|
|
39
|
-
"fesm2015": "fesm2015/ngx-skeleton-loader.mjs",
|
|
34
|
+
"module": "fesm2022/ngx-skeleton-loader.mjs",
|
|
40
35
|
"typings": "index.d.ts",
|
|
41
36
|
"exports": {
|
|
42
37
|
"./package.json": {
|
|
@@ -44,11 +39,9 @@
|
|
|
44
39
|
},
|
|
45
40
|
".": {
|
|
46
41
|
"types": "./index.d.ts",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"node": "./fesm2015/ngx-skeleton-loader.mjs",
|
|
51
|
-
"default": "./fesm2020/ngx-skeleton-loader.mjs"
|
|
42
|
+
"esm2022": "./esm2022/ngx-skeleton-loader.mjs",
|
|
43
|
+
"esm": "./esm2022/ngx-skeleton-loader.mjs",
|
|
44
|
+
"default": "./fesm2022/ngx-skeleton-loader.mjs"
|
|
52
45
|
}
|
|
53
46
|
},
|
|
54
47
|
"sideEffects": false
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { Component, Input, isDevMode, ChangeDetectionStrategy, Optional, Inject, } from '@angular/core';
|
|
2
|
-
import { start, end } from 'perf-marks/marks';
|
|
3
|
-
import { NGX_SKELETON_LOADER_CONFIG, } from './ngx-skeleton-loader-config.types';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/common";
|
|
6
|
-
export class NgxSkeletonLoaderComponent {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
|
|
10
|
-
this.appearance = appearance;
|
|
11
|
-
this.animation = animation;
|
|
12
|
-
this.theme = theme;
|
|
13
|
-
this.loadingText = loadingText;
|
|
14
|
-
this.count = count;
|
|
15
|
-
this.items = [];
|
|
16
|
-
this.ariaLabel = ariaLabel;
|
|
17
|
-
}
|
|
18
|
-
ngOnInit() {
|
|
19
|
-
start('NgxSkeletonLoader:Rendered');
|
|
20
|
-
start('NgxSkeletonLoader:Loaded');
|
|
21
|
-
this.validateInputValues();
|
|
22
|
-
}
|
|
23
|
-
validateInputValues() {
|
|
24
|
-
// Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
|
|
25
|
-
if (!/^\d+$/.test(`${this.count}`)) {
|
|
26
|
-
// Shows error message only in Development
|
|
27
|
-
if (isDevMode()) {
|
|
28
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
|
|
29
|
-
}
|
|
30
|
-
this.count = 1;
|
|
31
|
-
}
|
|
32
|
-
//Force count to 1 when custom-content is used
|
|
33
|
-
if (this.appearance === 'custom-content') {
|
|
34
|
-
// Shows error message only in Development
|
|
35
|
-
if (isDevMode() && this.count !== 1) {
|
|
36
|
-
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
37
|
-
this.count = 1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
this.items.length = this.count;
|
|
41
|
-
const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
42
|
-
if (allowedAnimations.indexOf(String(this.animation)) === -1) {
|
|
43
|
-
// Shows error message only in Development
|
|
44
|
-
if (isDevMode()) {
|
|
45
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
|
|
46
|
-
}
|
|
47
|
-
this.animation = 'progress';
|
|
48
|
-
}
|
|
49
|
-
if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {
|
|
50
|
-
// Shows error message only in Development
|
|
51
|
-
if (isDevMode()) {
|
|
52
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to "''".`);
|
|
53
|
-
}
|
|
54
|
-
this.appearance = '';
|
|
55
|
-
}
|
|
56
|
-
if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {
|
|
57
|
-
// Shows error message only in Development
|
|
58
|
-
this.theme = { ...this.config.theme, ...this.theme };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
ngOnChanges(changes) {
|
|
62
|
-
// Avoiding multiple calls for the same input in case there's no changes in the fields
|
|
63
|
-
// Checking if the fields that require validation are available and if they were changed
|
|
64
|
-
// In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
|
|
65
|
-
if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
this.validateInputValues();
|
|
69
|
-
}
|
|
70
|
-
ngAfterViewInit() {
|
|
71
|
-
end('NgxSkeletonLoader:Rendered');
|
|
72
|
-
}
|
|
73
|
-
ngOnDestroy() {
|
|
74
|
-
end('NgxSkeletonLoader:Loaded');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
/** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
80
|
-
type: Component,
|
|
81
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
|
|
82
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
83
|
-
type: Inject,
|
|
84
|
-
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
85
|
-
}, {
|
|
86
|
-
type: Optional
|
|
87
|
-
}] }]; }, propDecorators: { count: [{
|
|
88
|
-
type: Input
|
|
89
|
-
}], loadingText: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], appearance: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], animation: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], ariaLabel: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}], theme: [{
|
|
98
|
-
type: Input
|
|
99
|
-
}] } });
|
|
100
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBRVQsS0FBSyxFQUNMLFNBQVMsRUFHVCx1QkFBdUIsRUFHdkIsUUFBUSx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29udGVudCc6IGFwcGVhcmFuY2UgPT09ICdjdXN0b20tY29udGVudCcsXG4gIGNpcmNsZTogYXBwZWFyYW5jZSA9PT0gJ2NpcmNsZScsXG4gICAgcHJvZ3Jlc3M6IGFuaW1hdGlvbiA9PT0gJ3Byb2dyZXNzJyxcbiAgICAncHJvZ3Jlc3MtZGFyayc6IGFuaW1hdGlvbiA9PT0gJ3Byb2dyZXNzLWRhcmsnLFxuICAgIHB1bHNlOiBhbmltYXRpb24gPT09ICdwdWxzZSdcbiAgfVwiXG4gIFtuZ1N0eWxlXT1cInRoZW1lXCJcbj5cbiAgPG5nLWNvbnRlbnQgKm5nSWY9XCJhcHBlYXJhbmNlICA9PT0gJ2N1c3RvbS1jb250ZW50J1wiPjwvbmctY29udGVudD5cbjwvZGl2PlxuXG5cblxuXG4iXX0=
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';
|
|
4
|
-
import { NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export class NgxSkeletonLoaderModule {
|
|
7
|
-
static forRoot(config) {
|
|
8
|
-
return {
|
|
9
|
-
ngModule: NgxSkeletonLoaderModule,
|
|
10
|
-
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
15
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
|
|
16
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] });
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
18
|
-
type: NgModule,
|
|
19
|
-
args: [{
|
|
20
|
-
declarations: [NgxSkeletonLoaderComponent],
|
|
21
|
-
imports: [CommonModule],
|
|
22
|
-
exports: [NgxSkeletonLoaderComponent],
|
|
23
|
-
}]
|
|
24
|
-
}] });
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdFLE9BQU8sRUFBMkIsMEJBQTBCLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQzs7QUFPekcsTUFBTSxPQUFPLHVCQUF1QjtJQUNsQyxNQUFNLENBQUMsT0FBTyxDQUFDLE1BQXlDO1FBQ3RELE9BQU87WUFDTCxRQUFRLEVBQUUsdUJBQXVCO1lB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25Mb2FkZXJNb2R1bGUge1xuICBzdGF0aWMgZm9yUm9vdChjb25maWc/OiBQYXJ0aWFsPE5neFNrZWxldG9uTG9hZGVyQ29uZmlnPik6IE1vZHVsZVdpdGhQcm92aWRlcnM8Tmd4U2tlbGV0b25Mb2FkZXJNb2R1bGU+IHtcbiAgICByZXR1cm4ge1xuICAgICAgbmdNb2R1bGU6IE5neFNrZWxldG9uTG9hZGVyTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbeyBwcm92aWRlOiBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRywgdXNlVmFsdWU6IGNvbmZpZyB9XSxcbiAgICB9O1xuICB9XG59XG4iXX0=
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, isDevMode, Component, ChangeDetectionStrategy, Inject, Optional, Input, NgModule } from '@angular/core';
|
|
3
|
-
import { start, end } from 'perf-marks/marks';
|
|
4
|
-
import * as i1 from '@angular/common';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
|
|
7
|
-
const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
|
|
8
|
-
|
|
9
|
-
class NgxSkeletonLoaderComponent {
|
|
10
|
-
constructor(config) {
|
|
11
|
-
this.config = config;
|
|
12
|
-
const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
|
|
13
|
-
this.appearance = appearance;
|
|
14
|
-
this.animation = animation;
|
|
15
|
-
this.theme = theme;
|
|
16
|
-
this.loadingText = loadingText;
|
|
17
|
-
this.count = count;
|
|
18
|
-
this.items = [];
|
|
19
|
-
this.ariaLabel = ariaLabel;
|
|
20
|
-
}
|
|
21
|
-
ngOnInit() {
|
|
22
|
-
start('NgxSkeletonLoader:Rendered');
|
|
23
|
-
start('NgxSkeletonLoader:Loaded');
|
|
24
|
-
this.validateInputValues();
|
|
25
|
-
}
|
|
26
|
-
validateInputValues() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
// Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
|
|
29
|
-
if (!/^\d+$/.test(`${this.count}`)) {
|
|
30
|
-
// Shows error message only in Development
|
|
31
|
-
if (isDevMode()) {
|
|
32
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
|
|
33
|
-
}
|
|
34
|
-
this.count = 1;
|
|
35
|
-
}
|
|
36
|
-
//Force count to 1 when custom-content is used
|
|
37
|
-
if (this.appearance === 'custom-content') {
|
|
38
|
-
// Shows error message only in Development
|
|
39
|
-
if (isDevMode() && this.count !== 1) {
|
|
40
|
-
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
41
|
-
this.count = 1;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
this.items.length = this.count;
|
|
45
|
-
const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
46
|
-
if (allowedAnimations.indexOf(String(this.animation)) === -1) {
|
|
47
|
-
// Shows error message only in Development
|
|
48
|
-
if (isDevMode()) {
|
|
49
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
|
|
50
|
-
}
|
|
51
|
-
this.animation = 'progress';
|
|
52
|
-
}
|
|
53
|
-
if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {
|
|
54
|
-
// Shows error message only in Development
|
|
55
|
-
if (isDevMode()) {
|
|
56
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to "''".`);
|
|
57
|
-
}
|
|
58
|
-
this.appearance = '';
|
|
59
|
-
}
|
|
60
|
-
if (Boolean((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.extendsFromRoot) && this.theme !== null) {
|
|
61
|
-
// Shows error message only in Development
|
|
62
|
-
this.theme = Object.assign(Object.assign({}, this.config.theme), this.theme);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
ngOnChanges(changes) {
|
|
66
|
-
// Avoiding multiple calls for the same input in case there's no changes in the fields
|
|
67
|
-
// Checking if the fields that require validation are available and if they were changed
|
|
68
|
-
// In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
|
|
69
|
-
if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
this.validateInputValues();
|
|
73
|
-
}
|
|
74
|
-
ngAfterViewInit() {
|
|
75
|
-
end('NgxSkeletonLoader:Rendered');
|
|
76
|
-
}
|
|
77
|
-
ngOnDestroy() {
|
|
78
|
-
end('NgxSkeletonLoader:Loaded');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
-
/** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
84
|
-
type: Component,
|
|
85
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
|
|
86
|
-
}], ctorParameters: function () {
|
|
87
|
-
return [{ type: undefined, decorators: [{
|
|
88
|
-
type: Inject,
|
|
89
|
-
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
90
|
-
}, {
|
|
91
|
-
type: Optional
|
|
92
|
-
}] }];
|
|
93
|
-
}, propDecorators: { count: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], loadingText: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}], appearance: [{
|
|
98
|
-
type: Input
|
|
99
|
-
}], animation: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], ariaLabel: [{
|
|
102
|
-
type: Input
|
|
103
|
-
}], theme: [{
|
|
104
|
-
type: Input
|
|
105
|
-
}] } });
|
|
106
|
-
|
|
107
|
-
class NgxSkeletonLoaderModule {
|
|
108
|
-
static forRoot(config) {
|
|
109
|
-
return {
|
|
110
|
-
ngModule: NgxSkeletonLoaderModule,
|
|
111
|
-
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
116
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
|
|
117
|
-
/** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] });
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
119
|
-
type: NgModule,
|
|
120
|
-
args: [{
|
|
121
|
-
declarations: [NgxSkeletonLoaderComponent],
|
|
122
|
-
imports: [CommonModule],
|
|
123
|
-
exports: [NgxSkeletonLoaderComponent],
|
|
124
|
-
}]
|
|
125
|
-
}] });
|
|
126
|
-
|
|
127
|
-
/*
|
|
128
|
-
* Public API Surface of ngx-skeleton-loader
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Generated bundle index. Do not edit.
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
|
|
136
|
-
//# sourceMappingURL=ngx-skeleton-loader.mjs.map
|
|
137
|
-
//# sourceMappingURL=ngx-skeleton-loader.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-skeleton-loader.mjs","sources":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n // It enforces a combination of `fromRoot` styles with component `styles` attribute\n extendsFromRoot?: boolean;\n // This is required since ngStyle is using `any` as well\n // More details in https://angular.io/api/common/NgStyle\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n OnInit,\n Input,\n isDevMode,\n OnDestroy,\n AfterViewInit,\n ChangeDetectionStrategy,\n OnChanges,\n SimpleChanges,\n Optional,\n Inject,\n} from '@angular/core';\nimport { start, end } from 'perf-marks/marks';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n@Component({\n selector: 'ngx-skeleton-loader',\n templateUrl: './ngx-skeleton-loader.html',\n styleUrls: ['./ngx-skeleton-loader.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxSkeletonLoaderComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges {\n // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match\n static ngAcceptInputType_count: number | string;\n // eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle, id-blacklist, id-match\n static ngAcceptInputType_animation: boolean | string;\n\n @Input()\n count: NgxSkeletonLoaderConfig['count'];\n\n @Input()\n loadingText: NgxSkeletonLoaderConfig['loadingText'];\n\n @Input()\n appearance: NgxSkeletonLoaderConfig['appearance'];\n\n @Input()\n animation: NgxSkeletonLoaderConfig['animation'];\n\n @Input()\n ariaLabel: NgxSkeletonLoaderConfig['ariaLabel'];\n\n @Input()\n theme: NgxSkeletonLoaderConfigTheme;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n items: Array<any>;\n\n constructor(@Inject(NGX_SKELETON_LOADER_CONFIG) @Optional() private config?: NgxSkeletonLoaderConfig) {\n const {\n appearance = 'line',\n animation = 'progress',\n theme = null,\n loadingText = 'Loading...',\n count = 1,\n ariaLabel = 'loading',\n } = config || {};\n\n this.appearance = appearance;\n this.animation = animation;\n this.theme = theme;\n this.loadingText = loadingText;\n this.count = count;\n this.items = [];\n this.ariaLabel = ariaLabel;\n }\n\n ngOnInit() {\n start('NgxSkeletonLoader:Rendered');\n start('NgxSkeletonLoader:Loaded');\n\n this.validateInputValues();\n }\n\n private validateInputValues() {\n // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)\n if (!/^\\d+$/.test(`${this.count}`)) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'count' a numeric value. Forcing default to \"1\".`,\n );\n }\n this.count = 1;\n }\n\n //Force count to 1 when custom-content is used\n if (this.appearance === 'custom-content') {\n // Shows error message only in Development\n if (isDevMode() && this.count !== 1) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n this.count = 1;\n }\n }\n this.items.length = this.count;\n\n const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];\n if (allowedAnimations.indexOf(String(this.animation)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'animation' as: ${allowedAnimations.join(\n ', ',\n )}. Forcing default to \"progress\".`,\n );\n }\n this.animation = 'progress';\n }\n\n if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\n }\n\n if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {\n // Shows error message only in Development\n this.theme = { ...this.config!.theme, ...this.theme };\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // Avoiding multiple calls for the same input in case there's no changes in the fields\n // Checking if the fields that require validation are available and if they were changed\n // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.\n if (\n ['count', 'animation', 'appearance'].find(\n key =>\n changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue),\n )\n ) {\n return;\n }\n\n this.validateInputValues();\n }\n\n ngAfterViewInit() {\n end('NgxSkeletonLoader:Rendered');\n }\n\n ngOnDestroy() {\n end('NgxSkeletonLoader:Loaded');\n }\n}\n","<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n declarations: [NgxSkeletonLoaderComponent],\n imports: [CommonModule],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule> {\n return {\n ngModule: NgxSkeletonLoaderModule,\n providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],\n };\n }\n}\n","/*\n * Public API Surface of ngx-skeleton-loader\n */\n\nexport * from './lib/ngx-skeleton-loader.component';\nexport * from './lib/ngx-skeleton-loader.module';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAoBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;MCMrG,0BAA0B,CAAA;AA2BrC,IAAA,WAAA,CAAoE,MAAgC,EAAA;AAAhC,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAA0B;AAClG,QAAA,MAAM,EACJ,UAAU,GAAG,MAAM,EACnB,SAAS,GAAG,UAAU,EACtB,KAAK,GAAG,IAAI,EACZ,WAAW,GAAG,YAAY,EAC1B,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,SAAS,GACtB,GAAG,MAAM,IAAI,EAAE,CAAC;AAEjB,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;AAC3B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AAChB,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC5B;IAED,QAAQ,GAAA;QACN,KAAK,CAAC,4BAA4B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A,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,0BAA0B,CAAC;oBAC1C,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,0BAA0B,CAAC;iBACtC,CAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-skeleton-loader.mjs","sources":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n // It enforces a combination of `fromRoot` styles with component `styles` attribute\n extendsFromRoot?: boolean;\n // This is required since ngStyle is using `any` as well\n // More details in https://angular.io/api/common/NgStyle\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n OnInit,\n Input,\n isDevMode,\n OnDestroy,\n AfterViewInit,\n ChangeDetectionStrategy,\n OnChanges,\n SimpleChanges,\n Optional,\n Inject,\n} from '@angular/core';\nimport { start, end } from 'perf-marks/marks';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n@Component({\n selector: 'ngx-skeleton-loader',\n templateUrl: './ngx-skeleton-loader.html',\n styleUrls: ['./ngx-skeleton-loader.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxSkeletonLoaderComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges {\n // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match\n static ngAcceptInputType_count: number | string;\n // eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle, id-blacklist, id-match\n static ngAcceptInputType_animation: boolean | string;\n\n @Input()\n count: NgxSkeletonLoaderConfig['count'];\n\n @Input()\n loadingText: NgxSkeletonLoaderConfig['loadingText'];\n\n @Input()\n appearance: NgxSkeletonLoaderConfig['appearance'];\n\n @Input()\n animation: NgxSkeletonLoaderConfig['animation'];\n\n @Input()\n ariaLabel: NgxSkeletonLoaderConfig['ariaLabel'];\n\n @Input()\n theme: NgxSkeletonLoaderConfigTheme;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n items: Array<any>;\n\n constructor(@Inject(NGX_SKELETON_LOADER_CONFIG) @Optional() private config?: NgxSkeletonLoaderConfig) {\n const {\n appearance = 'line',\n animation = 'progress',\n theme = null,\n loadingText = 'Loading...',\n count = 1,\n ariaLabel = 'loading',\n } = config || {};\n\n this.appearance = appearance;\n this.animation = animation;\n this.theme = theme;\n this.loadingText = loadingText;\n this.count = count;\n this.items = [];\n this.ariaLabel = ariaLabel;\n }\n\n ngOnInit() {\n start('NgxSkeletonLoader:Rendered');\n start('NgxSkeletonLoader:Loaded');\n\n this.validateInputValues();\n }\n\n private validateInputValues() {\n // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)\n if (!/^\\d+$/.test(`${this.count}`)) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'count' a numeric value. Forcing default to \"1\".`,\n );\n }\n this.count = 1;\n }\n\n //Force count to 1 when custom-content is used\n if (this.appearance === 'custom-content') {\n // Shows error message only in Development\n if (isDevMode() && this.count !== 1) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n this.count = 1;\n }\n }\n this.items.length = this.count;\n\n const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];\n if (allowedAnimations.indexOf(String(this.animation)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'animation' as: ${allowedAnimations.join(\n ', ',\n )}. Forcing default to \"progress\".`,\n );\n }\n this.animation = 'progress';\n }\n\n if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\n }\n\n if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {\n // Shows error message only in Development\n this.theme = { ...this.config!.theme, ...this.theme };\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // Avoiding multiple calls for the same input in case there's no changes in the fields\n // Checking if the fields that require validation are available and if they were changed\n // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.\n if (\n ['count', 'animation', 'appearance'].find(\n key =>\n changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue),\n )\n ) {\n return;\n }\n\n this.validateInputValues();\n }\n\n ngAfterViewInit() {\n end('NgxSkeletonLoader:Rendered');\n }\n\n ngOnDestroy() {\n end('NgxSkeletonLoader:Loaded');\n }\n}\n","<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n declarations: [NgxSkeletonLoaderComponent],\n imports: [CommonModule],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule> {\n return {\n ngModule: NgxSkeletonLoaderModule,\n providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],\n };\n }\n}\n","/*\n * Public API Surface of ngx-skeleton-loader\n */\n\nexport * from './lib/ngx-skeleton-loader.component';\nexport * from './lib/ngx-skeleton-loader.module';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAoBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;MCMrG,0BAA0B,CAAA;AA2BrC,IAAA,WAAA,CAAoE,MAAgC,EAAA;QAAhC,IAAM,CAAA,MAAA,GAAN,MAAM,CAA0B;AAClG,QAAA,MAAM,EACJ,UAAU,GAAG,MAAM,EACnB,SAAS,GAAG,UAAU,EACtB,KAAK,GAAG,IAAI,EACZ,WAAW,GAAG,YAAY,EAC1B,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,SAAS,GACtB,GAAG,MAAM,IAAI,EAAE,CAAC;AAEjB,QAAA,IAAI,CAAC,UAAU,GAA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