ngx-skeleton-loader 11.0.0 → 11.2.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 +23 -1
- package/README.md +35 -0
- package/fesm2022/ngx-skeleton-loader.mjs +17 -10
- package/fesm2022/ngx-skeleton-loader.mjs.map +1 -1
- package/index.d.ts +106 -3
- package/package.json +3 -3
- package/lib/ngx-skeleton-loader-config.types.d.ts +0 -14
- package/lib/ngx-skeleton-loader.component.d.ts +0 -80
- package/lib/ngx-skeleton-loader.module.d.ts +0 -10
- package/public-api.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased][]
|
|
9
9
|
|
|
10
|
+
## [11.2.0][] - 2025-06-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Adding new `pulse-dark` animation
|
|
15
|
+
|
|
16
|
+
### Updated
|
|
17
|
+
|
|
18
|
+
- Upgrading Angular deps to v20
|
|
19
|
+
- Replacing `npm install` to `npm ci` on Circle CI pipeline
|
|
20
|
+
|
|
21
|
+
## [11.1.0][] - 2025-05-19
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Adding support for standalone `provideNgxSkeletonLoader()`
|
|
25
|
+
|
|
26
|
+
### Updated
|
|
27
|
+
- Upgrade project to use eslint v9
|
|
28
|
+
- Updating docs to reflect standalone `provideNgxSkeletonLoader()` support
|
|
29
|
+
|
|
10
30
|
## [11.0.0][] - 2025-04-09
|
|
11
31
|
|
|
12
32
|
### Updated
|
|
@@ -619,7 +639,9 @@ Now we can define the animation we want to use in `<ngx-skeleton-loader>` compon
|
|
|
619
639
|
[5.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v5.0.0
|
|
620
640
|
[unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v6.0.0...HEAD
|
|
621
641
|
[6.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/tree/v6.0.0
|
|
622
|
-
[Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.
|
|
642
|
+
[Unreleased]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.2.0...HEAD
|
|
643
|
+
[11.2.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.1.0...v11.2.0
|
|
644
|
+
[11.1.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v11.0.0...v11.1.0
|
|
623
645
|
[11.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v10.0.0...v11.0.0
|
|
624
646
|
[10.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v9.0.0...v10.0.0
|
|
625
647
|
[9.0.0]: https://github.com/willmendesneto/ngx-skeleton-loader/compare/v9.0.0...v9.0.0
|
package/README.md
CHANGED
|
@@ -49,6 +49,40 @@ npm install ngx-skeleton-loader --save
|
|
|
49
49
|
|
|
50
50
|
## Setup
|
|
51
51
|
|
|
52
|
+
## Standalone Setup
|
|
53
|
+
|
|
54
|
+
Add `ngx-skeleton-loader` to your application's `app.config.ts` providers.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// app.config.ts
|
|
58
|
+
|
|
59
|
+
import { ApplicationConfig } from '@angular/core';
|
|
60
|
+
import { provideNgxSkeletonLoader } from 'ngx-skeleton-loader';
|
|
61
|
+
|
|
62
|
+
export const appConfig: ApplicationConfig = {
|
|
63
|
+
providers: [
|
|
64
|
+
provideNgxSkeletonLoader({
|
|
65
|
+
theme: {
|
|
66
|
+
extendsFromRoot: true,
|
|
67
|
+
height: '30px',
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
After that, you can use the `ngx-skeleton-loader` component in your templates. Optionally you can pass configuration data into the component itself
|
|
75
|
+
|
|
76
|
+
- `ngx-skeleton-loader`: Handle the skeleton animation and the skeleton styles of your app;
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<div class="item">
|
|
80
|
+
<ngx-skeleton-loader count="5" appearance="circle" />
|
|
81
|
+
</div>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## NgModule Setup
|
|
85
|
+
|
|
52
86
|
You'll need to add `NgxSkeletonLoaderModule` to your application module. So that, the `<ngx-skeleton-loader>` components will be accessible in your application.
|
|
53
87
|
|
|
54
88
|
```typescript
|
|
@@ -211,6 +245,7 @@ You can also define which CSS animation you want to use - even not use any, if i
|
|
|
211
245
|
- `progress` - _default_: it will use it `progress` as animation;
|
|
212
246
|
- `progress-dark`: it will use it `progress-dark` as animation. Recommended if your color schema is darken;
|
|
213
247
|
- `pulse`: it will use `pulse` as animation;
|
|
248
|
+
- `pulse-dark`: it will use `pulse-dark` as animation. Recommended if your color schema is darken;
|
|
214
249
|
|
|
215
250
|
> `progress` is the default animation, used as the single one previously. If you don't pass the animation attribute, it defaults to `progress`.
|
|
216
251
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, numberAttribute, computed, isDevMode, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, numberAttribute, computed, isDevMode, ChangeDetectionStrategy, Component, NgModule, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
const NGX_SKELETON_LOADER_CONFIG = new InjectionToken('ngx-skeleton-loader.config');
|
|
5
5
|
|
|
@@ -81,6 +81,7 @@ class NgxSkeletonLoaderComponent {
|
|
|
81
81
|
if (this.appearance() === 'custom-content') {
|
|
82
82
|
// Shows error message only in Development
|
|
83
83
|
if (isDevMode() && count !== 1) {
|
|
84
|
+
// eslint-disable-next-line no-console
|
|
84
85
|
console.error(`\`NgxSkeletonLoaderComponent\` enforces elements with "custom-content" appearance as DOM nodes. Forcing "count" to "1".`);
|
|
85
86
|
count = 1;
|
|
86
87
|
}
|
|
@@ -111,12 +112,12 @@ class NgxSkeletonLoaderComponent {
|
|
|
111
112
|
* and appearance of the `NgxSkeletonLoaderComponent`.
|
|
112
113
|
*/
|
|
113
114
|
#config;
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
115
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
115
|
+
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 }); }
|
|
116
117
|
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderComponent, decorators: [{
|
|
118
119
|
type: Component,
|
|
119
|
-
args: [{ selector: 'ngx-skeleton-loader', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel()\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText()\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n", styles: [".skeleton-loader{box-sizing:border-box;overflow:hidden;position:relative;background:#eff1f6 no-repeat;border-radius:4px;width:100%;height:20px;display:inline-block;margin-bottom:10px;will-change:transform}.skeleton-loader:after,.skeleton-loader:before{box-sizing:border-box}.skeleton-loader.circle{width:40px;height:40px;margin:5px;border-radius:50%}.skeleton-loader.progress,.skeleton-loader.progress-dark{transform:translateZ(0)}.skeleton-loader.progress:after,.skeleton-loader.progress:before,.skeleton-loader.progress-dark:after,.skeleton-loader.progress-dark:before{box-sizing:border-box}.skeleton-loader.progress:before,.skeleton-loader.progress-dark:before{animation:progress 2s ease-in-out infinite;background-size:200px 100%;position:absolute;z-index:1;top:0;left:0;width:200px;height:100%;content:\"\"}.skeleton-loader.progress:before{background-image:linear-gradient(90deg,#fff0,#fff9,#fff0)}.skeleton-loader.progress-dark:before{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.skeleton-loader.pulse{animation:pulse 1.5s cubic-bezier(.4,0,.2,1) infinite;animation-delay:.5s}.skeleton-loader.custom-content{height:100%;background:none}@media (prefers-reduced-motion: reduce){.skeleton-loader.pulse,.skeleton-loader.progress-dark,.skeleton-loader.custom-content,.skeleton-loader.progress:before{animation:none}.skeleton-loader.progress:before,.skeleton-loader.progress-dark,.skeleton-loader.custom-content{background-image:none}}@media screen and (min-device-width: 1200px){.skeleton-loader{-webkit-user-select:none;user-select:none;cursor:wait}}@keyframes progress{0%{transform:translate3d(-200px,0,0)}to{transform:translate3d(calc(200px + 100vw),0,0)}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}\n"] }]
|
|
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"] }]
|
|
120
121
|
}] });
|
|
121
122
|
|
|
122
123
|
class NgxSkeletonLoaderModule {
|
|
@@ -126,11 +127,11 @@ class NgxSkeletonLoaderModule {
|
|
|
126
127
|
providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],
|
|
127
128
|
};
|
|
128
129
|
}
|
|
129
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
130
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
131
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
131
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, imports: [NgxSkeletonLoaderComponent], exports: [NgxSkeletonLoaderComponent] }); }
|
|
132
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule }); }
|
|
132
133
|
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxSkeletonLoaderModule, decorators: [{
|
|
134
135
|
type: NgModule,
|
|
135
136
|
args: [{
|
|
136
137
|
imports: [NgxSkeletonLoaderComponent],
|
|
@@ -138,6 +139,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
138
139
|
}]
|
|
139
140
|
}] });
|
|
140
141
|
|
|
142
|
+
function provideNgxSkeletonLoader(config) {
|
|
143
|
+
return makeEnvironmentProviders([
|
|
144
|
+
{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config },
|
|
145
|
+
]);
|
|
146
|
+
}
|
|
147
|
+
|
|
141
148
|
/*
|
|
142
149
|
* Public API Surface of ngx-skeleton-loader
|
|
143
150
|
*/
|
|
@@ -146,5 +153,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
146
153
|
* Generated bundle index. Do not edit.
|
|
147
154
|
*/
|
|
148
155
|
|
|
149
|
-
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule };
|
|
156
|
+
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule, provideNgxSkeletonLoader };
|
|
150
157
|
//# sourceMappingURL=ngx-skeleton-loader.mjs.map
|
|
@@ -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 [style] is using `any` as well\n // More details in https://angular.dev/api/common/NgStyle\n [k: string]: any;\n} | null;\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | '';\n animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n}\n\nexport const NGX_SKELETON_LOADER_CONFIG = new InjectionToken<NgxSkeletonLoaderConfig>('ngx-skeleton-loader.config');\n","import {\n Component,\n isDevMode,\n ChangeDetectionStrategy,\n input,\n inject,\n numberAttribute,\n computed,\n} from '@angular/core';\nimport {\n NgxSkeletonLoaderConfig,\n NgxSkeletonLoaderConfigTheme,\n NGX_SKELETON_LOADER_CONFIG,\n} from './ngx-skeleton-loader-config.types';\n\n/**\n * The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton\n * loader UI element.\n * It can be used to display a loading state before the actual content is available.\n * The component can be configured with various options such as the number of elements, appearance,\n * animation, and theme.\n */\n@Component({\n selector: 'ngx-skeleton-loader',\n templateUrl: './ngx-skeleton-loader.html',\n styleUrls: ['./ngx-skeleton-loader.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class NgxSkeletonLoaderComponent {\n /**\n * Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.\n * This configuration object provides various options for customizing the behavior\n * and appearance of the `NgxSkeletonLoaderComponent`.\n */\n readonly #config = inject<NgxSkeletonLoaderConfig>(NGX_SKELETON_LOADER_CONFIG, { optional: true});\n /**\n * The `count` property is an input that determines the number of skeleton loader elements\n * to display.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config\n * is not provided.\n * The `transform: numberAttribute` option ensures that the input value is converted to a number.\n */\n readonly count = input(this.#config?.count || 1, { transform: numberAttribute });\n /**\n * The `loadingText` property is an input that determines the text to display while the content\n * is loading.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'\n * if the config is not provided.\n */\n readonly loadingText = input<NgxSkeletonLoaderConfig['loadingText']>(this.#config?.loadingText || 'Loading...');\n /**\n * The `appearance` property is an input that determines the visual appearance of the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the\n * config is not provided.\n * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`\n * type.\n */\n readonly appearance = input<NgxSkeletonLoaderConfig['appearance']>(this.#config?.appearance || 'line');\n /**\n * The `animation` property is an input that determines the type of animation to apply to the\n * skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if\n * the config is not provided.\n * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.\n */\n readonly animation = input<NgxSkeletonLoaderConfig['animation']>(this.#config?.animation || 'progress');\n /**\n * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton\n * loader element. This is useful for providing accessibility information to screen readers.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the\n * config is not provided.\n */\n readonly ariaLabel = input<NgxSkeletonLoaderConfig['ariaLabel']>(this.#config?.ariaLabel || 'loading');\n /**\n * The `theme` property is an input that determines the theme configuration for the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows\n * customizing various aspects of the skeleton loader's appearance, such as colors, animation,\n * etc.\n */\n readonly theme = input<NgxSkeletonLoaderConfigTheme>(this.#config?.theme || null);\n /**\n * The `items` property is a computed property that generates an array of indices based on the\n * `count` input.\n * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the\n * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'\n * appearance.\n * This computed property is used to render the appropriate number of skeleton loader elements.\n */\n readonly items = computed(() => {\n let count = this.count() || 1;\n // Force count to 1 when custom-content is used\n if (this.appearance() === 'custom-content') {\n // Shows error message only in Development\n if (isDevMode() && count !== 1) {\n console.error(\n `\\`NgxSkeletonLoaderComponent\\` enforces elements with \"custom-content\" appearance as DOM nodes. Forcing \"count\" to \"1\".`,\n );\n count = 1;\n }\n }\n return [...Array(count)].map((_, index) => index);\n });\n /**\n * A computed property that returns the final theme configuration for the skeleton loader.\n * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged\n * with the root theme configuration. Otherwise, the theme is returned as-is.\n * This allows the skeleton loader to inherit global theme settings while still allowing for\n * component-specific theme customization.\n */\n readonly styles = computed(() => {\n const theme = this.theme();\n if (this.#config?.theme?.extendsFromRoot) {\n return {\n ...this.#config?.theme,\n ...theme,\n };\n }\n return theme;\n });\n}\n","@let appearanceValue = appearance();\n@let animationValue = animation();\n@for (item of items(); track item) {\n <div\n class=\"skeleton-loader\"\n [attr.aria-label]=\"ariaLabel()\"\n aria-busy=\"true\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuetext]=\"loadingText()\"\n role=\"progressbar\"\n tabindex=\"-1\"\n [class.custom-content]=\"appearanceValue === 'custom-content'\"\n [class.circle]=\"appearanceValue === 'circle'\"\n [class.progress]=\"animationValue === 'progress'\"\n [class.progress-dark]=\"animationValue === 'progress-dark'\"\n [class.pulse]=\"animationValue === 'pulse'\"\n [style]=\"styles()\"\n >\n @if (appearanceValue === 'custom-content') {\n <ng-content></ng-content>\n }\n </div>\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { NgxSkeletonLoaderComponent } from './ngx-skeleton-loader.component';\nimport { NgxSkeletonLoaderConfig, NGX_SKELETON_LOADER_CONFIG } from './ngx-skeleton-loader-config.types';\n\n@NgModule({\n imports: [NgxSkeletonLoaderComponent],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule> {\n return {\n ngModule: NgxSkeletonLoaderModule,\n providers: [{ provide: NGX_SKELETON_LOADER_CONFIG, useValue: config }],\n };\n }\n}\n","/*\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;;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,CAA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BAA0B,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;;;ACRD;;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\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,EAAE,KAAK,IAAI,IAAI,CAAC;AACjF;;;;;;;AAOG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;YAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;;AAE7B,YAAA,IAAI,IAAI,CAAC,UAAU,EAAE,KAAK,gBA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A,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;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
type NgxSkeletonLoaderConfigTheme = {
|
|
5
|
+
/** It enforces a combination of `fromRoot` styles with component `styles` attribute */
|
|
6
|
+
extendsFromRoot?: boolean;
|
|
7
|
+
[k: string]: any;
|
|
8
|
+
} | null;
|
|
9
|
+
interface NgxSkeletonLoaderConfig {
|
|
10
|
+
appearance: 'circle' | 'line' | 'custom-content' | '';
|
|
11
|
+
animation: 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'false' | false;
|
|
12
|
+
theme: NgxSkeletonLoaderConfigTheme;
|
|
13
|
+
loadingText: string;
|
|
14
|
+
count: number;
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
}
|
|
17
|
+
declare const NGX_SKELETON_LOADER_CONFIG: InjectionToken<NgxSkeletonLoaderConfig>;
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
|
-
*
|
|
20
|
+
* The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
|
|
21
|
+
* loader UI element.
|
|
22
|
+
* It can be used to display a loading state before the actual content is available.
|
|
23
|
+
* The component can be configured with various options such as the number of elements, appearance,
|
|
24
|
+
* animation, and theme.
|
|
3
25
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
26
|
+
declare class NgxSkeletonLoaderComponent {
|
|
27
|
+
#private;
|
|
28
|
+
/**
|
|
29
|
+
* The `count` property is an input that determines the number of skeleton loader elements
|
|
30
|
+
* to display.
|
|
31
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
|
|
32
|
+
* is not provided.
|
|
33
|
+
* The `transform: numberAttribute` option ensures that the input value is converted to a number.
|
|
34
|
+
*/
|
|
35
|
+
readonly count: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* The `loadingText` property is an input that determines the text to display while the content
|
|
38
|
+
* is loading.
|
|
39
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
|
|
40
|
+
* if the config is not provided.
|
|
41
|
+
*/
|
|
42
|
+
readonly loadingText: _angular_core.InputSignal<string>;
|
|
43
|
+
/**
|
|
44
|
+
* The `appearance` property is an input that determines the visual appearance of the skeleton
|
|
45
|
+
* loader.
|
|
46
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
|
|
47
|
+
* config is not provided.
|
|
48
|
+
* The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
|
|
49
|
+
* type.
|
|
50
|
+
*/
|
|
51
|
+
readonly appearance: _angular_core.InputSignal<"" | "circle" | "line" | "custom-content">;
|
|
52
|
+
/**
|
|
53
|
+
* The `animation` property is an input that determines the type of animation to apply to the
|
|
54
|
+
* skeleton loader.
|
|
55
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
|
|
56
|
+
* the config is not provided.
|
|
57
|
+
* The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
|
|
58
|
+
*/
|
|
59
|
+
readonly animation: _angular_core.InputSignal<false | "progress" | "progress-dark" | "pulse" | "pulse-dark" | "false">;
|
|
60
|
+
/**
|
|
61
|
+
* The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
|
|
62
|
+
* loader element. This is useful for providing accessibility information to screen readers.
|
|
63
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
|
|
64
|
+
* config is not provided.
|
|
65
|
+
*/
|
|
66
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
67
|
+
/**
|
|
68
|
+
* The `theme` property is an input that determines the theme configuration for the skeleton
|
|
69
|
+
* loader.
|
|
70
|
+
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
|
|
71
|
+
* config is not provided.
|
|
72
|
+
* The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
|
|
73
|
+
* customizing various aspects of the skeleton loader's appearance, such as colors, animation,
|
|
74
|
+
* etc.
|
|
75
|
+
*/
|
|
76
|
+
readonly theme: _angular_core.InputSignal<NgxSkeletonLoaderConfigTheme>;
|
|
77
|
+
/**
|
|
78
|
+
* The `items` property is a computed property that generates an array of indices based on the
|
|
79
|
+
* `count` input.
|
|
80
|
+
* If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
|
|
81
|
+
* skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
|
|
82
|
+
* appearance.
|
|
83
|
+
* This computed property is used to render the appropriate number of skeleton loader elements.
|
|
84
|
+
*/
|
|
85
|
+
readonly items: _angular_core.Signal<number[]>;
|
|
86
|
+
/**
|
|
87
|
+
* A computed property that returns the final theme configuration for the skeleton loader.
|
|
88
|
+
* If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
|
|
89
|
+
* with the root theme configuration. Otherwise, the theme is returned as-is.
|
|
90
|
+
* This allows the skeleton loader to inherit global theme settings while still allowing for
|
|
91
|
+
* component-specific theme customization.
|
|
92
|
+
*/
|
|
93
|
+
readonly styles: _angular_core.Signal<NgxSkeletonLoaderConfigTheme>;
|
|
94
|
+
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>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare class NgxSkeletonLoaderModule {
|
|
99
|
+
static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule>;
|
|
100
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxSkeletonLoaderModule, never>;
|
|
101
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, never, [typeof NgxSkeletonLoaderComponent], [typeof NgxSkeletonLoaderComponent]>;
|
|
102
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<NgxSkeletonLoaderModule>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>): _angular_core.EnvironmentProviders;
|
|
106
|
+
|
|
107
|
+
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule, provideNgxSkeletonLoader };
|
|
108
|
+
export type { NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme };
|
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.
|
|
4
|
+
"version": "11.2.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": ">=
|
|
7
|
-
"@angular/core": ">=
|
|
6
|
+
"@angular/common": ">=20.0.0",
|
|
7
|
+
"@angular/core": ">=20.0.0"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"keywords": [
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
export type NgxSkeletonLoaderConfigTheme = {
|
|
3
|
-
extendsFromRoot?: boolean;
|
|
4
|
-
[k: string]: any;
|
|
5
|
-
} | null;
|
|
6
|
-
export interface NgxSkeletonLoaderConfig {
|
|
7
|
-
appearance: 'circle' | 'line' | 'custom-content' | '';
|
|
8
|
-
animation: 'progress' | 'progress-dark' | 'pulse' | 'false' | false;
|
|
9
|
-
theme: NgxSkeletonLoaderConfigTheme;
|
|
10
|
-
loadingText: string;
|
|
11
|
-
count: number;
|
|
12
|
-
ariaLabel: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const NGX_SKELETON_LOADER_CONFIG: InjectionToken<NgxSkeletonLoaderConfig>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { NgxSkeletonLoaderConfigTheme } from './ngx-skeleton-loader-config.types';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* The `NgxSkeletonLoaderComponent` is a standalone Angular component that provides a skeleton
|
|
5
|
-
* loader UI element.
|
|
6
|
-
* It can be used to display a loading state before the actual content is available.
|
|
7
|
-
* The component can be configured with various options such as the number of elements, appearance,
|
|
8
|
-
* animation, and theme.
|
|
9
|
-
*/
|
|
10
|
-
export declare class NgxSkeletonLoaderComponent {
|
|
11
|
-
#private;
|
|
12
|
-
/**
|
|
13
|
-
* The `count` property is an input that determines the number of skeleton loader elements
|
|
14
|
-
* to display.
|
|
15
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config
|
|
16
|
-
* is not provided.
|
|
17
|
-
* The `transform: numberAttribute` option ensures that the input value is converted to a number.
|
|
18
|
-
*/
|
|
19
|
-
readonly count: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
20
|
-
/**
|
|
21
|
-
* The `loadingText` property is an input that determines the text to display while the content
|
|
22
|
-
* is loading.
|
|
23
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'
|
|
24
|
-
* if the config is not provided.
|
|
25
|
-
*/
|
|
26
|
-
readonly loadingText: import("@angular/core").InputSignal<string>;
|
|
27
|
-
/**
|
|
28
|
-
* The `appearance` property is an input that determines the visual appearance of the skeleton
|
|
29
|
-
* loader.
|
|
30
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the
|
|
31
|
-
* config is not provided.
|
|
32
|
-
* The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`
|
|
33
|
-
* type.
|
|
34
|
-
*/
|
|
35
|
-
readonly appearance: import("@angular/core").InputSignal<"" | "circle" | "line" | "custom-content">;
|
|
36
|
-
/**
|
|
37
|
-
* The `animation` property is an input that determines the type of animation to apply to the
|
|
38
|
-
* skeleton loader.
|
|
39
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if
|
|
40
|
-
* the config is not provided.
|
|
41
|
-
* The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
|
|
42
|
-
*/
|
|
43
|
-
readonly animation: import("@angular/core").InputSignal<false | "progress" | "progress-dark" | "pulse" | "false">;
|
|
44
|
-
/**
|
|
45
|
-
* The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
|
|
46
|
-
* loader element. This is useful for providing accessibility information to screen readers.
|
|
47
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the
|
|
48
|
-
* config is not provided.
|
|
49
|
-
*/
|
|
50
|
-
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
51
|
-
/**
|
|
52
|
-
* The `theme` property is an input that determines the theme configuration for the skeleton
|
|
53
|
-
* loader.
|
|
54
|
-
* It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the
|
|
55
|
-
* config is not provided.
|
|
56
|
-
* The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows
|
|
57
|
-
* customizing various aspects of the skeleton loader's appearance, such as colors, animation,
|
|
58
|
-
* etc.
|
|
59
|
-
*/
|
|
60
|
-
readonly theme: import("@angular/core").InputSignal<NgxSkeletonLoaderConfigTheme>;
|
|
61
|
-
/**
|
|
62
|
-
* The `items` property is a computed property that generates an array of indices based on the
|
|
63
|
-
* `count` input.
|
|
64
|
-
* If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the
|
|
65
|
-
* skeleton loader is displayed as a single DOM node, as required by the 'custom-content'
|
|
66
|
-
* appearance.
|
|
67
|
-
* This computed property is used to render the appropriate number of skeleton loader elements.
|
|
68
|
-
*/
|
|
69
|
-
readonly items: import("@angular/core").Signal<number[]>;
|
|
70
|
-
/**
|
|
71
|
-
* A computed property that returns the final theme configuration for the skeleton loader.
|
|
72
|
-
* If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged
|
|
73
|
-
* with the root theme configuration. Otherwise, the theme is returned as-is.
|
|
74
|
-
* This allows the skeleton loader to inherit global theme settings while still allowing for
|
|
75
|
-
* component-specific theme customization.
|
|
76
|
-
*/
|
|
77
|
-
readonly styles: import("@angular/core").Signal<NgxSkeletonLoaderConfigTheme>;
|
|
78
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderComponent, never>;
|
|
79
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxSkeletonLoaderComponent, "ngx-skeleton-loader", never, { "count": { "alias": "count"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
80
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { NgxSkeletonLoaderConfig } from './ngx-skeleton-loader-config.types';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./ngx-skeleton-loader.component";
|
|
5
|
-
export declare class NgxSkeletonLoaderModule {
|
|
6
|
-
static forRoot(config?: Partial<NgxSkeletonLoaderConfig>): ModuleWithProviders<NgxSkeletonLoaderModule>;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSkeletonLoaderModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSkeletonLoaderModule, never, [typeof i1.NgxSkeletonLoaderComponent], [typeof i1.NgxSkeletonLoaderComponent]>;
|
|
9
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgxSkeletonLoaderModule>;
|
|
10
|
-
}
|
package/public-api.d.ts
DELETED