ngx-skeleton-loader 11.1.0 → 11.2.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/CHANGELOG.md CHANGED
@@ -7,18 +7,36 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  ## [Unreleased][]
9
9
 
10
+ ## [11.2.1][] - 2025-06-27
11
+
12
+ ### Changed
13
+
14
+ - Adding new appearance `square`
15
+ - Fixing `peerDependencies` install
16
+
17
+ ## [11.2.0][] - 2025-06-09
18
+
19
+ ### Added
20
+
21
+ - Adding new `pulse-dark` animation
22
+
23
+ ### Changed
24
+
25
+ - Upgrading Angular deps to v20
26
+ - Replacing `npm install` to `npm ci` on Circle CI pipeline
27
+
10
28
  ## [11.1.0][] - 2025-05-19
11
29
 
12
30
  ### Added
13
31
  - Adding support for standalone `provideNgxSkeletonLoader()`
14
32
 
15
- ### Updated
33
+ ### Changed
16
34
  - Upgrade project to use eslint v9
17
35
  - Updating docs to reflect standalone `provideNgxSkeletonLoader()` support
18
36
 
19
37
  ## [11.0.0][] - 2025-04-09
20
38
 
21
- ### Updated
39
+ ### Changed
22
40
  - Upgrading project to use Node.js v22.14.0
23
41
  - Upgrading project to Angular v19
24
42
  - Removing [ngStyle] and [ngClass] in favor of `[style]` and `[class]`, respectively. These directives are expected to be removed in future Angular versions, since their behavior can be replicated using native bindings. This change also reduces the initial bundle size for applications that don’t use these directives.
@@ -28,7 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
28
46
  ### Removed
29
47
  - Removing warnings in dev mode in favor of typed angular signals integration. It should not affect consumers in general, but it will be released as a major version, since this project follows the SEMVER standards
30
48
 
31
- ### Updated
49
+ ### Changed
32
50
 
33
51
  > Thanks to @lekhmanrus
34
52
 
@@ -40,7 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
40
58
  - Adding `PUBLISHING_HOTFIX.md` file describing all the steps to cover a hotfix in older version of NGX-Skeleton-Loader module
41
59
 
42
60
  ## [9.0.0][] - 2024-01-13
43
- ### Updated
61
+ ### Changed
44
62
 
45
63
  - Upgrading `@angular/*` packages to v17
46
64
  - Upgrading NodeJS to v20.10.0
@@ -51,9 +69,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
51
69
 
52
70
  - fixing issue with optional chaining not being supported on apps using Angular CLI <=v11;
53
71
 
54
- ### Updated
72
+ ### Changed
55
73
 
56
- - Updated input values validation in order to remove optional chaining. Instead, the code is now using object destructuring to get config theme value;
74
+ - Changed input values validation in order to remove optional chaining. Instead, the code is now using object destructuring to get config theme value;
57
75
 
58
76
  ## [8.0.2][] - 2023-09-11
59
77
 
@@ -69,7 +87,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
69
87
 
70
88
  ## [8.0.0][] - 2023-06-20
71
89
 
72
- ### Updated
90
+ ### Changed
73
91
 
74
92
  - Updating project to support Angular v16;
75
93
  - Updating NodeJS version to v18;
@@ -119,7 +137,7 @@ By using `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* .
119
137
  - 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
120
138
  - Adding examples for `custom-content` usage
121
139
 
122
- ### Updated
140
+ ### Changed
123
141
 
124
142
  - Updagrading module to Angular v15
125
143
 
@@ -129,7 +147,7 @@ By using `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* .
129
147
 
130
148
  ## [6.0.0][] - 2022-08-18
131
149
 
132
- ### Updated
150
+ ### Changed
133
151
 
134
152
  - Adding Publishing setup using NPX
135
153
  - Replacing CSS class namespace from `.loader` to `.skeleton-loader`
@@ -140,7 +158,7 @@ The CSS class used as namespace was changed. Previously, it was called `.loader`
140
158
 
141
159
  ## [5.0.0][] - 2022-02-08
142
160
 
143
- ### Updated
161
+ ### Changed
144
162
 
145
163
  > Thanks @yharaskrik
146
164
 
@@ -196,7 +214,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
196
214
 
197
215
  ## [2.9.2][] - 2021-04-11
198
216
 
199
- ### Updated
217
+ ### Changed
200
218
 
201
219
  - Updating link in README.md
202
220
 
@@ -210,7 +228,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
210
228
 
211
229
  - Adding `appearance` attribute to be checked via `ngOnChanges`
212
230
 
213
- ### Updated
231
+ ### Changed
214
232
 
215
233
  - Updating examples with new features
216
234
 
@@ -224,7 +242,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
224
242
  - PS: The other values alredy have a fallback, so nothing to worry here
225
243
  - Adding error feedback for `appearance` attribute in case of wrong configuration. Now it will show a error message on the console in case of receiving a wrong value
