@iapps/ng-dhis2-ui 1.2.102 → 1.2.103

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.
@@ -3470,6 +3470,9 @@ const FilterToolbar = ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setO
3470
3470
  }, style: { display: 'inline-flex', alignItems: 'center' } },
3471
3471
  React__default.createElement(ClearIcon, { className: "my-icon-class" })))));
3472
3472
  }
3473
+ {
3474
+ /* TODO: I HAVE DUPLICATED DROPDOWN AND CLEAR ICON IN MULTIPLE PLACES REQUIRED TO CREATE A REUSABLE DROPDOWN COMPONENT WITH THE CLEAR ICON TO AVOID DUPLICATION */
3475
+ }
3473
3476
  if (options && options.options.length > 0) {
3474
3477
  return (React__default.createElement(DropdownButton, { name: "customDropdown", open: openDropdownKey === key, onClick: () => {
3475
3478
  setOpenDropdownKey(openDropdownKey === key ? null : key);
@@ -3621,6 +3624,49 @@ function formatDateForDisplay(dateString) {
3621
3624
  return 'dd-mm-yyyy';
3622
3625
  }
3623
3626
  }
3627
+ // case 'date':
3628
+ // case 'date-time':
3629
+ // return (
3630
+ // // <InputField
3631
+ // // error={hasError}
3632
+ // // validationText={validationError}
3633
+ // // type={this.field().type as any}
3634
+ // // inputWidth={inputWidth}
3635
+ // // required={this.field().required}
3636
+ // // name={this.field().id}
3637
+ // // label={this.label()}
3638
+ // // min={this.field().min?.toString()}
3639
+ // // max={this.field().max?.toString()}
3640
+ // // placeholder={this.placeholder()}
3641
+ // // value={value}
3642
+ // // readOnly={disabled}
3643
+ // // onChange={(event: any) => {
3644
+ // // onValueChange(event.value);
3645
+ // // }}
3646
+ // // onBlur={() => {
3647
+ // // checkValueUniqueness();
3648
+ // // }}
3649
+ // // />
3650
+ // <CalendarInput
3651
+ // label={this.label()}
3652
+ // error={hasError}
3653
+ // validationText={validationError}
3654
+ // date={value}
3655
+ // readOnly={disabled}
3656
+ // min={this.field().min?.toString()}
3657
+ // max={this.field().max?.toString()}
3658
+ // placeholder={this.placeholder()}
3659
+ // onDateSelect={(selectedDate: any) => {
3660
+ // onValueChange(selectedDate.calendarDateString);
3661
+ // }}
3662
+ // disabled={disabled}
3663
+ // inputWidth={inputWidth}
3664
+ // required={this.field().required}
3665
+ // calendar="gregory"
3666
+ // locale="en-GB"
3667
+ // timeZone="Africa/Dar_es_Salaam"
3668
+ // />
3669
+ // );
3624
3670
 
3625
3671
  const TableHeader = ({ columns, allSelected, onSelectAll, selectable, showActionButtons, }) => {
3626
3672
  const handleCheckboxChange = () => {
@@ -3976,7 +4022,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
3976
4022
  const attributeColumns = metaData.displayInListTrackedEntityAttributes
3977
4023
  .sort((a, b) => a.sortOrder - b.sortOrder)
3978
4024
  .map((trackedEntityAttribute) => ({
3979
- label: trackedEntityAttribute.formName ?? trackedEntityAttribute.name,
4025
+ label: trackedEntityAttribute.name ?? trackedEntityAttribute.formName,
3980
4026
  key: trackedEntityAttribute.id,
3981
4027
  }));
3982
4028
  const tableSearcheableDataElements = metaData
@@ -3985,7 +4031,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
3985
4031
  .programStageDataElements.filter((psde) => psde.displayInReports)
3986
4032
  .sort((a, b) => a.sortOrder - b.sortOrder)
3987
4033
  .map((psde) => ({
3988
- label: psde.dataElement.formName || psde.dataElement.name,
4034
+ label: psde.dataElement.name || psde.dataElement.formName || 'default',
3989
4035
  key: psde.dataElement.id,
3990
4036
  valueType: psde.dataElement.valueType,
3991
4037
  options: psde.dataElement.optionSet,
@@ -3998,7 +4044,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
3998
4044
  .programStageDataElements.filter((psde) => psde.displayInReports)
3999
4045
  .sort((a, b) => a.sortOrder - b.sortOrder) // Sorts data elements within stage
4000
4046
  .map((psde) => ({
4001
- label: psde.dataElement.formName || psde.dataElement.name,
4047
+ label: psde.dataElement.name || psde.dataElement.formName || 'default',
4002
4048
  key: psde.dataElement.id,
4003
4049
  })));
4004
4050
  const dataElementOptions = metaData.displayInListDataElements.map((element) => ({
@@ -8195,8 +8241,17 @@ class ProgramEntryFormModule {
8195
8241
  this.FormLoader = () => {
8196
8242
  return React__default.createElement(CircularLoader$1, { small: true });
8197
8243
  };
8244
+ // dataId = computed(() => {
8245
+ // return this.instance()?.trackedEntity || this.instance()?.event;
8246
+ // });
8198
8247
  this.dataId = computed(() => {
8199
- return this.instance()?.trackedEntity || this.instance()?.event;
8248
+ if (this.config().formType === 'EVENT') {
8249
+ return this.instance()?.event;
8250
+ }
8251
+ if (this.config().formType === 'TRACKER') {
8252
+ return this.instance()?.trackedEntity;
8253
+ }
8254
+ return undefined;
8200
8255
  });
8201
8256
  this.FormActionButtons = computed(() => {
8202
8257
  if (this.config().hideActionButtons) {