@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
package/lib/_index.scss
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Theme bundles
|
|
2
|
+
@forward './lib/core/all-color' show all-component-colors;
|
|
3
|
+
@forward './lib/core/all-theme' show all-component-themes;
|
|
4
|
+
@forward './lib/core/all-typography' show all-component-typographies;
|
|
5
|
+
|
|
6
|
+
// Component themes
|
|
7
|
+
@forward './lib/form-item-controls/date-item-theme' as date-item-* show date-item-theme, date-item-color, date-item-typography;
|
|
8
|
+
@forward './lib/form-item-controls/form-control-theme' as form-control-* show form-control-theme, form-control-color,
|
|
9
|
+
form-control-typography;
|
|
10
|
+
@forward './lib/form-item-controls/year-quarter-item-theme' as year-quarter-item-* show year-quarter-item-theme,
|
|
11
|
+
year-quarter-item-color, year-quarter-item-typography;
|
|
12
|
+
@forward './lib/form-stepper/form-step-group-theme' as form-step-group-* show form-step-group-theme, form-step-group-color,
|
|
13
|
+
form-step-group-typography;
|
|
14
|
+
@forward './lib/form-stepper/form-stepper-theme' as form-stepper-* show form-stepper-theme, form-stepper-color,
|
|
15
|
+
form-stepper-typography;
|
|
16
|
+
@forward './lib/groups/checkbox-theme' as checkbox-* show checkbox-theme, checkbox-color, checkbox-typography;
|
|
17
|
+
@forward './lib/groups/form-group-theme' as form-group-* show form-group-theme, form-group-color, form-group-typography;
|
|
18
|
+
@forward './lib/groups/multiple-choice-theme' as multiple-choice-* show multiple-choice-theme, multiple-choice-color,
|
|
19
|
+
multiple-choice-typography;
|
|
20
|
+
@forward './lib/groups/repeatable-item-theme' as repeatable-item-* show repeatable-item-theme, repeatable-item-color,
|
|
21
|
+
repeatable-item-typography;
|
|
22
|
+
@forward './lib/item-header/item-header-theme' as item-header-* show item-header-theme, item-header-color, item-header-typography;
|
|
23
|
+
@forward './lib/step-card/step-card-theme' as step-card-* show step-card-theme, step-card-color, step-card-typography;
|
|
24
|
+
|
|
25
|
+
@forward './lib/core/core-theme' as core-* show core-theme;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use '../form-item-controls/date-item-theme';
|
|
2
|
+
@use '../form-item-controls/form-control-theme';
|
|
3
|
+
@use '../form-item-controls/year-quarter-item-theme';
|
|
4
|
+
@use '../form-stepper/form-step-group-theme';
|
|
5
|
+
@use '../form-stepper/form-stepper-theme';
|
|
6
|
+
@use '../groups/checkbox-theme';
|
|
7
|
+
@use '../groups/form-group-theme';
|
|
8
|
+
@use '../groups/multiple-choice-theme';
|
|
9
|
+
@use '../groups/repeatable-item-theme';
|
|
10
|
+
@use '../item-header/item-header-theme';
|
|
11
|
+
@use '../step-card/step-card-theme';
|
|
12
|
+
|
|
13
|
+
@mixin all-component-colors($theme) {
|
|
14
|
+
@include checkbox-theme.color($theme);
|
|
15
|
+
@include date-item-theme.color($theme);
|
|
16
|
+
@include form-control-theme.color($theme);
|
|
17
|
+
@include form-group-theme.color($theme);
|
|
18
|
+
@include form-step-group-theme.color($theme);
|
|
19
|
+
@include form-stepper-theme.color($theme);
|
|
20
|
+
@include item-header-theme.color($theme);
|
|
21
|
+
@include multiple-choice-theme.color($theme);
|
|
22
|
+
@include repeatable-item-theme.color($theme);
|
|
23
|
+
@include step-card-theme.color($theme);
|
|
24
|
+
@include year-quarter-item-theme.color($theme);
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use '../form-item-controls/date-item-theme';
|
|
2
|
+
@use '../form-item-controls/form-control-theme';
|
|
3
|
+
@use '../form-item-controls/year-quarter-item-theme';
|
|
4
|
+
@use '../form-stepper/form-step-group-theme';
|
|
5
|
+
@use '../form-stepper/form-stepper-theme';
|
|
6
|
+
@use '../groups/checkbox-theme';
|
|
7
|
+
@use '../groups/form-group-theme';
|
|
8
|
+
@use '../groups/multiple-choice-theme';
|
|
9
|
+
@use '../groups/repeatable-item-theme';
|
|
10
|
+
@use '../item-header/item-header-theme';
|
|
11
|
+
@use '../step-card/step-card-theme';
|
|
12
|
+
|
|
13
|
+
@use './core-theme';
|
|
14
|
+
|
|
15
|
+
@mixin all-component-themes($theme) {
|
|
16
|
+
@include checkbox-theme.theme($theme);
|
|
17
|
+
@include core-theme.theme($theme);
|
|
18
|
+
@include date-item-theme.theme($theme);
|
|
19
|
+
@include form-control-theme.theme($theme);
|
|
20
|
+
@include form-group-theme.theme($theme);
|
|
21
|
+
@include form-step-group-theme.theme($theme);
|
|
22
|
+
@include form-stepper-theme.theme($theme);
|
|
23
|
+
@include item-header-theme.theme($theme);
|
|
24
|
+
@include multiple-choice-theme.theme($theme);
|
|
25
|
+
@include repeatable-item-theme.theme($theme);
|
|
26
|
+
@include step-card-theme.theme($theme);
|
|
27
|
+
@include year-quarter-item-theme.theme($theme);
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use '../form-item-controls/date-item-theme';
|
|
2
|
+
@use '../form-item-controls/form-control-theme';
|
|
3
|
+
@use '../form-item-controls/year-quarter-item-theme';
|
|
4
|
+
@use '../form-stepper/form-step-group-theme';
|
|
5
|
+
@use '../form-stepper/form-stepper-theme';
|
|
6
|
+
@use '../groups/checkbox-theme';
|
|
7
|
+
@use '../groups/form-group-theme';
|
|
8
|
+
@use '../groups/multiple-choice-theme';
|
|
9
|
+
@use '../groups/repeatable-item-theme';
|
|
10
|
+
@use '../item-header/item-header-theme';
|
|
11
|
+
@use '../step-card/step-card-theme';
|
|
12
|
+
|
|
13
|
+
@mixin all-component-typographies($theme) {
|
|
14
|
+
@include checkbox-theme.typography($theme);
|
|
15
|
+
@include date-item-theme.typography($theme);
|
|
16
|
+
@include form-control-theme.typography($theme);
|
|
17
|
+
@include form-group-theme.typography($theme);
|
|
18
|
+
@include form-step-group-theme.typography($theme);
|
|
19
|
+
@include form-stepper-theme.typography($theme);
|
|
20
|
+
@include item-header-theme.typography($theme);
|
|
21
|
+
@include multiple-choice-theme.typography($theme);
|
|
22
|
+
@include repeatable-item-theme.typography($theme);
|
|
23
|
+
@include step-card-theme.typography($theme);
|
|
24
|
+
@include year-quarter-item-theme.typography($theme);
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '~@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin theme($theme) {
|
|
5
|
+
$config: mat.get-color-config($theme);
|
|
6
|
+
$background: map.get($config, background);
|
|
7
|
+
$foreground: map.get($config, foreground);
|
|
8
|
+
|
|
9
|
+
mtna-wf-item .mat-list-base {
|
|
10
|
+
padding-top: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.mtna-wf-title-item {
|
|
14
|
+
color: mat.get-color-from-palette($foreground, secondary-text);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Date item disabled appearence when fieldset is disabled */
|
|
18
|
+
mtna-form form fieldset[disabled] .mtna-wf-item .mtna-wf-date-item .mat-form-field.mat-form-field-appearance-outline {
|
|
19
|
+
.mat-form-field-flex {
|
|
20
|
+
& .mat-form-field-outline,
|
|
21
|
+
& .mat-form-field-outline-thick {
|
|
22
|
+
color: mat.get-color-from-palette($background, disabled-button);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.mat-form-field-suffix .mat-datepicker-toggle .mat-icon-button {
|
|
26
|
+
color: mat.get-color-from-palette($background, disabled-button);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mtna-wf-title-item {
|
|
31
|
+
font-size: 1rem;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
letter-spacing: 1px;
|
|
34
|
+
line-height: 32px;
|
|
35
|
+
text-transform: uppercase;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
mtna-wf-section .mtna-wf-title-item {
|
|
39
|
+
font-size: 0.875rem;
|
|
40
|
+
line-height: 28px;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { DateItem, ValueItem } from '@mtna/web-form-ts';
|
|
3
|
+
import { GetObjectTypePipe } from './get-object-type.pipe';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CoerceDateItemPipe implements PipeTransform {
|
|
6
|
+
private objectTypePipe;
|
|
7
|
+
constructor(objectTypePipe: GetObjectTypePipe);
|
|
8
|
+
transform(item: ValueItem<unknown> | undefined | null): DateItem | null;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CoerceDateItemPipe, never>;
|
|
10
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<CoerceDateItemPipe, "coerceDateItem">;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Asserts whether the given control is the narrower FormGroup type. If so, coerces the FormGroup type.
|
|
6
|
+
* Otherwise, returns null.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <form [formGroup]="group | mtnaWfCoerceFormGroup"></form>
|
|
10
|
+
*
|
|
11
|
+
* <form *ngIf="controlContainer.control | mtnaWfCoerceFormGroup as group" [formGroup]="group"></form>
|
|
12
|
+
*
|
|
13
|
+
* @author Chase Moore <chase.moore@mtna.us>
|
|
14
|
+
*/
|
|
15
|
+
export declare class MtnaWfCoerceFormGroupPipe implements PipeTransform {
|
|
16
|
+
/**
|
|
17
|
+
* @param control control to be coerced into a FormGroup
|
|
18
|
+
* @returns the control typed as FormGroup if possible; else null
|
|
19
|
+
*/
|
|
20
|
+
transform(control: AbstractControl | null | undefined): FormGroup | null;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfCoerceFormGroupPipe, never>;
|
|
22
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaWfCoerceFormGroupPipe, "mtnaWfCoerceFormGroup">;
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DateQuarterPipe implements PipeTransform {
|
|
4
|
+
transform(quarter: 0 | 1 | 2 | 3, format?: string): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateQuarterPipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DateQuarterPipe, "mtnaWfDateQuarter">;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class GetAutoCompletePipe implements PipeTransform {
|
|
4
|
+
transform(label: string | null | undefined): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GetAutoCompletePipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<GetAutoCompletePipe, "getAutoComplete">;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { DateRange, YearQuarter } from '@mtna/web-form-ts';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MtnaWfGetAvailableQuartersPipe implements PipeTransform {
|
|
5
|
+
transform(year: number | null | undefined, limits: DateRange<YearQuarter> | null | undefined): number[];
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfGetAvailableQuartersPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaWfGetAvailableQuartersPipe, "mtnaWfGetQuarters">;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { FormItemImpl } from '@mtna/web-form-ts';
|
|
3
|
+
import { MtnaWfUIService } from '../services/ui.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MtnaGetFormControlErrorPipe implements PipeTransform {
|
|
6
|
+
private uiService;
|
|
7
|
+
constructor(uiService: MtnaWfUIService);
|
|
8
|
+
transform(error: {
|
|
9
|
+
key: string;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}, item?: FormItemImpl<unknown>): unknown;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaGetFormControlErrorPipe, never>;
|
|
13
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaGetFormControlErrorPipe, "mtnaWfGetControlError">;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class GetListIconPipe implements PipeTransform {
|
|
4
|
+
transform(header: string | null | undefined): string | null;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GetListIconPipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<GetListIconPipe, "getListIcon">;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class GetObjectTypePipe implements PipeTransform {
|
|
4
|
+
transform(id: string): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GetObjectTypePipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<GetObjectTypePipe, "getObjectType">;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { FormOptionSelector, StringOption } from '@mtna/web-form-ts';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MtnaWfGetSelectedOptionNamePipe implements PipeTransform {
|
|
5
|
+
transform(id: string, options: FormOptionSelector<StringOption>[]): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfGetSelectedOptionNamePipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaWfGetSelectedOptionNamePipe, "mtnaWfGetSelectedOptionName">;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./coerce-date-item.pipe";
|
|
3
|
+
import * as i2 from "./date-quarter.pipe";
|
|
4
|
+
import * as i3 from "./get-auto-complete.pipe";
|
|
5
|
+
import * as i4 from "./get-list-icon.pipe";
|
|
6
|
+
import * as i5 from "./get-object-type.pipe";
|
|
7
|
+
import * as i6 from "./get-form-control-error.pipe";
|
|
8
|
+
import * as i7 from "./coerce-form-group.pipe";
|
|
9
|
+
import * as i8 from "./get-available-quarters.pipe";
|
|
10
|
+
import * as i9 from "./get-selected-option.pipe";
|
|
11
|
+
import * as i10 from "./items-with-value.pipe";
|
|
12
|
+
import * as i11 from "./sanitize-html.pipe";
|
|
13
|
+
export declare class PipesModule {
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PipesModule, never>;
|
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PipesModule, [typeof i1.CoerceDateItemPipe, typeof i2.DateQuarterPipe, typeof i3.GetAutoCompletePipe, typeof i4.GetListIconPipe, typeof i5.GetObjectTypePipe, typeof i6.MtnaGetFormControlErrorPipe, typeof i7.MtnaWfCoerceFormGroupPipe, typeof i8.MtnaWfGetAvailableQuartersPipe, typeof i9.MtnaWfGetSelectedOptionNamePipe, typeof i10.MtnaWfItemsWithValuePipe, typeof i11.MtnaWfSanitizeHtmlPipe], never, [typeof i1.CoerceDateItemPipe, typeof i2.DateQuarterPipe, typeof i3.GetAutoCompletePipe, typeof i4.GetListIconPipe, typeof i5.GetObjectTypePipe, typeof i6.MtnaGetFormControlErrorPipe, typeof i7.MtnaWfCoerceFormGroupPipe, typeof i8.MtnaWfGetAvailableQuartersPipe, typeof i9.MtnaWfGetSelectedOptionNamePipe, typeof i10.MtnaWfItemsWithValuePipe, typeof i11.MtnaWfSanitizeHtmlPipe]>;
|
|
16
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PipesModule>;
|
|
17
|
+
}
|
|
18
|
+
export * from './coerce-date-item.pipe';
|
|
19
|
+
export * from './coerce-form-group.pipe';
|
|
20
|
+
export * from './date-quarter.pipe';
|
|
21
|
+
export * from './get-auto-complete.pipe';
|
|
22
|
+
export * from './get-available-quarters.pipe';
|
|
23
|
+
export * from './get-form-control-error.pipe';
|
|
24
|
+
export * from './get-list-icon.pipe';
|
|
25
|
+
export * from './get-object-type.pipe';
|
|
26
|
+
export * from './get-selected-option.pipe';
|
|
27
|
+
export * from './items-with-value.pipe';
|
|
28
|
+
export * from './sanitize-html.pipe';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { FormItem, ValueItem } from '@mtna/web-form-ts';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Returns an array of FormItems that contain a value.
|
|
6
|
+
* Use only for readonly forms
|
|
7
|
+
*/
|
|
8
|
+
export declare class MtnaWfItemsWithValuePipe implements PipeTransform {
|
|
9
|
+
itemsCache: Array<ValueItem<unknown>>;
|
|
10
|
+
transform(items: Array<FormItem> | null | undefined): Array<ValueItem<unknown>>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfItemsWithValuePipe, never>;
|
|
12
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaWfItemsWithValuePipe, "mtnaWfItemsWithValue">;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MtnaWfSanitizeHtmlPipe implements PipeTransform {
|
|
5
|
+
private _sanitizer;
|
|
6
|
+
constructor(_sanitizer: DomSanitizer);
|
|
7
|
+
transform(v: string | null | undefined): SafeHtml;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfSanitizeHtmlPipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MtnaWfSanitizeHtmlPipe, "mtnaWfSanitizeHtml">;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HttpClient, HttpResponse } from '@angular/common/http';
|
|
2
|
+
import { Form as WebForm, FormItemImpl, Template, TemplateItem, TemplateSectionImpl } from '@mtna/web-form-ts';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { MtnaWfApiConfig } from '../api-config';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MtnaWfApiService {
|
|
7
|
+
protected apiConfig: MtnaWfApiConfig;
|
|
8
|
+
protected http: HttpClient;
|
|
9
|
+
API_URL: string;
|
|
10
|
+
FORM_URL: string;
|
|
11
|
+
TEMPLATE_URL: string;
|
|
12
|
+
NEW_TEMPLATE_URL: string;
|
|
13
|
+
NEW_SECTION_URL: string;
|
|
14
|
+
ITEMS_URL: string;
|
|
15
|
+
ITEM_INSTANCE_URL: string;
|
|
16
|
+
TEMPLATE_SAVE_URL: string;
|
|
17
|
+
TEMPLATE_DELETE_URL: string;
|
|
18
|
+
ALL_TEMPLATES_URL: string;
|
|
19
|
+
constructor(apiConfig: MtnaWfApiConfig, http: HttpClient);
|
|
20
|
+
/**
|
|
21
|
+
* Download a web form
|
|
22
|
+
* @param form the web form pojo to download
|
|
23
|
+
* @returns Full HttlReponse with the Blob as the body
|
|
24
|
+
*/
|
|
25
|
+
downloadForm(form: WebForm): Observable<HttpResponse<Blob>>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a new repeatable FormItem
|
|
28
|
+
* @param formInstanceId template ID of the mtna form
|
|
29
|
+
* @param itemId repeatableTemplateId of the requesting RepeatableItem
|
|
30
|
+
*/
|
|
31
|
+
getRepeatableItem(formInstanceId: string, itemId: string): Observable<FormItemImpl<unknown>>;
|
|
32
|
+
getNewTemplate(): Observable<Template>;
|
|
33
|
+
getAllTemplate(): Observable<Template>;
|
|
34
|
+
getNewSection(): Observable<TemplateSectionImpl>;
|
|
35
|
+
getItems(): Observable<TemplateItem[]>;
|
|
36
|
+
getTemplateItem(id: string): Observable<TemplateItem>;
|
|
37
|
+
saveTemplate(): Observable<Template>;
|
|
38
|
+
getDeleteTemplate(): Observable<Template>;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfApiService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MtnaWfApiService>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { AbstractControl } from '@angular/forms';
|
|
3
|
+
import { ConditionChange, Form, FormItem, FormItemGroup, FormItemImpl, FormItemValidationResult, MtnaWfFormItemChange, MtnaWfFormItemChangeAction, RepeatableItem, Section, ValueItem } from '@mtna/web-form-ts';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
|
+
import { MtnaWfApiService } from './api.service';
|
|
6
|
+
import { MtnaWfNgFormService } from './ng-form.service';
|
|
7
|
+
import { MtnaWfUIService } from './ui.service';
|
|
8
|
+
import type { BaseFormItem } from '../../form';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* Allows a caller to (de)serializae an MtnaForm. It contains the determining logic for returning specific form controls
|
|
12
|
+
* and deserializing new MtnaForms from the reactive values, as well as registering custom Form Items & functions.
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare class MtnaWfManagerService {
|
|
17
|
+
protected apiService: MtnaWfApiService;
|
|
18
|
+
protected ngFormManager: MtnaWfNgFormService;
|
|
19
|
+
protected uiService: MtnaWfUIService;
|
|
20
|
+
protected components: Map<string, Type<BaseFormItem>>;
|
|
21
|
+
protected formChange$: Subject<Form>;
|
|
22
|
+
/** A map of all {@link FormItemValidationResult} keyed on id */
|
|
23
|
+
protected _formItemValidationResults: Record<string, FormItemValidationResult>;
|
|
24
|
+
/** ConditionChanges on 'add' must wait until the form rerenders to toggle items */
|
|
25
|
+
protected itemToggleQue: Array<ConditionChange> | null | undefined;
|
|
26
|
+
protected _mtnaForm: Form | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Observable stream of MtnaForm changes. Used to inform a subscriber that an MtnaForm has been changed.
|
|
29
|
+
*
|
|
30
|
+
* @returns Observable<MtnaForm> to which a caller can subscribe
|
|
31
|
+
*/
|
|
32
|
+
get formChanges(): Observable<Form>;
|
|
33
|
+
constructor(apiService: MtnaWfApiService, ngFormManager: MtnaWfNgFormService, uiService: MtnaWfUIService);
|
|
34
|
+
/**
|
|
35
|
+
* Adds or removes a FormItem from the form & modifies other affected FormItems
|
|
36
|
+
* @param change MtnaWfFormItemChange
|
|
37
|
+
*/
|
|
38
|
+
changeMtnaFormItem(change: MtnaWfFormItemChange): void;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a ConditionChange array for items existing in the <item> which enable/disable FormItems outside the <item>'s scope.
|
|
41
|
+
* @param item FormItem that effects the condition of other FormItems
|
|
42
|
+
* @param action Whether this item was added (ADD), or removed (REMOVE)
|
|
43
|
+
* @returns Array<ConditionChange>
|
|
44
|
+
*/
|
|
45
|
+
generateConditionChangeArray(item: FormItem, action?: MtnaWfFormItemChangeAction): Array<ConditionChange>;
|
|
46
|
+
/** @returns The top level validation results (usually the errors), keyed on ID. */
|
|
47
|
+
getFormItemValidationResults(): Record<string, FormItemValidationResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a new MtnaForm using the previous MtnaForm & reactive form values.
|
|
50
|
+
*
|
|
51
|
+
* @param mtnaForm MtnaForm requiring value insertion
|
|
52
|
+
* @param ngFormValues JSON object of ngForm values
|
|
53
|
+
* @returns new MtnaForm
|
|
54
|
+
*/
|
|
55
|
+
insertNewValues(mtnaForm: Form, ngFormValues: Record<string, unknown>): Form;
|
|
56
|
+
/**
|
|
57
|
+
* Serializes a Form | FormItem into FormControl(s)
|
|
58
|
+
*
|
|
59
|
+
* @param item Form | FormItem requiring serialization
|
|
60
|
+
* @returns FormGroup | FormControl
|
|
61
|
+
*/
|
|
62
|
+
serializeMtnaFormItem(item: Form | FormItemImpl<unknown>): AbstractControl | null;
|
|
63
|
+
getDynamicComponent(id: string): Type<BaseFormItem> | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Registers a map of components to be dynamically rendered inside an MtnaForm.
|
|
66
|
+
*
|
|
67
|
+
* @param components the map of components that a ValueItem will use for rendering
|
|
68
|
+
* @prop string - the type(itemId suffix) of component, used for retrieval
|
|
69
|
+
* @prop Type - the component to be rendered, an extension of BaseFormItem
|
|
70
|
+
*/
|
|
71
|
+
registerDynamicComponents(components: Map<string, Type<BaseFormItem>>): void;
|
|
72
|
+
/**
|
|
73
|
+
* Sets an MtnaForm on the service
|
|
74
|
+
* @param form MtnaForm to be used for internal modification
|
|
75
|
+
*/
|
|
76
|
+
setMtnaForm(form: Form): void;
|
|
77
|
+
/**
|
|
78
|
+
* Any FormService extension class should override this method in order to call the
|
|
79
|
+
* dynamicWebFormItemBuilder/dynamicReactiveFormControlBuilder methods. During web form generation, this method is checked &
|
|
80
|
+
* the current FormItem is passed in, which can be used by the overriding method.
|
|
81
|
+
*
|
|
82
|
+
* @example dynamicFormConditional = (item: FormItem) => item.itemId.includes({some itemId})
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
protected dynamicFormConditional: (item: FormItem) => boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Function to be overridden by extended service in order to handle form generation for any application-specific dynamic form components.
|
|
88
|
+
* Should return a new ValueItem<any>.
|
|
89
|
+
* Step 3
|
|
90
|
+
*
|
|
91
|
+
* @example dynamicWebFormItemBuilder(section: Section | Form, item: FormItem, ngFormValue: any): ValueItem {
|
|
92
|
+
* const newValue = this.generateNewValue(item, rfValue, section);
|
|
93
|
+
* return { ...item, ...newValue }
|
|
94
|
+
* }
|
|
95
|
+
* @param section the current FormSection
|
|
96
|
+
* @param item the current FormItem
|
|
97
|
+
* @param ngFormValue the ngForm JSON value
|
|
98
|
+
* @returns a new ValueItem
|
|
99
|
+
*/
|
|
100
|
+
protected dynamicWebFormItemBuilder(section: Form | FormItemGroup | RepeatableItem | undefined, item: FormItem, ngFormValue: unknown, disabledState?: {
|
|
101
|
+
[instanceId: string]: boolean;
|
|
102
|
+
}): ValueItem<unknown> | null;
|
|
103
|
+
/**
|
|
104
|
+
* Function to be overridden by extended service in order to handle reactive form generation
|
|
105
|
+
* for any application-specific dynamic form components.
|
|
106
|
+
* Should return FormControl | FormGroup.
|
|
107
|
+
*
|
|
108
|
+
* @example dynamicReactiveFormControlBuilder(item: FormItem) {
|
|
109
|
+
* return this.buildFormControlForDynamicComponent(item: FormItem);
|
|
110
|
+
* }
|
|
111
|
+
* @param item FormItem used to generate form controls
|
|
112
|
+
* @returns FormControl | FormGroup
|
|
113
|
+
*/
|
|
114
|
+
protected dynamicReactiveFormControlBuilder(item: FormItem): AbstractControl | null;
|
|
115
|
+
/**
|
|
116
|
+
* Recursively traverses a Form to insert or remove a designated FormItem.
|
|
117
|
+
* @param item MtnaForm to search through
|
|
118
|
+
* @param change: MtnaWfFormItemChange for adding or removing a FormItem
|
|
119
|
+
* @param newItem FormItem to add to its parent
|
|
120
|
+
*/
|
|
121
|
+
protected _modifyFormItem<I extends Form | Section | FormItem | FormItemImpl<unknown>>(item: I, change: MtnaWfFormItemChange, newItem?: FormItem): Form | Section | FormItem | FormItemImpl<unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* Traverses an OptionItemMap of a FormItem to insert or remove a designated FormItem
|
|
124
|
+
* @param optionItem FormItem with an optionItemMap, e.g. OptionItemImpl | OptionGroupItemImpl
|
|
125
|
+
* @param change MtnaWfFormItemChange for adding or removing a FormItem
|
|
126
|
+
* @param newItem FormItem to be added to its parent
|
|
127
|
+
* @returns FormItem with an optionItemMap containing FormItems
|
|
128
|
+
*/
|
|
129
|
+
private _modifyOptionItem;
|
|
130
|
+
/**
|
|
131
|
+
* Traverses table rows to insert or remove a FormItem
|
|
132
|
+
* @param tableItem TableItem to traverse
|
|
133
|
+
* @param change MtnaWfFormItemChange for adding or removing a FormItem
|
|
134
|
+
* @param newItem FormItem to be added to its parent
|
|
135
|
+
* @returns TableItem with a FormItem added or removed
|
|
136
|
+
*/
|
|
137
|
+
private _modifyTableItem;
|
|
138
|
+
/**
|
|
139
|
+
* Adds or removes instanceIds from the 'itemIds' in a FormItem's condition
|
|
140
|
+
* @param form MtnaForm to search through & replace formitems with the new condition
|
|
141
|
+
* @param change The change that recently occurred in the mtnaForm
|
|
142
|
+
*/
|
|
143
|
+
private _modifyFormItemConditions;
|
|
144
|
+
/**
|
|
145
|
+
* Builds a map of all instanceIds inside an item. Checks 'items' & 'optionItemMap'
|
|
146
|
+
* @param item Item to recurse
|
|
147
|
+
* @param idMap map of the item's internal instanceIds
|
|
148
|
+
*/
|
|
149
|
+
private _buildInternalIdsMap;
|
|
150
|
+
/**
|
|
151
|
+
* Builds an array of ConditionChanges to be implemented in an MtnaForm.
|
|
152
|
+
* @param item FormItem that was added/removed, which affects conditions of other FormItems
|
|
153
|
+
* @param changes Array to build up
|
|
154
|
+
* @param internalIdMap Map of all instanceIds located in the item; in order to exclude them from the condition changes
|
|
155
|
+
* @param action Whether the item was added or removed
|
|
156
|
+
*/
|
|
157
|
+
private _buildConditionChangeArray;
|
|
158
|
+
/**
|
|
159
|
+
* Builds an array of ConditionChanges from an item's optionItemMap
|
|
160
|
+
* @param item FormItem with an optionItemMap
|
|
161
|
+
* @param conditions Array of ConditionChanges to push on new changes
|
|
162
|
+
* @param itemMap map of instanceIds exisiting in an item; in order to exclude them from the changes
|
|
163
|
+
* @param action Whether an item was added or removed
|
|
164
|
+
*/
|
|
165
|
+
private _buildArrayFromOptionItemMap;
|
|
166
|
+
/**
|
|
167
|
+
* Pushes a new ConditionChange onto the conditions array. If a ConditionChange with matching id exists,
|
|
168
|
+
* it merges the new values into it
|
|
169
|
+
* @param enablerId instanceId of the item that enables other FormItems
|
|
170
|
+
* @param enabled the item's 'enabledItems' array
|
|
171
|
+
* @param disabled the item's 'disabledItems' array
|
|
172
|
+
* @param conditions Array of ConditionChanges to build up
|
|
173
|
+
* @param itemMap map of instanceIds inside an item; to ensure no internal ids are included in a change
|
|
174
|
+
* @param enable Whether the 'enabledItems' should toggled enabled
|
|
175
|
+
*/
|
|
176
|
+
private _pushConditionToArray;
|
|
177
|
+
/**
|
|
178
|
+
* Store all validation errors on the service.
|
|
179
|
+
* Revalidate form controls that previously had errors or have new errors now.
|
|
180
|
+
*/
|
|
181
|
+
private _updateServerSideErrors;
|
|
182
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfManagerService, never>;
|
|
183
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MtnaWfManagerService>;
|
|
184
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MtnaWfNgFormService {
|
|
5
|
+
private ngForm;
|
|
6
|
+
private unsavedChanges$;
|
|
7
|
+
private valueChangeSubscription;
|
|
8
|
+
/**
|
|
9
|
+
* Informs a caller when the MtnaForm is dirty and has unsaved changes.
|
|
10
|
+
*/
|
|
11
|
+
get unsavedChanges(): Observable<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* Add a control from the ngForm
|
|
14
|
+
* @param controlId id of the control being added
|
|
15
|
+
* @param parentIds array of ids representing the path to the parent control
|
|
16
|
+
* @param newControl the new form control to be added
|
|
17
|
+
*/
|
|
18
|
+
addControl(controlId: string, parentIds: string[], newControl: AbstractControl): void;
|
|
19
|
+
/**
|
|
20
|
+
* Remove a control from the ngForm.
|
|
21
|
+
*
|
|
22
|
+
* @param controlId is of the control to remove
|
|
23
|
+
* @param parentIds rray of ids representing the path to the parent control
|
|
24
|
+
*/
|
|
25
|
+
removeControl(controlId: string, parentIds: string[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the form if it exists
|
|
28
|
+
* @returns the angular form or null
|
|
29
|
+
*/
|
|
30
|
+
getForm(): FormGroup | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a JSON representation of form values
|
|
33
|
+
*/
|
|
34
|
+
getFormValue(): any;
|
|
35
|
+
/**
|
|
36
|
+
* @returns Whether a form has been set on this service
|
|
37
|
+
*/
|
|
38
|
+
hasForm(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @returns Whether the form is dirty.
|
|
41
|
+
*/
|
|
42
|
+
isFormDirty(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Unsubscribes from value changes & sets the ngForm to null.
|
|
45
|
+
* Should be called when any component using an MtnaForm is destroyed.
|
|
46
|
+
*/
|
|
47
|
+
disposeForm(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Forces the unsavedChanges observable to emit true.
|
|
50
|
+
* Use with care, one example is when repeatable items are added/removed from the form.
|
|
51
|
+
*/
|
|
52
|
+
forceUnsavedChange(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Marks ngForm as pristine & untouched.
|
|
55
|
+
*/
|
|
56
|
+
markAsPristineAndUntouched(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Resets the ngForm.
|
|
59
|
+
*/
|
|
60
|
+
resetForm(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Sets a FormGroup on the service so an external source may observe changes.
|
|
63
|
+
* @param ngForm FormGroup to be registered.
|
|
64
|
+
*/
|
|
65
|
+
setForm(ngForm: FormGroup): void;
|
|
66
|
+
/**
|
|
67
|
+
* Subscribes to ngForm status changes & updates the unsavedChanges observable
|
|
68
|
+
*/
|
|
69
|
+
private observeNgFormChanges;
|
|
70
|
+
/**
|
|
71
|
+
* Removes the ngForm status change subscription.
|
|
72
|
+
*/
|
|
73
|
+
private unsubscribeValueChanges;
|
|
74
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MtnaWfNgFormService, never>;
|
|
75
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MtnaWfNgFormService>;
|
|
76
|
+
}
|