ngx-skeleton-loader 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/CONTRIBUTING.md +1 -1
- package/PUBLISHING_HOTFIX.md +102 -0
- package/README.md +3 -3
- package/esm2022/lib/ngx-skeleton-loader.component.mjs +112 -87
- package/esm2022/lib/ngx-skeleton-loader.module.mjs +6 -7
- package/fesm2022/ngx-skeleton-loader.mjs +116 -93
- package/fesm2022/ngx-skeleton-loader.mjs.map +1 -1
- package/lib/ngx-skeleton-loader.component.d.ts +78 -19
- package/lib/ngx-skeleton-loader.module.d.ts +3 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased][]
|
|
9
9
|
|
|
10
|
+
## [10.0.0][] - 2025-01-24
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
- 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
|
|
14
|
+
|
|
15
|
+
### Updated
|
|
16
|
+
|
|
17
|
+
> Thanks to @lekhmanrus
|
|
18
|
+
|
|
19
|
+
- Upgrading `@angular/*` packages to v19 - https://github.com/willmendesneto/ngx-skeleton-loader/pull/179
|
|
20
|
+
- Implementing Angular Signals integration - https://github.com/willmendesneto/ngx-skeleton-loader/pull/179
|
|
21
|
+
- Making NGX-Skeleton-Loader Standalone Compliant - Closes https://github.com/willmendesneto/ngx-skeleton-loader/issues/183
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Adding `PUBLISHING_HOTFIX.md` file describing all the steps to cover a hotfix in older version of NGX-Skeleton-Loader module
|
|
25
|
+
|
|
10
26
|
## [9.0.0][] - 2024-01-13
|
|
11
27
|
### Updated
|
|
12
28
|
|
|
@@ -596,7 +612,9 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
|
|
|
596
612
|
[5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
|
|
597
613
|
[unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
|
|
598
614
|
[6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
|
|
599
|
-
[Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/
|
|
615
|
+
[Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v10.0.0...HEAD
|
|
616
|
+
[10.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v9.0.0...v10.0.0
|
|
617
|
+
[9.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v9.0.0...v9.0.0
|
|
600
618
|
[9.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v8.1.0...v9.0.0
|
|
601
619
|
[8.1.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v8.0.2...v8.1.0
|
|
602
620
|
[8.0.2]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v8.0.1...v8.0.2
|
package/CONTRIBUTING.md
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Publishing a Hotfix for NGX Skeleton Loader
|
|
2
|
+
|
|
3
|
+
> This guide outlines the steps to publish a hotfix for the NGX Skeleton Loader package for older versions - if necessary.
|
|
4
|
+
|
|
5
|
+
A hotfix addresses critical issues that need immediate attention without waiting for the next scheduled release cycle.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Please make sure you're using the correct NodeJS and NPM versions, as described below - and also in `.nvmrc` file.
|
|
10
|
+
|
|
11
|
+
> **Note** requires node v20.x.x or higher and npm 10.x.x.
|
|
12
|
+
|
|
13
|
+
## Hotfix Process
|
|
14
|
+
|
|
15
|
+
### 1. Identify the Issue
|
|
16
|
+
|
|
17
|
+
Clearly define the issue that needs a hotfix. Use the following steps:
|
|
18
|
+
|
|
19
|
+
Open an issue on GitHub, detailing the problem and its urgency.
|
|
20
|
+
|
|
21
|
+
Reference the issue number in all subsequent commits and documentation.
|
|
22
|
+
|
|
23
|
+
### 2. Create a Hotfix Branch
|
|
24
|
+
|
|
25
|
+
Create a new branch based on the latest stable release tag.
|
|
26
|
+
|
|
27
|
+
# Clone the package and fetch the latest tags and branches
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/willmendesneto/ngx-skeleton-loader.git
|
|
31
|
+
cd ngx-skeleton-loader
|
|
32
|
+
git fetch --all
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
# Check out the latest stable release without the issue in specific
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# By running `git checkout <latest-stable-tag>`
|
|
39
|
+
# you will be in a detached head state. E.G:
|
|
40
|
+
git checkout v1.1.0
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
# Create and switch to a hotfix branch
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# create new branch based on detached head state
|
|
47
|
+
git checkout -b hotfix/<issue-key>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Implement the Fix
|
|
51
|
+
|
|
52
|
+
Modify the necessary files in the codebase.
|
|
53
|
+
|
|
54
|
+
Run tests to confirm the fix resolves the issue without introducing new bugs.
|
|
55
|
+
|
|
56
|
+
### 4. Update the Version Number
|
|
57
|
+
|
|
58
|
+
Use npm to bump the patch version. The new version follows semantic versioning:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm version patch
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This updates the version in package.json and creates a Git tag for the new version.
|
|
65
|
+
|
|
66
|
+
### 5. Add a Changelog Entry
|
|
67
|
+
|
|
68
|
+
Update the `CHANGELOG.md` file with details of the hotfix:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
## [x.y.z] - YYYY-MM-DD
|
|
72
|
+
### Fixed
|
|
73
|
+
- [#issue-number] Description of the hotfix.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 6. Push Changes to the Repository
|
|
77
|
+
|
|
78
|
+
Push the hotfix branch and the updated tag to the remote repository:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git push origin hotfix/<issue-key>
|
|
82
|
+
git push origin --tags
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 7. Create a Pull Request
|
|
86
|
+
|
|
87
|
+
Open a pull request (PR) from the hotfix branch to the main branch.If it's not against main, please make sure you're pointing to the right branch - and add all relevant reviewers.
|
|
88
|
+
|
|
89
|
+
Include a link to the issue being resolved and the changelog entry.
|
|
90
|
+
|
|
91
|
+
### 8. Merge and Publish the Package Fix
|
|
92
|
+
|
|
93
|
+
Once the PR is reviewed and merged, the updated package will be published to npm by following the [Publish steps as described on `README.md` file.](https://github.com/willmendesneto/ngx-skeleton-loader?tab=readme-ov-file#publish)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Notes
|
|
97
|
+
|
|
98
|
+
Testing: Always run the full test suite before merging and publishing a hotfix.
|
|
99
|
+
|
|
100
|
+
Documentation: Maintain up-to-date documentation for future contributors.
|
|
101
|
+
|
|
102
|
+
By following these steps, you ensure a smooth and reliable hotfix process for the NGX Skeleton Loader package.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://npmjs.org/ngx-skeleton-loader)
|
|
9
9
|
|
|
10
10
|
[](https://circleci.com/gh/willmendesneto/ngx-skeleton-loader)
|
|
11
|
-
[](https://coveralls.io/r/willmendesneto/ngx-skeleton-loader?branch=main)
|
|
12
12
|
[](https://bundlephobia.com/result?p=ngx-skeleton-loader)
|
|
13
13
|
[](/LICENSE)
|
|
14
14
|
|
|
@@ -348,11 +348,11 @@ this project is using `np` package to publish, which makes things straightforwar
|
|
|
348
348
|
|
|
349
349
|
## Contribute
|
|
350
350
|
|
|
351
|
-
For any type of contribution, please follow the instructions in [CONTRIBUTING.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/
|
|
351
|
+
For any type of contribution, please follow the instructions in [CONTRIBUTING.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/main/CONTRIBUTING.md) and read [CODE_OF_CONDUCT.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/main/CODE_OF_CONDUCT.md) and [PUBLISHING_HOTFIX.md](https://github.com/willmendesneto/ngx-skeleton-loader/blob/main/PUBLISHING_HOTFIX.md) files.
|
|
352
352
|
|
|
353
353
|
## Author
|
|
354
354
|
|
|
355
355
|
**Wilson Mendes (willmendesneto)**
|
|
356
356
|
|
|
357
|
-
- <https://
|
|
357
|
+
- <https://instagram.com/willmendesneto>
|
|
358
358
|
- <http://github.com/willmendesneto>
|
|
@@ -1,95 +1,120 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, isDevMode, ChangeDetectionStrategy, input, inject, numberAttribute, computed, } from '@angular/core';
|
|
2
|
+
import { NgClass, NgStyle } from '@angular/common';
|
|
2
3
|
import { NGX_SKELETON_LOADER_CONFIG, } from './ngx-skeleton-loader-config.types';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
|
|
7
|
+
* loader UI element.
|
|
8
|
+
* It can be used to display a loading state before the actual content is available.
|
|
9
|
+
* The component can be configured with various options such as the number of elements, appearance,
|
|
10
|
+
* animation, and theme.
|
|
11
|
+
*/
|
|
5
12
|
export class NgxSkeletonLoaderComponent {
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.
|
|
16
|
+
* This configuration object provides various options for customizing the behavior
|
|
17
|
+
* and appearance of the `NgxSkeletonLoaderComponent`.
|
|
18
|
+
*/
|
|
19
|
+
this.#config = inject(NGX_SKELETON_LOADER_CONFIG, { optional: true });
|
|
20
|
+
/**
|
|
21
|
+
* The `count` property is an input that determines the number of skeleton loader elements
|
|
22
|
+
* to display.
|
|
23
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
|
|
24
|
+
* is not provided.
|
|
25
|
+
* The `transform: numberAttribute` option ensures that the input value is converted to a number.
|
|
26
|
+
*/
|
|
27
|
+
this.count = input(this.#config?.count || 1, { transform: numberAttribute });
|
|
28
|
+
/**
|
|
29
|
+
* The `loadingText` property is an input that determines the text to display while the content
|
|
30
|
+
* is loading.
|
|
31
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
|
|
32
|
+
* if the config is not provided.
|
|
33
|
+
*/
|
|
34
|
+
this.loadingText = input(this.#config?.loadingText || 'Loading...');
|
|
35
|
+
/**
|
|
36
|
+
* The `appearance` property is an input that determines the visual appearance of the skeleton
|
|
37
|
+
* loader.
|
|
38
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
|
|
39
|
+
* config is not provided.
|
|
40
|
+
* The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
|
|
41
|
+
* type.
|
|
42
|
+
*/
|
|
43
|
+
this.appearance = input(this.#config?.appearance || 'line');
|
|
44
|
+
/**
|
|
45
|
+
* The `animation` property is an input that determines the type of animation to apply to the
|
|
46
|
+
* skeleton loader.
|
|
47
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
|
|
48
|
+
* the config is not provided.
|
|
49
|
+
* The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
|
|
50
|
+
*/
|
|
51
|
+
this.animation = input(this.#config?.animation || 'progress');
|
|
52
|
+
/**
|
|
53
|
+
* The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
|
|
54
|
+
* loader element. This is useful for providing accessibility information to screen readers.
|
|
55
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
|
|
56
|
+
* config is not provided.
|
|
57
|
+
*/
|
|
58
|
+
this.ariaLabel = input(this.#config?.ariaLabel || 'loading');
|
|
59
|
+
/**
|
|
60
|
+
* The `theme` property is an input that determines the theme configuration for the skeleton
|
|
61
|
+
* loader.
|
|
62
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
|
|
63
|
+
* config is not provided.
|
|
64
|
+
* The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
|
|
65
|
+
* customizing various aspects of the skeleton loader's appearance, such as colors, animation,
|
|
66
|
+
* etc.
|
|
67
|
+
*/
|
|
68
|
+
this.theme = input(this.#config?.theme || null);
|
|
69
|
+
/**
|
|
70
|
+
* The `items` property is a computed property that generates an array of indices based on the
|
|
71
|
+
* `count` input.
|
|
72
|
+
* If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
|
|
73
|
+
* skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
|
|
74
|
+
* appearance.
|
|
75
|
+
* This computed property is used to render the appropriate number of skeleton loader elements.
|
|
76
|
+
*/
|
|
77
|
+
this.items = computed(() => {
|
|
78
|
+
let count = this.count() || 1;
|
|
79
|
+
// Force count to 1 when custom-content is used
|
|
80
|
+
if (this.appearance() === 'custom-content') {
|
|
81
|
+
// Shows error message only in Development
|
|
82
|
+
if (isDevMode() && count !== 1) {
|
|
83
|
+
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
84
|
+
count = 1;
|
|
85
|
+
}
|
|
35
86
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
87
|
+
return [...Array(count)].map((_, index) => index);
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* A computed property that returns the final theme configuration for the skeleton loader.
|
|
91
|
+
* If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
|
|
92
|
+
* with the root theme configuration. Otherwise, the theme is returned as-is.
|
|
93
|
+
* This allows the skeleton loader to inherit global theme settings while still allowing for
|
|
94
|
+
* component-specific theme customization.
|
|
95
|
+
*/
|
|
96
|
+
this.styles = computed(() => {
|
|
97
|
+
const theme = this.theme();
|
|
98
|
+
if (this.#config?.theme?.extendsFromRoot) {
|
|
99
|
+
return {
|
|
100
|
+
...this.#config?.theme,
|
|
101
|
+
...theme,
|
|
102
|
+
};
|
|
43
103
|
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {
|
|
47
|
-
// Shows error message only in Development
|
|
48
|
-
if (isDevMode()) {
|
|
49
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to "''".`);
|
|
50
|
-
}
|
|
51
|
-
this.appearance = '';
|
|
52
|
-
}
|
|
53
|
-
// This code is not using optional chaining since it's only supported on Angular CLI v12
|
|
54
|
-
// - more details in this comment https://github.com/angular/angular-cli/issues/20471#issuecomment-815599616
|
|
55
|
-
// Which raises issues on the consumer's side. E.G: https://github.com/willmendesneto/ngx-skeleton-loader/issues/150#issuecomment-1638612329
|
|
56
|
-
const { theme } = this.config || {};
|
|
57
|
-
if (!!theme && !!theme.extendsFromRoot && this.theme !== null) {
|
|
58
|
-
// Shows error message only in Development
|
|
59
|
-
this.theme = { ...this.config.theme, ...this.theme };
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
ngOnChanges(changes) {
|
|
63
|
-
// Avoiding multiple calls for the same input in case there's no changes in the fields
|
|
64
|
-
// Checking if the fields that require validation are available and if they were changed
|
|
65
|
-
// In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.
|
|
66
|
-
if (['count', 'animation', 'appearance'].find(key => changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue))) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.validateInputValues();
|
|
104
|
+
return theme;
|
|
105
|
+
});
|
|
70
106
|
}
|
|
71
|
-
/**
|
|
72
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.
|
|
109
|
+
* This configuration object provides various options for customizing the behavior
|
|
110
|
+
* and appearance of the `NgxSkeletonLoaderComponent`.
|
|
111
|
+
*/
|
|
112
|
+
#config;
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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 [ngClass]=\"{\n 'custom-content': appearanceValue === 'custom-content',\n circle: appearanceValue === 'circle',\n progress: animationValue === 'progress',\n 'progress-dark': animationValue === 'progress-dark',\n pulse: animationValue === 'pulse'\n }\"\n [ngStyle]=\"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"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
73
115
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
75
117
|
type: Component,
|
|
76
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "@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 [ngClass]=\"{\n 'custom-content':
|
|
77
|
-
}]
|
|
78
|
-
type: Inject,
|
|
79
|
-
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
80
|
-
}, {
|
|
81
|
-
type: Optional
|
|
82
|
-
}] }], propDecorators: { count: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], loadingText: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], appearance: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], animation: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], ariaLabel: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], theme: [{
|
|
93
|
-
type: Input
|
|
94
|
-
}] } });
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9u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AgY2lyY2xlOiBhcHBlYXJhbmNlID09PSAnY2lyY2xlJyxcbiAgICAgIHByb2dyZXNzOiBhbmltYXRpb24gPT09ICdwcm9ncmVzcycsXG4gICAgICAncHJvZ3Jlc3MtZGFyayc6IGFuaW1hdGlvbiA9PT0gJ3Byb2dyZXNzLWRhcmsnLFxuICAgICAgcHVsc2U6IGFuaW1hdGlvbiA9PT0gJ3B1bHNlJ1xuICAgIH1cIlxuICAgIFtuZ1N0eWxlXT1cInRoZW1lXCJcbiAgICA+XG4gICAgQGlmIChhcHBlYXJhbmNlICA9PT0gJ2N1c3RvbS1jb250ZW50Jykge1xuICAgICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuICAgIH1cbiAgPC9kaXY+XG59XG4iXX0=
|
|
118
|
+
args: [{ selector: 'ngx-skeleton-loader', imports: [NgClass, NgStyle], 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 [ngClass]=\"{\n 'custom-content': appearanceValue === 'custom-content',\n circle: appearanceValue === 'circle',\n progress: animationValue === 'progress',\n 'progress-dark': animationValue === 'progress-dark',\n pulse: animationValue === 'pulse'\n }\"\n [ngStyle]=\"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"] }]
|
|
119
|
+
}] });
|
|
120
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFD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ID09PSAnY3VzdG9tLWNvbnRlbnQnLFxuICAgICAgY2lyY2xlOiBhcHBlYXJhbmNlVmFsdWUgPT09ICdjaXJjbGUnLFxuICAgICAgcHJvZ3Jlc3M6IGFuaW1hdGlvblZhbHVlID09PSAncHJvZ3Jlc3MnLFxuICAgICAgJ3Byb2dyZXNzLWRhcmsnOiBhbmltYXRpb25WYWx1ZSA9PT0gJ3Byb2dyZXNzLWRhcmsnLFxuICAgICAgcHVsc2U6IGFuaW1hdGlvblZhbHVlID09PSAncHVsc2UnXG4gICAgfVwiXG4gICAgW25nU3R5bGVdPVwic3R5bGVzKClcIlxuICAgID5cbiAgICBAaWYgKGFwcGVhcmFuY2VWYWx1ZSAgPT09ICdjdXN0b20tY29udGVudCcpIHtcbiAgICAgIDxuZy1jb250ZW50PjwvbmctY29udGVudD5cbiAgICB9XG4gIDwvZGl2PlxufVxuIl19
|
|
@@ -10,16 +10,15 @@ export class NgxSkeletonLoaderModule {
|
|
|
10
10
|
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
14
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule, NgxSkeletonLoaderComponent], exports: [NgxSkeletonLoaderComponent] }); }
|
|
15
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
18
18
|
type: NgModule,
|
|
19
19
|
args: [{
|
|
20
|
-
|
|
21
|
-
imports: [CommonModule],
|
|
20
|
+
imports: [CommonModule, NgxSkeletonLoaderComponent],
|
|
22
21
|
exports: [NgxSkeletonLoaderComponent],
|
|
23
22
|
}]
|
|
24
23
|
}] });
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2tlbGV0b24tbG9hZGVyL3NyYy9saWIvbmd4LXNrZWxldG9uLWxvYWRlci5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdFLE9BQU8sRUFBMkIsMEJBQTBCLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQzs7QUFNekcsTUFBTSxPQUFPLHVCQUF1QjtJQUNsQyxNQUFNLENBQUMsT0FBTyxDQUFDLE1BQXlDO1FBQ3RELE9BQU87WUFDTCxRQUFRLEVBQUUsdUJBQXVCO1lBQ2pDLFNBQVMsRUFBRSxDQUFDLEVBQUUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLFFBQVEsRUFBRSxNQUFNLEVBQUUsQ0FBQztTQUN2RSxDQUFDO0lBQ0osQ0FBQzsrR0FOVSx1QkFBdUI7Z0hBQXZCLHVCQUF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TG9hZGVyTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbeyBwcm92aWRlOiBOR1hfU0tFTEVUT05fTE9BREVSX0NPTkZJRywgdXNlVmFsdWU6IGNvbmZpZyB9XSxcbiAgICB9O1xuICB9XG59XG4iXX0=
|
|
@@ -1,100 +1,124 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
3
|
-
import
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { InjectionToken, inject, input, numberAttribute, computed, isDevMode, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import { NgClass, NgStyle, CommonModule } from '@angular/common';
|
|
5
4
|
|
|
6
5
|
const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
|
|
9
|
+
* loader UI element.
|
|
10
|
+
* It can be used to display a loading state before the actual content is available.
|
|
11
|
+
* The component can be configured with various options such as the number of elements, appearance,
|
|
12
|
+
* animation, and theme.
|
|
13
|
+
*/
|
|
8
14
|
class NgxSkeletonLoaderComponent {
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
/**
|
|
17
|
+
* Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.
|
|
18
|
+
* This configuration object provides various options for customizing the behavior
|
|
19
|
+
* and appearance of the `NgxSkeletonLoaderComponent`.
|
|
20
|
+
*/
|
|
21
|
+
this.#config = inject(NGX_SKELETON_LOADER_CONFIG, { optional: true });
|
|
22
|
+
/**
|
|
23
|
+
* The `count` property is an input that determines the number of skeleton loader elements
|
|
24
|
+
* to display.
|
|
25
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
|
|
26
|
+
* is not provided.
|
|
27
|
+
* The `transform: numberAttribute` option ensures that the input value is converted to a number.
|
|
28
|
+
*/
|
|
29
|
+
this.count = input(this.#config?.count || 1, { transform: numberAttribute });
|
|
30
|
+
/**
|
|
31
|
+
* The `loadingText` property is an input that determines the text to display while the content
|
|
32
|
+
* is loading.
|
|
33
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
|
|
34
|
+
* if the config is not provided.
|
|
35
|
+
*/
|
|
36
|
+
this.loadingText = input(this.#config?.loadingText || 'Loading...');
|
|
37
|
+
/**
|
|
38
|
+
* The `appearance` property is an input that determines the visual appearance of the skeleton
|
|
39
|
+
* loader.
|
|
40
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
|
|
41
|
+
* config is not provided.
|
|
42
|
+
* The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
|
|
43
|
+
* type.
|
|
44
|
+
*/
|
|
45
|
+
this.appearance = input(this.#config?.appearance || 'line');
|
|
46
|
+
/**
|
|
47
|
+
* The `animation` property is an input that determines the type of animation to apply to the
|
|
48
|
+
* skeleton loader.
|
|
49
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
|
|
50
|
+
* the config is not provided.
|
|
51
|
+
* The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
|
|
52
|
+
*/
|
|
53
|
+
this.animation = input(this.#config?.animation || 'progress');
|
|
54
|
+
/**
|
|
55
|
+
* The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
|
|
56
|
+
* loader element. This is useful for providing accessibility information to screen readers.
|
|
57
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
|
|
58
|
+
* config is not provided.
|
|
59
|
+
*/
|
|
60
|
+
this.ariaLabel = input(this.#config?.ariaLabel || 'loading');
|
|
61
|
+
/**
|
|
62
|
+
* The `theme` property is an input that determines the theme configuration for the skeleton
|
|
63
|
+
* loader.
|
|
64
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
|
|
65
|
+
* config is not provided.
|
|
66
|
+
* The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
|
|
67
|
+
* customizing various aspects of the skeleton loader's appearance, such as colors, animation,
|
|
68
|
+
* etc.
|
|
69
|
+
*/
|
|
70
|
+
this.theme = input(this.#config?.theme || null);
|
|
71
|
+
/**
|
|
72
|
+
* The `items` property is a computed property that generates an array of indices based on the
|
|
73
|
+
* `count` input.
|
|
74
|
+
* If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
|
|
75
|
+
* skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
|
|
76
|
+
* appearance.
|
|
77
|
+
* This computed property is used to render the appropriate number of skeleton loader elements.
|
|
78
|
+
*/
|
|
79
|
+
this.items = computed(() => {
|
|
80
|
+
let count = this.count() || 1;
|
|
81
|
+
// Force count to 1 when custom-content is used
|
|
82
|
+
if (this.appearance() === 'custom-content') {
|
|
83
|
+
// Shows error message only in Development
|
|
84
|
+
if (isDevMode() && count !== 1) {
|
|
85
|
+
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
86
|
+
count = 1;
|
|
87
|
+
}
|
|
29
88
|
}
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
89
|
+
return [...Array(count)].map((_, index) => index);
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* A computed property that returns the final theme configuration for the skeleton loader.
|
|
93
|
+
* If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
|
|
94
|
+
* with the root theme configuration. Otherwise, the theme is returned as-is.
|
|
95
|
+
* This allows the skeleton loader to inherit global theme settings while still allowing for
|
|
96
|
+
* component-specific theme customization.
|
|
97
|
+
*/
|
|
98
|
+
this.styles = computed(() => {
|
|
99
|
+
const theme = this.theme();
|
|
100
|
+
if (this.#config?.theme?.extendsFromRoot) {
|
|
101
|
+
return {
|
|
102
|
+
...this.#config?.theme,
|
|
103
|
+
...theme,
|
|
104
|
+
};
|
|
38
105
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];
|
|
42
|
-
if (allowedAnimations.indexOf(String(this.animation)) === -1) {
|
|
43
|
-
// Shows error message only in Development
|
|
44
|
-
if (isDevMode()) {
|
|
45
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'animation' as: ${allowedAnimations.join(', ')}. Forcing default to "progress".`);
|
|
46
|
-
}
|
|
47
|
-
this.animation = 'progress';
|
|
48
|
-
}
|
|
49
|
-
if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {
|
|
50
|
-
// Shows error message only in Development
|
|
51
|
-
if (isDevMode()) {
|
|
52
|
-
console.error(`\`NgxSkeletonLoaderComponent\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to "''".`);
|
|
53
|
-
}
|
|
54
|
-
this.appearance = '';
|
|
55
|
-
}
|
|
56
|
-
// This code is not using optional chaining since it's only supported on Angular CLI v12
|
|
57
|
-
// - more details in this comment https://github.com/angular/angular-cli/issues/20471#issuecomment-815599616
|
|
58
|
-
// Which raises issues on the consumer's side. E.G: https://github.com/willmendesneto/ngx-skeleton-loader/issues/150#issuecomment-1638612329
|
|
59
|
-
const { theme } = this.config || {};
|
|
60
|
-
if (!!theme && !!theme.extendsFromRoot && this.theme !== null) {
|
|
61
|
-
// Shows error message only in Development
|
|
62
|
-
this.theme = { ...this.config.theme, ...this.theme };
|
|
63
|
-
}
|
|
106
|
+
return theme;
|
|
107
|
+
});
|
|
64
108
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [{ token: NGX_SKELETON_LOADER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
75
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.8", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: { count: "count", loadingText: "loadingText", appearance: "appearance", animation: "animation", ariaLabel: "ariaLabel", theme: "theme" }, usesOnChanges: true, ngImport: i0, template: "@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 [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n >\n @if (appearance === '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"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
109
|
+
/**
|
|
110
|
+
* Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.
|
|
111
|
+
* This configuration object provides various options for customizing the behavior
|
|
112
|
+
* and appearance of the `NgxSkeletonLoaderComponent`.
|
|
113
|
+
*/
|
|
114
|
+
#config;
|
|
115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
116
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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 [ngClass]=\"{\n 'custom-content': appearanceValue === 'custom-content',\n circle: appearanceValue === 'circle',\n progress: animationValue === 'progress',\n 'progress-dark': animationValue === 'progress-dark',\n pulse: animationValue === 'pulse'\n }\"\n [ngStyle]=\"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"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
76
117
|
}
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
78
119
|
type: Component,
|
|
79
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, template: "@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 [ngClass]=\"{\n 'custom-content':
|
|
80
|
-
}]
|
|
81
|
-
type: Inject,
|
|
82
|
-
args: [NGX_SKELETON_LOADER_CONFIG]
|
|
83
|
-
}, {
|
|
84
|
-
type: Optional
|
|
85
|
-
}] }], propDecorators: { count: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}], loadingText: [{
|
|
88
|
-
type: Input
|
|
89
|
-
}], appearance: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], animation: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], ariaLabel: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], theme: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}] } });
|
|
120
|
+
args: [{ selector: 'ngx-skeleton-loader', imports: [NgClass, NgStyle], 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 [ngClass]=\"{\n 'custom-content': appearanceValue === 'custom-content',\n circle: appearanceValue === 'circle',\n progress: animationValue === 'progress',\n 'progress-dark': animationValue === 'progress-dark',\n pulse: animationValue === 'pulse'\n }\"\n [ngStyle]=\"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"] }]
|
|
121
|
+
}] });
|
|
98
122
|
|
|
99
123
|
class NgxSkeletonLoaderModule {
|
|
100
124
|
static forRoot(config) {
|
|
@@ -103,15 +127,14 @@ class NgxSkeletonLoaderModule {
|
|
|
103
127
|
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
104
128
|
};
|
|
105
129
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
131
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule, NgxSkeletonLoaderComponent], exports: [NgxSkeletonLoaderComponent] }); }
|
|
132
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [CommonModule] }); }
|
|
109
133
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
111
135
|
type: NgModule,
|
|
112
136
|
args: [{
|
|
113
|
-
|
|
114
|
-
imports: [CommonModule],
|
|
137
|
+
imports: [CommonModule, NgxSkeletonLoaderComponent],
|
|
115
138
|
exports: [NgxSkeletonLoaderComponent],
|
|
116
139
|
}]
|
|
117
140
|
}] });
|
|
@@ -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/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n // It enforces a combination of `fromRoot` styles with component `styles` attribute\n extendsFromRoot?: boolean;\n // This is required since ngStyle is using `any` as well\n // More details in https://angular.io/api/common/NgStyle\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n OnInit,\n Input,\n isDevMode,\n ChangeDetectionStrategy,\n OnChanges,\n SimpleChanges,\n Optional,\n Inject,\n} from '@angular/core';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n@Component({\n selector: 'ngx-skeleton-loader',\n templateUrl: './ngx-skeleton-loader.html',\n styleUrls: ['./ngx-skeleton-loader.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgxSkeletonLoaderComponent implements OnInit, OnChanges {\n static ngAcceptInputType_count: number | string;\n static ngAcceptInputType_animation: boolean | string;\n\n @Input()\n count: NgxSkeletonLoaderConfig['count'];\n\n @Input()\n loadingText: NgxSkeletonLoaderConfig['loadingText'];\n\n @Input()\n appearance: NgxSkeletonLoaderConfig['appearance'];\n\n @Input()\n animation: NgxSkeletonLoaderConfig['animation'];\n\n @Input()\n ariaLabel: NgxSkeletonLoaderConfig['ariaLabel'];\n\n @Input()\n theme: NgxSkeletonLoaderConfigTheme;\n\n items: Array<any>;\n\n constructor(@Inject(NGX_SKELETON_LOADER_CONFIG) @Optional() private config?: NgxSkeletonLoaderConfig) {\n const {\n appearance = 'line',\n animation = 'progress',\n theme = null,\n loadingText = 'Loading...',\n count = 1,\n ariaLabel = 'loading',\n } = config || {};\n\n this.appearance = appearance;\n this.animation = animation;\n this.theme = theme;\n this.loadingText = loadingText;\n this.count = count;\n this.items = [];\n this.ariaLabel = ariaLabel;\n }\n\n ngOnInit() {\n this.validateInputValues();\n }\n\n private validateInputValues() {\n // Checking if it's receiving a numeric value (string having ONLY numbers or if it's a number)\n if (!/^\\d+$/.test(`${this.count}`)) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'count' a numeric value. Forcing default to \"1\".`,\n );\n }\n this.count = 1;\n }\n\n //Force count to 1 when custom-content is used\n if (this.appearance === 'custom-content') {\n // Shows error message only in Development\n if (isDevMode() && this.count !== 1) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n this.count = 1;\n }\n }\n this.items.length = this.count;\n\n const allowedAnimations = ['progress', 'progress-dark', 'pulse', 'false'];\n if (allowedAnimations.indexOf(String(this.animation)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'animation' as: ${allowedAnimations.join(\n ', ',\n )}. Forcing default to \"progress\".`,\n );\n }\n this.animation = 'progress';\n }\n\n if (['circle', 'line', 'custom-content', ''].indexOf(String(this.appearance)) === -1) {\n // Shows error message only in Development\n if (isDevMode()) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` need to receive 'appearance' as: circle or line or custom-content or empty string. Forcing default to \"''\".`,\n );\n }\n this.appearance = '';\n }\n\n // This code is not using optional chaining since it's only supported on Angular CLI v12\n // - more details in this comment https://github.com/angular/angular-cli/issues/20471#issuecomment-815599616\n // Which raises issues on the consumer's side. E.G: https://github.com/willmendesneto/ngx-skeleton-loader/issues/150#issuecomment-1638612329\n const { theme } = this.config || {};\n if (!!theme && !!theme.extendsFromRoot && this.theme !== null) {\n // Shows error message only in Development\n this.theme = { ...this.config!.theme, ...this.theme };\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // Avoiding multiple calls for the same input in case there's no changes in the fields\n // Checking if the fields that require validation are available and if they were changed\n // In case were not changed, we stop the function. Otherwise, `validateInputValues` will be called.\n if (\n ['count', 'animation', 'appearance'].find(\n key =>\n changes[key] && (changes[key].isFirstChange() || changes[key].previousValue === changes[key].currentValue),\n )\n ) {\n return;\n }\n\n this.validateInputValues();\n }\n}\n","@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 [ngClass]=\"{\n 'custom-content': appearance === 'custom-content',\n circle: appearance === 'circle',\n progress: animation === 'progress',\n 'progress-dark': animation === 'progress-dark',\n pulse: animation === 'pulse'\n }\"\n [ngStyle]=\"theme\"\n >\n @if (appearance === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n declarations: [NgxSkeletonLoaderComponent],\n imports: [CommonModule],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule> {\n return {\n ngModule: NgxSkeletonLoaderModule,\n providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],\n };\n }\n}\n","/*\n * Public API Surface of ngx-skeleton-loader\n */\n\nexport * from './lib/ngx-skeleton-loader.component';\nexport * from './lib/ngx-skeleton-loader.module';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAmBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;MCIrG,0BAA0B,CAAA;AAwBrC,IAAA,WAAA,CAAoE,MAAgC,EAAA;QAAhC,IAAM,CAAA,MAAA,GAAN,MAAM,CAA0B;AAClG,QAAA,MAAM,EACJ,UAAU,GAAG,MAAM,EACnB,SAAS,GAAG,UAAU,EACtB,KAAK,GAAG,IAAI,EACZ,WAAW,GAAG,YAAY,EAC1B,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,SAAS,GACtB,GAAG,MAAM,IAAI,EAAE,CAAC;AAEjB,QAAA,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":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n // It enforces a combination of `fromRoot` styles with component `styles` attribute\n extendsFromRoot?: boolean;\n // This is required since ngStyle is using `any` as well\n // More details in https://angular.io/api/common/NgStyle\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n isDevMode,\n ChangeDetectionStrategy,\n input,\n inject,\n numberAttribute,\n computed,\n} from '@angular/core';\nimport { NgClass, NgStyle } from '@angular/common';\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 imports: [NgClass, NgStyle],\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 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 [ngClass]=\"{\n 'custom-content': appearanceValue === 'custom-content',\n circle: appearanceValue === 'circle',\n progress: animationValue === 'progress',\n 'progress-dark': animationValue === 'progress-dark',\n pulse: animationValue === 'pulse'\n }\"\n [ngStyle]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n imports: [CommonModule, 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","/*\n * Public API Surface of ngx-skeleton-loader\n */\n\nexport * from './lib/ngx-skeleton-loader.component';\nexport * from './lib/ngx-skeleton-loader.module';\nexport * from './lib/ngx-skeleton-loader-config.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAmBa,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;ACHlH;;;;;;AAMG;MASU,0BAA0B,CAAA;AARvC,IAAA,WAAA,GAAA;AASE;;;;AAIG;QACM,IAAO,CAAA,OAAA,GAAG,MAAM,CAA0B,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,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,CAAC;AACjF;;;;;AAKG;QACM,IAAW,CAAA,WAAA,GAAG,KAAK,CAAyC,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,YAAY,CAAC,CAAC;AAChH;;;;;;;AAOG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,CAAw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AAA;AAEzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAHxB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGX,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,0BAA0B,CAAC;oBACnD,OAAO,EAAE,CAAC,0BAA0B,CAAC;AACtC,iBAAA,CAAA;;;ACTD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,21 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme } from './ngx-skeleton-loader-config.types';
|
|
1
|
+
import { NgxSkeletonLoaderConfigTheme } from './ngx-skeleton-loader-config.types';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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>;
|
|
21
80
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { NgxSkeletonLoaderConfig } from './ngx-skeleton-loader-config.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "
|
|
5
|
-
import * as i2 from "
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
import * as i2 from "./ngx-skeleton-loader.component";
|
|
6
6
|
export declare class NgxSkeletonLoaderModule {
|
|
7
7
|
static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule>;
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, [typeof i1.
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, never, [typeof i1.CommonModule, typeof i2.NgxSkeletonLoaderComponent], [typeof i2.NgxSkeletonLoaderComponent]>;
|
|
10
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxSkeletonLoaderModule>;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-skeleton-loader",
|
|
3
3
|
"description": "Make beautiful, animated loading skeletons that automatically adapt to your Angular apps",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": ">=
|
|
7
|
-
"@angular/core": ">=
|
|
6
|
+
"@angular/common": ">=18.0.0",
|
|
7
|
+
"@angular/core": ">=18.0.0"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"keywords": [
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/willmendesneto/ngx-skeleton-loader/issues"
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/willmendesneto/ngx-skeleton-loader#readme",
|
|
34
|
+
"sideEffects": false,
|
|
34
35
|
"module": "fesm2022/ngx-skeleton-loader.mjs",
|
|
35
36
|
"typings": "index.d.ts",
|
|
36
37
|
"exports": {
|
|
@@ -43,6 +44,5 @@
|
|
|
43
44
|
"esm": "./esm2022/ngx-skeleton-loader.mjs",
|
|
44
45
|
"default": "./fesm2022/ngx-skeleton-loader.mjs"
|
|
45
46
|
}
|
|
46
|
-
}
|
|
47
|
-
"sideEffects": false
|
|
47
|
+
}
|
|
48
48
|
}
|