@iapps/ng-dhis2-ui 1.1.80 → 1.2.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.
@@ -1,3 +1,3 @@
1
1
  export declare class FormFieldTypeUtil {
2
- static getFieldType(valueType: string): "number" | "text" | "image" | "org-unit" | "file";
2
+ static getFieldType(valueType: string): "text" | "number" | "image" | "org-unit" | "file";
3
3
  }
@@ -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" | "email" | "number" | "text" | "tel" | "org-unit" | "file";
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 OrgUnitSelector: ({ hide, setHide, selectedOrgUnit, setSelectedOrgUnit, setOrgUnitState, }: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TableBody: ({ data, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: any) => React.JSX.Element;
@@ -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,2 @@
1
+ import React from 'react';
2
+ export declare const LineListTable: ({ columns, data, pager, setPager, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: 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 {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const TableCell: ({ cell, getTextColorFromBackGround, }: {
3
+ cell: any;
4
+ getTextColorFromBackGround: (color: string) => string;
5
+ }) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TableFooter: ({ pager, setPager, columns }: any) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const TableHeader: ({ columns }: {
3
+ columns: any[];
4
+ }) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TableRow: ({ row, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: any) => React.JSX.Element;
@@ -2,10 +2,10 @@ 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
5
  import { TableRow } from '../models/line-list.models';
7
6
  import { LineListService } from '../services/line-list.service';
8
7
  import { ActionOptionOrientation, LineListActionOption } from '../models';
8
+ import { DataQueryFilter } from '@iapps/d2-web-sdk';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class LineListTableComponent extends ReactWrapperModule {
11
11
  programId: string;
@@ -17,9 +17,8 @@ export declare class LineListTableComponent extends ReactWrapperModule {
17
17
  useOuModeWithOlderDHIS2Instance?: boolean;
18
18
  startDate?: string;
19
19
  endDate?: string;
20
- filters?: FilterConfig[];
20
+ dataQueryFilters?: DataQueryFilter[];
21
21
  ouMode?: string;
22
- dispatchTeis: boolean;
23
22
  actionSelected: EventEmitter<{
24
23
  action: string;
25
24
  row: TableRow;
@@ -30,8 +29,6 @@ export declare class LineListTableComponent extends ReactWrapperModule {
30
29
  enrollmentId: string;
31
30
  }[]>;
32
31
  isButtonLoading: boolean;
33
- buttonLabel: string;
34
- firstValue: EventEmitter<string>;
35
32
  buttonFilter: string;
36
33
  filterRootOrgUnit: boolean;
37
34
  showFilters: boolean;
@@ -42,5 +39,5 @@ export declare class LineListTableComponent extends ReactWrapperModule {
42
39
  LineList: () => React.JSX.Element;
43
40
  ngAfterViewInit(): Promise<void>;
44
41
  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; }; "filters": { "alias": "filters"; "required": false; }; "ouMode": { "alias": "ouMode"; "required": false; }; "dispatchTeis": { "alias": "dispatchTeis"; "required": false; }; "isButtonLoading": { "alias": "isButtonLoading"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "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"; "firstValue": "firstValue"; }, never, ["*"], false, never>;
42
+ 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
43
  }
@@ -1,4 +1,5 @@
1
- export interface Pager {
1
+ import { 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: 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
- metadata: ProgramMetadata;
186
- data: EventsResponse | TrackedEntityInstancesResponse | EnrollmentsResponse | TrackedEntityResponse;
172
+ data: EventsResponse | TrackedEntityInstancesResponse | EnrollmentsResponse | TrackedEntityResponse | TrackedEntityInstance | TrackedEntityInstance[];
187
173
  }
188
174
  export interface TableRow {
189
- [key: string]: string | number;
190
- index: number;
175
+ [key: string]: {
176
+ value: 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: string;
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
- * Fetch orgUnit names for given orgUnit IDs
14
- */
15
- private fetchOrgUnits;
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
- metaData: Program;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@iapps/ng-dhis2-ui",
3
- "version": "1.1.80",
3
+ "version": "1.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",
@@ -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[];