ngx-skeleton-loader 6.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 CHANGED
@@ -7,6 +7,66 @@ 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
+
22
+ ## [7.0.0][] - 2023-02-04
23
+
24
+ ### Added
25
+
26
+ - Adding support for extending global theme added via `NgxSkeletonLoaderModule.forRoot({ theme: /* ...list of CSS atributes */} })`
27
+
28
+ By default when using `NgxSkeletonLoaderModule.forRoot({ theme: /* ...list of CSS atributes */} })` the application is using this value as source of truth, overriding any local theming passed to `<ngx-skeleton-loader>` component via `[theme]` input.
29
+
30
+ By using `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* ...list of CSS atributes */} })` in your application, you should also be aware that:
31
+
32
+ - By default, every `<ngx-skeleton-loader>` component will use `theme` coming from `NgxSkeletonLoaderModule.forRoot()` as the source of truth
33
+ - If there's any CSS attribute on the component locally which overrides the CSS spec, it combines both themes, but overriding global CSS attributes in favor of local ones.
34
+
35
+ ```html
36
+ <!--
37
+ // ... E.G: App is using this configuration below
38
+
39
+ NgxSkeletonLoaderModule.forRoot({
40
+ theme: {
41
+ // Enabliong theme combination
42
+ extendsFromRoot: true,
43
+ // ... list of CSS theme attributes
44
+ height: '30px',
45
+ },
46
+ }),
47
+ -->
48
+
49
+ <div class="item">
50
+ <ngx-skeleton-loader></ngx-skeleton-loader>
51
+ <!-- above line will produce a skeleton component using `height: 30px;`" -->
52
+ <ngx-skeleton-loader [theme]="{background: 'blue'}"></ngx-skeleton-loader>
53
+ <!-- above line will produce a skeleton component using `height: 30px; background: blue;`" -->
54
+ <ngx-skeleton-loader [theme]="{height: '50px', background: 'red'}"></ngx-skeleton-loader>
55
+ <!-- above line will produce a skeleton component using `height: 50px; background: red;`" -->
56
+ </div>
57
+ ```
58
+
59
+ - Adding new `custom-content` appearance. From now on, consumers can now add their own content inside `<ng-skeleton-loader></ng-skeleton-loader>` component. So that, they can add some custom content, such as SVG, as an example
60
+ - Adding examples for `custom-content` usage
61
+
62
+ ### Updated
63
+
64
+ - Updagrading module to Angular v15
65
+
66
+ ### Fixed
67
+
68
+ - Removing build warnings
69
+
10
70
  ## [6.0.0][] - 2022-08-18
11
71
 
12
72
  ### Updated
