@rangertechnologies/fusion-ui 0.1.3 → 0.1.5

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,7 +1,7 @@
1
1
  import * as i1$3 from "@angular/common";
2
- import { CommonModule } from "@angular/common";
2
+ import { CommonModule, DatePipe } from "@angular/common";
3
3
  import * as i0 from "@angular/core";
4
- import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Injectable, Input, Output, Pipe, ViewChild, ViewChildren } from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Injectable, Input, Optional, Output, Pipe, ViewChild, ViewChildren } from "@angular/core";
5
5
  import { AngularSvgIconModule } from "angular-svg-icon";
6
6
  import * as i1$4 from "@ngx-translate/core";
7
7
  import { TranslateModule } from "@ngx-translate/core";
@@ -314,8 +314,8 @@ var ConfigService = class ConfigService {
314
314
  http;
315
315
  config;
316
316
  static runtimeConfig;
317
- defaultApiUrl = "http://localhost:3000";
318
- hostContractGlobal = "__FUSION_HOST_RUNTIME_CONTRACT__";
317
+ defaultApiUrl = "https://dev-api.rangerfusion.com";
318
+ static hostContractGlobal = "__FUSION_HOST_RUNTIME_CONTRACT__";
319
319
  constructor(http) {
320
320
  this.http = http;
321
321
  }
@@ -359,24 +359,38 @@ var ConfigService = class ConfigService {
359
359
  return ConfigService.runtimeConfig?.serviceConfig?.[key];
360
360
  }
361
361
  getApiUrl() {
362
+ const hostContract = this.getHostContract();
363
+ if (hostContract?.apiUrl) return hostContract.apiUrl;
362
364
  return this.config?.serviceConfig?.apiUrl || this.config?.serviceConfig?.API_URL || this.defaultApiUrl;
363
365
  }
364
366
  static getApiUrl() {
367
+ const hostContract = ConfigService.getHostContract();
368
+ if (hostContract?.apiUrl) return hostContract.apiUrl;
365
369
  const serviceConfig = ConfigService.runtimeConfig?.serviceConfig;
366
370
  return serviceConfig?.API_URL || serviceConfig?.apiUrl;
367
371
  }
372
+ getAppUrl() {
373
+ const hostContract = this.getHostContract();
374
+ if (hostContract?.appUrl) return hostContract.appUrl;
375
+ return this.config?.serviceConfig?.appUrl || this.config?.serviceConfig?.APP_URL;
376
+ }
368
377
  static getAppUrl() {
378
+ const hostContract = ConfigService.getHostContract();
379
+ if (hostContract?.appUrl) return hostContract.appUrl;
369
380
  const serviceConfig = ConfigService.runtimeConfig?.serviceConfig;
370
381
  return serviceConfig?.APP_URL || serviceConfig?.appUrl;
371
382
  }
372
383
  isSplitUserBootstrap() {
373
384
  return Boolean(this.getServiceConfig("splitUserBootstrap"));
374
385
  }
375
- getHostContract() {
386
+ static getHostContract() {
376
387
  if (typeof window === "undefined") return null;
377
- const contract = window[this.hostContractGlobal];
388
+ const contract = window[ConfigService.hostContractGlobal];
378
389
  return contract?.apiUrl ? contract : null;
379
390
  }
391
+ getHostContract() {
392
+ return ConfigService.getHostContract();
393
+ }
380
394
  static ɵfac = i0.ɵɵngDeclareFactory({
381
395
  minVersion: "12.0.0",
382
396
  version: "22.2.4",
@@ -3575,6 +3589,123 @@ i0.ɵɵngDeclareClassMetadata({
3575
3589
  sideScreenEmittedEvent: [{ type: Output }]
3576
3590
  }
3577
3591
  });
3592
+ var ApprovalScreenComponent = class ApprovalScreenComponent {
3593
+ datePipe;
3594
+ constructor(datePipe) {
3595
+ this.datePipe = datePipe;
3596
+ }
3597
+ infoData;
3598
+ hideFields = [];
3599
+ approve = new EventEmitter();
3600
+ sideScreenEmitted() {
3601
+ this.approve.emit();
3602
+ }
3603
+ static ɵfac = i0.ɵɵngDeclareFactory({
3604
+ minVersion: "12.0.0",
3605
+ version: "22.2.4",
3606
+ ngImport: i0,
3607
+ type: ApprovalScreenComponent,
3608
+ deps: [{
3609
+ token: i1$3.DatePipe,
3610
+ optional: true
3611
+ }],
3612
+ target: i0.ɵɵFactoryTarget.Component
3613
+ });
3614
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3615
+ minVersion: "14.0.0",
3616
+ version: "22.2.4",
3617
+ type: ApprovalScreenComponent,
3618
+ isStandalone: true,
3619
+ selector: "app-approval-screen",
3620
+ inputs: {
3621
+ infoData: "infoData",
3622
+ hideFields: "hideFields"
3623
+ },
3624
+ outputs: { approve: "approve" },
3625
+ providers: [DatePipe],
3626
+ ngImport: i0,
3627
+ template: "<app-common-screen headerTitle=\"Approval Details\" (sideScreenEmittedEvent)=\"sideScreenEmitted()\">\n <div class=\"side-main-content container\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <!-- Approval Info -->\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.NAME' | customTranslate : 'Name'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.name }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.STATUS' | customTranslate : 'Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': infoData.status === 'Approved', \n 'bg-warning': infoData.status === 'Pending',\n 'bg-danger': infoData.status === 'Rejected'}\">\n {{ infoData.status }}</span>\n </div>\n </div>\n <div class=\"row mb-3\" *ngIf=\"!hideFields.includes('leaveStatus')\">\n <!-- SK21DEC24 to add Approval status in side screen-->\n <div class=\"col-6 text-start\">{{'APP.APPROVAL_STATUS' | customTranslate : 'Approval Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': infoData.leaveStatus === 'Approved', \n 'bg-warning': infoData.leaveStatus === 'Pending',\n 'bg-danger': infoData.leaveStatus === 'Rejected'}\">\n {{ infoData.leaveStatus || '' }}</span>\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.REASON' | customTranslate : 'Reason'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.reason }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.TYPE' | customTranslate : 'Type'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.type }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPLIED_ON' | customTranslate : 'Applied On'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.appliedOn | date:'short' }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPROVED_COUNT' | customTranslate : 'Approved Count'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.approvedCount }}</div>\n </div>\n </div>\n </div>\n \n <!-- Approval Managers -->\n <!-- SK03DEC24 show approval managers list only if applicable -->\n <h3 *ngIf=\"infoData.approvalManagers != undefined && infoData.approvalManagers.length > 0\" class=\"text-center mb-3 mt-4\" style=\"font-size: 20px\">{{'APP.APPROVAL_MANAGERS' | customTranslate : 'Approval Managers'}}</h3>\n <ul *ngIf=\"infoData.approvalManagers != undefined && infoData.approvalManagers.length > 0\" class=\"list-group mt-4\">\n <li *ngFor=\"let manager of infoData.approvalManagers\" class=\"list-group-item\">\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.EMPLOYEE_ID' | customTranslate : 'Employee ID'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.employeeId }}</div>\n </div>\n <div class=\"row mb-3\">\n <!-- SK10DEC24 to show manager name -->\n <div class=\"col-6 text-start\">{{'APP.EMPLOYEE_NAME' | customTranslate : 'Employee Name'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.name }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPROVAL_ORDER' | customTranslate : 'Approval Order'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.approvalOrder }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.STATUS' | customTranslate : 'Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': manager.status === 'Approved', \n 'bg-warning': manager.status === 'Pending',\n 'bg-danger': manager.status === 'Rejected'}\">\n {{ manager.status }}\n </span>\n </div>\n </div>\n <div class=\"row mb-3\" *ngIf=\"manager.viewedOn\">\n <div class=\"col-6 text-start\">{{'APP.VIEWED_ON' | customTranslate : 'Viewed On'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.viewedOn | date:'short' }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.IS_OPTIONAL' | customTranslate : 'Is Optional'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.isOptional ? \"Yes\" : \"No\" }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.COMMENTS' | customTranslate : 'Comments'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.rejectionReason }}</div>\n </div>\n </li>\n </ul>\n </div>\n \n \n \n </app-common-screen>",
3628
+ styles: [""],
3629
+ dependencies: [
3630
+ {
3631
+ kind: "component",
3632
+ type: CommonScreenComponent,
3633
+ selector: "app-common-screen",
3634
+ inputs: ["headerTitle", "dynamicScreenStyle"],
3635
+ outputs: ["sideScreenEmittedEvent"]
3636
+ },
3637
+ {
3638
+ kind: "ngmodule",
3639
+ type: CommonModule
3640
+ },
3641
+ {
3642
+ kind: "directive",
3643
+ type: i1$3.NgClass,
3644
+ selector: "[ngClass]",
3645
+ inputs: ["class", "ngClass"]
3646
+ },
3647
+ {
3648
+ kind: "directive",
3649
+ type: i1$3.NgForOf,
3650
+ selector: "[ngFor][ngForOf]",
3651
+ inputs: [
3652
+ "ngForOf",
3653
+ "ngForTrackBy",
3654
+ "ngForTemplate"
3655
+ ]
3656
+ },
3657
+ {
3658
+ kind: "directive",
3659
+ type: i1$3.NgIf,
3660
+ selector: "[ngIf]",
3661
+ inputs: [
3662
+ "ngIf",
3663
+ "ngIfThen",
3664
+ "ngIfElse"
3665
+ ]
3666
+ },
3667
+ {
3668
+ kind: "pipe",
3669
+ type: i1$3.DatePipe,
3670
+ name: "date"
3671
+ },
3672
+ {
3673
+ kind: "pipe",
3674
+ type: CustomTranslatePipe,
3675
+ name: "customTranslate"
3676
+ }
3677
+ ]
3678
+ });
3679
+ };
3680
+ i0.ɵɵngDeclareClassMetadata({
3681
+ minVersion: "12.0.0",
3682
+ version: "22.2.4",
3683
+ ngImport: i0,
3684
+ type: ApprovalScreenComponent,
3685
+ decorators: [{
3686
+ type: Component,
3687
+ args: [{
3688
+ selector: "app-approval-screen",
3689
+ standalone: true,
3690
+ imports: [
3691
+ CommonScreenComponent,
3692
+ CommonModule,
3693
+ CustomTranslatePipe
3694
+ ],
3695
+ providers: [DatePipe],
3696
+ template: "<app-common-screen headerTitle=\"Approval Details\" (sideScreenEmittedEvent)=\"sideScreenEmitted()\">\n <div class=\"side-main-content container\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <!-- Approval Info -->\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.NAME' | customTranslate : 'Name'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.name }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.STATUS' | customTranslate : 'Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': infoData.status === 'Approved', \n 'bg-warning': infoData.status === 'Pending',\n 'bg-danger': infoData.status === 'Rejected'}\">\n {{ infoData.status }}</span>\n </div>\n </div>\n <div class=\"row mb-3\" *ngIf=\"!hideFields.includes('leaveStatus')\">\n <!-- SK21DEC24 to add Approval status in side screen-->\n <div class=\"col-6 text-start\">{{'APP.APPROVAL_STATUS' | customTranslate : 'Approval Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': infoData.leaveStatus === 'Approved', \n 'bg-warning': infoData.leaveStatus === 'Pending',\n 'bg-danger': infoData.leaveStatus === 'Rejected'}\">\n {{ infoData.leaveStatus || '' }}</span>\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.REASON' | customTranslate : 'Reason'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.reason }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.TYPE' | customTranslate : 'Type'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.type }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPLIED_ON' | customTranslate : 'Applied On'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.appliedOn | date:'short' }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPROVED_COUNT' | customTranslate : 'Approved Count'}}:</div>\n <div class=\"col-6 text-start\">{{ infoData.approvedCount }}</div>\n </div>\n </div>\n </div>\n \n <!-- Approval Managers -->\n <!-- SK03DEC24 show approval managers list only if applicable -->\n <h3 *ngIf=\"infoData.approvalManagers != undefined && infoData.approvalManagers.length > 0\" class=\"text-center mb-3 mt-4\" style=\"font-size: 20px\">{{'APP.APPROVAL_MANAGERS' | customTranslate : 'Approval Managers'}}</h3>\n <ul *ngIf=\"infoData.approvalManagers != undefined && infoData.approvalManagers.length > 0\" class=\"list-group mt-4\">\n <li *ngFor=\"let manager of infoData.approvalManagers\" class=\"list-group-item\">\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.EMPLOYEE_ID' | customTranslate : 'Employee ID'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.employeeId }}</div>\n </div>\n <div class=\"row mb-3\">\n <!-- SK10DEC24 to show manager name -->\n <div class=\"col-6 text-start\">{{'APP.EMPLOYEE_NAME' | customTranslate : 'Employee Name'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.name }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.APPROVAL_ORDER' | customTranslate : 'Approval Order'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.approvalOrder }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.STATUS' | customTranslate : 'Status'}}:</div>\n <div class=\"col-6 text-start\">\n <span class=\"badge custom-badge\" [ngClass]=\"{\n 'bg-success': manager.status === 'Approved', \n 'bg-warning': manager.status === 'Pending',\n 'bg-danger': manager.status === 'Rejected'}\">\n {{ manager.status }}\n </span>\n </div>\n </div>\n <div class=\"row mb-3\" *ngIf=\"manager.viewedOn\">\n <div class=\"col-6 text-start\">{{'APP.VIEWED_ON' | customTranslate : 'Viewed On'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.viewedOn | date:'short' }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.IS_OPTIONAL' | customTranslate : 'Is Optional'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.isOptional ? \"Yes\" : \"No\" }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-6 text-start\">{{'APP.COMMENTS' | customTranslate : 'Comments'}}:</div>\n <div class=\"col-6 text-start\">{{ manager.rejectionReason }}</div>\n </div>\n </li>\n </ul>\n </div>\n \n \n \n </app-common-screen>"
3697
+ }]
3698
+ }],
3699
+ ctorParameters: () => [{
3700
+ type: i1$3.DatePipe,
3701
+ decorators: [{ type: Optional }]
3702
+ }],
3703
+ propDecorators: {
3704
+ infoData: [{ type: Input }],
3705
+ hideFields: [{ type: Input }],
3706
+ approve: [{ type: Output }]
3707
+ }
3708
+ });
3578
3709
  var BrowseComponent = class BrowseComponent {
3579
3710
  selectedEmployee;
3580
3711
  employeeFinanceInfo;
@@ -7246,6 +7377,73 @@ i0.ɵɵngDeclareClassMetadata({
7246
7377
  deleteModal: [{ type: Input }]
7247
7378
  }
7248
7379
  });
7380
+ var PdfFontService = class PdfFontService {
7381
+ fontLoadedPromise = null;
7382
+ configurePdfMake(pdfMakeInstance) {
7383
+ if (!pdfMakeInstance) return;
7384
+ pdfMakeInstance.vfs = (typeof window !== "undefined" ? window : {}).vfs || {};
7385
+ pdfMakeInstance.fonts = { Amiri: {
7386
+ normal: "Amiri-Regular.ttf",
7387
+ bold: "Amiri-Regular.ttf",
7388
+ italics: "Amiri-Regular.ttf",
7389
+ bolditalics: "Amiri-Regular.ttf"
7390
+ } };
7391
+ }
7392
+ async ensureAmiriFont(pdfMakeInstance) {
7393
+ if (typeof window === "undefined") return;
7394
+ const win = window;
7395
+ if (win.vfs && win.vfs["Amiri-Regular.ttf"]) {
7396
+ if (pdfMakeInstance) this.configurePdfMake(pdfMakeInstance);
7397
+ return;
7398
+ }
7399
+ if (!this.fontLoadedPromise) this.fontLoadedPromise = new Promise((resolve) => {
7400
+ const existing = document.querySelector("script[src*=\"vfs-amiri.js\"]");
7401
+ if (existing) {
7402
+ existing.addEventListener("load", () => resolve(), { once: true });
7403
+ existing.addEventListener("error", () => resolve(), { once: true });
7404
+ return;
7405
+ }
7406
+ const script = document.createElement("script");
7407
+ script.src = "/assets/fonts/vfs-amiri.js";
7408
+ script.async = true;
7409
+ script.onload = () => {
7410
+ resolve();
7411
+ };
7412
+ script.onerror = (err) => {
7413
+ console.warn("MR 18OCT26 Unable to load Amiri font dynamically, falling back to default pdfMake fonts", err);
7414
+ resolve();
7415
+ };
7416
+ document.head.appendChild(script);
7417
+ });
7418
+ await this.fontLoadedPromise;
7419
+ if (pdfMakeInstance) this.configurePdfMake(pdfMakeInstance);
7420
+ }
7421
+ static ɵfac = i0.ɵɵngDeclareFactory({
7422
+ minVersion: "12.0.0",
7423
+ version: "22.2.4",
7424
+ ngImport: i0,
7425
+ type: PdfFontService,
7426
+ deps: [],
7427
+ target: i0.ɵɵFactoryTarget.Injectable
7428
+ });
7429
+ static ɵprov = i0.ɵɵngDeclareInjectable({
7430
+ minVersion: "12.0.0",
7431
+ version: "22.2.4",
7432
+ ngImport: i0,
7433
+ type: PdfFontService,
7434
+ providedIn: "root"
7435
+ });
7436
+ };
7437
+ i0.ɵɵngDeclareClassMetadata({
7438
+ minVersion: "12.0.0",
7439
+ version: "22.2.4",
7440
+ ngImport: i0,
7441
+ type: PdfFontService,
7442
+ decorators: [{
7443
+ type: Injectable,
7444
+ args: [{ providedIn: "root" }]
7445
+ }]
7446
+ });
7249
7447
  var AmountToWordsPipe = class AmountToWordsPipe {
7250
7448
  transform(value) {
7251
7449
  if (value === null || value === void 0 || isNaN(value)) return "";
@@ -7285,6 +7483,6 @@ i0.ɵɵngDeclareClassMetadata({
7285
7483
  }]
7286
7484
  }]
7287
7485
  });
