clr-lift 0.4.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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/esm2022/clr-lift.mjs +5 -0
  4. package/esm2022/lib/components/alert/alert.component.mjs +31 -0
  5. package/esm2022/lib/components/alerts/alert-container.component.mjs +28 -0
  6. package/esm2022/lib/components/alerts/alert.l10n.mjs +36 -0
  7. package/esm2022/lib/components/alerts/alert.service.mjs +77 -0
  8. package/esm2022/lib/components/alerts/alert.type.mjs +2 -0
  9. package/esm2022/lib/components/alerts/index.mjs +3 -0
  10. package/esm2022/lib/components/callout/callout.component.mjs +11 -0
  11. package/esm2022/lib/components/index.mjs +11 -0
  12. package/esm2022/lib/components/key-value-inputs/index.mjs +3 -0
  13. package/esm2022/lib/components/key-value-inputs/key-value-form-group.type.mjs +2 -0
  14. package/esm2022/lib/components/key-value-inputs/key-value-inputs.component.mjs +110 -0
  15. package/esm2022/lib/components/key-value-inputs/key-value.l10n.mjs +99 -0
  16. package/esm2022/lib/components/page-container/page-container.component.mjs +22 -0
  17. package/esm2022/lib/components/spinner/spinner.component.mjs +26 -0
  18. package/esm2022/lib/components/theme-toggle/theme-toggle.component.mjs +58 -0
  19. package/esm2022/lib/components/theme-toggle/theme-toggle.l10n.mjs +69 -0
  20. package/esm2022/lib/components/timeline-wizard/index.mjs +5 -0
  21. package/esm2022/lib/components/timeline-wizard/timeline-base.component.mjs +105 -0
  22. package/esm2022/lib/components/timeline-wizard/timeline-step.type.mjs +2 -0
  23. package/esm2022/lib/components/timeline-wizard/timeline-wizard.component.mjs +306 -0
  24. package/esm2022/lib/components/timeline-wizard/timeline-wizard.l10n.mjs +75 -0
  25. package/esm2022/lib/components/timeline-wizard/timeline-wizard.service.mjs +60 -0
  26. package/esm2022/lib/components/toast/index.mjs +5 -0
  27. package/esm2022/lib/components/toast/toast-container.component.mjs +53 -0
  28. package/esm2022/lib/components/toast/toast.component.mjs +377 -0
  29. package/esm2022/lib/components/toast/toast.l10n.mjs +94 -0
  30. package/esm2022/lib/components/toast/toast.service.mjs +63 -0
  31. package/esm2022/lib/components/toast/toast.type.mjs +2 -0
  32. package/esm2022/lib/components/tooltip/index.mjs +4 -0
  33. package/esm2022/lib/components/tooltip/positioning-tooltip.directive.mjs +48 -0
  34. package/esm2022/lib/components/tooltip/tooltip.component.mjs +103 -0
  35. package/esm2022/lib/components/tooltip/tooltip.directive.mjs +201 -0
  36. package/esm2022/lib/components/tooltip/tooltip.model.mjs +2 -0
  37. package/esm2022/lib/components/tooltip/tooltip.module.mjs +17 -0
  38. package/esm2022/lib/components/tooltip/tooltip.util.mjs +93 -0
  39. package/esm2022/lib/models/index.mjs +3 -0
  40. package/esm2022/lib/models/page-query.type.mjs +2 -0
  41. package/esm2022/lib/models/rde.type.mjs +2 -0
  42. package/esm2022/lib/operators/dg-state.operator.mjs +18 -0
  43. package/esm2022/lib/operators/index.mjs +2 -0
  44. package/esm2022/lib/pipes/translate.pipe.mjs +22 -0
  45. package/esm2022/lib/services/translation.service.mjs +49 -0
  46. package/esm2022/lib/shared/animation.const.mjs +52 -0
  47. package/esm2022/lib/utils/clr-datagrid.util.mjs +99 -0
  48. package/esm2022/lib/utils/index.mjs +2 -0
  49. package/esm2022/public-api.mjs +8 -0
  50. package/fesm2022/clr-lift.mjs +2307 -0
  51. package/fesm2022/clr-lift.mjs.map +1 -0
  52. package/index.d.ts +5 -0
  53. package/lib/components/alert/alert.component.d.ts +12 -0
  54. package/lib/components/alerts/alert-container.component.d.ts +19 -0
  55. package/lib/components/alerts/alert.l10n.d.ts +1 -0
  56. package/lib/components/alerts/alert.service.d.ts +32 -0
  57. package/lib/components/alerts/alert.type.d.ts +37 -0
  58. package/lib/components/alerts/index.d.ts +3 -0
  59. package/lib/components/callout/callout.component.d.ts +5 -0
  60. package/lib/components/index.d.ts +10 -0
  61. package/lib/components/key-value-inputs/index.d.ts +2 -0
  62. package/lib/components/key-value-inputs/key-value-form-group.type.d.ts +5 -0
  63. package/lib/components/key-value-inputs/key-value-inputs.component.d.ts +33 -0
  64. package/lib/components/key-value-inputs/key-value.l10n.d.ts +1 -0
  65. package/lib/components/page-container/page-container.component.d.ts +7 -0
  66. package/lib/components/spinner/spinner.component.d.ts +8 -0
  67. package/lib/components/theme-toggle/theme-toggle.component.d.ts +20 -0
  68. package/lib/components/theme-toggle/theme-toggle.l10n.d.ts +1 -0
  69. package/lib/components/timeline-wizard/index.d.ts +4 -0
  70. package/lib/components/timeline-wizard/timeline-base.component.d.ts +80 -0
  71. package/lib/components/timeline-wizard/timeline-step.type.d.ts +36 -0
  72. package/lib/components/timeline-wizard/timeline-wizard.component.d.ts +71 -0
  73. package/lib/components/timeline-wizard/timeline-wizard.l10n.d.ts +1 -0
  74. package/lib/components/timeline-wizard/timeline-wizard.service.d.ts +37 -0
  75. package/lib/components/toast/index.d.ts +4 -0
  76. package/lib/components/toast/toast-container.component.d.ts +29 -0
  77. package/lib/components/toast/toast.component.d.ts +38 -0
  78. package/lib/components/toast/toast.l10n.d.ts +1 -0
  79. package/lib/components/toast/toast.service.d.ts +29 -0
  80. package/lib/components/toast/toast.type.d.ts +16 -0
  81. package/lib/components/tooltip/index.d.ts +3 -0
  82. package/lib/components/tooltip/positioning-tooltip.directive.d.ts +9 -0
  83. package/lib/components/tooltip/tooltip.component.d.ts +25 -0
  84. package/lib/components/tooltip/tooltip.directive.d.ts +64 -0
  85. package/lib/components/tooltip/tooltip.model.d.ts +1 -0
  86. package/lib/components/tooltip/tooltip.module.d.ts +8 -0
  87. package/lib/components/tooltip/tooltip.util.d.ts +39 -0
  88. package/lib/models/index.d.ts +2 -0
  89. package/lib/models/page-query.type.d.ts +26 -0
  90. package/lib/models/rde.type.d.ts +75 -0
  91. package/lib/operators/dg-state.operator.d.ts +9 -0
  92. package/lib/operators/index.d.ts +1 -0
  93. package/lib/pipes/translate.pipe.d.ts +8 -0
  94. package/lib/services/translation.service.d.ts +10 -0
  95. package/lib/shared/animation.const.d.ts +34 -0
  96. package/lib/utils/clr-datagrid.util.d.ts +32 -0
  97. package/lib/utils/index.d.ts +1 -0
  98. package/package.json +29 -0
  99. package/public-api.d.ts +4 -0