226
244
 
227
- ### Updated
245
+ ### Changed
228
246
 
229
247
  - Adding `ngOnChange` to validate `count` input in case of changes via binding
230
248
  - Updating `README.md` with information about `appearance` and `theme` usage.
@@ -236,7 +254,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
236
254
  - Using `ngAcceptInputType_count` for template checking in count input. That solves issue https://github.com/willmendesneto/ngx-skeleton-loader/issues/59. You can find more details about it in https://angular.io/guide/template-typecheck
237
255
  - Fixing type issues on `yarn build:ssr` command
238
256
 
239
- ### Updated
257
+ ### Changed
240
258
 
241
259
  - Updating `perf-marks` to `v1.14.1`
242
260
  - Adding strict mode support in module
@@ -257,7 +275,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
257
275
  </div>
258
276
  ```
259
277
 
260
- ### Updated
278
+ ### Changed
261
279
 
262
280
  - Using OnPush as changeDetection mechanism into ngx-skeleton-loader component
263
281
  - Adding ability to pass `false` as string or boolean (coming from variable value via binding) on `animation` attribute in `ngx-skeleton-loader` component configuration. 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.
@@ -323,7 +341,7 @@ export class AppModule {}
323
341
 
324
342
  - Fixing bundle size command on CircleCI pipeline
325
343
 
326
- ### Updated
344
+ ### Changed
327
345
 
328
346
  - Upgrading NodeJS to v14.11.0
329
347
  - Updating `perf-marks` package to v1.14.0
@@ -348,13 +366,13 @@ export class AppModule {}
348
366
 
349
367
  ## [2.4.2][] - 2020-08-01
350
368
 
351
- ### Updated
369
+ ### Changed
352
370
 
353
371
  - Bumping `perf-marks` to latest version
354
372
 
355
373
  ## [2.4.1][] - 2020-08-01
356
374
 
357
- ### Updated
375
+ ### Changed
358
376
 
359
377
  - Bumping `perf-marks` to latest version
360
378
 
@@ -364,7 +382,7 @@ export class AppModule {}
364
382
 
365
383
  - Adding User Timing API to track component render and content loader time
366
384
 
367
- ### Updated
385
+ ### Changed
368
386
 
369
387
  - Updating examples with new skeleton simulation
370
388
  - Adding Stackblitz link for user card skeleton loading demo
@@ -375,7 +393,7 @@ export class AppModule {}
375
393
 
376
394
  - Adding User Timing API to track component render and content loader time
377
395
 
378
- ### Updated
396
+ ### Changed
379
397
 
380
398
  - Updating examples with new skeleton simulation
381
399
  - Adding Stackblitz link for user card skeleton loading demo
@@ -386,7 +404,7 @@ export class AppModule {}
386
404
 
387
405
  - For compatibility with IE11 by using indexOf instead of `includes`
388
406
 
389
- ### Updated
407
+ ### Changed
390
408
 
391
409
  - Updating `npm run postinstall` command to follow the new rules from update.angular.io website
392
410
 
@@ -398,14 +416,14 @@ export class AppModule {}
398
416
 
399
417
  ## [2.1.0][] - 2020-06-01
400
418
 
401
- ### Updated
419
+ ### Changed
402
420
 
403
421
  - Upgrading @angular/cli to version 9
404
422
  - 🎉 Decreasing bundle size to 1.17KB 🎉
405
423
 
406
424
  ## [2.0.0][] - 2020-05-15
407
425
 
408
- ### Updated
426
+ ### Changed
409
427
 
410
428
  - Upgrading NodeJS to v12.16.2
411
429
  - Updating documentation with `animation` attribute
@@ -448,7 +466,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
448
466
 
449
467
  ## [1.2.7][] - 2020-04-13
450
468
 
451
- ### Updated
469
+ ### Changed
452
470
 
453
471
  - Decreasing bundle size after disable Ivy in production build
454
472
  - Adding description, keywords and github information on `package.json` files
@@ -467,7 +485,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
467
485
 
468
486
  ## [1.2.4][] - 2020-02-25
469
487
 
470
- ### Updated
488
+ ### Changed
471
489
 
472
490
  - Updating Github templates
473
491
  - Updating Angular CLI to v9
@@ -486,13 +504,13 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
486
504
 
487
505
  ## [1.2.1][] - 2019-06-08
488
506
 
489
- ### Updated
507
+ ### Changed
490
508
 
491
509
  - Updating Angular CLI to v8
492
510
 
493
511
  ## [1.2.0][] - 2019-04-19
494
512
 
495
- ### Updated
513
+ ### Changed
496
514
 
497
515
  - Updating Angular CLI to 7.3.8
498
516
 
@@ -502,7 +520,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
502
520
 
503
521
  - Adding badges for stackblitz, bundlephobia and license
504
522
 
505
- ### Updated
523
+ ### Changed
506
524
 
507
525
  - Removing unnecessary CSS styles for skeleton
508
526
 
@@ -523,7 +541,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
523
541
  - Added `CODE_OF_CONDUCT.md` with the Code of conduct
524
542
  - Added unit tests for skeletons and demo components
525
543
 
526
- ### Updated
544
+ ### Changed
527
545
 
528
546
  - Decreased bundle size
529
547
  - New gif showing `ngx-skeleton-loader` in action
@@ -628,7 +646,9 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
628
646
  [5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
629
647
  [unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
630
648
  [6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
631
- [Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.1.0...HEAD
649
+ [Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.1...HEAD
650
+ [11.2.1]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.0...v11.2.1
651
+ [11.2.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.1.0...v11.2.0
632
652
  [11.1.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.0.0...v11.1.0
633
653
  [11.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v10.0.0...v11.0.0
634
654
  [10.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v9.0.0...v10.0.0
package/README.md CHANGED
@@ -115,6 +115,9 @@ After that, you can use the `ngx-skeleton-loader` components in your templates,
115
115
  <div class="item">
116
116
  <ngx-skeleton-loader count="5" appearance="circle" />
117
117
  </div>
118
+ <div class="item">
119
+ <ngx-skeleton-loader count="5" appearance="square" size="100px" />
120
+ </div>
118
121
  ```
