@testgorilla/tgo-ui 7.2.7 → 7.2.8

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.
@@ -61,6 +61,7 @@ export declare class AvatarComponent {
61
61
  protected readonly iconSize: Record<string, import("@testgorilla/tgo-ui/components/icon").IconSize>;
62
62
  protected readonly avatarSize: typeof AvatarSize;
63
63
  constructor(defaultAppTheme: ApplicationTheme);
64
+ protected handleImageError(): void;
64
65
  protected onEditClick(event: Event): void;
65
66
  static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, [{ optional: true; }]>;
66
67
  static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "ui-avatar", never, { "size": { "alias": "size"; "required": false; }; "imageUrl": { "alias": "imageUrl"; "required": false; }; "name": { "alias": "name"; "required": false; }; "tooltipText": { "alias": "tooltipText"; "required": false; }; "allowEdit": { "alias": "allowEdit"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; }, { "editClick": "editClick"; }, never, never, false, never>;
@@ -120,15 +120,18 @@ class AvatarComponent {
120
120
  this.applicationTheme = defaultAppTheme;
121
121
  }
122
122
  }
123
+ handleImageError() {
124
+ this.imageUrl = '';
125
+ }
123
126
  onEditClick(event) {
124
127
  this.editClick.emit(event);
125
128
  }
126
129
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AvatarComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
127
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: AvatarComponent, isStandalone: false, selector: "ui-avatar", inputs: { size: "size", imageUrl: "imageUrl", name: "name", tooltipText: "tooltipText", allowEdit: "allowEdit", applicationTheme: "applicationTheme", backgroundColor: "backgroundColor" }, outputs: { editClick: "editClick" }, ngImport: i0, template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#cbd6cb;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#e0e0e0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#f6f6f6;width:32px;height:32px;border-radius:100%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "component", type: i3.ButtonComponent, selector: "ui-button", inputs: ["size", "variant", "label", "iconPosition", "justIcon", "iconName", "disabled", "loading", "fullWidth", "url", "urlTarget", "value", "tooltip", "isPremium", "type", "companyColor", "buttonBadgeConfig", "applicationTheme", "disabledScaleOnClick", "ariaLabel", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "preventDefault", "hasBackground", "tooltipPosition", "role", "iconFilled"], outputs: ["buttonClickEvent", "buttonHoverEvent"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.UiTranslatePipe, name: "uiTranslate" }, { kind: "pipe", type: NameInitialsPipe, name: "nameInitials" }] }); }
130
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: AvatarComponent, isStandalone: false, selector: "ui-avatar", inputs: { size: "size", imageUrl: "imageUrl", name: "name", tooltipText: "tooltipText", allowEdit: "allowEdit", applicationTheme: "applicationTheme", backgroundColor: "backgroundColor" }, outputs: { editClick: "editClick" }, ngImport: i0, template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#cbd6cb;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#e0e0e0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#f6f6f6;width:32px;height:32px;border-radius:100%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "component", type: i3.ButtonComponent, selector: "ui-button", inputs: ["size", "variant", "label", "iconPosition", "justIcon", "iconName", "disabled", "loading", "fullWidth", "url", "urlTarget", "value", "tooltip", "isPremium", "type", "companyColor", "buttonBadgeConfig", "applicationTheme", "disabledScaleOnClick", "ariaLabel", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "preventDefault", "hasBackground", "tooltipPosition", "role", "iconFilled"], outputs: ["buttonClickEvent", "buttonHoverEvent"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.UiTranslatePipe, name: "uiTranslate" }, { kind: "pipe", type: NameInitialsPipe, name: "nameInitials" }] }); }
128
131
  }
