ngx-skeleton-loader 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,13 +7,40 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  ## [Unreleased][]
9
9
 
10
+ ## [11.3.0][] - 2025-08-27
11
+
12
+ ### Added
13
+
14
+ - Adding info about `measureUnit` usage on `README.md` file
15
+ - Adding support for different CSS measurement units via `measureUnit` input attribute
16
+
17
+ ### Fixed
18
+
19
+ - Removing unnecessary folders from package distribution
20
+
21
+ ### Changed
22
+
23
+ - Using CSS Vars for skeleton definition
24
+ - Moving bundlesize configuration into `.bundlesize.config.json` file
25
+
26
+ ### Fixed
27
+
28
+ - Fixing dynamic height/width via `[theme]`
29
+
30
+ ## [11.2.1][] - 2025-06-27
31
+
32
+ ### Changed
33
+
34
+ - Adding new appearance `square`
35
+ - Fixing `peerDependencies` install
36
+
10
37
  ## [11.2.0][] - 2025-06-09
11
38
 
12
39
  ### Added
13
40
 
14
41
  - Adding new `pulse-dark` animation
15
42
 
16
- ### Updated
43
+ ### Changed
17
44
 
18
45
  - Upgrading Angular deps to v20
19
46
  - Replacing `npm install` to `npm ci` on Circle CI pipeline
@@ -23,13 +50,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
23
50
  ### Added
24
51
  - Adding support for standalone `provideNgxSkeletonLoader()`
25
52
 
26
- ### Updated
53
+ ### Changed
27
54
  - Upgrade project to use eslint v9
28
55
  - Updating docs to reflect standalone `provideNgxSkeletonLoader()` support
29
56
 
30
57
  ## [11.0.0][] - 2025-04-09
31
58
 
32
- ### Updated
59
+ ### Changed
33
60
  - Upgrading project to use Node.js v22.14.0
34
61
  - Upgrading project to Angular v19
35
62
  - 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.
@@ -39,7 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
39
66
  ### Removed
40
67
  - 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
41
68
 
42
- ### Updated
69
+ ### Changed
43
70
 
44
71
  > Thanks to @lekhmanrus
45
72
 
@@ -51,7 +78,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
51
78
  - Adding `PUBLISHING_HOTFIX.md` file describing all the steps to cover a hotfix in older version of NGX-Skeleton-Loader module
52
79
 
53
80
  ## [9.0.0][] - 2024-01-13
54
- ### Updated
81
+ ### Changed
55
82
 
56
83
  - Upgrading `@angular/*` packages to v17
57
84
  - Upgrading NodeJS to v20.10.0
@@ -62,9 +89,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
62
89
 
63
90
  - fixing issue with optional chaining not being supported on apps using Angular CLI <=v11;
64
91
 
65
- ### Updated
92
+ ### Changed
66
93
 
67
- - Updated input values validation in order to remove optional chaining. Instead, the code is now using object destructuring to get config theme value;
94
+ - Changed input values validation in order to remove optional chaining. Instead, the code is now using object destructuring to get config theme value;
68
95
 
69
96
  ## [8.0.2][] - 2023-09-11
70
97
 
@@ -80,7 +107,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
80
107
 
81
108
  ## [8.0.0][] - 2023-06-20
82
109
 
83
- ### Updated
110
+ ### Changed
84
111
 
85
112
  - Updating project to support Angular v16;
86
113
  - Updating NodeJS version to v18;
