@ieeesa-npm/presentation 0.1.1 → 0.1.2

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.
@@ -0,0 +1,61 @@
1
+ import { ComponentRef, EventEmitter, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { ModalType } from '@ieeesa-npm/feature';
4
+ import { ToggleButton } from '../../models/toggle-button.model';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * This component encapsulates the functionality of a modal dialog and implements reusable contents part of the modal components such as text content, loading another component into the modal and emitting modal events to consumed component.
8
+ * It utilizes Angular Material's MatDialog module to display the modal dialog.
9
+ * @usageNotes -Pass ModalComponent and data options as parameters to MatDialog open method as given below
10
+ this.dialog.open(ConfirmationDialogComponent, {data: {}})
11
+ * @class ModalComponent
12
+ */
13
+ export declare class ModalComponent implements OnInit, OnDestroy {
14
+ dialogRef: MatDialogRef<ModalComponent>;
15
+ modalData: any;
16
+ componentContainer: ViewContainerRef;
17
+ componentRef: ComponentRef<any>;
18
+ toggleButtonClicked: EventEmitter<any>;
19
+ isComponentLoaded: boolean;
20
+ heading: string;
21
+ subHeading: string;
22
+ promptMessage: string;
23
+ leftButtonLabel: string;
24
+ rightButtonLabel: string;
25
+ toggleButtons: ToggleButton[];
26
+ componentReference: any;
27
+ modalType: ModalType;
28
+ isCloseNeeded: boolean;
29
+ modalConfirm: EventEmitter<any>;
30
+ constructor(dialogRef: MatDialogRef<ModalComponent>, modalData: any);
31
+ /**
32
+ * Initializes the component.
33
+ * @return -returns nothing
34
+ */
35
+ ngOnInit(): void;
36
+ /**
37
+ * Emit onToggleButtonClicked event when a toggle button is selected.
38
+ * @param {ToggleButton} selected -Selected toggle button object.
39
+ */
40
+ onToggleButtonSelect(selected: ToggleButton): void;
41
+ /**
42
+ * Loads the component into the view container.
43
+ */
44
+ loadComponent(): void;
45
+ /**
46
+ * Handles the confirmation event.
47
+ * @param {boolean} value - The confirmation value.
48
+ */
49
+ onConfirm(value: boolean): void;
50
+ /**
51
+ * Returns dialog type
52
+ * @return {number} value-Dialog type enum
53
+ */
54
+ getModalType(): boolean;
55
+ /**
56
+ * Cleans up resources when the component is destroyed.
57
+ */
58
+ ngOnDestroy(): void;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "ieeesa-modal", never, {}, {}, never, never, true, never>;
61
+ }
@@ -0,0 +1,47 @@
1
+ import { EventEmitter, OnInit } from "@angular/core";
2
+ import { ToggleButton } from "../../models/toggle-button.model";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * ToggleButtonComponent allows users to select toggle between group of buttons.
6
+ * The component takes an array of ToggleButton objects as an input, where each object contains id, label and isDisabled property. Default the first button is selected when selectedLabel is not provided.
7
+ * @class ToggleButtonComponent
8
+ * @implements {OnInit}
9
+ */
10
+ export declare class ToggleButtonComponent implements OnInit {
11
+ /**
12
+ * Label of the selected button. Default is an empty string.
13
+ * @type {string}
14
+ */
15
+ selectedLabel: string;
16
+ /**
17
+ * An array of ToggleButton objects that represent the buttons in the toggle group.
18
+ * Each ToggleButton object must have properties: id, label, and isDisabled.
19
+ * @type {ToggleButton[]}
20
+ */
21
+ buttons: ToggleButton[];
22
+ /**
23
+ * Event emitter that emits the selected ToggleButton object when a button is clicked.
24
+ * @type {EventEmitter<ToggleButton>}
25
+ */
26
+ toggleSelected: EventEmitter<ToggleButton>;
27
+ /**
28
+ * By default, the first button in a group is selected when selectedLabel is not provided.
29
+ * @return -returns nothing
30
+ */
31
+ ngOnInit(): void;
32
+ /**
33
+ * Updates the selectedLabel with the clicked button label and emits the toggleSelected event with the selected ToggleButton object.
34
+ * @param {ToggleButton} button -Selected ToggleButton object.
35
+ * @return -returns nothing
36
+ */
37
+ toggleButtonClicked(button: ToggleButton): void;
38
+ /**
39
+ * TrackByFunction is called for each item in the collection and return a unique identifier for that item.
40
+ * @param {number} index -The index of the current item in the collection.
41
+ * @param {ToggleButton} button -The current button object from the collection being iterated.
42
+ * @return {number} -returns number
43
+ */
44
+ trackByFn(index: number, button: ToggleButton): number;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToggleButtonComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToggleButtonComponent, "ieeesa-toggle-button", never, { "selectedLabel": { "alias": "selectedLabel"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; }, { "toggleSelected": "toggleSelected"; }, never, never, true, never>;
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/presentation",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
package/public-api.d.ts CHANGED
@@ -14,6 +14,8 @@ export * from './lib/components/select/select.component';
14
14
  export * from './lib/components/header/header.component';
15
15
  export * from './lib/components/footer/footer.component';
16
16
  export * from './lib/components/navigation-menu/navigation-menu.component';
17
+ export * from './lib/components/modal/modal.component';
18
+ export * from './lib/components/toggle-button/toggle-button.component';
17
19
  export * from './lib/directives/dynamic-form-field/dynamic-form-field.directive';
18
20
  export * from './lib/models/field-config.model';
19
21
  export * from './lib/models/form-field.model';