@iapps/ng-dhis2-ui 1.1.41 → 1.1.42
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.
|
@@ -3334,6 +3334,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3334
3334
|
this.approvalSelected = new EventEmitter();
|
|
3335
3335
|
this.isButtonLoading = false;
|
|
3336
3336
|
this.buttonLabel = '';
|
|
3337
|
+
this.firstValue = new EventEmitter();
|
|
3337
3338
|
this.setReactStateUpdaters = (updaters) => {
|
|
3338
3339
|
this.reactStateUpdaters = updaters;
|
|
3339
3340
|
};
|
|
@@ -3408,6 +3409,8 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3408
3409
|
const { columns, data, filteredEntityColumns } = getTrackedEntityData(response, this.programId, pager, this.filters);
|
|
3409
3410
|
entityColumns = columns;
|
|
3410
3411
|
entityData = data;
|
|
3412
|
+
let firstTei = response.data.trackedEntityInstances[0].trackedEntityInstance;
|
|
3413
|
+
this.firstValue.emit(firstTei);
|
|
3411
3414
|
// setFilteredColumns(filteredEntityColumns);
|
|
3412
3415
|
// Ensure filter inputs do not disappear when no data is returned
|
|
3413
3416
|
// If filteredEntityColumns is empty, keep the previous columns instead of clearing them
|
|
@@ -3478,15 +3481,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3478
3481
|
}
|
|
3479
3482
|
});
|
|
3480
3483
|
};
|
|
3481
|
-
// const handleInputChange = (key: string, value: string) => {
|
|
3482
|
-
// setInputValues((prevValues) => ({
|
|
3483
|
-
// ...prevValues,
|
|
3484
|
-
// [key]: value ?? '', // Ensure no undefined values
|
|
3485
|
-
// }));
|
|
3486
|
-
// };
|
|
3487
|
-
// if (!filteredColumns || filteredColumns.length === 0) {
|
|
3488
|
-
// return <div>No fields available</div>;
|
|
3489
|
-
// }
|
|
3490
3484
|
const handleInputChange = (key, value) => {
|
|
3491
3485
|
setInputValues((prevValues) => ({
|
|
3492
3486
|
...prevValues,
|
|
@@ -3502,29 +3496,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3502
3496
|
// console.log(`Updated Filters:`, updatedFilters); // Debugging
|
|
3503
3497
|
return updatedFilters;
|
|
3504
3498
|
});
|
|
3505
|
-
// setAttributeFiltersState((prevFilters = []) => {
|
|
3506
|
-
// // Check if attribute already exists
|
|
3507
|
-
// const existingFilterIndex = prevFilters.findIndex(
|
|
3508
|
-
// (f) => f.attribute === key
|
|
3509
|
-
// );
|
|
3510
|
-
// // Create a new filter object
|
|
3511
|
-
// const newFilter = { attribute: key, operator: 'like', value };
|
|
3512
|
-
// if (existingFilterIndex !== -1) {
|
|
3513
|
-
// // If attribute exists, update its value
|
|
3514
|
-
// const updatedFilters = [...prevFilters];
|
|
3515
|
-
// updatedFilters[existingFilterIndex] = newFilter;
|
|
3516
|
-
// console.log(`Updated Filters:`, updatedFilters); // Log updated filter list
|
|
3517
|
-
// return updatedFilters;
|
|
3518
|
-
// } else {
|
|
3519
|
-
// // If attribute doesn't exist, add a new object
|
|
3520
|
-
// return [...prevFilters, newFilter];
|
|
3521
|
-
// }
|
|
3522
|
-
// });
|
|
3523
3499
|
};
|
|
3524
|
-
// console.log(
|
|
3525
|
-
// 'these are the filtered columns which have the attributes neede',
|
|
3526
|
-
// filteredColumns
|
|
3527
|
-
// );
|
|
3528
3500
|
return (React__default.createElement("div", null,
|
|
3529
3501
|
React__default.createElement("div", { style: {
|
|
3530
3502
|
width: '100%',
|
|
@@ -3554,7 +3526,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3554
3526
|
gap: 8,
|
|
3555
3527
|
}, onClick: () => {
|
|
3556
3528
|
setFilters(!filters);
|
|
3557
|
-
} },
|
|
3529
|
+
}, secondary: true },
|
|
3558
3530
|
React__default.createElement(IconFilter16, null),
|
|
3559
3531
|
filters ? 'Hide Filters' : 'Show Filters'))),
|
|
3560
3532
|
filters && (React__default.createElement("div", { style: {
|
|
@@ -3640,7 +3612,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3640
3612
|
this.render();
|
|
3641
3613
|
}
|
|
3642
3614
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3643
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.8", type: LineListTableComponent, isStandalone: false, selector: "app-line-list", inputs: { programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", attributeFilters: "attributeFilters", startDate: "startDate", endDate: "endDate", filters: "filters", ouMode: "ouMode", dispatchTeis: "dispatchTeis", showFilterButton: "showFilterButton", isButtonLoading: "isButtonLoading", buttonLabel: "buttonLabel" }, outputs: { actionSelected: "actionSelected", approvalSelected: "approvalSelected" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["[data-test=dhis2-uiwidgets-pagination]{display:flex!important;flex-direction:row!important;justify-content:space-between!important;align-items:center!important}\n"] }); }
|
|
3615
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.8", type: LineListTableComponent, isStandalone: false, selector: "app-line-list", inputs: { programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", attributeFilters: "attributeFilters", startDate: "startDate", endDate: "endDate", filters: "filters", ouMode: "ouMode", dispatchTeis: "dispatchTeis", showFilterButton: "showFilterButton", isButtonLoading: "isButtonLoading", buttonLabel: "buttonLabel" }, outputs: { actionSelected: "actionSelected", approvalSelected: "approvalSelected", firstValue: "firstValue" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["[data-test=dhis2-uiwidgets-pagination]{display:flex!important;flex-direction:row!important;justify-content:space-between!important;align-items:center!important}\n"] }); }
|
|
3644
3616
|
}
|
|
3645
3617
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, decorators: [{
|
|
3646
3618
|
type: Component,
|
|
@@ -3675,6 +3647,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
3675
3647
|
type: Input
|
|
3676
3648
|
}], buttonLabel: [{
|
|
3677
3649
|
type: Input
|
|
3650
|
+
}], firstValue: [{
|
|
3651
|
+
type: Output
|
|
3678
3652
|
}] } });
|
|
3679
3653
|
|
|
3680
3654
|
class LineListModule {
|