@iapps/ng-dhis2-ui 1.1.55 → 1.1.56
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/fesm2022/iapps-ng-dhis2-ui.mjs +570 -2
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/modules/form/containers/flat-form/flat-form.component.d.ts +11 -0
- package/lib/modules/form/form.module.d.ts +7 -6
- package/lib/modules/form/index.d.ts +1 -0
- package/lib/modules/form/shared/components/base-form-wrapper.component.d.ts +26 -0
- package/lib/modules/form/shared/components/index.d.ts +1 -0
- package/lib/modules/form/shared/index.d.ts +1 -0
- package/lib/modules/program-entry-form/index.d.ts +2 -0
- package/lib/modules/program-entry-form/models/index.d.ts +3 -0
- package/lib/modules/program-entry-form/models/program-entry-form-metadata.d.ts +28 -0
- package/lib/modules/program-entry-form/models/program-entry-form-section.model.d.ts +16 -0
- package/lib/modules/program-entry-form/models/program-entry-form.config.d.ts +47 -0
- package/lib/modules/program-entry-form/program-entry-form.component.d.ts +35 -0
- package/lib/modules/program-entry-form/utils/index.d.ts +2 -0
- package/lib/modules/program-entry-form/utils/program-entry-form-field.util.d.ts +62 -0
- package/lib/modules/program-entry-form/utils/program-entry-form-section.util.d.ts +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { BaseFormWrapperComponent } from '../../shared';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class FlatFormComponent extends BaseFormWrapperComponent implements OnInit {
|
|
6
|
+
formGroup: FormGroup;
|
|
7
|
+
ngOnInit(): void;
|
|
8
|
+
onFormUpdate(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlatFormComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FlatFormComponent, "ng-dhis2-ui-flat-form", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -3,13 +3,14 @@ import * as i1 from "./containers/form-field/form-field.component";
|
|
|
3
3
|
import * as i2 from "./containers/form/form.component";
|
|
4
4
|
import * as i3 from "./containers/repeatable-form/repeatable-form.component";
|
|
5
5
|
import * as i4 from "./containers/section-form/section-form.component";
|
|
6
|
-
import * as i5 from "./
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "@angular/
|
|
9
|
-
import * as i8 from "
|
|
10
|
-
import * as i9 from "../
|
|
6
|
+
import * as i5 from "./containers/flat-form/flat-form.component";
|
|
7
|
+
import * as i6 from "./components/form-field-item.component";
|
|
8
|
+
import * as i7 from "@angular/common";
|
|
9
|
+
import * as i8 from "@angular/forms";
|
|
10
|
+
import * as i9 from "../react-wrapper/react-wrapper.component.tsx";
|
|
11
|
+
import * as i10 from "../organisation-unit-selector/organisation-unit-selector.module";
|
|
11
12
|
export declare class D2FormModule {
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<D2FormModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<D2FormModule, [typeof i1.FormFieldComponent, typeof i2.FormComponent, typeof i3.RepeatableFormComponent, typeof i4.SectionFormComponent, typeof i5.FormFieldItemComponent], [typeof
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<D2FormModule, [typeof i1.FormFieldComponent, typeof i2.FormComponent, typeof i3.RepeatableFormComponent, typeof i4.SectionFormComponent, typeof i5.FlatFormComponent, typeof i6.FormFieldItemComponent], [typeof i7.CommonModule, typeof i8.ReactiveFormsModule, typeof i9.ReactWrapperModule, typeof i10.OrganisationUnitSelectorModule], [typeof i1.FormFieldComponent, typeof i2.FormComponent, typeof i3.RepeatableFormComponent, typeof i4.SectionFormComponent, typeof i5.FlatFormComponent]>;
|
|
14
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<D2FormModule>;
|
|
15
16
|
}
|
|
@@ -3,6 +3,7 @@ export * from './containers/form-field/form-field.component';
|
|
|
3
3
|
export * from './containers/form/form.component';
|
|
4
4
|
export * from './containers/repeatable-form/repeatable-form.component';
|
|
5
5
|
export * from './containers/section-form/section-form.component';
|
|
6
|
+
export * from './containers/flat-form/flat-form.component';
|
|
6
7
|
export * from './models';
|
|
7
8
|
export * from './interfaces';
|
|
8
9
|
export * from './utils';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EffectRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
|
|
2
|
+
import { IFormField } from '../../interfaces';
|
|
3
|
+
import { IMetadataRule, IMetadataRuleAction } from '../../models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class BaseFormWrapperComponent implements OnDestroy {
|
|
6
|
+
#private;
|
|
7
|
+
ngZone: NgZone;
|
|
8
|
+
name: import("@angular/core").InputSignal<string>;
|
|
9
|
+
fields: import("@angular/core").InputSignal<IFormField<string>[]>;
|
|
10
|
+
rules: import("@angular/core").InputSignal<IMetadataRule[]>;
|
|
11
|
+
dataValues: import("@angular/core").InputSignal<Record<string, unknown>>;
|
|
12
|
+
ruleActions: import("@angular/core").WritableSignal<IMetadataRuleAction[]>;
|
|
13
|
+
isFormValid: import("@angular/core").WritableSignal<boolean>;
|
|
14
|
+
formSave: EventEmitter<Record<string, unknown>>;
|
|
15
|
+
formUpdate: EventEmitter<Record<string, unknown>>;
|
|
16
|
+
formCancel: EventEmitter<void>;
|
|
17
|
+
formValidityUpdate: EventEmitter<boolean>;
|
|
18
|
+
ruleProcessor: EffectRef;
|
|
19
|
+
constructor();
|
|
20
|
+
updateDataValues(dataValues: Record<string, unknown>): void;
|
|
21
|
+
updateFormValidity(isFormValid: boolean): void;
|
|
22
|
+
protected executeRules(): void;
|
|
23
|
+
ngOnDestroy(): void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormWrapperComponent, never>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormWrapperComponent, never, never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": true; "isSignal": true; }; "rules": { "alias": "rules"; "required": false; "isSignal": true; }; "dataValues": { "alias": "dataValues"; "required": false; "isSignal": true; }; }, { "formSave": "formSave"; "formUpdate": "formUpdate"; "formCancel": "formCancel"; "formValidityUpdate": "formValidityUpdate"; }, never, never, true, never>;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './base-form-wrapper.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
2
|
+
import { ProgramEntryFormConfig } from './program-entry-form.config';
|
|
3
|
+
import { IFormField, IMetadataRule } from '../../form';
|
|
4
|
+
import { IProgramEntryFormSection } from './program-entry-form-section.model';
|
|
5
|
+
export interface IProgramEntryFormMetaData {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
formFields: IFormField<string>[];
|
|
10
|
+
sections: IProgramEntryFormSection[];
|
|
11
|
+
rules: IMetadataRule[];
|
|
12
|
+
}
|
|
13
|
+
export declare class ProgramEntryFormMetaData implements IProgramEntryFormMetaData {
|
|
14
|
+
#private;
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
d2: import("@iapps/d2-web-sdk").D2Web;
|
|
19
|
+
config: ProgramEntryFormConfig;
|
|
20
|
+
metaData: Program;
|
|
21
|
+
setConfig(config: ProgramEntryFormConfig): ProgramEntryFormMetaData;
|
|
22
|
+
getProgramPromise(): Promise<import("@iapps/d2-web-sdk").D2Response<Program>>;
|
|
23
|
+
get formFields(): IFormField<string>[];
|
|
24
|
+
get sections(): IProgramEntryFormSection[];
|
|
25
|
+
get rules(): IMetadataRule[];
|
|
26
|
+
toJson(): IProgramEntryFormMetaData;
|
|
27
|
+
get(): Promise<IProgramEntryFormMetaData>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IFormField } from '../../form';
|
|
2
|
+
export interface IProgramEntryFormSection {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
formFields: IFormField<string>[];
|
|
7
|
+
orientation: 'HORIZONTAL' | 'VERTICAL';
|
|
8
|
+
}
|
|
9
|
+
export declare class ProgramEntryFormSection implements IProgramEntryFormSection {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
formFields: IFormField<string>[];
|
|
14
|
+
orientation: 'HORIZONTAL' | 'VERTICAL';
|
|
15
|
+
constructor(props: IProgramEntryFormSection);
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type AutoAssignedValues = {
|
|
2
|
+
field: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export interface IProgramEntryFormConfig {
|
|
6
|
+
program: string;
|
|
7
|
+
programStage?: string;
|
|
8
|
+
displayType: 'FLAT' | 'SECTION' | 'CUSTOM';
|
|
9
|
+
formType: 'TRACKER' | 'EVENT';
|
|
10
|
+
hideRegistrationUnit?: boolean;
|
|
11
|
+
hideEnrollmentDate?: boolean;
|
|
12
|
+
hideTrackedEntityTypeAttributes?: boolean;
|
|
13
|
+
disableRegistrationUnit?: boolean;
|
|
14
|
+
disableEnrollmentDate?: boolean;
|
|
15
|
+
disabledIncidentDate?: boolean;
|
|
16
|
+
excludeProgramStages?: boolean;
|
|
17
|
+
includedProgramStages?: string[];
|
|
18
|
+
submitButtonLabel?: string;
|
|
19
|
+
cancelButtonLabel?: string;
|
|
20
|
+
hideActionButtons?: boolean;
|
|
21
|
+
hideSubmitButton?: boolean;
|
|
22
|
+
hideCancelButton?: boolean;
|
|
23
|
+
ignoreRepeatability?: boolean;
|
|
24
|
+
autoAssignedValues?: AutoAssignedValues[];
|
|
25
|
+
}
|
|
26
|
+
export declare class ProgramEntryFormConfig implements IProgramEntryFormConfig {
|
|
27
|
+
program: string;
|
|
28
|
+
programStage?: string;
|
|
29
|
+
displayType: 'FLAT' | 'SECTION' | 'CUSTOM';
|
|
30
|
+
formType: 'TRACKER' | 'EVENT';
|
|
31
|
+
hideRegistrationUnit?: boolean;
|
|
32
|
+
hideEnrollmentDate?: boolean;
|
|
33
|
+
hideTrackedEntityTypeAttributes?: boolean;
|
|
34
|
+
disableRegistrationUnit?: boolean;
|
|
35
|
+
disableEnrollmentDate?: boolean;
|
|
36
|
+
disabledIncidentDate?: boolean;
|
|
37
|
+
excludeProgramStages?: boolean;
|
|
38
|
+
includedProgramStages?: string[];
|
|
39
|
+
submitButtonLabel: string;
|
|
40
|
+
cancelButtonLabel: string;
|
|
41
|
+
hideActionButtons?: boolean;
|
|
42
|
+
hideSubmitButton?: boolean;
|
|
43
|
+
hideCancelButton?: boolean;
|
|
44
|
+
ignoreRepeatability?: boolean;
|
|
45
|
+
autoAssignedValues?: AutoAssignedValues[];
|
|
46
|
+
constructor(config: IProgramEntryFormConfig);
|
|
47
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EventEmitter, NgZone } from '@angular/core';
|
|
2
|
+
import { IProgramEntryFormMetaData, ProgramEntryFormConfig } from './models';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { BaseEventQuery, BaseTrackerQuery, D2EventResponse, D2TrackerResponse, DHIS2Event, TrackedEntityInstance } from '@iapps/d2-web-sdk';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ProgramEntryFormModule {
|
|
8
|
+
#private;
|
|
9
|
+
config: import("@angular/core").InputSignal<ProgramEntryFormConfig>;
|
|
10
|
+
trackedEntity: import("@angular/core").InputSignal<string>;
|
|
11
|
+
event: import("@angular/core").InputSignal<string>;
|
|
12
|
+
enrollment: import("@angular/core").InputSignal<string>;
|
|
13
|
+
orgUnit: import("@angular/core").InputSignal<string>;
|
|
14
|
+
ngZone: NgZone;
|
|
15
|
+
d2: import("@iapps/d2-web-sdk").D2Web;
|
|
16
|
+
loading: import("@angular/core").WritableSignal<boolean>;
|
|
17
|
+
metaData: import("@angular/core").WritableSignal<IProgramEntryFormMetaData>;
|
|
18
|
+
isFormValid: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
isFormValid$: Observable<boolean>;
|
|
20
|
+
instance: import("@angular/core").WritableSignal<TrackedEntityInstance | DHIS2Event>;
|
|
21
|
+
instanceQuery: BaseTrackerQuery<TrackedEntityInstance> | BaseEventQuery<DHIS2Event>;
|
|
22
|
+
instanceSave: EventEmitter<TrackedEntityInstance | DHIS2Event>;
|
|
23
|
+
instanceSaveCompleted: EventEmitter<D2TrackerResponse<TrackedEntityInstance> | D2EventResponse<DHIS2Event>>;
|
|
24
|
+
instanceUpdate: EventEmitter<TrackedEntityInstance | DHIS2Event>;
|
|
25
|
+
formValidityUpdate: EventEmitter<boolean>;
|
|
26
|
+
formCancel: EventEmitter<any>;
|
|
27
|
+
FormLoader: () => React.JSX.Element;
|
|
28
|
+
FormActionButtons: import("@angular/core").Signal<React.JSX.Element | (() => React.JSX.Element)>;
|
|
29
|
+
ngOnInit(): Promise<void>;
|
|
30
|
+
onFormUpdate(dataValues: Record<string, unknown>): void;
|
|
31
|
+
onValidityUpdate(isFormValid: boolean): void;
|
|
32
|
+
onCancel(): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProgramEntryFormModule, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ProgramEntryFormModule, "ng-dhis2-ui-program-entry-form", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "trackedEntity": { "alias": "trackedEntity"; "required": false; "isSignal": true; }; "event": { "alias": "event"; "required": false; "isSignal": true; }; "enrollment": { "alias": "enrollment"; "required": false; "isSignal": true; }; "orgUnit": { "alias": "orgUnit"; "required": false; "isSignal": true; }; }, { "instanceSave": "instanceSave"; "instanceSaveCompleted": "instanceSaveCompleted"; "instanceUpdate": "instanceUpdate"; "formValidityUpdate": "formValidityUpdate"; "formCancel": "formCancel"; }, never, never, true, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
2
|
+
import { ProgramEntryFormConfig } from '../models';
|
|
3
|
+
import { FormField, IFormField } from '../../form';
|
|
4
|
+
export declare class ProgramEntryFormFieldUtil {
|
|
5
|
+
#private;
|
|
6
|
+
private program;
|
|
7
|
+
private config;
|
|
8
|
+
constructor(program: Program, config: ProgramEntryFormConfig);
|
|
9
|
+
get attributes(): {
|
|
10
|
+
sortOrder: number;
|
|
11
|
+
mandatory: boolean;
|
|
12
|
+
allowFutureDate: boolean;
|
|
13
|
+
metaType: string;
|
|
14
|
+
stepId: any;
|
|
15
|
+
formName?: string;
|
|
16
|
+
valueType: string;
|
|
17
|
+
aggregationType?: string;
|
|
18
|
+
generated?: boolean;
|
|
19
|
+
unique?: boolean;
|
|
20
|
+
optionSetValue?: boolean;
|
|
21
|
+
optionSetValueCount?: number;
|
|
22
|
+
optionSet?: import("@iapps/d2-web-sdk").OptionSet;
|
|
23
|
+
id: string;
|
|
24
|
+
lastUpdated: string;
|
|
25
|
+
created: string;
|
|
26
|
+
name: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
shortName: string;
|
|
29
|
+
code?: string;
|
|
30
|
+
attributeValues?: any[];
|
|
31
|
+
}[];
|
|
32
|
+
get dataElements(): {
|
|
33
|
+
sortOrder: number;
|
|
34
|
+
mandatory: boolean;
|
|
35
|
+
allowFutureDate: boolean;
|
|
36
|
+
stepId: string;
|
|
37
|
+
metaType: string;
|
|
38
|
+
formName?: string;
|
|
39
|
+
valueType: string;
|
|
40
|
+
aggregationType: string;
|
|
41
|
+
domainType: string;
|
|
42
|
+
displayDescription?: string;
|
|
43
|
+
displayFormName?: string;
|
|
44
|
+
skipSynchronization?: boolean;
|
|
45
|
+
zeroIsSignificant?: boolean;
|
|
46
|
+
periodOffset?: number;
|
|
47
|
+
optionSetValue?: boolean;
|
|
48
|
+
optionSet?: import("@iapps/d2-web-sdk").OptionSet;
|
|
49
|
+
programStageId?: string;
|
|
50
|
+
isProgramStageRepeatable?: boolean;
|
|
51
|
+
id: string;
|
|
52
|
+
lastUpdated: string;
|
|
53
|
+
created: string;
|
|
54
|
+
name: string;
|
|
55
|
+
displayName: string;
|
|
56
|
+
shortName: string;
|
|
57
|
+
code?: string;
|
|
58
|
+
attributeValues?: any[];
|
|
59
|
+
}[];
|
|
60
|
+
get reportFields(): FormField<string>[];
|
|
61
|
+
get fields(): IFormField<string>[];
|
|
62
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
2
|
+
import { IProgramEntryFormSection, ProgramEntryFormConfig } from '../models';
|
|
3
|
+
export declare class ProgramEntryFormSectionUtil {
|
|
4
|
+
private program;
|
|
5
|
+
private config;
|
|
6
|
+
constructor(program: Program, config: ProgramEntryFormConfig);
|
|
7
|
+
get sections(): IProgramEntryFormSection[];
|
|
8
|
+
}
|