@skyux/indicators 10.19.0 → 10.21.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.
@@ -1,14 +1,15 @@
1
1
  import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
2
+ import { CommonModule, NgOptimizedImage } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, Injectable, Pipe, Component, Input, ChangeDetectionStrategy, NgModule, EventEmitter, Output, ChangeDetectorRef, ElementRef, Directive, ViewChild, ViewChildren, EnvironmentInjector } from '@angular/core';
4
+ import { inject, Injectable, Pipe, Component, Input, ChangeDetectionStrategy, NgModule, EventEmitter, Output, input, computed, ChangeDetectorRef, ElementRef, Directive, ViewChild, ViewChildren, EnvironmentInjector } from '@angular/core';
5
5
  import * as i2 from '@skyux/theme';
6
6
  import { SkyThemeIconManifestService, SkyThemeService, SkyThemeModule } from '@skyux/theme';
7
7
  import * as i4 from '@skyux/i18n';
8
8
  import { SkyLibResourcesService, getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
9
9
  import * as i3 from '@skyux/core';
10
10
  import { SkyLogService, SkyTrimModule, SkyMutationObserverService, SkyLiveAnnouncerService, SkyIdModule, SkyScreenReaderLabelDirective, SkyAppWindowRef, SkyDynamicComponentService } from '@skyux/core';
11
- import { take, Subject, BehaviorSubject, defer } from 'rxjs';
11
+ import { toSignal, toObservable } from '@angular/core/rxjs-interop';
12
+ import { switchMap, from, of, catchError, take, Subject, BehaviorSubject, defer } from 'rxjs';
12
13
  import { trigger, transition, style, animate } from '@angular/animations';
13
14
  import { takeUntil, take as take$1, finalize } from 'rxjs/operators';
14
15
 
@@ -659,6 +660,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
659
660
  }]
660
661
  }] });
661
662
 
663
+ /**
664
+ * Resolves information about spot illustrations.
665
+ */
666
+ class SkyIllustrationResolverService {
667
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
668
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationResolverService }); }
669
+ }
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationResolverService, decorators: [{
671
+ type: Injectable
672
+ }] });
673
+
674
+ const pixelSizes = {
675
+ sm: 48,
676
+ md: 64,
677
+ lg: 80,
678
+ xl: 96,
679
+ };
680
+ /**
681
+ * Displays a spot illustration at the specified size.
682
+ */
683
+ class SkyIllustrationComponent {
684
+ constructor() {
685
+ this.#resolverSvc = inject(SkyIllustrationResolverService, {
686
+ optional: true,
687
+ });
688
+ /**
689
+ * The name of the illustration to display.
690
+ * @required
691
+ */
692
+ this.name = input.required();
693
+ /**
694
+ * The size of the illustration.
695
+ * @required
696
+ */
697
+ this.size = input.required();
698
+ this.url = toSignal(toObservable(this.name).pipe(switchMap((name) => this.#resolverSvc ? from(this.#resolverSvc.resolveUrl(name)) : of('')), catchError(() => of(''))));
699
+ this.pixelSize = computed(() => pixelSizes[this.size()]);
700
+ }
701
+ #resolverSvc;
702
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
703
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.4", type: SkyIllustrationComponent, isStandalone: true, selector: "sky-illustration", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<img\n alt=\"\"\n class=\"sky-illustration-img\"\n loading=\"lazy\"\n [attr.data-sky-illustration-name]=\"name()\"\n [height]=\"pixelSize()\"\n [src]=\"url()\"\n [width]=\"pixelSize()\"\n/>\n", styles: [":host,.sky-illustration-img{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
704
+ }
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationComponent, decorators: [{
706
+ type: Component,
707
+ args: [{ selector: 'sky-illustration', standalone: true, imports: [CommonModule, NgOptimizedImage], changeDetection: ChangeDetectionStrategy.OnPush, template: "<img\n alt=\"\"\n class=\"sky-illustration-img\"\n loading=\"lazy\"\n [attr.data-sky-illustration-name]=\"name()\"\n [height]=\"pixelSize()\"\n [src]=\"url()\"\n [width]=\"pixelSize()\"\n/>\n", styles: [":host,.sky-illustration-img{display:block}\n"] }]
708
+ }] });
709
+
710
+ class SkyIllustrationModule {
711
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
712
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationModule, imports: [SkyIllustrationComponent], exports: [SkyIllustrationComponent] }); }
713
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationModule, imports: [SkyIllustrationComponent] }); }
714
+ }
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyIllustrationModule, decorators: [{
716
+ type: NgModule,
717
+ args: [{
718
+ imports: [SkyIllustrationComponent],
719
+ exports: [SkyIllustrationComponent],
720
+ }]
721
+ }] });
722
+
662
723
  /**
663
724
  * Specifies a label to display in smaller text under or beside the value.
664
725
  * To display a help button beside the label, include a help button element, such as `sky-help-inline`,
@@ -2204,5 +2265,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
2204
2265
  * Generated bundle index. Do not edit.
2205
2266
  */
2206
2267
 
2207
- export { SkyAlertModule, SkyChevronModule, SkyExpansionIndicatorModule, SkyHelpInlineModule, SkyIconModule, SkyKeyInfoModule, SkyLabelModule, SkyStatusIndicatorModule, SkyTextHighlightDirective, SkyTextHighlightModule, SkyTokensMessageType, SkyTokensModule, SkyWaitModule, SkyWaitService, SkyAlertComponent as λ1, SkyStatusIndicatorComponent as λ10, SkyTextHighlightDirective as λ11, SkyTokenComponent as λ12, SkyTokensComponent as λ13, SkyWaitComponent as λ14, SkyExpansionIndicatorComponent as λ15, SkyChevronComponent as λ2, SkyHelpInlineComponent as λ3, SkyIconComponent as λ4, SkyIconStackComponent as λ5, SkyKeyInfoLabelComponent as λ6, SkyKeyInfoValueComponent as λ7, SkyKeyInfoComponent as λ8, SkyLabelComponent as λ9 };
2268
+ export { SkyAlertModule, SkyChevronModule, SkyExpansionIndicatorModule, SkyHelpInlineModule, SkyIconModule, SkyIllustrationModule, SkyIllustrationResolverService, SkyKeyInfoModule, SkyLabelModule, SkyStatusIndicatorModule, SkyTextHighlightDirective, SkyTextHighlightModule, SkyTokensMessageType, SkyTokensModule, SkyWaitModule, SkyWaitService, SkyAlertComponent as λ1, SkyStatusIndicatorComponent as λ10, SkyTextHighlightDirective as λ11, SkyTokenComponent as λ12, SkyTokensComponent as λ13, SkyWaitComponent as λ14, SkyExpansionIndicatorComponent as λ15, SkyIllustrationComponent as λ16, SkyChevronComponent as λ2, SkyHelpInlineComponent as λ3, SkyIconComponent as λ4, SkyIconStackComponent as λ5, SkyKeyInfoLabelComponent as λ6, SkyKeyInfoValueComponent as λ7, SkyKeyInfoComponent as λ8, SkyLabelComponent as λ9 };
2208
2269
  //# sourceMappingURL=skyux-indicators.mjs.map