@iapps/ng-dhis2-ui 1.0.8 → 1.0.9

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/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './lib/modules/button';
3
3
  export * from './lib/modules/period-selector';
4
4
  export * from './lib/modules/organisation-unit-selector';
5
5
  export * from './lib/modules/react-wrapper';
6
+ export * from './lib/modules/line-list';
@@ -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,5 @@
1
+ export declare const dropdownStyles: {
2
+ layer: {
3
+ zIndex: string;
4
+ };
5
+ };
@@ -0,0 +1 @@
1
+ export * from './dropdown-menu';
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { LineListService } from '../services/line-list.service';
3
+ import { DropdownMenuOption } from '../components/dropdown-menu';
4
+ import { AttributeFilter } from '../models/attribute-filter.model';
5
+ import { ReactWrapperComponent } from '../../react-wrapper';
6
+ import * as i0 from "@angular/core";
7
+ export declare class LineListTableComponent extends ReactWrapperComponent {
8
+ programId: string;
9
+ orgUnit: string;
10
+ programStageId?: string;
11
+ actionOptions?: DropdownMenuOption[];
12
+ attributeFilters?: AttributeFilter[];
13
+ startDate?: string;
14
+ endDate?: string;
15
+ lineListService: LineListService;
16
+ LineList: () => React.JSX.Element;
17
+ ngAfterViewInit(): Promise<void>;
18
+ 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>;
20
+ }
@@ -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,2 @@
1
+ export * from './line-list.module';
2
+ export * from './containers/line-list.component';
@@ -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,9 @@
1
+ export interface AttributeFilter {
2
+ attribute: string;
3
+ operator: string;
4
+ value: string | number;
5
+ }
6
+ export interface AttributeFilterGroup {
7
+ logic: 'AND' | 'OR';
8
+ filters: AttributeFilter[];
9
+ }
@@ -0,0 +1,70 @@
1
+ export interface Pager {
2
+ page: number;
3
+ pageSize: number;
4
+ total: number;
5
+ pageCount: number;
6
+ }
7
+ export interface EventsResponse {
8
+ events: {
9
+ event: string;
10
+ programStage?: string;
11
+ dataValues: {
12
+ dataElement: string;
13
+ value: string;
14
+ }[];
15
+ }[];
16
+ pager: Pager;
17
+ }
18
+ export interface Enrollment {
19
+ enrollment: string;
20
+ program: string;
21
+ attributes: {
22
+ attribute: string;
23
+ value: string;
24
+ displayName?: string;
25
+ }[];
26
+ }
27
+ export interface TrackedEntityInstance {
28
+ trackedEntityInstance: string;
29
+ attributes: {
30
+ attribute: string;
31
+ value: string;
32
+ displayName?: string;
33
+ }[];
34
+ enrollments: Enrollment[];
35
+ }
36
+ export interface TrackedEntityInstancesResponse {
37
+ trackedEntityInstances: TrackedEntityInstance[];
38
+ pager: Pager;
39
+ }
40
+ export interface ProgramStageDataElement {
41
+ dataElement: {
42
+ id: string;
43
+ name: string;
44
+ };
45
+ }
46
+ export interface ProgramStage {
47
+ id: string;
48
+ name: string;
49
+ programStageDataElements: ProgramStageDataElement[];
50
+ }
51
+ export interface ProgramMetadata {
52
+ programType: string;
53
+ programStages: ProgramStage[];
54
+ organisationUnits: {
55
+ id: string;
56
+ name: string;
57
+ }[];
58
+ }
59
+ export interface LineListResponse {
60
+ metadata: ProgramMetadata;
61
+ data: EventsResponse | TrackedEntityInstancesResponse;
62
+ }
63
+ export interface TableRow {
64
+ [key: string]: string | number;
65
+ index: number;
66
+ }
67
+ export interface ColumnDefinition {
68
+ label: string;
69
+ key: string;
70
+ }
@@ -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,2 @@
1
+ import { AttributeFilter } from '../models/attribute-filter.model';
2
+ export declare function buildFilters(filters: AttributeFilter[]): string;
@@ -0,0 +1,14 @@
1
+ import { LineListResponse, ColumnDefinition, TableRow } from '../models/line-list.models';
2
+ export declare const getProgramStageData: (response: LineListResponse, programStageId: string, pager: any) => {
3
+ columns: ColumnDefinition[];
4
+ data: TableRow[];
5
+ };
6
+ export declare const getTrackedEntityData: (response: LineListResponse, programId: string, pager: any) => {
7
+ columns: ColumnDefinition[];
8
+ data: TableRow[];
9
+ };
10
+ export declare const getEventData: (response: LineListResponse, pager: any) => {
11
+ columns: ColumnDefinition[];
12
+ data: TableRow[];
13
+ };
14
+ export declare const addActionsColumn: (columns: ColumnDefinition[], actionOptions?: any[]) => ColumnDefinition[];
@@ -11,19 +11,19 @@ export declare const getFixedDimensions: () => {
11
11
  id: string;
12
12
  name: any;
13
13
  iconName: string;
14
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
14
+ icon: any;
15
15
  };
16
16
  pe: {
17
17
  id: string;
18
18
  name: any;
19
19
  iconName: string;
20
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
20
+ icon: any;
21
21
  };
22
22
  ou: {
23
23
  id: string;
24
24
  name: any;
25
25
  iconName: string;
26
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
26
+ icon: any;
27
27
  };
28
28
  };
29
29
  export declare const getDynamicDimensions: () => {
@@ -47,19 +47,19 @@ export declare const getPredefinedDimensions: () => {
47
47
  id: string;
48
48
  name: any;
49
49
  iconName: string;
50
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
50
+ icon: any;
51
51
  };
52
52
  pe: {
53
53
  id: string;
54
54
  name: any;
55
55
  iconName: string;
56
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
56
+ icon: any;
57
57
  };
58
58
  ou: {
59
59
  id: string;
60
60
  name: any;
61
61
  iconName: string;
62
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
62
+ icon: any;
63
63
  };
64
64
  };
65
65
  export declare const filterOutPredefinedDimensions: (dimensionIds: string[]) => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iapps/ng-dhis2-ui",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",