@rangertechnologies/fusion-ui 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangertechnologies/fusion-ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "author": "Mohamed Riyaz Y",
5
5
  "license": "ISC",
6
6
  "description": "Shared component library for Fusion platform and micro-frontends",
@@ -1005,6 +1005,49 @@ export declare class ScrollService {
1005
1005
  static ɵfac: i0.ɵɵFactoryDeclaration<ScrollService, never>;
1006
1006
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1007
1007
  }
1008
+ export interface FusionUserObject {
1009
+ _id?: string;
1010
+ firstName?: string;
1011
+ lastName?: string;
1012
+ thumbnailURL?: string;
1013
+ avatarUrl?: string;
1014
+ fusionId?: string;
1015
+ name?: string;
1016
+ }
1017
+ export type UserLookupMap = Record<string, FusionUserObject> | Map<string, FusionUserObject>;
1018
+ export interface TableColumnConfig {
1019
+ key?: string;
1020
+ column?: string;
1021
+ field?: string;
1022
+ name?: string;
1023
+ type?: 'user' | 'userTag' | string;
1024
+ maxVisible?: number;
1025
+ }
1026
+ export interface ResolvedUserChipItem {
1027
+ displayName: string;
1028
+ initials: string;
1029
+ avatarUrl: string | null;
1030
+ key: string;
1031
+ }
1032
+ /**
1033
+ * Checks whether a column is configured as 'user' or 'userTag' in tableConfigurations.
1034
+ */
1035
+ export declare function getColumnConfig(tableConfigurations: any, column: string): TableColumnConfig | null;
1036
+ export declare function isUserColumnType(tableConfigurations: any, column: string): boolean;
1037
+ export declare function getUserColumnMaxVisible(tableConfigurations: any, column: string, defaultMax?: number): number;
1038
+ /**
1039
+ * Validates that an avatar URL uses a safe scheme/path (https://, http://, /, data:image/).
1040
+ */
1041
+ export declare function isValidAvatarUrl(url: unknown): url is string;
1042
+ export declare function getUserInitials(name: string): string;
1043
+ export declare function formatUserDisplayName(user: FusionUserObject | null | undefined, rawFallback?: string): string;
1044
+ export declare function resolveUserChipItems(value: unknown, userLookupMap?: UserLookupMap): ResolvedUserChipItem[];
1045
+ export declare function resolveUserColumnText(value: unknown, userLookupMap?: UserLookupMap): string;
1046
+ /**
1047
+ * Configures MatTableDataSource sortingDataAccessor and filterPredicate so user/userTag columns
1048
+ * sort and filter by resolved "FirstName LastName" rather than "[object Object]" or raw _id.
1049
+ */
1050
+ export declare function configureUserTableDataSource<T extends Record<string, any>>(dataSource: MatTableDataSource<T> | null | undefined, getTableConfigurations: () => any, getUserLookupMap: () => UserLookupMap | undefined): void;
1008
1051
  export declare class DataTableComponent implements OnInit {
1009
1052
  private scrollService;
1010
1053
  private overlay;
@@ -1066,6 +1109,7 @@ export declare class DataTableComponent implements OnInit {
1066
1109
  pageSize: any;
1067
1110
  pageIndex: any;
1068
1111
  tableConfigurations: any;
1112
+ userLookupMap?: UserLookupMap;
1069
1113
  actionButtonCondition: any;
1070
1114
  dateColumns: any;
1071
1115
  timeColumns: any;
@@ -1244,6 +1288,9 @@ export declare class DataTableComponent implements OnInit {
1244
1288
  isConditionMet(element: any, conditions: any): boolean;
1245
1289
  isDateColumn(column: string): boolean;
1246
1290
  isTimeColumn(column: string): boolean;
1291
+ isUserColumn(column: string): boolean;
1292
+ getUserColumnMaxVisible(column: string): number;
1293
+ private configureDataSource;
1247
1294
  onInfoClick(ele: any, col: any, index: any): void;
1248
1295
  onSearch(event: any): void;
1249
1296
  emptySearch(event: any): void;
@@ -1428,6 +1475,10 @@ export declare class DataTableComponent implements OnInit {
1428
1475
  "alias": "tableConfigurations";
1429
1476
  "required": false;
1430
1477
  };
1478
+ "userLookupMap": {
1479
+ "alias": "userLookupMap";
1480
+ "required": false;
1481
+ };
1431
1482
  "actionButtonCondition": {
1432
1483
  "alias": "actionButtonCondition";
1433
1484
  "required": false;
@@ -1666,6 +1717,8 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1666
1717
  filterScreenConfigs: Array<any>;
1667
1718
  exportFieldsListConfigs: any;
1668
1719
  exportFilterListConfigs: any;
1720
+ tableConfigurations: any;
1721
+ userLookupMap?: UserLookupMap;
1669
1722
  private _stickyColumn;
1670
1723
  private _stickyColumns;
1671
1724
  set stickyColumn(val: boolean | Array<any>);
@@ -1739,6 +1792,9 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1739
1792
  isFutureDate(column: string): boolean;
1740
1793
  isColumnSticky(column: string): boolean;
1741
1794
  getInitials(name: string): string;
1795
+ isUserColumn(column: string): boolean;
1796
+ getUserColumnMaxVisible(column: string): number;
1797
+ private configureDataSource;
1742
1798
  triggerChangeDetection(): void;
1743
1799
  hyperLinkClick(element: any, column: string, i: number): void;
1744
1800
  isNearTarget(workingDays: any, totalDays: any): boolean;
@@ -1912,6 +1968,14 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1912
1968
  "alias": "exportFilterListConfigs";
1913
1969
  "required": false;
1914
1970
  };
1971
+ "tableConfigurations": {
1972
+ "alias": "tableConfigurations";
1973
+ "required": false;
1974
+ };
1975
+ "userLookupMap": {
1976
+ "alias": "userLookupMap";
1977
+ "required": false;
1978
+ };
1915
1979
  "stickyColumn": {
1916
1980
  "alias": "stickyColumn";
1917
1981
  "required": false;
@@ -1944,6 +2008,34 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1944
2008
  "filterDateEmitEvt": "filterDateEmitEvt";
1945
2009
  }, never, ["[table-toolbar-left]", "[table-toolbar-right]"], true, never>;
1946
2010
  }
2011
+ export declare class UserChipComponent implements OnChanges {
2012
+ value: unknown;
2013
+ userLookupMap?: UserLookupMap;
2014
+ maxVisible: number;
2015
+ items: ResolvedUserChipItem[];
2016
+ visibleItems: ResolvedUserChipItem[];
2017
+ overflowCount: number;
2018
+ overflowTooltip: string;
2019
+ private failedAvatarKeys;
2020
+ ngOnChanges(): void;
2021
+ onAvatarError(key: string): void;
2022
+ showImage(item: ResolvedUserChipItem): boolean;
2023
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserChipComponent, never>;
2024
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserChipComponent, "app-user-chip, fusion-user-chip", never, {
2025
+ "value": {
2026
+ "alias": "value";
2027
+ "required": false;
2028
+ };
2029
+ "userLookupMap": {
2030
+ "alias": "userLookupMap";
2031
+ "required": false;
2032
+ };
2033
+ "maxVisible": {
2034
+ "alias": "maxVisible";
2035
+ "required": false;
2036
+ };
2037
+ }, {}, never, never, true, never>;
2038
+ }
1947
2039
  export declare class FusionCardComponent implements OnInit {
1948
2040
  private sanitizer;
1949
2041
  private renderer;