119
122
 
120
123
  ### Using `NgxSkeletonLoaderModule.forRoot()`
@@ -232,7 +235,8 @@ You can also define which appearance want to use in your skeleton loader by pass
232
235
  - `''` - _default_: it will use it `''` as appearance. At the end, it will render like a line;
233
236
  - `line`: it will render like a line. This is the same behavior as passing an empty string;
234
237
  - `circle`: it will use `circle` as appearance. Great for avatar skeletons, for example :);
235
- - `custom-content`: it will NOT add any appearance. Great for custom content, such as SVG, internal components and such;
238
+ - `square`: it will use `square` as appearance and render it appropriately. Great for cards and images, for example; It also requires `size` to be passed through the component - `size` has default size of `40px`;
239
+ - `custom-content`: it will NOT add any appearance. Great for custom content, such as SVG, internal components and such. Although not rendering appearance, animation will be added unless component has `animation="false"` prop;
236
240
 
237
241
  ## Animations
238
242
 
@@ -245,6 +249,7 @@ You can also define which CSS animation you want to use - even not use any, if i
245
249
  - `progress` - _default_: it will use it `progress` as animation;
246
250
  - `progress-dark`: it will use it `progress-dark` as animation. Recommended if your color schema is darken;
247
251
  - `pulse`: it will use `pulse` as animation;
252
+ - `pulse-dark`: it will use `pulse-dark` as animation. Recommended if your color schema is darken;
248
253
 
249
254
  > `progress` is the default animation, used as the single one previously. If you don't pass the animation attribute, it defaults to `progress`.
250
255
 
@@ -67,6 +67,13 @@ class NgxSkeletonLoaderComponent {
67
67
  * etc.
68
68
  */
69
69
  this.theme = input(this.#config?.theme || null);
70
+ /**
71
+ * The `size` property is an input that determines the size of the skeleton loader.
72
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
73
+ * config is not provided.
74
+ * The size can be specified as a number (in pixels) or a string (e.g., '50px', '200').
75
+ */
76
+ this.size = input(this.#config?.size || null);
70
77
  /**
71
78
  * The `items` property is a computed property that generates an array of indices based on the
72
79
  * `count` input.
@@ -88,6 +95,27 @@ class NgxSkeletonLoaderComponent {
88
95
  }
89
96
  return [...Array(count)].map((_, index) => index);
90
97
  });
98
+ /**
99
+ * The `squareSize` property is a computed property that calculates the size of the skeleton
100
+ * loader when the appearance is set to 'square'.
101
+ * It checks the `size` input and ensures that it is a valid number or string representing a
102
+ * valid pixel value. If the `size` is not a valid number or string, it returns `null`.
103
+ * If the `appearance` is not 'square', it also returns `null`.
104
+ * This computed property is used to set the width and height of the skeleton loader when it
105
+ * is displayed as a square.
106
+ */
107
+ this.squareSize = computed(() => {
108
+ const size = this.size();
109
+ if (this.appearance() !== 'square' ||
110
+ (typeof size !== 'number' && typeof size !== 'string')) {
111
+ return null;
112
+ }
113
+ const sizeValueInNumbersOnly = Number(size.toString().trim().replace(/\D/g, ''));
114
+ if (!Number.isInteger(sizeValueInNumbersOnly)) {
115
+ return null;
116
+ }
117
+ return `${sizeValueInNumbersOnly}px`;
118
+ });
91
119
  /**
92
120
  * A computed property that returns the final theme configuration for the skeleton loader.
93
121
  * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
@@ -97,13 +125,18 @@ class NgxSkeletonLoaderComponent {
97
125
  */
98
126
  this.styles = computed(() => {
99
127
  const theme = this.theme();
128
+ const size = this.squareSize();
100
129
  if (this.#config?.theme?.extendsFromRoot) {
101
130
  return {
102
131
  ...this.#config?.theme,
103
132
  ...theme,
133
+ ...(size && { 'width': size, 'height': size })
104
134
  };
105
135
  }
106
- return theme;
136
+ return {
137
+ ...theme,
138
+ ...(size && { 'width': size, 'height': size })
139
+ };
107
140
  });
108
141
  }
109
142
  /**
@@ -112,12 +145,12 @@ class NgxSkeletonLoaderComponent {
112
145
  * and appearance of the `NgxSkeletonLoaderComponent`.
113
146
  */
114
147
  #config;
115
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
116
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: NgxSkeletonLoaderComponent, isStandalone: true, selector: "ngx-skeleton-loader", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\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: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,#fff0,#fff9,#fff0)}.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"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
148
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
149
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: NgxSkeletonLoaderComponent, isStandalone: true, selector: "ngx-skeleton-loader", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.square]=\"appearanceValue === 'square'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [class.pulse-dark]=\"animationValue === 'pulse-dark'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\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.square{width:40px;height:40px;margin:5px}.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,#fff0,#fff9,#fff0)}.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.pulse-dark{background:#32323233;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.pulse-dark,.skeleton-loader.custom-content,.skeleton-loader.progress:before{animation:none}.skeleton-loader.progress:before,.skeleton-loader.progress-dark,.skeleton-loader.pulse-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"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
117
150
  }
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
119
152
  type: Component,