7288
- export { AlertService, AmountToWordsPipe, ApiService, CommonScreenComponent, ConfigService, Constants, CustomDatePipe, CustomPaginatorIntl, CustomTimePipe, CustomTranslatePipe, DataTableComponent, DropDownComponent, EditColumnCheckPipe, EditColumnDropdownPipe, EditColumnTypePipe, ErrorHandlerService, FileUploadComponent, FormsComponent, FusionButtonComponent, GetValuePipe, GlobalValuesService, LoaderService, ModalComponent, MultiCheckboxComponent, MultipleFilterComponent, PaginationComponent, PopoverComponent, ScrollService, SearchFilterComponent, SearchFilterPipe, SideScreenComponent, TabDataService, TotalColumSumPipe };
7486
+ export { AlertService, AmountToWordsPipe, ApiService, ApprovalScreenComponent, CommonScreenComponent, ConfigService, Constants, CustomDatePipe, CustomPaginatorIntl, CustomTimePipe, CustomTranslatePipe, DataTableComponent, DropDownComponent, EditColumnCheckPipe, EditColumnDropdownPipe, EditColumnTypePipe, ErrorHandlerService, FileUploadComponent, FormsComponent, FusionButtonComponent, GetValuePipe, GlobalValuesService, LoaderService, ModalComponent, MultiCheckboxComponent, MultipleFilterComponent, PaginationComponent, PdfFontService, PopoverComponent, ScrollService, SearchFilterComponent, SearchFilterPipe, SideScreenComponent, TabDataService, TotalColumSumPipe };
7289
7487
 
7290
7488
  //# sourceMappingURL=rangertechnologies-fusion-ui.mjs.map