@iapps/ng-dhis2-ui 1.2.0 → 1.2.2

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,8 +1,8 @@
1
1
  import { EffectRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { FormControl, FormGroup } from '@angular/forms';
3
3
  import { Subject } from 'rxjs';
4
- import { FieldConfig, IMetadataRuleAction } from '../../models';
5
4
  import { IFormField } from '../../interfaces';
5
+ import { FieldConfig, IMetadataRuleAction } from '../../models';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class FormFieldComponent implements OnInit, OnChanges, OnDestroy {
8
8
  #private;
@@ -1,3 +1,3 @@
1
1
  export declare class FormFieldTypeUtil {
2
- static getFieldType(valueType: string): "text" | "number" | "image" | "org-unit" | "file";
2
+ static getFieldType(valueType: string): "text" | "image" | "org-unit" | "file" | "number";
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" | "text" | "tel" | "email" | "number" | "org-unit" | "file";
6
+ static getFieldType(valueType: string): "text" | "tel" | "email" | "date" | "org-unit" | "file" | "number";
7
7
  static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
8
8
  static getOptionEntities?(options: any[]): any;
9
9
  }
@@ -1,6 +1,8 @@
1
1
  import { ActionOptionOrientation, LineListActionOption } from '../../models';
2
2
  import React from 'react';
3
+ import { TableRow } from '../../models/line-list.models';
3
4
  export declare const DataTableActions: (props: {
5
+ data: TableRow;
4
6
  actionOptions: LineListActionOption[];
5
7
  actionOptionOrientation: ActionOptionOrientation;
6
8
  onClick: (dropdownOption: LineListActionOption) => void;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const LineListTable: ({ columns, data, pager, setPager, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: any) => React.JSX.Element;
2
+ export declare const LineListTable: ({ columns, data, pager, setPager, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, selectable, rowsSelected, }: any) => React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const TableBody: ({ data, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: any) => React.JSX.Element;
2
+ export declare const TableBody: ({ data, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, selectedRows, onRowToggle, selectable, }: any) => React.JSX.Element;
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
- export declare const TableHeader: ({ columns }: {
2
+ export declare const TableHeader: ({ columns, allSelected, onSelectAll, selectable, }: {
3
3
  columns: any[];
4
+ allSelected: boolean;
5
+ onSelectAll: (checked: boolean) => void;
6
+ selectable: boolean;
4
7
  }) => React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const TableRow: ({ row, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, }: any) => React.JSX.Element;
2
+ export declare const TableRow: ({ row, columns, getTextColorFromBackGround, actionOptions, actionOptionOrientation, actionSelected, isChecked, onToggle, selectable, }: any) => React.JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { EventEmitter, SimpleChanges } from '@angular/core';
2
+ import { DataQueryFilter, DHIS2Event, TrackedEntityInstance } from '@iapps/d2-web-sdk';
2
3
  import React from 'react';
3
4
  import { ReactWrapperModule } from '../../react-wrapper/react-wrapper.component';
5
+ import { ActionOptionOrientation, LineListActionOption } from '../models';
4
6
  import { AttributeFilter } from '../models/attribute-filter.model';
5
- import { TableRow } from '../models/line-list.models';
6
7
  import { LineListService } from '../services/line-list.service';
7
- import { ActionOptionOrientation, LineListActionOption } from '../models';
8
- import { DataQueryFilter } 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;
@@ -19,25 +18,23 @@ export declare class LineListTableComponent extends ReactWrapperModule {
19
18
  endDate?: string;
20
19
  dataQueryFilters?: DataQueryFilter[];
21
20
  ouMode?: string;
22
- actionSelected: EventEmitter<{
23
- action: string;
24
- row: TableRow;
25
- }>;
26
- private reactStateUpdaters;
27
- approvalSelected: EventEmitter<{
28
- teiId: string;
29
- enrollmentId: string;
30
- }[]>;
31
21
  isButtonLoading: boolean;
32
22
  buttonFilter: string;
33
23
  filterRootOrgUnit: boolean;
34
24
  showFilters: boolean;
35
25
  isOptionSetNameVisible: boolean;
26
+ allowRowsSelection: boolean;
27
+ actionSelected: EventEmitter<{
28
+ action: string;
29
+ data: TrackedEntityInstance | DHIS2Event;
30
+ }>;
31
+ rowsSelected: EventEmitter<TrackedEntityInstance[] | DHIS2Event[]>;
32
+ private reactStateUpdaters;
36
33
  setReactStateUpdaters: (updaters: any) => void;
37
34
  ngOnChanges(changes: SimpleChanges): void;
38
35
  lineListService: LineListService;
39
36
  LineList: () => React.JSX.Element;
40
37
  ngAfterViewInit(): Promise<void>;
41
38
  static ɵfac: i0.ɵɵFactoryDeclaration<LineListTableComponent, 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>;
39
+ 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; }; "allowRowsSelection": { "alias": "allowRowsSelection"; "required": false; }; }, { "actionSelected": "actionSelected"; "rowsSelected": "rowsSelected"; }, never, ["*"], false, never>;
43
40
  }
@@ -1,5 +1,6 @@
1
- import { TableRow } from './line-list.models';
1
+ import { DHIS2Event, TrackedEntityInstance } from '@iapps/d2-web-sdk';
2
2
  import { DropdownMenuOption } from './dropdown-menu.model';
3
3
  export interface LineListActionOption extends DropdownMenuOption {
4
- onClick?: (tableRow: TableRow) => void;
4
+ condition?: string;
5
+ onClick?: (tableRow: TrackedEntityInstance | DHIS2Event) => void;
5
6
  }
@@ -1,4 +1,4 @@
1
- import { Pager, TrackedEntityInstance } from "@iapps/d2-web-sdk";
1
+ import { DHIS2Event, Pager, TrackedEntityInstance } from '@iapps/d2-web-sdk';
2
2
  export interface PagerObject {
3
3
  page: number;
4
4
  pageSize: number;
@@ -173,7 +173,7 @@ export interface LineListResponse {
173
173
  }
174
174
  export interface TableRow {
175
175
  [key: string]: {
176
- value: string | number;
176
+ value: TrackedEntityInstance | DHIS2Event | string | number;
177
177
  style?: string;
178
178
  };
179
179
  index: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iapps/ng-dhis2-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",
@@ -1,6 +0,0 @@
1
- export interface FilterConfig {
2
- programStage: string;
3
- dataElement: string;
4
- operator: string;
5
- value: string | number;
6
- }
@@ -1,10 +0,0 @@
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
- };