@iapps/ng-dhis2-ui 1.2.160 → 1.2.162
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 +103 -10
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +20 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import React, { ComponentProps } from 'react';
|
|
|
4
4
|
import * as ReactDOM from 'react-dom/client';
|
|
5
5
|
import * as i2 from '@angular/common';
|
|
6
6
|
import * as _iapps_d2_web_sdk from '@iapps/d2-web-sdk';
|
|
7
|
-
import { TrackedEntityInstance, DHIS2Event, DataQueryFilter, LineListRowActionFilterConfig, EnrollmentStatus, EventStatus, Option as Option$1, ProgramRuleAction, ProgramRuleVariable, ProgramRule, Program, BaseTrackerQuery, BaseEventQuery,
|
|
7
|
+
import { TrackedEntityInstance, DHIS2Event, DataQueryFilter, LineListRowActionFilterConfig, EnrollmentStatus, EventStatus, Option as Option$1, ProgramRuleAction, ProgramRuleVariable, ProgramRule, Program, BaseTrackerQuery, BaseEventQuery, D2TrackerResponse, D2EventResponse } from '@iapps/d2-web-sdk';
|
|
8
8
|
import * as rxjs from 'rxjs';
|
|
9
9
|
import { Observable, Subject } from 'rxjs';
|
|
10
10
|
import * as i8 from '@angular/forms';
|
|
@@ -648,7 +648,10 @@ interface JsonTransformer<T> {
|
|
|
648
648
|
}
|
|
649
649
|
type ProgramRuleActionType = 'HIDEFIELD' | 'SHOWFIELD' | 'ASSIGN' | 'HIDESECTION' | 'SHOWSECTION' | 'HIDEPROGRAMSTAGE' | 'SHOWPROGRAMSTAGE' | 'WARNINGONCOMPLETE' | 'WARNINGONCREATE' | 'ERRORONCOMPLETE' | 'ERRORONCREATE' | string;
|
|
650
650
|
interface IMetadataRuleAction {
|
|
651
|
+
id?: string;
|
|
651
652
|
field: string;
|
|
653
|
+
section?: string;
|
|
654
|
+
sectionType?: 'PROGRAM_SECTION' | 'PROGRAM_STAGE_SECTION';
|
|
652
655
|
actionType: ProgramRuleActionType;
|
|
653
656
|
assignedData?: string;
|
|
654
657
|
displayedContent?: string;
|
|
@@ -670,6 +673,9 @@ declare class MetadataRuleAction implements IMetadataRuleAction, JsonTransformer
|
|
|
670
673
|
private variableMap;
|
|
671
674
|
constructor(ruleAction: ProgramRuleAction, ruleVariables: ProgramRuleVariable[]);
|
|
672
675
|
get field(): string;
|
|
676
|
+
get section(): string | undefined;
|
|
677
|
+
get sectionType(): 'PROGRAM_SECTION' | 'PROGRAM_STAGE_SECTION' | undefined;
|
|
678
|
+
get isSectionAction(): boolean;
|
|
673
679
|
get programRule(): {
|
|
674
680
|
id: string;
|
|
675
681
|
};
|
|
@@ -1033,6 +1039,7 @@ declare class FormFieldComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1033
1039
|
runtimeOptionChange: EventEmitter<any>;
|
|
1034
1040
|
value: _angular_core.WritableSignal<any>;
|
|
1035
1041
|
runtimeError: _angular_core.WritableSignal<string>;
|
|
1042
|
+
programRuleOptions: _angular_core.WritableSignal<any[]>;
|
|
1036
1043
|
private _runtimeOptions;
|
|
1037
1044
|
runtimeOptions: any;
|
|
1038
1045
|
fieldFilterControl: FormControl;
|
|
@@ -1060,11 +1067,14 @@ declare class FormFieldComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1060
1067
|
value: string;
|
|
1061
1068
|
}): void;
|
|
1062
1069
|
onFieldUpdate(e?: any, isDate?: boolean, isDateTime?: boolean): void;
|
|
1070
|
+
getDisplayField(field: IFormField<string>): IFormField<string>;
|
|
1071
|
+
private getProgramRuleOptions;
|
|
1063
1072
|
onUpdateRuntimeOptions(options: any[]): void;
|
|
1064
1073
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
1065
1074
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "ng-dhis2-ui-form-field", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "fieldConfig": { "alias": "fieldConfig"; "required": true; "isSignal": true; }; "form": { "alias": "form"; "required": false; }; "isCheckBoxButton": { "alias": "isCheckBoxButton"; "required": false; "isSignal": true; }; "fieldClass": { "alias": "fieldClass"; "required": false; "isSignal": true; }; "programRuleActions": { "alias": "programRuleActions"; "required": false; "isSignal": true; }; "dataEntities": { "alias": "dataEntities"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "dataId": { "alias": "dataId"; "required": false; "isSignal": true; }; "customOrgUnitRoots": { "alias": "customOrgUnitRoots"; "required": false; "isSignal": true; }; "program": { "alias": "program"; "required": false; "isSignal": true; }; "optionCascadeConfigs": { "alias": "optionCascadeConfigs"; "required": false; "isSignal": true; }; "optionCascadeConfigMap": { "alias": "optionCascadeConfigMap"; "required": false; "isSignal": true; }; "coordinatePickerGeoConfig": { "alias": "coordinatePickerGeoConfig"; "required": false; "isSignal": true; }; "fieldControlKeyById": { "alias": "fieldControlKeyById"; "required": false; "isSignal": true; }; }, { "fieldUpdate": "fieldUpdate"; "immediateFieldUpdate": "immediateFieldUpdate"; "runtimeOptionChange": "runtimeOptionChange"; }, never, never, false, never>;
|
|
1066
1075
|
}
|
|
1067
1076
|
|
|
1077
|
+
type SectionRuleTargetType = 'PROGRAM_SECTION' | 'PROGRAM_STAGE_SECTION';
|
|
1068
1078
|
declare class FormComponent implements OnChanges, OnDestroy, OnInit {
|
|
1069
1079
|
#private;
|
|
1070
1080
|
programEntryFormConfig: _angular_core.InputSignal<any>;
|
|
@@ -1106,6 +1116,9 @@ declare class FormComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
1106
1116
|
isSectionOpen(section: {
|
|
1107
1117
|
id?: string | number;
|
|
1108
1118
|
}, index: number): boolean;
|
|
1119
|
+
isSectionVisible(section: {
|
|
1120
|
+
id?: string;
|
|
1121
|
+
} | null | undefined, expectedSectionType: SectionRuleTargetType): boolean;
|
|
1109
1122
|
ngOnInit(): void;
|
|
1110
1123
|
ngOnChanges(changes: SimpleChanges): void;
|
|
1111
1124
|
onSubmit(): void;
|
|
@@ -1352,6 +1365,7 @@ declare class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
1352
1365
|
field: _angular_core.InputSignal<IFormField<string>>;
|
|
1353
1366
|
fieldError: _angular_core.InputSignal<string>;
|
|
1354
1367
|
fieldConfig: _angular_core.InputSignal<FieldConfig>;
|
|
1368
|
+
programRuleOptions: _angular_core.InputSignal<any[]>;
|
|
1355
1369
|
form: _angular_core.ModelSignal<FormGroup<any>>;
|
|
1356
1370
|
isValid: _angular_core.InputSignal<boolean>;
|
|
1357
1371
|
isValueAssigned: _angular_core.InputSignal<boolean>;
|
|
@@ -1366,6 +1380,7 @@ declare class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
1366
1380
|
protected readonly value$: rxjs.Observable<string>;
|
|
1367
1381
|
protected readonly isValueAssigned$: rxjs.Observable<boolean>;
|
|
1368
1382
|
protected readonly fieldError$: rxjs.Observable<string>;
|
|
1383
|
+
protected readonly programRuleOptions$: rxjs.Observable<any[]>;
|
|
1369
1384
|
readonly label: Signal<string | undefined>;
|
|
1370
1385
|
readonly placeholder: Signal<string>;
|
|
1371
1386
|
InputField: () => React.JSX.Element | React.ReactElement | null;
|
|
@@ -1401,7 +1416,7 @@ declare class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
1401
1416
|
private getNowInEatIsoString;
|
|
1402
1417
|
searchForDuplicates(value: string): Promise<boolean>;
|
|
1403
1418
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseFormFieldComponent, never>;
|
|
1404
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseFormFieldComponent, never, never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "fieldError": { "alias": "fieldError"; "required": false; "isSignal": true; }; "fieldConfig": { "alias": "fieldConfig"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": true; "isSignal": true; }; "isValid": { "alias": "isValid"; "required": false; "isSignal": true; }; "isValueAssigned": { "alias": "isValueAssigned"; "required": false; "isSignal": true; }; "dataId": { "alias": "dataId"; "required": false; "isSignal": true; }; "customOrgUnitRoots": { "alias": "customOrgUnitRoots"; "required": false; "isSignal": true; }; "optionCascadeConfigs": { "alias": "optionCascadeConfigs"; "required": false; "isSignal": true; }; "optionCascadeConfigMap": { "alias": "optionCascadeConfigMap"; "required": false; "isSignal": true; }; "coordinatePickerGeoConfig": { "alias": "coordinatePickerGeoConfig"; "required": false; "isSignal": true; }; "fieldControlKeyById": { "alias": "fieldControlKeyById"; "required": false; "isSignal": true; }; "program": { "alias": "program"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "form": "formChange"; "value": "valueChange"; "update": "update"; "immediateUpdate": "immediateUpdate"; }, never, never, true, never>;
|
|
1419
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseFormFieldComponent, never, never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "fieldError": { "alias": "fieldError"; "required": false; "isSignal": true; }; "fieldConfig": { "alias": "fieldConfig"; "required": false; "isSignal": true; }; "programRuleOptions": { "alias": "programRuleOptions"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": true; "isSignal": true; }; "isValid": { "alias": "isValid"; "required": false; "isSignal": true; }; "isValueAssigned": { "alias": "isValueAssigned"; "required": false; "isSignal": true; }; "dataId": { "alias": "dataId"; "required": false; "isSignal": true; }; "customOrgUnitRoots": { "alias": "customOrgUnitRoots"; "required": false; "isSignal": true; }; "optionCascadeConfigs": { "alias": "optionCascadeConfigs"; "required": false; "isSignal": true; }; "optionCascadeConfigMap": { "alias": "optionCascadeConfigMap"; "required": false; "isSignal": true; }; "coordinatePickerGeoConfig": { "alias": "coordinatePickerGeoConfig"; "required": false; "isSignal": true; }; "fieldControlKeyById": { "alias": "fieldControlKeyById"; "required": false; "isSignal": true; }; "program": { "alias": "program"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "form": "formChange"; "value": "valueChange"; "update": "update"; "immediateUpdate": "immediateUpdate"; }, never, never, true, never>;
|
|
1405
1420
|
}
|
|
1406
1421
|
|
|
1407
1422
|
declare class FormFieldItemComponent extends BaseFormFieldComponent {
|
|
@@ -1418,7 +1433,7 @@ declare class D2FormModule {
|
|
|
1418
1433
|
declare class FieldUtil {
|
|
1419
1434
|
static getFieldDropdownOptions(field: any): DropdownOption[];
|
|
1420
1435
|
static sanitizeOptions(options: any[]): any;
|
|
1421
|
-
static getFieldType(valueType: string): "
|
|
1436
|
+
static getFieldType(valueType: string): "date" | "date-time" | "org-unit" | "file" | "number" | "tel" | "coordinate" | "text" | "email";
|
|
1422
1437
|
static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
|
|
1423
1438
|
static getOptionEntities?(options: any[]): any;
|
|
1424
1439
|
}
|
|
@@ -1428,7 +1443,7 @@ declare class FieldControlTypeUtil {
|
|
|
1428
1443
|
}
|
|
1429
1444
|
|
|
1430
1445
|
declare class FormFieldTypeUtil {
|
|
1431
|
-
static getFieldType(valueType: string): "
|
|
1446
|
+
static getFieldType(valueType: string): "date-time" | "image" | "org-unit" | "file" | "number" | "tel" | "coordinate" | "text";
|
|
1432
1447
|
}
|
|
1433
1448
|
|
|
1434
1449
|
declare class FormUtil {
|
|
@@ -1627,7 +1642,7 @@ declare class ProgramEntryFormModule {
|
|
|
1627
1642
|
instance: TrackedEntityInstance | DHIS2Event;
|
|
1628
1643
|
}) => void>;
|
|
1629
1644
|
instanceSave: EventEmitter<TrackedEntityInstance | DHIS2Event>;
|
|
1630
|
-
instanceSaveCompleted: EventEmitter<
|
|
1645
|
+
instanceSaveCompleted: EventEmitter<D2TrackerResponse<TrackedEntityInstance> | D2EventResponse<DHIS2Event>>;
|
|
1631
1646
|
instanceUpdate: EventEmitter<TrackedEntityInstance | DHIS2Event>;
|
|
1632
1647
|
formValidityUpdate: EventEmitter<boolean>;
|
|
1633
1648
|
formCancel: EventEmitter<any>;
|