@iapps/ng-dhis2-ui 1.1.80 → 1.2.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 +440 -1125
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/lib/modules/form/utils/field-type.util.d.ts +1 -1
- package/lib/modules/form/utils/field.util.d.ts +1 -1
- package/lib/modules/line-list/components/orgUnitSelector.d.ts +2 -0
- package/lib/modules/line-list/components/table/TableBody.d.ts +2 -0
- package/lib/modules/line-list/components/table/filterToolbar.d.ts +2 -0
- package/lib/modules/line-list/components/table/lineListTable.d.ts +2 -0
- package/lib/modules/line-list/components/table/pagination.d.ts +8 -0
- package/lib/modules/line-list/components/table/tableCell.d.ts +5 -0
- package/lib/modules/line-list/components/table/tableFooter.d.ts +2 -0
- package/lib/modules/line-list/components/table/tableHeader.d.ts +4 -0
- package/lib/modules/line-list/components/table/tableRow.d.ts +2 -0
- package/lib/modules/line-list/containers/line-list.component.d.ts +10 -14
- package/lib/modules/line-list/models/line-list.models.d.ts +15 -23
- package/lib/modules/line-list/services/line-list.service.d.ts +3 -11
- package/lib/modules/line-list/utils/event-table-table-util.d.ts +10 -0
- package/lib/modules/line-list/utils/tei-table-data-utils.d.ts +9 -0
- package/lib/modules/program-entry-form/models/program-entry-form-metadata.d.ts +2 -1
- package/package.json +1 -1
- package/lib/modules/line-list/utils/filter-builder.d.ts +0 -7
- package/lib/modules/line-list/utils/line-list-utils.d.ts +0 -17
|
@@ -3,7 +3,7 @@ import { DropdownOption } from '../models';
|
|
|
3
3
|
export declare class FieldUtil {
|
|
4
4
|
static getFieldDropdownOptions(field: any): DropdownOption[];
|
|
5
5
|
static sanitizeOptions(options: any[]): any;
|
|
6
|
-
static getFieldType(valueType: string): "date" | "
|
|
6
|
+
static getFieldType(valueType: string): "date" | "text" | "tel" | "email" | "number" | "org-unit" | "file";
|
|
7
7
|
static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
|
|
8
8
|
static getOptionEntities?(options: any[]): any;
|
|
9
9
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const FilterToolbar: ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setOrgUnitState, defaultOrgUnit, setHide, startDateState, setStartDateState, endDateState, setEndDateState, visibleFilters, dateStates, inputValues, setInputValues, handleInputChange, handleInputChangeForSelectField, handleDateSelect, prevValue, setPrevValue, showAllFilters, setShowAllFilters, }: any) => React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Pager } from '@iapps/d2-web-sdk';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type PaginationProps = {
|
|
4
|
+
pager: Pager;
|
|
5
|
+
setPager: React.Dispatch<React.SetStateAction<Pager>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const Pagination: ({ pager, setPager }: PaginationProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -2,10 +2,9 @@ import { EventEmitter, SimpleChanges } from '@angular/core';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactWrapperModule } from '../../react-wrapper/react-wrapper.component';
|
|
4
4
|
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
5
|
-
import { FilterConfig } from '../models/filter-config.model';
|
|
6
|
-
import { TableRow } from '../models/line-list.models';
|
|
7
5
|
import { LineListService } from '../services/line-list.service';
|
|
8
6
|
import { ActionOptionOrientation, LineListActionOption } from '../models';
|
|
7
|
+
import { DataQueryFilter, DHIS2Event, TrackedEntityInstance } from '@iapps/d2-web-sdk';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
export declare class LineListTableComponent extends ReactWrapperModule {
|
|
11
10
|
programId: string;
|
|
@@ -17,30 +16,27 @@ export declare class LineListTableComponent extends ReactWrapperModule {
|
|
|
17
16
|
useOuModeWithOlderDHIS2Instance?: boolean;
|
|
18
17
|
startDate?: string;
|
|
19
18
|
endDate?: string;
|
|
20
|
-
|
|
19
|
+
dataQueryFilters?: DataQueryFilter[];
|
|
21
20
|
ouMode?: string;
|
|
22
|
-
|
|
21
|
+
isButtonLoading: boolean;
|
|
22
|
+
buttonFilter: string;
|
|
23
|
+
filterRootOrgUnit: boolean;
|
|
24
|
+
showFilters: boolean;
|
|
25
|
+
isOptionSetNameVisible: boolean;
|
|
23
26
|
actionSelected: EventEmitter<{
|
|
24
27
|
action: string;
|
|
25
|
-
|
|
28
|
+
data: TrackedEntityInstance | DHIS2Event;
|
|
26
29
|
}>;
|
|
27
|
-
private reactStateUpdaters;
|
|
28
30
|
approvalSelected: EventEmitter<{
|
|
29
31
|
teiId: string;
|
|
30
32
|
enrollmentId: string;
|
|
31
33
|
}[]>;
|
|
32
|
-
|
|
33
|
-
buttonLabel: string;
|
|
34
|
-
firstValue: EventEmitter<string>;
|
|
35
|
-
buttonFilter: string;
|
|
36
|
-
filterRootOrgUnit: boolean;
|
|
37
|
-
showFilters: boolean;
|
|
38
|
-
isOptionSetNameVisible: boolean;
|
|
34
|
+
private reactStateUpdaters;
|
|
39
35
|
setReactStateUpdaters: (updaters: any) => void;
|
|
40
36
|
ngOnChanges(changes: SimpleChanges): void;
|
|
41
37
|
lineListService: LineListService;
|
|
42
38
|
LineList: () => React.JSX.Element;
|
|
43
39
|
ngAfterViewInit(): Promise<void>;
|
|
44
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<LineListTableComponent, never>;
|
|
45
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LineListTableComponent, "ng-dhis2-ui-line-list", never, { "programId": { "alias": "programId"; "required": false; }; "orgUnit": { "alias": "orgUnit"; "required": false; }; "programStageId": { "alias": "programStageId"; "required": false; }; "actionOptions": { "alias": "actionOptions"; "required": false; }; "actionOptionOrientation": { "alias": "actionOptionOrientation"; "required": false; }; "attributeFilters": { "alias": "attributeFilters"; "required": false; }; "useOuModeWithOlderDHIS2Instance": { "alias": "useOuModeWithOlderDHIS2Instance"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "endDate": { "alias": "endDate"; "required": false; }; "
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LineListTableComponent, "ng-dhis2-ui-line-list", never, { "programId": { "alias": "programId"; "required": false; }; "orgUnit": { "alias": "orgUnit"; "required": false; }; "programStageId": { "alias": "programStageId"; "required": false; }; "actionOptions": { "alias": "actionOptions"; "required": false; }; "actionOptionOrientation": { "alias": "actionOptionOrientation"; "required": false; }; "attributeFilters": { "alias": "attributeFilters"; "required": false; }; "useOuModeWithOlderDHIS2Instance": { "alias": "useOuModeWithOlderDHIS2Instance"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "endDate": { "alias": "endDate"; "required": false; }; "dataQueryFilters": { "alias": "dataQueryFilters"; "required": false; }; "ouMode": { "alias": "ouMode"; "required": false; }; "isButtonLoading": { "alias": "isButtonLoading"; "required": false; }; "buttonFilter": { "alias": "buttonFilter"; "required": false; }; "filterRootOrgUnit": { "alias": "filterRootOrgUnit"; "required": false; }; "showFilters": { "alias": "showFilters"; "required": false; }; "isOptionSetNameVisible": { "alias": "isOptionSetNameVisible"; "required": false; }; }, { "actionSelected": "actionSelected"; "approvalSelected": "approvalSelected"; }, never, ["*"], false, never>;
|
|
46
42
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { DHIS2Event, Pager, TrackedEntityInstance } from '@iapps/d2-web-sdk';
|
|
2
|
+
export interface PagerObject {
|
|
2
3
|
page: number;
|
|
3
4
|
pageSize: number;
|
|
4
5
|
total: number;
|
|
@@ -84,21 +85,6 @@ export interface Enrollment {
|
|
|
84
85
|
events: Event[];
|
|
85
86
|
attributes: Attribute[];
|
|
86
87
|
}
|
|
87
|
-
export interface TrackedEntityInstance {
|
|
88
|
-
trackedEntityInstance: string;
|
|
89
|
-
attributes: Attribute[];
|
|
90
|
-
enrollments: Enrollment[];
|
|
91
|
-
trackedEntity: string;
|
|
92
|
-
trackedEntityType: string;
|
|
93
|
-
createdAt: string;
|
|
94
|
-
createdAtClient: string;
|
|
95
|
-
updatedAt: string;
|
|
96
|
-
orgUnit: string;
|
|
97
|
-
inactive: boolean;
|
|
98
|
-
deleted: boolean;
|
|
99
|
-
potentialDuplicate: boolean;
|
|
100
|
-
programOwners: ProgramOwner[];
|
|
101
|
-
}
|
|
102
88
|
export interface TrackedEntity {
|
|
103
89
|
attributes: Attribute[];
|
|
104
90
|
enrollments: Enrollment[];
|
|
@@ -119,9 +105,10 @@ export interface ProgramOwner {
|
|
|
119
105
|
program: string;
|
|
120
106
|
}
|
|
121
107
|
export interface TrackedEntityInstancesResponse {
|
|
122
|
-
trackedEntityInstances: TrackedEntityInstance[];
|
|
123
|
-
trackedEntity
|
|
108
|
+
trackedEntityInstances: TrackedEntityInstance | TrackedEntityInstance[];
|
|
109
|
+
trackedEntity?: TrackedEntity[];
|
|
124
110
|
pager: Pager;
|
|
111
|
+
orgUnitsMap?: Map<string, string>;
|
|
125
112
|
}
|
|
126
113
|
export interface TrackedEntityResponse {
|
|
127
114
|
trackedEntities: TrackedEntity[];
|
|
@@ -182,12 +169,17 @@ export interface ProgramMetadata {
|
|
|
182
169
|
orgUnitLabel: string;
|
|
183
170
|
}
|
|
184
171
|
export interface LineListResponse {
|
|
185
|
-
|
|
186
|
-
data: EventsResponse | TrackedEntityInstancesResponse | EnrollmentsResponse | TrackedEntityResponse;
|
|
172
|
+
data: EventsResponse | TrackedEntityInstancesResponse | EnrollmentsResponse | TrackedEntityResponse | TrackedEntityInstance | TrackedEntityInstance[];
|
|
187
173
|
}
|
|
188
174
|
export interface TableRow {
|
|
189
|
-
[key: string]:
|
|
190
|
-
|
|
175
|
+
[key: string]: {
|
|
176
|
+
value: TrackedEntityInstance | DHIS2Event | string | number;
|
|
177
|
+
style?: string;
|
|
178
|
+
};
|
|
179
|
+
index: {
|
|
180
|
+
value: number;
|
|
181
|
+
style?: string;
|
|
182
|
+
};
|
|
191
183
|
}
|
|
192
184
|
export interface ColumnDefinition {
|
|
193
185
|
label: string;
|
|
@@ -263,7 +255,7 @@ export interface OptionSet {
|
|
|
263
255
|
id: string;
|
|
264
256
|
}
|
|
265
257
|
export interface Option {
|
|
266
|
-
code
|
|
258
|
+
code?: string;
|
|
267
259
|
name: string;
|
|
268
260
|
id: string;
|
|
269
261
|
value?: string;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { NgxDhis2HttpClientService } from '@iapps/ngx-dhis2-http-client';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { LineListResponse } from '../models/line-list.models';
|
|
4
|
-
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
5
|
-
import { FilterConfig } from '../models/filter-config.model';
|
|
6
3
|
import * as i0 from "@angular/core";
|
|
7
4
|
export declare class LineListService {
|
|
8
5
|
private httpClient;
|
|
9
6
|
constructor(httpClient: NgxDhis2HttpClientService);
|
|
10
|
-
private getProgramMetadata;
|
|
11
|
-
private getTrackedEntityInstances;
|
|
12
7
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private getEvents;
|
|
17
|
-
private getEventsByProgramStage;
|
|
18
|
-
getLineListData(programId: string, orgUnit?: string, programStageId?: string, page?: number, pageSize?: number, filters?: AttributeFilter[], startDate?: string, endDate?: string, ouMode?: string, filterRootOrgUnit?: boolean, useOuModeWithOlderDHIS2Instance?: boolean, filtersFromEvents?: FilterConfig[]): Observable<LineListResponse>;
|
|
8
|
+
* Fetch orgUnit names for given orgUnit IDs
|
|
9
|
+
*/
|
|
10
|
+
fetchOrgUnits(orgUnitIds: string[]): Observable<Map<string, string>>;
|
|
19
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<LineListService, never>;
|
|
20
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<LineListService>;
|
|
21
13
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
2
|
+
import { LineListResponse, ColumnDefinition, TableRow } from '../models/line-list.models';
|
|
3
|
+
export declare const getEventData: (response: LineListResponse, pager: any, metaData: Program, isOptionSetNameVisible: boolean) => {
|
|
4
|
+
columns: ColumnDefinition[];
|
|
5
|
+
data: TableRow[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getProgramStageData: (response: LineListResponse, programStageId: string, pager: any, metaData: Program, isOptionSetNameVisible: boolean) => {
|
|
8
|
+
columns: ColumnDefinition[];
|
|
9
|
+
data: TableRow[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Program } from '@iapps/d2-web-sdk';
|
|
2
|
+
import { LineListResponse, ColumnDefinition, TableRow } from '../models/line-list.models';
|
|
3
|
+
export declare const getTrackedEntityTableData: (response: LineListResponse, programId: string, pager: any, metaData: Program) => {
|
|
4
|
+
columns: ColumnDefinition[];
|
|
5
|
+
data: TableRow[];
|
|
6
|
+
filteredEntityColumns: ColumnDefinition[];
|
|
7
|
+
orgUnitLabel: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const addActionsColumn: (columns: ColumnDefinition[], actionOptions?: any[]) => ColumnDefinition[];
|
|
@@ -6,6 +6,7 @@ export interface IProgramEntryFormMetaData {
|
|
|
6
6
|
id: string;
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string;
|
|
9
|
+
program: Program;
|
|
9
10
|
formFields: IFormField<string>[];
|
|
10
11
|
sections: IProgramEntryFormSection[];
|
|
11
12
|
rules: IMetadataRule[];
|
|
@@ -17,7 +18,7 @@ export declare class ProgramEntryFormMetaData implements IProgramEntryFormMetaDa
|
|
|
17
18
|
description?: string;
|
|
18
19
|
d2: import("@iapps/d2-web-sdk").D2Web;
|
|
19
20
|
config: ProgramEntryFormConfig;
|
|
20
|
-
|
|
21
|
+
program: Program;
|
|
21
22
|
setConfig(config: ProgramEntryFormConfig): ProgramEntryFormMetaData;
|
|
22
23
|
getProgramPromise(): Promise<import("@iapps/d2-web-sdk").D2Response<Program>>;
|
|
23
24
|
get formFields(): IFormField<string>[];
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
2
|
-
import { FilterConfig } from '../models/filter-config.model';
|
|
3
|
-
import { TrackedEntity, TrackedEntityInstance } from '../models/line-list.models';
|
|
4
|
-
export declare function buildFilters(filters: AttributeFilter[]): string;
|
|
5
|
-
export declare function buildFiltersFromEvents(filters: FilterConfig[]): string;
|
|
6
|
-
export declare const getFilteredTrackedEntityInstances: (trackedEntityInstances: TrackedEntityInstance[], filters: FilterConfig[]) => TrackedEntityInstance[];
|
|
7
|
-
export declare const getFilteredTrackedEntites: (trackedEntities: TrackedEntity[], filters: FilterConfig[]) => TrackedEntity[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FilterConfig } from '../models/filter-config.model';
|
|
2
|
-
import { LineListResponse, ColumnDefinition, TableRow } from '../models/line-list.models';
|
|
3
|
-
export declare const getProgramStageData: (response: LineListResponse, programStageId: string, pager: any, isOptionSetNameVisible: boolean) => {
|
|
4
|
-
columns: ColumnDefinition[];
|
|
5
|
-
data: TableRow[];
|
|
6
|
-
};
|
|
7
|
-
export declare const getTrackedEntityData: (response: LineListResponse, programId: string, pager: any, isOptionSetNameVisible: boolean, filters?: FilterConfig[]) => {
|
|
8
|
-
columns: ColumnDefinition[];
|
|
9
|
-
data: TableRow[];
|
|
10
|
-
filteredEntityColumns: ColumnDefinition[];
|
|
11
|
-
orgUnitLabel: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const getEventData: (response: LineListResponse, pager: any, isOptionSetNameVisible: boolean) => {
|
|
14
|
-
columns: ColumnDefinition[];
|
|
15
|
-
data: TableRow[];
|
|
16
|
-
};
|
|
17
|
-
export declare const addActionsColumn: (columns: ColumnDefinition[], actionOptions?: any[]) => ColumnDefinition[];
|