@mtna/web-form-angular 0.0.1
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/_index.scss +25 -0
- package/bundles/mtna-web-form-angular.umd.js +4982 -0
- package/bundles/mtna-web-form-angular.umd.js.map +1 -0
- package/esm2015/lib/core/animations.js +8 -0
- package/esm2015/lib/core/api-config.js +3 -0
- package/esm2015/lib/core/index.js +7 -0
- package/esm2015/lib/core/pipes/coerce-date-item.pipe.js +23 -0
- package/esm2015/lib/core/pipes/coerce-form-group.pipe.js +35 -0
- package/esm2015/lib/core/pipes/date-quarter.pipe.js +43 -0
- package/esm2015/lib/core/pipes/get-auto-complete.pipe.js +42 -0
- package/esm2015/lib/core/pipes/get-available-quarters.pipe.js +29 -0
- package/esm2015/lib/core/pipes/get-form-control-error.pipe.js +20 -0
- package/esm2015/lib/core/pipes/get-list-icon.pipe.js +53 -0
- package/esm2015/lib/core/pipes/get-object-type.pipe.js +17 -0
- package/esm2015/lib/core/pipes/get-selected-option.pipe.js +20 -0
- package/esm2015/lib/core/pipes/index.js +71 -0
- package/esm2015/lib/core/pipes/items-with-value.pipe.js +30 -0
- package/esm2015/lib/core/pipes/sanitize-html.pipe.js +23 -0
- package/esm2015/lib/core/services/api.service.js +67 -0
- package/esm2015/lib/core/services/form-manager.service.js +465 -0
- package/esm2015/lib/core/services/index.js +5 -0
- package/esm2015/lib/core/services/ng-form.service.js +150 -0
- package/esm2015/lib/core/services/ui.service.js +333 -0
- package/esm2015/lib/core/utilities/find-form-control.js +29 -0
- package/esm2015/lib/core/utilities/find-form-item.js +25 -0
- package/esm2015/lib/core/utilities/flatten-steps.js +10 -0
- package/esm2015/lib/core/utilities/generate-form-steps.js +25 -0
- package/esm2015/lib/core/utilities/index.js +9 -0
- package/esm2015/lib/core/utilities/is-form-group.js +6 -0
- package/esm2015/lib/core/utilities/serializer-util.js +358 -0
- package/esm2015/lib/core/utilities/update-step-status.js +38 -0
- package/esm2015/lib/core/validators/index.js +3 -0
- package/esm2015/lib/core/validators/instant-validation-result-error-state-matcher.js +23 -0
- package/esm2015/lib/core/validators/validation-result-validator.js +19 -0
- package/esm2015/lib/file-upload/file-upload.component.js +66 -0
- package/esm2015/lib/file-upload/index.js +2 -0
- package/esm2015/lib/form/base-form-item.model.js +2 -0
- package/esm2015/lib/form/form-disabler.component.js +38 -0
- package/esm2015/lib/form/form-item.directive.js +22 -0
- package/esm2015/lib/form/form.component.js +250 -0
- package/esm2015/lib/form/form.module.js +214 -0
- package/esm2015/lib/form/index.js +5 -0
- package/esm2015/lib/form/white-list.model.js +11 -0
- package/esm2015/lib/form-item-controls/base-form-item-control.directive.js +58 -0
- package/esm2015/lib/form-item-controls/base-parent-item-control.directive.js +42 -0
- package/esm2015/lib/form-item-controls/base-single-selection-parent.directive.js +53 -0
- package/esm2015/lib/form-item-controls/date-range.component.js +84 -0
- package/esm2015/lib/form-item-controls/date.component.js +134 -0
- package/esm2015/lib/form-item-controls/dropdown.component.js +109 -0
- package/esm2015/lib/form-item-controls/index.js +8 -0
- package/esm2015/lib/form-item-controls/input.component.js +149 -0
- package/esm2015/lib/form-item-controls/year-quarter-range.component.js +75 -0
- package/esm2015/lib/form-item-controls/year-quarter.component.js +228 -0
- package/esm2015/lib/form-stepper/form-step-group.component.js +95 -0
- package/esm2015/lib/form-stepper/form-step-group.pipe.js +20 -0
- package/esm2015/lib/form-stepper/form-step.component.js +110 -0
- package/esm2015/lib/form-stepper/form-step.util.js +28 -0
- package/esm2015/lib/form-stepper/form-stepper.component.js +115 -0
- package/esm2015/lib/form-stepper/form-stepper.module.js +53 -0
- package/esm2015/lib/form-stepper/index.js +8 -0
- package/esm2015/lib/form-stepper/models/base-form-step.model.js +6 -0
- package/esm2015/lib/form-stepper/models/form-step-group.model.js +13 -0
- package/esm2015/lib/form-stepper/models/form-step.model.js +12 -0
- package/esm2015/lib/form-stepper/models/index.js +4 -0
- package/esm2015/lib/groups/form-item-dialog-data.model.js +14 -0
- package/esm2015/lib/groups/group-components.js +646 -0
- package/esm2015/lib/groups/index.js +3 -0
- package/esm2015/lib/groups/repeatable-item.component.js +23 -0
- package/esm2015/lib/item-header/index.js +2 -0
- package/esm2015/lib/item-header/item-header.component.js +108 -0
- package/esm2015/lib/static-form-items/index.js +3 -0
- package/esm2015/lib/static-form-items/ordered-list-item.js +50 -0
- package/esm2015/lib/static-form-items/unordered-list-item.js +52 -0
- package/esm2015/lib/step-card/index.js +2 -0
- package/esm2015/lib/step-card/step-card.component.js +53 -0
- package/esm2015/mtna-web-form-angular.js +5 -0
- package/esm2015/public-api.js +10 -0
- package/fesm2015/mtna-web-form-angular.js +4614 -0
- package/fesm2015/mtna-web-form-angular.js.map +1 -0
- package/lib/_index.scss +25 -0
- package/lib/core/_all-color.scss +25 -0
- package/lib/core/_all-theme.scss +28 -0
- package/lib/core/_all-typography.scss +25 -0
- package/lib/core/_core-theme.scss +43 -0
- package/lib/core/animations.d.ts +2 -0
- package/lib/core/api-config.d.ts +5 -0
- package/lib/core/index.d.ts +6 -0
- package/lib/core/pipes/coerce-date-item.pipe.d.ts +11 -0
- package/lib/core/pipes/coerce-form-group.pipe.d.ts +23 -0
- package/lib/core/pipes/date-quarter.pipe.d.ts +7 -0
- package/lib/core/pipes/get-auto-complete.pipe.d.ts +7 -0
- package/lib/core/pipes/get-available-quarters.pipe.d.ts +8 -0
- package/lib/core/pipes/get-form-control-error.pipe.d.ts +14 -0
- package/lib/core/pipes/get-list-icon.pipe.d.ts +7 -0
- package/lib/core/pipes/get-object-type.pipe.d.ts +7 -0
- package/lib/core/pipes/get-selected-option.pipe.d.ts +8 -0
- package/lib/core/pipes/index.d.ts +28 -0
- package/lib/core/pipes/items-with-value.pipe.d.ts +13 -0
- package/lib/core/pipes/sanitize-html.pipe.d.ts +10 -0
- package/lib/core/services/api.service.d.ts +41 -0
- package/lib/core/services/form-manager.service.d.ts +184 -0
- package/lib/core/services/index.d.ts +4 -0
- package/lib/core/services/ng-form.service.d.ts +76 -0
- package/lib/core/services/ui.service.d.ts +123 -0
- package/lib/core/utilities/find-form-control.d.ts +11 -0
- package/lib/core/utilities/find-form-item.d.ts +10 -0
- package/lib/core/utilities/flatten-steps.d.ts +7 -0
- package/lib/core/utilities/generate-form-steps.d.ts +3 -0
- package/lib/core/utilities/index.d.ts +8 -0
- package/lib/core/utilities/is-form-group.d.ts +3 -0
- package/lib/core/utilities/serializer-util.d.ts +81 -0
- package/lib/core/utilities/update-step-status.d.ts +14 -0
- package/lib/core/validators/index.d.ts +2 -0
- package/lib/core/validators/instant-validation-result-error-state-matcher.d.ts +13 -0
- package/lib/core/validators/validation-result-validator.d.ts +12 -0
- package/lib/file-upload/file-upload.component.d.ts +23 -0
- package/lib/file-upload/index.d.ts +1 -0
- package/lib/form/base-form-item.model.d.ts +15 -0
- package/lib/form/form-disabler.component.d.ts +6 -0
- package/lib/form/form-item.directive.d.ts +13 -0
- package/lib/form/form.component.d.ts +89 -0
- package/lib/form/form.module.d.ts +52 -0
- package/lib/form/index.d.ts +4 -0
- package/lib/form/white-list.model.d.ts +6 -0
- package/lib/form-item-controls/_date-item-theme.scss +29 -0
- package/lib/form-item-controls/_form-control-theme.scss +28 -0
- package/lib/form-item-controls/_year-quarter-item-theme.scss +28 -0
- package/lib/form-item-controls/base-form-item-control.directive.d.ts +26 -0
- package/lib/form-item-controls/base-parent-item-control.directive.d.ts +19 -0
- package/lib/form-item-controls/base-single-selection-parent.directive.d.ts +26 -0
- package/lib/form-item-controls/date-range.component.d.ts +12 -0
- package/lib/form-item-controls/date.component.d.ts +24 -0
- package/lib/form-item-controls/dropdown.component.d.ts +9 -0
- package/lib/form-item-controls/index.d.ts +7 -0
- package/lib/form-item-controls/input.component.d.ts +14 -0
- package/lib/form-item-controls/year-quarter-range.component.d.ts +9 -0
- package/lib/form-item-controls/year-quarter.component.d.ts +33 -0
- package/lib/form-stepper/_form-step-group-theme.scss +43 -0
- package/lib/form-stepper/_form-stepper-theme.scss +72 -0
- package/lib/form-stepper/form-step-group.component.d.ts +23 -0
- package/lib/form-stepper/form-step-group.pipe.d.ts +11 -0
- package/lib/form-stepper/form-step.component.d.ts +27 -0
- package/lib/form-stepper/form-step.util.d.ts +27 -0
- package/lib/form-stepper/form-stepper.component.d.ts +35 -0
- package/lib/form-stepper/form-stepper.module.d.ts +18 -0
- package/lib/form-stepper/index.d.ts +7 -0
- package/lib/form-stepper/models/base-form-step.model.d.ts +4 -0
- package/lib/form-stepper/models/form-step-group.model.d.ts +8 -0
- package/lib/form-stepper/models/form-step.model.d.ts +11 -0
- package/lib/form-stepper/models/index.d.ts +3 -0
- package/lib/groups/_checkbox-theme.scss +62 -0
- package/lib/groups/_form-group-theme.scss +32 -0
- package/lib/groups/_multiple-choice-theme.scss +65 -0
- package/lib/groups/_repeatable-item-theme.scss +28 -0
- package/lib/groups/form-item-dialog-data.model.d.ts +13 -0
- package/lib/groups/group-components.d.ts +221 -0
- package/lib/groups/index.d.ts +2 -0
- package/lib/groups/repeatable-item.component.d.ts +5 -0
- package/lib/item-header/_item-header-theme.scss +28 -0
- package/lib/item-header/index.d.ts +1 -0
- package/lib/item-header/item-header.component.d.ts +35 -0
- package/lib/static-form-items/index.d.ts +2 -0
- package/lib/static-form-items/ordered-list-item.d.ts +11 -0
- package/lib/static-form-items/unordered-list-item.d.ts +11 -0
- package/lib/step-card/_step-card-theme.scss +42 -0
- package/lib/step-card/index.d.ts +1 -0
- package/lib/step-card/step-card.component.d.ts +21 -0
- package/mtna-web-form-angular.d.ts +5 -0
- package/package.json +43 -0
- package/public-api.d.ts +9 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '~@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin color($theme) {
|
|
5
|
+
$config: mat.get-color-config($theme);
|
|
6
|
+
$foreground: map.get($config, foreground);
|
|
7
|
+
|
|
8
|
+
mtna-wf-repeatable-item-container {
|
|
9
|
+
mtna-wf-repeatable-item {
|
|
10
|
+
border-color: mat.get-color-from-palette($foreground, divider);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin typography($theme) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin theme($theme) {
|
|
19
|
+
$config: mat.get-color-config($theme);
|
|
20
|
+
@if $config != null {
|
|
21
|
+
@include color($theme);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
$typography-config: mat.get-typography-config($theme);
|
|
25
|
+
@if $typography-config != null {
|
|
26
|
+
@include typography($theme);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormItem } from '@mtna/web-form-ts';
|
|
2
|
+
/**
|
|
3
|
+
* Dialog data for a {@link MtnaWfFormItemDialogComponent}
|
|
4
|
+
*/
|
|
5
|
+
export declare class MtnaWfFormItemDialogData {
|
|
6
|
+
formItems: FormItem[];
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @param formItems The form items to render in the dialog
|
|
10
|
+
* @param title optional dialog title
|
|
11
|
+
*/
|
|
12
|
+
constructor(formItems: FormItem[], title?: string | undefined);
|
|
13
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
4
|
+
import { ThemePalette } from '@angular/material/core';
|
|
5
|
+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
6
|
+
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
|
7
|
+
import { CanDestroyNotify, MtnaLogger } from '@mtna/core-angular';
|
|
8
|
+
import { AnnotationIndicatorStatus, IndicatorStatusRepeater } from '@mtna/pojo-social-angular';
|
|
9
|
+
import { BooleanItem, CheckboxItem, FormItem, FormItemGroupImpl, MultipleChoiceItem, RepeatableItem, Section, TableItem, TableRowItem, ValueItem } from '@mtna/web-form-ts';
|
|
10
|
+
import { Observable, Subject } from 'rxjs';
|
|
11
|
+
import { MtnaWfManagerService } from '../core/services/form-manager.service';
|
|
12
|
+
import { MtnaWfUIService } from '../core/services/ui.service';
|
|
13
|
+
import { BaseParentItemControl } from '../form-item-controls/base-parent-item-control.directive';
|
|
14
|
+
import { BaseSingleSelectionParent } from '../form-item-controls/base-single-selection-parent.directive';
|
|
15
|
+
import { MtnaWfFormItemDirective } from '../form/form-item.directive';
|
|
16
|
+
import { FormStep } from '../form-stepper/models/form-step.model';
|
|
17
|
+
import { MtnaWfItemWhiteList } from '../form/white-list.model';
|
|
18
|
+
import { MtnaWfFormItemDialogData } from './form-item-dialog-data.model';
|
|
19
|
+
import type { BaseFormItem } from '../form/base-form-item.model';
|
|
20
|
+
import * as i0 from "@angular/core";
|
|
21
|
+
export declare class MtnaWfDialogService {
|
|
22
|
+
private dialog;
|
|
23
|
+
constructor(dialog: MatDialog);
|
|
24
|
+
/**
|
|
25
|
+
* Display the acknowledgement the user agreed to for a given option.
|
|
26
|
+
* @param acknowledgementItem The {@link Section} that represents the acknowledgement text to display to the user.
|
|
27
|
+
*/
|
|
28
|
+
showAcknowledgement(acknowledgementItem: Section): void;
|
|
29
|
+
/**
|
|
30
|
+
* Show some text in a dialog that the user needs to "acknowledge" before they can make a certain selection.
|
|
31
|
+
* @param acknowledgementItem The {@link Section} that represents the text displayed to the user for acknowledgement.
|
|
32
|
+
* @returns Whether the user acknowledges (agrees).
|
|
33
|
+
*/
|
|
34
|
+
verifyAcknowledgement(acknowledgementItem: Section): Observable<boolean>;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfDialogService, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MtnaWfDialogService>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A dialog that renders a form item that represents something the user needs to acknowledge.
|
|
40
|
+
*/
|
|
41
|
+
export declare class MtnaWfAcknowledgeDialogComponent {
|
|
42
|
+
data: MtnaWfFormItemDialogData;
|
|
43
|
+
dialogRef: MatDialogRef<MtnaWfAcknowledgeDialogComponent, boolean>;
|
|
44
|
+
constructor(data: MtnaWfFormItemDialogData, dialogRef: MatDialogRef<MtnaWfAcknowledgeDialogComponent, boolean>);
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfAcknowledgeDialogComponent, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfAcknowledgeDialogComponent, "mtna-wf-acknowledge-dialog", never, {}, {}, never, never>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Component that wraps an MtnaForm item.
|
|
50
|
+
*
|
|
51
|
+
* ChangeDetectionStrategy.OnPush was not working as of 9/19/2018.
|
|
52
|
+
* Dynamic components in the ValueItemComponent were not being initialized (ngOnInit was never called).
|
|
53
|
+
*
|
|
54
|
+
* @export
|
|
55
|
+
*/
|
|
56
|
+
export declare class MtnaWfFormItemComponent implements OnInit {
|
|
57
|
+
private _elementRef;
|
|
58
|
+
private uiService;
|
|
59
|
+
visible: boolean;
|
|
60
|
+
get elementId(): string;
|
|
61
|
+
item: FormItem;
|
|
62
|
+
readonly: boolean;
|
|
63
|
+
control: AbstractControl | null | undefined;
|
|
64
|
+
parentIds: string[];
|
|
65
|
+
step: FormStep | null | undefined;
|
|
66
|
+
focusedSection: EventEmitter<FormStep>;
|
|
67
|
+
annotations$?: Observable<number | null>;
|
|
68
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
69
|
+
constructor(_elementRef: ElementRef, uiService: MtnaWfUIService);
|
|
70
|
+
ngOnInit(): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfFormItemComponent, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfFormItemComponent, "mtna-wf-item", never, { "item": "item"; "readonly": "readonly"; "control": "control"; "parentIds": "parentIds"; "step": "step"; }, { "focusedSection": "focusedSection"; }, never, never>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A dialog that renders a form item.
|
|
76
|
+
*/
|
|
77
|
+
export declare class MtnaWfFormItemDialogComponent {
|
|
78
|
+
data: MtnaWfFormItemDialogData;
|
|
79
|
+
dialogRef: MatDialogRef<MtnaWfFormItemDialogComponent>;
|
|
80
|
+
constructor(data: MtnaWfFormItemDialogData, dialogRef: MatDialogRef<MtnaWfFormItemDialogComponent>);
|
|
81
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfFormItemDialogComponent, never>;
|
|
82
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfFormItemDialogComponent, "mtna-wf-form-item-dialog", never, {}, {}, never, never>;
|
|
83
|
+
}
|
|
84
|
+
export declare class MtnaWfFormSectionComponent implements IndicatorStatusRepeater {
|
|
85
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
86
|
+
item: Section;
|
|
87
|
+
readonly: boolean;
|
|
88
|
+
step: FormStep | undefined | null;
|
|
89
|
+
control: FormGroup | null | undefined;
|
|
90
|
+
parentIds: string[];
|
|
91
|
+
focused: EventEmitter<FormStep>;
|
|
92
|
+
_trackByInstanceId(index: number, item: FormItem): string;
|
|
93
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfFormSectionComponent, never>;
|
|
94
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfFormSectionComponent, "mtna-wf-section", never, { "indicatorStatus": "indicatorStatus"; "item": "item"; "readonly": "readonly"; "step": "step"; "control": "control"; "parentIds": "parentIds"; }, { "focused": "focused"; }, never, never>;
|
|
95
|
+
}
|
|
96
|
+
export declare class MtnaWfFormGroupComponent implements IndicatorStatusRepeater {
|
|
97
|
+
control: FormGroup | null | undefined;
|
|
98
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
99
|
+
get item(): FormItemGroupImpl | null | undefined;
|
|
100
|
+
set item(item: FormItemGroupImpl | null | undefined);
|
|
101
|
+
private _item;
|
|
102
|
+
parentIds: Array<string>;
|
|
103
|
+
readonly: boolean;
|
|
104
|
+
fullWidth: {
|
|
105
|
+
[id: string]: boolean;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* If form is readonly & all child items are one of the specified types below,
|
|
109
|
+
* we want to display this group's child items in a mat-list
|
|
110
|
+
*/
|
|
111
|
+
inList: boolean;
|
|
112
|
+
_trackByInstanceId(index: number, section: FormItem): string;
|
|
113
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfFormGroupComponent, never>;
|
|
114
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfFormGroupComponent, "mtna-wf-group", never, { "control": "control"; "indicatorStatus": "indicatorStatus"; "item": "item"; "parentIds": "parentIds"; "readonly": "readonly"; }, {}, never, never>;
|
|
115
|
+
}
|
|
116
|
+
export declare class RepeatableItemContainerComponent implements IndicatorStatusRepeater {
|
|
117
|
+
private manager;
|
|
118
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
119
|
+
item: RepeatableItem;
|
|
120
|
+
control: FormGroup | null | undefined;
|
|
121
|
+
parentIds: string[];
|
|
122
|
+
readonly: boolean;
|
|
123
|
+
constructor(manager: MtnaWfManagerService);
|
|
124
|
+
addItem(): void;
|
|
125
|
+
removeItem(item: FormItem): void;
|
|
126
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RepeatableItemContainerComponent, never>;
|
|
127
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RepeatableItemContainerComponent, "mtna-wf-repeatable-item-container", never, { "indicatorStatus": "indicatorStatus"; "item": "item"; "control": "control"; "parentIds": "parentIds"; "readonly": "readonly"; }, {}, never, never>;
|
|
128
|
+
}
|
|
129
|
+
export declare class MtnaWfTableFormItemComponent implements IndicatorStatusRepeater {
|
|
130
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
131
|
+
item: TableItem;
|
|
132
|
+
control: FormGroup | null | undefined;
|
|
133
|
+
readonly: boolean;
|
|
134
|
+
parentIds: string[];
|
|
135
|
+
_trackByTableRow(index: number, row: TableRowItem): string;
|
|
136
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfTableFormItemComponent, never>;
|
|
137
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfTableFormItemComponent, "mtna-wf-table-item", never, { "indicatorStatus": "indicatorStatus"; "item": "item"; "control": "control"; "readonly": "readonly"; "parentIds": "parentIds"; }, {}, never, never>;
|
|
138
|
+
}
|
|
139
|
+
export declare class ValueItemComponent implements AfterViewInit, IndicatorStatusRepeater, OnChanges, OnDestroy {
|
|
140
|
+
private cdf;
|
|
141
|
+
private cfResolver;
|
|
142
|
+
private formManager;
|
|
143
|
+
private logger;
|
|
144
|
+
private whiteList;
|
|
145
|
+
/** the container for adding dynamic form items */
|
|
146
|
+
itemHost: MtnaWfFormItemDirective | null | undefined;
|
|
147
|
+
control: AbstractControl | null | undefined;
|
|
148
|
+
inList: boolean;
|
|
149
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
150
|
+
item: ValueItem<unknown>;
|
|
151
|
+
parentIds: string[];
|
|
152
|
+
readonly: boolean;
|
|
153
|
+
/** the reference to a dynamically rendered component */
|
|
154
|
+
componentRef: ComponentRef<BaseFormItem> | null | undefined;
|
|
155
|
+
/** The list of pre-existing(non-dynamic) item types
|
|
156
|
+
* If this item's itemId does not match one of the following, then
|
|
157
|
+
* this item is a dynamic component registered by the client application
|
|
158
|
+
* & requires the ComponentFactory to create the component.
|
|
159
|
+
*/
|
|
160
|
+
fixedItemTypes: string[];
|
|
161
|
+
constructor(cdf: ChangeDetectorRef, cfResolver: ComponentFactoryResolver, formManager: MtnaWfManagerService, logger: MtnaLogger, whiteList: MtnaWfItemWhiteList);
|
|
162
|
+
/**
|
|
163
|
+
* Sets a value on the control for any components that only emit a value &
|
|
164
|
+
* do not directly manipulate their control themselves, i.e. a FileUploadItem
|
|
165
|
+
*
|
|
166
|
+
* @param item the value to be set on the control
|
|
167
|
+
*/
|
|
168
|
+
setValue(item: unknown): void;
|
|
169
|
+
/**
|
|
170
|
+
* Renders a dynamic component from a relevant type in the FormService (registered)components;
|
|
171
|
+
* ONLY if the item type(using itemId) does not match one of the existing fixedItemTypes
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
ngAfterViewInit(): void;
|
|
175
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
176
|
+
/**
|
|
177
|
+
* Used to destroy the componentRef to a dynamic component, if it was rendered.
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
ngOnDestroy(): void;
|
|
181
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueItemComponent, [null, null, null, null, { optional: true; }]>;
|
|
182
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ValueItemComponent, "mtna-wf-value-item", never, { "control": "control"; "inList": "inList"; "indicatorStatus": "indicatorStatus"; "item": "item"; "parentIds": "parentIds"; "readonly": "readonly"; }, {}, never, never>;
|
|
183
|
+
}
|
|
184
|
+
export declare class MtnaWfMultipleChoiceComponent extends BaseSingleSelectionParent<MultipleChoiceItem> {
|
|
185
|
+
constructor(uiService: MtnaWfUIService);
|
|
186
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfMultipleChoiceComponent, never>;
|
|
187
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfMultipleChoiceComponent, "mtna-wf-multiple-choice-item", never, {}, {}, never, never>;
|
|
188
|
+
}
|
|
189
|
+
export declare class MtnaWfBooleanComponent extends BaseParentItemControl<BooleanItem, FormControl> {
|
|
190
|
+
private uiService;
|
|
191
|
+
constructor(uiService: MtnaWfUIService);
|
|
192
|
+
toggleChange(change: MatSlideToggleChange): void;
|
|
193
|
+
_trackByInstanceId(index: number, item: {
|
|
194
|
+
key: string;
|
|
195
|
+
value: FormItem;
|
|
196
|
+
}): string;
|
|
197
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfBooleanComponent, never>;
|
|
198
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfBooleanComponent, "mtna-wf-boolean-item", never, {}, {}, never, never>;
|
|
199
|
+
}
|
|
200
|
+
export declare class MtnaWfCheckboxComponent extends BaseParentItemControl<CheckboxItem, FormArray> implements CanDestroyNotify, OnDestroy {
|
|
201
|
+
private dialogService;
|
|
202
|
+
private uiService;
|
|
203
|
+
color: ThemePalette;
|
|
204
|
+
destroyed$: Subject<void>;
|
|
205
|
+
constructor(dialogService: MtnaWfDialogService, uiService: MtnaWfUIService);
|
|
206
|
+
handleChange(change: MatCheckboxChange, index: number): void;
|
|
207
|
+
ngOnDestroy(): void;
|
|
208
|
+
/**
|
|
209
|
+
* Display what the user already acknowledged for a given option.
|
|
210
|
+
* @param event the browser event when the button was invoked
|
|
211
|
+
* @param acknowledgementItem The form item that represents the acknowledgement text to display to the user.
|
|
212
|
+
* */
|
|
213
|
+
showAcknowledgement(event: Event, acknowledgementItem: Section): void;
|
|
214
|
+
/**
|
|
215
|
+
* Stop a browser event from propagating
|
|
216
|
+
* @param event the event to stop
|
|
217
|
+
*/
|
|
218
|
+
stopEventPropagation(event: Event): void;
|
|
219
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfCheckboxComponent, never>;
|
|
220
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfCheckboxComponent, "mtna-wf-checkbox-item", never, { "color": "color"; }, {}, never, never>;
|
|
221
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RepeatableItemComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RepeatableItemComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RepeatableItemComponent, "mtna-wf-repeatable-item", never, {}, {}, never, ["*"]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '~@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin color($theme) {
|
|
5
|
+
$config: mat.get-color-config($theme);
|
|
6
|
+
$warn: map.get($config, warn);
|
|
7
|
+
|
|
8
|
+
mtna-wf-item-header {
|
|
9
|
+
.invalid {
|
|
10
|
+
color: mat.get-color-from-palette($warn);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@mixin typography($theme) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin theme($theme) {
|
|
19
|
+
$config: mat.get-color-config($theme);
|
|
20
|
+
@if $config != null {
|
|
21
|
+
@include color($theme);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
$typography-config: mat.get-typography-config($theme);
|
|
25
|
+
@if $typography-config != null {
|
|
26
|
+
@include typography($theme);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './item-header.component';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Common header html for a form item.
|
|
5
|
+
*
|
|
6
|
+
* @author Will Davis <will.davis@mtna.us>
|
|
7
|
+
*/
|
|
8
|
+
export declare class ItemHeaderComponent {
|
|
9
|
+
static ngAcceptInputType_disabled: BooleanInput;
|
|
10
|
+
static ngAcceptInputType_hideRequiredMarker: BooleanInput;
|
|
11
|
+
static ngAcceptInputType_invalid: BooleanInput;
|
|
12
|
+
itemHeaderClass: boolean;
|
|
13
|
+
/** Optional descriptive text/HTML */
|
|
14
|
+
descriptiveText: string | null | undefined;
|
|
15
|
+
/** Whether the form item is disabled */
|
|
16
|
+
get disabled(): boolean;
|
|
17
|
+
set disabled(disabled: boolean);
|
|
18
|
+
private _disabled;
|
|
19
|
+
/** Whether the required marker (asterix) is hidden. Defaults to false. */
|
|
20
|
+
get hideRequiredMarker(): boolean;
|
|
21
|
+
set hideRequiredMarker(hideRequiredMarker: boolean);
|
|
22
|
+
private _hideRequiredMarker;
|
|
23
|
+
/** Whether the form item is invalid */
|
|
24
|
+
get invalid(): boolean;
|
|
25
|
+
set invalid(invalid: boolean);
|
|
26
|
+
private _invalid;
|
|
27
|
+
/** Optional question text/HTML */
|
|
28
|
+
questionText: string | null | undefined;
|
|
29
|
+
/** Whether the form item is required */
|
|
30
|
+
required: boolean;
|
|
31
|
+
/** HTML to insert for required items */
|
|
32
|
+
_requiredHtml: string;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ItemHeaderComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ItemHeaderComponent, "mtna-wf-item-header", never, { "descriptiveText": "descriptiveText"; "disabled": "disabled"; "hideRequiredMarker": "hideRequiredMarker"; "invalid": "invalid"; "questionText": "questionText"; "required": "required"; }, {}, never, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { AnnotationIndicatorStatus, IndicatorStatusRepeater } from '@mtna/pojo-social-angular';
|
|
3
|
+
import { NumberedListItem } from '@mtna/web-form-ts';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MtnaWfOrderedListItemComponent implements IndicatorStatusRepeater {
|
|
6
|
+
header: TemplateRef<unknown> | null;
|
|
7
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
8
|
+
item: NumberedListItem;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfOrderedListItemComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfOrderedListItemComponent, "mtna-wf-ordered-list-item", never, { "header": "header"; "indicatorStatus": "indicatorStatus"; "item": "item"; }, {}, never, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { AnnotationIndicatorStatus, IndicatorStatusRepeater } from '@mtna/pojo-social-angular';
|
|
3
|
+
import { BulletedListItem } from '@mtna/web-form-ts';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MtnaWfUnorderedListItemComponent implements IndicatorStatusRepeater {
|
|
6
|
+
header: TemplateRef<unknown> | null;
|
|
7
|
+
indicatorStatus: AnnotationIndicatorStatus;
|
|
8
|
+
item: BulletedListItem;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfUnorderedListItemComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfUnorderedListItemComponent, "mtna-wf-unordered-list-item", never, { "header": "header"; "indicatorStatus": "indicatorStatus"; "item": "item"; }, {}, never, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '~@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin color($theme) {
|
|
5
|
+
$config: mat.get-color-config($theme);
|
|
6
|
+
$primary: map.get($config, primary);
|
|
7
|
+
$accent: map.get($config, accent);
|
|
8
|
+
$warn: map.get($config, warn);
|
|
9
|
+
|
|
10
|
+
mtna-wf-step-card {
|
|
11
|
+
&.mat-primary {
|
|
12
|
+
@include _step-card-palette($primary);
|
|
13
|
+
}
|
|
14
|
+
&.mat-accent {
|
|
15
|
+
@include _step-card-palette($accent);
|
|
16
|
+
}
|
|
17
|
+
&.mat-warn {
|
|
18
|
+
@include _step-card-palette($warn);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin typography($theme) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin theme($theme) {
|
|
27
|
+
$config: mat.get-color-config($theme);
|
|
28
|
+
@if $config != null {
|
|
29
|
+
@include color($theme);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$typography-config: mat.get-typography-config($theme);
|
|
33
|
+
@if $typography-config != null {
|
|
34
|
+
@include typography($theme);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin _step-card-palette($palette) {
|
|
39
|
+
&::before {
|
|
40
|
+
background-color: mat.get-color-from-palette($palette, default);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './step-card.component';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
2
|
+
import { ElementRef, EventEmitter } from '@angular/core';
|
|
3
|
+
import { CanColor } from '@angular/material/core';
|
|
4
|
+
import { FormStep } from '../form-stepper/models/form-step.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
declare const _StepCardMixinBase: import("@angular/material/core/common-behaviors/constructor").Constructor<CanColor> & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor<CanColor> & {
|
|
7
|
+
new (_elementRef: ElementRef): {
|
|
8
|
+
_elementRef: ElementRef;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare class MtnaWfStepCardComponent extends _StepCardMixinBase implements CanColor {
|
|
12
|
+
get active(): boolean;
|
|
13
|
+
step: FormStep | null | undefined;
|
|
14
|
+
subtitle: string | null | undefined;
|
|
15
|
+
focused: EventEmitter<FormStep>;
|
|
16
|
+
constructor(elementRef: ElementRef);
|
|
17
|
+
handleFocusChange(event: FocusOrigin): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfStepCardComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MtnaWfStepCardComponent, "mtna-wf-step-card", never, { "color": "color"; "step": "step"; "subtitle": "subtitle"; }, { "focused": "focused"; }, never, ["[cardContent]", "[cardActions]"]>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mtna/web-form-angular",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://bitbucket.org/mtnaus/web-form-angular"
|
|
7
|
+
},
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@angular/animations": "12.2.17",
|
|
10
|
+
"@angular/cdk": "12.2.13",
|
|
11
|
+
"@angular/common": "12.2.17",
|
|
12
|
+
"@angular/core": "12.2.17",
|
|
13
|
+
"@angular/flex-layout": "12.0.0-beta.34",
|
|
14
|
+
"@angular/forms": "12.2.17",
|
|
15
|
+
"@angular/localize": "12.2.17",
|
|
16
|
+
"@angular/material": "12.2.13",
|
|
17
|
+
"@angular/material-moment-adapter": "12.2.13",
|
|
18
|
+
"@angular/platform-browser": "12.2.17",
|
|
19
|
+
"@angular/platform-browser-dynamic": "12.2.17",
|
|
20
|
+
"@angular/router": "12.2.17",
|
|
21
|
+
"@mtna/core-angular": "0.0.6",
|
|
22
|
+
"@mtna/file-manager-angular": "0.0.1",
|
|
23
|
+
"@mtna/pojo-social-angular": "0.0.1",
|
|
24
|
+
"@mtna/pojo-social-ts": "0.0.2",
|
|
25
|
+
"@mtna/web-form-ts": "0.0.2",
|
|
26
|
+
"@ngrx/effects": "~12.5.0",
|
|
27
|
+
"@ngrx/store": "~12.5.0",
|
|
28
|
+
"moment": "^2.29.3",
|
|
29
|
+
"moment-jdateformatparser": "^1.2.1",
|
|
30
|
+
"rxjs": "6.6.7",
|
|
31
|
+
"zone.js": "~0.11.4"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"tslib": "^2.3.0"
|
|
35
|
+
},
|
|
36
|
+
"main": "bundles/mtna-web-form-angular.umd.js",
|
|
37
|
+
"module": "fesm2015/mtna-web-form-angular.js",
|
|
38
|
+
"es2015": "fesm2015/mtna-web-form-angular.js",
|
|
39
|
+
"esm2015": "esm2015/mtna-web-form-angular.js",
|
|
40
|
+
"fesm2015": "fesm2015/mtna-web-form-angular.js",
|
|
41
|
+
"typings": "mtna-web-form-angular.d.ts",
|
|
42
|
+
"sideEffects": false
|
|
43
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './lib/core';
|
|
2
|
+
export * from './lib/file-upload';
|
|
3
|
+
export * from './lib/form';
|
|
4
|
+
export * from './lib/form-item-controls';
|
|
5
|
+
export * from './lib/form-stepper';
|
|
6
|
+
export * from './lib/groups';
|
|
7
|
+
export * from './lib/item-header';
|
|
8
|
+
export * from './lib/static-form-items';
|
|
9
|
+
export * from './lib/step-card';
|