@@ -130,7 +157,7 @@ By using `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* .
130
157
  - 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
131
158
  - Adding examples for `custom-content` usage
132
159
 
133
- ### Updated
160
+ ### Changed
134
161
 
135
162
  - Updagrading module to Angular v15
136
163
 
@@ -140,7 +167,7 @@ By using `NgxSkeletonLoaderModule.forRoot({ theme: { extendsFromRoot: true, /* .
140
167
 
141
168
  ## [6.0.0][] - 2022-08-18
142
169
 
143
- ### Updated
170
+ ### Changed
144
171
 
145
172
  - Adding Publishing setup using NPX
146
173
  - Replacing CSS class namespace from `.loader` to `.skeleton-loader`
@@ -151,7 +178,7 @@ The CSS class used as namespace was changed. Previously, it was called `.loader`
151
178
 
152
179
  ## [5.0.0][] - 2022-02-08
153
180
 
154
- ### Updated
181
+ ### Changed
155
182
 
156
183
  > Thanks @yharaskrik
157
184
 
@@ -207,7 +234,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
207
234
 
208
235
  ## [2.9.2][] - 2021-04-11
209
236
 
210
- ### Updated
237
+ ### Changed
211
238
 
212
239
  - Updating link in README.md
213
240
 
@@ -221,7 +248,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
221
248
 
222
249
  - Adding `appearance` attribute to be checked via `ngOnChanges`
223
250
 
224
- ### Updated
251
+ ### Changed
225
252
 
226
253
  - Updating examples with new features
227
254
 
@@ -235,7 +262,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
235
262
  - PS: The other values alredy have a fallback, so nothing to worry here
236
263
  - 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
237
264
 
238
- ### Updated
265
+ ### Changed
239
266
 
240
267
  - Adding `ngOnChange` to validate `count` input in case of changes via binding
241
268
  - Updating `README.md` with information about `appearance` and `theme` usage.
@@ -247,7 +274,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
247
274
  - 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
248
275
  - Fixing type issues on `yarn build:ssr` command
249
276
 
250
- ### Updated
277
+ ### Changed
251
278
 
252
279
  - Updating `perf-marks` to `v1.14.1`
253
280
  - Adding strict mode support in module
@@ -268,7 +295,7 @@ Thanks @rkristelijn for raising the issue and the pull request!
268
295
  </div>
269
296
  ```
270
297
 
271
- ### Updated
298
+ ### Changed
272
299
 
273
300
  - Using OnPush as changeDetection mechanism into ngx-skeleton-loader component
274
301
  - 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.
@@ -334,7 +361,7 @@ export class AppModule {}
334
361
 
335
362
  - Fixing bundle size command on CircleCI pipeline
336
363
 
337
- ### Updated
364
+ ### Changed
338
365
 
339
366
  - Upgrading NodeJS to v14.11.0
340
367
  - Updating `perf-marks` package to v1.14.0
@@ -359,13 +386,13 @@ export class AppModule {}
359
386
 
360
387
  ## [2.4.2][] - 2020-08-01
361
388
 
362
- ### Updated
389
+ ### Changed
363
390
 
364
391
  - Bumping `perf-marks` to latest version
365
392
 
366
393
  ## [2.4.1][] - 2020-08-01
367
394
 
368
- ### Updated
395
+ ### Changed
369
396
 
370
397
  - Bumping `perf-marks` to latest version
371
398
 
@@ -375,7 +402,7 @@ export class AppModule {}
375
402
 
376
403
  - Adding User Timing API to track component render and content loader time
377
404
 
378
- ### Updated
405
+ ### Changed
379
406
 
380
407
  - Updating examples with new skeleton simulation
381
408
  - Adding Stackblitz link for user card skeleton loading demo
@@ -386,7 +413,7 @@ export class AppModule {}
386
413
 
387
414
  - Adding User Timing API to track component render and content loader time
388
415
 
389
- ### Updated
416
+ ### Changed
390
417
 
391
418
  - Updating examples with new skeleton simulation
392
419
  - Adding Stackblitz link for user card skeleton loading demo
@@ -397,7 +424,7 @@ export class AppModule {}
397
424
 
398
425
  - For compatibility with IE11 by using indexOf instead of `includes`
399
426
 
400
- ### Updated
427
+ ### Changed
401
428
 
402
429
  - Updating `npm run postinstall` command to follow the new rules from update.angular.io website
403
430
 
@@ -409,14 +436,14 @@ export class AppModule {}
409
436
 
410
437
  ## [2.1.0][] - 2020-06-01
411
438
 
412
- ### Updated
439
+ ### Changed
413
440
 
414
441
  - Upgrading @angular/cli to version 9
415
442
  - 🎉 Decreasing bundle size to 1.17KB 🎉
416
443
 
417
444
  ## [2.0.0][] - 2020-05-15
418
445
 
419
- ### Updated
446
+ ### Changed
420
447
 
421
448
  - Upgrading NodeJS to v12.16.2
422
449
  - Updating documentation with `animation` attribute
@@ -459,7 +486,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
459
486
 
460
487
  ## [1.2.7][] - 2020-04-13
461
488
 
462
- ### Updated
489
+ ### Changed
463
490
 
464
491
  - Decreasing bundle size after disable Ivy in production build
465
492
  - Adding description, keywords and github information on `package.json` files
@@ -478,7 +505,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
478
505
 
479
506
  ## [1.2.4][] - 2020-02-25
480
507
 
481
- ### Updated
508
+ ### Changed
482
509
 
483
510
  - Updating Github templates
484
511
  - Updating Angular CLI to v9
@@ -497,13 +524,13 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
497
524
 
498
525
  ## [1.2.1][] - 2019-06-08
499
526
 
500
- ### Updated
527
+ ### Changed
501
528
 
502
529
  - Updating Angular CLI to v8
503
530
 
504
531
  ## [1.2.0][] - 2019-04-19
505
532
 
506
- ### Updated
533
+ ### Changed
507
534
 
508
535
  - Updating Angular CLI to 7.3.8
509
536
 
@@ -513,7 +540,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
513
540
 
514
541
  - Adding badges for stackblitz, bundlephobia and license
515
542
 
516
- ### Updated
543
+ ### Changed
517
544
 
518
545
  - Removing unnecessary CSS styles for skeleton
519
546
 
@@ -534,7 +561,7 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
534
561
  - Added `CODE_OF_CONDUCT.md` with the Code of conduct
535
562
  - Added unit tests for skeletons and demo components
536
563
 
537
- ### Updated
564
+ ### Changed
538
565
 
539
566
  - Decreased bundle size
540
567
  - New gif showing `ngx-skeleton-loader` in action
@@ -639,7 +666,9 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
639
666
  [5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
640
667
  [unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
641
668
  [6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
642
- [Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.0...HEAD
669
+ [Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.3.0...HEAD
670
+ [11.3.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.1...v11.3.0
671
+ [11.2.1]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.0...v11.2.1
643
672
  [11.2.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.1.0...v11.2.0
644
673
  [11.1.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.0.0...v11.1.0
645
674
  [11.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v10.0.0...v11.0.0
package/README.md CHANGED
@@ -115,6 +115,10 @@ 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
+ <!-- It will use `px` as default CSS measure unit -->
120
+ <ngx-skeleton-loader count="5" appearance="square" size="100" />
121
+ </div>
118
122
  ```
119
123
 
120
124
  ### Using `NgxSkeletonLoaderModule.forRoot()`
@@ -148,7 +152,12 @@ export class YourAppComponent {}
148
152
  ```html
149
153
  <div class="item">
150
154
  <ngx-skeleton-loader count="5" appearance="circle" />
151
- <!-- 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..." -->
155
+ <!-- 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...", since it was
156
+ configured via `NgxSkeletonLoaderModule.forRoot()`-->
157
+
158
+ <!-- It will render a component with `aria-valuetext` attribute set with `Loading section content`,
159
+ since it was passed directly via input attribute `loadingText` -->
160
+ <ngx-skeleton-loader count="5" loadingText="Loading section content" />
152
161
  </div>
153
162
  ```
154
163
 
@@ -232,7 +241,14 @@ You can also define which appearance want to use in your skeleton loader by pass
232
241
  - `''` - _default_: it will use it `''` as appearance. At the end, it will render like a line;
233
242
  - `line`: it will render like a line. This is the same behavior as passing an empty string;
234
243
  - `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;
244
+ - `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` and it has `measureUnit` as optional way to change default CSS measure unit from `px` to one of the valid options: `px`, `em`, `rem`, `%`, `vh`, `vw`
245
+ - `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;
246
+
247
+ ### Appearance props (specific for `square`)
248
+
249
+ When setting `square` as appearance, your component can also use these other input attributes to configure it properly
250
+ - `size` - default _40_: number to be passed as definition for `width` and `height`. If not passed, it defaults to `40`
251
+ - `measureUnit` - default _px_: CSS measure unit to be used for `width` and `height`. If not passed, it defaults to `px`. Valid options: `px`, `em`, `rem`, `%`, `vh`, `vw`
236
252
 
237
253
  ## Animations
238
254
 
@@ -67,6 +67,21 @@ 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) (e.g., '50', '200').
75
+ */
76
+ this.size = input(this.#config?.size || null);
77
+ /**
78
+ * The `measureUnit` property is an input that determines the unit of measurement for the size
79
+ * of the skeleton loader.
80
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'px' if the
81
+ * config is not provided.
82
+ * This allows the size to be specified in different units, such as 'px', 'em', etc.
83
+ */
84
+ this.measureUnit = input(this.#config?.measureUnit || 'px');
70
85
  /**
71
86
  * The `items` property is a computed property that generates an array of indices based on the
72
87
  * `count` input.
@@ -88,6 +103,26 @@ class NgxSkeletonLoaderComponent {
88
103
  }
89
104
  return [...Array(count)].map((_, index) => index);
90
105
  });
106
+ /**
107
+ * The `squareSize` property is a computed property that calculates the size of the skeleton
108
+ * loader when the appearance is set to 'square'.
109
+ * It checks the `size` input and ensures that it is a valid number or string representing a
110
+ * valid pixel value. If the `size` is not a valid number or string, it returns `null`.
111
+ * If the `appearance` is not 'square', it also returns `null`.
112
+ * This computed property is used to set the width and height of the skeleton loader when it
113
+ * is displayed as a square.
114
+ */
115
+ this.squareSize = computed(() => {
116
+ const size = this.size();
117
+ if (this.appearance() !== 'square' || (typeof size !== 'number' && typeof size !== 'string')) {
118
+ return null;
119
+ }
120
+ const sizeValueInNumbersOnly = Number(size.toString().trim().replace(/\D/g, ''));
121
+ if (!Number.isInteger(sizeValueInNumbersOnly)) {
122
+ return null;
123
+ }
124
+ return `${sizeValueInNumbersOnly}${this.measureUnit()}`;
125
+ });
91
126
  /**
92
127
  * A computed property that returns the final theme configuration for the skeleton loader.
93
128
  * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
@@ -97,13 +132,18 @@ class NgxSkeletonLoaderComponent {
97
132
  */
98
133
  this.styles = computed(() => {
99
134
  const theme = this.theme();
135
+ const size = this.squareSize();
100
136
  if (this.#config?.theme?.extendsFromRoot) {
101
137
  return {
102
138
  ...this.#config?.theme,
103
139
  ...theme,
140
+ ...(size && { width: size, height: size }),
104
141
  };
105
142
  }
106
- return theme;
143
+ return {
144
+ ...theme,
145
+ ...(size && { width: size, height: size }),
146
+ };
107
147
  });
108
148
  }
109
149
  /**
@@ -113,11 +153,11 @@ class NgxSkeletonLoaderComponent {
113
153
  */
114
154
  #config;
115
155
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
116
- 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 } }, 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 [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.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 }); }
156
+ 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 }, measureUnit: { classPropertyName: "measureUnit", publicName: "measureUnit", 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{--ngx-skeleton-loader-base-color: rgb(239, 241, 246);--ngx-skeleton-loader-light-mode-color: rgba(255, 255, 255, .6);--ngx-skeleton-loader-light-mode-color-to: rgba(255, 255, 255, 0);--ngx-skeleton-loader-dark-mode-color: rgba(0, 0, 0, .2);--ngx-skeleton-loader-dark-mode-color-to: transparent;--ngx-skeleton-loader-animation-duration: 2s;--ngx-skeleton-loader-background-image-light-mode: linear-gradient( 90deg, var(--ngx-skeleton-loader-light-mode-color-to), var(--ngx-skeleton-loader-light-mode-color), var(--ngx-skeleton-loader-light-mode-color-to) );--ngx-skeleton-loader-background-image-dark-mode: linear-gradient( 90deg, var(--ngx-skeleton-loader-dark-mode-color-to), var(--ngx-skeleton-loader-dark-mode-color), var(--ngx-skeleton-loader-dark-mode-color-to) );box-sizing:border-box;overflow:hidden;position:relative;background:var(--ngx-skeleton-loader-base-color) 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 var(--ngx-skeleton-loader-animation-duration) 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:var(--ngx-skeleton-loader-background-image-light-mode)}.skeleton-loader.progress-dark:before{background-image:var(--ngx-skeleton-loader-background-image-dark-mode)}.skeleton-loader.pulse{animation:pulse var(--ngx-skeleton-loader-animation-duration) cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.pulse-dark{background:var(--ngx-skeleton-loader-dark-mode-color);animation:pulse var(--ngx-skeleton-loader-animation-duration) 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
157
  }
118
158
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
119
159
  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 [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.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"] }]
160
+ 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{--ngx-skeleton-loader-base-color: rgb(239, 241, 246);--ngx-skeleton-loader-light-mode-color: rgba(255, 255, 255, .6);--ngx-skeleton-loader-light-mode-color-to: rgba(255, 255, 255, 0);--ngx-skeleton-loader-dark-mode-color: rgba(0, 0, 0, .2);--ngx-skeleton-loader-dark-mode-color-to: transparent;--ngx-skeleton-loader-animation-duration: 2s;--ngx-skeleton-loader-background-image-light-mode: linear-gradient( 90deg, var(--ngx-skeleton-loader-light-mode-color-to), var(--ngx-skeleton-loader-light-mode-color), var(--ngx-skeleton-loader-light-mode-color-to) );--ngx-skeleton-loader-background-image-dark-mode: linear-gradient( 90deg, var(--ngx-skeleton-loader-dark-mode-color-to), var(--ngx-skeleton-loader-dark-mode-color), var(--ngx-skeleton-loader-dark-mode-color-to) );box-sizing:border-box;overflow:hidden;position:relative;background:var(--ngx-skeleton-loader-base-color) 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 var(--ngx-skeleton-loader-animation-duration) 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:var(--ngx-skeleton-loader-background-image-light-mode)}.skeleton-loader.progress-dark:before{background-image:var(--ngx-skeleton-loader-background-image-dark-mode)}.skeleton-loader.pulse{animation:pulse var(--ngx-skeleton-loader-animation-duration) cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.pulse-dark{background:var(--ngx-skeleton-loader-dark-mode-color);animation:pulse var(--ngx-skeleton-loader-animation-duration) 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
161
  }] });
122
162
 
123
163
  class NgxSkeletonLoaderModule {
@@ -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' | 'pulse-dark' | '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 [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":";;;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,KAAK,CAA+B,IAAI,CAAC,OAAO,EA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,MAAA,EAAA,CAAA,CAAA;;2FDIa,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAGd,eAAA,EAAA,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,m1BAAA,EAAA,MAAA,EAAA,CAAA,i5DAAA,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;;;;"}
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\ntype CSSMeasureUnit = 'px' | 'em' | 'rem' | '%' | 'vh' | 'vw';\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}${CSSMeasureUnit}` | null;\n measureUnit: CSSMeasureUnit;\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) (e.g., '50', '200').\n */\n readonly size = input<NgxSkeletonLoaderConfig['size']>(this.#config?.size || null);\n /**\n * The `measureUnit` property is an input that determines the unit of measurement for the size\n * of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'px' if the\n * config is not provided.\n * This allows the size to be specified in different units, such as 'px', 'em', etc.\n */\n readonly measureUnit = input<NgxSkeletonLoaderConfig['measureUnit']>(this.#config?.measureUnit || 'px');\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\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\n if (this.appearance() !== 'square' || (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\n return `${sizeValueInNumbersOnly}${this.measureUnit()}`;\n });\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":";;;MAuBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;ACRlH;;;;;;AAMG;MAQU,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQE;;;;AAIG;QACM,IAAO,CAAA,OAAA,GAAG,MAAM,CAA0B,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAClG;;;;;;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,CAA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AQ,EAAE,MAAM,EAAE;AAC1D,KAAA,CAAC;AACJ;;ACPA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -6,13 +6,16 @@ type NgxSkeletonLoaderConfigTheme = {
6
6
  extendsFromRoot?: boolean;
7
7
  [k: string]: any;
8
8
  } | null;
9
+ type CSSMeasureUnit = 'px' | 'em' | 'rem' | '%' | 'vh' | 'vw';
9
10
  interface NgxSkeletonLoaderConfig {
10
- appearance: 'circle' | 'line' | 'custom-content' | '';
11
+ appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';
11
12
  animation: 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'false' | false;
12
13
  theme: NgxSkeletonLoaderConfigTheme;
13
14
  loadingText: string;
14
15
  count: number;
15
16
  ariaLabel: string;
17
+ size: number | `${number}` | `${number}${CSSMeasureUnit}` | null;
18
+ measureUnit: CSSMeasureUnit;
16
19
  }
17
20
  declare const NGX_SKELETON_LOADER_CONFIG: InjectionToken<NgxSkeletonLoaderConfig>;
18
21
 
@@ -48,7 +51,7 @@ declare class NgxSkeletonLoaderComponent {
48
51
  * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
49
52
  * type.
50
53
  */
51
- readonly appearance: _angular_core.InputSignal<"" | "circle" | "line" | "custom-content">;
54
+ readonly appearance: _angular_core.InputSignal<"" | "circle" | "line" | "custom-content" | "square">;
52
55
  /**
53
56
  * The `animation` property is an input that determines the type of animation to apply to the
54
57
  * skeleton loader.
@@ -74,6 +77,21 @@ declare class NgxSkeletonLoaderComponent {
74
77
  * etc.
75
78
  */
76
79
  readonly theme: _angular_core.InputSignal<NgxSkeletonLoaderConfigTheme>;
80
+ /**
81
+ * The `size` property is an input that determines the size of the skeleton loader.
82
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
83
+ * config is not provided.
84
+ * The size can be specified as a number (in pixels) (e.g., '50', '200').
85
+ */
86
+ readonly size: _angular_core.InputSignal<number | `${number}` | `${number}px` | `${number}em` | `${number}rem` | `${number}%` | `${number}vh` | `${number}vw` | null>;
87
+ /**
88
+ * The `measureUnit` property is an input that determines the unit of measurement for the size
89
+ * of the skeleton loader.
90
+ * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'px' if the
91
+ * config is not provided.
92
+ * This allows the size to be specified in different units, such as 'px', 'em', etc.
93
+ */
94
+ readonly measureUnit: _angular_core.InputSignal<"px" | "em" | "rem" | "%" | "vh" | "vw">;
77
95
  /**
78
96
  * The `items` property is a computed property that generates an array of indices based on the
79
97
  * `count` input.
@@ -83,6 +101,16 @@ declare class NgxSkeletonLoaderComponent {
83
101
  * This computed property is used to render the appropriate number of skeleton loader elements.
84
102
  */
85
103
  readonly items: _angular_core.Signal<number[]>;
104
+ /**
105
+ * The `squareSize` property is a computed property that calculates the size of the skeleton
106
+ * loader when the appearance is set to 'square'.
107
+ * It checks the `size` input and ensures that it is a valid number or string representing a
108
+ * valid pixel value. If the `size` is not a valid number or string, it returns `null`.
109
+ * If the `appearance` is not 'square', it also returns `null`.
110
+ * This computed property is used to set the width and height of the skeleton loader when it
111
+ * is displayed as a square.
112
+ */
113
+ readonly squareSize: _angular_core.Signal<string | null>;
86
114
  /**
87
115
  * A computed property that returns the final theme configuration for the skeleton loader.
88
116
  * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
@@ -90,9 +118,13 @@ declare class NgxSkeletonLoaderComponent {
90
118
  * This allows the skeleton loader to inherit global theme settings while still allowing for
91
119
  * component-specific theme customization.
92
120
  */
93
- readonly styles: _angular_core.Signal<NgxSkeletonLoaderConfigTheme>;
121
+ readonly styles: _angular_core.Signal<{
122
+ width?: string | undefined;
123
+ height?: string | undefined;
124
+ extendsFromRoot?: boolean;
125
+ }>;
94
126
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, never>;
95
- 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; }; }, {}, never, ["*"], true, never>;
127
+ 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; }; "measureUnit": { "alias": "measureUnit"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
96
128
  }
97
129
 
98
130
  declare class NgxSkeletonLoaderModule {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "ngx-skeleton-loader",
3
3
  "description": "Make beautiful, animated loading skeletons that automatically adapt to your Angular apps",
4
- "version": "11.2.0",
4
+ "version": "11.3.0",
5
5
  "peerDependencies": {
6
- "@angular/common": ">=20.0.0",
7
- "@angular/core": ">=20.0.0"
6
+ "@angular/common": ">=19.0.0",
7
+ "@angular/core": ">=19.0.0"
8
8
  },
9
9
  "license": "MIT",
10
10
  "keywords": [