ets-fe-ng-sdk 19.0.117 → 20.0.0
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/fesm2022/ets-fe-ng-sdk.mjs +1591 -1632
- package/fesm2022/ets-fe-ng-sdk.mjs.map +1 -1
- package/index.d.ts +14526 -3
- package/package.json +1 -1
- package/environments/environment.d.ts +0 -11
- package/lib/Reusables/reusable-comps/find-item/find-item.component.d.ts +0 -258
- package/lib/Reusables/reusable-comps/find-item/find-item.model.d.ts +0 -13
- package/lib/Reusables/reusable-comps/find-item/find-item.service.d.ts +0 -38
- package/lib/Reusables/reusable-comps/watermark/watermark.component.d.ts +0 -22
- package/lib/Reusables/reusable-pages/extra-pages/extra-pages-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/extra-pages/extra-pages.module.d.ts +0 -8
- package/lib/Reusables/reusable-pages/logger/logger-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/logger/logger.component.d.ts +0 -71
- package/lib/Reusables/reusable-pages/logger/logger.interface.d.ts +0 -73
- package/lib/Reusables/reusable-pages/logger/logger.module.d.ts +0 -11
- package/lib/Reusables/reusable-pages/logger/logger.service.d.ts +0 -81
- package/lib/Reusables/reusable-pages/page-not-found/page-not-found.component.d.ts +0 -28
- package/lib/Reusables/reusable-pages/reset/reset-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/reset/reset.component.d.ts +0 -13
- package/lib/Reusables/reusable-pages/reset/reset.module.d.ts +0 -8
- package/lib/Reusables/reusable-pages/robot/robot-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/robot/robot.component.d.ts +0 -8
- package/lib/Reusables/reusable-pages/robot/robot.module.d.ts +0 -9
- package/lib/Reusables/reusable-pages/timeout-tester/timeout-tester-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/timeout-tester/timeout-tester.component.d.ts +0 -23
- package/lib/Reusables/reusable-pages/timeout-tester/timeout-tester.module.d.ts +0 -11
- package/lib/Reusables/reusable-pages/user-activity/ua-extras/user-activity.model.d.ts +0 -56
- package/lib/Reusables/reusable-pages/user-activity/ua-extras/user-activity.service.d.ts +0 -13
- package/lib/Reusables/reusable-pages/version/version-routing.module.d.ts +0 -7
- package/lib/Reusables/reusable-pages/version/version.component.d.ts +0 -13
- package/lib/Reusables/reusable-pages/version/version.module.d.ts +0 -10
- package/lib/Reusables/reusable-pages/version/version.service.d.ts +0 -19
- package/lib/Services/Interceptors/authentication-interceptor.service.d.ts +0 -27
- package/lib/Services/Interceptors/global-error-handler.service.d.ts +0 -28
- package/lib/Services/Interceptors/logger-interceptor.service.d.ts +0 -33
- package/lib/Services/Interceptors/request-loader-interceptor.service.d.ts +0 -24
- package/lib/Services/Interceptors/request-timeout.service.d.ts +0 -32
- package/lib/Services/api.service.d.ts +0 -255
- package/lib/Services/app.service.d.ts +0 -112
- package/lib/Services/base.effect.d.ts +0 -24
- package/lib/Services/base.facade.service.d.ts +0 -42
- package/lib/Services/base.service.d.ts +0 -81
- package/lib/Services/cache/cache-updater.service.d.ts +0 -10
- package/lib/Services/cache/cache.service.d.ts +0 -17
- package/lib/Services/cache/local-cache.service.d.ts +0 -17
- package/lib/Services/cache/saver.service.d.ts +0 -34
- package/lib/Services/debouncer.service.d.ts +0 -66
- package/lib/Services/error-reporter.service.d.ts +0 -56
- package/lib/Services/htmler.service.d.ts +0 -18
- package/lib/Services/input.service.d.ts +0 -55
- package/lib/Services/number-format.service.d.ts +0 -10
- package/lib/Services/object-size.service.d.ts +0 -14
- package/lib/Services/page-loader.service.d.ts +0 -62
- package/lib/Services/page.service.d.ts +0 -57
- package/lib/Services/route.service.d.ts +0 -75
- package/lib/Services/service-worker/check-for-update.service.d.ts +0 -33
- package/lib/Services/service-worker/handle-unrecoverable-state.service.d.ts +0 -24
- package/lib/Services/service-worker/log-update.service.d.ts +0 -20
- package/lib/Services/service-worker/prompt-update.service.d.ts +0 -63
- package/lib/Services/service-worker/service-worker.service.d.ts +0 -40
- package/lib/Services/storage.service.d.ts +0 -115
- package/lib/Services/theme.service.d.ts +0 -29
- package/lib/Services/translation.service.d.ts +0 -182
- package/lib/Services/utility.service.d.ts +0 -989
- package/lib/Services/window-security.service.d.ts +0 -10
- package/lib/Shared/classes/page-loader.class.d.ts +0 -41
- package/lib/Shared/components/add-item/add-item.component.d.ts +0 -31
- package/lib/Shared/components/autocomplete/autocomplete-td-rf/autocomplete-td-rf.component.d.ts +0 -75
- package/lib/Shared/components/autocomplete/autocomplete.component.d.ts +0 -81
- package/lib/Shared/components/autocomplete/autocomplete.module.d.ts +0 -6
- package/lib/Shared/components/autocomplete/autocomplete.service.d.ts +0 -58
- package/lib/Shared/components/btn/btn-lg/btn-lg.component.d.ts +0 -55
- package/lib/Shared/components/btn/btn-link/btn-link.component.d.ts +0 -21
- package/lib/Shared/components/btn/btn.component.d.ts +0 -216
- package/lib/Shared/components/btn/btn.model.d.ts +0 -135
- package/lib/Shared/components/btn/btn.module.d.ts +0 -4
- package/lib/Shared/components/btn/btn.service.d.ts +0 -80
- package/lib/Shared/components/btn/details-btn/details-btn.component.d.ts +0 -17
- package/lib/Shared/components/btn/details-btn/details-btn.module.d.ts +0 -1
- package/lib/Shared/components/card/card.component.d.ts +0 -22
- package/lib/Shared/components/card/card.module.d.ts +0 -1
- package/lib/Shared/components/confirm-dialog/confirm-dialog.component.d.ts +0 -36
- package/lib/Shared/components/confirm-dialog/confirm-dialog.module.d.ts +0 -1
- package/lib/Shared/components/confirm-dialog/confirm-dialog.service.d.ts +0 -21
- package/lib/Shared/components/core/button/button.component.d.ts +0 -28
- package/lib/Shared/components/core/button/components.module.d.ts +0 -1
- package/lib/Shared/components/documents-name-display/documents-name-display.component.d.ts +0 -44
- package/lib/Shared/components/documents-name-display/documents-name-display.model.d.ts +0 -6
- package/lib/Shared/components/documents-name-display/documents-name-display.module.d.ts +0 -1
- package/lib/Shared/components/editable-text-case/editable-text-case.component.d.ts +0 -63
- package/lib/Shared/components/editable-text-case/editable-text-case.module.d.ts +0 -1
- package/lib/Shared/components/export-table/export-table.component.d.ts +0 -61
- package/lib/Shared/components/export-table/export-table.module.d.ts +0 -1
- package/lib/Shared/components/fields-to-display/fields-to-display.component.d.ts +0 -66
- package/lib/Shared/components/file-upload/file-upload.component.d.ts +0 -96
- package/lib/Shared/components/form-error/form-error.component.d.ts +0 -73
- package/lib/Shared/components/form-generator/form-generated-value/form-generated-value.component.d.ts +0 -95
- package/lib/Shared/components/form-generator/form-generator.base.component.d.ts +0 -234
- package/lib/Shared/components/form-generator/form-generator.component.d.ts +0 -207
- package/lib/Shared/components/form-generator/form-generator.module.d.ts +0 -1
- package/lib/Shared/components/form-generator/form-generator.service.d.ts +0 -45
- package/lib/Shared/components/form-link/form-link.component.d.ts +0 -47
- package/lib/Shared/components/form-link/form-link.module.d.ts +0 -1
- package/lib/Shared/components/form-tab-headers/form-tab-headers.component.d.ts +0 -13
- package/lib/Shared/components/form-tab-headers/form-tab-headers.module.d.ts +0 -1
- package/lib/Shared/components/idler/idler.component.d.ts +0 -41
- package/lib/Shared/components/idler/idler.service.d.ts +0 -71
- package/lib/Shared/components/index-comp-layout/index-comp-layout.component.d.ts +0 -93
- package/lib/Shared/components/info-dialog/info-dialog.component.d.ts +0 -67
- package/lib/Shared/components/info-dialog/info-dialog.module.d.ts +0 -4
- package/lib/Shared/components/info-dialog/info-dialog.service.d.ts +0 -13
- package/lib/Shared/components/info-icon/info-icon.component.d.ts +0 -17
- package/lib/Shared/components/info-icon/info-icon.module.d.ts +0 -1
- package/lib/Shared/components/input/date-input/date-input.component.d.ts +0 -137
- package/lib/Shared/components/input/day-hour-min-input/day-hour-min-input.component.d.ts +0 -64
- package/lib/Shared/components/input/input-base.component.d.ts +0 -264
- package/lib/Shared/components/input/input-basic.component.d.ts +0 -96
- package/lib/Shared/components/input/input-control.component.d.ts +0 -28
- package/lib/Shared/components/input/input-label/input-label.component.d.ts +0 -49
- package/lib/Shared/components/input/input-label/input-label.module.d.ts +0 -1
- package/lib/Shared/components/input/input-shared.module.d.ts +0 -30
- package/lib/Shared/components/input/input-td-rf.component.d.ts +0 -58
- package/lib/Shared/components/input/input.component.d.ts +0 -82
- package/lib/Shared/components/input/input.model.d.ts +0 -16
- package/lib/Shared/components/input/input.module.d.ts +0 -23
- package/lib/Shared/components/input/input.service.d.ts +0 -189
- package/lib/Shared/components/input/inputs-pipes.pipe.d.ts +0 -61
- package/lib/Shared/components/input/inputs.component.d.ts +0 -11
- package/lib/Shared/components/input/validation-message/validation-message.component.d.ts +0 -75
- package/lib/Shared/components/input/validation-message/validation-message.module.d.ts +0 -1
- package/lib/Shared/components/input/validation-message/validation-message.service.d.ts +0 -73
- package/lib/Shared/components/input/year-month-td-rf/year-month-td-rf.component.d.ts +0 -38
- package/lib/Shared/components/input-NgModel/input-ngmodel.component.d.ts +0 -165
- package/lib/Shared/components/input-NgModel/input-ngmodel.module.d.ts +0 -1
- package/lib/Shared/components/input-NgModel/validation-message-ngmodel/validation-message-ngmodel.component.d.ts +0 -50
- package/lib/Shared/components/input-table/input-table.component.d.ts +0 -76
- package/lib/Shared/components/input-table/input-table.model.d.ts +0 -23
- package/lib/Shared/components/input-table/input-table.service.d.ts +0 -8
- package/lib/Shared/components/label/label.component.d.ts +0 -25
- package/lib/Shared/components/label/label.module.d.ts +0 -1
- package/lib/Shared/components/loader/loader-animations/blinking-blocks/blinking-blocks.component.d.ts +0 -5
- package/lib/Shared/components/loader/loader-animations/bouncing-ball/bouncing-ball.component.d.ts +0 -5
- package/lib/Shared/components/loader/loader-animations/fading-bars/fading-bars.component.d.ts +0 -5
- package/lib/Shared/components/loader/loader-animations/fading-circles/fading-circles.component.d.ts +0 -5
- package/lib/Shared/components/loader/loader-animations/ring-ripples/ring-ripples.component.d.ts +0 -5
- package/lib/Shared/components/loader/loader.component.d.ts +0 -88
- package/lib/Shared/components/loader/loader.module.d.ts +0 -1
- package/lib/Shared/components/loader/spinner.component.d.ts +0 -8
- package/lib/Shared/components/modal/modal-body.directive.d.ts +0 -27
- package/lib/Shared/components/modal/modal-footer.directive.d.ts +0 -27
- package/lib/Shared/components/modal/modal.component.d.ts +0 -154
- package/lib/Shared/components/modal/modal.model.d.ts +0 -21
- package/lib/Shared/components/modal/modal.module.d.ts +0 -1
- package/lib/Shared/components/modal-components/modal.components.d.ts +0 -7
- package/lib/Shared/components/modal-form/modal-form.component.d.ts +0 -79
- package/lib/Shared/components/modal-form/modal-form.module.d.ts +0 -1
- package/lib/Shared/components/modal-header/modal-header.component.d.ts +0 -35
- package/lib/Shared/components/modal-header/modal-header.module.d.ts +0 -1
- package/lib/Shared/components/narration-history-comp/narration-history-comp.component.d.ts +0 -34
- package/lib/Shared/components/notifications/notifications.component.d.ts +0 -10
- package/lib/Shared/components/notifications/notifications.service.d.ts +0 -9
- package/lib/Shared/components/page-center-body/page-center-body.component.d.ts +0 -5
- package/lib/Shared/components/page-template/page-template.component.d.ts +0 -181
- package/lib/Shared/components/page-template/page-template.module.d.ts +0 -1
- package/lib/Shared/components/page-to-component/page-to-component.component.d.ts +0 -70
- package/lib/Shared/components/page-to-component/page-to-component.directive.d.ts +0 -8
- package/lib/Shared/components/page-to-component/page-to-component.module.d.ts +0 -1
- package/lib/Shared/components/page-to-component/page-to-component.service.d.ts +0 -33
- package/lib/Shared/components/paginator/paginator.component.d.ts +0 -57
- package/lib/Shared/components/phone-number/phone-number.component.d.ts +0 -129
- package/lib/Shared/components/phone-number/phone-number.service.d.ts +0 -33
- package/lib/Shared/components/rich-text-editor/rich-text-editor.component.d.ts +0 -94
- package/lib/Shared/components/rich-text-editor-rf/rich-text-editor-rf.component.d.ts +0 -41
- package/lib/Shared/components/row-actions/row-actions.component.d.ts +0 -74
- package/lib/Shared/components/row-actions/row-actions.module.d.ts +0 -1
- package/lib/Shared/components/svg-icon/svg-icon.component.d.ts +0 -20
- package/lib/Shared/components/svg-icon/svg-icon.model.d.ts +0 -1
- package/lib/Shared/components/svg-icon/svg-icon.module.d.ts +0 -1
- package/lib/Shared/components/svg-icon/svg-icon.service.d.ts +0 -11
- package/lib/Shared/components/table/table-base.component.d.ts +0 -240
- package/lib/Shared/components/table/table-https/table-https.component.d.ts +0 -168
- package/lib/Shared/components/table/table-input/table-input-row/table-input-row.component.d.ts +0 -54
- package/lib/Shared/components/table/table-input/table-input.component.d.ts +0 -251
- package/lib/Shared/components/table/table-input/table-input.model.d.ts +0 -21
- package/lib/Shared/components/table/table-plain/table-plain.component.d.ts +0 -118
- package/lib/Shared/components/table/table-plain.service.d.ts +0 -52
- package/lib/Shared/components/table/table.pipe.d.ts +0 -87
- package/lib/Shared/components/text/text.component.d.ts +0 -6
- package/lib/Shared/components/text/text.module.d.ts +0 -1
- package/lib/Shared/components/text-area-modal/text-area-modal.component.d.ts +0 -27
- package/lib/Shared/components/text-area-modal/text-area-modal.service.d.ts +0 -10
- package/lib/Shared/components/text-case-1/text-case-1.component.d.ts +0 -53
- package/lib/Shared/components/text-case-1/text-case-1.module.d.ts +0 -1
- package/lib/Shared/components/text-case-2/text-case-2.component.d.ts +0 -219
- package/lib/Shared/components/text-case-2/text-case-2.module.d.ts +0 -1
- package/lib/Shared/components/text-case-2/text-case.service.d.ts +0 -23
- package/lib/Shared/components/text-case-input/text-case-input.component.d.ts +0 -9
- package/lib/Shared/components/text-case-input/text-case-input.module.d.ts +0 -1
- package/lib/Shared/components/toggle-input-form/toggle-input-form.component.d.ts +0 -138
- package/lib/Shared/components/toggle-input-form/toggle-input-form.model.d.ts +0 -27
- package/lib/Shared/components/translator-case/translator-case.component.d.ts +0 -6
- package/lib/Shared/components/vertical-nav/vertical-nav.component.d.ts +0 -101
- package/lib/Shared/components/view-form-buttons/view-form-buttons.component.d.ts +0 -23
- package/lib/Shared/components/view-form-buttons/view-form-buttons.module.d.ts +0 -1
- package/lib/Shared/components/webcam-media/webcam-media.component.d.ts +0 -162
- package/lib/Shared/components/webcam-media/webcam-media.model.d.ts +0 -7
- package/lib/Shared/directives/commafy-number.directive.d.ts +0 -104
- package/lib/Shared/directives/drag-drop-file-upload.directive.d.ts +0 -50
- package/lib/Shared/directives/form-invalid-class.directive.d.ts +0 -49
- package/lib/Shared/directives/index.directive.d.ts +0 -369
- package/lib/Shared/directives/input-formatter.directive.d.ts +0 -166
- package/lib/Shared/directives/integer-only.directive.d.ts +0 -60
- package/lib/Shared/directives/mHref.directive.d.ts +0 -6
- package/lib/Shared/directives/native-event-listeners.directive.d.ts +0 -228
- package/lib/Shared/directives/negative-number-only.directive.d.ts +0 -30
- package/lib/Shared/directives/responsiveness.directive.d.ts +0 -157
- package/lib/Shared/directives/translator.directive.d.ts +0 -45
- package/lib/Shared/injection-tokens/index.injection-tokens.d.ts +0 -3
- package/lib/Shared/models/IMenuItem.d.ts +0 -247
- package/lib/Shared/models/RouteItem.class.d.ts +0 -120
- package/lib/Shared/models/environment.model.d.ts +0 -204
- package/lib/Shared/models/form-schema.model.d.ts +0 -1
- package/lib/Shared/models/form.class.d.ts +0 -175
- package/lib/Shared/models/index.model.d.ts +0 -938
- package/lib/Shared/models/translator.model.d.ts +0 -27
- package/lib/Shared/pipes/form-invalid-class.pipe.d.ts +0 -28
- package/lib/Shared/pipes/number.pipe.d.ts +0 -15
- package/lib/Shared/pipes/paginator.pipe.d.ts +0 -28
- package/lib/Shared/pipes/translate.pipe.d.ts +0 -104
- package/lib/Shared/pipes/utility.pipe.d.ts +0 -715
- package/lib/Shared/prototypes/prototypes.d.ts +0 -201
- package/lib/Shared/shared.module.d.ts +0 -105
- package/lib/authentication/web-user/web-user-authentication.guard.d.ts +0 -15
- package/lib/authentication/web-user/web-user-authentication.interceptor.d.ts +0 -17
- package/lib/authentication/web-user/web-user-authentication.model.d.ts +0 -34
- package/lib/authentication/web-user/web-user-authentication.service.d.ts +0 -91
- package/lib/authentication/web-user/web-user-forgot-password.component.d.ts +0 -46
- package/lib/authentication/web-user/web-user-login.component.d.ts +0 -45
- package/lib/authentication/web-user/web-user-reset-password.component.d.ts +0 -59
- package/lib/configs/base-functions.d.ts +0 -141
- package/lib/configs/index.config.d.ts +0 -95
- package/lib/configs/validation-messages.config.d.ts +0 -20
- package/public-api.d.ts +0 -215
|
@@ -1,989 +0,0 @@
|
|
|
1
|
-
import { CurrencyPipe, DatePipe, DecimalPipe, Location, TitleCasePipe } from '@angular/common';
|
|
2
|
-
import { ResourceRef } from '@angular/core';
|
|
3
|
-
import { MatDialog as MatDialog, MatDialogConfig as MatDialogConfig } from '@angular/material/dialog';
|
|
4
|
-
import { MatSnackBar as MatSnackBar } from '@angular/material/snack-bar';
|
|
5
|
-
import { Title } from '@angular/platform-browser';
|
|
6
|
-
import { Router, NavigationExtras, ActivatedRoute } from '@angular/router';
|
|
7
|
-
import { ETSReactiveFormInputService as IS1 } from './input.service';
|
|
8
|
-
import jfd from 'js-file-download';
|
|
9
|
-
import { PageLoaderService } from './page-loader.service';
|
|
10
|
-
import { Config } from '../configs/index.config';
|
|
11
|
-
import { AppRouteBase } from '../Shared/models/RouteItem.class';
|
|
12
|
-
import { EValidationType, IStrictFormGroup, Status, TableCol } from '../Shared/models/index.model';
|
|
13
|
-
import { PageService } from './page.service';
|
|
14
|
-
import { AbstractControl, AsyncValidatorFn, FormArray, FormControl, FormControlOptions, FormGroup, UntypedFormArray, ValidatorFn } from '@angular/forms';
|
|
15
|
-
import { LoggerService } from '../Reusables/reusable-pages/logger/logger.service';
|
|
16
|
-
import { Observable, ReplaySubject, Subscription } from 'rxjs';
|
|
17
|
-
import { EETSPageBtnID } from '../Shared/models/IMenuItem';
|
|
18
|
-
import { SDKEnvironment } from '../Shared/models/environment.model';
|
|
19
|
-
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
20
|
-
import { DebouncerService } from './debouncer.service';
|
|
21
|
-
import { IFormSchema } from '../Shared/components/form-generator/form-generator.component';
|
|
22
|
-
import { IInfoDialogBtn } from '../Shared/components/info-dialog/info-dialog.component';
|
|
23
|
-
import { ToastNotificationsService } from '@serene-dev/toast-notifications';
|
|
24
|
-
import { ErrorReporterService } from './error-reporter.service';
|
|
25
|
-
import { ObjectSizeService } from './object-size.service';
|
|
26
|
-
import { NumberFormatService } from './number-format.service';
|
|
27
|
-
import * as i0 from "@angular/core";
|
|
28
|
-
/**
|
|
29
|
-
* A comprehensive utility service that provides various helper functions and services for Angular applications.
|
|
30
|
-
* This service includes functionality for form handling, date formatting, file operations, and more.
|
|
31
|
-
*
|
|
32
|
-
* @template TEnvironment - The type of environment configuration to use, defaults to SDKEnvironment
|
|
33
|
-
*/
|
|
34
|
-
export declare class UtilityService<TEnvironment extends SDKEnvironment = SDKEnvironment> {
|
|
35
|
-
/** Angular Material Dialog service for managing dialogs */
|
|
36
|
-
readonly dialog: MatDialog;
|
|
37
|
-
/** Angular Material SnackBar service for displaying notifications */
|
|
38
|
-
readonly snackBar: MatSnackBar;
|
|
39
|
-
/** Angular Router service for navigation */
|
|
40
|
-
readonly router: Router;
|
|
41
|
-
/** Angular Title service for managing page titles */
|
|
42
|
-
readonly titleS: Title;
|
|
43
|
-
/** Angular Location service for browser location management */
|
|
44
|
-
readonly location: Location;
|
|
45
|
-
/** Service for handling form input operations */
|
|
46
|
-
readonly inputService: IS1<any, any>;
|
|
47
|
-
/** Service for managing page loading states */
|
|
48
|
-
readonly pS: PageLoaderService;
|
|
49
|
-
/** Angular CurrencyPipe for currency formatting */
|
|
50
|
-
readonly currencyPipe: CurrencyPipe;
|
|
51
|
-
/** Angular TitleCasePipe for text case transformation */
|
|
52
|
-
readonly titleCasePipe: TitleCasePipe;
|
|
53
|
-
/** Service for logging operations */
|
|
54
|
-
readonly loggerService: LoggerService;
|
|
55
|
-
/** Service for error reporting */
|
|
56
|
-
readonly errorReporterService: ErrorReporterService;
|
|
57
|
-
/** Service for page-related operations */
|
|
58
|
-
readonly pageS: PageService;
|
|
59
|
-
/** Service for responsive design breakpoint observation */
|
|
60
|
-
readonly responsive: BreakpointObserver;
|
|
61
|
-
/** Angular DatePipe for date formatting */
|
|
62
|
-
readonly datePipe: DatePipe;
|
|
63
|
-
/** Service for number formatting operations */
|
|
64
|
-
readonly numberFormatService: NumberFormatService;
|
|
65
|
-
/** Service for debouncing operations */
|
|
66
|
-
readonly debouncerService: DebouncerService;
|
|
67
|
-
/** Angular DecimalPipe for decimal number formatting */
|
|
68
|
-
readonly numberPipe: DecimalPipe;
|
|
69
|
-
/** Service for calculating object sizes */
|
|
70
|
-
readonly objectSizeService: ObjectSizeService;
|
|
71
|
-
/** Service for toast notifications */
|
|
72
|
-
readonly toastNotificationService: ToastNotificationsService;
|
|
73
|
-
/** Base route configuration */
|
|
74
|
-
r: AppRouteBase;
|
|
75
|
-
/** File downloader utility using js-file-download */
|
|
76
|
-
downloader: typeof jfd;
|
|
77
|
-
/** Enum for validation types */
|
|
78
|
-
eValidationType: typeof EValidationType;
|
|
79
|
-
/** Application configuration */
|
|
80
|
-
config: typeof Config;
|
|
81
|
-
/** Current environment configuration */
|
|
82
|
-
environment: TEnvironment;
|
|
83
|
-
/** Enum for page button IDs */
|
|
84
|
-
pbid: typeof EETSPageBtnID;
|
|
85
|
-
/** jQuery reference */
|
|
86
|
-
$: any;
|
|
87
|
-
/** Flag indicating if the current device is mobile */
|
|
88
|
-
isMobile: boolean;
|
|
89
|
-
/** Emits true if the device is mobile */
|
|
90
|
-
mobileQueryChanged: ReplaySubject<boolean>;
|
|
91
|
-
/** Signal that emits true when the device is a mobile handset */
|
|
92
|
-
readonly isMobileSignal: import("@angular/core").Signal<boolean>;
|
|
93
|
-
/** Signal that emits true when the device is a tablet */
|
|
94
|
-
readonly isTabletSignal: import("@angular/core").Signal<boolean>;
|
|
95
|
-
/** Signal that emits true when the device is a desktop */
|
|
96
|
-
readonly isDesktopSignal: import("@angular/core").Signal<boolean>;
|
|
97
|
-
/** Available options for page size in paginated views */
|
|
98
|
-
pageSizeOptions: number[];
|
|
99
|
-
/** Date pipe format for full date display */
|
|
100
|
-
datePipeDate: string;
|
|
101
|
-
/** Date pipe format for compact date display */
|
|
102
|
-
datePipeDateLean: string;
|
|
103
|
-
/** Date pipe format for compact date and time display */
|
|
104
|
-
datePipeDateTimeLean: string;
|
|
105
|
-
/** Field name used for custom ID tracking */
|
|
106
|
-
readonly customIDField = "__id";
|
|
107
|
-
/** Delimiter used for string operations */
|
|
108
|
-
readonly delimiter = "~~~//~~~";
|
|
109
|
-
/** Non-nullable form builder instance */
|
|
110
|
-
formBuilder: import("@angular/forms").NonNullableFormBuilder;
|
|
111
|
-
constructor();
|
|
112
|
-
/**
|
|
113
|
-
* Creates a form control configuration array for use with FormBuilder
|
|
114
|
-
* @param value - Initial value for the control
|
|
115
|
-
* @param validatorOrOpts - Validators or options for the control
|
|
116
|
-
* @param asyncValidator - Async validators for the control
|
|
117
|
-
* @returns Array containing value, validators, and async validators
|
|
118
|
-
* @template T - Type of the form control value
|
|
119
|
-
*/
|
|
120
|
-
formControl: <T>(value?: T | null, validatorOrOpts?: ValidatorFn | ValidatorFn[] | FormControlOptions, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]) => (ValidatorFn | ValidatorFn[] | AsyncValidatorFn | AsyncValidatorFn[] | FormControlOptions | T)[];
|
|
121
|
-
/**
|
|
122
|
-
* Navigates back to the previous page using Angular's Location service
|
|
123
|
-
*/
|
|
124
|
-
back: () => void;
|
|
125
|
-
/**
|
|
126
|
-
* Shortcut for toast notifications
|
|
127
|
-
*/
|
|
128
|
-
readonly toast: {
|
|
129
|
-
add: (item: import("@serene-dev/toast-notifications").IAddToastNotification) => {
|
|
130
|
-
id: string;
|
|
131
|
-
update: (update: Partial<import("@serene-dev/toast-notifications").IAddToastNotification>) => void;
|
|
132
|
-
close: () => void;
|
|
133
|
-
loader: {
|
|
134
|
-
play: () => void;
|
|
135
|
-
stop: () => void;
|
|
136
|
-
};
|
|
137
|
-
closed: import("rxjs").Subject<{
|
|
138
|
-
manuallyClosed: boolean;
|
|
139
|
-
}>;
|
|
140
|
-
};
|
|
141
|
-
close: (id: string, manualDismissal: boolean) => void;
|
|
142
|
-
update: (id: string, item: Partial<import("@serene-dev/toast-notifications").IAddToastNotification>) => void;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Utility to calculate approximate size of an object
|
|
146
|
-
*/
|
|
147
|
-
readonly roughSizeOfObject: (object: any, maxSize?: number) => {
|
|
148
|
-
bytes?: number;
|
|
149
|
-
crossedMaxSize?: boolean;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Ensures only one input from a group can be active at a time.
|
|
153
|
-
* When one input has a value, all others are disabled.
|
|
154
|
-
* @param inputs - Array of form controls to manage
|
|
155
|
-
* @returns Subscription that can be used to unsubscribe from the input changes
|
|
156
|
-
* @example
|
|
157
|
-
* // Create form controls
|
|
158
|
-
* const nameControl = new FormControl('');
|
|
159
|
-
* const idControl = new FormControl('');
|
|
160
|
-
* const emailControl = new FormControl('');
|
|
161
|
-
*
|
|
162
|
-
* // Make them mutually exclusive
|
|
163
|
-
* const subscription = utilityService.onlyOneInput([nameControl, idControl, emailControl]);
|
|
164
|
-
*
|
|
165
|
-
* // Later, unsubscribe when done
|
|
166
|
-
* subscription.unsubscribe();
|
|
167
|
-
*/
|
|
168
|
-
onlyOneInput(inputs: FormControl[]): Subscription;
|
|
169
|
-
/**
|
|
170
|
-
* Copies a payload to clipboard in debug mode
|
|
171
|
-
* @param payload - Data to be copied to clipboard
|
|
172
|
-
* @example
|
|
173
|
-
* // Copy API response to clipboard in debug mode
|
|
174
|
-
* utilityService.copyPayload(apiResponse);
|
|
175
|
-
*/
|
|
176
|
-
copyPayload(payload: any): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Returns the value x if it's not null or undefined, otherwise returns y
|
|
179
|
-
* @param x - Primary value to return if not null/undefined
|
|
180
|
-
* @param y - Default value to return if x is null/undefined (defaults to '-')
|
|
181
|
-
* @returns x if not null/undefined, otherwise y
|
|
182
|
-
* @example
|
|
183
|
-
* // Returns "User" since the value exists
|
|
184
|
-
* utilityService.xOrY("User", "Guest"); // "User"
|
|
185
|
-
*
|
|
186
|
-
* // Returns "-" (default fallback) since value is null
|
|
187
|
-
* utilityService.xOrY(null); // "-"
|
|
188
|
-
*
|
|
189
|
-
* // Returns "N/A" (custom fallback) since value is undefined
|
|
190
|
-
* utilityService.xOrY(undefined, "N/A"); // "N/A"
|
|
191
|
-
*/
|
|
192
|
-
xOrY: (x: any, y?: string) => string;
|
|
193
|
-
/**
|
|
194
|
-
* Converts text to title case using Angular's TitleCasePipe
|
|
195
|
-
* @param text - Text to convert to title case
|
|
196
|
-
* @returns Text in title case format
|
|
197
|
-
* @example
|
|
198
|
-
* utilityService.toTitleCase("hello world"); // "Hello World"
|
|
199
|
-
* utilityService.toTitleCase("USER_PROFILE"); // "User Profile"
|
|
200
|
-
*/
|
|
201
|
-
toTitleCase(text: string): string;
|
|
202
|
-
/**
|
|
203
|
-
* Convert Date string to Date Time string
|
|
204
|
-
* @param dateStr - Date string
|
|
205
|
-
* @param config - Configuration for the conversion
|
|
206
|
-
* @returns Returns a Date Time string
|
|
207
|
-
* @example
|
|
208
|
-
* // Basic conversion with default time (00:00:00Z)
|
|
209
|
-
* utilityService.dateToDateTime('2022-01-25'); // '2022-01-25T00:00:00Z'
|
|
210
|
-
*
|
|
211
|
-
* // With custom time
|
|
212
|
-
* utilityService.dateToDateTime('2022-01-25', { time: '14:30:00Z' }); // '2022-01-25T14:30:00Z'
|
|
213
|
-
*
|
|
214
|
-
* // Without T separator
|
|
215
|
-
* utilityService.dateToDateTime('2022-01-25', { omitT: true }); // '2022-01-25 00:00:00'
|
|
216
|
-
*/
|
|
217
|
-
dateToDateTime: (dateStr: string, config?: {
|
|
218
|
-
/**
|
|
219
|
-
* Use the yyyy-mm-dd hh:mm:ss format
|
|
220
|
-
*/
|
|
221
|
-
omitT?: boolean;
|
|
222
|
-
/**Time to append to date. @example `12:00:00Z` */
|
|
223
|
-
time?: string;
|
|
224
|
-
}) => string;
|
|
225
|
-
/**
|
|
226
|
-
* Set an Object's field if the object exists or don't if the object doesn't
|
|
227
|
-
* @param obj - Object holding the field
|
|
228
|
-
* @param kvps - Partial<T> object containing the field and its value
|
|
229
|
-
* @returns Returns the object holding the data
|
|
230
|
-
* @example
|
|
231
|
-
* const user = { name: 'John', age: 30 };
|
|
232
|
-
*
|
|
233
|
-
* // Update user's age and add a new field
|
|
234
|
-
* utilityService.setterWithNull(user, { age: 31, role: 'Admin' });
|
|
235
|
-
* // user is now { name: 'John', age: 31, role: 'Admin' }
|
|
236
|
-
*
|
|
237
|
-
* // Returns null if object is null
|
|
238
|
-
* utilityService.setterWithNull(null, { name: 'Test' }); // null
|
|
239
|
-
*/
|
|
240
|
-
setterWithNull<T>(obj: T, kvps: Partial<T>): T;
|
|
241
|
-
/**
|
|
242
|
-
* (Set an Object's field if the object exists or don't if the object doesn't) for multiple entries
|
|
243
|
-
* @param items - Array of objects and their modifications
|
|
244
|
-
*/
|
|
245
|
-
setterWithNullArray<T>(items: {
|
|
246
|
-
obj: T;
|
|
247
|
-
kvps: Partial<T>;
|
|
248
|
-
}[]): void;
|
|
249
|
-
/**
|
|
250
|
-
* Handles the deletion of rows from a FormArray
|
|
251
|
-
* @param index - Index of the row to delete
|
|
252
|
-
* @param fa - The FormArray that holds the rows
|
|
253
|
-
* @param deleteService - The deletion service to be called (It should be an anonymous function)
|
|
254
|
-
* @param addRowFunc - The function (anonymous) that adds a new row to the FormArray
|
|
255
|
-
* @param extraConfig - Optional configuration for the deletion operation
|
|
256
|
-
* @returns Promise that resolves after deletion is complete
|
|
257
|
-
* @example
|
|
258
|
-
* // Delete a row from a form array of addresses
|
|
259
|
-
* const deleteAddress = (id) => this.apiService.deleteAddress(id);
|
|
260
|
-
* const addNewAddress = () => this.addressesFormArray.push(this.createAddressFormGroup());
|
|
261
|
-
*
|
|
262
|
-
* utilityService.handleFormRowDelete(
|
|
263
|
-
* 2, // Delete the third row (index 2)
|
|
264
|
-
* this.addressesFormArray,
|
|
265
|
-
* deleteAddress,
|
|
266
|
-
* addNewAddress,
|
|
267
|
-
* {
|
|
268
|
-
* dontEmitEvent: true,
|
|
269
|
-
* onDelete: (response) => console.log('Address deleted', response)
|
|
270
|
-
* }
|
|
271
|
-
* );
|
|
272
|
-
*/
|
|
273
|
-
handleFormRowDelete: (index: number, fa: UntypedFormArray, deleteService: (...args: any) => Promise<any> | Observable<any>, addRowFunc: (...args: any) => any, extraConfig?: {
|
|
274
|
-
dontEmitEvent?: boolean;
|
|
275
|
-
onDelete?: (res: any) => any;
|
|
276
|
-
}) => Promise<any>;
|
|
277
|
-
/**
|
|
278
|
-
* Opens an HTML element in fullscreen mode
|
|
279
|
-
* @param elem - HTML element to display in fullscreen
|
|
280
|
-
* @param metadata - Optional metadata to pass to the onLeave callback
|
|
281
|
-
* @param onLeave - Optional callback function when leaving fullscreen mode
|
|
282
|
-
* @example
|
|
283
|
-
* // Open an image viewer in fullscreen
|
|
284
|
-
* const imageViewer = document.getElementById('image-viewer');
|
|
285
|
-
* const imageData = { id: '123', url: 'https://example.com/image.jpg' };
|
|
286
|
-
*
|
|
287
|
-
* utilityService.openHTMLInFullscreen(
|
|
288
|
-
* imageViewer,
|
|
289
|
-
* imageData,
|
|
290
|
-
* (data) => console.log('Left fullscreen view of image:', data.id)
|
|
291
|
-
* );
|
|
292
|
-
*/
|
|
293
|
-
openHTMLInFullscreen<TMetadata>(elem: HTMLElement, metadata?: TMetadata, onLeave?: (metadata: TMetadata) => any): void;
|
|
294
|
-
/**
|
|
295
|
-
* Exits fullscreen mode
|
|
296
|
-
* @example
|
|
297
|
-
* // Exit fullscreen when a button is clicked
|
|
298
|
-
* closeButton.addEventListener('click', () => {
|
|
299
|
-
* utilityService.closeFullscreen();
|
|
300
|
-
* });
|
|
301
|
-
*/
|
|
302
|
-
closeFullscreen(): void;
|
|
303
|
-
/**
|
|
304
|
-
* Adds subscriptions to be automatically closed when navigating away
|
|
305
|
-
* @param sub - Subscriptions to be closed
|
|
306
|
-
* @example
|
|
307
|
-
* const dataSub = this.dataService.getData().subscribe(data => this.data = data);
|
|
308
|
-
* const statusSub = this.statusService.getStatus().subscribe(status => this.status = status);
|
|
309
|
-
*
|
|
310
|
-
* // These subscriptions will be automatically unsubscribed when navigating to another route
|
|
311
|
-
* this.utilityService.addToSubsToCloseOnRoute(dataSub, statusSub);
|
|
312
|
-
*/
|
|
313
|
-
addToSubsToCloseOnRoute: (...sub: Subscription[]) => void;
|
|
314
|
-
/**
|
|
315
|
-
* Clears all subscriptions that were added to be closed on route change
|
|
316
|
-
*/
|
|
317
|
-
clearSubsToCloseOnRoute: () => void;
|
|
318
|
-
/**
|
|
319
|
-
* Handles the deletion of rows from an array
|
|
320
|
-
* @param index - Index of the row to delete
|
|
321
|
-
* @param arr - The array that holds the rows
|
|
322
|
-
* @param deleteService - The deletion service to be called (It should be an anonymous function)
|
|
323
|
-
* @param addRowFunc - The function (anonymous) that adds a new row to the array
|
|
324
|
-
* @param cb - The function to callback with the response of the deletion service as the input parameter
|
|
325
|
-
*/
|
|
326
|
-
handleRowDelete: <T>(index: number, arr: any[], deleteService: (...args: any) => Promise<T> | Observable<T>, addRowFunc: (...args: any) => any, cb?: (any: any) => any) => Promise<void>;
|
|
327
|
-
/**
|
|
328
|
-
* To handle the patching of a FormArray
|
|
329
|
-
* @param arr - The array that contains the data
|
|
330
|
-
* @param addFunc - The function that performs addition of single entries
|
|
331
|
-
* @param formArr - The FormArray that will hold the array's data
|
|
332
|
-
*/
|
|
333
|
-
initPatchFormArray: <T>(arr: T[], addFunc: (i: number, data?: T, formArr?: FormArray) => void, formArr: FormArray) => void;
|
|
334
|
-
/**
|
|
335
|
-
* Checks if a value is a Promise
|
|
336
|
-
* @param func - Value to check
|
|
337
|
-
* @returns True if the value is a Promise
|
|
338
|
-
*/
|
|
339
|
-
private isPromise;
|
|
340
|
-
/**
|
|
341
|
-
* Checks if a function is async
|
|
342
|
-
* @param func - Function to check
|
|
343
|
-
* @returns True if the function is async
|
|
344
|
-
*/
|
|
345
|
-
isAsync: (func: any) => boolean;
|
|
346
|
-
/**
|
|
347
|
-
* Checks if a value is an Observable
|
|
348
|
-
* @param func - Value to check
|
|
349
|
-
* @returns True if the value is an Observable
|
|
350
|
-
*/
|
|
351
|
-
isObservable: <T>(func: any) => func is Observable<unknown>;
|
|
352
|
-
/**
|
|
353
|
-
* Converts a value to a Promise
|
|
354
|
-
* @param val - Value to convert
|
|
355
|
-
* @returns Promise that resolves with the value
|
|
356
|
-
*/
|
|
357
|
-
promisifyVal: <T>(val: T | Promise<T> | Observable<T>) => Promise<Awaited<T>>;
|
|
358
|
-
/**
|
|
359
|
-
* Merges multiple observables into a single observable
|
|
360
|
-
* @param arr - Array of observables to fetch
|
|
361
|
-
* @returns An array of the responses merged together. It emits the merged responses as they are fetched and closes once all the responses have been fetched
|
|
362
|
-
*/
|
|
363
|
-
mergeArrObservables: <T>(arr: {
|
|
364
|
-
$func: Observable<T[]>;
|
|
365
|
-
}[]) => Observable<T[]>;
|
|
366
|
-
/**
|
|
367
|
-
* Removes duplicate items from an array based on a key field
|
|
368
|
-
* @param list - Array to remove duplicates from
|
|
369
|
-
* @param keyField - Field to use for comparison (defaults to 'code')
|
|
370
|
-
* @returns Array with duplicates removed
|
|
371
|
-
*/
|
|
372
|
-
removeDuplicate<T>(list: T[], keyField?: string): T[];
|
|
373
|
-
/**
|
|
374
|
-
* Generates a random ID
|
|
375
|
-
*/
|
|
376
|
-
get genRandomID(): number;
|
|
377
|
-
/**
|
|
378
|
-
* Picks a random item from an array
|
|
379
|
-
* @param array - Array to pick from
|
|
380
|
-
* @returns Random item or null if array is empty
|
|
381
|
-
*/
|
|
382
|
-
pickRandomIndex: <T>(array: T[]) => T | null;
|
|
383
|
-
/**
|
|
384
|
-
* Stores a payload in the logger
|
|
385
|
-
*/
|
|
386
|
-
storePayload: <T>(log: import("ets-fe-ng-sdk").ILog<T>) => void;
|
|
387
|
-
/**
|
|
388
|
-
* Checks if an object is empty, optionally excluding certain fields
|
|
389
|
-
* @param obj - Object to check
|
|
390
|
-
* @param exclusionFields - Fields to exclude from the check
|
|
391
|
-
* @returns True if the object is empty
|
|
392
|
-
*/
|
|
393
|
-
objIsEmpty: (obj: any, exclusionFields?: string[]) => boolean;
|
|
394
|
-
/**
|
|
395
|
-
* Generates an array of objects with random string values for the specified keys.
|
|
396
|
-
* @param keys - Array of keys to include in each object.
|
|
397
|
-
* @param length - Number of objects to generate (default is 10).
|
|
398
|
-
* @returns An array of objects with random string values.
|
|
399
|
-
* @example
|
|
400
|
-
* utilityService.dataGen(['name', 'email'], 2);
|
|
401
|
-
* // [{ name: 'random123', email: 'random456' }, { name: 'random789', email: 'random101' }]
|
|
402
|
-
*/
|
|
403
|
-
dataGen: <T = any>(keys: string[], length?: number) => T[];
|
|
404
|
-
/**
|
|
405
|
-
* Generates a random string value.
|
|
406
|
-
* @returns A random string in the format 'randomXXX'.
|
|
407
|
-
* @example
|
|
408
|
-
* utilityService.textGen(); // 'random123'
|
|
409
|
-
*/
|
|
410
|
-
textGen: () => string;
|
|
411
|
-
/**
|
|
412
|
-
* TrackBy function for Angular lists using the 'code' property.
|
|
413
|
-
* @param index - Index of the item.
|
|
414
|
-
* @param item - The item object.
|
|
415
|
-
* @returns The 'code' property of the item.
|
|
416
|
-
* @example
|
|
417
|
-
* <div *ngFor="let item of items; trackBy: utilityService.trackByCode">...</div>
|
|
418
|
-
*/
|
|
419
|
-
trackByCode(index: number, item: any): any;
|
|
420
|
-
/**
|
|
421
|
-
* TrackBy function for Angular lists using the 'id' property.
|
|
422
|
-
* @param index - Index of the item.
|
|
423
|
-
* @param item - The item object.
|
|
424
|
-
* @returns The 'id' property of the item.
|
|
425
|
-
* @example
|
|
426
|
-
* <div *ngFor="let item of items; trackBy: utilityService.trackByID">...</div>
|
|
427
|
-
*/
|
|
428
|
-
trackByID(index: number, item: any): any;
|
|
429
|
-
/**
|
|
430
|
-
* Opens a dialog and handles the result with provided callbacks.
|
|
431
|
-
* @param comp - The component to open in the dialog.
|
|
432
|
-
* @param config - Dialog configuration.
|
|
433
|
-
* @param valueCB - Callback if a value is returned.
|
|
434
|
-
* @param noValueCB - Optional callback if no value is returned.
|
|
435
|
-
* @example
|
|
436
|
-
* utilityService.dialogOpener(MyDialogComponent, config, (result) => { ... });
|
|
437
|
-
*/
|
|
438
|
-
dialogOpener: (comp: any, config: MatDialogConfig, valueCB: (r: any) => any, noValueCB?: any) => Subscription;
|
|
439
|
-
/**
|
|
440
|
-
* Opens a dialog and returns the dialog reference.
|
|
441
|
-
* @param comp - The component to open in the dialog.
|
|
442
|
-
* @param config - Dialog configuration.
|
|
443
|
-
* @returns The MatDialogRef instance.
|
|
444
|
-
* @example
|
|
445
|
-
* const ref = utilityService.dialogOpenerRef(MyDialogComponent, config);
|
|
446
|
-
*/
|
|
447
|
-
dialogOpenerRef: (comp: any, config: MatDialogConfig) => import("@angular/material/dialog").MatDialogRef<unknown, any>;
|
|
448
|
-
/**
|
|
449
|
-
* Finds and formats a label for an item from an array, using a key and label field.
|
|
450
|
-
* @param item - The item value to find.
|
|
451
|
-
* @param arr - The array to search.
|
|
452
|
-
* @param labelField - The field to use for the label (default: 'title' or 'description').
|
|
453
|
-
* @param keyField - The field to use as the key (default: 'code').
|
|
454
|
-
* @returns A formatted string combining the item and its label, or the item if not found.
|
|
455
|
-
* @example
|
|
456
|
-
* utilityService.findLabelByItem('A1', [{ code: 'A1', title: 'Alpha' }]); // 'A1 - Alpha'
|
|
457
|
-
*/
|
|
458
|
-
findLabelByItem: (item: any, arr: any[], labelField?: string, keyField?: string) => any;
|
|
459
|
-
formFieldsFromArr: <TFCInput>(inputs: TFCInput[]) => {
|
|
460
|
-
[key: string]: AbstractControl<any, any>;
|
|
461
|
-
};
|
|
462
|
-
objToFormControls: <T = any>(obj: T) => { [key in keyof T]: AbstractControl<T[key], T[key]>; };
|
|
463
|
-
formSchemaToFormControls: <TIFormSchema>(formFields: TIFormSchema[]) => {
|
|
464
|
-
[key: string]: AbstractControl<any, any>;
|
|
465
|
-
};
|
|
466
|
-
addFormSchemaToForm: <TIFormSchema>(formFields: TIFormSchema[], form: FormGroup) => FormGroup<any>;
|
|
467
|
-
bindFormControlToInputs: <TFCInput>(inputs: TFCInput[], form: FormGroup) => void;
|
|
468
|
-
go: (value: string, extra?: NavigationExtras) => void;
|
|
469
|
-
/**
|
|
470
|
-
* Route to component
|
|
471
|
-
* @param route Route of path to component
|
|
472
|
-
* @param extra
|
|
473
|
-
*/
|
|
474
|
-
goR: (route: string, extra?: NavigationExtras) => void;
|
|
475
|
-
/**
|
|
476
|
-
* Provides a set of router utilities for relative navigation and parameter access.
|
|
477
|
-
* @returns An object containing the current route, router, navigation function, query params, and path params.
|
|
478
|
-
* @example
|
|
479
|
-
* const { navigate, queryParams, pathParams } = utilityService.relativeRouter();
|
|
480
|
-
* navigate('details', { queryParams: { id: 1 } });
|
|
481
|
-
*/
|
|
482
|
-
relativeRouter(): {
|
|
483
|
-
route: ActivatedRoute;
|
|
484
|
-
router: Router;
|
|
485
|
-
navigate: (link: string, config?: NavigationExtras | undefined) => Promise<boolean>;
|
|
486
|
-
queryParams: import("@angular/router").Params;
|
|
487
|
-
pathParams: import("@angular/router").Params;
|
|
488
|
-
};
|
|
489
|
-
/**
|
|
490
|
-
* Formats a number as currency using the current locale.
|
|
491
|
-
* @param amount - The amount to format.
|
|
492
|
-
* @param currency - The currency code (default is a space for generic formatting).
|
|
493
|
-
* @returns The formatted currency string.
|
|
494
|
-
* @example
|
|
495
|
-
* utilityService.moneyParser(1000, 'USD'); // "$1,000.00"
|
|
496
|
-
*/
|
|
497
|
-
moneyParser: (amount: string | number, currency?: string) => string;
|
|
498
|
-
/**
|
|
499
|
-
* Extracts uploaded files from an input event.
|
|
500
|
-
* @param event - The file input event.
|
|
501
|
-
* @returns An array of uploaded files, or an empty array if none found.
|
|
502
|
-
* @example
|
|
503
|
-
* const files = utilityService.extractUpload($event);
|
|
504
|
-
*/
|
|
505
|
-
extractUpload(event: any): File[];
|
|
506
|
-
/**
|
|
507
|
-
* Converts seconds to an object containing hours, minutes, and seconds.
|
|
508
|
-
* @param seconds - The total number of seconds.
|
|
509
|
-
* @returns An object with hours, mins, and secs properties.
|
|
510
|
-
* @example
|
|
511
|
-
* utilityService.secondsToHourMinSec(3661); // { hours: 1, mins: 1, secs: 1 }
|
|
512
|
-
*/
|
|
513
|
-
secondsToHourMinSec: (seconds: number) => {
|
|
514
|
-
hours: number;
|
|
515
|
-
mins: number;
|
|
516
|
-
secs: number;
|
|
517
|
-
};
|
|
518
|
-
/**
|
|
519
|
-
* Converts minutes to an object containing days, hours, and minutes.
|
|
520
|
-
* @param minutes - The total number of minutes.
|
|
521
|
-
* @returns An object with days, hours, and mins properties.
|
|
522
|
-
* @example
|
|
523
|
-
* utilityService.minutesToDayHourMin(1500); // { days: 1, hours: 1, mins: 0 }
|
|
524
|
-
*/
|
|
525
|
-
minutesToDayHourMin: (minutes: number) => {
|
|
526
|
-
days: number;
|
|
527
|
-
hours: number;
|
|
528
|
-
mins: number;
|
|
529
|
-
};
|
|
530
|
-
/**
|
|
531
|
-
* Converts minutes to a string in the format "D H:M".
|
|
532
|
-
* @param minutes - The total number of minutes.
|
|
533
|
-
* @returns A formatted string or null if input is falsy.
|
|
534
|
-
* @example
|
|
535
|
-
* utilityService.minutesToDayHourMinStr(1500); // "1 1:0"
|
|
536
|
-
*/
|
|
537
|
-
minutesToDayHourMinStr: (minutes: number) => string;
|
|
538
|
-
/**
|
|
539
|
-
* Converts minutes to a string in the format "Ddays Hhrs Mmins".
|
|
540
|
-
* @param minutes - The total number of minutes.
|
|
541
|
-
* @returns A formatted string or null if input is falsy.
|
|
542
|
-
* @example
|
|
543
|
-
* utilityService.minutesToDayHourMinStr2(1500); // "1days 1hrs 0mins"
|
|
544
|
-
*/
|
|
545
|
-
minutesToDayHourMinStr2: (minutes: number) => string;
|
|
546
|
-
/**
|
|
547
|
-
* Converts days, hours, and minutes to a string in the format "HH:MM".
|
|
548
|
-
* @param dys - Number of days.
|
|
549
|
-
* @param hrs - Number of hours.
|
|
550
|
-
* @param mins - Number of minutes.
|
|
551
|
-
* @returns A string in the format "HH:MM" or an empty string if all inputs are falsy.
|
|
552
|
-
* @example
|
|
553
|
-
* utilityService.dayHourMinToHourMinutes(1, 2, 30); // "26:30"
|
|
554
|
-
*/
|
|
555
|
-
dayHourMinToHourMinutes: (dys: number, hrs: number, mins: number) => string;
|
|
556
|
-
/**
|
|
557
|
-
* Enables or disables a collection of form controls
|
|
558
|
-
* @param controls Array of AbstractControls to enable or disable
|
|
559
|
-
* @param disable Whether to disable (true) or enable (false) the controls
|
|
560
|
-
*/
|
|
561
|
-
disableOrEnableInputs: (controls: AbstractControl[], disable: boolean) => void;
|
|
562
|
-
/**
|
|
563
|
-
* Disables a collection of form controls
|
|
564
|
-
* @param controls Array of AbstractControls to disable
|
|
565
|
-
*/
|
|
566
|
-
disableInputs: (controls: AbstractControl[]) => void;
|
|
567
|
-
/**
|
|
568
|
-
* Enables a collection of form controls
|
|
569
|
-
* @param controls Array of AbstractControls to enable
|
|
570
|
-
*/
|
|
571
|
-
enableInputs: (controls: AbstractControl[]) => void;
|
|
572
|
-
/**
|
|
573
|
-
* Converts days, hours, and minutes to total minutes
|
|
574
|
-
* @param dys Number of days
|
|
575
|
-
* @param hrs Number of hours
|
|
576
|
-
* @param mins Number of minutes
|
|
577
|
-
* @returns Total minutes or 0 if all inputs are falsy
|
|
578
|
-
*/
|
|
579
|
-
dayHourMinToMinutes: (dys: number, hrs: number, mins: number) => number;
|
|
580
|
-
/**
|
|
581
|
-
* Converts hours and minutes to total minutes
|
|
582
|
-
* @param hrs Number of hours
|
|
583
|
-
* @param mins Number of minutes
|
|
584
|
-
* @returns Total minutes or null if both inputs are falsy
|
|
585
|
-
*/
|
|
586
|
-
hourMinToMinutes: (hrs: number, mins: number) => number;
|
|
587
|
-
/**
|
|
588
|
-
* Converts a time string in format "HH:MM" to total minutes
|
|
589
|
-
* @param hrsMins Time string in format "HH:MM"
|
|
590
|
-
* @returns Total minutes
|
|
591
|
-
*/
|
|
592
|
-
hourMinToMinutes2: (hrsMins: string) => number;
|
|
593
|
-
/**
|
|
594
|
-
* Displays a notification message
|
|
595
|
-
* @param message Message to display
|
|
596
|
-
* @param cls Notification type: 0=error, 1=success, 2=info, 3=warning
|
|
597
|
-
* @param duration Duration in milliseconds
|
|
598
|
-
* @param title Optional title for the notification
|
|
599
|
-
* @returns Object with closed observable
|
|
600
|
-
* @example
|
|
601
|
-
* // Success notification
|
|
602
|
-
* utilityService.notify('Profile updated successfully', 1);
|
|
603
|
-
*
|
|
604
|
-
* // Error notification with custom duration
|
|
605
|
-
* utilityService.notify('Failed to save changes', 0, 10000);
|
|
606
|
-
*
|
|
607
|
-
* // Info notification with title
|
|
608
|
-
* utilityService.notify('Your session will expire in 5 minutes', 2, 5000, 'Session Expiry');
|
|
609
|
-
*/
|
|
610
|
-
notify(message: string, cls?: 0 | 1 | 2 | 3, duration?: number, title?: string): {
|
|
611
|
-
closed: import("rxjs").Subject<{
|
|
612
|
-
manuallyClosed: boolean;
|
|
613
|
-
}>;
|
|
614
|
-
};
|
|
615
|
-
/**
|
|
616
|
-
* Scrolls the window to the top
|
|
617
|
-
*/
|
|
618
|
-
scrollToTop: () => void;
|
|
619
|
-
/**
|
|
620
|
-
* Gets the current date and time in a format suitable for datetime-local inputs
|
|
621
|
-
* @returns Current datetime in ISO format without timezone
|
|
622
|
-
*/
|
|
623
|
-
getLocalDateTimeNow: () => string;
|
|
624
|
-
/** @returns The current date local that can be used to set the date input */
|
|
625
|
-
localDateNow: () => string;
|
|
626
|
-
/**
|
|
627
|
-
* Formats a date in various formats
|
|
628
|
-
* @param date Date to format
|
|
629
|
-
* @param format Format option: 1=toDateString, 2=DD Month, 3=EEE MMM DD YYYY, hh:mm aa, 4=Month DD
|
|
630
|
-
* @returns Formatted date string or null if date is falsy
|
|
631
|
-
*/
|
|
632
|
-
dateFormat: (date: any, format?: number) => string;
|
|
633
|
-
/**
|
|
634
|
-
* Converts an ISO date string to Java date string format
|
|
635
|
-
* @param isoDateString ISO date string, defaults to current date
|
|
636
|
-
* @returns Date string in Java format or null if input is falsy
|
|
637
|
-
*/
|
|
638
|
-
toJavaDateString: (isoDateString?: string) => string;
|
|
639
|
-
/**
|
|
640
|
-
* Converts a date string to Java datetime format
|
|
641
|
-
* @param isoDateString Date string to convert
|
|
642
|
-
* @returns Datetime string in Java format or null if input is falsy
|
|
643
|
-
*/
|
|
644
|
-
toJavaDatetimeString: (isoDateString: string) => string;
|
|
645
|
-
/**
|
|
646
|
-
* Formats a time string by removing seconds
|
|
647
|
-
* @param time Time string to format
|
|
648
|
-
* @returns Formatted time string
|
|
649
|
-
*/
|
|
650
|
-
timeFormat: (time?: any) => string;
|
|
651
|
-
/**
|
|
652
|
-
* Formats a timestamp as a full date and time
|
|
653
|
-
* @param timestamp Timestamp to format
|
|
654
|
-
* @returns Formatted date and time string
|
|
655
|
-
*/
|
|
656
|
-
fullDateTime: (timestamp: string | number) => string;
|
|
657
|
-
/**
|
|
658
|
-
* Formats a number of days into years, months, and days
|
|
659
|
-
* @param days Number of days to format
|
|
660
|
-
* @returns Formatted string or "-" if days is falsy
|
|
661
|
-
*/
|
|
662
|
-
daysFormatter: (days: number) => string;
|
|
663
|
-
/**
|
|
664
|
-
* Formats a number of months into years and months
|
|
665
|
-
* @param months Number of months to format
|
|
666
|
-
* @returns Formatted string or "-" if months is falsy
|
|
667
|
-
*/
|
|
668
|
-
monthsFormatter: (months: number) => string;
|
|
669
|
-
/**
|
|
670
|
-
* Adds appropriate plural suffix to a value
|
|
671
|
-
* @param val Numeric value
|
|
672
|
-
* @param txt Singular text
|
|
673
|
-
* @param plural Optional plural text (defaults to txt + 's')
|
|
674
|
-
* @returns Formatted string with value and appropriate suffix
|
|
675
|
-
*/
|
|
676
|
-
pluarlizer: (val: number, txt: string, plural?: string) => string;
|
|
677
|
-
/**
|
|
678
|
-
* Converts a decimal to percentage string
|
|
679
|
-
* @param dec Decimal value to convert
|
|
680
|
-
* @returns Percentage string
|
|
681
|
-
*/
|
|
682
|
-
decimalToPercentage: (dec: number) => string;
|
|
683
|
-
/**
|
|
684
|
-
* Logs form details to console
|
|
685
|
-
* @param form Form to log
|
|
686
|
-
*/
|
|
687
|
-
logForm: (form: any) => void;
|
|
688
|
-
/**
|
|
689
|
-
* Converts data to CSV and triggers download
|
|
690
|
-
* @param data Array of data objects
|
|
691
|
-
* @param headerNames Array of header names
|
|
692
|
-
* @param filename Filename for the downloaded file
|
|
693
|
-
*/
|
|
694
|
-
toCSV(data: any[], headerNames: string[], filename: string): void;
|
|
695
|
-
/**
|
|
696
|
-
* Checks if a filename has a picture format extension
|
|
697
|
-
* @param fileName Filename to check
|
|
698
|
-
* @returns True if filename has a picture format extension
|
|
699
|
-
*/
|
|
700
|
-
isPictureFormat(fileName: string): boolean;
|
|
701
|
-
/**
|
|
702
|
-
* Converts an object to an array of its values
|
|
703
|
-
* @param obj Object to convert
|
|
704
|
-
* @returns Array of object values
|
|
705
|
-
*/
|
|
706
|
-
objectToArray<T>(obj: any): T[];
|
|
707
|
-
/**
|
|
708
|
-
* Formats a field name to title case
|
|
709
|
-
* @param field Field name to format
|
|
710
|
-
* @returns Formatted field name
|
|
711
|
-
*/
|
|
712
|
-
formatField(field: string): string;
|
|
713
|
-
/**
|
|
714
|
-
* Uses a web worker to perform a task
|
|
715
|
-
* @param worker Web worker object
|
|
716
|
-
* @param inputData Data to pass to the web worker
|
|
717
|
-
* @param conditions Optional conditions for stopping or error handling
|
|
718
|
-
* @returns Observable of worker results
|
|
719
|
-
*/
|
|
720
|
-
useWebWorker<T = any>(worker: Worker, inputData: any, conditions?: {
|
|
721
|
-
stop: (res: any) => boolean;
|
|
722
|
-
error: (res: any) => boolean;
|
|
723
|
-
}): Observable<T>;
|
|
724
|
-
/**
|
|
725
|
-
* Creates a function that trims text to a specified length
|
|
726
|
-
* @param length Maximum length before trimming
|
|
727
|
-
* @returns Function that trims text
|
|
728
|
-
*/
|
|
729
|
-
trim: (length?: number) => (text: string | undefined) => string;
|
|
730
|
-
/**
|
|
731
|
-
* Converts an array to CSV and triggers download
|
|
732
|
-
* @param data Array of data objects
|
|
733
|
-
* @param filename Filename for the downloaded file
|
|
734
|
-
* @param headerMap Optional column definitions
|
|
735
|
-
* @param extraConfig Optional configuration
|
|
736
|
-
*/
|
|
737
|
-
arrayToCSV(data: any[], filename: string, headerMap?: TableCol[], extraConfig?: {
|
|
738
|
-
prefix?: string;
|
|
739
|
-
hideHeader?: boolean;
|
|
740
|
-
hideNotification?: boolean;
|
|
741
|
-
}): Promise<void>;
|
|
742
|
-
/**
|
|
743
|
-
* Type casting helper
|
|
744
|
-
* @param value Value to cast
|
|
745
|
-
* @returns The same value with type information
|
|
746
|
-
*/
|
|
747
|
-
typeCaster: <T>(value: T) => T;
|
|
748
|
-
/**
|
|
749
|
-
* Joins multiple CSV strings with newlines
|
|
750
|
-
* @param CSVs CSV strings to join
|
|
751
|
-
* @returns Combined CSV string
|
|
752
|
-
*/
|
|
753
|
-
joinCSVRows(...CSVs: string[]): string;
|
|
754
|
-
/**
|
|
755
|
-
* Converts an array to a CSV string
|
|
756
|
-
* @param data Array of data objects
|
|
757
|
-
* @param headerMap Optional column definitions
|
|
758
|
-
* @param extraConfig Optional configuration
|
|
759
|
-
* @returns CSV string
|
|
760
|
-
*/
|
|
761
|
-
arrayToCSVString<T = any>(data: T[], headerMap?: TableCol<T>[], extraConfig?: {
|
|
762
|
-
prefix?: string;
|
|
763
|
-
hideHeader?: boolean;
|
|
764
|
-
}): Promise<string>;
|
|
765
|
-
/**
|
|
766
|
-
* Checks if a value is a date string in YYYY-MM-DD format
|
|
767
|
-
* @param v Value to check
|
|
768
|
-
* @returns True if value is a date string
|
|
769
|
-
*/
|
|
770
|
-
isDateValue: (v: any) => boolean;
|
|
771
|
-
/**
|
|
772
|
-
* Checks if a value is a datetime string in ISO format
|
|
773
|
-
* @param v Value to check
|
|
774
|
-
* @returns True if value is a datetime string
|
|
775
|
-
*/
|
|
776
|
-
isDatTimeValue: (v: any) => boolean;
|
|
777
|
-
/**
|
|
778
|
-
* Formats a boolean value as a colored "Yes" or "No" HTML span
|
|
779
|
-
* @param v Boolean value to format
|
|
780
|
-
* @returns HTML string with appropriate styling
|
|
781
|
-
*/
|
|
782
|
-
yesNoCellFormatterColoured: (v: any) => string;
|
|
783
|
-
/**
|
|
784
|
-
* Formats a boolean value as "Yes" or "No"
|
|
785
|
-
* @param v Boolean value to format
|
|
786
|
-
* @returns "Yes" or "No" string
|
|
787
|
-
*/
|
|
788
|
-
yesNoCellFormatter: (v: any) => string;
|
|
789
|
-
/**
|
|
790
|
-
* Formats a status value as a colored HTML span
|
|
791
|
-
* @param status Status value to format
|
|
792
|
-
* @returns HTML string with appropriate styling
|
|
793
|
-
*/
|
|
794
|
-
statusCellFormatter: (status: Status) => string;
|
|
795
|
-
/**
|
|
796
|
-
* Creates a formatter function that applies styling based on value
|
|
797
|
-
* @param guide Object defining values for different styles
|
|
798
|
-
* @returns Formatter function that returns styled HTML
|
|
799
|
-
*/
|
|
800
|
-
cellStatusFormatter: <T = any>(guide: {
|
|
801
|
-
successVal?: T;
|
|
802
|
-
pendingVal?: T;
|
|
803
|
-
errorVal?: T;
|
|
804
|
-
inertVal?: T;
|
|
805
|
-
}) => (v: any) => string;
|
|
806
|
-
/**
|
|
807
|
-
* Generates a UUID
|
|
808
|
-
*/
|
|
809
|
-
generateUUID: () => string;
|
|
810
|
-
/**
|
|
811
|
-
* Shows an information dialog
|
|
812
|
-
* @param text Text to display
|
|
813
|
-
* @param status Optional status: 0=error, 1=success, 2=info
|
|
814
|
-
* @param heading Optional dialog heading
|
|
815
|
-
* @param btns Optional buttons configuration
|
|
816
|
-
* @param disableClose Whether to disable dialog closing
|
|
817
|
-
* @returns Promise resolving to boolean indicating user action
|
|
818
|
-
*/
|
|
819
|
-
info: (text: string, status?: 0 | 2 | 1, heading?: string, btns?: IInfoDialogBtn[], disableClose?: boolean) => Promise<boolean>;
|
|
820
|
-
/**
|
|
821
|
-
* Creates a debounced function
|
|
822
|
-
*/
|
|
823
|
-
debouncer: (config: {
|
|
824
|
-
uniqueKey: string;
|
|
825
|
-
callback: () => any;
|
|
826
|
-
}) => void;
|
|
827
|
-
/**
|
|
828
|
-
* Creates an async validator
|
|
829
|
-
*/
|
|
830
|
-
asyncValidation: <TData extends {
|
|
831
|
-
response?: boolean;
|
|
832
|
-
} = any>(config: {
|
|
833
|
-
uniqueKey: string;
|
|
834
|
-
callback: () => Promise<TData>;
|
|
835
|
-
validationError?: import("../Shared/models/index.model").CustomValidationError;
|
|
836
|
-
}) => Promise<import("../Shared/models/index.model").CustomValidationError>;
|
|
837
|
-
/**
|
|
838
|
-
* Starts the page loader
|
|
839
|
-
*/
|
|
840
|
-
startPl: (value?: number) => number;
|
|
841
|
-
/**
|
|
842
|
-
* Stops the page loader
|
|
843
|
-
*/
|
|
844
|
-
stopPl: (value?: number) => number;
|
|
845
|
-
/**
|
|
846
|
-
* Creates a subscription manager to handle multiple subscriptions
|
|
847
|
-
* @param subs Initial subscriptions
|
|
848
|
-
* @returns Object with methods to manage subscriptions
|
|
849
|
-
* @example
|
|
850
|
-
* // Create a subscription manager
|
|
851
|
-
* const subManager = utilityService.createSubscriptionManager();
|
|
852
|
-
*
|
|
853
|
-
* // Add subscriptions to the manager
|
|
854
|
-
* subManager.push(
|
|
855
|
-
* this.dataService.getData().subscribe(data => this.data = data),
|
|
856
|
-
* this.userService.getUser().subscribe(user => this.user = user)
|
|
857
|
-
* );
|
|
858
|
-
*
|
|
859
|
-
* // Later, clear all subscriptions at once (e.g., in ngOnDestroy)
|
|
860
|
-
* ngOnDestroy() {
|
|
861
|
-
* subManager.clear();
|
|
862
|
-
* }
|
|
863
|
-
*/
|
|
864
|
-
createSubscriptionManager: (...subs: Subscription[]) => {
|
|
865
|
-
clear: () => void;
|
|
866
|
-
push: (...subs: Subscription[]) => number;
|
|
867
|
-
subs: () => Subscription[];
|
|
868
|
-
};
|
|
869
|
-
/**
|
|
870
|
-
* Creates a cache manager for storing and retrieving data
|
|
871
|
-
* @param config Configuration options
|
|
872
|
-
* @returns Object with methods to manage the cache
|
|
873
|
-
* @example
|
|
874
|
-
* // Create a cache for user data with custom key function
|
|
875
|
-
* const userCache = utilityService.createCacheManager<User, number>({
|
|
876
|
-
* keyer: (userId) => `user_${userId}`,
|
|
877
|
-
* maxSize: 50 // Store up to 50 users
|
|
878
|
-
* });
|
|
879
|
-
*
|
|
880
|
-
* // Save data to cache
|
|
881
|
-
* userCache.save(123, { id: 123, name: 'John Doe', email: 'john@example.com' });
|
|
882
|
-
*
|
|
883
|
-
* // Retrieve data from cache
|
|
884
|
-
* const user = userCache.get(123);
|
|
885
|
-
*
|
|
886
|
-
* // Clear cache when needed
|
|
887
|
-
* userCache.clear();
|
|
888
|
-
*/
|
|
889
|
-
createCacheManager: <TData = any, TKey = any>(config: {
|
|
890
|
-
keyer?: (item: TKey) => string;
|
|
891
|
-
maxSize?: number;
|
|
892
|
-
}) => {
|
|
893
|
-
clear: () => void;
|
|
894
|
-
destroy: () => void;
|
|
895
|
-
get: (key: TKey) => TData;
|
|
896
|
-
save: (key: string | number | TKey, data: TData) => void;
|
|
897
|
-
cache: () => {
|
|
898
|
-
[key: string]: {
|
|
899
|
-
item: TData;
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
};
|
|
903
|
-
/**
|
|
904
|
-
* Track by function that uses a custom ID field
|
|
905
|
-
* @param index Index of the item
|
|
906
|
-
* @param item Item to track
|
|
907
|
-
* @returns Custom ID for the item
|
|
908
|
-
*/
|
|
909
|
-
trackByCustomID: (index: any, item: any) => any;
|
|
910
|
-
/**
|
|
911
|
-
* Track by function for form groups
|
|
912
|
-
* @param index Index of the form group
|
|
913
|
-
* @param item Form group to track
|
|
914
|
-
* @returns Custom ID for the form group
|
|
915
|
-
*/
|
|
916
|
-
trackByForForms: (index: any, item: FormGroup) => any;
|
|
917
|
-
/**
|
|
918
|
-
* Converts an object to a FormGroup
|
|
919
|
-
* @param data Object to convert
|
|
920
|
-
* @returns FormGroup with controls for each object property
|
|
921
|
-
*/
|
|
922
|
-
objectToFormGroup: <T>(data: T) => FormGroup<IStrictFormGroup<T>>;
|
|
923
|
-
/**
|
|
924
|
-
* Converts a form schema to a FormGroup
|
|
925
|
-
* @param schema Form schema definition
|
|
926
|
-
* @param data Optional initial data
|
|
927
|
-
* @returns FormGroup built from the schema
|
|
928
|
-
*/
|
|
929
|
-
formSchemaToFormGroup: <T extends {
|
|
930
|
-
[x: string]: any;
|
|
931
|
-
}>(schema: IFormSchema[], data?: T) => FormGroup<IStrictFormGroup<T>>;
|
|
932
|
-
/**
|
|
933
|
-
* Times the execution of a code block
|
|
934
|
-
* @param label Label for the timing log
|
|
935
|
-
* @param cb Callback function to execute and time
|
|
936
|
-
* @returns Result of the callback function
|
|
937
|
-
* @example
|
|
938
|
-
* // Time a data processing function
|
|
939
|
-
* const processedData = utilityService.timeCodeBlock('Process user data', () => {
|
|
940
|
-
* const result = [];
|
|
941
|
-
* for (let i = 0; i < 10000; i++) {
|
|
942
|
-
* result.push(this.processUserData(this.users[i]));
|
|
943
|
-
* }
|
|
944
|
-
* return result;
|
|
945
|
-
* });
|
|
946
|
-
* // Console output: "Process user data 1621234567890 1621234568920 1.03sec"
|
|
947
|
-
*/
|
|
948
|
-
timeCodeBlock: <T>(label: string, cb: () => T) => T;
|
|
949
|
-
/**
|
|
950
|
-
* Removes null, undefined, and empty string fields from an object
|
|
951
|
-
* @param obj Object to clean
|
|
952
|
-
* @returns New object without null, undefined, or empty string fields
|
|
953
|
-
* @example
|
|
954
|
-
* const userData = {
|
|
955
|
-
* name: 'John',
|
|
956
|
-
* email: 'john@example.com',
|
|
957
|
-
* phone: '',
|
|
958
|
-
* address: null,
|
|
959
|
-
* age: 30
|
|
960
|
-
* };
|
|
961
|
-
*
|
|
962
|
-
* const cleanData = utilityService.deleteNull(userData);
|
|
963
|
-
* // cleanData = { name: 'John', email: 'john@example.com', age: 30 }
|
|
964
|
-
*/
|
|
965
|
-
deleteNull: <T>(obj: T) => T;
|
|
966
|
-
/**
|
|
967
|
-
* Conditionally executes an observable-returning function based on request value
|
|
968
|
-
* @param req The request parameter to check
|
|
969
|
-
* @param observable Function that returns an Observable when given the request
|
|
970
|
-
* @returns The Observable from the function if req has a value, otherwise an Observable of null
|
|
971
|
-
* @template Q Request parameter type
|
|
972
|
-
* @template R Observable response type
|
|
973
|
-
*/
|
|
974
|
-
nullRequestHandler: <Q, R>(req: Q, observable: (q: Q) => Observable<R>) => Observable<R>;
|
|
975
|
-
/**
|
|
976
|
-
* Handles errors from Angular's ResourceRef by displaying an error message
|
|
977
|
-
* @param res The ResourceRef object to check for errors
|
|
978
|
-
* @template T The type of data in the ResourceRef
|
|
979
|
-
*/
|
|
980
|
-
resouceErrorHandler: <T>(res: ResourceRef<T>) => void;
|
|
981
|
-
/**
|
|
982
|
-
* Formats a time duration in milliseconds to hours, minutes, and seconds
|
|
983
|
-
* @param timeTaken Time in milliseconds
|
|
984
|
-
* @returns Formatted time string
|
|
985
|
-
*/
|
|
986
|
-
formatTimeTaken: (timeTaken: number) => string;
|
|
987
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<UtilityService<any>, never>;
|
|
988
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<UtilityService<any>>;
|
|
989
|
-
}
|