@posiwise/shared-components 0.0.168 → 0.0.169
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.
|
@@ -660,7 +660,7 @@ class ClearBitIconComponent {
|
|
|
660
660
|
return Math.max(10, Math.round(this.size * 0.42));
|
|
661
661
|
}
|
|
662
662
|
ngOnChanges() {
|
|
663
|
-
this.logoSrc = this.src ? HelperService.getLogoByUrl(this.src)
|
|
663
|
+
this.logoSrc = this.src ? (HelperService.getLogoByUrl(this.src) ?? null) : null;
|
|
664
664
|
this.showFallback = !this.logoSrc;
|
|
665
665
|
this.buildMonogram();
|
|
666
666
|
}
|
|
@@ -669,7 +669,12 @@ class ClearBitIconComponent {
|
|
|
669
669
|
this.showFallback = true;
|
|
670
670
|
}
|
|
671
671
|
buildMonogram() {
|
|
672
|
-
|
|
672
|
+
// Initials derive ONLY from `name` — never from `altText`. `altText` is the
|
|
673
|
+
// image alt / aria-label (e.g. "Logo"), and folding it in here made an
|
|
674
|
+
// unbound `name` masquerade as real initials ("Logo" → "LO"). With no name,
|
|
675
|
+
// deriveInitials('') returns the '#' unknown-sigil, so a missing binding
|
|
676
|
+
// fails visibly instead of silently wrong.
|
|
677
|
+
const label = (this.name || '').trim();
|
|
673
678
|
this.initials = ClearBitIconComponent.deriveInitials(label);
|
|
674
679
|
this.tint = MONOGRAM_TINTS[ClearBitIconComponent.hash(label) % MONOGRAM_TINTS.length];
|
|
675
680
|
}
|
|
@@ -691,11 +696,11 @@ class ClearBitIconComponent {
|
|
|
691
696
|
return hash;
|
|
692
697
|
}
|
|
693
698
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ClearBitIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
694
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ClearBitIconComponent, isStandalone: false, selector: "pw-clearbit-icon", inputs: { src: "src", altText: "altText", name: "name", size: "size", iconClass: "iconClass" }, usesOnChanges: true, ngImport: i0, template: "@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n
|
|
699
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ClearBitIconComponent, isStandalone: false, selector: "pw-clearbit-icon", inputs: { src: "src", altText: "altText", name: "name", size: "size", iconClass: "iconClass" }, usesOnChanges: true, ngImport: i0, template: "@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n [attr.aria-label]=\"altText\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.borderRadius.px]=\"tileRadius\"\n [style.fontSize.px]=\"tileFontSize\"\n [style.background-color]=\"tint.bg\"\n [style.color]=\"tint.fg\">{{ initials }}</span>\n} @else {\n <img [src]=\"logoSrc\"\n [alt]=\"altText\"\n (error)=\"onLogoError()\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n class=\"img-fluid company-logo\"\n [ngClass]=\"iconClass\" />\n}\n", styles: [".company-monogram{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-family:Roboto,sans-serif;font-weight:600;line-height:1;letter-spacing:.2px;text-transform:uppercase;-webkit-user-select:none;user-select:none;vertical-align:middle;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
695
700
|
}
|
|
696
701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ClearBitIconComponent, decorators: [{
|
|
697
702
|
type: Component,
|
|
698
|
-
args: [{ selector: 'pw-clearbit-icon', standalone: false, template: "@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n
|
|
703
|
+
args: [{ selector: 'pw-clearbit-icon', standalone: false, template: "@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n [attr.aria-label]=\"altText\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.borderRadius.px]=\"tileRadius\"\n [style.fontSize.px]=\"tileFontSize\"\n [style.background-color]=\"tint.bg\"\n [style.color]=\"tint.fg\">{{ initials }}</span>\n} @else {\n <img [src]=\"logoSrc\"\n [alt]=\"altText\"\n (error)=\"onLogoError()\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n class=\"img-fluid company-logo\"\n [ngClass]=\"iconClass\" />\n}\n", styles: [".company-monogram{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-family:Roboto,sans-serif;font-weight:600;line-height:1;letter-spacing:.2px;text-transform:uppercase;-webkit-user-select:none;user-select:none;vertical-align:middle;overflow:hidden}\n"] }]
|
|
699
704
|
}], propDecorators: { src: [{
|
|
700
705
|
type: Input
|
|
701
706
|
}], altText: [{
|