@@ -0,0 +1,33 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { AbstractControl, FormArray, NonNullableFormBuilder } from '@angular/forms';
3
+ import { TranslationService } from '../../services/translation.service';
4
+ import { KeyValueFormGroup } from './key-value-form-group.type';
5
+ import * as i0 from "@angular/core";
6
+ export declare class KeyValueInputsComponent implements OnInit {
7
+ private translationService;
8
+ private fb;
9
+ formArray: FormArray<KeyValueFormGroup> | undefined;
10
+ data: {
11
+ key: string;
12
+ value: string;
13
+ }[];
14
+ uniqueKey: boolean;
15
+ keyHelper: string;
16
+ valueHelper: string;
17
+ addText: string;
18
+ inputSize: number;
19
+ isSmallButton: boolean;
20
+ removeKeyValue: EventEmitter<number>;
21
+ addKeyValue: EventEmitter<void>;
22
+ constructor(translationService: TranslationService, fb: NonNullableFormBuilder);
23
+ removeKeyValuePair(index: number): void;
24
+ addKeyValuePair(): void;
25
+ _validateKeyControl(index: number): void;
26
+ validateKeyControl(control: AbstractControl): void;
27
+ ngOnInit(): void;
28
+ private validateAllKeyControls;
29
+ private addUniqueKeyValidator;
30
+ private initializeFormData;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeyValueInputsComponent, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<KeyValueInputsComponent, "cll-key-value-inputs", never, { "formArray": { "alias": "formArray"; "required": true; }; "data": { "alias": "data"; "required": false; }; "uniqueKey": { "alias": "uniqueKey"; "required": false; }; "keyHelper": { "alias": "keyHelper"; "required": false; }; "valueHelper": { "alias": "valueHelper"; "required": false; }; "addText": { "alias": "addText"; "required": false; }; "inputSize": { "alias": "inputSize"; "required": false; }; "isSmallButton": { "alias": "isSmallButton"; "required": false; }; }, { "removeKeyValue": "removeKeyValue"; "addKeyValue": "addKeyValue"; }, never, never, true, never>;
33
+ }
@@ -0,0 +1 @@
1
+ export declare const keyValueTranslations: Record<string, Record<string, string>>;
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PageContainerComponent {
3
+ title: string;
4
+ customClass: string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<PageContainerComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<PageContainerComponent, "cll-page-container", never, { "title": { "alias": "title"; "required": true; }; "customClass": { "alias": "class"; "required": false; }; }, {}, never, ["*"], true, never>;
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class SpinnerComponent {
3
+ size: 'lg' | 'md' | 'sm';
4
+ isCenter: boolean;
5
+ customClass: string;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpinnerComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpinnerComponent, "cll-spinner", never, { "size": { "alias": "size"; "required": false; }; "isCenter": { "alias": "isCenter"; "required": false; }; }, {}, never, never, true, never>;
8
+ }
@@ -0,0 +1,20 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { TranslationService } from '../../services/translation.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ThemeToggleComponent implements OnInit {
5
+ private translationService;
6
+ lang: string;
7
+ changeTheme: EventEmitter<string>;
8
+ hovering: boolean;
9
+ theme: 'dark' | 'light';
10
+ get themeDisplayName(): string;
11
+ get ariaLabel(): string;
12
+ get iconShape(): "moon" | "sun";
13
+ constructor(translationService: TranslationService);
14
+ toggleTheme(): void;
15
+ setHovering(value: boolean): void;
16
+ private setTheme;
17
+ ngOnInit(): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ThemeToggleComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThemeToggleComponent, "cll-theme-toggle", never, { "lang": { "alias": "lang"; "required": false; }; }, { "changeTheme": "changeTheme"; }, never, never, true, never>;
20
+ }
@@ -0,0 +1 @@
1
+ export declare const themeToggleTranslations: Record<string, Record<string, string>>;
@@ -0,0 +1,4 @@
1
+ export * from './timeline-base.component';
2
+ export * from './timeline-step.type';
3
+ export * from './timeline-wizard.component';
4
+ export * from './timeline-wizard.service';
@@ -0,0 +1,80 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * A base class that every step component should extend.
6
+ * This class provides a foundation for creating step components in a timeline-based wizard.
7
+ *
8
+ * Usage Example:
9
+ export class ConfigureDatabaseFormComponent extends TimelineBaseComponent implements AfterViewInit {
10
+ // Step-specific form definition
11
+ override form = new FormGroup({
12
+ database: new FormControl('', {
13
+ validators: [Validators.required],
14
+ asyncValidators: [validateDatabaseNameAvailability(inject(HttpClient))],
15
+ }),
16
+ });
17
+
18
+ private timelineWizardService = inject(TimelineWizardService);
19
+ stepData = this.timelineWizardService.getStepData<{database: string}>('configure-database-step-title-or-id');
20
+
21
+ // Clicking the next button triggers a POST request. Use timelineWizard service data
22
+ override next$ = inject(HttpClient).post(`/your/api`, {data: this.stepData.data});
23
+
24
+ // Clicking the next button triggers a POST request. Use component @Input data, need defer for data to be available
25
+ override next$ = defer(() => inject(HttpClient).post(`/your/api`, {data: this.currentStep.data}));
26
+
27
+ ngAfterViewInit() {
28
+ // For async validators' controls, run below because moving between steps needs to update status.
29
+ this.form.controls.database.updateValueAndValidity();
30
+ }
31
+ }
32
+
33
+ // Asynchronously validates the uniqueness of the database name using an HTTP request.
34
+ function validateDatabaseNameAvailability(http: HttpClient): AsyncValidatorFn {
35
+ return (control: AbstractControl): Observable<ValidationErrors | null> => {
36
+ const databaseName = control.value;
37
+
38
+ // Return null if the input is empty (no validation needed)
39
+ if (!databaseName) {
40
+ return of(null);
41
+ }
42
+
43
+ return control.valueChanges.pipe(
44
+ debounceTime(300), // Adjust the debounce time as needed
45
+ first(),
46
+ switchMap((databaseName) => {
47
+ return http.get(`https://randomuser.me/api?q=${databaseName}`).pipe(
48
+ map((isAvailable) => (isAvailable ? null : { databaseNameTaken: true })),
49
+ catchError(() => of({ databaseNameTaken: true })),
50
+ );
51
+ }),
52
+ );
53
+ };
54
+ }
55
+ */
56
+ export declare abstract class TimelineBaseComponent<StepData = unknown> {
57
+ allStepsData: {
58
+ id: string;
59
+ data: StepData;
60
+ }[];
61
+ currentStepData: StepData | null;
62
+ form: FormGroup<any> | null;
63
+ next$: Observable<true | unknown>;
64
+ get stepInvalid(): boolean;
65
+ /**
66
+ * Converts the step's form value to data. The return value must be the same type as the data passed from timeline inputs.
67
+ * For a simple form, it defaults to emitting the step data form value.
68
+ * For a complex form, override this method and return the shape as the data type passed from timeline inputs.
69
+ * @returns Step data derived from the form value.
70
+ */
71
+ formValueToData(): any;
72
+ /**
73
+ * Converts step data to the form value that patchValue uses.
74
+ * @param data Step data, same as the API model.
75
+ * @returns Form value that can be used for patchValue.
76
+ */
77
+ dataToFormValue(data: any): any;
78
+ static ɵfac: i0.ɵɵFactoryDeclaration<TimelineBaseComponent<any>, never>;
79
+ static ɵcmp: i0.ɵɵComponentDeclaration<TimelineBaseComponent<any>, "ng-component", never, { "allStepsData": { "alias": "allStepsData"; "required": false; }; "currentStepData": { "alias": "currentStepData"; "required": false; }; }, {}, never, never, false, never>;
80
+ }
@@ -0,0 +1,36 @@
1
+ import { Type } from '@angular/core';
2
+ import { ClrTimelineStepDescription, ClrTimelineStepHeader, ClrTimelineStepState } from '@clr/angular';
3
+ import { TimelineBaseComponent } from './timeline-base.component';
4
+ /**
5
+ * Represents a step in a timeline.
6
+ */
7
+ export interface TimelineStep {
8
+ /**
9
+ * The state of the timeline step.
10
+ */
11
+ state: ClrTimelineStepState;
12
+ /**
13
+ * The header of the timeline step.
14
+ */
15
+ header?: ClrTimelineStepHeader;
16
+ /**
17
+ * The title of the timeline step, acting as an identifier (should be unique within the array).
18
+ */
19
+ title: string;
20
+ /**
21
+ * optional identifier of the timeline step.
22
+ */
23
+ id?: string;
24
+ /**
25
+ * The description of the timeline step.
26
+ */
27
+ description?: ClrTimelineStepDescription;
28
+ /**
29
+ * The component associated with the timeline step.
30
+ */
31
+ component: Type<TimelineBaseComponent>;
32
+ /**
33
+ * Step data, will be converted to form data by timeline wizard component, and write back whenever form changes.
34
+ */
35
+ data?: any;
36
+ }
@@ -0,0 +1,71 @@
1
+ import { HttpErrorResponse } from '@angular/common/http';
2
+ import { AfterViewInit, ChangeDetectorRef, ComponentRef, EventEmitter, ViewContainerRef } from '@angular/core';
3
+ import { TranslationService } from '../../services/translation.service';
4
+ import { TimelineBaseComponent } from './timeline-base.component';
5
+ import { TimelineStep } from './timeline-step.type';
6
+ import { TimelineWizardService } from './timeline-wizard.service';
7
+ import * as i0 from "@angular/core";
8
+ export declare class TimelineWizardComponent implements AfterViewInit {
9
+ private translationService;
10
+ private cdr;
11
+ timelineWizardService: TimelineWizardService;
12
+ container: ViewContainerRef;
13
+ /**
14
+ * Controls whether to destroy step components when clicking prev/next buttons.
15
+ * By default, live is false, and it will destroy the step component.
16
+ * If live is true, moving to a new step won't destroy the previous component.
17
+ */
18
+ live: boolean;
19
+ confirmButtonText: string;
20
+ set timelineSteps(value: TimelineStep[]);
21
+ confirmed: EventEmitter<any>;
22
+ canceled: EventEmitter<any>;
23
+ finished: EventEmitter<any>;
24
+ private componentRefMap;
25
+ private subscriptions;
26
+ private nextAction;
27
+ /**
28
+ * When clicking next/finish button:
29
+ * 1) Clear previous error, set state as PROCESSING.
30
+ * 2) Hook into the specific component's observable that could be either synchronous or asynchronous.
31
+ */
32
+ next$: import("rxjs").Observable<import("ngx-lift").AsyncState<unknown, HttpErrorResponse>>;
33
+ constructor(translationService: TranslationService, cdr: ChangeDetectorRef, timelineWizardService: TimelineWizardService);
34
+ get currentComponentRef(): ComponentRef<TimelineBaseComponent<unknown>>;
35
+ get currentStepFormInvalid(): boolean;
36
+ ngAfterViewInit(): void;
37
+ renderComponent(): void;
38
+ cancel(): void;
39
+ nextStep(): void;
40
+ previousStep(): void;
41
+ /**
42
+ * container.clear() will destroy the component, but we want to display the previous form data like clicking prev button.
43
+ * This function will save and populate data.
44
+ * each component's form data will be saved into the corresponding step. Again, steps are the single source of truth.
45
+ * If the last step is a review component, input all previous steps' data into it. So review component can display them and send API.
46
+ * @param cmpRef a component ref
47
+ */
48
+ private initComponent;
49
+ /**
50
+ * when clicking next/finish button, clear error (description = ''), set processing state
51
+ */
52
+ private beforeAsyncOperation;
53
+ /**
54
+ * set current step error
55
+ * @param err
56
+ */
57
+ private setStepAsError;
58
+ private finish;
59
+ /**
60
+ * Move to the next step in the process.
61
+ *
62
+ * This function changes the data source and updates the timeline. It should execute
63
+ * before any other logic because it changes the value of CURRENT, which affects
64
+ * the currentStepIndex.
65
+ *
66
+ * @return {void}
67
+ */
68
+ private moveToNextStep;
69
+ static ɵfac: i0.ɵɵFactoryDeclaration<TimelineWizardComponent, never>;
70
+ static ɵcmp: i0.ɵɵComponentDeclaration<TimelineWizardComponent, "cll-timeline-wizard", never, { "live": { "alias": "live"; "required": false; }; "confirmButtonText": { "alias": "confirmButtonText"; "required": false; }; "timelineSteps": { "alias": "timelineSteps"; "required": true; }; }, { "confirmed": "confirmed"; "canceled": "canceled"; "finished": "finished"; }, never, never, true, never>;
71
+ }
@@ -0,0 +1 @@
1
+ export declare const timelineWizardTranslations: Record<string, Record<string, string>>;
@@ -0,0 +1,37 @@
1
+ import { TimelineStep } from './timeline-step.type';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TimelineWizardService {
4
+ steps: TimelineStep[];
5
+ /**
6
+ * Get the index of the current step, error, or processing step, as they can appear once at a time as the current step.
7
+ * If all steps are finished, no currentStep any more.
8
+ */
9
+ get currentStepIndex(): number;
10
+ get isFirstStep(): boolean;
11
+ get isLastStep(): boolean;
12
+ /**
13
+ * Get the current step object.
14
+ */
15
+ get currentStep(): TimelineStep;
16
+ /**
17
+ * Get the data of the current step.
18
+ */
19
+ get currentStepData(): any;
20
+ /**
21
+ * Get all steps data to be reviewed. Usually, send it as payload for final submission.
22
+ * Each step is represented by an object with identifier (step id with higher priority or step title) and data (step data).
23
+ * If the last step is a review component which doesn't have a form, filter it out.
24
+ */
25
+ get allStepsData(): {
26
+ id: string;
27
+ data: any;
28
+ }[];
29
+ /**
30
+ * Get the data of a specific step by its title.
31
+ * @param key - The id or title of the step to retrieve.
32
+ * @throws Error if the step with the given title is not found.
33
+ */
34
+ getStepData<T>(key: string): T;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<TimelineWizardService, never>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<TimelineWizardService>;
37
+ }
@@ -0,0 +1,4 @@
1
+ export * from './toast.component';
2
+ export * from './toast.service';
3
+ export * from './toast.type';
4
+ export * from './toast-container.component';
@@ -0,0 +1,29 @@
1
+ import { ToastService } from './toast.service';
2
+ import { Toast } from './toast.type';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ToastContainerComponent {
5
+ private toastService;
6
+ timeoutSeconds: number;
7
+ manualClosable: boolean;
8
+ topOffset: number;
9
+ toasts$: import("rxjs").Observable<{
10
+ id: symbol;
11
+ title: string;
12
+ description: string;
13
+ toastType: "error" | "info" | "warning" | "success";
14
+ manualClosable?: boolean | undefined;
15
+ timeoutSeconds?: number | undefined;
16
+ primaryButtonText?: string | undefined;
17
+ secondaryButtonText?: string | undefined;
18
+ date?: string | undefined;
19
+ closed?: (() => void) | undefined;
20
+ primaryButtonClick?: (() => void) | undefined;
21
+ secondaryButtonClick?: (() => void) | undefined;
22
+ }[]>;
23
+ get top(): string;
24
+ constructor(toastService: ToastService);
25
+ trackById(index: number, item: Toast): symbol | undefined;
26
+ deleteToast(id: symbol): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastContainerComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToastContainerComponent, "cll-toast-container", never, { "timeoutSeconds": { "alias": "timeoutSeconds"; "required": false; }; "manualClosable": { "alias": "manualClosable"; "required": false; }; "topOffset": { "alias": "topOffset"; "required": false; }; }, {}, never, never, true, never>;
29
+ }
@@ -0,0 +1,38 @@
1
+ import { ElementRef, EventEmitter, NgZone, OnInit } from '@angular/core';
2
+ import { TranslationService } from '../../services/translation.service';
3
+ import { ToastType } from './toast.type';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ToastComponent implements OnInit {
6
+ private element;
7
+ private ngZone;
8
+ private translationService;
9
+ toastType: ToastType;
10
+ primaryButtonText: string;
11
+ secondaryButtonText: string;
12
+ manualClosable: boolean;
13
+ timeoutSeconds: number;
14
+ /**
15
+ * Emit when toast is closed, either by an explicit action of clicking on the X
16
+ * or after the auto close timeout. If the user clicked the X, the emission will be
17
+ * a boolean true, otherwise false.
18
+ */
19
+ closed: EventEmitter<boolean>;
20
+ primaryButtonClick: EventEmitter<any>;
21
+ secondaryButtonClick: EventEmitter<any>;
22
+ disableAutoClose: boolean;
23
+ animate: boolean;
24
+ constructor(element: ElementRef, ngZone: NgZone, translationService: TranslationService);
25
+ get loaded(): {
26
+ value: boolean;
27
+ params: {
28
+ height: any;
29
+ };
30
+ };
31
+ ngOnInit(): void;
32
+ mouseOver(over: boolean): void;
33
+ focus(focused: boolean): void;
34
+ close(userClosed?: boolean): void;
35
+ private setUpTimer;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "cll-toast", never, { "toastType": { "alias": "toastType"; "required": false; }; "primaryButtonText": { "alias": "primaryButtonText"; "required": false; }; "secondaryButtonText": { "alias": "secondaryButtonText"; "required": false; }; "manualClosable": { "alias": "manualClosable"; "required": false; }; "timeoutSeconds": { "alias": "timeoutSeconds"; "required": false; }; }, { "closed": "closed"; "primaryButtonClick": "primaryButtonClick"; "secondaryButtonClick": "secondaryButtonClick"; }, never, [".toast-title", ".toast-date", ".toast-description"], true, never>;
38
+ }
@@ -0,0 +1 @@
1
+ export declare const toastTranslations: Record<string, Record<string, string>>;
@@ -0,0 +1,29 @@
1
+ import { CreatedToast, Toast } from './toast.type';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ToastService {
4
+ private toastsBS;
5
+ toasts$: import("rxjs").Observable<{
6
+ id: symbol;
7
+ title: string;
8
+ description: string;
9
+ toastType: "error" | "info" | "warning" | "success";
10
+ manualClosable?: boolean | undefined;
11
+ timeoutSeconds?: number | undefined;
12
+ primaryButtonText?: string | undefined;
13
+ secondaryButtonText?: string | undefined;
14
+ date?: string | undefined;
15
+ closed?: (() => void) | undefined;
16
+ primaryButtonClick?: (() => void) | undefined;
17
+ secondaryButtonClick?: (() => void) | undefined;
18
+ }[]>;
19
+ addToast(toast: Toast): CreatedToast;
20
+ success(toast: Toast): CreatedToast;
21
+ warning(toast: Toast): CreatedToast;
22
+ info(toast: Toast): CreatedToast;
23
+ error(toast: Toast): CreatedToast;
24
+ deleteToast(id: symbol): void;
25
+ clearToasts(): void;
26
+ private createToast;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
29
+ }
@@ -0,0 +1,16 @@
1
+ export type ToastType = 'success' | 'error' | 'info' | 'warning';
2
+ export type Toast = {
3
+ title: string;
4
+ description: string;
5
+ id?: symbol;
6
+ toastType?: ToastType;
7
+ manualClosable?: boolean;
8
+ timeoutSeconds?: number;
9
+ primaryButtonText?: string;
10
+ secondaryButtonText?: string;
11
+ date?: string;
12
+ closed?: () => void;
13
+ primaryButtonClick?: () => void;
14
+ secondaryButtonClick?: () => void;
15
+ };
16
+ export type CreatedToast = Required<Pick<Toast, 'title' | 'description' | 'id' | 'toastType'>> & Toast;
@@ -0,0 +1,3 @@
1
+ export * from './tooltip.component';
2
+ export * from './tooltip.directive';
3
+ export * from './tooltip.module';
@@ -0,0 +1,9 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PositioningTooltipDirective implements AfterViewInit {
4
+ private tooltipContainerElement;
5
+ ngAfterViewInit(): void;
6
+ private updateTooltipClass;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<PositioningTooltipDirective, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PositioningTooltipDirective, "[clxPositioningTooltip]", never, {}, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentRef, EventEmitter, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { TooltipPosition } from './tooltip.model';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TooltipComponent {
5
+ left: number;
6
+ top: number;
7
+ width?: number;
8
+ position?: TooltipPosition;
9
+ triggerElementHovering: boolean;
10
+ set content(c: string | TemplateRef<any> | ComponentRef<any>);
11
+ closePopover: EventEmitter<boolean>;
12
+ contentContainer?: ViewContainerRef;
13
+ text?: string | undefined;
14
+ showClose: boolean;
15
+ tooltipHovering: boolean;
16
+ private host;
17
+ get tooltipChildren(): HTMLCollection;
18
+ closeTooltip(): void;
19
+ click(event: MouseEvent): void;
20
+ mouseEnter(event: MouseEvent): void;
21
+ mouseLeave(event: MouseEvent): void;
22
+ onEscape(event: KeyboardEvent): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "cll-tooltip", never, { "left": { "alias": "left"; "required": false; }; "top": { "alias": "top"; "required": false; }; "width": { "alias": "width"; "required": false; }; "position": { "alias": "position"; "required": false; }; "triggerElementHovering": { "alias": "triggerElementHovering"; "required": false; }; "content": { "alias": "content"; "required": false; }; }, { "closePopover": "closePopover"; }, never, never, true, never>;
25
+ }
@@ -0,0 +1,64 @@
1
+ import { ComponentRef, TemplateRef } from '@angular/core';
2
+ import { TooltipPosition } from './tooltip.model';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TooltipDirective {
5
+ clxTooltip: string;
6
+ clxTooltipContent: string | TemplateRef<any> | ComponentRef<any>;
7
+ clxTooltipHideDelay: number;
8
+ clxTooltipWidth: number;
9
+ clxTooltipPosition?: TooltipPosition;
10
+ private elementRef;
11
+ private appRef;
12
+ private document;
13
+ private tooltipComponent?;
14
+ private sub;
15
+ get triggerElement(): HTMLElement;
16
+ get hostElement(): any;
17
+ get tooltipAnchorElement(): HTMLAnchorElement;
18
+ get tooltipContentElement(): HTMLSpanElement;
19
+ onMouseEnter(): void;
20
+ onMouseLeave(): void;
21
+ /**
22
+ * Show tooltip and position it on the screen.
23
+ */
24
+ showTooltip(): void;
25
+ /**
26
+ * Removes the tooltip if force is true or if the tooltip is not being hovered over.
27
+ *
28
+ * @param {boolean} force - indicates whether to force the removal of the tooltip
29
+ * @return {void}
30
+ */
31
+ removeTooltip(force?: boolean): void;
32
+ /**
33
+ * A function to position the tooltip based on the previous position.
34
+ *
35
+ * @param {string} previousTooltipPosition - the previous position of the tooltip
36
+ * @return {void}
37
+ */
38
+ private positionTooltip;
39
+ /**
40
+ * Set tooltip properties based on the calculated position.
41
+ *
42
+ * @param {TooltipPosition} calculatedPosition - the calculated position for the tooltip
43
+ */
44
+ private setTooltipProps;
45
+ /**
46
+ * Calculates the tooltip position based on the trigger element's position and the viewport width.
47
+ *
48
+ * @param {TooltipPosition} positionOverride - (optional) The position to override the calculated position
49
+ * @return {string} The calculated tooltip position
50
+ */
51
+ private calculateTooltipPosition;
52
+ /**
53
+ * Re-renders the tooltip based on the latest positioning and updates its coordinates.
54
+ */
55
+ private reRenderTooltip;
56
+ /**
57
+ * Calculate tooltip class based on collision detection.
58
+ *
59
+ * @return {string} The updated tooltip class based on collision detection.
60
+ */
61
+ private calculateTooltipClassByCollisionDetection;
62
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
63
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[clxTooltip]", never, { "clxTooltip": { "alias": "clxTooltip"; "required": false; }; "clxTooltipContent": { "alias": "clxTooltipContent"; "required": false; }; "clxTooltipHideDelay": { "alias": "clxTooltipHideDelay"; "required": false; }; "clxTooltipWidth": { "alias": "clxTooltipWidth"; "required": false; }; "clxTooltipPosition": { "alias": "clxTooltipPosition"; "required": false; }; }, {}, never, never, true, never>;
64
+ }
@@ -0,0 +1 @@
1
+ export type TooltipPosition = 'tooltip-top-right' | 'tooltip-top-left' | 'tooltip-bottom-right' | 'tooltip-bottom-left' | 'tooltip-right' | 'tooltip-left';
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./tooltip.component";
3
+ import * as i2 from "./tooltip.directive";
4
+ export declare class TooltipModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TooltipModule, never, [typeof i1.TooltipComponent, typeof i2.TooltipDirective], [typeof i1.TooltipComponent, typeof i2.TooltipDirective]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<TooltipModule>;
8
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Get the coordinates for the tooltip (arrow coordinates) based on the given trigger element's bounding client rect and tooltip class.
3
+ *
4
+ * @param {HTMLElement} triggerElement - The tooltip trigger element. For example, <button clxTooltip>Hover me</button>, where the button is the trigger element.
5
+ * @param {string} tooltipClass - The class of the tooltip.
6
+ * @returns {{ x: number; y: number }} The x and y coordinates for the tooltip (arrow origin).
7
+ */
8
+ export declare function getTooltipCoords(triggerElement: HTMLElement, tooltipClass: string): {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ /**
13
+ * Check if the given element is clickable (button, link, or element with role="button").
14
+ *
15
+ * @param {HTMLElement} el - The element to check.
16
+ * @returns {boolean} True if the element is clickable, otherwise false.
17
+ */
18
+ export declare function isElementClickable(el: HTMLElement): boolean;
19
+ /**
20
+ * Check if the given element is inside the specified collection.
21
+ *
22
+ * @param {HTMLElement} el - The element to check.
23
+ * @param {HTMLCollection} collection - The collection to check against.
24
+ * @returns {boolean} True if the element is inside the collection, otherwise false.
25
+ */
26
+ export declare function isElementInsideCollection(el: HTMLElement, collection: HTMLCollection): boolean;
27
+ /**
28
+ * Perform collision detection for the target element against the reference element (default is window).
29
+ *
30
+ * @param {HTMLElement} targetElement - The target element for collision detection.
31
+ * @param {HTMLElement|Window} [referenceElement=window] - The reference element for collision detection. Defaults to the window.
32
+ * @returns {{ left: boolean; right: boolean; top: boolean; bottom: boolean }} Object indicating which edges are colliding.
33
+ */
34
+ export declare function collisionDetection(targetElement: HTMLElement, referenceElement?: HTMLElement | Window): {
35
+ left: boolean;
36
+ right: boolean;
37
+ top: boolean;
38
+ bottom: boolean;
39
+ };
@@ -0,0 +1,2 @@
1
+ export * from './page-query.type';
2
+ export * from './rde.type';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Represents the parameters for paginating and querying data.
3
+ */
4
+ export interface PageQuery {
5
+ /**
6
+ * The page number for pagination. Starts from 1.
7
+ */
8
+ page: number;
9
+ /**
10
+ * The number of items per page in the result set.
11
+ */
12
+ pageSize: number;
13
+ /**
14
+ * Optional: The field to sort in ascending order.
15
+ */
16
+ sortAsc?: string;
17
+ /**
18
+ * Optional: The field to sort in descending order.
19
+ */
20
+ sortDesc?: string;
21
+ /**
22
+ * Optional: The filter criteria in FIQL (Feed Item Query Language) format.
23
+ * Example: name==*term*;enabled==false
24
+ */
25
+ filter?: string;
26
+ }