129
132
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AvatarComponent, decorators: [{
130
133
  type: Component,
131
- args: [{ selector: 'ui-avatar', standalone: false, template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#cbd6cb;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#e0e0e0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#f6f6f6;width:32px;height:32px;border-radius:100%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"] }]
134
+ args: [{ selector: 'ui-avatar', standalone: false, template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#cbd6cb;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#e0e0e0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#f6f6f6;width:32px;height:32px;border-radius:100%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"] }]
132
135
  }], ctorParameters: () => [{ type: undefined, decorators: [{
133
136
  type: Optional
134
137
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"testgorilla-tgo-ui-components-avatar.mjs","sources":["../../../components/avatar/avatar.model.ts","../../../components/avatar/name-initials.pipe.ts","../../../components/avatar/avatar.component.ts","../../../components/avatar/avatar.component.html","../../../components/avatar/avatar.component.module.ts","../../../components/avatar/testgorilla-tgo-ui-components-avatar.ts"],"sourcesContent":["import { IconSize } from '@testgorilla/tgo-ui/components/icon';\n\nexport enum AvatarSize {\n SMALL = 'small',\n SMALL_MEDIUM = 'smallMedium',\n MEDIUM = 'medium',\n MEDIUM_LARGE = 'mediumLarge',\n LARGE = 'large',\n}\n\nexport type AvatarSizeType = `${AvatarSize}`;\n\nexport const iconSize: Record<string, IconSize> = {\n small: '16',\n medium: '24',\n large: '80',\n};\n\nexport enum AvatarBackgroundColor {\n PINK = '#FFE6FA',\n BLUE = '#D9E8FF',\n GREEN = '#D4F2C3',\n ORANGE = '#FFE1B3',\n RED = '#FFAC9A',\n}\n\nexport type BackgroundAvatarColorType = 'red' | 'blue' | 'green' | 'orange' | 'pink';\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nameInitials',\n standalone: false,\n})\nexport class NameInitialsPipe implements PipeTransform {\n transform(value: string): string {\n const initials = value.split(' ').filter(Boolean);\n if (initials.length > 1) {\n return initials\n .map((initial, i) => (i === 0 || i === initials.length - 1 ? initial[0].toUpperCase() : ''))\n .join('');\n } else {\n const firstLetters = value.substring(0, 2);\n return `${firstLetters[0]?.toUpperCase() ?? ''}${firstLetters[1]?.toLowerCase() ?? ''}`;\n }\n }\n}\n","import { Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { AvatarBackgroundColor, AvatarSize, AvatarSizeType, BackgroundAvatarColorType, iconSize } from './avatar.model';\n\n@Component({\n selector: 'ui-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n standalone: false,\n})\nexport class AvatarComponent {\n /**\n * Input property for specifying the size of the avatar.\n * @type {AvatarSize}\n * @default AvatarSize.SMALL\n * @memberof AvatarComponent\n */\n @Input() size: AvatarSizeType = AvatarSize.SMALL;\n /**\n * Input property for specifying the URL of the image to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() imageUrl = '';\n\n /**\n * Input property for specifying the initials to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() name = '';\n\n /**\n * Input property for specifying the tooltip text for edit.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() tooltipText = '';\n\n /**\n * Input property that makes avatar editable.\n * @type {boolean}\n * @memberof AvatarComponent\n */\n @Input() allowEdit = false;\n\n /**\n *\n * Defines the application theme where\n *\n * @type {ApplicationTheme}\n * @memberof AvatarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n *\n * Defines the background color\n *\n * @type {BackgroundAvatarColorType}\n * @memberof AvatarComponent\n */\n @Input() set backgroundColor(colorName: BackgroundAvatarColorType) {\n this.backgroundAvatarColor = AvatarBackgroundColor[colorName.toUpperCase() as keyof typeof AvatarBackgroundColor];\n }\n\n /**\n * Event emitted when the edit button is clicked.\n * @type {Event}\n * @memberof AvatarComponent\n */\n @Output() editClick = new EventEmitter<Event>();\n\n protected backgroundAvatarColor: string;\n protected readonly iconSize = iconSize;\n protected readonly avatarSize = AvatarSize;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n protected onEditClick(event: Event): void {\n this.editClick.emit(event);\n }\n}\n","<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar.component';\nimport { NameInitialsPipe } from './name-initials.pipe';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\n\n@NgModule({\n declarations: [AvatarComponent, NameInitialsPipe],\n imports: [CommonModule, IconComponentModule, MatTooltipModule, ButtonComponentModule, UiTranslatePipe],\n exports: [AvatarComponent],\n})\nexport class AvatarComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i5.NameInitialsPipe"],"mappings":";;;;;;;;;;;;IAEY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,cAAA,CAAA,GAAA,aAA4B;AAC5B,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UAAA,CAAA,cAAA,CAAA,GAAA,aAA4B;AAC5B,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EANW,UAAU,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CAAA;sBAAlB;;;MEzDU,qBAAqB,CAAA;+GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,CAJjB,eAAe,EAAE,gBAAgB,aACtC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,aAC3F,eAAe,CAAA,EAAA,CAAA,CAAA;AAEd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAHtB,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;;4FAGzE,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBALjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;oBACjD,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,CAAC;oBACtG,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-avatar.mjs","sources":["../../../components/avatar/avatar.model.ts","../../../components/avatar/name-initials.pipe.ts","../../../components/avatar/avatar.component.ts","../../../components/avatar/avatar.component.html","../../../components/avatar/avatar.component.module.ts","../../../components/avatar/testgorilla-tgo-ui-components-avatar.ts"],"sourcesContent":["import { IconSize } from '@testgorilla/tgo-ui/components/icon';\n\nexport enum AvatarSize {\n SMALL = 'small',\n SMALL_MEDIUM = 'smallMedium',\n MEDIUM = 'medium',\n MEDIUM_LARGE = 'mediumLarge',\n LARGE = 'large',\n}\n\nexport type AvatarSizeType = `${AvatarSize}`;\n\nexport const iconSize: Record<string, IconSize> = {\n small: '16',\n medium: '24',\n large: '80',\n};\n\nexport enum AvatarBackgroundColor {\n PINK = '#FFE6FA',\n BLUE = '#D9E8FF',\n GREEN = '#D4F2C3',\n ORANGE = '#FFE1B3',\n RED = '#FFAC9A',\n}\n\nexport type BackgroundAvatarColorType = 'red' | 'blue' | 'green' | 'orange' | 'pink';\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nameInitials',\n standalone: false,\n})\nexport class NameInitialsPipe implements PipeTransform {\n transform(value: string): string {\n const initials = value.split(' ').filter(Boolean);\n if (initials.length > 1) {\n return initials\n .map((initial, i) => (i === 0 || i === initials.length - 1 ? initial[0].toUpperCase() : ''))\n .join('');\n } else {\n const firstLetters = value.substring(0, 2);\n return `${firstLetters[0]?.toUpperCase() ?? ''}${firstLetters[1]?.toLowerCase() ?? ''}`;\n }\n }\n}\n","import { Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { AvatarBackgroundColor, AvatarSize, AvatarSizeType, BackgroundAvatarColorType, iconSize } from './avatar.model';\n\n@Component({\n selector: 'ui-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n standalone: false,\n})\nexport class AvatarComponent {\n /**\n * Input property for specifying the size of the avatar.\n * @type {AvatarSize}\n * @default AvatarSize.SMALL\n * @memberof AvatarComponent\n */\n @Input() size: AvatarSizeType = AvatarSize.SMALL;\n /**\n * Input property for specifying the URL of the image to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() imageUrl = '';\n\n /**\n * Input property for specifying the initials to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() name = '';\n\n /**\n * Input property for specifying the tooltip text for edit.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() tooltipText = '';\n\n /**\n * Input property that makes avatar editable.\n * @type {boolean}\n * @memberof AvatarComponent\n */\n @Input() allowEdit = false;\n\n /**\n *\n * Defines the application theme where\n *\n * @type {ApplicationTheme}\n * @memberof AvatarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n *\n * Defines the background color\n *\n * @type {BackgroundAvatarColorType}\n * @memberof AvatarComponent\n */\n @Input() set backgroundColor(colorName: BackgroundAvatarColorType) {\n this.backgroundAvatarColor = AvatarBackgroundColor[colorName.toUpperCase() as keyof typeof AvatarBackgroundColor];\n }\n\n /**\n * Event emitted when the edit button is clicked.\n * @type {Event}\n * @memberof AvatarComponent\n */\n @Output() editClick = new EventEmitter<Event>();\n\n protected backgroundAvatarColor: string;\n protected readonly iconSize = iconSize;\n protected readonly avatarSize = AvatarSize;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n protected handleImageError(): void {\n this.imageUrl = '';\n }\n\n protected onEditClick(event: Event): void {\n this.editClick.emit(event);\n }\n}\n","<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n <span class=\"initials\" *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img [attr.aria-hidden]=\"true\" *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n <ui-icon\n *ngIf=\"!imageUrl && !name\"\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n <div class=\"edit-avatar\" *ngIf=\"allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar.component';\nimport { NameInitialsPipe } from './name-initials.pipe';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\n\n@NgModule({\n declarations: [AvatarComponent, NameInitialsPipe],\n imports: [CommonModule, IconComponentModule, MatTooltipModule, ButtonComponentModule, UiTranslatePipe],\n exports: [AvatarComponent],\n})\nexport class AvatarComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i5.NameInitialsPipe"],"mappings":";;;;;;;;;;;;IAEY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,cAAA,CAAA,GAAA,aAA4B;AAC5B,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UAAA,CAAA,cAAA,CAAA,GAAA,aAA4B;AAC5B,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EANW,UAAU,KAAV,UAAU,GAAA,EAAA,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