@ieeesa-npm/presentation 0.33.13 → 0.33.15
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/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +72 -1
- package/esm2022/lib/components/export-format-popover/export-format-popover.component.mjs +13 -2
- package/esm2022/lib/components/home-group-selection/home-group-selection.component.mjs +101 -0
- package/esm2022/lib/models/home-group-selection.model.mjs +9 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/ieeesa-npm-presentation.mjs +184 -2
- package/fesm2022/ieeesa-npm-presentation.mjs.map +1 -1
- package/lib/components/dynamic-form/dynamic-form.component.d.ts +34 -0
- package/lib/components/export-format-popover/export-format-popover.component.d.ts +3 -1
- package/lib/components/home-group-selection/home-group-selection.component.d.ts +63 -0
- package/lib/models/home-group-selection.model.d.ts +53 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -124,6 +124,40 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit, A
|
|
|
124
124
|
* @memberof DynamicFormComponent
|
|
125
125
|
*/
|
|
126
126
|
createFormGroupArray(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Incrementally adds a single control to an existing form group at the given
|
|
129
|
+
* group index WITHOUT rebuilding the whole form. This preserves every other
|
|
130
|
+
* live control (including controls that are not part of the static config,
|
|
131
|
+
* e.g. dynamically-populated dropdowns) along with their current values and
|
|
132
|
+
* options.
|
|
133
|
+
* @param {number} groupIndex - Index of the target form group.
|
|
134
|
+
* @param {FieldConfig} control - Field configuration of the control to add.
|
|
135
|
+
* @param {number} [position] - Optional position within the group's controls;
|
|
136
|
+
* defaults to appending at the end.
|
|
137
|
+
* @return {void}
|
|
138
|
+
* @memberof DynamicFormComponent
|
|
139
|
+
*/
|
|
140
|
+
addControlToGroup(groupIndex: number, control: FieldConfig, position?: number): void;
|
|
141
|
+
/**
|
|
142
|
+
* Incrementally removes a single control from an existing form group by its
|
|
143
|
+
* control name WITHOUT rebuilding the whole form. Other live controls and
|
|
144
|
+
* their values/options are left untouched.
|
|
145
|
+
* @param {number} groupIndex - Index of the target form group.
|
|
146
|
+
* @param {string} controlName - Name of the control to remove.
|
|
147
|
+
* @return {void}
|
|
148
|
+
* @memberof DynamicFormComponent
|
|
149
|
+
*/
|
|
150
|
+
removeControlFromGroup(groupIndex: number, controlName: string): void;
|
|
151
|
+
/**
|
|
152
|
+
* Returns true when the live form group at the given index currently contains
|
|
153
|
+
* a control with the given name. Reflects the rendered form state (including
|
|
154
|
+
* controls added/removed incrementally), not the static config.
|
|
155
|
+
* @param {number} groupIndex - Index of the target form group.
|
|
156
|
+
* @param {string} controlName - Name of the control to look for.
|
|
157
|
+
* @return {boolean} Whether the control exists in the rendered group.
|
|
158
|
+
* @memberof DynamicFormComponent
|
|
159
|
+
*/
|
|
160
|
+
hasControlInGroup(groupIndex: number, controlName: string): boolean;
|
|
127
161
|
/**
|
|
128
162
|
* Creates form group using form builder
|
|
129
163
|
* @param {any[]} controls
|
|
@@ -16,7 +16,9 @@ export declare class ExportFormatPopoverComponent {
|
|
|
16
16
|
*/
|
|
17
17
|
origin?: unknown;
|
|
18
18
|
/** Controls visibility */
|
|
19
|
-
|
|
19
|
+
private _isOpen;
|
|
20
|
+
set isOpen(value: boolean);
|
|
21
|
+
get isOpen(): boolean;
|
|
20
22
|
/** Title text displayed at the top of the popover */
|
|
21
23
|
popoverTitle: string;
|
|
22
24
|
/** Subtitle map for format options (keyed by ExportFormat value) */
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { HomeGroupSelectionData, QualifyingGroup } from '../../models/home-group-selection.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* HomeGroupSelectionComponent is a generic, reusable dialog for selecting a
|
|
7
|
+
* home Working Group to receive reciprocal attendance credit (SP3M-18).
|
|
8
|
+
*
|
|
9
|
+
* It is shown when an attendee (or an admin acting on their behalf) qualifies
|
|
10
|
+
* for reciprocal credit in more than one home Working Group and must choose
|
|
11
|
+
* which one should receive the credit. The first qualifying group is
|
|
12
|
+
* pre-selected so Submit is enabled immediately; Submit is disabled only if no
|
|
13
|
+
* group is selected.
|
|
14
|
+
*
|
|
15
|
+
* This component is feature-agnostic — all display text is supplied by the
|
|
16
|
+
* caller via MAT_DIALOG_DATA (HomeGroupSelectionData). It performs no API calls;
|
|
17
|
+
* it collects the selection and returns it so the caller can re-submit.
|
|
18
|
+
*
|
|
19
|
+
* Footer:
|
|
20
|
+
* - Submit → closes with { homeGroupId }
|
|
21
|
+
* - Cancel → closes with null (caller aborts)
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @class HomeGroupSelectionComponent
|
|
25
|
+
* @implements {OnInit}
|
|
26
|
+
*/
|
|
27
|
+
export declare class HomeGroupSelectionComponent implements OnInit {
|
|
28
|
+
data: HomeGroupSelectionData;
|
|
29
|
+
private dialogRef;
|
|
30
|
+
/** Qualifying home groups the user must choose between. */
|
|
31
|
+
qualifyingGroups: QualifyingGroup[];
|
|
32
|
+
/** The currently selected home group id. */
|
|
33
|
+
selectedGroupId: string;
|
|
34
|
+
constructor(data: HomeGroupSelectionData, dialogRef: MatDialogRef<HomeGroupSelectionComponent>);
|
|
35
|
+
ngOnInit(): void;
|
|
36
|
+
/**
|
|
37
|
+
* trackBy for the qualifying groups list.
|
|
38
|
+
* @param {number} _index
|
|
39
|
+
* @param {QualifyingGroup} group
|
|
40
|
+
* @return {string}
|
|
41
|
+
* @memberof HomeGroupSelectionComponent
|
|
42
|
+
*/
|
|
43
|
+
trackByGroupId(_index: number, group: QualifyingGroup): string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether Submit should be enabled — true once a group is selected.
|
|
46
|
+
* @return {boolean}
|
|
47
|
+
* @memberof HomeGroupSelectionComponent
|
|
48
|
+
*/
|
|
49
|
+
get canSubmit(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Cancel handler — closes with null so the caller aborts.
|
|
52
|
+
* @memberof HomeGroupSelectionComponent
|
|
53
|
+
*/
|
|
54
|
+
onCancel(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Submit handler — closes with the selected home group id.
|
|
57
|
+
* No-ops if no group is selected.
|
|
58
|
+
* @memberof HomeGroupSelectionComponent
|
|
59
|
+
*/
|
|
60
|
+
onSubmit(): void;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HomeGroupSelectionComponent, never>;
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HomeGroupSelectionComponent, "ieeesa-home-group-selection", never, {}, {}, never, never, true, never>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared models for the reusable Home Group Selection dialog (SP3M-18).
|
|
3
|
+
*
|
|
4
|
+
* The dialog is generic and feature-agnostic: all display text is supplied by
|
|
5
|
+
* the calling feature library (e.g. attendance, attendees) via MAT_DIALOG_DATA,
|
|
6
|
+
* so this presentation-layer component never depends on any feature's constants.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A single selectable Working Group in the home-group selection dialog.
|
|
10
|
+
* Mirrors the backend HomeGroupOption ({ groupId, groupName }).
|
|
11
|
+
*/
|
|
12
|
+
export interface QualifyingGroup {
|
|
13
|
+
groupId: string;
|
|
14
|
+
groupName: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The homeGroupSelectionPrompt object returned by the attendance log-in APIs
|
|
18
|
+
* when the user qualifies for reciprocal credit in more than one home group.
|
|
19
|
+
* Mirrors HomeGroupSelectionPromptResponse from the attendee-api.
|
|
20
|
+
*/
|
|
21
|
+
export interface HomeGroupSelectionPrompt {
|
|
22
|
+
eventId: string;
|
|
23
|
+
qualifyingGroups: QualifyingGroup[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Data passed to the HomeGroupSelectionComponent via MAT_DIALOG_DATA.
|
|
27
|
+
* All text is provided by the caller so the component stays generic.
|
|
28
|
+
*/
|
|
29
|
+
export interface HomeGroupSelectionData {
|
|
30
|
+
/** Qualifying home groups the user must choose between. */
|
|
31
|
+
qualifyingGroups: QualifyingGroup[];
|
|
32
|
+
/** Dialog title. */
|
|
33
|
+
title: string;
|
|
34
|
+
/** First instruction paragraph (context). */
|
|
35
|
+
messageLine1: string;
|
|
36
|
+
/** Second instruction paragraph (the "please select" prompt). */
|
|
37
|
+
messageLine2: string;
|
|
38
|
+
/** Informational note shown in the footer banner. */
|
|
39
|
+
infoText: string;
|
|
40
|
+
/** Submit button label. */
|
|
41
|
+
submitLabel: string;
|
|
42
|
+
/** Cancel button label. */
|
|
43
|
+
cancelLabel: string;
|
|
44
|
+
/** Accessibility label for the radio group. */
|
|
45
|
+
groupOptionAriaLabel: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Result returned by HomeGroupSelectionComponent when the user clicks Submit.
|
|
49
|
+
* `null` is returned when the user cancels.
|
|
50
|
+
*/
|
|
51
|
+
export interface HomeGroupSelectionResult {
|
|
52
|
+
homeGroupId: string;
|
|
53
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from './lib/components/export-format-popover/export-format-popover.comp
|
|
|
45
45
|
export * from './lib/components/filter-popover/filter-popover.component';
|
|
46
46
|
export * from './lib/components/policy-confirmation-dialog/policy-confirmation-dialog.component';
|
|
47
47
|
export * from './lib/components/export-success-dialog/export-success-dialog.component';
|
|
48
|
+
export * from './lib/components/home-group-selection/home-group-selection.component';
|
|
48
49
|
export * from './lib/directives/dynamic-form-field/dynamic-form-field.directive';
|
|
49
50
|
export * from './lib/directives/set-background/set-background.directive';
|
|
50
51
|
export * from './lib/directives/text-truncated/text-truncated.directive';
|
|
@@ -105,6 +106,7 @@ export * from './lib/models/export-format-popover.model';
|
|
|
105
106
|
export * from './lib/models/filter-popover.model';
|
|
106
107
|
export * from './lib/models/policy-confirmation-dialog.model';
|
|
107
108
|
export * from './lib/models/export-success-dialog.model';
|
|
109
|
+
export * from './lib/models/home-group-selection.model';
|
|
108
110
|
export * from './lib/services/datepicker.service';
|
|
109
111
|
export * from './lib/services/form-utility.service';
|
|
110
112
|
export * from './lib/services/file-upload.service';
|