@iapps/ng-dhis2-ui 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/iapps-ng-dhis2-ui.mjs +2198 -469
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +3 -1
- package/lib/modules/button/button.component.d.ts +2 -2
- package/lib/modules/form/components/base-form-field.component.d.ts +53 -0
- package/lib/modules/form/components/form-field-item.component.d.ts +6 -0
- package/lib/modules/form/containers/form/form.component.d.ts +32 -0
- package/lib/modules/form/containers/form-field/form-field.component.d.ts +50 -0
- package/lib/modules/form/containers/repeatable-form/repeatable-form.component.d.ts +38 -0
- package/lib/modules/form/containers/section-form/section-form.component.d.ts +32 -0
- package/lib/modules/form/form.module.d.ts +15 -0
- package/lib/modules/form/index.d.ts +8 -0
- package/lib/modules/form/interfaces/field-control-type.interface.d.ts +1 -0
- package/lib/modules/form/interfaces/field-dropdown.interface.d.ts +7 -0
- package/lib/modules/form/interfaces/field-type.interface.d.ts +15 -0
- package/lib/modules/form/interfaces/form-configuration.model.d.ts +63 -0
- package/lib/modules/form/interfaces/form-field-group.interface.d.ts +15 -0
- package/lib/modules/form/interfaces/form-field-meta-type.interface.d.ts +1 -0
- package/lib/modules/form/interfaces/form-field.interface.d.ts +40 -0
- package/lib/modules/form/interfaces/form-metadata-section.interface.d.ts +10 -0
- package/lib/modules/form/interfaces/form-metadata.interface.d.ts +11 -0
- package/lib/modules/form/interfaces/index.d.ts +9 -0
- package/lib/modules/form/models/boolean.model.d.ts +5 -0
- package/lib/modules/form/models/check-box.model.d.ts +5 -0
- package/lib/modules/form/models/date-field.model.d.ts +7 -0
- package/lib/modules/form/models/date-range-value.model.d.ts +4 -0
- package/lib/modules/form/models/dropdown-option.model.d.ts +6 -0
- package/lib/modules/form/models/dropdown.model.d.ts +5 -0
- package/lib/modules/form/models/field-config.model.d.ts +5 -0
- package/lib/modules/form/models/field-dropdown.model.d.ts +10 -0
- package/lib/modules/form/models/fields-data.model.d.ts +8 -0
- package/lib/modules/form/models/form-config.model.d.ts +10 -0
- package/lib/modules/form/models/form-field-group.model.d.ts +21 -0
- package/lib/modules/form/models/form-field.model.d.ts +41 -0
- package/lib/modules/form/models/form-metadata-rule.model.d.ts +28 -0
- package/lib/modules/form/models/form-metadata-section.model.d.ts +28 -0
- package/lib/modules/form/models/form-metadata.model.d.ts +21 -0
- package/lib/modules/form/models/form-value.model.d.ts +19 -0
- package/lib/modules/form/models/form.model.d.ts +14 -0
- package/lib/modules/form/models/index.d.ts +17 -0
- package/lib/modules/form/utils/field-control-type.util.d.ts +4 -0
- package/lib/modules/form/utils/field-type.util.d.ts +3 -0
- package/lib/modules/form/utils/field.util.d.ts +9 -0
- package/lib/modules/form/utils/form-value.util.d.ts +4 -0
- package/lib/modules/form/utils/form.util.d.ts +8 -0
- package/lib/modules/form/utils/index.d.ts +6 -0
- package/lib/modules/form/utils/translation.util.d.ts +3 -0
- package/lib/modules/header-bar/header-bar.component.d.ts +2 -2
- package/lib/modules/line-list/containers/line-list.component.d.ts +6 -5
- package/lib/modules/line-list/models/line-list.models.d.ts +43 -0
- package/lib/modules/line-list/services/line-list.service.d.ts +1 -1
- package/lib/modules/organisation-unit-selector/containers/organisation-unit-selector/organisation-unit-selector.component.d.ts +2 -2
- package/lib/modules/organisation-unit-selector/containers/organisation-unit-selector-modal/organisation-unit-selector-modal.component-modal.d.ts +2 -2
- package/lib/modules/period-selector/containers/period-selector/period-selector.component.d.ts +2 -2
- package/lib/modules/period-selector/containers/period-selector-modal/period-selector-modal.component.d.ts +2 -2
- package/lib/modules/react-wrapper/react-wrapper.component.d.ts +3 -3
- package/lib/modules/tracker-form/index.d.ts +2 -0
- package/lib/modules/tracker-form/tracker-form.component.d.ts +15 -0
- package/lib/modules/tracker-form/tracker-form.module.d.ts +9 -0
- package/lib/shared/components/index.d.ts +1 -2
- package/lib/shared/utils/predefinedDimensions.d.ts +6 -6
- package/package.json +1 -1
- package/lib/modules/react-wrapper/index.d.ts +0 -2
- package/lib/modules/react-wrapper/react-wrapper.module.d.ts +0 -8
- /package/lib/shared/components/{TransferOption.d.ts → transfer-option.component.d.ts} +0 -0
package/index.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ export * from './lib/modules/header-bar';
|
|
|
2
2
|
export * from './lib/modules/button';
|
|
3
3
|
export * from './lib/modules/period-selector';
|
|
4
4
|
export * from './lib/modules/organisation-unit-selector';
|
|
5
|
-
export * from './lib/modules/react-wrapper';
|
|
5
|
+
export * from './lib/modules/react-wrapper/react-wrapper.component';
|
|
6
6
|
export * from './lib/modules/line-list';
|
|
7
|
+
export * from './lib/modules/form';
|
|
8
|
+
export * from './lib/modules/tracker-form';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactWrapperModule } from '../react-wrapper/react-wrapper.component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ButtonComponent extends
|
|
4
|
+
export declare class ButtonComponent extends ReactWrapperModule {
|
|
5
5
|
label: string;
|
|
6
6
|
primary?: boolean;
|
|
7
7
|
secondary?: boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EventEmitter, NgZone, OnChanges, Signal, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ReactWrapperModule } from '../../react-wrapper/react-wrapper.component';
|
|
5
|
+
import { FieldConfig, FormField } from '../models';
|
|
6
|
+
import { OrganisationUnitSelectionConfig } from '../../organisation-unit-selector';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { NgxDhis2HttpClientService } from '@iapps/ngx-dhis2-http-client';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class BaseFormFieldComponent extends ReactWrapperModule implements OnChanges {
|
|
11
|
+
#private;
|
|
12
|
+
ngZone: NgZone;
|
|
13
|
+
httpClient: NgxDhis2HttpClientService;
|
|
14
|
+
fieldType: string;
|
|
15
|
+
field: import("@angular/core").InputSignal<FormField<string>>;
|
|
16
|
+
fieldConfig: import("@angular/core").InputSignal<FieldConfig>;
|
|
17
|
+
form: import("@angular/core").ModelSignal<FormGroup<any>>;
|
|
18
|
+
isValid: import("@angular/core").InputSignal<boolean>;
|
|
19
|
+
uploadedFiles: any;
|
|
20
|
+
value: import("@angular/core").ModelSignal<string>;
|
|
21
|
+
protected value$: Observable<string>;
|
|
22
|
+
FieldOrgUnitSelector: (props: {
|
|
23
|
+
onSelectOrgUnit: (selectedOrgUnits: any) => void;
|
|
24
|
+
onCancelOrgUnit: () => void;
|
|
25
|
+
}) => React.JSX.Element;
|
|
26
|
+
showOrgUnitTree: import("@angular/core").WritableSignal<boolean>;
|
|
27
|
+
orgUnitSelectionConfig: OrganisationUnitSelectionConfig;
|
|
28
|
+
selectedOrgUnit: import("@angular/core").WritableSignal<any>;
|
|
29
|
+
selectedOrgUnit$: Observable<any>;
|
|
30
|
+
label: Signal<string | undefined>;
|
|
31
|
+
placeholder: Signal<string>;
|
|
32
|
+
InputField: () => React.JSX.Element;
|
|
33
|
+
update: EventEmitter<{
|
|
34
|
+
form: FormGroup;
|
|
35
|
+
value: any;
|
|
36
|
+
}>;
|
|
37
|
+
immediateUpdate: EventEmitter<{
|
|
38
|
+
form: FormGroup;
|
|
39
|
+
value: any;
|
|
40
|
+
}>;
|
|
41
|
+
ngAfterViewInit(): Promise<void>;
|
|
42
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
43
|
+
onChange(event: any): void;
|
|
44
|
+
onSelectOrgUnit(selectedOrgUnits: Record<string, string>[]): void;
|
|
45
|
+
onCancelOrgUnit(): void;
|
|
46
|
+
private getAppConfig;
|
|
47
|
+
getOrgUnitAttributeByUsage(usageType: string): "organisationUnits" | "dataViewOrganisationUnits";
|
|
48
|
+
getRootOrgUnits(): Observable<string[]>;
|
|
49
|
+
getOrgUnitGroups(): Promise<any>;
|
|
50
|
+
getOrgUnitLevels(): Promise<any>;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormFieldComponent, never>;
|
|
52
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormFieldComponent, never, never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "fieldConfig": { "alias": "fieldConfig"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": true; "isSignal": true; }; "isValid": { "alias": "isValid"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "form": "formChange"; "value": "valueChange"; "update": "update"; "immediateUpdate": "immediateUpdate"; }, never, never, true, never>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseFormFieldComponent } from './base-form-field.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FormFieldItemComponent extends BaseFormFieldComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldItemComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldItemComponent, "ng-dhis2-ui-form-field-item", never, {}, {}, never, ["*"], false, never>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { FieldsData, FormConfig, FormField } from '../../models';
|
|
4
|
+
import { FormFieldComponent } from '../form-field/form-field.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class FormComponent implements OnChanges {
|
|
7
|
+
formConfig: import("@angular/core").InputSignal<FormConfig>;
|
|
8
|
+
fields: FormField<string>[];
|
|
9
|
+
form: FormGroup;
|
|
10
|
+
isFormHorizontal: boolean;
|
|
11
|
+
showSaveButton: boolean;
|
|
12
|
+
fieldsData: FieldsData;
|
|
13
|
+
fieldClass: string;
|
|
14
|
+
shouldRenderAsCheckBoxesButton: boolean;
|
|
15
|
+
programRuleActions: any[];
|
|
16
|
+
dataEntities: any;
|
|
17
|
+
configuration: import("@angular/core").Signal<FormConfig>;
|
|
18
|
+
formUpdate: EventEmitter<any>;
|
|
19
|
+
fieldComponents: FormFieldComponent[];
|
|
20
|
+
values: any;
|
|
21
|
+
get sanitizedFields(): FormField<string>[];
|
|
22
|
+
get layoutCssClass(): string;
|
|
23
|
+
onUpdateFields(programRuleActions: any): void;
|
|
24
|
+
ngOnChanges(): void;
|
|
25
|
+
onSubmit(): void;
|
|
26
|
+
onFieldUpdate(form: FormGroup, field: FormField<string>): void;
|
|
27
|
+
onClear(): void;
|
|
28
|
+
isFormInValid(): boolean;
|
|
29
|
+
onRunTimeOptionUpdate(result: any): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "ng-dhis2-ui-form", never, { "formConfig": { "alias": "formConfig"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; }; "form": { "alias": "form"; "required": false; }; "isFormHorizontal": { "alias": "isFormHorizontal"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "fieldsData": { "alias": "fieldsData"; "required": false; }; "fieldClass": { "alias": "fieldClass"; "required": false; }; "shouldRenderAsCheckBoxesButton": { "alias": "shouldRenderAsCheckBoxesButton"; "required": false; }; "programRuleActions": { "alias": "programRuleActions"; "required": false; }; "dataEntities": { "alias": "dataEntities"; "required": false; }; }, { "formUpdate": "formUpdate"; }, never, never, false, never>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { FieldConfig, FormField } from '../../models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class FormFieldComponent implements OnInit, OnChanges, OnDestroy {
|
|
7
|
+
field: import("@angular/core").InputSignal<FormField<string>>;
|
|
8
|
+
fieldConfig: FieldConfig;
|
|
9
|
+
form: FormGroup;
|
|
10
|
+
isCheckBoxButton: boolean;
|
|
11
|
+
fieldClass: string;
|
|
12
|
+
programRuleActions: any[];
|
|
13
|
+
dataEntities: any;
|
|
14
|
+
minDate: any;
|
|
15
|
+
maxDate: Date;
|
|
16
|
+
color: string;
|
|
17
|
+
fieldUpdate: EventEmitter<FormGroup>;
|
|
18
|
+
immediateFieldUpdate: EventEmitter<{
|
|
19
|
+
value: string;
|
|
20
|
+
}>;
|
|
21
|
+
runtimeOptionChange: EventEmitter<any>;
|
|
22
|
+
value: import("@angular/core").WritableSignal<any>;
|
|
23
|
+
private _runtimeOptions;
|
|
24
|
+
runtimeOptions: any;
|
|
25
|
+
fieldFilterControl: FormControl;
|
|
26
|
+
protected _onDestroy: Subject<void>;
|
|
27
|
+
optionSearchTerm: string;
|
|
28
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
29
|
+
ngOnInit(): void;
|
|
30
|
+
ngOnDestroy(): void;
|
|
31
|
+
get isValid(): boolean;
|
|
32
|
+
get fieldError(): string | undefined;
|
|
33
|
+
get minErrorText(): string | undefined;
|
|
34
|
+
get maxErrorText(): string | undefined;
|
|
35
|
+
get isInvalid(): boolean;
|
|
36
|
+
get isDate(): boolean;
|
|
37
|
+
get isDateTime(): boolean;
|
|
38
|
+
get isBoolean(): boolean;
|
|
39
|
+
get isCheckbox(): boolean;
|
|
40
|
+
get isCommonField(): boolean;
|
|
41
|
+
get fieldId(): string;
|
|
42
|
+
onValueChange(): void;
|
|
43
|
+
onImmediateChange(event: {
|
|
44
|
+
value: string;
|
|
45
|
+
}): void;
|
|
46
|
+
onFieldUpdate(e?: any, isDate?: boolean, isDateTime?: boolean): void;
|
|
47
|
+
onUpdateRuntimeOptions(options: any[]): void;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "ng-dhis2-ui-form-field", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "fieldConfig": { "alias": "fieldConfig"; "required": false; }; "form": { "alias": "form"; "required": false; }; "isCheckBoxButton": { "alias": "isCheckBoxButton"; "required": false; }; "fieldClass": { "alias": "fieldClass"; "required": false; }; "programRuleActions": { "alias": "programRuleActions"; "required": false; }; "dataEntities": { "alias": "dataEntities"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "fieldUpdate": "fieldUpdate"; "immediateFieldUpdate": "immediateFieldUpdate"; "runtimeOptionChange": "runtimeOptionChange"; }, never, never, false, never>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventEmitter, NgZone, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { IFormFieldGroup } from '../../interfaces';
|
|
4
|
+
import { FormValue } from '../../models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class RepeatableFormComponent implements OnInit {
|
|
7
|
+
#private;
|
|
8
|
+
ngZone: NgZone;
|
|
9
|
+
formObject: any;
|
|
10
|
+
formData: any;
|
|
11
|
+
fieldGroup: import("@angular/core").InputSignal<IFormFieldGroup>;
|
|
12
|
+
form: FormGroup;
|
|
13
|
+
numberOfRows: number | string;
|
|
14
|
+
programRuleActions: any[];
|
|
15
|
+
events: import("@angular/core").ModelSignal<unknown>;
|
|
16
|
+
program: string;
|
|
17
|
+
programStage: string;
|
|
18
|
+
repeatDependentField: string;
|
|
19
|
+
dataEntities: import("@angular/core").InputSignal<Record<string, unknown>>;
|
|
20
|
+
repeatableEvents: any[];
|
|
21
|
+
repeatableData: {
|
|
22
|
+
[index: number]: FormValue;
|
|
23
|
+
};
|
|
24
|
+
repeatableStageUpdate: EventEmitter<any>;
|
|
25
|
+
repeatableFormEntities: {
|
|
26
|
+
[event: string]: FormGroup;
|
|
27
|
+
};
|
|
28
|
+
eventForm: FormGroup;
|
|
29
|
+
eventFormValue: import("@angular/core").WritableSignal<FormValue>;
|
|
30
|
+
showForm: import("@angular/core").WritableSignal<boolean>;
|
|
31
|
+
eventIndex: import("@angular/core").WritableSignal<number>;
|
|
32
|
+
constructor();
|
|
33
|
+
get isValid(): boolean;
|
|
34
|
+
ngOnInit(): void;
|
|
35
|
+
onFormUpdate(formValue: FormValue): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RepeatableFormComponent, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RepeatableFormComponent, "ng-dhis2-ui-repeatable-form", never, { "formObject": { "alias": "formObject"; "required": false; }; "formData": { "alias": "formData"; "required": false; }; "fieldGroup": { "alias": "fieldGroup"; "required": true; "isSignal": true; }; "form": { "alias": "form"; "required": false; }; "numberOfRows": { "alias": "numberOfRows"; "required": false; }; "programRuleActions": { "alias": "programRuleActions"; "required": false; }; "events": { "alias": "events"; "required": false; "isSignal": true; }; "program": { "alias": "program"; "required": false; }; "programStage": { "alias": "programStage"; "required": false; }; "repeatDependentField": { "alias": "repeatDependentField"; "required": false; }; "dataEntities": { "alias": "dataEntities"; "required": true; "isSignal": true; }; }, { "events": "eventsChange"; "repeatableStageUpdate": "repeatableStageUpdate"; }, never, never, false, never>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventEmitter, NgZone, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { IFormFieldGroup, IFormMetadata } from '../../interfaces';
|
|
5
|
+
import { FormValue } from '../../models';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class SectionFormComponent implements OnInit {
|
|
8
|
+
#private;
|
|
9
|
+
ngZone: NgZone;
|
|
10
|
+
loading: import("@angular/core").InputSignal<boolean>;
|
|
11
|
+
isloading: boolean;
|
|
12
|
+
formMetaData: import("@angular/core").InputSignal<IFormMetadata>;
|
|
13
|
+
dataValueEntities: import("@angular/core").InputSignal<Record<string, unknown>>;
|
|
14
|
+
formGroups: Record<string, FormGroup>;
|
|
15
|
+
formValueEntity: Record<string, FormValue>;
|
|
16
|
+
repeatableFormValueEntity: Record<string, Record<number, FormValue>>;
|
|
17
|
+
ruleActions: Record<string, unknown>[];
|
|
18
|
+
save: EventEmitter<Record<string, unknown>>;
|
|
19
|
+
formUpdate: EventEmitter<Record<string, unknown>>;
|
|
20
|
+
cancel: EventEmitter<any>;
|
|
21
|
+
inValid: import("@angular/core").WritableSignal<boolean>;
|
|
22
|
+
inValid$: Observable<boolean>;
|
|
23
|
+
constructor();
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
onUpdateRepeatableStage(repeatableData: Record<number, FormValue>, fieldGroup: IFormFieldGroup): void;
|
|
26
|
+
onFormUpdate(formValue: FormValue, fieldGroupId: string): void;
|
|
27
|
+
onSubmit(): void;
|
|
28
|
+
onCancel(event?: MouseEvent): void;
|
|
29
|
+
checkIfInValid(): boolean;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SectionFormComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SectionFormComponent, "ng-dhis2-ui-section-form", never, { "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "formMetaData": { "alias": "formMetaData"; "required": true; "isSignal": true; }; "dataValueEntities": { "alias": "dataValueEntities"; "required": true; "isSignal": true; }; }, { "save": "save"; "formUpdate": "formUpdate"; "cancel": "cancel"; }, never, never, false, never>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./containers/form-field/form-field.component";
|
|
3
|
+
import * as i2 from "./containers/form/form.component";
|
|
4
|
+
import * as i3 from "./containers/repeatable-form/repeatable-form.component";
|
|
5
|
+
import * as i4 from "./containers/section-form/section-form.component";
|
|
6
|
+
import * as i5 from "./components/form-field-item.component";
|
|
7
|
+
import * as i6 from "@angular/common";
|
|
8
|
+
import * as i7 from "@angular/forms";
|
|
9
|
+
import * as i8 from "../react-wrapper/react-wrapper.component.tsx";
|
|
10
|
+
import * as i9 from "../organisation-unit-selector/organisation-unit-selector.module";
|
|
11
|
+
export declare class D2FormModule {
|
|
12
|
+
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 i6.CommonModule, typeof i7.ReactiveFormsModule, typeof i8.ReactWrapperModule, typeof i9.OrganisationUnitSelectorModule], [typeof i1.FormFieldComponent, typeof i2.FormComponent, typeof i3.RepeatableFormComponent, typeof i4.SectionFormComponent]>;
|
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<D2FormModule>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './form.module';
|
|
2
|
+
export * from './containers/form-field/form-field.component';
|
|
3
|
+
export * from './containers/form/form.component';
|
|
4
|
+
export * from './containers/repeatable-form/repeatable-form.component';
|
|
5
|
+
export * from './containers/section-form/section-form.component';
|
|
6
|
+
export * from './models';
|
|
7
|
+
export * from './interfaces';
|
|
8
|
+
export * from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FieldControlType = 'dropdown' | 'textbox' | 'textarea' | 'checkbox' | 'date' | 'date-time' | 'image' | 'org-unit' | 'file' | 'boolean' | 'transfer' | 'search';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum FieldType {
|
|
2
|
+
TEXT = "TEXT",
|
|
3
|
+
TRUE_ONLY = "TRUE_ONLY",
|
|
4
|
+
LONG_TEXT = "LONG_TEXT",
|
|
5
|
+
BOOLEAN = "BOOLEAN",
|
|
6
|
+
NUMBER = "NUMBER",
|
|
7
|
+
INTEGER_ZERO_OR_POSITIVE = "INTEGER_ZERO_OR_POSITIVE",
|
|
8
|
+
IMAGE = "IMAGE",
|
|
9
|
+
FILE_RESOURCE = "FILE_RESOURCE",
|
|
10
|
+
DATE = "DATE",
|
|
11
|
+
DATE_TIME = "DATETIME",
|
|
12
|
+
ORG_UNIT = "ORGANISATION_UNIT",
|
|
13
|
+
PHONE_NUMBER = "PHONE_NUMBER",
|
|
14
|
+
EMAIL = "EMAIL"
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface FormGroupField {
|
|
2
|
+
id: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
formName?: string;
|
|
5
|
+
fieldType: 'ATTRIBUTE' | 'DATA_ELEMENT' | 'ORG_UNIT' | 'ENROLLMENT_DATE' | 'CUSTOM';
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
mandatory?: boolean;
|
|
8
|
+
fieldOptionsDependsOn?: string;
|
|
9
|
+
optionType?: 'ORG_UNIT' | 'PORT_OF_ENTRY' | 'CUSTOM';
|
|
10
|
+
hasOptions?: boolean;
|
|
11
|
+
valueType?: string;
|
|
12
|
+
openFutureDays?: number;
|
|
13
|
+
openPreviousDays?: number;
|
|
14
|
+
skipSaving?: boolean;
|
|
15
|
+
stageId?: string;
|
|
16
|
+
trackedEntityInstance?: string;
|
|
17
|
+
event?: string;
|
|
18
|
+
min?: number | Date | string;
|
|
19
|
+
max?: number | Date | string;
|
|
20
|
+
optionSet?: any;
|
|
21
|
+
translations?: any;
|
|
22
|
+
}
|
|
23
|
+
interface FormFieldGroup {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
translations?: any;
|
|
27
|
+
isFormHorizontal?: boolean;
|
|
28
|
+
attributes?: string[] | object[];
|
|
29
|
+
dataElements?: string[] | object[];
|
|
30
|
+
booleanGroupedDataElements?: string[] | object[];
|
|
31
|
+
fields: any[];
|
|
32
|
+
repeatableStage?: string;
|
|
33
|
+
repeatDependentField?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface FormSection {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
sectionStateComplete?: boolean;
|
|
39
|
+
description?: string;
|
|
40
|
+
translations?: any;
|
|
41
|
+
fieldGroups: FormFieldGroup[];
|
|
42
|
+
}
|
|
43
|
+
export interface AddtionalAttributeFilter {
|
|
44
|
+
attribute: string;
|
|
45
|
+
value: any;
|
|
46
|
+
}
|
|
47
|
+
export interface FormConfiguration {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
program: string;
|
|
52
|
+
topOrgUnit?: string;
|
|
53
|
+
trackedEntityType?: string;
|
|
54
|
+
autoFilledAttributes?: string[];
|
|
55
|
+
reservedAttribute?: string;
|
|
56
|
+
sections: FormSection[];
|
|
57
|
+
additionalAttributeFilters?: AddtionalAttributeFilter[];
|
|
58
|
+
downloadSqlView?: string;
|
|
59
|
+
sectionCategories?: Record<string, string[]>;
|
|
60
|
+
optionGroups?: string[];
|
|
61
|
+
dataElementGroup?: string[];
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IFormField } from './form-field.interface';
|
|
2
|
+
export interface IFormFieldGroup {
|
|
3
|
+
dataKey?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
sortOrder?: number;
|
|
7
|
+
translations?: any;
|
|
8
|
+
isFormHorizontal?: boolean;
|
|
9
|
+
attributes?: string[] | object[];
|
|
10
|
+
dataElements?: string[] | object[];
|
|
11
|
+
booleanGroupedDataElements?: string[] | object[];
|
|
12
|
+
fields: IFormField<string>[];
|
|
13
|
+
repeatableStage?: string;
|
|
14
|
+
repeatDependentField?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FormFieldMetaType = 'DATA_ELEMENT' | 'ATTRIBUTE';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IFieldDropdown } from './field-dropdown.interface';
|
|
2
|
+
import { FieldControlType } from './field-control-type.interface';
|
|
3
|
+
import { FormFieldMetaType } from './form-field-meta-type.interface';
|
|
4
|
+
export interface IFormField<T> {
|
|
5
|
+
value?: T | '';
|
|
6
|
+
id: string;
|
|
7
|
+
code?: string;
|
|
8
|
+
key: string;
|
|
9
|
+
referenceKey?: string;
|
|
10
|
+
label: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
order?: number;
|
|
13
|
+
controlType: FieldControlType;
|
|
14
|
+
type: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
options?: IFieldDropdown[];
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
min?: number | Date | string;
|
|
19
|
+
max?: number | Date | string;
|
|
20
|
+
maxLength?: number | string;
|
|
21
|
+
hidden: boolean;
|
|
22
|
+
units?: string;
|
|
23
|
+
isDataElement?: boolean;
|
|
24
|
+
isAttribute?: boolean;
|
|
25
|
+
isOrgUnit?: boolean;
|
|
26
|
+
isEnrollmentDate?: boolean;
|
|
27
|
+
event?: string;
|
|
28
|
+
programStage?: string;
|
|
29
|
+
program?: string;
|
|
30
|
+
trackedEntityInstance?: string;
|
|
31
|
+
hasOptions?: boolean;
|
|
32
|
+
dependentField?: any;
|
|
33
|
+
fieldOptionsDependsOn?: string;
|
|
34
|
+
displayInList?: boolean;
|
|
35
|
+
displayInReports?: boolean;
|
|
36
|
+
searchable?: boolean;
|
|
37
|
+
unique?: boolean;
|
|
38
|
+
metaType?: FormFieldMetaType;
|
|
39
|
+
stepId?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFormFieldGroup } from './form-field-group.interface';
|
|
2
|
+
export interface IFormMetadataSection {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
program?: string;
|
|
6
|
+
sectionStateComplete?: boolean;
|
|
7
|
+
description?: string;
|
|
8
|
+
translations?: any;
|
|
9
|
+
fieldGroups: IFormFieldGroup[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IFormField } from './form-field.interface';
|
|
2
|
+
import { IFormMetadataSection } from './form-metadata-section.interface';
|
|
3
|
+
export interface IFormMetadata {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
fields: IFormField<string>[];
|
|
8
|
+
sections: IFormMetadataSection[];
|
|
9
|
+
rules: any[];
|
|
10
|
+
downloadSqlView?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './form-field.interface';
|
|
2
|
+
export * from './field-dropdown.interface';
|
|
3
|
+
export * from './field-control-type.interface';
|
|
4
|
+
export * from './field-type.interface';
|
|
5
|
+
export * from './form-field-meta-type.interface';
|
|
6
|
+
export * from './form-configuration.model';
|
|
7
|
+
export * from './form-field-group.interface';
|
|
8
|
+
export * from './form-metadata-section.interface';
|
|
9
|
+
export * from './form-metadata.interface';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFieldDropdown } from '../interfaces';
|
|
2
|
+
export declare class FieldDropdown implements IFieldDropdown {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
order?: number | undefined;
|
|
7
|
+
constructor(params: IFieldDropdown);
|
|
8
|
+
toJson(): IFieldDropdown;
|
|
9
|
+
static getDropdownOptions(field: any, locale?: string): FieldDropdown[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FieldConfig } from './field-config.model';
|
|
2
|
+
export type FormDirection = 'horizontal' | 'vertical';
|
|
3
|
+
export declare class FormConfig {
|
|
4
|
+
direction: FormDirection;
|
|
5
|
+
showSaveButton: boolean;
|
|
6
|
+
formName?: string;
|
|
7
|
+
fieldConfig: FieldConfig;
|
|
8
|
+
constructor(config?: Partial<FormConfig>);
|
|
9
|
+
get directionClassName(): "form-vertical" | "form-horizontal";
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IFormField, IFormFieldGroup } from '../interfaces';
|
|
2
|
+
export declare class FormFieldGroup implements IFormFieldGroup {
|
|
3
|
+
private params;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
translations?: any;
|
|
7
|
+
isFormHorizontal?: boolean | undefined;
|
|
8
|
+
attributes?: string[] | object[] | undefined;
|
|
9
|
+
dataElements?: string[] | object[] | undefined;
|
|
10
|
+
booleanGroupedDataElements?: string[] | object[] | undefined;
|
|
11
|
+
repeatableStage?: string | undefined;
|
|
12
|
+
repeatDependentField?: string | undefined;
|
|
13
|
+
dataKey?: string | undefined;
|
|
14
|
+
constructor(params: {
|
|
15
|
+
formFieldGroup: Partial<FormFieldGroup>;
|
|
16
|
+
fieldMetaData: Record<string, unknown>[];
|
|
17
|
+
locale?: string;
|
|
18
|
+
});
|
|
19
|
+
get fields(): IFormField<string>[];
|
|
20
|
+
toJson(): IFormFieldGroup;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FieldControlType, FormFieldMetaType, IFormField, IFieldDropdown } from '../interfaces';
|
|
2
|
+
export declare class FormField<T> implements IFormField<T> {
|
|
3
|
+
value?: T | '';
|
|
4
|
+
id: string;
|
|
5
|
+
code?: string;
|
|
6
|
+
key: string;
|
|
7
|
+
referenceKey?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
order?: number;
|
|
11
|
+
controlType: FieldControlType;
|
|
12
|
+
type: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
options?: IFieldDropdown[];
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
min?: number | Date | string;
|
|
17
|
+
max?: number | Date | string;
|
|
18
|
+
maxLength?: number | string;
|
|
19
|
+
hidden: boolean;
|
|
20
|
+
units?: string;
|
|
21
|
+
isDataElement?: boolean;
|
|
22
|
+
isAttribute?: boolean;
|
|
23
|
+
isOrgUnit?: boolean;
|
|
24
|
+
isEnrollmentDate?: boolean;
|
|
25
|
+
event?: string;
|
|
26
|
+
programStage?: string;
|
|
27
|
+
program?: string;
|
|
28
|
+
trackedEntityInstance?: string;
|
|
29
|
+
hasOptions?: boolean;
|
|
30
|
+
dependentField?: any;
|
|
31
|
+
fieldOptionsDependsOn?: string;
|
|
32
|
+
displayInList?: boolean;
|
|
33
|
+
displayInReports?: boolean;
|
|
34
|
+
searchable?: boolean;
|
|
35
|
+
unique?: boolean;
|
|
36
|
+
metaType?: FormFieldMetaType;
|
|
37
|
+
stepId?: string;
|
|
38
|
+
availableOptionsLabel?: string;
|
|
39
|
+
selectedOptionsLabel?: string;
|
|
40
|
+
constructor(options?: Partial<FormField<T>>);
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ProgramRule, ProgramRuleAction, ProgramRuleVariable } from '@iapps/d2-web-sdk';
|
|
2
|
+
interface JsonTransformer<T> {
|
|
3
|
+
toJson: () => T;
|
|
4
|
+
}
|
|
5
|
+
export interface IMetadataRuleAction {
|
|
6
|
+
field: string;
|
|
7
|
+
actionType: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class MetadataRuleAction implements IMetadataRuleAction, JsonTransformer<IMetadataRuleAction> {
|
|
10
|
+
private ruleAction;
|
|
11
|
+
constructor(ruleAction: ProgramRuleAction);
|
|
12
|
+
get field(): string;
|
|
13
|
+
get actionType(): string;
|
|
14
|
+
toJson(): IMetadataRuleAction;
|
|
15
|
+
}
|
|
16
|
+
export interface IMetadataRule {
|
|
17
|
+
actions: IMetadataRuleAction[];
|
|
18
|
+
condition: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class MetadataRule implements IMetadataRule, JsonTransformer<IMetadataRule> {
|
|
21
|
+
private rule;
|
|
22
|
+
private ruleVariables;
|
|
23
|
+
constructor(rule: ProgramRule, ruleVariables: ProgramRuleVariable[]);
|
|
24
|
+
get actions(): MetadataRuleAction[];
|
|
25
|
+
get condition(): string;
|
|
26
|
+
toJson(): IMetadataRule;
|
|
27
|
+
}
|
|
28
|
+
export {};
|