@iapps/ng-dhis2-ui 1.1.22 → 1.1.26
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 +14 -19
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/lib/modules/form/utils/field-type.util.d.ts +1 -1
- package/lib/modules/form/utils/field.util.d.ts +1 -1
- package/lib/modules/line-list/containers/line-list.component.d.ts +1 -2
- package/package.json +1 -1
|
@@ -2043,7 +2043,7 @@ const FixedPeriodFilter = ({ allowedPeriodTypes, excludedPeriodTypes, currentPer
|
|
|
2043
2043
|
React__default.createElement("div", { className: "leftSection" },
|
|
2044
2044
|
React__default.createElement(SingleSelectField, { label: i18n.t('Period type'), onChange: ({ selected }) => onSelectPeriodType(selected), dense: true, selected: currentPeriodType, disabled: onlyAllowedTypeIsSelected, className: "filterElement", dataTest: `${dataTest}-period-type` }, (allowedPeriodTypes
|
|
2045
2045
|
? getFixedPeriodsOptions().filter((option) => allowedPeriodTypes.some((type) => type === option.id))
|
|
2046
|
-
: filterPeriodTypesById(getFixedPeriodsOptions(), excludedPeriodTypes)).map((option) => (React__default.createElement(SingleSelectOption, { key: option.id, value: option.id, label: option.name, dataTest: `${dataTest}-period-type-option-${option.id}` }))))),
|
|
2046
|
+
: filterPeriodTypesById(getFixedPeriodsOptions(), excludedPeriodTypes)).map((option) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || option.id, value: crypto.randomUUID() || option.id, label: option.name, dataTest: `${dataTest}-period-type-option-${option.id}` }))))),
|
|
2047
2047
|
React__default.createElement("div", { className: "rightSection" },
|
|
2048
2048
|
React__default.createElement(InputField$1, { label: i18n.t('Year'), className: "filterElement", type: "number", placeholder: i18n.t('Select year'), value: currentYear, onChange: ({ value }) => onSelectYear(value), dense: true, dataTest: `${dataTest}-year` })),
|
|
2049
2049
|
React__default.createElement("style", { jsx: true }, `
|
|
@@ -2074,7 +2074,7 @@ FixedPeriodFilter.propTypes = {
|
|
|
2074
2074
|
};
|
|
2075
2075
|
|
|
2076
2076
|
const RelativePeriodFilter = ({ currentFilter, onSelectFilter, dataTest, excludedPeriodTypes, }) => (React__default.createElement("div", { className: "leftSection" },
|
|
2077
|
-
React__default.createElement(SingleSelectField, { label: i18n.t('Period type'), onChange: ({ selected }) => onSelectFilter(selected), dense: true, selected: currentFilter, className: "filterElement", dataTest: dataTest }, filterPeriodTypesById(getRelativePeriodsOptions(), excludedPeriodTypes).map((option) => (React__default.createElement(SingleSelectOption, { key: option.id, value: option.id, label: option.name, dataTest: `${dataTest}-option-${option.id}` })))),
|
|
2077
|
+
React__default.createElement(SingleSelectField, { label: i18n.t('Period type'), onChange: ({ selected }) => onSelectFilter(selected), dense: true, selected: currentFilter, className: "filterElement", dataTest: dataTest }, filterPeriodTypesById(getRelativePeriodsOptions(), excludedPeriodTypes).map((option) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || option.id, value: option.id, label: option.name, dataTest: `${dataTest}-option-${option.id}` })))),
|
|
2078
2078
|
React__default.createElement("style", { jsx: true }, `
|
|
2079
2079
|
.leftSection {
|
|
2080
2080
|
flex-grow: 1;
|
|
@@ -3142,8 +3142,10 @@ class LineListService {
|
|
|
3142
3142
|
const dateFilter = startDate && endDate ? `&programStartDate=${startDate}&programEndDate=${endDate}` : '';
|
|
3143
3143
|
const ouModeIdentifier = ouMode ? `&ouMode=${ouMode}` : ``;
|
|
3144
3144
|
return this.httpClient.get(`trackedEntityInstances.json?program=${programId}&ou=${orgUnit}${ouModeIdentifier}&page=${page}&pageSize=${pageSize}&fields=trackedEntityInstance,attributes[*,displayInList],enrollments[*]&totalPages=true&${filterParams}${dateFilter}`).pipe(map$1((response) => {
|
|
3145
|
-
|
|
3146
|
-
|
|
3145
|
+
response.trackedEntityInstances.forEach((tei) => {
|
|
3146
|
+
// Filter attributes to only include those with displayInList=true
|
|
3147
|
+
tei.attributes = tei.attributes.filter((attr) => attr.displayInList);
|
|
3148
|
+
});
|
|
3147
3149
|
return response;
|
|
3148
3150
|
}));
|
|
3149
3151
|
}
|
|
@@ -3311,7 +3313,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3311
3313
|
this.actionSelected = new EventEmitter();
|
|
3312
3314
|
this.reactStateUpdaters = null;
|
|
3313
3315
|
this.approvalSelected = new EventEmitter();
|
|
3314
|
-
this.isButtonLoading = false;
|
|
3315
3316
|
this.setReactStateUpdaters = (updaters) => {
|
|
3316
3317
|
this.reactStateUpdaters = updaters;
|
|
3317
3318
|
};
|
|
@@ -3333,7 +3334,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3333
3334
|
const [startDateState, setStartDateState] = useState(this.startDate);
|
|
3334
3335
|
const [endDateState, setEndDateState] = useState(this.endDate);
|
|
3335
3336
|
const [loading, setLoading] = useState(false);
|
|
3336
|
-
const [isButtonLoading, setIsButtonLoading] = useState(this.isButtonLoading);
|
|
3337
3337
|
// Store updaters in refs for Angular to access
|
|
3338
3338
|
const updateRefs = useRef({
|
|
3339
3339
|
setProgramIdState,
|
|
@@ -3342,7 +3342,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3342
3342
|
setAttributeFiltersState,
|
|
3343
3343
|
setStartDateState,
|
|
3344
3344
|
setEndDateState,
|
|
3345
|
-
setIsButtonLoading,
|
|
3346
3345
|
});
|
|
3347
3346
|
useEffect(() => {
|
|
3348
3347
|
this.setReactStateUpdaters?.(updateRefs.current);
|
|
@@ -3453,7 +3452,8 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3453
3452
|
gap: 8,
|
|
3454
3453
|
padding: 8,
|
|
3455
3454
|
marginBottom: 16,
|
|
3456
|
-
} },
|
|
3455
|
+
} },
|
|
3456
|
+
React__default.createElement(Button$1, { className: "bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600", onClick: handleApprovalClick, primary: true }, "Approval"))),
|
|
3457
3457
|
loading ? (React__default.createElement("div", { style: {
|
|
3458
3458
|
display: 'flex',
|
|
3459
3459
|
alignItems: 'center',
|
|
@@ -3501,9 +3501,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3501
3501
|
if (changes['endDate']) {
|
|
3502
3502
|
this.reactStateUpdaters.setEndDateState(this.endDate);
|
|
3503
3503
|
}
|
|
3504
|
-
if (changes['isButtonLoading']) {
|
|
3505
|
-
this.reactStateUpdaters.setIsButtonLoading(this.isButtonLoading);
|
|
3506
|
-
}
|
|
3507
3504
|
}
|
|
3508
3505
|
}
|
|
3509
3506
|
async ngAfterViewInit() {
|
|
@@ -3514,7 +3511,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
3514
3511
|
this.render();
|
|
3515
3512
|
}
|
|
3516
3513
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3517
|
-
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", showApprovalButton: "showApprovalButton"
|
|
3514
|
+
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", showApprovalButton: "showApprovalButton" }, 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"] }); }
|
|
3518
3515
|
}
|
|
3519
3516
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, decorators: [{
|
|
3520
3517
|
type: Component,
|
|
@@ -3543,8 +3540,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
3543
3540
|
type: Output
|
|
3544
3541
|
}], approvalSelected: [{
|
|
3545
3542
|
type: Output
|
|
3546
|
-
}], isButtonLoading: [{
|
|
3547
|
-
type: Input
|
|
3548
3543
|
}] } });
|
|
3549
3544
|
|
|
3550
3545
|
class LineListModule {
|
|
@@ -4672,7 +4667,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
4672
4667
|
if (!(changes['field'] || {})?.firstChange) {
|
|
4673
4668
|
this.InputField = this.#getInputField();
|
|
4674
4669
|
this.component = this.#getInputField();
|
|
4675
|
-
this.render();
|
|
4670
|
+
// this.render();
|
|
4676
4671
|
}
|
|
4677
4672
|
}
|
|
4678
4673
|
#getInputField() {
|
|
@@ -4813,7 +4808,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
4813
4808
|
});
|
|
4814
4809
|
setValue(event.selected);
|
|
4815
4810
|
setTouched(true);
|
|
4816
|
-
} }, (this.field().options || []).map((option) => (React__default.createElement(SingleSelectOption, { key: option.key, label: option.label, value: option.value })))));
|
|
4811
|
+
} }, (this.field().options || []).map((option) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || option.key, label: option.label, value: option.value })))));
|
|
4817
4812
|
case 'multi-dropdown':
|
|
4818
4813
|
return (React__default.createElement(MultiSelectField, { clearText: "Clear", clearable: true, empty: "No data found", filterable: (this.field().options || []).length > 5, filterPlaceholder: "Type to filter options", error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, label: this.label(), name: this.field().id, required: this.field().required, loadingText: "Loading options", noMatchText: "No options found", onChange: (event) => {
|
|
4819
4814
|
const selectedValue = (event.selected || []).join(',');
|
|
@@ -4827,7 +4822,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
4827
4822
|
});
|
|
4828
4823
|
setValue(selectedValue);
|
|
4829
4824
|
setTouched(true);
|
|
4830
|
-
}, selected: arrayValue }, (this.field().options || []).map((option) => (React__default.createElement(MultiSelectOption, { key: option.key, label: option.label, value: option.value })))));
|
|
4825
|
+
}, selected: arrayValue }, (this.field().options || []).map((option) => (React__default.createElement(MultiSelectOption, { key: crypto.randomUUID() || option.key, label: option.label, value: option.value })))));
|
|
4831
4826
|
case 'file':
|
|
4832
4827
|
return (React__default.createElement(FileInputField, { accept: "*", buttonLabel: "Upload a file", label: this.label(), name: this.field().id, files: this.uploadedFiles, onChange: (event) => {
|
|
4833
4828
|
this.uploadedFiles.push((event?.files || [])[0]);
|
|
@@ -5694,12 +5689,12 @@ class SelectionFiltersComponent extends ReactWrapperModule {
|
|
|
5694
5689
|
display: 'grid',
|
|
5695
5690
|
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
5696
5691
|
gap: '16px',
|
|
5697
|
-
} }, filters.programAttributesFilters.map((filter, index) => (React__default.createElement("div", { key: index, style: { gridColumn: getAttributeColumnSpan(index) } }, filter.hasOptions && filter.options.length > 0 ? (React__default.createElement(SingleSelectField, { className: "single-select", label: filter.name || 'Select Option', type: filter.valueType, selected: filter.value, onChange: (event) => handleAttributeChange(index, event.selected) }, filter.options.map((option, i) => (React__default.createElement(SingleSelectOption, { key: i, label: option.name, value: option.code }))))) : (React__default.createElement(InputField$1, { className: "input-field", label: filter.name || 'Program name', type: filter.valueType, value: filter.value, onChange: (event) => handleAttributeChange(index, event.value) })))))),
|
|
5692
|
+
} }, filters.programAttributesFilters.map((filter, index) => (React__default.createElement("div", { key: index, style: { gridColumn: getAttributeColumnSpan(index) } }, filter.hasOptions && filter.options.length > 0 ? (React__default.createElement(SingleSelectField, { className: "single-select", label: filter.name || 'Select Option', type: filter.valueType, selected: filter.value, onChange: (event) => handleAttributeChange(index, event.selected) }, filter.options.map((option, i) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || i, label: option.name, value: option.code }))))) : (React__default.createElement(InputField$1, { className: "input-field", label: filter.name || 'Program name', type: filter.valueType, value: filter.value, onChange: (event) => handleAttributeChange(index, event.value) })))))),
|
|
5698
5693
|
React__default.createElement("div", { style: {
|
|
5699
5694
|
display: 'grid',
|
|
5700
5695
|
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
5701
5696
|
gap: '16px',
|
|
5702
|
-
} }, filters.programStageDataElementFilters.map((filter, index) => (React__default.createElement("div", { key: index, style: { gridColumn: getDataElementColumnSpan(index) } }, filter.hasOptions && filter.options.length > 0 ? (React__default.createElement(SingleSelectField, { className: "single-select", label: filter.name || 'Aggregation type', type: filter.valueType, selected: filter.value, onChange: (event) => handleDataElementChange(index, event.selected) }, filter.options.map((option, i) => (React__default.createElement(SingleSelectOption, { key: i, label: option.name, value: option.code }))))) : (React__default.createElement(InputField$1, { className: "input-field", type: filter.valueType, label: filter.name || 'Program name', value: filter.value, onChange: (event) => handleDataElementChange(index, event.value) })))))),
|
|
5697
|
+
} }, filters.programStageDataElementFilters.map((filter, index) => (React__default.createElement("div", { key: index, style: { gridColumn: getDataElementColumnSpan(index) } }, filter.hasOptions && filter.options.length > 0 ? (React__default.createElement(SingleSelectField, { className: "single-select", label: filter.name || 'Aggregation type', type: filter.valueType, selected: filter.value, onChange: (event) => handleDataElementChange(index, event.selected) }, filter.options.map((option, i) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || i, label: option.name, value: option.code }))))) : (React__default.createElement(InputField$1, { className: "input-field", type: filter.valueType, label: filter.name || 'Program name', value: filter.value, onChange: (event) => handleDataElementChange(index, event.value) })))))),
|
|
5703
5698
|
React__default.createElement("div", { style: { textAlign: 'right', marginTop: '16px' } },
|
|
5704
5699
|
React__default.createElement(Button$1, { onClick: handleSearch }, "Search"))));
|
|
5705
5700
|
};
|