@iapps/ng-dhis2-ui 1.2.155 → 1.2.156

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.
@@ -4300,7 +4300,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
4300
4300
  type: Injectable
4301
4301
  }] });
4302
4302
 
4303
- const getTrackedEntityTableData = (response, programId, pager, metaData, searcheableDataElements) => {
4303
+ const getTrackedEntityTableData = (response, programId, pager, metaData, searcheableDataElements, customDisplayInReportsIds) => {
4304
4304
  const teisRaw = response.data
4305
4305
  .trackedEntityInstances;
4306
4306
  const teis = Array.isArray(teisRaw)
@@ -4315,10 +4315,13 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
4315
4315
  label: trackedEntityAttribute.name ?? trackedEntityAttribute.formName,
4316
4316
  key: trackedEntityAttribute.id,
4317
4317
  }));
4318
+ const shouldIncludeDataElement = (psde) => customDisplayInReportsIds !== undefined
4319
+ ? customDisplayInReportsIds.includes(psde.dataElement.id)
4320
+ : psde.displayInReports;
4318
4321
  const tableSearcheableDataElements = metaData
4319
4322
  .programStages.sort((a, b) => a.sortOrder - b.sortOrder)
4320
4323
  .flatMap((stage) => stage
4321
- .programStageDataElements.filter((psde) => psde.displayInReports)
4324
+ .programStageDataElements.filter(shouldIncludeDataElement)
4322
4325
  .sort((a, b) => a.sortOrder - b.sortOrder)
4323
4326
  .map((psde) => ({
4324
4327
  label: psde.dataElement.name || psde.dataElement.formName || 'default',
@@ -4331,19 +4334,32 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
4331
4334
  const dataElementColumns = metaData
4332
4335
  .programStages.sort((a, b) => a.sortOrder - b.sortOrder)
4333
4336
  .flatMap((stage) => stage
4334
- .programStageDataElements.filter((psde) => psde.displayInReports)
4337
+ .programStageDataElements.filter(shouldIncludeDataElement)
4335
4338
  .sort((a, b) => a.sortOrder - b.sortOrder)
4336
4339
  .map((psde) => ({
4337
4340
  label: psde.dataElement.name || psde.dataElement.formName || 'default',
4338
4341
  key: psde.dataElement.id,
4339
4342
  })));
4340
- const dataElementOptions = metaData.displayInListDataElements.map((element) => ({
4341
- id: element.id,
4342
- options: element.optionSet?.options.map((opt) => ({
4343
- name: opt.name,
4344
- code: opt.code,
4345
- color: opt.style?.color,
4346
- })),
4343
+ // const dataElementOptions = metaData.displayInListDataElements.map(
4344
+ // (element) => ({
4345
+ // id: element.id,
4346
+ // options: element.optionSet?.options.map((opt) => ({
4347
+ // name: opt.name,
4348
+ // code: opt.code,
4349
+ // color: opt.style?.color,
4350
+ // })),
4351
+ // })
4352
+ // );
4353
+ const dataElementOptions = (metaData.programStages ?? [])
4354
+ .flatMap((stage) => stage.programStageDataElements ?? [])
4355
+ .filter((psde) => psde.dataElement && shouldIncludeDataElement(psde))
4356
+ .map(({ dataElement }) => ({
4357
+ id: dataElement.id,
4358
+ options: dataElement.optionSet?.options?.map((option) => ({
4359
+ name: option.name,
4360
+ code: option.code,
4361
+ color: option.style?.color,
4362
+ })) ?? [],
4347
4363
  }));
4348
4364
  const tableColumns = [
4349
4365
  {
@@ -4851,7 +4867,7 @@ class LineListTableComponent extends ReactWrapperModule {
4851
4867
  pager: pager,
4852
4868
  orgUnitsMap: fetchedOrgUnits,
4853
4869
  };
4854
- const { columns, data, filteredEntityColumns, orgUnitLabel } = getTrackedEntityTableData({ data: trackedEntityResponse }, this.programId, pager, metaData, this.searcheableDataElements);
4870
+ const { columns, data, filteredEntityColumns, orgUnitLabel } = getTrackedEntityTableData({ data: trackedEntityResponse }, this.programId, pager, metaData, this.searcheableDataElements, this.customDisplayInReportsIds);
4855
4871
  setFilteredColumns((prev) => filteredEntityColumns.length > 0 ? filteredEntityColumns : prev);
4856
4872
  let updatedFilterableColumnIds;
4857
4873
  if (Array.isArray(this.filterableColumnIds) &&
@@ -5220,7 +5236,7 @@ class LineListTableComponent extends ReactWrapperModule {
5220
5236
  this.render();
5221
5237
  }
5222
5238
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LineListTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5223
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { triggerToken: "triggerToken", programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", actionOptionOrientation: "actionOptionOrientation", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", dataQueryFilters: "dataQueryFilters", lineListRowActionFilterConfig: "lineListRowActionFilterConfig", hydrateForActionFiltering: "hydrateForActionFiltering", ouMode: "ouMode", isButtonLoading: "isButtonLoading", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible", allowRowsSelection: "allowRowsSelection", enrollmentStatus: "enrollmentStatus", filterableColumnIds: "filterableColumnIds", triggerRefetch: "triggerRefetch", eventStatus: "eventStatus", showActionButtons: "showActionButtons", showEnrollmentDates: "showEnrollmentDates", showDownloadButton: "showDownloadButton", searcheableDataElements: "searcheableDataElements" }, outputs: { actionSelected: "actionSelected", rowsSelected: "rowsSelected" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-input div{margin:0!important}::ng-deep .custom-input label{font-size:12px;padding-right:0}::ng-deep .custom-input input{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-input input:focus{border:none!important;box-shadow:none!important}::ng-deep .custom-input [data-test=calendar-clear-button]{background-color:#f2f2f2!important;color:#870808!important;border-radius:6px!important;padding:4px 10px!important;font-size:0!important}::ng-deep .custom-input [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:14px;color:#870808}::ng-deep .custom-input [data-test=calendar-clear-button]:hover{background-color:#ddd}::ng-deep .calendar-input-wrapper{position:relative}::ng-deep .calendar-input-wrapper .custom-input{position:relative;width:100%;display:flex;align-items:center}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]{right:8px;bottom:14px;margin:auto;display:flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:0!important;background-color:#a0adba!important;border-radius:50%;padding:2px;cursor:pointer}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:10px;color:#f0f0f0}::ng-deep .calendar-input-wrapper input{padding-right:40px!important;height:40px;line-height:40px;box-sizing:border-box}::ng-deep .custom-input label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}::ng-deep .custom-select-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-select-input div{margin:0!important}::ng-deep .custom-select-input [data-test=dhis2-uiwidgets-singleselectfield-label]{font-size:12px;color:gray!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]:focus-within{box-shadow:none!important}::ng-deep .custom-select-input input:focus{border:none!important;box-shadow:none!important}\n"] }); }
5239
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.3", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { triggerToken: "triggerToken", programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", actionOptionOrientation: "actionOptionOrientation", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", dataQueryFilters: "dataQueryFilters", lineListRowActionFilterConfig: "lineListRowActionFilterConfig", hydrateForActionFiltering: "hydrateForActionFiltering", ouMode: "ouMode", isButtonLoading: "isButtonLoading", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible", allowRowsSelection: "allowRowsSelection", enrollmentStatus: "enrollmentStatus", filterableColumnIds: "filterableColumnIds", triggerRefetch: "triggerRefetch", eventStatus: "eventStatus", showActionButtons: "showActionButtons", showEnrollmentDates: "showEnrollmentDates", showDownloadButton: "showDownloadButton", searcheableDataElements: "searcheableDataElements", customDisplayInReportsIds: "customDisplayInReportsIds" }, outputs: { actionSelected: "actionSelected", rowsSelected: "rowsSelected" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-input div{margin:0!important}::ng-deep .custom-input label{font-size:12px;padding-right:0}::ng-deep .custom-input input{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-input input:focus{border:none!important;box-shadow:none!important}::ng-deep .custom-input [data-test=calendar-clear-button]{background-color:#f2f2f2!important;color:#870808!important;border-radius:6px!important;padding:4px 10px!important;font-size:0!important}::ng-deep .custom-input [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:14px;color:#870808}::ng-deep .custom-input [data-test=calendar-clear-button]:hover{background-color:#ddd}::ng-deep .calendar-input-wrapper{position:relative}::ng-deep .calendar-input-wrapper .custom-input{position:relative;width:100%;display:flex;align-items:center}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]{right:8px;bottom:14px;margin:auto;display:flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:0!important;background-color:#a0adba!important;border-radius:50%;padding:2px;cursor:pointer}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:10px;color:#f0f0f0}::ng-deep .calendar-input-wrapper input{padding-right:40px!important;height:40px;line-height:40px;box-sizing:border-box}::ng-deep .custom-input label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}::ng-deep .custom-select-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-select-input div{margin:0!important}::ng-deep .custom-select-input [data-test=dhis2-uiwidgets-singleselectfield-label]{font-size:12px;color:gray!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]:focus-within{box-shadow:none!important}::ng-deep .custom-select-input input:focus{border:none!important;box-shadow:none!important}\n"] }); }
5224
5240
  }
5225
5241
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: LineListTableComponent, decorators: [{
5226
5242
  type: Component,
@@ -5285,6 +5301,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
5285
5301
  type: Input
5286
5302
  }], searcheableDataElements: [{
5287
5303
  type: Input
5304
+ }], customDisplayInReportsIds: [{
5305
+ type: Input
5288
5306
  }] } });
5289
5307
 
5290
5308
  class LineListModule {