120
- args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\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: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,#fff0,#fff9,#fff0)}.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"] }]
153
+ args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.square]=\"appearanceValue === 'square'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [class.pulse-dark]=\"animationValue === 'pulse-dark'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\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.square{width:40px;height:40px;margin:5px}.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,#fff0,#fff9,#fff0)}.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.pulse-dark{background:#32323233;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.pulse-dark,.skeleton-loader.custom-content,.skeleton-loader.progress:before{animation:none}.skeleton-loader.progress:before,.skeleton-loader.progress-dark,.skeleton-loader.pulse-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"] }]
121
154
  }] });
122
155
 
123
156
  class NgxSkeletonLoaderModule {
@@ -127,11 +160,11 @@ class NgxSkeletonLoaderModule {
127
160
  providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
128
161
  };
129
162
  }
130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
131
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [NgxSkeletonLoaderComponent], exports: [NgxSkeletonLoaderComponent] }); }
132
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderModule }); }
163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
164
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [NgxSkeletonLoaderComponent], exports: [NgxSkeletonLoaderComponent] }); }
165
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule }); }
133
166
  }
134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
167
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
135
168
  type: NgModule,
136
169
  args: [{
137
170
  imports: [NgxSkeletonLoaderComponent],
@@ -1 +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/lib/ngx-skeleton-loader.providers.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 [style] is using `any` as well\n // More details in https://angular.dev/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 isDevMode,\n ChangeDetectionStrategy,\n input,\n inject,\n numberAttribute,\n computed,\n} from '@angular/core';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n/**\n * The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton\n * loader UI element.\n * It can be used to display a loading state before the actual content is available.\n * The component can be configured with various options such as the number of elements, appearance,\n * animation, and theme.\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 standalone: true,\n})\nexport class NgxSkeletonLoaderComponent {\n /**\n * Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.\n * This configuration object provides various options for customizing the behavior\n * and appearance of the `NgxSkeletonLoaderComponent`.\n */\n readonly #config = inject<NgxSkeletonLoaderConfig>(NGX_SKELETON_LOADER_CONFIG, { optional: true});\n /**\n * The `count` property is an input that determines the number of skeleton loader elements\n * to display.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config\n * is not provided.\n * The `transform: numberAttribute` option ensures that the input value is converted to a number.\n */\n readonly count = input(this.#config?.count || 1, { transform: numberAttribute });\n /**\n * The `loadingText` property is an input that determines the text to display while the content\n * is loading.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'\n * if the config is not provided.\n */\n readonly loadingText = input<NgxSkeletonLoaderConfig['loadingText']>(this.#config?.loadingText || 'Loading...');\n /**\n * The `appearance` property is an input that determines the visual appearance of the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the\n * config is not provided.\n * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`\n * type.\n */\n readonly appearance = input<NgxSkeletonLoaderConfig['appearance']>(this.#config?.appearance || 'line');\n /**\n * The `animation` property is an input that determines the type of animation to apply to the\n * skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if\n * the config is not provided.\n * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.\n */\n readonly animation = input<NgxSkeletonLoaderConfig['animation']>(this.#config?.animation || 'progress');\n /**\n * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton\n * loader element. This is useful for providing accessibility information to screen readers.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the\n * config is not provided.\n */\n readonly ariaLabel = input<NgxSkeletonLoaderConfig['ariaLabel']>(this.#config?.ariaLabel || 'loading');\n /**\n * The `theme` property is an input that determines the theme configuration for the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows\n * customizing various aspects of the skeleton loader's appearance, such as colors, animation,\n * etc.\n */\n readonly theme = input<NgxSkeletonLoaderConfigTheme>(this.#config?.theme || null);\n /**\n * The `items` property is a computed property that generates an array of indices based on the\n * `count` input.\n * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the\n * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'\n * appearance.\n * This computed property is used to render the appropriate number of skeleton loader elements.\n */\n readonly items = computed(() => {\n let count = this.count() || 1;\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() && count !== 1) {\n // eslint-disable-next-line no-console\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n count = 1;\n }\n }\n return [...Array(count)].map((_, index) => index);\n });\n /**\n * A computed property that returns the final theme configuration for the skeleton loader.\n * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged\n * with the root theme configuration. Otherwise, the theme is returned as-is.\n * This allows the skeleton loader to inherit global theme settings while still allowing for\n * component-specific theme customization.\n */\n readonly styles = computed(() => {\n const theme = this.theme();\n if (this.#config?.theme?.extendsFromRoot) {\n return {\n ...this.#config?.theme,\n ...theme,\n };\n }\n return theme;\n });\n}\n","@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n imports: [NgxSkeletonLoaderComponent],\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","import { makeEnvironmentProviders } from '@angular/core';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\nexport function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>) {\n return makeEnvironmentProviders([\n { provide: NGX_SKELETON_LOADER_CONFIG, useValue: config },\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.providers';\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;;ACJlH;;;;;;AAMG;MAQU,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQE;;;;AAIG;QACM,IAAO,CAAA,OAAA,GAAG,MAAM,CAA0B,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;AACjG;;;;;;AAMG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAChF;;;;;AAKG;QACM,IAAW,CAAA,WAAA,GAAG,KAAK,CAAyC,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,YAAY,CAAC;AAC/G;;;;;;;AAOG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,CAAwC,IAAI,CAAC,OAAO,EAAE,UAAU,IAAI,MAAM,CAAC;AACtG;;;;;;AAMG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAuC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,UAAU,CAAC;AACvG;;;;;AAKG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAuC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,SAAS,CAAC;AACtG;;;;;;;;AAQG;QACM,IAAK,CAAA,KAAA,GAAG,KA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-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/lib/ngx-skeleton-loader.providers.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 [style] is using `any` as well\n // More details in https://angular.dev/api/common/NgStyle\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n size?: number | `${number}` | `${number}px` | null;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n isDevMode,\n ChangeDetectionStrategy,\n input,\n inject,\n numberAttribute,\n computed,\n} from '@angular/core';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n/**\n * The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton\n * loader UI element.\n * It can be used to display a loading state before the actual content is available.\n * The component can be configured with various options such as the number of elements, appearance,\n * animation, and theme.\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 standalone: true,\n})\nexport class NgxSkeletonLoaderComponent {\n /**\n * Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.\n * This configuration object provides various options for customizing the behavior\n * and appearance of the `NgxSkeletonLoaderComponent`.\n */\n readonly #config = inject<NgxSkeletonLoaderConfig>(NGX_SKELETON_LOADER_CONFIG, { optional: true});\n /**\n * The `count` property is an input that determines the number of skeleton loader elements\n * to display.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config\n * is not provided.\n * The `transform: numberAttribute` option ensures that the input value is converted to a number.\n */\n readonly count = input(this.#config?.count || 1, { transform: numberAttribute });\n /**\n * The `loadingText` property is an input that determines the text to display while the content\n * is loading.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'\n * if the config is not provided.\n */\n readonly loadingText = input<NgxSkeletonLoaderConfig['loadingText']>(this.#config?.loadingText || 'Loading...');\n /**\n * The `appearance` property is an input that determines the visual appearance of the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the\n * config is not provided.\n * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`\n * type.\n */\n readonly appearance = input<NgxSkeletonLoaderConfig['appearance']>(this.#config?.appearance || 'line');\n /**\n * The `animation` property is an input that determines the type of animation to apply to the\n * skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if\n * the config is not provided.\n * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.\n */\n readonly animation = input<NgxSkeletonLoaderConfig['animation']>(this.#config?.animation || 'progress');\n /**\n * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton\n * loader element. This is useful for providing accessibility information to screen readers.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the\n * config is not provided.\n */\n readonly ariaLabel = input<NgxSkeletonLoaderConfig['ariaLabel']>(this.#config?.ariaLabel || 'loading');\n /**\n * The `theme` property is an input that determines the theme configuration for the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows\n * customizing various aspects of the skeleton loader's appearance, such as colors, animation,\n * etc.\n */\n readonly theme = input<NgxSkeletonLoaderConfigTheme>(this.#config?.theme || null);\n /**\n * The `size` property is an input that determines the size of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The size can be specified as a number (in pixels) or a string (e.g., '50px', '200').\n */\n readonly size = input<NgxSkeletonLoaderConfig['size']>(this.#config?.size || null);\n /**\n * The `items` property is a computed property that generates an array of indices based on the\n * `count` input.\n * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the\n * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'\n * appearance.\n * This computed property is used to render the appropriate number of skeleton loader elements.\n */\n readonly items = computed(() => {\n let count = this.count() || 1;\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() && count !== 1) {\n // eslint-disable-next-line no-console\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n count = 1;\n }\n }\n return [...Array(count)].map((_, index) => index);\n });\n /**\n * The `squareSize` property is a computed property that calculates the size of the skeleton\n * loader when the appearance is set to 'square'.\n * It checks the `size` input and ensures that it is a valid number or string representing a\n * valid pixel value. If the `size` is not a valid number or string, it returns `null`.\n * If the `appearance` is not 'square', it also returns `null`.\n * This computed property is used to set the width and height of the skeleton loader when it\n * is displayed as a square.\n */\n readonly squareSize = computed(() => {\n const size = this.size();\n if (this.appearance() !== 'square' ||\n (typeof size !== 'number' && typeof size !== 'string')) {\n return null;\n }\n\n const sizeValueInNumbersOnly = Number(size.toString().trim().replace(/\\D/g, ''));\n if (!Number.isInteger(sizeValueInNumbersOnly)) {\n return null;\n }\n return `${sizeValueInNumbersOnly}px`;\n });\n /**\n * A computed property that returns the final theme configuration for the skeleton loader.\n * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged\n * with the root theme configuration. Otherwise, the theme is returned as-is.\n * This allows the skeleton loader to inherit global theme settings while still allowing for\n * component-specific theme customization.\n */\n readonly styles = computed(() => {\n const theme = this.theme();\n const size = this.squareSize();\n\n if (this.#config?.theme?.extendsFromRoot) {\n return {\n ...this.#config?.theme,\n ...theme,\n ...(size && { 'width': size, 'height': size })\n };\n }\n\n return {\n ...theme,\n ...(size && { 'width': size, 'height': size })\n };\n });\n}\n","@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\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 [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.square]=\"appearanceValue === 'square'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [class.pulse-dark]=\"animationValue === 'pulse-dark'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n imports: [NgxSkeletonLoaderComponent],\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","import { makeEnvironmentProviders } from '@angular/core';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\nexport function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>) {\n return makeEnvironmentProviders([\n { provide: NGX_SKELETON_LOADER_CONFIG, useValue: config },\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.providers';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAoBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;ACLlH;;;;;;AAMG;MAQU,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQE;;;;AAIG;QACM,IAAO,CAAA,OAAA,GAAG,MAAM,CAA0B,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;AACjG;;;;;;AAMG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAChF;;;;;AAKG;QACM,IAAW,CAAA,WAAA,GAAG,KAAK,CAAyC,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,YAAY,CAAC;AAC/G;;;;;;;AAOG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,CAAwC,IAAI,CAAC,OAAO,EAAE,UAAU,IAAI,MAAM,CAAC;AACtG;;;;;;AAMG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAuC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,UAAU,CAAC;AACvG;;;;;AAKG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAuC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,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A,w4BAAA,EAAA,MAAA,EAAA,CAAA,28DAAA,CAAA,EAAA;;;MElBL,uBAAuB,CAAA;IAClC,OAAO,OAAO,CAAC,MAAyC,EAAA;QACtD,OAAO;AACL,YAAA,QAAQ,EAAE,uBAAuB;YACjC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;SACvE;;8GALQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAvB,uBAAuB,EAAA,OAAA,EAAA,CAHxB,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAC1B,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAEzB,uBAAuB,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,0BAA0B,CAAC;oBACrC,OAAO,EAAE,CAAC,0BAA0B,CAAC;AACtC,iBAAA;;;ACLK,SAAU,wBAAwB,CAAC,MAAyC,EAAA;AAChF,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC1D,KAAA,CAAC;AACJ;;ACPA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,130 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, ModuleWithProviders } from '@angular/core';
3
+
4
+ type NgxSkeletonLoaderConfigTheme = {
5
+ /** It enforces a combination of `fromRoot` styles with component `styles` attribute */
6
+ extendsFromRoot?: boolean;
7
+ [k: string]: any;
8
+ } | null;
9
+ interface NgxSkeletonLoaderConfig {
10
+ appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';
11
+ animation: 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'false' | false;
12
+ theme: NgxSkeletonLoaderConfigTheme;
13
+ loadingText: string;
14
+ count: number;
15
+ ariaLabel: string;
16
+ size?: number | `${number}` | `${number}px` | null;
17
+ }
18
+ declare const NGX_SKELETON_LOADER_CONFIG: InjectionToken<NgxSkeletonLoaderConfig>;
19
+
1
20
  /**
2
- * Generated bundle index. Do not edit.
21
+ * The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
22
+ * loader UI element.
23
+ * It can be used to display a loading state before the actual content is available.
24
+ * The component can be configured with various options such as the number of elements, appearance,
25
+ * animation, and theme.
3
26
  */
4
- /// <amd-module name="ngx-skeleton-loader" />
5
- export * from './public-api';
27
+ declare class NgxSkeletonLoaderComponent {
28
+ #private;
29
+ /**
30
+ * The `count` property is an input that determines the number of skeleton loader elements
31
+ * to display.
32
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
33
+ * is not provided.
34
+ * The `transform: numberAttribute` option ensures that the input value is converted to a number.
35
+ */
36
+ readonly count: _angular_core.InputSignalWithTransform<number, unknown>;
37
+ /**
38
+ * The `loadingText` property is an input that determines the text to display while the content
39
+ * is loading.
40
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
41
+ * if the config is not provided.
42
+ */
43
+ readonly loadingText: _angular_core.InputSignal<string>;
44
+ /**
45
+ * The `appearance` property is an input that determines the visual appearance of the skeleton
46
+ * loader.
47
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
48
+ * config is not provided.
49
+ * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
50
+ * type.
51
+ */
52
+ readonly appearance: _angular_core.InputSignal<"" | "circle" | "line" | "custom-content" | "square">;
53
+ /**
54
+ * The `animation` property is an input that determines the type of animation to apply to the
55
+ * skeleton loader.
56
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
57
+ * the config is not provided.
58
+ * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
59
+ */
60
+ readonly animation: _angular_core.InputSignal<false | "progress" | "progress-dark" | "pulse" | "pulse-dark" | "false">;
61
+ /**
62
+ * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
63
+ * loader element. This is useful for providing accessibility information to screen readers.
64
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
65
+ * config is not provided.
66
+ */
67
+ readonly ariaLabel: _angular_core.InputSignal<string>;
68
+ /**
69
+ * The `theme` property is an input that determines the theme configuration for the skeleton
70
+ * loader.
71
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
72
+ * config is not provided.
73
+ * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
74
+ * customizing various aspects of the skeleton loader's appearance, such as colors, animation,
75
+ * etc.
76
+ */
77
+ readonly theme: _angular_core.InputSignal<NgxSkeletonLoaderConfigTheme>;
78
+ /**
79
+ * The `size` property is an input that determines the size of the skeleton loader.
80
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
81
+ * config is not provided.
82
+ * The size can be specified as a number (in pixels) or a string (e.g., '50px', '200').
83
+ */
84
+ readonly size: _angular_core.InputSignal<number | `${number}` | `${number}px` | null | undefined>;
85
+ /**
86
+ * The `items` property is a computed property that generates an array of indices based on the
87
+ * `count` input.
88
+ * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
89
+ * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
90
+ * appearance.
91
+ * This computed property is used to render the appropriate number of skeleton loader elements.
92
+ */
93
+ readonly items: _angular_core.Signal<number[]>;
94
+ /**
95
+ * The `squareSize` property is a computed property that calculates the size of the skeleton
96
+ * loader when the appearance is set to 'square'.
97
+ * It checks the `size` input and ensures that it is a valid number or string representing a
98
+ * valid pixel value. If the `size` is not a valid number or string, it returns `null`.
99
+ * If the `appearance` is not 'square', it also returns `null`.
100
+ * This computed property is used to set the width and height of the skeleton loader when it
101
+ * is displayed as a square.
102
+ */
103
+ readonly squareSize: _angular_core.Signal<string | null>;
104
+ /**
105
+ * A computed property that returns the final theme configuration for the skeleton loader.
106
+ * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
107
+ * with the root theme configuration. Otherwise, the theme is returned as-is.
108
+ * This allows the skeleton loader to inherit global theme settings while still allowing for
109
+ * component-specific theme customization.
110
+ */
111
+ readonly styles: _angular_core.Signal<{
112
+ width?: string | undefined;
113
+ height?: string | undefined;
114
+ extendsFromRoot?: boolean;
115
+ }>;
116
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, never>;
117
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": { "alias": "count"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
118
+ }
119
+
120
+ declare class NgxSkeletonLoaderModule {
121
+ static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule>;
122
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxSkeletonLoaderModule, never>;
123
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, never, [typeof NgxSkeletonLoaderComponent], [typeof NgxSkeletonLoaderComponent]>;
124
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<NgxSkeletonLoaderModule>;
125
+ }
126
+
127
+ declare function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>): _angular_core.EnvironmentProviders;
128
+
129
+ export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule, provideNgxSkeletonLoader };
130
+ export type { NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme };
package/package.json CHANGED
@@ -1,7 +1,7 @@
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": "11.1.0",
4
+ "version": "11.2.1",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=19.0.0",
7
7
  "@angular/core": ">=19.0.0"
