ngx-skeleton-loader 14.0.0 → 14.1.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/README.md +13 -580
- package/fesm2022/ngx-skeleton-loader-testing.mjs +82 -0
- package/fesm2022/ngx-skeleton-loader-testing.mjs.map +1 -0
- package/fesm2022/ngx-skeleton-loader.mjs.map +1 -1
- package/package.json +11 -1
- package/types/ngx-skeleton-loader-testing.d.ts +34 -0
- package/types/ngx-skeleton-loader.d.ts +5 -3
- package/CHANGELOG.md +0 -751
- package/CODE_OF_CONDUCT.md +0 -77
- package/CONTRIBUTING.md +0 -34
- package/PUBLISHING_HOTFIX.md +0 -102
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
const APPEARANCES = {
|
|
4
|
+
'circle': true,
|
|
5
|
+
'square': true,
|
|
6
|
+
'custom-content': true,
|
|
7
|
+
};
|
|
8
|
+
const BUILT_IN_ANIMATIONS = {
|
|
9
|
+
'progress': true,
|
|
10
|
+
'progress-dark': true,
|
|
11
|
+
'pulse': true,
|
|
12
|
+
'pulse-dark': true,
|
|
13
|
+
'wave': true,
|
|
14
|
+
};
|
|
15
|
+
const CUSTOM_ANIMATION_PREFIX = 'animation-';
|
|
16
|
+
/** Harness for interacting with `<ngx-skeleton-loader>` in tests. It reports the resolved values rendered in the DOM */
|
|
17
|
+
class NgxSkeletonLoaderHarness extends ComponentHarness {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
// `:scope >` ignores skeletons nested via `custom-content`
|
|
21
|
+
this.items = this.locatorForAll(':scope > .skeleton-loader');
|
|
22
|
+
}
|
|
23
|
+
static { this.hostSelector = 'ngx-skeleton-loader'; }
|
|
24
|
+
/** Gets a `HarnessPredicate` that can be used to search for a skeleton loader with specific attributes */
|
|
25
|
+
static with(options = {}) {
|
|
26
|
+
return new HarnessPredicate(NgxSkeletonLoaderHarness, options)
|
|
27
|
+
.addOption('appearance', options.appearance, async (harness, appearance) => {
|
|
28
|
+
return (await harness.getAppearance()) === appearance;
|
|
29
|
+
})
|
|
30
|
+
.addOption('animation', options.animation, async (harness, animation) => {
|
|
31
|
+
return (await harness.getAnimation()) === (animation === 'false' ? false : animation);
|
|
32
|
+
})
|
|
33
|
+
.addOption('loadingText', options.loadingText, (harness, loadingText) => HarnessPredicate.stringMatches(harness.getLoadingText(), loadingText));
|
|
34
|
+
}
|
|
35
|
+
/** Gets the number of rendered skeleton items. `custom-content` always renders one */
|
|
36
|
+
async getItemCount() {
|
|
37
|
+
return (await this.items()).length;
|
|
38
|
+
}
|
|
39
|
+
/** Gets the appearance. It is `'line'` when no appearance class is rendered */
|
|
40
|
+
async getAppearance() {
|
|
41
|
+
const [item] = await this.items();
|
|
42
|
+
for (const appearance of Object.keys(APPEARANCES)) {
|
|
43
|
+
if (await item.hasClass(appearance)) {
|
|
44
|
+
return appearance;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return 'line';
|
|
48
|
+
}
|
|
49
|
+
/** Gets the animation name, without the `animation-` prefix of custom animations. It is `false` when there is no animation */
|
|
50
|
+
async getAnimation() {
|
|
51
|
+
const [item] = await this.items();
|
|
52
|
+
const classes = ((await item.getAttribute('class')) ?? '').split(/\s+/);
|
|
53
|
+
for (const className of classes) {
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(BUILT_IN_ANIMATIONS, className)) {
|
|
55
|
+
return className;
|
|
56
|
+
}
|
|
57
|
+
if (className.startsWith(CUSTOM_ANIMATION_PREFIX)) {
|
|
58
|
+
return className.slice(CUSTOM_ANIMATION_PREFIX.length);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
/** Gets the loading text (`aria-valuetext` of the host) */
|
|
64
|
+
async getLoadingText() {
|
|
65
|
+
return (await this.host()).getAttribute('aria-valuetext');
|
|
66
|
+
}
|
|
67
|
+
/** Gets the ARIA label (`aria-label` of the host) */
|
|
68
|
+
async getAriaLabel() {
|
|
69
|
+
return (await this.host()).getAttribute('aria-label');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Public API Surface of ngx-skeleton-loader/testing
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Generated bundle index. Do not edit.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
export { NgxSkeletonLoaderHarness };
|
|
82
|
+
//# sourceMappingURL=ngx-skeleton-loader-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-skeleton-loader-testing.mjs","sources":["../../../projects/ngx-skeleton-loader/testing/src/ngx-skeleton-loader.harness.ts","../../../projects/ngx-skeleton-loader/testing/src/public-api.ts","../../../projects/ngx-skeleton-loader/testing/src/ngx-skeleton-loader-testing.ts"],"sourcesContent":["import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\nimport type { NgxSkeletonLoaderBuiltInAnimation, NgxSkeletonLoaderConfig } from 'ngx-skeleton-loader';\n\ntype NgxSkeletonLoaderHarnessAppearance = Exclude<NgxSkeletonLoaderConfig['appearance'], ''>;\n/** explicit appearance Type prevents type drift when adding new appearance classes in the future */\ntype NgxSkeletonLoaderHarnessExplicitAppearance = Exclude<NgxSkeletonLoaderHarnessAppearance, 'line'>;\ntype NgxSkeletonLoaderHarnessAnimation = NgxSkeletonLoaderConfig['animation'];\n\n/** A set of criteria that can be used to filter a list of `NgxSkeletonLoaderHarness` instances */\nexport interface NgxSkeletonLoaderHarnessFilters extends BaseHarnessFilters {\n /** Only find instances rendered with the given appearance (`'line'` includes the `''` appearance) */\n appearance?: NgxSkeletonLoaderHarnessAppearance;\n /** Only find instances rendered with the given animation (`'false'` is the same as `false`) */\n animation?: NgxSkeletonLoaderHarnessAnimation;\n /** Only find instances whose loading text (`aria-valuetext`) matches the given value */\n loadingText?: string | RegExp;\n}\n\nconst APPEARANCES = {\n 'circle': true,\n 'square': true,\n 'custom-content': true,\n} satisfies Record<NgxSkeletonLoaderHarnessExplicitAppearance, true>;\nconst BUILT_IN_ANIMATIONS = {\n 'progress': true,\n 'progress-dark': true,\n 'pulse': true,\n 'pulse-dark': true,\n 'wave': true,\n} satisfies Record<NgxSkeletonLoaderBuiltInAnimation, true>;\nconst CUSTOM_ANIMATION_PREFIX = 'animation-';\n\n/** Harness for interacting with `<ngx-skeleton-loader>` in tests. It reports the resolved values rendered in the DOM */\nexport class NgxSkeletonLoaderHarness extends ComponentHarness {\n static hostSelector = 'ngx-skeleton-loader';\n\n // `:scope >` ignores skeletons nested via `custom-content`\n private readonly items = this.locatorForAll(':scope > .skeleton-loader');\n\n /** Gets a `HarnessPredicate` that can be used to search for a skeleton loader with specific attributes */\n static with(options: NgxSkeletonLoaderHarnessFilters = {}): HarnessPredicate<NgxSkeletonLoaderHarness> {\n return new HarnessPredicate(NgxSkeletonLoaderHarness, options)\n .addOption('appearance', options.appearance, async (harness, appearance) => {\n return (await harness.getAppearance()) === appearance;\n })\n .addOption('animation', options.animation, async (harness, animation) => {\n return (await harness.getAnimation()) === (animation === 'false' ? false : animation);\n })\n .addOption('loadingText', options.loadingText, (harness, loadingText) =>\n HarnessPredicate.stringMatches(harness.getLoadingText(), loadingText),\n );\n }\n\n /** Gets the number of rendered skeleton items. `custom-content` always renders one */\n async getItemCount(): Promise<number> {\n return (await this.items()).length;\n }\n\n /** Gets the appearance. It is `'line'` when no appearance class is rendered */\n async getAppearance(): Promise<NgxSkeletonLoaderHarnessAppearance> {\n const [item] = await this.items();\n\n for (const appearance of Object.keys(APPEARANCES) as NgxSkeletonLoaderHarnessExplicitAppearance[]) {\n if (await item.hasClass(appearance)) {\n return appearance;\n }\n }\n\n return 'line';\n }\n\n /** Gets the animation name, without the `animation-` prefix of custom animations. It is `false` when there is no animation */\n async getAnimation(): Promise<NgxSkeletonLoaderHarnessAnimation> {\n const [item] = await this.items();\n const classes = ((await item.getAttribute('class')) ?? '').split(/\\s+/);\n\n for (const className of classes) {\n if (Object.prototype.hasOwnProperty.call(BUILT_IN_ANIMATIONS, className)) {\n return className as NgxSkeletonLoaderHarnessAnimation;\n }\n if (className.startsWith(CUSTOM_ANIMATION_PREFIX)) {\n return className.slice(CUSTOM_ANIMATION_PREFIX.length) as NgxSkeletonLoaderHarnessAnimation;\n }\n }\n\n return false;\n }\n\n /** Gets the loading text (`aria-valuetext` of the host) */\n async getLoadingText(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-valuetext');\n }\n\n /** Gets the ARIA label (`aria-label` of the host) */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n}\n","/*\n * Public API Surface of ngx-skeleton-loader/testing\n */\n\nexport * from './ngx-skeleton-loader.harness';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAkBA,MAAM,WAAW,GAAG;AAClB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,gBAAgB,EAAE,IAAI;CAC4C;AACpE,MAAM,mBAAmB,GAAG;AAC1B,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,MAAM,EAAE,IAAI;CAC6C;AAC3D,MAAM,uBAAuB,GAAG,YAAY;AAE5C;AACM,MAAO,wBAAyB,SAAQ,gBAAgB,CAAA;AAA9D,IAAA,WAAA,GAAA;;;AAImB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC;IA4D1E;aA/DS,IAAA,CAAA,YAAY,GAAG,qBAAH,CAAyB;;AAM5C,IAAA,OAAO,IAAI,CAAC,OAAA,GAA2C,EAAE,EAAA;AACvD,QAAA,O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IAAI,OAAO,EAAE;AAC/B,YAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAAE;AACxE,gBAAA,OAAO,SAA8C;YACvD;AACA,YAAA,IAAI,SAAS,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE;gBACjD,OAAO,SAAS,CAAC,KAAK,CAAC,uBAAuB,CAAC,MAAM,CAAsC;YAC7F;QACF;AAEA,QAAA,OAAO,KAAK;IACd;;AAGA,IAAA,MAAM,cAAc,GAAA;AAClB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,gBAAgB,CAAC;IAC3D;;AAGA,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC;IACvD;;;AChGF;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-skeleton-loader.mjs","sources":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.providers.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n /** It enforces a combination of `fromRoot` styles with component `styles` attribute */\n extendsFromRoot?: boolean;\n /**\n * Same entries accepted by `[style]` binding: CSS properties (dash-case or camelCase),\n * CSS custom properties (e.g. `--ngx-skeleton-loader-base-color`) and CSS properties with\n * unit suffix (e.g. `'height.px': 50`). Values are strings or numbers, and `null`/`undefined`\n * remove the style. More details in https://angular.dev/guide/templates/binding#css-style-properties\n */\n [k: string]: string | number | boolean | null | undefined;\n} | null;\n\ntype CSSMeasureUnit = 'px' | 'em' | 'rem' | '%' | 'vh' | 'vw';\n\n/**\n * Registry of custom animations, extended by consumers via TypeScript declaration merging.\n * Every key registered here becomes a valid `animation` value, rendered as `animation-<key>`\n * CSS class in the skeleton. E.g.:\n *\n * ```ts\n * import 'ngx-skeleton-loader';\n *\n * declare module 'ngx-skeleton-loader' {\n * interface NgxSkeletonLoaderCustomAnimations {\n * 'my-wave': true;\n * }\n * }\n * ```\n *\n * The animation styles must be added in a global stylesheet (e.g. `styles.css`) or via `::ng-deep`,\n * targeting `.skeleton-loader.animation-my-wave`, since component styles are encapsulated.\n */\nexport interface NgxSkeletonLoaderCustomAnimations {}\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';\n animation:\n | 'progress'\n | 'progress-dark'\n | 'pulse'\n | 'pulse-dark'\n | 'wave'\n | 'false'\n | false\n | Extract<keyof NgxSkeletonLoaderCustomAnimations, string>;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n size: number | `${number}` | `${number}${CSSMeasureUnit}` | null;\n measureUnit: CSSMeasureUnit;\n /**\n * `light` (default) keeps light colors, as in previous versions. `auto` enables dark mode\n * following the user's color scheme preference (OS and/or browser), and `dark` forces it.\n */\n colorScheme: 'auto' | 'light' | 'dark';\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// Converts a size (e.g. `10`, `'1.5'`, `'10rem'`) into a CSS value, using `unit` if it has none\nconst toCSSSize = (size: NgxSkeletonLoaderConfig['size'], unit: NgxSkeletonLoaderConfig['measureUnit']) => {\n const [, value, sizeUnit] = `${size ?? ''}`.trim().match(/^(\\d*\\.?\\d+)(px|em|rem|%|vh|vw)?$/) || [];\n\n return value ? `${Number(value)}${sizeUnit || unit}` : null;\n};\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 styleUrl: './ngx-skeleton-loader.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // WAI-ARIA in the host: a single progress bar per component (items are `aria-hidden`)\n host: {\n role: 'progressbar',\n 'aria-busy': 'true',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-valuetext]': 'loadingText()',\n },\n})\nexport class NgxSkeletonLoaderComponent {\n /**\n * Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.\n * This configuration object provides various options for customizing the behavior\n * and appearance of the `NgxSkeletonLoaderComponent`.\n */\n readonly #config = inject<NgxSkeletonLoaderConfig>(NGX_SKELETON_LOADER_CONFIG, { optional: true });\n /**\n * The `count` property is an input that determines the number of skeleton loader elements\n * to display.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config\n * is not provided.\n * The `transform: numberAttribute` option ensures that the input value is converted to a number.\n */\n readonly count = input(this.#config?.count || 1, { transform: numberAttribute });\n /**\n * The `loadingText` property is an input that determines the text to display while the content\n * is loading.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'\n * if the config is not provided.\n */\n readonly loadingText = input<NgxSkeletonLoaderConfig['loadingText']>(this.#config?.loadingText || 'Loading...');\n /**\n * The `appearance` property is an input that determines the visual appearance of the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the\n * config is not provided.\n * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`\n * type.\n */\n readonly appearance = input<NgxSkeletonLoaderConfig['appearance']>(this.#config?.appearance || 'line');\n /**\n * The `animation` property is an input that determines the type of animation to apply to the\n * skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if\n * the config is not provided.\n * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.\n */\n readonly animation = input<NgxSkeletonLoaderConfig['animation']>(this.#config?.animation || 'progress');\n /**\n * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton\n * loader element. This is useful for providing accessibility information to screen readers.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the\n * config is not provided.\n */\n readonly ariaLabel = input<NgxSkeletonLoaderConfig['ariaLabel']>(this.#config?.ariaLabel || 'loading');\n /**\n * The `theme` property is an input that determines the theme configuration for the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows\n * customizing various aspects of the skeleton loader's appearance, such as colors, animation,\n * etc.\n */\n readonly theme = input<NgxSkeletonLoaderConfigTheme>(this.#config?.theme || null);\n /**\n * The `size` property is an input that determines the size of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The size can be specified as a number (in pixels) (e.g., '50', '200').\n */\n readonly size = input<NgxSkeletonLoaderConfig['size']>(this.#config?.size || null);\n /**\n * The `measureUnit` property is an input that determines the unit of measurement for the size\n * of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'px' if the\n * config is not provided.\n * This allows the size to be specified in different units, such as 'px', 'em', etc.\n */\n readonly measureUnit = input<NgxSkeletonLoaderConfig['measureUnit']>(this.#config?.measureUnit || 'px');\n /** Shortcuts for `width`, `height` and `border-radius` styles (same values as `size`) */\n readonly width = input<NgxSkeletonLoaderConfig['size']>(null);\n readonly height = input<NgxSkeletonLoaderConfig['size']>(null);\n readonly borderRadius = input<NgxSkeletonLoaderConfig['size']>(null);\n /** Color scheme: 'light' (default), 'auto' (follows the user's preference) or 'dark' */\n readonly colorScheme = input<NgxSkeletonLoaderConfig['colorScheme']>(this.#config?.colorScheme || 'light');\n /**\n * The `items` property is a computed property that generates an array of indices based on the\n * `count` input.\n * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the\n * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'\n * appearance.\n * This computed property is used to render the appropriate number of skeleton loader elements.\n */\n readonly items = computed(() => {\n let count = this.count() || 1;\n\n // Force count to 1 when custom-content is used\n if (this.appearance() === 'custom-content' && count !== 1) {\n // Shows error message only in Development\n if (isDevMode()) {\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 }\n count = 1;\n }\n return [...Array(count)].map((_, index) => index);\n });\n /** Item classes. Custom animations are `animation-` prefixed to avoid collisions */\n readonly classes = computed(() => {\n const appearance = this.appearance();\n const animation = this.animation();\n\n return `${/^(circle|square|custom-content)$/.test(appearance) ? appearance : ''} ${\n !animation || animation === 'false'\n ? ''\n : /^(wave|(progress|pulse)(-dark)?)$/.test(animation)\n ? animation\n : `animation-${animation}`\n }`;\n });\n /**\n * The `squareSize` property is a computed property that calculates the size of the skeleton\n * loader when the appearance is set to 'square'.\n * It checks the `size` input and ensures that it is a valid number, optionally with a CSS unit\n * that takes precedence over `measureUnit` (e.g. '1.5', '10rem'). If the `size` is not valid,\n * or the `appearance` is not 'square', it returns `null`.\n * This computed property is used to set the width and height of the skeleton loader when it\n * is displayed as a square.\n */\n readonly squareSize = computed(() =>\n this.appearance() === 'square' ? toCSSSize(this.size(), this.measureUnit()) : null,\n );\n\n /**\n * A computed property that returns the final theme configuration for the skeleton loader.\n * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged\n * with the root theme configuration. Otherwise, the theme is returned as-is.\n * This allows the skeleton loader to inherit global theme settings while still allowing for\n * component-specific theme customization.\n */\n readonly styles = computed(() => {\n const size = this.squareSize();\n const colorScheme = this.colorScheme();\n const unit = this.measureUnit();\n const width = toCSSSize(this.width(), unit);\n const height = toCSSSize(this.height(), unit);\n const borderRadius = toCSSSize(this.borderRadius(), unit);\n const { extendsFromRoot, ...styles } = {\n ...(colorScheme !== 'light' && { 'color-scheme': colorScheme === 'auto' ? 'light dark' : colorScheme }),\n ...(this.#config?.theme?.extendsFromRoot && this.#config.theme),\n ...this.theme(),\n ...(width && { width }),\n ...(height && { height }),\n ...(borderRadius && { 'border-radius': borderRadius }),\n ...(size && { width: size, height: size }),\n };\n\n return styles;\n });\n}\n","@let appearanceValue = appearance();\n@for (item of items(); track item) {\n <div\n class=\"skeleton-loader\"\n [class]=\"classes()\"\n aria-hidden=\"true\"\n [style]=\"styles()\"\n [style.--ngx-skeleton-loader-index]=\"item || null\"\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/** @deprecated Import the standalone `NgxSkeletonLoaderComponent` and use `provideNgxSkeletonLoader()` */\n@NgModule({\n imports: [NgxSkeletonLoaderComponent],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n /** @deprecated Use `provideNgxSkeletonLoader()` */\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":";;;MA4Da,0BAA0B,GAAG,IAAI,cAAc,CAA0B,4BAA4B;;AC7ClH;AACA,MAAM,SAAS,GAAG,CAAC,IAAqC,EAAE,IAA4C,KAAI;IACxG,MAAM,GAAG,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAA,EAAG,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,mCAAmC,CAAC,IAAI,EAAE;AAEnG,IAAA,OAAO,KAAK,GAAG,CAAA,EAAG,MAAM,CAAC,KAAK,CAAC,CAAA,EAAG,QAAQ,IAAI,IAAI,CAAA,CAAE,GAAG,IAAI;AAC7D,CAAC;AAED;;;;;;AAMG;MAgBU,0BAA0B,CAAA;AAfvC,IAAA,WAAA,GAAA;AAgBE;;;;AAIG;QACM,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAClG;;;;;;AAMG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,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EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC1D,KAAA,CAAC;AACJ;;ACPA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-skeleton-loader.mjs","sources":["../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader-config.types.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.component.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.html","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.module.ts","../../../projects/ngx-skeleton-loader/src/lib/ngx-skeleton-loader.providers.ts","../../../projects/ngx-skeleton-loader/src/public-api.ts","../../../projects/ngx-skeleton-loader/src/ngx-skeleton-loader.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type NgxSkeletonLoaderConfigTheme = {\n /** It enforces a combination of `fromRoot` styles with component `styles` attribute */\n extendsFromRoot?: boolean;\n /**\n * Same entries accepted by `[style]` binding: CSS properties (dash-case or camelCase),\n * CSS custom properties (e.g. `--ngx-skeleton-loader-base-color`) and CSS properties with\n * unit suffix (e.g. `'height.px': 50`). Values are strings or numbers, and `null`/`undefined`\n * remove the style. More details in https://angular.dev/guide/templates/binding#css-style-properties\n */\n [k: string]: string | number | boolean | null | undefined;\n} | null;\n\ntype CSSMeasureUnit = 'px' | 'em' | 'rem' | '%' | 'vh' | 'vw';\n\n/**\n * Registry of custom animations, extended by consumers via TypeScript declaration merging.\n * Every key registered here becomes a valid `animation` value, rendered as `animation-<key>`\n * CSS class in the skeleton. E.g.:\n *\n * ```ts\n * import 'ngx-skeleton-loader';\n *\n * declare module 'ngx-skeleton-loader' {\n * interface NgxSkeletonLoaderCustomAnimations {\n * 'my-wave': true;\n * }\n * }\n * ```\n *\n * The animation styles must be added in a global stylesheet (e.g. `styles.css`) or via `::ng-deep`,\n * targeting `.skeleton-loader.animation-my-wave`, since component styles are encapsulated.\n */\nexport interface NgxSkeletonLoaderCustomAnimations {}\n\nexport type NgxSkeletonLoaderBuiltInAnimation = 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'wave';\n\nexport interface NgxSkeletonLoaderConfig {\n appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';\n animation: NgxSkeletonLoaderBuiltInAnimation\n | 'false'\n | false\n | Extract<keyof NgxSkeletonLoaderCustomAnimations, string>;\n theme: NgxSkeletonLoaderConfigTheme;\n loadingText: string;\n count: number;\n ariaLabel: string;\n size: number | `${number}` | `${number}${CSSMeasureUnit}` | null;\n measureUnit: CSSMeasureUnit;\n /**\n * `light` (default) keeps light colors, as in previous versions. `auto` enables dark mode\n * following the user's color scheme preference (OS and/or browser), and `dark` forces it.\n */\n colorScheme: 'auto' | 'light' | 'dark';\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// Converts a size (e.g. `10`, `'1.5'`, `'10rem'`) into a CSS value, using `unit` if it has none\nconst toCSSSize = (size: NgxSkeletonLoaderConfig['size'], unit: NgxSkeletonLoaderConfig['measureUnit']) => {\n const [, value, sizeUnit] = `${size ?? ''}`.trim().match(/^(\\d*\\.?\\d+)(px|em|rem|%|vh|vw)?$/) || [];\n\n return value ? `${Number(value)}${sizeUnit || unit}` : null;\n};\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 styleUrl: './ngx-skeleton-loader.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // WAI-ARIA in the host: a single progress bar per component (items are `aria-hidden`)\n host: {\n role: 'progressbar',\n 'aria-busy': 'true',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-valuetext]': 'loadingText()',\n },\n})\nexport class NgxSkeletonLoaderComponent {\n /**\n * Injects the `NgxSkeletonLoaderConfig` configuration object, which is optional.\n * This configuration object provides various options for customizing the behavior\n * and appearance of the `NgxSkeletonLoaderComponent`.\n */\n readonly #config = inject<NgxSkeletonLoaderConfig>(NGX_SKELETON_LOADER_CONFIG, { optional: true });\n /**\n * The `count` property is an input that determines the number of skeleton loader elements\n * to display.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 1 if the config\n * is not provided.\n * The `transform: numberAttribute` option ensures that the input value is converted to a number.\n */\n readonly count = input(this.#config?.count || 1, { transform: numberAttribute });\n /**\n * The `loadingText` property is an input that determines the text to display while the content\n * is loading.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'Loading...'\n * if the config is not provided.\n */\n readonly loadingText = input<NgxSkeletonLoaderConfig['loadingText']>(this.#config?.loadingText || 'Loading...');\n /**\n * The `appearance` property is an input that determines the visual appearance of the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'line' if the\n * config is not provided.\n * The available appearance options are defined in the `NgxSkeletonLoaderConfig['appearance']`\n * type.\n */\n readonly appearance = input<NgxSkeletonLoaderConfig['appearance']>(this.#config?.appearance || 'line');\n /**\n * The `animation` property is an input that determines the type of animation to apply to the\n * skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'progress' if\n * the config is not provided.\n * The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.\n */\n readonly animation = input<NgxSkeletonLoaderConfig['animation']>(this.#config?.animation || 'progress');\n /**\n * The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton\n * loader element. This is useful for providing accessibility information to screen readers.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'loading' if the\n * config is not provided.\n */\n readonly ariaLabel = input<NgxSkeletonLoaderConfig['ariaLabel']>(this.#config?.ariaLabel || 'loading');\n /**\n * The `theme` property is an input that determines the theme configuration for the skeleton\n * loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The theme configuration is defined by the `NgxSkeletonLoaderConfigTheme` type, which allows\n * customizing various aspects of the skeleton loader's appearance, such as colors, animation,\n * etc.\n */\n readonly theme = input<NgxSkeletonLoaderConfigTheme>(this.#config?.theme || null);\n /**\n * The `size` property is an input that determines the size of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or `null` if the\n * config is not provided.\n * The size can be specified as a number (in pixels) (e.g., '50', '200').\n */\n readonly size = input<NgxSkeletonLoaderConfig['size']>(this.#config?.size || null);\n /**\n * The `measureUnit` property is an input that determines the unit of measurement for the size\n * of the skeleton loader.\n * It is initialized with the value from the `NgxSkeletonLoaderConfig` object, or 'px' if the\n * config is not provided.\n * This allows the size to be specified in different units, such as 'px', 'em', etc.\n */\n readonly measureUnit = input<NgxSkeletonLoaderConfig['measureUnit']>(this.#config?.measureUnit || 'px');\n /** Shortcuts for `width`, `height` and `border-radius` styles (same values as `size`) */\n readonly width = input<NgxSkeletonLoaderConfig['size']>(null);\n readonly height = input<NgxSkeletonLoaderConfig['size']>(null);\n readonly borderRadius = input<NgxSkeletonLoaderConfig['size']>(null);\n /** Color scheme: 'light' (default), 'auto' (follows the user's preference) or 'dark' */\n readonly colorScheme = input<NgxSkeletonLoaderConfig['colorScheme']>(this.#config?.colorScheme || 'light');\n /**\n * The `items` property is a computed property that generates an array of indices based on the\n * `count` input.\n * If the `appearance` is set to 'custom-content', the `count` is forced to 1 to ensure that the\n * skeleton loader is displayed as a single DOM node, as required by the 'custom-content'\n * appearance.\n * This computed property is used to render the appropriate number of skeleton loader elements.\n */\n readonly items = computed(() => {\n let count = this.count() || 1;\n\n // Force count to 1 when custom-content is used\n if (this.appearance() === 'custom-content' && count !== 1) {\n // Shows error message only in Development\n if (isDevMode()) {\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 }\n count = 1;\n }\n return [...Array(count)].map((_, index) => index);\n });\n /** Item classes. Custom animations are `animation-` prefixed to avoid collisions */\n readonly classes = computed(() => {\n const appearance = this.appearance();\n const animation = this.animation();\n\n return `${/^(circle|square|custom-content)$/.test(appearance) ? appearance : ''} ${\n !animation || animation === 'false'\n ? ''\n : /^(wave|(progress|pulse)(-dark)?)$/.test(animation)\n ? animation\n : `animation-${animation}`\n }`;\n });\n /**\n * The `squareSize` property is a computed property that calculates the size of the skeleton\n * loader when the appearance is set to 'square'.\n * It checks the `size` input and ensures that it is a valid number, optionally with a CSS unit\n * that takes precedence over `measureUnit` (e.g. '1.5', '10rem'). If the `size` is not valid,\n * or the `appearance` is not 'square', it returns `null`.\n * This computed property is used to set the width and height of the skeleton loader when it\n * is displayed as a square.\n */\n readonly squareSize = computed(() =>\n this.appearance() === 'square' ? toCSSSize(this.size(), this.measureUnit()) : null,\n );\n\n /**\n * A computed property that returns the final theme configuration for the skeleton loader.\n * If the `extendsFromRoot` property is set in the `NgxSkeletonLoaderConfig`, the theme is merged\n * with the root theme configuration. Otherwise, the theme is returned as-is.\n * This allows the skeleton loader to inherit global theme settings while still allowing for\n * component-specific theme customization.\n */\n readonly styles = computed(() => {\n const size = this.squareSize();\n const colorScheme = this.colorScheme();\n const unit = this.measureUnit();\n const width = toCSSSize(this.width(), unit);\n const height = toCSSSize(this.height(), unit);\n const borderRadius = toCSSSize(this.borderRadius(), unit);\n const { extendsFromRoot, ...styles } = {\n ...(colorScheme !== 'light' && { 'color-scheme': colorScheme === 'auto' ? 'light dark' : colorScheme }),\n ...(this.#config?.theme?.extendsFromRoot && this.#config.theme),\n ...this.theme(),\n ...(width && { width }),\n ...(height && { height }),\n ...(borderRadius && { 'border-radius': borderRadius }),\n ...(size && { width: size, height: size }),\n };\n\n return styles;\n });\n}\n","@let appearanceValue = appearance();\n@for (item of items(); track item) {\n <div\n class=\"skeleton-loader\"\n [class]=\"classes()\"\n aria-hidden=\"true\"\n [style]=\"styles()\"\n [style.--ngx-skeleton-loader-index]=\"item || null\"\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/** @deprecated Import the standalone `NgxSkeletonLoaderComponent` and use `provideNgxSkeletonLoader()` */\n@NgModule({\n imports: [NgxSkeletonLoaderComponent],\n exports: [NgxSkeletonLoaderComponent],\n})\nexport class NgxSkeletonLoaderModule {\n /** @deprecated Use `provideNgxSkeletonLoader()` */\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"],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HAAA,CAAA,EAAA;;;AErCH;MAKa,uBAAuB,CAAA;;IAElC,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;IACH;8GAPW,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;;;ACNK,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/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
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": "14.
|
|
4
|
+
"version": "14.1.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
+
"@angular/cdk": ">=19.0.0",
|
|
6
7
|
"@angular/common": ">=19.0.0",
|
|
7
8
|
"@angular/core": ">=19.0.0"
|
|
8
9
|
},
|
|
10
|
+
"peerDependenciesMeta": {
|
|
11
|
+
"@angular/cdk": {
|
|
12
|
+
"optional": true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
9
15
|
"license": "MIT",
|
|
10
16
|
"keywords": [
|
|
11
17
|
"angular",
|
|
@@ -41,6 +47,10 @@
|
|
|
41
47
|
".": {
|
|
42
48
|
"types": "./types/ngx-skeleton-loader.d.ts",
|
|
43
49
|
"default": "./fesm2022/ngx-skeleton-loader.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./testing": {
|
|
52
|
+
"types": "./types/ngx-skeleton-loader-testing.d.ts",
|
|
53
|
+
"default": "./fesm2022/ngx-skeleton-loader-testing.mjs"
|
|
44
54
|
}
|
|
45
55
|
},
|
|
46
56
|
"type": "module"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
import { NgxSkeletonLoaderConfig } from 'ngx-skeleton-loader';
|
|
3
|
+
|
|
4
|
+
type NgxSkeletonLoaderHarnessAppearance = Exclude<NgxSkeletonLoaderConfig['appearance'], ''>;
|
|
5
|
+
type NgxSkeletonLoaderHarnessAnimation = NgxSkeletonLoaderConfig['animation'];
|
|
6
|
+
/** A set of criteria that can be used to filter a list of `NgxSkeletonLoaderHarness` instances */
|
|
7
|
+
interface NgxSkeletonLoaderHarnessFilters extends BaseHarnessFilters {
|
|
8
|
+
/** Only find instances rendered with the given appearance (`'line'` includes the `''` appearance) */
|
|
9
|
+
appearance?: NgxSkeletonLoaderHarnessAppearance;
|
|
10
|
+
/** Only find instances rendered with the given animation (`'false'` is the same as `false`) */
|
|
11
|
+
animation?: NgxSkeletonLoaderHarnessAnimation;
|
|
12
|
+
/** Only find instances whose loading text (`aria-valuetext`) matches the given value */
|
|
13
|
+
loadingText?: string | RegExp;
|
|
14
|
+
}
|
|
15
|
+
/** Harness for interacting with `<ngx-skeleton-loader>` in tests. It reports the resolved values rendered in the DOM */
|
|
16
|
+
declare class NgxSkeletonLoaderHarness extends ComponentHarness {
|
|
17
|
+
static hostSelector: string;
|
|
18
|
+
private readonly items;
|
|
19
|
+
/** Gets a `HarnessPredicate` that can be used to search for a skeleton loader with specific attributes */
|
|
20
|
+
static with(options?: NgxSkeletonLoaderHarnessFilters): HarnessPredicate<NgxSkeletonLoaderHarness>;
|
|
21
|
+
/** Gets the number of rendered skeleton items. `custom-content` always renders one */
|
|
22
|
+
getItemCount(): Promise<number>;
|
|
23
|
+
/** Gets the appearance. It is `'line'` when no appearance class is rendered */
|
|
24
|
+
getAppearance(): Promise<NgxSkeletonLoaderHarnessAppearance>;
|
|
25
|
+
/** Gets the animation name, without the `animation-` prefix of custom animations. It is `false` when there is no animation */
|
|
26
|
+
getAnimation(): Promise<NgxSkeletonLoaderHarnessAnimation>;
|
|
27
|
+
/** Gets the loading text (`aria-valuetext` of the host) */
|
|
28
|
+
getLoadingText(): Promise<string | null>;
|
|
29
|
+
/** Gets the ARIA label (`aria-label` of the host) */
|
|
30
|
+
getAriaLabel(): Promise<string | null>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { NgxSkeletonLoaderHarness };
|
|
34
|
+
export type { NgxSkeletonLoaderHarnessFilters };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as ngx_skeleton_loader from 'ngx-skeleton-loader';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
3
4
|
|
|
@@ -33,9 +34,10 @@ type CSSMeasureUnit = 'px' | 'em' | 'rem' | '%' | 'vh' | 'vw';
|
|
|
33
34
|
*/
|
|
34
35
|
interface NgxSkeletonLoaderCustomAnimations {
|
|
35
36
|
}
|
|
37
|
+
type NgxSkeletonLoaderBuiltInAnimation = 'progress' | 'progress-dark' | 'pulse' | 'pulse-dark' | 'wave';
|
|
36
38
|
interface NgxSkeletonLoaderConfig {
|
|
37
39
|
appearance: 'circle' | 'line' | 'custom-content' | 'square' | '';
|
|
38
|
-
animation:
|
|
40
|
+
animation: NgxSkeletonLoaderBuiltInAnimation | 'false' | false | Extract<keyof NgxSkeletonLoaderCustomAnimations, string>;
|
|
39
41
|
theme: NgxSkeletonLoaderConfigTheme;
|
|
40
42
|
loadingText: string;
|
|
41
43
|
count: number;
|
|
@@ -90,7 +92,7 @@ declare class NgxSkeletonLoaderComponent {
|
|
|
90
92
|
* the config is not provided.
|
|
91
93
|
* The available animation options are defined in the `NgxSkeletonLoaderConfig['animation']` type.
|
|
92
94
|
*/
|
|
93
|
-
readonly animation: _angular_core.InputSignal<false |
|
|
95
|
+
readonly animation: _angular_core.InputSignal<false | ngx_skeleton_loader.NgxSkeletonLoaderBuiltInAnimation | "false">;
|
|
94
96
|
/**
|
|
95
97
|
* The `ariaLabel` property is an input that determines the ARIA label to be used for the skeleton
|
|
96
98
|
* loader element. This is useful for providing accessibility information to screen readers.
|
|
@@ -179,4 +181,4 @@ declare class NgxSkeletonLoaderModule {
|
|
|
179
181
|
declare function provideNgxSkeletonLoader(config?: Partial<NgxSkeletonLoaderConfig>): _angular_core.EnvironmentProviders;
|
|
180
182
|
|
|
181
183
|
export { NGX_SKELETON_LOADER_CONFIG, NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule, provideNgxSkeletonLoader };
|
|
182
|
-
export type { NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme, NgxSkeletonLoaderCustomAnimations };
|
|
184
|
+
export type { NgxSkeletonLoaderBuiltInAnimation, NgxSkeletonLoaderConfig, NgxSkeletonLoaderConfigTheme, NgxSkeletonLoaderCustomAnimations };
|