@iapps/ng-dhis2-ui 1.0.8 → 1.1.0
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 +512 -8
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/modules/line-list/components/dropdown-menu/dropdown-menu.d.ts +19 -0
- package/lib/modules/line-list/components/dropdown-menu/dropdown-menu.styles.d.ts +5 -0
- package/lib/modules/line-list/components/dropdown-menu/index.d.ts +1 -0
- package/lib/modules/line-list/containers/line-list.component.d.ts +31 -0
- package/lib/modules/line-list/hooks/index.d.ts +1 -0
- package/lib/modules/line-list/hooks/use-dynamic-styles.hook.d.ts +1 -0
- package/lib/modules/line-list/index.d.ts +2 -0
- package/lib/modules/line-list/line-list.module.d.ts +9 -0
- package/lib/modules/line-list/models/attribute-filter.model.d.ts +10 -0
- package/lib/modules/line-list/models/filter-config.model.d.ts +6 -0
- package/lib/modules/line-list/models/line-list.models.d.ts +129 -0
- package/lib/modules/line-list/services/line-list.service.d.ts +16 -0
- package/lib/modules/line-list/utils/filter-builder.d.ts +5 -0
- package/lib/modules/line-list/utils/line-list-utils.d.ts +15 -0
- package/lib/modules/react-wrapper/react-wrapper.component.d.ts +2 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DropdownMenuOption {
|
|
3
|
+
id?: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: any;
|
|
7
|
+
destructive?: boolean;
|
|
8
|
+
onClick?: Function;
|
|
9
|
+
}
|
|
10
|
+
export declare const ContextMenu: (params: {
|
|
11
|
+
dropDownOptions: DropdownMenuOption[];
|
|
12
|
+
anchorRef: any;
|
|
13
|
+
onClose: Function;
|
|
14
|
+
onMenuClick: (dropdownOption: DropdownMenuOption) => void;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
export declare const DropdownMenu: (props: {
|
|
17
|
+
dropdownOptions: DropdownMenuOption[];
|
|
18
|
+
onClick: (dropdownOption: DropdownMenuOption) => void;
|
|
19
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dropdown-menu';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventEmitter, SimpleChanges } from '@angular/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { LineListService } from '../services/line-list.service';
|
|
4
|
+
import { DropdownMenuOption } from '../components/dropdown-menu';
|
|
5
|
+
import { TableRow } from '../models/line-list.models';
|
|
6
|
+
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
7
|
+
import { ReactWrapperComponent } from '../../react-wrapper';
|
|
8
|
+
import { FilterConfig } from '../models/filter-config.model';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class LineListTableComponent extends ReactWrapperComponent {
|
|
11
|
+
programId: string;
|
|
12
|
+
orgUnit: string;
|
|
13
|
+
programStageId?: string;
|
|
14
|
+
actionOptions?: DropdownMenuOption[];
|
|
15
|
+
attributeFilters?: AttributeFilter[];
|
|
16
|
+
startDate?: string;
|
|
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;
|
|
26
|
+
lineListService: LineListService;
|
|
27
|
+
LineList: () => React.JSX.Element;
|
|
28
|
+
ngAfterViewInit(): Promise<void>;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LineListTableComponent, 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>;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-dynamic-styles.hook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDynamicStyles: <T extends Record<string, React.CSSProperties | any>>(stylesObj: T) => { [K in keyof T]: string; };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./containers/line-list.component.tsx";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../../shared/shared.module";
|
|
5
|
+
export declare class LineListModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LineListModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LineListModule, [typeof i1.LineListTableComponent], [typeof i2.CommonModule, typeof i3.SharedDhis2UiModule], [typeof i1.LineListTableComponent]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<LineListModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export interface Pager {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
total: number;
|
|
5
|
+
pageCount: number;
|
|
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
|
+
}
|
|
16
|
+
export interface EventsResponse {
|
|
17
|
+
events: Event[];
|
|
18
|
+
pager: Pager;
|
|
19
|
+
}
|
|
20
|
+
export interface Event {
|
|
21
|
+
dueDate: string;
|
|
22
|
+
program: string;
|
|
23
|
+
event: string;
|
|
24
|
+
programStage?: string;
|
|
25
|
+
orgUnit: string;
|
|
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 {
|
|
54
|
+
program: string;
|
|
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[];
|
|
73
|
+
}
|
|
74
|
+
export interface TrackedEntityInstance {
|
|
75
|
+
trackedEntityInstance: string;
|
|
76
|
+
attributes: {
|
|
77
|
+
attribute: string;
|
|
78
|
+
value: string;
|
|
79
|
+
displayName?: string;
|
|
80
|
+
}[];
|
|
81
|
+
enrollments: Enrollment[];
|
|
82
|
+
}
|
|
83
|
+
export interface TrackedEntityInstancesResponse {
|
|
84
|
+
trackedEntityInstances: TrackedEntityInstance[];
|
|
85
|
+
pager: Pager;
|
|
86
|
+
}
|
|
87
|
+
export interface ProgramStageDataElement {
|
|
88
|
+
dataElement: {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface ProgramStage {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
programStageDataElements: ProgramStageDataElement[];
|
|
97
|
+
}
|
|
98
|
+
export interface ProgramMetadata {
|
|
99
|
+
programType: string;
|
|
100
|
+
programStages: ProgramStage[];
|
|
101
|
+
organisationUnits: {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
}[];
|
|
105
|
+
}
|
|
106
|
+
export interface LineListResponse {
|
|
107
|
+
metadata: ProgramMetadata;
|
|
108
|
+
data: EventsResponse | TrackedEntityInstancesResponse;
|
|
109
|
+
}
|
|
110
|
+
export interface TableRow {
|
|
111
|
+
[key: string]: string | number;
|
|
112
|
+
index: number;
|
|
113
|
+
}
|
|
114
|
+
export interface ColumnDefinition {
|
|
115
|
+
label: string;
|
|
116
|
+
key: string;
|
|
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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NgxDhis2HttpClientService } from '@iapps/ngx-dhis2-http-client';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { LineListResponse } from '../models/line-list.models';
|
|
4
|
+
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class LineListService {
|
|
7
|
+
private httpClient;
|
|
8
|
+
constructor(httpClient: NgxDhis2HttpClientService);
|
|
9
|
+
private getProgramMetadata;
|
|
10
|
+
private getTrackedEntityInstances;
|
|
11
|
+
private getEvents;
|
|
12
|
+
private getEventsByProgramStage;
|
|
13
|
+
getLineListData(programId: string, orgUnit?: string, programStageId?: string, page?: number, pageSize?: number, filters?: AttributeFilter[], startDate?: string, endDate?: string): Observable<LineListResponse>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LineListService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LineListService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AttributeFilter } from '../models/attribute-filter.model';
|
|
2
|
+
import { FilterConfig } from '../models/filter-config.model';
|
|
3
|
+
import { TrackedEntityInstance } from '../models/line-list.models';
|
|
4
|
+
export declare function buildFilters(filters: AttributeFilter[]): string;
|
|
5
|
+
export declare const getFilteredTrackedEntityInstances: (trackedEntityInstance: TrackedEntityInstance[], filters: FilterConfig[]) => TrackedEntityInstance[];
|
|
@@ -0,0 +1,15 @@
|
|
|
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) => {
|
|
4
|
+
columns: ColumnDefinition[];
|
|
5
|
+
data: TableRow[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getTrackedEntityData: (response: LineListResponse, programId: string, pager: any, filters?: FilterConfig[]) => {
|
|
8
|
+
columns: ColumnDefinition[];
|
|
9
|
+
data: TableRow[];
|
|
10
|
+
};
|
|
11
|
+
export declare const getEventData: (response: LineListResponse, pager: any) => {
|
|
12
|
+
columns: ColumnDefinition[];
|
|
13
|
+
data: TableRow[];
|
|
14
|
+
};
|
|
15
|
+
export declare const addActionsColumn: (columns: ColumnDefinition[], actionOptions?: any[]) => ColumnDefinition[];
|
|
@@ -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>;
|