@@ -1,15 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export type NgxSkeletonLoaderConfigTheme = {
3
- /** It enforces a combination of `fromRoot` styles with component `styles` attribute */
4
- extendsFromRoot?: boolean;
5
- [k: string]: any;
6
- } | null;
7
- export interface NgxSkeletonLoaderConfig {
8
- appearance: 'circle' | 'line' | 'custom-content' | '';
9
- animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;
10
- theme: NgxSkeletonLoaderConfigTheme;
11
- loadingText: string;
12
- count: number;
13
- ariaLabel: string;
14
- }
15
- export declare const NGX_SKELETON_LOADER_CONFIG: InjectionToken<NgxSkeletonLoaderConfig>;
@@ -1,80 +0,0 @@
1
- import { NgxSkeletonLoaderConfigTheme } from './ngx-skeleton-loader-config.types';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
5
- * loader UI element.
6
- * It can be used to display a loading state before the actual content is available.
7
- * The component can be configured with various options such as the number of elements, appearance,
8
- * animation, and theme.
9
- */
10
- export declare class NgxSkeletonLoaderComponent {
11
- #private;
12
- /**
13
- * The `count` property is an input that determines the number of skeleton loader elements
14
- * to display.
15
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
16
- * is not provided.
17
- * The `transform: numberAttribute` option ensures that the input value is converted to a number.
18
- */
19
- readonly count: import("@angular/core").InputSignalWithTransform<number, unknown>;
20
- /**
21
- * The `loadingText` property is an input that determines the text to display while the content
22
- * is loading.
23
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
24
- * if the config is not provided.
25
- */
26
- readonly loadingText: import("@angular/core").InputSignal<string>;
27
- /**
28
- * The `appearance` property is an input that determines the visual appearance of the skeleton
29
- * loader.
30
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
31
- * config is not provided.
32
- * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
33
- * type.
34
- */
35
- readonly appearance: import("@angular/core").InputSignal<"" | "circle" | "line" | "custom-content">;
36
- /**
37
- * The `animation` property is an input that determines the type of animation to apply to the
38
- * skeleton loader.
39
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
40
- * the config is not provided.
41
- * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
42
- */
43
- readonly animation: import("@angular/core").InputSignal<false | "progress" | "progress-dark" | "pulse" | "false">;
44
- /**
45
- * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
46
- * loader element. This is useful for providing accessibility information to screen readers.
47
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
48
- * config is not provided.
49
- */
50
- readonly ariaLabel: import("@angular/core").InputSignal<string>;
51
- /**
52
- * The `theme` property is an input that determines the theme configuration for the skeleton
53
- * loader.
54
- * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
55
- * config is not provided.
56
- * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
57
- * customizing various aspects of the skeleton loader's appearance, such as colors, animation,
58
- * etc.
59
- */
60
- readonly theme: import("@angular/core").InputSignal<NgxSkeletonLoaderConfigTheme>;
61
- /**
62
- * The `items` property is a computed property that generates an array of indices based on the
63
- * `count` input.
64
- * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
65
- * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
66
- * appearance.
67
- * This computed property is used to render the appropriate number of skeleton loader elements.
68
- */
69
- readonly items: import("@angular/core").Signal<number[]>;
70
- /**
71
- * A computed property that returns the final theme configuration for the skeleton loader.
72
- * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
73
- * with the root theme configuration. Otherwise, the theme is returned as-is.
74
- * This allows the skeleton loader to inherit global theme settings while still allowing for
75
- * component-specific theme customization.
76
- */
77
- readonly styles: import("@angular/core").Signal<NgxSkeletonLoaderConfigTheme>;
78
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, never>;
79
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": { "alias": "count"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
80
- }
@@ -1,10 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { NgxSkeletonLoaderConfig } from './ngx-skeleton-loader-config.types';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "./ngx-skeleton-loader.component";
5
- export declare class NgxSkeletonLoaderModule {
6
- static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, never, [typeof i1.NgxSkeletonLoaderComponent], [typeof i1.NgxSkeletonLoaderComponent]>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxSkeletonLoaderModule>;
10
- }
@@ -1,2 +0,0 @@
1
- import { NgxSkeletonLoaderConfig } from './ngx-skeleton-loader-config.types';
2
- export declare function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>): import("@angular/core").EnvironmentProviders;
package/public-api.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './lib/ngx-skeleton-loader.component';
2
- export * from './lib/ngx-skeleton-loader.module';
3
- export * from './lib/ngx-skeleton-loader.providers';
4
- export * from './lib/ngx-skeleton-loader-config.types';