ngx-skeleton-loader 7.0.0 → 8.0.1

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/README.md CHANGED
@@ -1,345 +1,24 @@
1
- # NGX Skeleton loader
1
+ # NgxSkeletonLoader
2
2
 
3
- [![npm downloads](https://img.shields.io/npm/dm/ngx-skeleton-loader.svg)](https://npmjs.org/ngx-skeleton-loader)
4
- [![npm](https://img.shields.io/badge/stackblitz-online-orange.svg)](https://stackblitz.com/edit/ngx-skeleton-loader-sample)
5
- [![npm](https://img.shields.io/badge/stackblitz-online-orange.svg)](https://stackblitz.com/edit/ngx-skeleton-loader-user-card-component-sample)
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.0.0.
6
4
 
7
- [![NPM](https://nodei.co/npm/ngx-skeleton-loader.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.org/ngx-skeleton-loader)
8
- [![NPM](https://nodei.co/npm-dl/ngx-skeleton-loader.png?height=3&months=3)](https://npmjs.org/ngx-skeleton-loader)
5
+ ## Code scaffolding
9
6
 
10
- [![Build Status](https://circleci.com/gh/willmendesneto/ngx-skeleton-loader.svg?style=shield)](https://circleci.com/gh/willmendesneto/ngx-skeleton-loader)
11
- [![Coverage Status](https://coveralls.io/repos/willmendesneto/ngx-skeleton-loader/badge.svg?branch=master)](https://coveralls.io/r/willmendesneto/ngx-skeleton-loader?branch=master)
12
- [![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/ngx-skeleton-loader.svg)](https://bundlephobia.com/result?p=ngx-skeleton-loader)
13
- [![npm](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](/LICENSE)
7
+ Run `ng generate component component-name --project ngx-skeleton-loader` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-skeleton-loader`.
8
+ > Note: Don't forget to add `--project ngx-skeleton-loader` or else it will be added to the default project in your `angular.json` file.
14
9
 
15
- ![ngx-skeleton-loader in action](https://user-images.githubusercontent.com/1252570/50053778-d4e0d900-018e-11e9-9de7-fad6f9fddd9e.gif)
10
+ ## Build
16
11
 
17
- ## Why skeletons?
12
+ Run `ng build ngx-skeleton-loader` to build the project. The build artifacts will be stored in the `dist/` directory.
18
13
 
19
- > If you want to get more details about that, please read ["NGX-Skeleton-Loader — States, Animations, Performance, and Accessibility for your Angular App"](https://willmendesneto.com/posts/ngx-skeleton-loader-states-animations-performance-and-accessibility-for-your-angular-app) blog post
14
+ ## Publishing
20
15
 
21
- The idea of this component is make the process transparent and easier. So the main point is integrate this component with other tooling process, such as:
16
+ After building your library with `ng build ngx-skeleton-loader`, go to the dist folder `cd dist/ngx-skeleton-loader` and run `npm publish`.
22
17
 
23
- - Server-side rendering;
24
- - Progressive rendering;
25
- - Any other that you like :)
18
+ ## Running unit tests
26
19
 
27
- It's totally transparent for you and you can integrate easier in your application, improving your user experience 🎉
20
+ Run `ng test ngx-skeleton-loader` to execute the unit tests via [Karma](https://karma-runner.github.io).
28
21
 
29
- - [Demo](#demo)
30
- - [Install](#install)
31
- - [Setup](#setup)
32
- - [Development](#development)
33
- - [Contribute](#contribute)
22
+ ## Further help
34
23
 
35
- ## Demo
36
-
37
- Try out our demos on Stackblitz!
38
-
39
- - [Usage: animations, appearance, and themes](https://ngx-skeleton-loader-sample.stackblitz.io)
40
- - [User Card Component Loading simulation using NGX Skeleton Loader](https://ngx-skeleton-loader-user-card-component-sample.stackblitz.io)
41
-
42
- ## Install
43
-
44
- You can get it on NPM installing `ngx-skeleton-loader` module as a project dependency.
45
-
46
- ```shell
47
- npm install ngx-skeleton-loader --save
48
- ```
49
-
50
- ## Setup
51
-
52
- You'll need to add `NgxSkeletonLoaderModule` to your application module. So that, the `<ngx-skeleton-loader>` components will be accessible in your application.
53
-
54
- ```typescript
55
- ...
56
- import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
57
- ...
58
-
59
- @NgModule({
60
- declarations: [
61
- YourAppComponent
62
- ],
63
- imports: [
64
- ...
65
- NgxSkeletonLoaderModule,
66
- ...
67
- ],
68
- providers: [],
69
- bootstrap: [YourAppComponent]
70
- })
71
-
72
- export class YourAppComponent {}
73
-
74
- ```
75
-
76
- After that, you can use the `ngx-skeleton-loader` components in your templates, passing the configuration data into the component itself.
77
-
78
- - `ngx-skeleton-loader`: Handle the skeleton animation and the skeleton styles of your app;
79
-
80
- ```html
81
- <div class="item">
82
- <ngx-skeleton-loader count="5" appearance="circle"></ngx-skeleton-loader>
83
- </div>
84
- ```
85
-
86
- ### Using `NgxSkeletonLoaderModule.forRoot()`
87
-
88
- Also, you can import the module in your app by calling `NgxSkeletonLoaderModule.forRoot()` when adding it. So it will be available across your Angular application.
89
-
90
- Importing the module this way also allows you to globally configure the default values for the `ngx-skeleton-loader` components in your application, in case you need some different default values for your app.
91
-
92
- ```typescript
93
- ...
94
- import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
95
- ...
96
-
97
- @NgModule({
98
- declarations: [
99
- YourAppComponent
100
- ],
101
- imports: [
102
- ...
103
- NgxSkeletonLoaderModule.forRoot({ animation: 'pulse', loadingText: 'This item is actually loading...' }),
104
- ...
105
- ],
106
- providers: [],
107
- bootstrap: [YourAppComponent]
108
- })
109
-
110
- export class YourAppComponent {}
111
-
112
- ```
113
-
114
- ```html
115
- <div class="item">
116
- <ngx-skeleton-loader count="5" appearance="circle"></ngx-skeleton-loader>
117
- <!-- above line will produce the rendering of 5 circles with the pulse animation and the aria-valuetext attribute set with "This item is actually loading..." -->
118
- </div>
119
- ```
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
-
174
- ## WAI-ARIA values
175
-
176
- - loadingText - _default_ `Loading...`: attribute that defines the text value for `aria-valuetext` attribute. Defaults to "Loading..."
177
- - `aria-label` - _default_ `loading`: you can add `ariaLabel` as input of the component to set a different value.
178
-
179
- ## Appearance
180
-
181
- You can also define which appearance want to use in your skeleton loader by passing the options in your component via `[appearance]` attribute.
182
-
183
- ### Options
184
-
185
- - `''` - _default_: it will use it `''` as appearance. At the end, it will render like a line;
186
- - `line`: it will render like a line. This is the same behavior as passing an empty string;
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;
189
-
190
- ## Animations
191
-
192
- You can also define which CSS animation you want to use - even not use any, if it's the case - in your skeleton loader by passing the options in your component via `[animation]` attribute.
193
-
194
- ### Options
195
-
196
- - `"false"` (as string): it will disable the animation;
197
- - `false` (as boolean): it will disable the animation. Animation will receive `false` as string when attribute field it's not using binding. Component now can receive `false` (boolean), "false" (string), or any other animation type via binding;
198
- - `progress` - _default_: it will use it `progress` as animation;
199
- - `progress-dark`: it will use it `progress-dark` as animation. Recommended if your color schema is darken;
200
- - `pulse`: it will use `pulse` as animation;
201
-
202
- > `progress` is the default animation, used as the single one previously. If you don't pass the animation attribute, it defaults to `progress`.
203
-
204
- ```html
205
- <!--
206
- If you need to change all the background wrapper
207
- you need to apply the style changes on the
208
- `ngx-skeleton-loader` component wrapper
209
- -->
210
- <div class="item">
211
- <!-- Disables the animation -->
212
- <ngx-skeleton-loader animation="false"></ngx-skeleton-loader>
213
- <!-- Disables the animation, but receiving boolean value from binding -->
214
- <!-- Via binding it can receive `false` (boolean), "false" (string), or any other animation type -->
215
- <ngx-skeleton-loader [animation]="classAttributeWithBooleanFalseValue"></ngx-skeleton-loader>
216
- <!-- Uses `progress` as animation -->
217
- <ngx-skeleton-loader animation="progress"></ngx-skeleton-loader>
218
- <ngx-skeleton-loader></ngx-skeleton-loader>
219
- <!-- Uses `pulse` as animation -->
220
- <ngx-skeleton-loader animation="pulse"></ngx-skeleton-loader>
221
- </div>
222
- ```
223
-
224
- > You can check the code details in the [Stackblitz Live Demo Link](https://stackblitz.com/edit/ngx-skeleton-loader-sample?file=app%2Fapp.component.html)
225
-
226
- ## Theming
227
-
228
- You can also define different styles for the skeleton loader by passing an object with the css styles - in dashed case - into the component via `[theme]` attribute.
229
-
230
- ```html
231
- <!--
232
- If you need to change all the background wrapper
233
- you need to apply the style changes on the
234
- `ngx-skeleton-loader` component wrapper
235
- -->
236
-
237
- <div style="background: #FF0001; padding: 10px;">
238
- <ngx-skeleton-loader
239
- count="5"
240
- [theme]="{
241
- 'border-radius': '5px',
242
- height: '50px',
243
- 'background-color': '#992929',
244
- border: '1px solid white'
245
- }"
246
- ></ngx-skeleton-loader>
247
- </div>
248
- ```
249
-
250
- The [theme] attribute now accepts the same configuration as `ngStyle` as well. That means you can manage to use like you're doing with the built-in directive, having a pleasure and beautiful experience
251
-
252
- ```html
253
- <!--
254
- Note that we are using a combination of styles and ngStyle inside theme object,
255
- having `height.px` receiving a number and `background-color` receiving a HEX Color
256
- -->
257
- <div style="background: #FF0001; padding: 10px;">
258
- <ngx-skeleton-loader
259
- count="5"
260
- [theme]="{
261
- 'height.px': 50,
262
- 'background-color': '#992929'
263
- }"
264
- ></ngx-skeleton-loader>
265
- </div>
266
- ```
267
-
268
- ### ⚠️ This is here only as a documentation, but it's not encouraged to be used. Please consider use it with caution ⚠️
269
-
270
- Also, you can use CSS to add theme styles into your component. However, there are some implications:
271
-
272
- - You're using `:host` in your stylesheet, which means **you are aware of any possible problem `:host` can create for your app at that level since it's based on [`:host` DOM style scoping](https://developer.mozilla.org/en-US/docs/Web/CSS/:host)**
273
- - You're adding stylesheet based on `<ngx-skeleton-loader>` internal classes. It means that **class naming changes on module's side will be breaking changes for your application as well**.
274
-
275
- As an example, your Component file is like this
276
-
277
- ```typescript
278
- import { Component } from '@angular/core';
279
-
280
- @Component({
281
- selector: 'my-ngx-skeleton-loader-with-theming',
282
- templateUrl: './my-ngx-skeleton-loader-with-theming.component.html',
283
- styleUrls: ['./my-ngx-skeleton-loader-with-theming.component.css'],
284
- })
285
- export class MyNGXSkeletonLoaderWithThemingComponent {
286
- /* ... code goes here*/
287
- }
288
- ```
289
-
290
- And your component HTML code is
291
-
292
- ```html
293
- <!--
294
- file: my-ngx-skeleton-loader-with-theming.component.html
295
-
296
- As an example, it's not using themes via [theme] attributes.
297
- -->
298
-
299
- <ngx-skeleton-loader count="5" animation="pulse"></ngx-skeleton-loader>
300
- ```
301
-
302
- You can apply theme changes in our stylesheet. At the end it will be
303
-
304
- ```css
305
- /* file: `my-ngx-skeleton-loader-with-theming.component.css`
306
- *
307
- * You can find more details about `:host` at
308
- * Angular Component Style Docs https://angular.io/guide/component-styles#host
309
- */
310
- :host >>> ngx-skeleton-loader .skeleton-loader {
311
- border-radius: 5px;
312
- height: 50px;
313
- background-color: #992929;
314
- border: 1px solid white;
315
- }
316
- ```
317
-
318
- > You should change the styles on the skeleton wrapper element in case you need to change the background color. You can check the code details in the [Stackblitz Live Demo Link](https://stackblitz.com/edit/ngx-skeleton-loader-sample?file=app%2Fapp.component.html) or check it out a content load simulation [in this Stackblitz Live Demo Link](https://stackblitz.com/edit/ngx-skeleton-loader-user-card-component-sample?file=app%2Fapp.component.html)
319
-
320
- ## Development
321
-
322
- ### Run demo locally
323
-
324
- 1. This project uses [Angular CLI](https://cli.angular.io/) as base. That means you just need to run `npm start` and access the link `http://localhost:4200` in your browser
325
-
326
- ### Run tests
327
-
328
- 1. Run `npm test` for run tests. In case you want to test using watch, please use `npm run tdd`
329
-
330
- ### Publish
331
-
332
- this project is using `np` package to publish, which makes things straightforward. EX: `npx np <patch|minor|major> --no-yarn --no-cleanup --contents=dist/ngx-skeleton-loader`
333
-
334
- > For more details, [please check np package on npmjs.com](https://www.npmjs.com/package/np)
335
-
336
- ## Contribute
337
-
338
- For any type of contribution, please follow the instructions in [CONTRIBUTING.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/master/CONTRIBUTING.md) and read [CODE_OF_CONDUCT.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/master/CODE_OF_CONDUCT.md) files.
339
-
340
- ## Author
341
-
342
- **Wilson Mendes (willmendesneto)**
343
-
344
- - <https://twitter.com/willmendesneto>
345
- - <http://github.com/willmendesneto>
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -1,3 +1,3 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  export const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQW9CL0MsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsSUFBSSxjQUFjLENBQTBCLDRCQUE0QixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgdHlwZSBOZ3hTa2VsZXRvbkxvYWRlckNvbmZpZ1RoZW1lID0ge1xuICAvLyBJdCBlbmZvcmNlcyBhIGNvbWJpbmF0aW9uIG9mIGBmcm9tUm9vdGAgc3R5bGVzIHdpdGggY29tcG9uZW50IGBzdHlsZXNgIGF0dHJpYnV0ZVxuICBleHRlbmRzRnJvbVJvb3Q/OiBib29sZWFuO1xuICAvLyBUaGlzIGlzIHJlcXVpcmVkIHNpbmNlIG5nU3R5bGUgaXMgdXNpbmcgYGFueWAgYXMgd2VsbFxuICAvLyBNb3JlIGRldGFpbHMgaW4gaHR0cHM6Ly9hbmd1bGFyLmlvL2FwaS9jb21tb24vTmdTdHlsZVxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICBbazogc3RyaW5nXTogYW55O1xufSB8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xuXG5leHBvcnQgdHlwZSBOZ3hTa2VsZXRvbkxvYWRlckNvbmZpZ1RoZW1lID0ge1xuICAvLyBJdCBlbmZvcmNlcyBhIGNvbWJpbmF0aW9uIG9mIGBmcm9tUm9vdGAgc3R5bGVzIHdpdGggY29tcG9uZW50IGBzdHlsZXNgIGF0dHJpYnV0ZVxuICBleHRlbmRzRnJvbVJvb3Q/OiBib29sZWFuO1xuICAvLyBUaGlzIGlzIHJlcXVpcmVkIHNpbmNlIG5nU3R5bGUgaXMgdXNpbmcgYGFueWAgYXMgd2VsbFxuICAvLyBNb3JlIGRldGFpbHMgaW4gaHR0cHM6Ly9hbmd1bGFyLmlvL2FwaS9jb21tb24vTmdTdHlsZVxuICBbazogc3RyaW5nXTogYW55O1xufSB8IG51bGw7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTmd4U2tlbGV0b25Mb2FkZXJDb25maWcge1xuICBhcHBlYXJhbmNlOiAnY2lyY2xlJyB8ICdsaW5lJyB8ICdjdXN0b20tY29udGVudCcgfCAnJztcbiAgYW5pbWF0aW9uOiAncHJvZ3Jlc3MnIHwgJ3Byb2dyZXNzLWRhcmsnIHwgJ3B1bHNlJyB8ICdmYWxzZScgfCBmYWxzZTtcbiAgdGhlbWU6IE5neFNrZWxldG9uTG9hZGVyQ29uZmlnVGhlbWU7XG4gIGxvYWRpbmdUZXh0OiBzdHJpbmc7XG4gIGNvdW50OiBudW1iZXI7XG4gIGFyaWFMYWJlbDogc3RyaW5nO1xufVxuXG5leHBvcnQgY29uc3QgTkdYX1NLRUxFVE9OX0xPQURFUl9DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9rZW48Tmd4U2tlbGV0b25Mb2FkZXJDb25maWc+KCduZ3gtc2tlbGV0b24tbG9hZGVyLmNvbmZpZycpO1xuIl19
@@ -0,0 +1,96 @@
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
+ // Optional chaining is only supported on Angular CLI v12
54
+ // - more details in this comment https://github.com/angular/angular-cli/issues/20471#issuecomment-815599616
55
+ // So the main issue here is on the consumer's side.
56
+ // Options are use v6.0.0 or upgrade your Angular CLI to >= v12, as described in https://github.com/willmendesneto/ngx-skeleton-loader/issues/150#issuecomment-1638612329
57
+ if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {
58
+ // Shows error message only in Development
59
+ this.theme = { ...this.config.theme, ...this.theme };
60
+ }
61
+ }
62
+ ngOnChanges(changes) {
63
+ // Avoiding multiple calls for the same input in case there's no changes in the fields
64
+ // Checking if the fields that require validation are available and if they were changed
65
+ // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
66
+ if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
67
+ return;
68
+ }
69
+ this.validateInputValues();
70
+ }
71
+ /** @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 }); }
72
+ /** @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:before{animation:none}.skeleton-loader.progress:before,.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 }); }
73
+ }
74
+ export { NgxSkeletonLoaderComponent };
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
76
+ type: Component,
77
+ 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:before{animation:none}.skeleton-loader.progress:before,.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"] }]
78
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
79
+ type: Inject,
80
+ args: [NGX_SKELETON_LOADER_CONFIG]
81
+ }, {
82
+ type: Optional
83
+ }] }]; }, propDecorators: { count: [{
84
+ type: Input
85
+ }], loadingText: [{
86
+ type: Input
87
+ }], appearance: [{
88
+ type: Input
89
+ }], animation: [{
90
+ type: Input
91
+ }], ariaLabel: [{
92
+ type: Input
93
+ }], theme: [{
94
+ type: Input
95
+ }] } });
96
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxld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jb250ZW50PlxuPC9kaXY+XG4iXX0=
@@ -0,0 +1,26 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';
4
+ import { NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';
5
+ import * as i0 from "@angular/core";
6
+ class NgxSkeletonLoaderModule {
7
+ static forRoot(config) {
8
+ return {
9
+ ngModule: NgxSkeletonLoaderModule,
10
+ providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
11
+ };
12
+ }
13
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
14
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] }); }
15
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
16
+ }
17
+ export { NgxSkeletonLoaderModule };
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
19
+ type: NgModule,
20
+ args: [{
21
+ declarations: [NgxSkeletonLoaderComponent],
22
+ imports: [CommonModule],
23
+ exports: [NgxSkeletonLoaderComponent],
24
+ }]
25
+ }] });
26
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wc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uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuaW1wb3J0IHsgTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnQgfSBmcm9tICcuL25neC1za2VsZXRvbi1sb2FkZXIuY29tcG9uZW50JztcbmltcG9ydCB7IE5neFNrZWxldG9uTG9hZGVyQ29uZmlnLCBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRyB9IGZyb20gJy4vbmd4LXNrZWxldG9uLWxvYWRlci1jb25maWcudHlwZXMnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtOZ3hTa2VsZXRvbkxvYWRlckNvbXBvbmVudF0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdLFxuICBleHBvcnRzOiBbTmd4U2tlbGV0b25Mb2FkZXJDb21wb25lbnRdLFxufSlcbmV4cG9ydCBjbGFzcyBOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZSB7XG4gIHN0YXRpYyBmb3JSb290KGNvbmZpZz86IFBhcnRpYWw8Tmd4U2tlbGV0b25Mb2FkZXJDb25maWc+KTogTW9kdWxlV2l0aFByb3ZpZGVyczxOZ3hTa2VsZXRvbkxvYWRlck1vZHVsZT4ge1xuICAgIHJldHVybiB7XG4gICAgICBuZ01vZHVsZTogTmd4U2tlbGV0b25Mb2FkZXJNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFt7IHByb3ZpZGU6IE5HWF9TS0VMRVRPTl9MT0FERVJfQ09ORklHLCB1c2VWYWx1ZTogY29uZmlnIH1dLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
@@ -1,6 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, isDevMode, Component, ChangeDetectionStrategy, Inject, Optional, Input, NgModule } from '@angular/core';
3
- import { start, end } from 'perf-marks/marks';
4
3
  import * as i1 from '@angular/common';
5
4
  import { CommonModule } from '@angular/common';
6
5
 
@@ -19,8 +18,6 @@ class NgxSkeletonLoaderComponent {
19
18
  this.ariaLabel = ariaLabel;
20
19
  }
21
20
  ngOnInit() {
22
- start('NgxSkeletonLoader:Rendered');
23
- start('NgxSkeletonLoader:Loaded');
24
21
  this.validateInputValues();
25
22
  }
26
23
  validateInputValues() {
@@ -56,6 +53,10 @@ class NgxSkeletonLoaderComponent {
56
53
  }
57
54
  this.appearance = '';
58
55
  }
56
+ // Optional chaining is only supported on Angular CLI v12
57
+ // - more details in this comment https://github.com/angular/angular-cli/issues/20471#issuecomment-815599616
58
+ // So the main issue here is on the consumer's side.
59
+ // Options are use v6.0.0 or upgrade your Angular CLI to >= v12, as described in https://github.com/willmendesneto/ngx-skeleton-loader/issues/150#issuecomment-1638612329
59
60
  if (Boolean(this.config?.theme?.extendsFromRoot) && this.theme !== null) {
60
61
  // Shows error message only in Development
61
62
  this.theme = { ...this.config.theme, ...this.theme };
@@ -70,18 +71,12 @@ class NgxSkeletonLoaderComponent {
70
71
  }
71
72
  this.validateInputValues();
72
73
  }
73
- ngAfterViewInit() {
74
- end('NgxSkeletonLoader:Rendered');
75
- }
76
- ngOnDestroy() {
77
- end('NgxSkeletonLoader:Loaded');
78
- }
74
+ /** @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 }); }
75
+ /** @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:before{animation:none}.skeleton-loader.progress:before,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
79
76
  }
80
- /** @nocollapse */ NgxSkeletonLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
81
- /** @nocollapse */ NgxSkeletonLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
83
78
  type: Component,
84
- args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngFor=\"let item of items\"\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText\"\n role=\"progressbar\"\n tabindex=\"0\"\n [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n>\n <ng-content *ngIf=\"appearance === 'custom-content'\"></ng-content>\n</div>\n\n\n\n\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:rgb(239,241,246) no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0))}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress{animation:none}.skeleton-loader.progress,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
79
+ 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:before{animation:none}.skeleton-loader.progress:before,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
85
80
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
86
81
  type: Inject,
87
82
  args: [NGX_SKELETON_LOADER_CONFIG]
@@ -108,11 +103,11 @@ class NgxSkeletonLoaderModule {
108
103
  providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
109
104
  };
110
105
  }
106
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
107
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] }); }
108
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
111
109
  }
112
- /** @nocollapse */ NgxSkeletonLoaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
113
- /** @nocollapse */ NgxSkeletonLoaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, declarations: [NgxSkeletonLoaderComponent], imports: [CommonModule], exports: [NgxSkeletonLoaderComponent] });
114
- /** @nocollapse */ NgxSkeletonLoaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] });
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
116
111
  type: NgModule,
117
112
  args: [{
118
113
  declarations: [NgxSkeletonLoaderComponent],
@@ -131,4 +126,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
131
126
 
132
127
  export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
133
128
  //# sourceMappingURL=ngx-skeleton-loader.mjs.map
134
- //# sourceMappingURL=ngx-skeleton-loader.mjs.map