@rangertechnologies/fusion-ui 0.2.2 → 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.2",
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",
@@ -44,6 +44,7 @@ export declare class FusionButtonComponent implements OnInit {
44
44
  constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
45
45
  ngOnInit(): void;
46
46
  ngOnChanges(change: SimpleChanges): void;
47
+ get resolvedButtonClasses(): string;
47
48
  getButtonStyles(config: any): {
48
49
  [key: string]: string;
49
50
  };
@@ -1004,6 +1005,49 @@ export declare class ScrollService {
1004
1005
  static ɵfac: i0.ɵɵFactoryDeclaration<ScrollService, never>;
1005
1006
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1006
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;
1007
1051
  export declare class DataTableComponent implements OnInit {
1008
1052
  private scrollService;
1009
1053
  private overlay;
@@ -1065,6 +1109,7 @@ export declare class DataTableComponent implements OnInit {
1065
1109
  pageSize: any;
1066
1110
  pageIndex: any;
1067
1111
  tableConfigurations: any;
1112
+ userLookupMap?: UserLookupMap;
1068
1113
  actionButtonCondition: any;
1069
1114
  dateColumns: any;
1070
1115
  timeColumns: any;
@@ -1243,6 +1288,9 @@ export declare class DataTableComponent implements OnInit {
1243
1288
  isConditionMet(element: any, conditions: any): boolean;
1244
1289
  isDateColumn(column: string): boolean;
1245
1290
  isTimeColumn(column: string): boolean;
1291
+ isUserColumn(column: string): boolean;
1292
+ getUserColumnMaxVisible(column: string): number;
1293
+ private configureDataSource;
1246
1294
  onInfoClick(ele: any, col: any, index: any): void;
1247
1295
  onSearch(event: any): void;
1248
1296
  emptySearch(event: any): void;
@@ -1427,6 +1475,10 @@ export declare class DataTableComponent implements OnInit {
1427
1475
  "alias": "tableConfigurations";
1428
1476
  "required": false;
1429
1477
  };
1478
+ "userLookupMap": {
1479
+ "alias": "userLookupMap";
1480
+ "required": false;
1481
+ };
1430
1482
  "actionButtonCondition": {
1431
1483
  "alias": "actionButtonCondition";
1432
1484
  "required": false;
@@ -1665,6 +1717,8 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1665
1717
  filterScreenConfigs: Array<any>;
1666
1718
  exportFieldsListConfigs: any;
1667
1719
  exportFilterListConfigs: any;
1720
+ tableConfigurations: any;
1721
+ userLookupMap?: UserLookupMap;
1668
1722
  private _stickyColumn;
1669
1723
  private _stickyColumns;
1670
1724
  set stickyColumn(val: boolean | Array<any>);
@@ -1738,6 +1792,9 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1738
1792
  isFutureDate(column: string): boolean;
1739
1793
  isColumnSticky(column: string): boolean;
1740
1794
  getInitials(name: string): string;
1795
+ isUserColumn(column: string): boolean;
1796
+ getUserColumnMaxVisible(column: string): number;
1797
+ private configureDataSource;
1741
1798
  triggerChangeDetection(): void;
1742
1799
  hyperLinkClick(element: any, column: string, i: number): void;
1743
1800
  isNearTarget(workingDays: any, totalDays: any): boolean;
@@ -1911,6 +1968,14 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1911
1968
  "alias": "exportFilterListConfigs";
1912
1969
  "required": false;
1913
1970
  };
1971
+ "tableConfigurations": {
1972
+ "alias": "tableConfigurations";
1973
+ "required": false;
1974
+ };
1975
+ "userLookupMap": {
1976
+ "alias": "userLookupMap";
1977
+ "required": false;
1978
+ };
1914
1979
  "stickyColumn": {
1915
1980
  "alias": "stickyColumn";
1916
1981
  "required": false;
@@ -1943,6 +2008,34 @@ export declare class AttendanceTableComponent implements OnInit, OnChanges, OnDe
1943
2008
  "filterDateEmitEvt": "filterDateEmitEvt";
1944
2009
  }, never, ["[table-toolbar-left]", "[table-toolbar-right]"], true, never>;
1945
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
+ }
1946
2039
  export declare class FusionCardComponent implements OnInit {
1947
2040
  private sanitizer;
1948
2041
  private renderer;