@datarailsshared/datarailsshared 1.5.370 → 1.5.373

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,23 +1,21 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import { AvatarUser } from './types';
3
+ import { ElPosition } from '../models/dropdown';
2
4
  import * as i0 from "@angular/core";
3
- export declare class DrAvatarComponent {
4
- set users(users: any[] | any);
5
- warning: boolean;
5
+ export declare class DrAvatarComponent<T extends AvatarUser = AvatarUser> {
6
+ set users(users: T[] | T);
6
7
  showUnassigned: boolean;
7
- drAvatarTooltipPosition: string;
8
+ drAvatarTooltipPosition: ElPosition;
8
9
  drAvatarTooltipClass: string;
9
10
  drAvatarSize: string;
10
11
  drAvatarIsClickable: boolean;
11
12
  compact: boolean;
12
- userClicked: EventEmitter<any>;
13
- parsedUsers: any[];
14
- constructor();
15
- getFirstUsers(): any[];
16
- getLastUsers(): any[];
17
- getAvatarColor(user: {
18
- [field: string]: any;
19
- colorNumber?: number;
20
- }): string;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<DrAvatarComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<DrAvatarComponent, "dr-avatar", never, { "users": { "alias": "users"; "required": false; }; "warning": { "alias": "warning"; "required": false; }; "showUnassigned": { "alias": "showUnassigned"; "required": false; }; "drAvatarTooltipPosition": { "alias": "drAvatarTooltipPosition"; "required": false; }; "drAvatarTooltipClass": { "alias": "drAvatarTooltipClass"; "required": false; }; "drAvatarSize": { "alias": "drAvatarSize"; "required": false; }; "drAvatarIsClickable": { "alias": "drAvatarIsClickable"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; }, { "userClicked": "userClicked"; }, never, never, false, never>;
13
+ userClicked: EventEmitter<void>;
14
+ parsedUsers: T[];
15
+ readonly USERS_TO_SHOW = 2;
16
+ getFirstUsers(): T[];
17
+ getLastUsers(): T[];
18
+ getAvatarColor(user: T): string;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DrAvatarComponent<any>, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<DrAvatarComponent<any>, "dr-avatar", never, { "users": { "alias": "users"; "required": false; }; "showUnassigned": { "alias": "showUnassigned"; "required": false; }; "drAvatarTooltipPosition": { "alias": "drAvatarTooltipPosition"; "required": false; }; "drAvatarTooltipClass": { "alias": "drAvatarTooltipClass"; "required": false; }; "drAvatarSize": { "alias": "drAvatarSize"; "required": false; }; "drAvatarIsClickable": { "alias": "drAvatarIsClickable"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; }, { "userClicked": "userClicked"; }, never, never, false, never>;
23
21
  }
@@ -1,11 +1,10 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./dr-avatar.component";
3
3
  import * as i2 from "./dr-avatar.pipe";
4
- import * as i3 from "@angular/material/legacy-tooltip";
5
- import * as i4 from "../dr-tooltip/dr-tooltip.module";
6
- import * as i5 from "@angular/common";
4
+ import * as i3 from "../dr-tooltip/dr-tooltip.module";
5
+ import * as i4 from "@angular/common";
7
6
  export declare class DrAvatarModule {
8
7
  static ɵfac: i0.ɵɵFactoryDeclaration<DrAvatarModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<DrAvatarModule, [typeof i1.DrAvatarComponent, typeof i2.DrAvatarPipe], [typeof i3.MatLegacyTooltipModule, typeof i4.DrTooltipModule, typeof i5.CommonModule], [typeof i1.DrAvatarComponent, typeof i2.DrAvatarPipe]>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DrAvatarModule, [typeof i1.DrAvatarComponent, typeof i2.DrAvatarPipe], [typeof i3.DrTooltipModule, typeof i4.CommonModule], [typeof i1.DrAvatarComponent, typeof i2.DrAvatarPipe]>;
10
9
  static ɵinj: i0.ɵɵInjectorDeclaration<DrAvatarModule>;
11
10
  }
@@ -1,7 +1,8 @@
1
1
  import { PipeTransform } from '@angular/core';
2
+ import { AvatarUser } from './types';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class DrAvatarPipe implements PipeTransform {
4
- transform(item: any, type?: string): string;
5
+ transform<T extends AvatarUser>(item: T, type?: 'full' | 'initials'): string;
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<DrAvatarPipe, never>;
6
7
  static ɵpipe: i0.ɵɵPipeDeclaration<DrAvatarPipe, "drAvatar", false>;
7
8
  }
@@ -1,4 +1,4 @@
1
1
  export declare class DrAvatarService {
2
- static avatarColors: string[];
2
+ static readonly avatarColors: string[];
3
3
  static getAvatarColorNumber(index: number): number;
4
4
  }
@@ -0,0 +1,8 @@
1
+ export type AvatarUser = {
2
+ first_name?: string | null;
3
+ last_name?: string | null;
4
+ email?: string;
5
+ colorNumber?: number;
6
+ status?: string;
7
+ class?: string;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.5.370",
3
+ "version": "1.5.373",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",
package/public-api.d.ts CHANGED
@@ -91,6 +91,7 @@ export { DrAlertTheme } from './lib/dr-alert/enums/dr-alert-theme.enum';
91
91
  export { TooltipInfoContext, TooltipInfoWidth, TooltipInfoIconTheme, } from './lib/dr-tooltip/interfaces/tooltip-component-context';
92
92
  export { Step } from './lib/stepper/interfaces/stepper';
93
93
  export * from './lib/dr-dialog/interfaces/dialog-data';
94
+ export * from './lib/dr-avatar/types';
94
95
  export * from './lib/dr-inputs/dr-model-debounce-change.directive';
95
96
  export * from './lib/directives/click-outside/click-outside.directive';
96
97
  export * from './lib/models/datePicker';