@@ -506,7 +566,8 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
506
566
  [3.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v3.0.0
507
567
  [unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v5.0.0...HEAD
508
568
  [5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
509
-
510
-
511
- [Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
512
- [6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
569
+ [unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
570
+ [6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.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
package/README.md CHANGED
@@ -118,6 +118,59 @@ export class YourAppComponent {}
118
118
  </div>
119
119
  ```
120
120
 
121
+ #### Extending `theme` via `NgxSkeletonLoaderModule.forRoot()`
122
+
123
+ > By default when using `NgxSkeletonLoaderModule.forRoot({ theme: /* ...list of CSS atributes */} })` the application is using this value as source of truth, overriding any local theming passed to `<ngx-skeleton-loader>` component via `[theme]` input. Check these steps in case you need to change this behaviour in your app
124
+
125
+ This method is also accepting the option of having a global theme and local theme inputs. You can enable it by passing `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* ...list of CSS atributes */} })` in your module. Quite simple, right? 😄
126
+
127
+ By using that configuration in your application, you should also be aware that:
128
+
129
+ - By default, every `<ngx-skeleton-loader>` component will use `theme` coming from `NgxSkeletonLoaderModule.forRoot()` as the source of truth
130
+ - If there's any CSS attribute on the component locally which overrides the CSS spec, it combines both themes, but overriding global CSS attributes in favor of local ones.
131
+
132
+ As an example:
133
+
134
+ ```typescript
135
+ ...
136
+ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
137
+ ...
138
+
139
+ @NgModule({
140
+ declarations: [
141
+ YourAppComponent
142
+ ],
143
+ imports: [
144
+ ...
145
+ NgxSkeletonLoaderModule.forRoot({
146
+ theme: {
147
+ // Enabliong theme combination
148
+ extendsFromRoot: true,
149
+ // ... list of CSS theme attributes
150
+ height: '30px',
151
+ },
152
+ }),
153
+ ...
154
+ ],
155
+ providers: [],
156
+ bootstrap: [YourAppComponent]
157
+ })
158
+
159
+ export class YourAppComponent {}
160
+
161
+ ```
162
+
163
+ ```html
164
+ <div class="item">
165
+ <ngx-skeleton-loader></ngx-skeleton-loader>
166
+ <!-- above line will produce a skeleton component using `height: 30px;`" -->
167
+ <ngx-skeleton-loader [theme]="{background: 'blue'}"></ngx-skeleton-loader>
168
+ <!-- above line will produce a skeleton component using `height: 30px; background: blue;`" -->
169
+ <ngx-skeleton-loader [theme]="{height: '50px', background: 'red'}"></ngx-skeleton-loader>
170
+ <!-- above line will produce a skeleton component using `height: 50px; background: red;`" -->
171
+ </div>
172
+ ```
173
+
121
174
  ## WAI-ARIA values
122
175
 
123
176
  - loadingText - _default_ `Loading...`: attribute that defines the text value for `aria-valuetext` attribute. Defaults to "Loading..."
@@ -132,6 +185,7 @@ You can also define which appearance want to use in your skeleton loader by pass
132
185
  - `''` - _default_: it will use it `''` as appearance. At the end, it will render like a line;
133
186
  - `line`: it will render like a line. This is the same behavior as passing an empty string;
134
187
  - `circle`: it will use `circle` as appearance. Great for avatar skeletons, for example :);
188
+ - `custom-content`: it will NOT add any appearance. Great for custom content, such as SVG, internal components and such;
135
189
 
136
190
  ## Animations
137
191
 
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQW1CL0MsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsSUFBSSxjQUFjLENBQTBCLDRCQUE0QixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgdHlwZSBOZ3hTa2VsZXRvbkxvYWRlckNvbmZpZ1RoZW1lID0ge1xuICAvLyBJdCBlbmZvcmNlcyBhIGNvbWJpbmF0aW9uIG9mIGBmcm9tUm9vdGAgc3R5bGVzIHdpdGggY29tcG9uZW50IGBzdHlsZXNgIGF0dHJpYnV0ZVxuICBleHRlbmRzRnJvbVJvb3Q/OiBib29sZWFuO1xuICAvLyBUaGlzIGlzIHJlcXVpcmVkIHNpbmNlIG5nU3R5bGUgaXMgdXNpbmcgYGFueWAgYXMgd2VsbFxuICAvLyBNb3JlIGRldGFpbHMgaW4gaHR0cHM6Ly9hbmd1bGFyLmlvL2FwaS9jb21tb24vTmdTdHlsZVxuICBbazogc3RyaW5nXTogYW55O1xufSB8IG51bGw7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTmd4U2tlbGV0b25Mb2FkZXJDb25maWcge1xuICBhcHBlYXJhbmNlOiAnY2lyY2xlJyB8ICdsaW5lJyB8ICdjdXN0b20tY29udGVudCcgfCAnJztcbiAgYW5pbWF0aW9uOiAncHJvZ3Jlc3MnIHwgJ3Byb2dyZXNzLWRhcmsnIHwgJ3B1bHNlJyB8ICdmYWxzZScgfCBmYWxzZTtcbiAgdGhlbWU6IE5neFNrZWxldG9uTG9hZGVyQ29uZmlnVGhlbWU7XG4gIGxvYWRpbmdUZXh0OiBzdHJpbmc7XG4gIGNvdW50OiBudW1iZXI7XG4gIGFyaWFMYWJlbDogc3RyaW5nO1xufVxuXG5leHBvcnQgY29uc3QgTkdYX1NLRUxFVE9OX0xPQURFUl9DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9rZW48Tmd4U2tlbGV0b25Mb2FkZXJDb25maWc+KCduZ3gtc2tlbGV0b24tbG9hZGVyLmNvbmZpZycpO1xuIl19
@@ -0,0 +1,92 @@
1
+ import { Component, Input, isDevMode, ChangeDetectionStrategy, Optional, 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBRVQsS0FBSyxFQUNMLFNBQVMsRUFDVCx1QkFBdUIsRUFHdkIsUUFBUSxFQUNSLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBR0wsMEJBQTBCLEdBQzNCLE1BQU0sb0NBQW9DLENBQUM7OztBQUU1QyxNQU1hLDBCQUEwQjtJQXdCckMsWUFBb0UsTUFBZ0M7UUFBaEMsV0FBTSxHQUFOLE1BQU0sQ0FBMEI7UUFDbEcsTUFBTSxFQUNKLFVBQVUsR0FBRyxNQUFNLEVBQ25CLFNBQVMsR0FBRyxVQUFVLEVB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wZWFyYW5jZSAgPT09ICdjdXN0b20tY29udGVudCdcIj48L25nLWNvbnRlbnQ+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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJz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b20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuaW1wb3J0IHsgTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnQgfSBmcm9tICcuL25neC1za2VsZXRvbi1sb2FkZXIuY29tcG9uZW50JztcbmltcG9ydCB7IE5neFNrZWxldG9uTG9hZGVyQ29uZmlnLCBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRyB9IGZyb20gJy4vbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtOZ3hTa2VsZXRvbkxvYWRlckNvbXBvbmVudF0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdLFxuICBleHBvcnRzOiBbTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnRdLFxufSlcbmV4cG9ydCBjbGFzcyBOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZSB7XG4gIHN0YXRpYyBmb3JSb290KGNvbmZpZz86IFBhcnRpYWw8Tmd4U2tlbGV0b25Mb2FkZXJDb25maWc+KTogTW9kdWxlV2l0aFByb3ZpZGVyczxOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZT4ge1xuICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogTmd4U2tlbGV0b25Mb2FkZXJNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFt7IHByb3ZpZGU6IE5HWF9TS0VMRVRPTl9MT0FERVJfQ09ORklHLCB1c2VWYWx1ZTogY29uZmlnIH1dLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,124 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, isDevMode, Component, ChangeDetectionStrategy, Inject, Optional, Input, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+
6
+ const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
7
+
8
+ class NgxSkeletonLoaderComponent {
9
+ constructor(config) {
10
+ this.config = config;
11
+ const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
12
+ this.appearance = appearance;
13
+ this.animation = animation;
14
+ this.theme = theme;
15
+ this.loadingText = loadingText;
16
+ this.count = count;
17
+ this.items = [];
18
+ this.ariaLabel = ariaLabel;
19
+ }
20
+ ngOnInit() {
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
+ /** @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 }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
74
+ type: Component,
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"] }]
76
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
77
+ type: Inject,
78
+ args: [NGX_SKELETON_LOADER_CONFIG]
79
+ }, {
80
+ type: Optional
81
+ }] }]; }, propDecorators: { count: [{
82
+ type: Input
83
+ }], loadingText: [{
84
+ type: Input
85
+ }], appearance: [{
86
+ type: Input
87
+ }], animation: [{
88
+ type: Input
89
+ }], ariaLabel: [{
90
+ type: Input
91
+ }], theme: [{
92
+ type: Input
93
+ }] } });
94
+
95
+ class NgxSkeletonLoaderModule {
96
+ static forRoot(config) {
97
+ return {
98
+ ngModule: NgxSkeletonLoaderModule,
99
+ providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
100
+ };
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] }); }
105
+ }
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
107
+ type: NgModule,
108
+ args: [{
109
+ declarations: [NgxSkeletonLoaderComponent],
110
+ imports: [CommonModule],
111
+ exports: [NgxSkeletonLoaderComponent],
112
+ }]
113
+ }] });
114
+
115
+ /*
116
+ * Public API Surface of ngx-skeleton-loader
117
+ */
118
+
119
+ /**
120
+ * Generated bundle index. Do not edit.
121
+ */
122
+
123
+ export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
124
+ //# 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,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,CA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-1,9 +1,10 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- export declare type NgxSkeletonLoaderConfigTheme = {
2
+ export type NgxSkeletonLoaderConfigTheme = {
3
+ extendsFromRoot?: boolean;
3
4
  [k: string]: any;
4
5
  } | null;
5
6
  export interface NgxSkeletonLoaderConfig {
6
- appearance: 'circle' | 'line' | '';
7
+ appearance: 'circle' | 'line' | 'custom-content' | '';
7
8
  animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;
8
9
  theme: NgxSkeletonLoaderConfigTheme;
9
10
  loadingText: string;
@@ -1,7 +1,8 @@
1
- import { OnInit, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
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, AfterViewInit, OnDestroy, OnChanges {
4
+ export declare class NgxSkeletonLoaderComponent implements OnInit, OnChanges {
5
+ private config?;
5
6
  static ngAcceptInputType_count: number | string;
6
7
  static ngAcceptInputType_animation: boolean | string;
7
8
  count: NgxSkeletonLoaderConfig['count'];
@@ -11,12 +12,10 @@ export declare class NgxSkeletonLoaderComponent implements OnInit, AfterViewInit
11
12
  ariaLabel: NgxSkeletonLoaderConfig['ariaLabel'];
12
13
  theme: NgxSkeletonLoaderConfigTheme;
13
14
  items: Array<any>;
14
- constructor(config?: NgxSkeletonLoaderConfig);
15
+ constructor(config?: NgxSkeletonLoaderConfig | undefined);
15
16
  ngOnInit(): void;
16
17
  private validateInputValues;
17
18
  ngOnChanges(changes: SimpleChanges): void;
18
- ngAfterViewInit(): void;
19
- ngOnDestroy(): void;
20
19
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, [{ optional: true; }]>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": "count"; "loadingText": "loadingText"; "appearance": "appearance"; "animation": "animation"; "ariaLabel": "ariaLabel"; "theme": "theme"; }, {}, never, 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>;
22
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": "6.0.0",
4
+ "version": "8.0.0",
5
5
  "peerDependencies": {
6
- "@angular/common": ">=8.0.0",
7
- "@angular/core": ">=8.0.0"
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,23 +31,17 @@
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": "fesm2015/ngx-skeleton-loader.mjs",
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",
40
- "typings": "ngx-skeleton-loader.d.ts",
34
+ "module": "fesm2022/ngx-skeleton-loader.mjs",
35
+ "typings": "index.d.ts",
41
36
  "exports": {
42
37
  "./package.json": {
43
38
  "default": "./package.json"
44
39
  },
45
40
  ".": {
46
- "types": "./ngx-skeleton-loader.d.ts",
47
- "esm2020": "./esm2020/ngx-skeleton-loader.mjs",
48
- "es2020": "./fesm2020/ngx-skeleton-loader.mjs",
49
- "es2015": "./fesm2015/ngx-skeleton-loader.mjs",
50
- "node": "./fesm2015/ngx-skeleton-loader.mjs",
51
- "default": "./fesm2020/ngx-skeleton-loader.mjs"
41
+ "types": "./index.d.ts",
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,3 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQWtCL0MsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsSUFBSSxjQUFjLENBQTBCLDRCQUE0QixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgdHlwZSBOZ3hTa2VsZXRvbkxvYWRlckNvbmZpZ1RoZW1lID0ge1xuICAvLyBUaGlzIGlzIHJlcXVpcmVkIHNpbmNlIG5nU3R5bGUgaXMgdXNpbmcgYGFueWAgYXMgd2VsbFxuICAvLyBNb3JlIGRldGFpbHMgaW4gaHR0cHM6Ly9hbmd1bGFyLmlvL2FwaS9jb21tb24vTmdTdHlsZVxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICBbazogc3RyaW5nXTogYW55O1xufSB8IG51bGw7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTmd4U2tlbGV0b25Mb2FkZXJDb25maWcge1xuICBhcHBlYXJhbmNlOiAnY2lyY2xlJyB8ICdsaW5lJyB8ICcnO1xuICBhbmltYXRpb246ICdwcm9ncmVzcycgfCAncHJvZ3Jlc3MtZGFyaycgfCAncHVsc2UnIHwgJ2ZhbHNlJyB8IGZhbHNlO1xuICB0aGVtZTogTmd4U2tlbGV0b25Mb2FkZXJDb25maWdUaGVtZTtcbiAgbG9hZGluZ1RleHQ6IHN0cmluZztcbiAgY291bnQ6IG51bWJlcjtcbiAgYXJpYUxhYmVsOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBjb25zdCBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRyA9IG5ldyBJbmplY3Rpb25Ub2tlbjxOZ3hTa2VsZXRvbkxvYWRlckNvbmZpZz4oJ25neC1za2VsZXRvbi1sb2FkZXIuY29uZmlnJyk7XG4iXX0=
@@ -1,87 +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
- 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
- start('NgxSkeletonLoader:Rendered');
19
- start('NgxSkeletonLoader:Loaded');
20
- this.validateInputValues();
21
- }
22
- validateInputValues() {
23
- // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
24
- if (!/^\d+$/.test(`${this.count}`)) {
25
- // Shows error message only in Development
26
- if (isDevMode()) {
27
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
28
- }
29
- this.count = 1;
30
- }
31
- this.items.length = this.count;
32
- const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
33
- if (allowedAnimations.indexOf(String(this.animation)) === -1) {
34
- // Shows error message only in Development
35
- if (isDevMode()) {
36
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
37
- }
38
- this.animation = 'progress';
39
- }
40
- if (['circle', 'line', ''].indexOf(String(this.appearance)) === -1) {
41
- // Shows error message only in Development
42
- if (isDevMode()) {
43
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or empty string. Forcing default to "''".`);
44
- }
45
- this.appearance = '';
46
- }
47
- }
48
- ngOnChanges(changes) {
49
- // Avoiding multiple calls for the same input in case there's no changes in the fields
50
- // Checking if the fields that require validation are available and if they were changed
51
- // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
52
- if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
53
- return;
54
- }
55
- this.validateInputValues();
56
- }
57
- ngAfterViewInit() {
58
- end('NgxSkeletonLoader:Rendered');
59
- }
60
- ngOnDestroy() {
61
- end('NgxSkeletonLoader:Loaded');
62
- }
63
- }
64
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
65
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
67
- type: Component,
68
- args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
69
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
70
- type: Inject,
71
- args: [NGX_SKELETON_LOADER_CONFIG]
72
- }, {
73
- type: Optional
74
- }] }]; }, propDecorators: { count: [{
75
- type: Input
76
- }], loadingText: [{
77
- type: Input
78
- }], appearance: [{
79
- type: Input
80
- }], animation: [{
81
- type: Input
82
- }], ariaLabel: [{
83
- type: Input
84
- }], theme: [{
85
- type: Input
86
- }] } });
87
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBRVQsS0FBSyxFQUNMLFNBQVMsRUFHVCx1QkFBdUIsRUFHdkIsUUFBUSxFQUNSLE1BQU0sR0FDUCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzlDLE9BQU8sRUFHTCwwQkFBMEIsR0FDM0IsTUFBTSxvQ0FBb0MsQ0FBQzs7O0FBUTVDLE1BQU0sT0FBTywwQkFBMEI7SUEyQnJDLFlBQTRELE1BQWdDO1FBQzFGLE1BQU0sRUFDSixVQUFVLEdBQUcsTUFBTSxFQUNuQixTQUFTLEdBQUcsVUFBVSxFQUN0QixLQUFLLEdBQUcsSUFBSSxFQUNaLFdBQVcsR0FBRyxZQUFZLEVBQzFCLEtBQUssR0FBRyxDQUFDLEVBQ1QsU0FBUyxHQUFHLFNBQVMsR0FDdEIsR0FBRyxNQUFNLElBQUksRUFBRSxDQUFDO1FBRWpCLElBQUksQ0FBQyxVQUF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x1ZXRleHRdPVwibG9hZGluZ1RleHRcIlxuICByb2xlPVwicHJvZ3Jlc3NiYXJcIlxuICB0YWJpbmRleD1cIjBcIlxuICBbbmdDbGFzc109XCJ7XG4gICAgY2lyY2xlOiBhcHBlYXJhbmNlID09PSAnY2lyY2xlJyxcbiAgICBwcm9ncmVzczogYW5pbWF0aW9uID09PSAncHJvZ3Jlc3MnLFxuICAgICdwcm9ncmVzcy1kYXJrJzogYW5pbWF0aW9uID09PSAncHJvZ3Jlc3MtZGFyaycsXG4gICAgcHVsc2U6IGFuaW1hdGlvbiA9PT0gJ3B1bHNlJ1xuICB9XCJcbiAgW25nU3R5bGVdPVwidGhlbWVcIlxuPlxuPC9zcGFuPlxuIl19
@@ -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 */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
15
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
16
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [[CommonModule]] });
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdFLE9BQU8sRUFBMkIsMEJBQTBCLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQzs7QUFPekcsTUFBTSxPQUFPLHVCQUF1QjtJQUNsQyxNQUFNLENBQUMsT0FBTyxDQUFDLE1BQXlDO1FBQ3RELE9BQU87WUFDTCxRQUFRLEVBQUUsdUJBQXVCO1lBQ2pDLFNBQVMsRUFBRSxDQUFDLEVBQUUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLFFBQVEsRUFBRSxNQUFNLEVBQUUsQ0FBQztTQUN2RSxDQUFDO0lBQ0osQ0FBQzs7MEpBTlUsdUJBQXVCOzJKQUF2Qix1QkFBdUIsaUJBSm5CLDBCQUEwQixhQUMvQixZQUFZLGFBQ1osMEJ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TW9kdWxlOiBOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZSxcbiAgICAgIHByb3ZpZGVyczogW3sgcHJvdmlkZTogTkdYX1NLRUxFVE9OX0xPQURFUl9DT05GSUcsIHVzZVZhbHVlOiBjb25maWcgfV0sXG4gICAgfTtcbiAgfVxufVxuIl19
@@ -1,122 +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
- const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
12
- this.appearance = appearance;
13
- this.animation = animation;
14
- this.theme = theme;
15
- this.loadingText = loadingText;
16
- this.count = count;
17
- this.items = [];
18
- this.ariaLabel = ariaLabel;
19
- }
20
- ngOnInit() {
21
- start('NgxSkeletonLoader:Rendered');
22
- start('NgxSkeletonLoader:Loaded');
23
- this.validateInputValues();
24
- }
25
- validateInputValues() {
26
- // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
27
- if (!/^\d+$/.test(`${this.count}`)) {
28
- // Shows error message only in Development
29
- if (isDevMode()) {
30
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
31
- }
32
- this.count = 1;
33
- }
34
- this.items.length = this.count;
35
- const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
36
- if (allowedAnimations.indexOf(String(this.animation)) === -1) {
37
- // Shows error message only in Development
38
- if (isDevMode()) {
39
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
40
- }
41
- this.animation = 'progress';
42
- }
43
- if (['circle', 'line', ''].indexOf(String(this.appearance)) === -1) {
44
- // Shows error message only in Development
45
- if (isDevMode()) {
46
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or empty string. Forcing default to "''".`);
47
- }
48
- this.appearance = '';
49
- }
50
- }
51
- ngOnChanges(changes) {
52
- // Avoiding multiple calls for the same input in case there's no changes in the fields
53
- // Checking if the fields that require validation are available and if they were changed
54
- // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
55
- if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
56
- return;
57
- }
58
- this.validateInputValues();
59
- }
60
- ngAfterViewInit() {
61
- end('NgxSkeletonLoader:Rendered');
62
- }
63
- ngOnDestroy() {
64
- end('NgxSkeletonLoader:Loaded');
65
- }
66
- }
67
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
68
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
70
- type: Component,
71
- args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
72
- }], ctorParameters: function () {
73
- return [{ type: undefined, decorators: [{
74
- type: Inject,
75
- args: [NGX_SKELETON_LOADER_CONFIG]
76
- }, {
77
- type: Optional
78
- }] }];
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
-
93
- class NgxSkeletonLoaderModule {
94
- static forRoot(config) {
95
- return {
96
- ngModule: NgxSkeletonLoaderModule,
97
- providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
98
- };
99
- }
100
- }
101
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
102
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
103
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [[CommonModule]] });
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
105
- type: NgModule,
106
- args: [{
107
- declarations: [NgxSkeletonLoaderComponent],
108
- imports: [CommonModule],
109
- exports: [NgxSkeletonLoaderComponent],
110
- }]
111
- }] });
112
-
113
- /*
114
- * Public API Surface of ngx-skeleton-loader
115
- */
116
-
117
- /**
118
- * Generated bundle index. Do not edit.
119
- */
120
-
121
- export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
122
- //# 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 // 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' | '';\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() 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 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', ''].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 empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\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","<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\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":";;;;;;MAkBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;MCQrG,0BAA0B;IA2BrC,YAA4D,MAAgC;QAC1F,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;QAEjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAA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D;;;;ACAA;;;;;;"}
@@ -1,120 +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
- const { appearance = 'line', animation = 'progress', theme = null, loadingText = 'Loading...', count = 1, ariaLabel = 'loading', } = config || {};
12
- this.appearance = appearance;
13
- this.animation = animation;
14
- this.theme = theme;
15
- this.loadingText = loadingText;
16
- this.count = count;
17
- this.items = [];
18
- this.ariaLabel = ariaLabel;
19
- }
20
- ngOnInit() {
21
- start('NgxSkeletonLoader:Rendered');
22
- start('NgxSkeletonLoader:Loaded');
23
- this.validateInputValues();
24
- }
25
- validateInputValues() {
26
- // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)
27
- if (!/^\d+$/.test(`${this.count}`)) {
28
- // Shows error message only in Development
29
- if (isDevMode()) {
30
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'count' a numeric value. Forcing default to "1".`);
31
- }
32
- this.count = 1;
33
- }
34
- this.items.length = this.count;
35
- const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
36
- if (allowedAnimations.indexOf(String(this.animation)) === -1) {
37
- // Shows error message only in Development
38
- if (isDevMode()) {
39
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
40
- }
41
- this.animation = 'progress';
42
- }
43
- if (['circle', 'line', ''].indexOf(String(this.appearance)) === -1) {
44
- // Shows error message only in Development
45
- if (isDevMode()) {
46
- console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or empty string. Forcing default to "''".`);
47
- }
48
- this.appearance = '';
49
- }
50
- }
51
- ngOnChanges(changes) {
52
- // Avoiding multiple calls for the same input in case there's no changes in the fields
53
- // Checking if the fields that require validation are available and if they were changed
54
- // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
55
- if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
56
- return;
57
- }
58
- this.validateInputValues();
59
- }
60
- ngAfterViewInit() {
61
- end('NgxSkeletonLoader:Rendered');
62
- }
63
- ngOnDestroy() {
64
- end('NgxSkeletonLoader:Loaded');
65
- }
66
- }
67
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
68
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
70
- type: Component,
71
- args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 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:translate(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{-webkit-animation:progress 2s ease-in-out infinite;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{-webkit-animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;-webkit-animation-delay:.5s;animation-delay:.5s}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.progress{-webkit-animation:none;animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark{background-image:none}}@-webkit-keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@keyframes progress{0%{transform:translate(-200px)}to{transform:translate(calc(200px + 100vw))}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
72
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
73
- type: Inject,
74
- args: [NGX_SKELETON_LOADER_CONFIG]
75
- }, {
76
- type: Optional
77
- }] }]; }, propDecorators: { count: [{
78
- type: Input
79
- }], loadingText: [{
80
- type: Input
81
- }], appearance: [{
82
- type: Input
83
- }], animation: [{
84
- type: Input
85
- }], ariaLabel: [{
86
- type: Input
87
- }], theme: [{
88
- type: Input
89
- }] } });
90
-
91
- class NgxSkeletonLoaderModule {
92
- static forRoot(config) {
93
- return {
94
- ngModule: NgxSkeletonLoaderModule,
95
- providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
96
- };
97
- }
98
- }
99
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
100
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
101
- /** @nocollapse */ /** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [[CommonModule]] });
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
103
- type: NgModule,
104
- args: [{
105
- declarations: [NgxSkeletonLoaderComponent],
106
- imports: [CommonModule],
107
- exports: [NgxSkeletonLoaderComponent],
108
- }]
109
- }] });
110
-
111
- /*
112
- * Public API Surface of ngx-skeleton-loader
113
- */
114
-
115
- /**
116
- * Generated bundle index. Do not edit.
117
- */
118
-
119
- export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
120
- //# 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 // 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' | '';\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() 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 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', ''].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 empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\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","<span\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 circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n</span>\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":";;;;;;MAkBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;MCQrG,0BAA0B;IA2BrC,YAA4D,MAAgC;QAC1F,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;QAEjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC5B;IAED,QAAQ;QACN,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACpC,KAAK,CAAC,0BAA0B,CAAC,CAAC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