@iapps/ng-dhis2-ui 1.0.9 → 1.1.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/fesm2022/iapps-ng-dhis2-ui.mjs +1947 -292
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- 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 +31 -0
- package/lib/modules/form/containers/section-form/section-form.component.d.ts +31 -0
- package/lib/modules/form/form.module.d.ts +14 -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 +14 -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 +20 -0
- package/lib/modules/form/models/form-value.model.d.ts +17 -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 +5 -0
- package/lib/modules/line-list/containers/line-list.component.d.ts +12 -1
- package/lib/modules/line-list/models/attribute-filter.model.d.ts +2 -1
- package/lib/modules/line-list/models/filter-config.model.d.ts +6 -0
- package/lib/modules/line-list/models/line-list.models.d.ts +73 -14
- package/lib/modules/line-list/utils/filter-builder.d.ts +3 -0
- package/lib/modules/line-list/utils/line-list-utils.d.ts +2 -1
- package/lib/modules/react-wrapper/react-wrapper.component.d.ts +2 -3
- package/lib/shared/components/index.d.ts +1 -2
- package/package.json +1 -1
- /package/lib/shared/components/{TransferOption.d.ts → transfer-option.component.d.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IMetadataRule } from './form-metadata-rule.model';
|
|
2
|
+
import { FormField } from './form-field.model';
|
|
3
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
4
|
+
import { IFormMetadata, IFormMetadataSection } from '../interfaces';
|
|
5
|
+
export declare class FormMetaData implements IFormMetadata {
|
|
6
|
+
private params;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
downloadSqlView?: string | undefined;
|
|
11
|
+
constructor(params: {
|
|
12
|
+
formMetaData: Partial<FormMetaData>;
|
|
13
|
+
programs: Program[];
|
|
14
|
+
locale?: string;
|
|
15
|
+
});
|
|
16
|
+
get sections(): IFormMetadataSection[];
|
|
17
|
+
get fields(): FormField<string>[];
|
|
18
|
+
get rules(): IMetadataRule[];
|
|
19
|
+
toJson(): IFormMetadata;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import { FormField } from './form-field.model';
|
|
3
|
+
export declare class FormValue {
|
|
4
|
+
form: FormGroup;
|
|
5
|
+
fields: FormField<string>[];
|
|
6
|
+
changedField?: FormField<string>;
|
|
7
|
+
constructor(form: FormGroup, fields: FormField<string>[], changedField?: FormField<string>);
|
|
8
|
+
get isValid(): boolean;
|
|
9
|
+
clear(): void;
|
|
10
|
+
getValues(): {
|
|
11
|
+
[id: string]: {
|
|
12
|
+
id: string;
|
|
13
|
+
value: string;
|
|
14
|
+
options: any[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DropdownOption } from './dropdown-option.model';
|
|
2
|
+
import { FormField } from './form-field.model';
|
|
3
|
+
export interface EocForm {
|
|
4
|
+
id: string;
|
|
5
|
+
uuid: string;
|
|
6
|
+
name: string;
|
|
7
|
+
setMembers: EocForm[];
|
|
8
|
+
options?: DropdownOption[];
|
|
9
|
+
dataType?: string;
|
|
10
|
+
formClass: string;
|
|
11
|
+
formField?: FormField<string>;
|
|
12
|
+
formFields: FormField<string>[];
|
|
13
|
+
concept?: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './boolean.model';
|
|
2
|
+
export * from './check-box.model';
|
|
3
|
+
export * from './date-field.model';
|
|
4
|
+
export * from './dropdown-option.model';
|
|
5
|
+
export * from './dropdown.model';
|
|
6
|
+
export * from './form-field.model';
|
|
7
|
+
export * from './fields-data.model';
|
|
8
|
+
export * from './field-config.model';
|
|
9
|
+
export * from './date-range-value.model';
|
|
10
|
+
export * from './field-dropdown.model';
|
|
11
|
+
export * from './form-config.model';
|
|
12
|
+
export * from './form-field-group.model';
|
|
13
|
+
export * from './form-metadata-rule.model';
|
|
14
|
+
export * from './form-metadata-section.model';
|
|
15
|
+
export * from './form-metadata.model';
|
|
16
|
+
export * from './form-value.model';
|
|
17
|
+
export * from './form.model';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldControlType } from '../interfaces';
|
|
2
|
+
import { DropdownOption } from '../models';
|
|
3
|
+
export declare class FieldUtil {
|
|
4
|
+
static getFieldDropdownOptions(field: any): DropdownOption[];
|
|
5
|
+
static sanitizeOptions(options: any[]): any;
|
|
6
|
+
static getFieldType(valueType: string): "number" | "date" | "org-unit" | "file" | "tel" | "text";
|
|
7
|
+
static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
|
|
8
|
+
static getOptionEntities?(options: any[]): any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
2
|
+
import { FormField } from '../models';
|
|
3
|
+
export declare class FormUtil {
|
|
4
|
+
static getFormGroup(fields: FormField<string>[], dataEntities: any): UntypedFormGroup;
|
|
5
|
+
static getFieldValue(field: FormField<string>, dataEntities: Record<string, any>): any;
|
|
6
|
+
static getFormFields(fields: any[]): FormField<string>[];
|
|
7
|
+
static createField(id: string, label: string, required: boolean, controlType: 'textbox' | 'dropdown' | 'textarea' | 'transfer' | 'search' | 'file', disabled?: boolean, placeholder?: string, options?: Array<any>): FormField<string>;
|
|
8
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { EventEmitter, SimpleChanges } from '@angular/core';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { LineListService } from '../services/line-list.service';
|
|
3
4
|
import { DropdownMenuOption } from '../components/dropdown-menu';
|
|
5
|
+
import { TableRow } from '../models/line-list.models';
|
|
4
6
|
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
5
7
|
import { ReactWrapperComponent } from '../../react-wrapper';
|
|
8
|
+
import { FilterConfig } from '../models/filter-config.model';
|
|
6
9
|
import * as i0 from "@angular/core";
|
|
7
10
|
export declare class LineListTableComponent extends ReactWrapperComponent {
|
|
8
11
|
programId: string;
|
|
@@ -12,9 +15,17 @@ export declare class LineListTableComponent extends ReactWrapperComponent {
|
|
|
12
15
|
attributeFilters?: AttributeFilter[];
|
|
13
16
|
startDate?: string;
|
|
14
17
|
endDate?: string;
|
|
18
|
+
filters?: FilterConfig[];
|
|
19
|
+
actionSelected: EventEmitter<{
|
|
20
|
+
action: string;
|
|
21
|
+
row: TableRow;
|
|
22
|
+
}>;
|
|
23
|
+
private reactStateUpdaters;
|
|
24
|
+
setReactStateUpdaters: (updaters: any) => void;
|
|
25
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
15
26
|
lineListService: LineListService;
|
|
16
27
|
LineList: () => React.JSX.Element;
|
|
17
28
|
ngAfterViewInit(): Promise<void>;
|
|
18
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<LineListTableComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LineListTableComponent, "app-line-list", never, { "programId": { "alias": "programId"; "required": false; }; "orgUnit": { "alias": "orgUnit"; "required": false; }; "programStageId": { "alias": "programStageId"; "required": false; }; "actionOptions": { "alias": "actionOptions"; "required": false; }; "attributeFilters": { "alias": "attributeFilters"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "endDate": { "alias": "endDate"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LineListTableComponent, "app-line-list", never, { "programId": { "alias": "programId"; "required": false; }; "orgUnit": { "alias": "orgUnit"; "required": false; }; "programStageId": { "alias": "programStageId"; "required": false; }; "actionOptions": { "alias": "actionOptions"; "required": false; }; "attributeFilters": { "alias": "attributeFilters"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "endDate": { "alias": "endDate"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; }, { "actionSelected": "actionSelected"; }, never, ["*"], false, never>;
|
|
20
31
|
}
|
|
@@ -4,25 +4,72 @@ export interface Pager {
|
|
|
4
4
|
total: number;
|
|
5
5
|
pageCount: number;
|
|
6
6
|
}
|
|
7
|
+
export interface Attribute {
|
|
8
|
+
lastUpdated: string;
|
|
9
|
+
code: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
created: string;
|
|
12
|
+
valueType: string;
|
|
13
|
+
attribute: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
7
16
|
export interface EventsResponse {
|
|
8
|
-
events:
|
|
9
|
-
event: string;
|
|
10
|
-
programStage?: string;
|
|
11
|
-
dataValues: {
|
|
12
|
-
dataElement: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
17
|
+
events: Event[];
|
|
16
18
|
pager: Pager;
|
|
17
19
|
}
|
|
18
|
-
export interface
|
|
20
|
+
export interface Event {
|
|
21
|
+
dueDate: string;
|
|
22
|
+
program: string;
|
|
23
|
+
event: string;
|
|
24
|
+
programStage?: string;
|
|
25
|
+
orgUnit: string;
|
|
19
26
|
enrollment: string;
|
|
27
|
+
trackedEntityInstance: string;
|
|
28
|
+
enrollmentStatus: string;
|
|
29
|
+
orgUnitName: string;
|
|
30
|
+
status: string;
|
|
31
|
+
eventDate: string;
|
|
32
|
+
attributeCategoryOptions: string;
|
|
33
|
+
lastUpdated: string;
|
|
34
|
+
created: string;
|
|
35
|
+
completedDate: string;
|
|
36
|
+
followup: boolean;
|
|
37
|
+
deleted: boolean;
|
|
38
|
+
attributeOptionCombo: string;
|
|
39
|
+
completedBy: string;
|
|
40
|
+
lastUpdatedByUserInfo: LastUpdatedByUserInfo;
|
|
41
|
+
createdByUserInfo: CreatedByUserInfo;
|
|
42
|
+
dataValues: DataValue[];
|
|
43
|
+
notes: any[];
|
|
44
|
+
relationships: any[];
|
|
45
|
+
}
|
|
46
|
+
export interface DataValue {
|
|
47
|
+
lastUpdated: string;
|
|
48
|
+
created: string;
|
|
49
|
+
dataElement: string;
|
|
50
|
+
value: string;
|
|
51
|
+
providedElsewhere: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface Enrollment {
|
|
20
54
|
program: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
lastUpdated: string;
|
|
56
|
+
created: string;
|
|
57
|
+
orgUnit: string;
|
|
58
|
+
enrollment: string;
|
|
59
|
+
trackedEntityInstance: string;
|
|
60
|
+
trackedEntityType: string;
|
|
61
|
+
orgUnitName: string;
|
|
62
|
+
enrollmentDate: string;
|
|
63
|
+
followup: boolean;
|
|
64
|
+
deleted: boolean;
|
|
65
|
+
incidentDate: string;
|
|
66
|
+
status: string;
|
|
67
|
+
lastUpdatedByUserInfo: LastUpdatedByUserInfo;
|
|
68
|
+
createdByUserInfo: CreatedByUserInfo;
|
|
69
|
+
notes: any[];
|
|
70
|
+
relationships: any[];
|
|
71
|
+
events: Event[];
|
|
72
|
+
attributes: Attribute[];
|
|
26
73
|
}
|
|
27
74
|
export interface TrackedEntityInstance {
|
|
28
75
|
trackedEntityInstance: string;
|
|
@@ -68,3 +115,15 @@ export interface ColumnDefinition {
|
|
|
68
115
|
label: string;
|
|
69
116
|
key: string;
|
|
70
117
|
}
|
|
118
|
+
export interface LastUpdatedByUserInfo {
|
|
119
|
+
uid: string;
|
|
120
|
+
firstName: string;
|
|
121
|
+
surname: string;
|
|
122
|
+
username: string;
|
|
123
|
+
}
|
|
124
|
+
export interface CreatedByUserInfo {
|
|
125
|
+
uid: string;
|
|
126
|
+
firstName: string;
|
|
127
|
+
surname: string;
|
|
128
|
+
username: string;
|
|
129
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
2
|
+
import { FilterConfig } from '../models/filter-config.model';
|
|
3
|
+
import { TrackedEntityInstance } from '../models/line-list.models';
|
|
2
4
|
export declare function buildFilters(filters: AttributeFilter[]): string;
|
|
5
|
+
export declare const getFilteredTrackedEntityInstances: (trackedEntityInstance: TrackedEntityInstance[], filters: FilterConfig[]) => TrackedEntityInstance[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { FilterConfig } from '../models/filter-config.model';
|
|
1
2
|
import { LineListResponse, ColumnDefinition, TableRow } from '../models/line-list.models';
|
|
2
3
|
export declare const getProgramStageData: (response: LineListResponse, programStageId: string, pager: any) => {
|
|
3
4
|
columns: ColumnDefinition[];
|
|
4
5
|
data: TableRow[];
|
|
5
6
|
};
|
|
6
|
-
export declare const getTrackedEntityData: (response: LineListResponse, programId: string, pager: any) => {
|
|
7
|
+
export declare const getTrackedEntityData: (response: LineListResponse, programId: string, pager: any, filters?: FilterConfig[]) => {
|
|
7
8
|
columns: ColumnDefinition[];
|
|
8
9
|
data: TableRow[];
|
|
9
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef,
|
|
1
|
+
import { AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import * as ReactDOM from 'react-dom/client';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ReactWrapperComponent implements
|
|
5
|
+
export declare class ReactWrapperComponent implements OnDestroy, AfterViewInit {
|
|
6
6
|
protected elementRef: ElementRef<HTMLElement>;
|
|
7
7
|
props?: ComponentProps<any>;
|
|
8
8
|
component: any;
|
|
@@ -10,7 +10,6 @@ export declare class ReactWrapperComponent implements OnChanges, OnDestroy, Afte
|
|
|
10
10
|
protected reactDomRoot?: ReactDOM.Root;
|
|
11
11
|
constructor(elementRef: ElementRef<HTMLElement>);
|
|
12
12
|
ngAfterViewInit(): void;
|
|
13
|
-
ngOnChanges(): void;
|
|
14
13
|
ngOnDestroy(): void;
|
|
15
14
|
protected render(): void;
|
|
16
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReactWrapperComponent, never>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './TransferOption';
|
|
1
|
+
export * from './transfer-option.component';
|
package/package.json
CHANGED
|
File without changes
|